This commit was manufactured by cvs2svn to create tag
'before-commons'.

git-svn-id: https://svn.apache.org/repos/asf/xalan/java/tags/before-commons@335488 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/KEYS b/KEYS
deleted file mode 100644
index 95eef46..0000000
--- a/KEYS
+++ /dev/null
@@ -1,132 +0,0 @@
-This file contains the PGP keys of various Xalan developers.
-Please don't use them for email unless you have to. Their main
-purpose is code signing.
-
-Xalan users: pgp < KEYS
-Xalan developers: pgp -kxa <your name> and append it to this file.
-
-
-Type Bits/KeyID    Date       User ID
-pub  1024/30A21D55 1999/11/04 Shane Curcuru <shane_curcuru@lotus.com>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: PGP Personal Privacy 6.5.3
-
-mQGiBDghjNIRBADXB4UY4YfZ2DmbSushlzPZCkY00iDPUB+GkW6FQhgnGCLZovgy
-FhCnCsKdN1xyHFq/Ns3PV3HPrMGxFKgVOfRuxREbF8CoXAa/u0qR1WoAm+rlyC9l
-OVsHdXxyOpZ8e4SPGne8LQYZwr2q+LsHiXOZktkaBo8ua8F4EJYkBMFhZQCg/4Iw
-jXmfpt661Essmf8d05cMdAcEAL0r+PrFxCmrU8Ok+r74+eqyclxVbiDbOf7Uef6N
-fEJmC5ihX7p8k8eEf2XepeAo6N0gdOxYVXVwcoRCmqPy7SSg1jnXqKOnA87ylv16
-lOiJ5WUkiVX96WOWEsbbYKuggmWeDL+6iFc9hp6oEP2sf/geC8AEAEHTPfneJzpo
-3z28A/9iX41r4K0iRx5eIJu2KUrjdpPxhn0JPe9dz2XzWZIciNeki+ThrcarEj9h
-lmfvcGLifXbQfXuFid3btMsBRI8dqAbbXmyfvCYYSHDOkXEmoMW66AWfeF4hgfHF
-SA5lmcpH4mtHU69uC0+cvYlRROP+HaeOepYbriA+9A9Qq4MAW7QnU2hhbmUgQ3Vy
-Y3VydSA8c2hhbmVfY3VyY3VydUBsb3R1cy5jb20+iQBOBBARAgAOBQI4IYzSBAsD
-AgECGQEACgkQMuwXWTCiHVXQIQCg1Q1MKkWygIsDGAOhiPaM09pTdlUAniTeCkoO
-I0+2IgD/NtqnGDaSvNDniQBGBBARAgAGBQI4qZk/AAoJEFHrPvFXdlryVbIAoO/e
-gti1esgRI6GErIhICg3IoctfAKDlpw6NWq/WTxk1Aa0pN/1b6fmD5LkCDQQ4IYzS
-EAgA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV89AHxstD
-qZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50T8X8dryD
-xUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknbzSC0neSR
-BzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdXQ6MdGGze
-MyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbTCD1mpF1B
-n5x8vYlLIhkmuquiXsNV6TILOwACAggAzu/QObuykLGwPLCoSQEKfeNSGPOr7wK2
-XSp8c8DS1B2jrVL4oH+PYb6wVhcNd3+Xt4+P/BfllemRU80GD6t/RHoTEZhIhp/3
-8erBLJfLPqFDYdjKf30EMMjFWIhecg9QnZSXU2f7EJ24L+/vnotjAz6hZfJvjb1b
-1tX3PQ1W2e+lTFhSz1RYSKx4msEcez3Z0wValNqWlet3t78cCZRT4fPOkyM4C7Fb
-tK6csvFUXkIfu3qgx4aVk8HUIwXkHZD2W7XiFSPhMtgcPeUAb3AIeYJs/iqP4H4N
-4oJ8B6tXxmpDm3P85PhC4gJOFUThnZKGkLtWwdUago8XSKB5VUA/UIkARgQYEQIA
-BgUCOCGM0gAKCRAy7BdZMKIdVXS+AKDhyJwx048+c7ATINSGf6IxiXQyYQCg46pJ
-/fc0HVWUvHfjioDRaLQUIv8=
-=ut/M
------END PGP PUBLIC KEY BLOCK-----
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: PGP 6.5.8
-
-mQGiBDnjTUMRBADGzi7y1XiTty/HZ1QhRQxMkyf7JD/E5dGXCVLRoSQV9/hdKPtF
-OGzjZQt6DssPnisgrW6hSLEs8GrZKHCZE6z8h5Yekg+WJTs3K0LNJ3X/tStVe/fU
-DarLM7u0qwtcsaISWFMRoy1xbrxBkpFBeNkD+FRUk8sXTVXoOGvm3Fw/8wCg/+pg
-Y7XD6ZIA0m/CxrxR+xTBri8D/Rk4/5rzsT42AImJwAweJidzlmmvWcDGjZolDxrH
-TlVpIXFjGFJBj9tg1Xz+3/w9zKyk900gcwlHU7uz28xPylishgd8DyAb/enSXsEy
-NC1EagypAbMpEhTAdBaUNPb6t8yOX3dHUki5yuZ+PryOyKWTaiHyhHLwJ5vZi9xm
-o+/ZBACqjUqAL27JOC1qw1zrWCQQzEJIeIIdGFEGoMBiFC425vh/1dJA1LUICHSZ
-bZvg7VlvAMErnZb/IcVx4LX4R8Uergh0E/4Xi6krTYZvDuI4RmP5Jn/7IaK2c27I
-lCx7I0hj4CQIWVIEVCDAGjJk9E38VahJYHySHzjMdhXSjTbqW7QnTG90dXN4c2wg
-VGVhbSA8TG90dXN4c2xfVGVhbUBsb3R1cy5jb20+iQBOBBARAgAOBQI5401DBAsD
-AgECGQEACgkQGbnBi2RCw9yVZwCgjxC/ie5/GhPLZyQhMSQvJuDJP8kAn17UNfN/
-tRtFfcJDrNcC7P21ut+VuQINBDnjTUMQCAD2Qle3CH8IF3KiutapQvMF6PlTETlP
-tvFuuUs4INoBp1ajFOmPQFXz0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2
-Uk89PY3bzpnhV5JZzf24rnRPxfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVy
-OtQa8L9GAFgr5fSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPw
-pVsYjY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnI
-Byl6ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7AAICB/9g
-5aR6mWbvaZAwN/IFwIC9cd54cDAW6pvowo6/gkgLfwULI7iGR8jrHHs9rSu968fV
-3L7ys3pFLR93/22mJR1InTp+qQdUntcnh5fwbAd9Z8NoM2QEuY4c7cVjobazOgPf
-C6XZkS1C3tHcvUedzR8kmf1hiRtILWW2pF7A9JbJB3RHcuBut3cS3eME2+s+dCSl
-SugZKyVFuiDoKO59TD7OIn9dwipVhX7UgG0uLDlZzCd9dHLsrlr75LDxIZyiifDB
-1oa+xM5smFYEqux+3lf/UNGhpxcaGDJM09UUpOVv8yVz+FZQilZ7Bu0XKvnj1p91
-YFVAiQvQHijya+kMy6MCiQBGBBgRAgAGBQI5401DAAoJEBm5wYtkQsPcPlUAoNkm
-fMB0HL71h5QYfB/NRJupWsWUAKCi2UETq9cwA7QtuMyQ1cjvkA1mnQ==
-=lNZ2
------END PGP PUBLIC KEY BLOCK-----
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
-
-mQGiBDtiOuERBADWqtYvR/wqP9H99bmQ1GNpS8NL7YXmOUEdH9X/7KT3nrFBjacO
-XTJ2/rjnY1ItW6EwnenuFf0okgnf3ZgUai6Ajr4buxCMhpAzm2htOAaSnc3l/FZF
-mcdvpvKkpc4bf2qYC0j4RjKPvXExPdK3DbQnl7Pi5q0qvdaS0JUkYR5X/QCg/7fI
-uJKHVBqIveeAmZKpU8xYd60D/RvTll3dwVCWhs21a/AFFYKpA86A5jyq/yXwIeVr
-IKtKfxnvcjpmZAYIMddsBtVFjW/CyRm6KQZXRdWpXuLymP7+ppT2VlRLM3TqUxum
-4pASJdptk7fj3qzivyfaQ6/fAG3PyJcOe5hS7znLV2a0LX7PQBiPpUwqcjKQ2a2h
-LogQBACalpgAIdN1dfUbgOSm9gdsRb8wYIOKTFGpCWF17rMTMuSYTLAsm6mPdxrl
-FHn2wlROwiDFnzhEDFbPOHdC5XMD+tYdrWJaffJZKW7ZItOEz6OIh7gnmKpBcDsy
-WoJ9J7QRUiETHX3AbKOynSdk5kcgDWymCjSP6rE0M1PAiMVg1LQhU2NvdHQgQm9h
-ZyA8c2NvdHRfYm9hZ0Bsb3R1cy5jb20+iQBOBBARAgAOBQI7YjrhBAsDAgECGQEA
-CgkQQkPbOcGiXuYuqQCgxnuxkA2wfXf/qrhK9FDdhtG67MQAninm2rZVcTHqorBV
-KqUHMeC4VHaEuQINBDtiOuEQCAD2Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4
-INoBp1ajFOmPQFXz0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3b
-zpnhV5JZzf24rnRPxfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9G
-AFgr5fSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67
-VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM
-2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7AAICCADj1YHJzpg7
-J0z0zRmpzhmRfDZtzBZB+bjqXh1lkcJO9P6tqwEe9Jnhm+yMWKtfETeiNxyK7C5f
-qTATo9USqB2+VTfEr0Y+UivUcITB1UvChj02iPj7zhrW6A7ki5UHYzcK6y29Mw6K
-J39nKn7FPaxcqFEzksAGenT+yq0/sSCAydX0GyW6scEkkmdVsUskD5tb83KqNzKK
-wXm/iIkQHS5FyzQ7U/WGAKRMcQf14UkGrfPoeRbMfNmlp/B+Jwpfbn3bH47hgowA
-gdGcKQSAQhUgy6GDpsxWFTVyjiZNEBI2UxkoB7d8HzMRvme6tw51d59MSNK7X/Go
-GtA9P+IqA3UTiQBGBBgRAgAGBQI7YjrhAAoJEEJD2znBol7mw+MAn3pbgcaYV+KZ
-TLJszssOCpQLvJwpAKCOBhKSHNUJR8OXI4VhY2Arvmm33g==
-=genn
------END PGP PUBLIC KEY BLOCK-----
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: PGPfreeware 6.5.1 for non-commercial use <http://www.pgp.com>
-
-mQGiBDuOlFsRBADT2HtC2QiEuPHzAk6Oa95nupm5zPFdtUasGWnbNhj37JNjhNFA
-/iCAvloRHMG8pR9ltlLZA4ae4X2BhPPqk+Us7zjYY/DkF/+G+cTMwPdoakc5JxL5
-ZRoVntAYRH5bcmv9MdSbY4YDf2iqk8gCaFPjP9EQcw3l38kTbfVvGKIjNwCg/7fU
-aAHIiOYSH+eLMpF4LtuqQP0D/3DhtpvrALSpiF/rw3VnL1rnxcb2IZs9IL1U6bFK
-p0IbqQORSVO2+dYSWo4/Vt7aWBFVPf/yfn/elncVmo12wAzWy7sBnqv8QzfYAvyY
-UuOh2WUD4K1ALOy7VHNM1mMyvH4dDIAoOuqXMQBwJx0A+/zUUaUZZLojsWl366pF
-GHmlBACa5zXSZ0mUf5ScZqZyda7/kUsV+B5tKjEKuOY1d/hnI5e/9Z11EQIfqqxs
-UckzCii+mg8zSpSgWHtsSu5N90teLum98bEuhYNT1tB6Pc7yNWEfq3c3SPw8ZstX
-u1kTQrsQeTiPhmfTQ+RyFiv+ZjonEsETNQK8n7CU+N2diiX5d7QjTXlyaWFtIE1p
-ZHkgPG15cmlhbV9taWR5QGxvdHVzLmNvbT6JAE4EEBECAA4FAjuOlFsECwMCAQIZ
-AQAKCRDeziK2wcV9LzZ/AKCYT4SNAFyQB+tA93nYjRo+NMc12wCaAw6zfJ7j7pI4
-e7L2OA0niSd8vHe5Ag0EO46UWxAIAPZCV7cIfwgXcqK61qlC8wXo+VMROU+28W65
-Szgg2gGnVqMU6Y9AVfPQB8bLQ6mUrfdMZIZJ+AyDvWXpF9Sh01D49Vlf3HZSTz09
-jdvOmeFXklnN/biudE/F/Ha8g8VHMGHOfMlm/xX5u/2RXscBqtNbno2gpXI61Brw
-v0YAWCvl9Ij9WE5J280gtJ3kkQc2azNsOA1FHQ98iLMcfFstjvbzySPAQ/ClWxiN
-jrtVjLhdONM0/XwXV0OjHRhs3jMhLLUq/zzhsSlAGBGNfISnCnLWhsQDGcgHKXrK
-lQzZlp+r0ApQmwJG0wg9ZqRdQZ+cfL2JSyIZJrqrol7DVekyCzsAAgIIANxxFjYo
-tUFTQpvEVHu1ZJhyZNySlR5EEDFemG/3AC67Mhv7ygHaeKP/oFzIixKmWllT7iKS
-SLjyS75rq7LpTzhasg2+suQPRnV8y2ATTLnlKWQVmZfVKY1RDiO4MWLik9laFTVY
-kEyFbKgF9w0LyeobsD7SU1J4D9IUOYmslq0m9rac0l+1ovNetdzIm3WSTB/gm/B2
-Nrz1z8urh4mf+RJwuO0to9fkSjE1KUcrE7nTiSD6A3eUaQC6S+Q5wEeiB3QN5f18
-giQuxna9Aet9J8tnMk+5iuh0QYKjNyXlyYD5B9ZF/4SXnQVDi6jAIC/Zzt/Yqzwo
-QX3NAtR8yY0WgASJAEYEGBECAAYFAjuOlFsACgkQ3s4itsHFfS+Q1QCg9ywbxv1n
-32glMqfIb9X7icWxYIEAoOGctrkwfA71hEB0S6zhT4UU3zx7
-=eDC+
------END PGP PUBLIC KEY BLOCK-----
diff --git a/License b/License
deleted file mode 100644
index 21156a6..0000000
--- a/License
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
diff --git a/bin/BCEL.jar b/bin/BCEL.jar
deleted file mode 100644
index 3346058..0000000
--- a/bin/BCEL.jar
+++ /dev/null
Binary files differ
diff --git a/bin/JLex.jar b/bin/JLex.jar
deleted file mode 100644
index 1c977f3..0000000
--- a/bin/JLex.jar
+++ /dev/null
Binary files differ
diff --git a/bin/ant.jar b/bin/ant.jar
deleted file mode 100644
index e4efab3..0000000
--- a/bin/ant.jar
+++ /dev/null
Binary files differ
diff --git a/bin/antRun b/bin/antRun
deleted file mode 100644
index f0a18f1..0000000
--- a/bin/antRun
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-# Args: DIR command
-cd "$1"
-CMD="$2"
-shift
-shift
-
-exec $CMD "$@"
diff --git a/bin/antRun.bat b/bin/antRun.bat
deleted file mode 100755
index 816cb60..0000000
--- a/bin/antRun.bat
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-
-# Change drive and directory to %1 (Win9X only for NT/2K use "cd /d")
-cd %1
-%1\
-set ANT_RUN_CMD=%2
-shift
-shift
-
-set PARAMS=
-:loop
-if ""%1 == "" goto runCommand
-set PARAMS=%PARAMS% %1
-shift
-goto loop
-
-:runCommand
-rem echo %ANT_RUN_CMD% %PARAMS%
-%ANT_RUN_CMD% %PARAMS%
-
diff --git a/bin/bsf.jar b/bin/bsf.jar
deleted file mode 100644
index 19036c1..0000000
--- a/bin/bsf.jar
+++ /dev/null
Binary files differ
diff --git a/bin/java_cup.jar b/bin/java_cup.jar
deleted file mode 100644
index 2f7b1f7..0000000
--- a/bin/java_cup.jar
+++ /dev/null
Binary files differ
diff --git a/bin/runtime.jar b/bin/runtime.jar
deleted file mode 100644
index 5041cdb..0000000
--- a/bin/runtime.jar
+++ /dev/null
Binary files differ
diff --git a/bin/stylebook-1.0-b3_xalan-2.jar b/bin/stylebook-1.0-b3_xalan-2.jar
deleted file mode 100644
index 2b640e9..0000000
--- a/bin/stylebook-1.0-b3_xalan-2.jar
+++ /dev/null
Binary files differ
diff --git a/bin/xalan2jdoc.jar b/bin/xalan2jdoc.jar
deleted file mode 100644
index 484b47b..0000000
--- a/bin/xalan2jdoc.jar
+++ /dev/null
Binary files differ
diff --git a/bin/xerces.jar b/bin/xerces.jar
deleted file mode 100644
index b5a5fde..0000000
--- a/bin/xerces.jar
+++ /dev/null
Binary files differ
diff --git a/bin/xml.jar b/bin/xml.jar
deleted file mode 100644
index 33f6129..0000000
--- a/bin/xml.jar
+++ /dev/null
Binary files differ
diff --git a/build.bat b/build.bat
deleted file mode 100755
index 1628658..0000000
--- a/build.bat
+++ /dev/null
@@ -1,60 +0,0 @@
-@echo off
-rem     build.bat: Build Xalan-J 2.x using Ant 
-rem     Usage: build [ant-options] [targets]
-rem     Setup:
-rem         - you should set JAVA_HOME
-rem         - you can set ANT_HOME if you use your own Ant install
-rem         - JAVA_OPTS is added to the java command line
-rem         - PARSER_JAR may be set to use alternate parser (default:bin\xerces.jar)
-echo.
-echo Xalan-J 2.x Build
-echo -------------
-
-if not "%JAVA_HOME%" == "" goto setant
-:noJavaHome
-rem Default command used to call java.exe; hopefully it's on the path here
-if "%_JAVACMD%" == "" set _JAVACMD=java
-echo.
-echo Warning: JAVA_HOME environment variable is not set.
-echo   If build fails because sun.* classes could not be found
-echo   you will need to set the JAVA_HOME environment variable
-echo   to the installation directory of java.
-echo.
-
-:setant
-rem Default command used to call java.exe or equivalent
-if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
-
-rem Default _ANT_HOME to Xalan's checked-in copy if not set
-set _ANT_HOME=%ANT_HOME%
-if "%_ANT_HOME%" == "" set _ANT_HOME=.
-
-rem Default locations of jars we depend on to run Ant on our build.xml file
-rem Set our local vars to all start with _underscore
-set _ANT_JAR=%ANT_JAR%
-if "%_ANT_JAR%" == "" set _ANT_JAR=bin\ant.jar
-set _PARSER_JAR=%PARSER_JAR%
-if "%_PARSER_JAR%" == "" set _PARSER_JAR=bin\xerces.jar
-
-rem Attempt to automatically add system classes to _CLASSPATH
-rem Use _underscore prefix to not conflict with user's settings
-set _CLASSPATH=%CLASSPATH%
-if exist "%JAVA_HOME%\lib\tools.jar" set _CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
-if exist "%JAVA_HOME%\lib\classes.zip" set _CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\classes.zip
-set _CLASSPATH=%_ANT_JAR%;%_PARSER_JAR%;%_CLASSPATH%
-
-REM echo "%_JAVACMD%" %JAVA_OPTS% -Dant.home="%ANT_HOME%" -classpath "%_CLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
-@echo on
-"%_JAVACMD%" -mx64m %JAVA_OPTS% -Dant.home="%ANT_HOME%" -classpath "%_CLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
-@echo off
-
-goto end
-
-:end
-rem Cleanup environment variables
-set _JAVACMD=
-set _CLASSPATH=
-set _ANT_HOME=
-set _ANT_JAR=
-set _PARSER_JAR=
-
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 4d89929..0000000
--- a/build.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#	Name:   build.sh Build Xalan-J 2.x using Ant
-#	Author: Shane Curcuru
-
-# Alternatively, you can just call "ant" 
-
-echo "Xalan-J 2.x Build"
-echo "-------------"
-
-_JAVACMD=$JAVA_HOME/bin/java
-if [ "$JAVA_HOME" = "" ] ; then
-    echo "Warning: JAVA_HOME environment variable is not set."
-    _JAVACMD=java
-fi
-
-# Default locations of jars we depend on to run Ant on our build.xml file
-if [ "$ANT_HOME" = "" ] ; then
-    ANT_HOME=.
-fi
-if [ "$ANT_JAR" = "" ] ; then
-    ANT_JAR=./bin/ant.jar
-fi
-if [ "$PARSER_JAR" = "" ] ; then
-    PARSER_JAR=./bin/xerces.jar
-fi
-
-# Use _underscore prefix to not conflict with user's settings
-# Default to UNIX-style pathing
-CLPATHSEP=:
-# if we're on a Windows box make it ;
-uname | grep WIN && CLPATHSEP=\;
-_CLASSPATH="$ANT_JAR${CLPATHSEP}$PARSER_JAR${CLPATHSEP}$CLASSPATH"
-
-# Attempt to automatically add system classes to _CLASSPATH
-if [ -f $JAVA_HOME/lib/tools.jar ] ; then
-  _CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/tools.jar
-fi
-
-if [ -f $JAVA_HOME/lib/classes.zip ] ; then
-  _CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/classes.zip
-fi
-
-
-echo "Starting Ant with targets: $@"
-echo "        ...with classpath: $_CLASSPATH"
-
-"$_JAVACMD" $JAVA_OPTS -Dant.home=$ANT_HOME -classpath "$_CLASSPATH" org.apache.tools.ant.Main $@
-
-
-
-
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 68da898..0000000
--- a/build.xml
+++ /dev/null
@@ -1,823 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- ===================================================================
-
-   Build file for Xalan-J 2.x - for use with the Jakarta Ant java build tool
-   
-Setup instructions: 
-   Before running an Ant build, you must
-   
-     - set the JAVA_HOME environment variable to the JDK root directory
-     - To build 'servlet' sample: Include Servlet SDK in your classpath
-     - To build docs/javadocs/xsltc: use JDK 1.2.x or higher
-   
-Build Instructions:   
-  To build, run
-    build.bat (win32) or build.sh (unix) [antoptions] [targets]
-  in the directory where this file is located.
-   
-  build -projecthelp  will show a list of supported targets.
-   
-  Developers: include a description="" attribute in all user-callable targets.
-        
-  If you build a target that depends on other targets, those other 
-  targets are *usually* created in the correct order; however a 
-  few of the larger targets like dist do not list all dependencies.
-
-Other Important Notes:
-- 'dist' produces a .tar file that works with GNU compatible tar 
-  programs, because that's what Ant does when it finds a path that's 
-  longer than 100 characters (like in our docs).  Sorry!
-  
-- External build maintainers: look for GUMP: comments; developers 
-  please use great caution when changing these lines!
-
-- Unusual build items: the docs and xsltc.compile targets leave 
-  cruft in the source areas; various clean targets get most of this.
-  
-Authors:
-  Shane Curcuru <shane_curcuru@lotus.com>
-  Don Leslie <donald_leslie@lotus.com>
-
-Copyright:
-  Copyright (c) 1999-2001 The Apache Software Foundation.
-   $Id$
-==================================================================== -->
-
-<project name="Xalan" default="jar" basedir=".">
-  <!-- =================================================================== -->
-  <!-- Defines paths/names of prerequisite jar files we compile against    -->
-  <!-- =================================================================== -->
-  <!-- We keep checked-in known-good .jars here -->
-  <property name="bin.dir" value="./bin"/>
-
-  <!-- GUMP: Allows external build systems to replace .jars Xalan 
-       is dependent on as needed.  Most have separate name and 
-       location properties to make it simpler to reset these values; 
-       please provide feedback if this is useful. 
-  -->
-  <property name="parser.jar.name" value="xerces.jar"/>
-  <property name="parser.jar" value="${bin.dir}/${parser.jar.name}"/>
-  <property name="bsf.jar.name" value="bsf.jar"/>
-  <property name="bsf.jar" value="${bin.dir}/${bsf.jar.name}"/>
-  <property name="stylebook.jar.name" value="stylebook-1.0-b3_xalan-2.jar"/>
-  <property name="stylebook.jar" value="${bin.dir}/${stylebook.jar.name}"/>
-  <property name="doclet.jar.name" value="xalan2jdoc.jar"/>
-  <property name="doclet.jar" value="${bin.dir}/${doclet.jar.name}"/>
-
-  <!-- GUMP: Currently 18-Apr-01 used only for xsltc.compile -->
-  <property name="BCEL.jar.name" value="BCEL.jar"/>
-  <property name="BCEL.jar" value="${bin.dir}/${BCEL.jar.name}"/>
-  <property name="crimson.jar.name" value="crimson.jar"/><!-- Why is this here? 10-Sep-01 -sc -->
-  <property name="crimson.jar" value="${bin.dir}/${crimson.jar.name}"/>
-  <property name="java_cup.jar.name" value="java_cup.jar"/>
-  <property name="java_cup.jar" value="${bin.dir}/${java_cup.jar.name}"/>
-  <property name="JLex.jar.name" value="JLex.jar"/>
-  <property name="JLex.jar" value="${bin.dir}/${JLex.jar.name}"/>
-  <property name="runtime.jar.name" value="runtime.jar"/>
-  <property name="runtime.jar" value="${bin.dir}/${runtime.jar.name}"/>
-  <property name="xml.jar.name" value="xml.jar"/>
-  <property name="xml.jar" value="${bin.dir}/${xml.jar.name}"/>
-
-  <!-- Defines general variables used by the other targets; name controls output xalan.jar  -->
-  <property name="version" value="2_2_D10"/><!-- GUMP: version # of dist file -->
-  <property name="name" value="xalan"/><!-- GUMP: base name of jar target's file -->
-  <property name="year" value="2001"/>
-  <property name="build.compiler" value="classic"/>
-  <property name="debug" value="off"/>
-
-  <!-- Relative locations of source directories -->
-  <property name="metainf.dir" value="./src/META-INF"/>
-  <property name="src.dir" value="./src"/>
-  <property name="xpath.reldir" value="org/apache/xpath"/>
-  <property name="xalan.reldir" value="org/apache/xalan"/>
-  <property name="xsltc.reldir" value="${xalan.reldir}/xsltc"/>
-  <property name="trax.reldir" value="javax/xml/transform"/>
-  <property name="serialize.reldir" value="org/apache/serialize"/>
-  <property name="serializer.reldir" value="org/apache/xalan/serialize"/>
-  <property name="jaxp.reldir" value="javax/xml/parsers"/>
-  <property name="sax.reldir" value="org/xml/sax"/>
-  <property name="w3c.reldir" value="org/w3c"/>    
-
-  <!-- Build and distribution output areas -->
-  <property name="build.dir" value="./build"/><!-- GUMP: root of all normal builds output -->
-  <property name="build.xalan.jar" value="${build.dir}/${name}.jar"/><!-- GUMP: actual path/name of jar target output -->
-  <property name="build.xsltc.jar" value="${build.dir}/xsltc.jar"/>
-  <property name="build.classes" value="${build.dir}/classes"/>
-  <property name="build.docs" value="${build.dir}/docs"/>
-  <property name="build.samples" value="${build.dir}/samples"/>
-  <property name="build.apidocs" value="${build.docs}/apidocs"/>
-  <property name="dist.file" value="${name}-j_${version}"/><!-- GUMP: actual path/name of dist target .tar.gz/.zip-->
-  <property name="dist.dir" value="${build.dir}/${dist.file}"/>
-  
-  <!-- Xalan-J1 compatability stuff.  -->
-  <property name="compat.jar" value="xalanj1compat.jar"/>
-  <property name="compat.src.dir" value="./compat_src"/>
-  <property name="build.compat.classes" value="${build.dir}/compat_classes"/>
-  <property name="build.compat.jar" value="${build.dir}/${compat.jar}"/>
-  <property name="build.compat.apidocs" value="${build.docs}/compat_apidocs"/>        
-
-  <!-- Documentation and samples information  -->
-  <property name="Name" value="Xalan-Java"/>
-  <property name="version.file" value="${xalan.reldir}/processor/XSLProcessorVersion.java"/>
-  <property name="samples.dir" value="./samples"/>
-  <property name="build.samples.jar" value="${build.dir}/xalansamples.jar"/>
-  <property name="build.servlet.jar" value="${build.dir}/xalanservlet.jar"/>
-  <property name="xdocs.dir" value="./xdocs"/>
-  <property name="xdocs.book" value="${xdocs.dir}/sources/xalan-jlocal.xml"/>
-  <property name="xdocs.style" value="${xdocs.dir}/style"/>
-  <property name="xalanonly-styledocs"
-            value="dtd/xsl-html40s.dtd,dtd/spec.dtd,stylesheets/patterns.xsl,stylesheets/notice.xsl,stylesheets/spec.xsl,stylesheets/done.xsl,loaderdesign.xml,stylesheets/design2project.xsl,stylesheets/designdoc2html.xsl,stylesheets/xml2fo.xsl"/>
-  <property name="xalan.cmdline.class" value="org.apache.xalan.xslt.Process"/>
-  <property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
-  <property name="doc.generator.styletargz" value="${xdocs.dir}/xml-site-style.tar.gz"/>
-  <property name="doc.generator.styletar" value="${xdocs.dir}/xml-site-style.tar"/>
-  <property name="site.root" value="./xml-site"/>
-  <property name="site.dir" value="${site.root}/target/xalan-j"/>
-  <property name="site.book" value="${xdocs.dir}/sources/xalan-jsite.xml"/>
-  <property name="xdocs.DONE.file" value="${xdocs.dir}/sources/xalan/DONE"/>
-  <path id="docs.class.path">
-    <pathelement location="${bsf.jar}" />
-    <pathelement location="${stylebook.jar}" />
-    <pathelement location="${doclet.jar}" />
-    <pathelement location="${build.xalan.jar}" />
-    <pathelement path="${java.class.path}" />
-  </path>
-
-  <!-- =================================================================== -->
-  <!-- Creates output build directories and doc prerequistes               -->
-  <!-- =================================================================== -->
-  <target name="prepare">
-    <echo message="Project:${Name} version:${version} build.xml $Revision$"/>
-    <mkdir dir="${build.dir}"/>
-    <mkdir dir="${build.classes}"/>
-    <!-- Note that all testing-related targets *must* depend on 
-         this target, either directly or indirectly, to get 
-         the tests-available property set for them.
-    -->
-    <available file="${test.relpath}" property="tests-available" />
-    <available property="xerces.present" 
-      classname="org.apache.xerces.parsers.SAXParser"/>
-  </target>
-
-  <!-- Must depend on jar since we use Xalan to process xml files -->
-  <target name="prepare.docs" depends="jar">
-    <mkdir dir="${build.docs}"/> 
-    <mkdir dir="${build.apidocs}"/>
-
-    <gunzip src="${doc.generator.styletargz}"/>
-    <untar src="${doc.generator.styletar}" dest="${xdocs.dir}"/>
-    <delete file="${doc.generator.styletar}"/>
-    
-    <echo message="Transform todo.xml and put the result in ${build.docs}"/>
-    <java fork="yes" classname="${xalan.cmdline.class}">
-      <classpath refid="docs.class.path" />
-      <arg line="-in todo.xml -xsl todo.xsl -out build/docs/todo.html"/>
-    </java> 
-    <!-- We use a Notes agent to periodically extract Xalan-Java 2 commits from our team database into commits.xml.  The following operation 
-    transforms commits.xml (just including source code commits) and puts the result in xdocs/sources/xalan for inclusion in the 
-    readme.xml -->      
-    <echo message="Transform commits.xml and put the result in ${xdocs.dir}"/>
-    <java fork="yes" classname="${xalan.cmdline.class}" >
-      <classpath refid="docs.class.path" />
-      <arg line="-in commits.xml -xsl ${xdocs.style}/stylesheets/done.xsl -out ${xdocs.DONE.file}"/>
-    </java>
-    <echo message="Generate Xalan-J 2.x design document"/>
-    <java fork="yes" classname="${doc.generator}" >
-      <classpath refid="docs.class.path" />
-      <arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./build/docs/design/
-                 ./xdocs/sources/xalandesign.xml ./xdocs/style"/>
-    </java>
-  </target>
-
-
-  <!-- =================================================================== -->
-  <!-- Compile entire source tree - except Xalan-J 1 compatability classes -->
-  <!-- =================================================================== -->
-  <target name="compile" depends="prepare"
-    description="Compile Xalan-J 2.x (skips 1.x compat and XSLTC)" >
-    <echo message="compile entire source tree and copy .properties and .res files to build tree."/>
-    <!-- Note: split compile into separate javac steps to avoid JDK 1.1.8 bug reported at:
-         http://developer.java.sun.com/developer/bugParade/bugs/4043508.html
-         which causes an error like:
-         [javac] E:\builds\xml-xalan\java\src\org\apache\xalan\templates\ElemTemplate.java:108: Cyclic class inheritance or scoping.
-    --> 
-    <!-- Compile our copy of JAXP 1.1 classes -->
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           includes="javax/**/*.java"
-           debug="${debug}"/>
-    <!-- Compile our copy of DOM Level 2 final draft, SAX 2.0 classes -->
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           includes="org/w3c/**/*.java,org/xml/**/*.java"
-           debug="${debug}"/>
-    <!-- Compile XPath engine and some common utilities -->
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           debug="${debug}" >
-      <include name="org/apache/xml/**/*.java" />
-      <include name="${xpath.reldir}/**/*.java" />
-      <exclude name="**/CoroutineSAXFilterTest.java" 
-        unless="xerces.present"	 />
-      <exclude name="**/CoroutineSAXParser_Xerces.java" 
-        unless="xerces.present"	 />
-      <exclude name="**/IncrementalSAXSource_Xerces.java" 
-        unless="xerces.present"	 />
-    </javac>
-    <!-- Compile Xalan main engine (but not xsltc package yet) -->
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           includes="${xalan.reldir}/**/*.java"
-           excludes="${xsltc.reldir}/**/*.java,${xalan.reldir}/lib/**/*.java,${xalan.reldir}/xslt/**/*.java"
-           debug="${debug}"/>
-    <!-- Compile various Xalan-specific extensions and command line class -->
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           includes="${xalan.reldir}/lib/**/*.java,${xalan.reldir}/xslt/**/*.java"
-           debug="${debug}"/>
-    <!-- Copy needed properties, resource, etc. files to be put into .jar file -->
-    <copy todir="${build.classes}">
-          <fileset dir="${src.dir}" includes="**/*.properties,**/*.res,**/javax.xml.parsers.*,**/javax.xml.transform.*"/>
-        </copy>  
-  </target>
-
-  <!-- =================================================================== -->
-  <!-- Compile just the XSLTC compiler portion (to be integrated soon!) -->
-  <!-- =================================================================== -->
-  <path id="xsltc.class.path">
-    <pathelement location="${BCEL.jar}" />
-    <pathelement location="${JLex.jar}" />
-    <pathelement location="${java_cup.jar}" />
-    <pathelement location="${runtime.jar}" />
-    <pathelement location="${xml.jar}" />
-    <pathelement location="${crimson.jar}" />
-    <!-- build.classes needed for 
-         org.apache.xalan.xsltc.util.JavaCupRedirect -->
-    <pathelement location="${build.classes}" />
-    <pathelement path="${java.class.path}" />
-  </path>
-  <!-- The xsltc.compile target should be rewritten to properly 
-       do dependencies on the generated sources: right now, it 
-       will always regenerate the sources, even if it's not needed
-       (which forces all later steps to re-run as well) -->
-  <target name="xsltc.compile" depends="prepare"
-    description="Compile just the XSLTC classes" >
-
-    <!-- The first step compiles the utils directpry, which includes 
-         a special wrapper for the java_cup step next. -->
-    <echo message="Compiling XSLTC utilities"/>
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           includes="${xsltc.reldir}/util/**/*.java"
-           debug="${debug}">
-      <classpath refid="xsltc.class.path" />
-    </javac>
-    <!-- The second step generates sym.java and XPathParser.java, and the
-    last one generates XPathLexer.java. The lexiographical analyser
-    has to be generated after sym.java, so order is important. -->
-    <echo message="java_cup preparsing"/>
-    <java fork="no" failonerror="true" classname="org.apache.xalan.xsltc.util.JavaCupRedirect" >
-      <classpath refid="xsltc.class.path" />
-      <!-- We're using JavaCupRedirect to call the java_cup application -->
-      <arg line="-parser XPathParser -expect 0 -stdin ${src.dir}/${xsltc.reldir}/compiler/xpath.cup"/>
-    </java>
-    <echo message="java_cup move output files"/>
-    <move file="XPathParser.java" tofile="${src.dir}/${xsltc.reldir}/compiler/XPathParser.java"/>
-    <move file="sym.java" tofile="${src.dir}/${xsltc.reldir}/compiler/sym.java"/>
-
-    <echo message="JLex preparsing"/>
-    <java fork="no" failonerror="true" classname="JLex.Main" >
-      <classpath refid="xsltc.class.path" />
-      <arg line="-static ${src.dir}/${xsltc.reldir}/compiler/xpath.lex"/>
-    </java>
-    <echo message="JLex move output file"/>
-    <move file="${src.dir}/${xsltc.reldir}/compiler/xpath.lex.java" tofile="${src.dir}/${xsltc.reldir}/compiler/XPathLexer.java"/>
-
-    <echo message="Compiling remaining XSLTC classes"/>
-    <javac srcdir="${src.dir}" 
-           destdir="${build.classes}"
-           includes="${xsltc.reldir}/**/*.java"
-           debug="${debug}">
-      <classpath refid="xsltc.class.path" />
-    </javac>
-  </target>
-  <target name="xsltc.jar" depends="xsltc.compile"
-    description="Jar just the xsltc.jar file" >
-    <jar jarfile="${build.xsltc.jar}" basedir="${build.classes}" >
-      <patternset><!-- relative to jar/@basedir -->
-        <include name="${xsltc.reldir}/**/*" />
-      </patternset>
-    </jar>
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Creates the xalan JAR                                               -->
-  <!-- =================================================================== -->
-  <target name="jar" depends="compile"
-    description="Jar up xalan.jar" >
-    <jar jarfile="${build.xalan.jar}" manifest="src\MANIFEST.MF" basedir="${build.classes}" >
-      <patternset><!-- relative to jar/@basedir -->
-        <exclude name="${xsltc.reldir}/**/*" />
-        <exclude name="javax/xml/parsers/**" />
-        <exclude name="META-INF/services/javax.xml.parsers*" />
-      </patternset>
-    </jar>
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Default all target simply Creates the xalan JAR                     -->
-  <!-- =================================================================== -->
-  <target name="all" depends="jar"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
-    <echo message="Redirect to jar target; please provide input on desired functionality of this target"/>
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Creates the Xalan-J1 compatability JAR                              -->
-  <!-- =================================================================== -->
-  <target name="compat.jar" depends="jar"
-    description="Compile and jar Xalan-J 1.x backwards compat classes" >
-    <echo message="Compile and jar just the Xalan-J 1 compability API"/>
-    <mkdir dir="${build.compat.classes}"/>
-    <javac srcdir="${compat.src.dir}" classpath="${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.classes}"
-           includes="**/*.java"
-           debug="${debug}"/>
-    <copy todir="${build.compat.classes}">
-          <fileset dir="${compat.src.dir}" includes="**/*.properties,**/*.res"/>
-    </copy>  
-    <jar jarfile="${build.compat.jar}" manifest="src\MANIFEST.MF" basedir="${build.compat.classes}"/>
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Creates the Xalan-J1 compatability javadoc                          -->
-  <!-- =================================================================== -->
-  <target name="compat.javadocs" depends="jar"
-    description="Build javadocs for Xalan-J 1.x backwards compat classes" >
-    <mkdir dir="${build.compat.apidocs}"/>
-    <javadoc
-         public="true"
-         sourcepath="${compat.src.dir}"
-         overview="${compat.src.dir}/compatOverview.html"         
-         packagenames="org.apache.xalan.xslt,org.apache.xalan.xpath,org.apache.xalan.xpath.xml"
-         author="true"
-         version="true"
-         use="true"
-         destdir="${build.compat.apidocs}"
-         windowtitle="${Name} 1 Compatability" 
-         doctitle="${Name} 1 Compatability"
-         bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved.">
-      <classpath refid="docs.class.path" />
-    </javadoc>
-  </target>
-    
-
-  <!-- =================================================================== -->
-  <!-- Compiles the samples (servlet excluded) and jars the class files    -->  
-  <!-- =================================================================== -->
-  <target name="samples" depends="jar"
-    description="Compile and jar the samples (except servlet)" >
-    <property name="exclude" value="*.xml,*.xsl,*.txt,*.html,*.properties,*.out"/>
-    <mkdir dir="${build.samples}"/>
-    <!-- Since the samples are packageless, they must be compiled separately. -->   
-    <javac srcdir="${samples.dir}/SimpleTransform" classpath="${java.class.path}:${build.xalan.jar}" 
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samples.dir}/UseStylesheetPI" classpath="${java.class.path}:${build.xalan.jar}"  
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samples.dir}/UseStylesheetParam" classpath="${java.class.path}:${build.xalan.jar}"
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>           
-    <javac srcdir="${samples.dir}/SAX2SAX" classpath="${java.class.path}:${build.xalan.jar}" 
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>           
-    <javac srcdir="${samples.dir}/DOM2DOM" classpath="${java.class.path}:${build.xalan.jar}" 
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samples.dir}/Pipe" classpath="${java.class.path}:${build.xalan.jar}" 
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>           
-    <javac srcdir="${samples.dir}/UseXMLFilters" classpath="${java.class.path}:${build.xalan.jar}" 
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samples.dir}/Trace" classpath="${java.class.path}:${build.xalan.jar}"  
-           destdir="${build.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-   <javac srcdir="${samples.dir}/ApplyXPath" classpath="${java.class.path}:${build.xalan.jar}" 
-          destdir="${build.samples}" excludes="${exclude}" 
-          debug="${debug}"/>
-   <javac srcdir="${samples.dir}/trax" classpath="${java.class.path}:${build.xalan.jar}" 
-          destdir="${build.samples}" excludes="${exclude}" 
-          debug="${debug}"/>
-   <javac srcdir="${samples.dir}/extensions" classpath="${java.class.path}:${build.xalan.jar}" 
-          destdir="${build.samples}" excludes="${exclude}" 
-          debug="${debug}"/> 
-   <javac srcdir="${samples.dir}/Validate" classpath="${java.class.path}:${build.xalan.jar}" 
-          destdir="${build.samples}" excludes="${exclude}" 
-          debug="${debug}"/>               
-    <jar jarfile="${build.samples.jar}" basedir="${build.samples}"
-         includes="*.class"/>                   
-  </target>
-   
-  <!-- =================================================================== -->
-  <!-- Compiles the sample servlet and jars the class files.                -->  
-  <!-- The javax.servlet and javax.servlet.http packages                    -->
-  <!-- must be on the classpath                                             -->
-  <!-- =================================================================== -->
- <target name="servlet" depends="jar"
-    description="Compile and jar the servlet samples" >
-     <echo message="To compile the sample servlets, javax.servlet and javax.servlet.http must be on the classpath"/>   
-     <mkdir dir="${build.samples}/servlet"/>
-     <javac srcdir="${samples.dir}/servlet" classpath="${java.class.path}:${build.xalan.jar}" 
-           destdir="${build.samples}"
-           debug="${debug}"/>
-      <copy todir="${build.samples}/servlet">
-          <fileset dir="${samples.dir}/servlet" 
-                includes="media.properties,default.xsl,default2.xsl"/>
-        </copy>  		         
-    <jar jarfile="${build.servlet.jar}" 
-         basedir="${build.samples}" 
-         includes="servlet/**"/>
- </target>
- 
-  <!-- =================================================================== -->
-  <!-- Compiles (does not jar) the translet samples in translets.          -->
-  <!-- For time being, classes are generated in place.                     -->
-  <!-- To run these samples, add xsltc.jar, runtime.jar, BCEL.jar,         -->
-  <!-- and java_cup.jar (all in the bin directory) to the classpath        --> 
-  <!--                                                                     -->
-  <!-- When we have straightened out classpath issues,                     -->
-  <!-- add samples in CompiledApplet, CompiledBrazil, and CompiledServlet  -->
-  <!-- =================================================================== -->
-  <target name="xsltc.samples" depends="jar,xsltc.jar">
-    <javac srcdir="${samples.dir}/translets" classpath="${java.class.path}:${build.xsltc.jar}" 
-           destdir="${samples.dir}/translets" excludes="${exclude}" 
-           debug="${debug}"/>  
-  </target>
- 
- 
-  <!-- =================================================================== -->
-  <!-- Generate HTML docs                                                  -->
-  <!-- =================================================================== -->
-  <target name="docs" depends="jar,prepare.docs,autodocs"
-    description="Build the documentation (overview, readme, etc.)" >
-    <echo message="docs is human-usable target with dependencies"/>  
-  </target>
-  
-  <target name="autodocs">
-    <echo message="autodocs is for automated build process, without dependencies"/>   
-    <java fork="yes" 
-          classname="${doc.generator}" 
-          classpathref="docs.class.path" >
-       <arg line="targetDirectory=${build.docs} ${xdocs.book} ${xdocs.style}"/>
-    </java>	 
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Creates the API documentation                                       -->
-  <!-- =================================================================== -->
-  <target name="javadocs" depends="jar,prepare.docs,autojavadocs"
-    description="Build the Javadocs for Xalan 2.x sources" >
-    <echo message="javadocs is human-usable target with dependencies"/>  
-  </target>
-
-  <target name="autojavadocs">
-    <echo message="autojavadocs is for automated build process, without dependencies"/>    
-    
-    <!-- Ant ignores destdir arg if doclet is set, so must send to doclet in doclet subelement-->
-    <javadoc
-         public="true"
-         sourcepath="${src.dir}"
-         overview="${src.dir}/javadocOverview.html"
-         packagenames="org.apache.*,org.xml.*,org.w3c.*,javax.xml.*"
-         author="true"
-         version="true"
-         use="true"
-         windowtitle="${Name} 2" 
-         doctitle="${Name} 2"
-         bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved.">
-          <classpath refid="docs.class.path" />
-          <doclet name="xalanjdoc.Standard" path="${doclet.jar.name}">
-            <param name="-d" value="${build.apidocs}"/>
-          </doclet>
-          <group title="Transformations API for XML (TrAX)" packages="javax.xml.transform*"/>
-          <group title="Java API for XML Parsing" packages="javax.xml.parsers"/>
-          <group title="Xalan Core"
-                 packages="org.apache.xalan.processor:org.apache.xalan.templates:org.apache.xalan.transformer"/>
-          <group title="XPath" packages="org.apache.xpath*"/>
-          <group title="Document Table Model (DTM)" packages="org.apache.xml.dtm*"/>          
-          <group title="Utilities" packages="org.apache.xml.utils*"/>
-          <group title="Xalan Other" packages="org.apache.xalan.client:org:org.apache.xalan.extensions:org.apache.xalan.res:org.apache.xalan.stree:org.apache.xalan.trace:org.apache.xalan.xslt"/>
-          <group title="Xalan Extensions" packages="org.apache.xalan.lib*"/>
-          <group title="Serializers" packages="org.apache.xalan.serialize"/>
-          <group title="SAX 2" packages="org.xml.sax*"/>
-          <group title="DOM 2" packages="org.w3c.dom*"/>
-          <group title="XSLTC Core"
-                 packages="org.apache.xalan.xsltc*"/>
-    </javadoc>
-    
-  </target>
-
-  <!-- =================================================================== -->
-  <!-- Various targets to clean the build tree                             -->
-  <!-- =================================================================== -->
-  <target name="distclean" depends="clean"
-    description="Clean everything, including dist/jar/docs/xsltc.*" >
-    <delete dir="${dist.dir}"/>
-  </target>
-
-  <target name="clean" depends="xsltc.clean"
-    description="Clean the ${build.dir} tree and doc outputs" >
-    <delete dir="${build.dir}"/>
-    <delete dir="${site.root}"/>
-    <delete>
-      <fileset dir="${xdocs.style}" excludes="${xalanonly-styledocs}"/>
-    </delete>
-    <delete file="${xdocs.DONE.file}"/>
-  </target>
- 
-  <target name="xsltc.clean"
-    description="Clean miscellaneous generated sources from xsltc.compile" >
-    <delete file="${src.dir}/${xsltc.reldir}/compiler/XPathParser.java" />
-    <delete file="${src.dir}/${xsltc.reldir}/compiler/sym.java" />
-    <delete file="${src.dir}/${xsltc.reldir}/compiler/XPathLexer.java" />
-  </target>
-
-  <!-- =================================================================== -->
-  <!-- Install/Uninstall targets - not currently applicable                -->
-  <!-- =================================================================== -->
-  <target name="install"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
-    <echo message="install target currently not supported in ${Name}; try jar or dist instead"/>
-  </target>
-  <target name="uninstall"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
-    <echo message="uninstall target currently not supported in ${Name}; try distclean instead"/>
-  </target>
-
-  <!-- =================================================================== -->
-  <!-- Creates the distribution                                            -->
-  <!-- =================================================================== -->
-  <target name="dist" depends="jar,docs,javadocs,samples,servlet,compat.jar,compat.javadocs,xsltc.jar,xsltc.docs,autodist,todo"
-    description="Create a .zip/.tar.gz distribution module" >
-    <echo message="dist is human-useable target for distribution, with all dependencies"/>
-  </target>
-  <target name="autodist">
-    <echo message="autodist is for automated build processes, without dependencies"/>
-    <mkdir dir="${dist.dir}"/>
-    <mkdir dir="${dist.dir}/bin"/>    
-    <mkdir dir="${dist.dir}/src"/>
-    <mkdir dir="${dist.dir}/compat_src"/>    
-    <mkdir dir="${dist.dir}/xdocs"/>
-    <mkdir dir="${dist.dir}/docs"/>
-    <mkdir dir="${dist.dir}/docs/apidocs"/>
-    <mkdir dir="${dist.dir}/docs/compat_apidocs"/>    
-    <mkdir dir="${dist.dir}/samples"/>
-        
-        <!-- Copy bin directory -->
-    <copy todir="${dist.dir}/bin">
-          <fileset dir="${bin.dir}"/>
-        </copy>  
-
-    <!-- Copy sources and source documentation -->
-    <copy todir="${dist.dir}/src">
-      <fileset dir="${src.dir}"/>
-    </copy>
-    <copy todir="${dist.dir}/compat_src">
-      <fileset dir="${compat.src.dir}"/>
-    </copy>    
-    <copy todir="${dist.dir}/xdocs">
-      <fileset dir="${xdocs.dir}"/>
-    </copy>
-    
-    <!-- Copy built documentation and javadoc, and samples src and jars -->
-    <copy todir="${dist.dir}/docs">
-      <fileset dir="${build.docs}"/>
-    </copy>  
-    <copy todir="${dist.dir}/samples">
-      <fileset dir="${samples.dir}"/>
-    </copy>   
-    <copy file="${build.dir}/xalansamples.jar" todir="${dist.dir}/bin"/>
-    <copy file="${build.dir}/xalanservlet.jar" todir="${dist.dir}/bin"/>
-
-    <!-- Copy various built .jar files into the bin directory (subject to change) -->
-    <copy file="${build.xalan.jar}" todir="${dist.dir}/bin"/>
-    <copy file="${build.compat.jar}" todir="${dist.dir}/bin"/>    
-    <copy file="${build.xsltc.jar}" todir="${dist.dir}/bin"/>
-
-    <copy todir="${dist.dir}">
-      <fileset dir="." includes="readme.html,KEYS,License,build.xml,build.sh,build.bat,todo.xml,xsltc_todo.xml,todo.xsl,commits.xml"/>
-    </copy>
-          
-    <zip zipfile="${build.dir}/${dist.file}.zip" basedir="${build.dir}" includes="${dist.file}/**"/>
-    <tar tarfile="${build.dir}/${dist.file}.tar" basedir="${build.dir}" includes="${dist.file}/**"/>
-    <gzip src="${build.dir}/${dist.file}.tar" zipfile="${build.dir}/${dist.file}.tar.gz"/>
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Creates the documentation tree for the org.apache.xml website       -->
-  <!-- =================================================================== -->
-  <target name="site" depends="prepare.docs"
-    description="Build documentation for posting to the website" >
- 
-    <mkdir dir="${site.dir}/apidocs"/>
-    <mkdir dir="${site.dir}/compat_apidocs"/>
-    <mkdir dir="${site.dir}/design"/>
-    <java fork="yes" 
-          classname="${doc.generator}" 
-          classpathref="docs.class.path" >
-       <arg line="targetDirectory=${site.dir} ${site.book} ${xdocs.style}"/>
-    </java>
-
-    <!-- put todo.html in the site directory -->     
-    <copy file="${build.docs}/todo.html" todir="${site.dir}"/>
-    <!-- put xalan design doc in the site design subdir -->
-    <copy todir="${site.dir}/design">
-      <fileset dir="${build.docs}/design"/>
-    </copy>
-    <!-- put xsltc design doc in the site xsltc subdir -->
-    <copy todir="${site.dir}/xsltc">
-      <fileset dir="${build.docs}/xsltc"/>
-    </copy>  
-    
-    <!-- put in the javadoc -->
-    <copy todir="${site.dir}/apidocs">
-      <fileset dir="${build.apidocs}"/>
-    </copy>
-    <copy todir="${site.dir}/compat_apidocs">
-      <fileset dir="${build.compat.apidocs}"/>
-    </copy>  
-      
-  </target>
-   
-  <!-- =================================================================== -->
-  <!-- Compiles and runs mini/smoketest from xml-xalan\test, if present    -->
-  <!-- =================================================================== -->
-  <property name="test.relpath" value="../test"/>
-
-  <target name="minitest" depends="prepare,minitest-run,tests-not-available" 
-    description="Run the Minitest from xml-xalan/test" >
-    <!-- This target simply asks the minitest-run worker target to 
-         actually have the Minitest run (by the test/build.xml file);
-         we then also call the tests-not-available target in case 
-         the user never checked out the tests.
-    -->
-  </target>
-  <target name="minitest-run" if="tests-available" depends="jar" >
-    <echo message=" [minitest] Calling ${test.relpath}/build.xml to run the Minitest" />
-    <ant dir="${test.relpath}" antfile="build.xml" target="minitest.gump" >
-    </ant>
-  </target>
-
-  <target name="smoketest" depends="prepare,smoketest-run,tests-not-available" 
-    description="Run Smoketests (Minitest, conf, harness) from xml-xalan/test" >
-  </target>
-  <target name="smoketest-run" if="tests-available" depends="jar" >
-    <echo message=" [minitest] Calling ${test.relpath}/build.xml to run the Smoketest" />
-    <ant dir="${test.relpath}" antfile="build.xml" target="smoketest.dev" >
-    </ant>
-  </target>
-
-  <target name="check" depends="smoketest"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
-    <echo message="Redirect to smoketest target"/>
-  </target>
-
-  <!-- Called from various testing targets if the test dir doesn't exist. -->
-  <target name="tests-not-available" unless="tests-available" >
-    <echo message=" [tests] The tests do not seem to be present in ${test.relpath}" />
-    <echo message=" [tests] You must have checked out from CVS to run the tests," />
-    <echo message=" [tests]   it is not included in binary distributions." />
-    <echo message=" [tests] See http://xml.apache.org/xalan-j/test/ for more info." />
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Creates the todo list for the org.apache.xml website                -->
-  <!-- =================================================================== -->
-  <target name="todo">
-    <java fork="yes" 
-          classname="${xalan.cmdline.class}" 
-          classpathref="docs.class.path" >
-      <arg line="-in todo.xml -xsl todo.xsl -out todo.html"/>
-    </java>   
-  </target>  
-
-  <!-- =================================================================== -->
-  <!-- Creates the xalan design document                                   -->
-  <!-- =================================================================== -->
-    <target name="xalan-j2-design">
-    <java fork="yes" 
-          classname="${doc.generator}" 
-          classpathref="docs.class.path" >
-      <arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=${build.dir}/docs/design/
-      ${xdocs.dir}/sources/xalandesign.xml ${xdocs.style}"/>
-    </java>
-  </target>
-  
-  <!-- =================================================================== -->
-  <!-- Use FOP to create preliminary print (pdf) doc                       -->
-  <!-- Note: fop.jar and xml.jar (from xml-fop) must be on classpath       -->
-  <!-- This is VERY preliminary, not yet for inclusion in distribution     -->
-  <!-- =================================================================== -->
-  <!--Collate the xml sources into a single xml source with a litle extra structure -->
-  <target name="printerdocs" depends="prepare.docs">
-    <echo message="NOTICE: requires fop.jar and xml.jar on the classpath"/>
-    <java fork="yes" 
-          classname="${xalan.cmdline.class}"
-          classpathref="docs.class.path" >
-      <arg line="-xsl ${xdocs.dir}/sources/xalan-collate.xsl 
-                 -out xdocs/sources/xalan/xalan-collate.xml"/>
-    </java>
-    
-    <!-- Transform collation into Formatting Objects 
-         (with a little work on links along the way) -->    
-    <java fork="yes" 
-          classname="${xalan.cmdline.class}"
-          classpathref="docs.class.path" >
-      <arg line="-in  ${xdocs.dir}/sources/xalan/xalan-collate.xml
-                 -param resourceFile '../../sources/xalan/resources.xml'
-                 -param project ${Name}      
-                 -xsl ${xdocs.style}/stylesheets/xml2fo.xsl 
-                 -out build/docs/xalan-collate.fo"/>
-    </java>
-    
-    <!-- Use FOP to generate a pdf file (classpath may need updating! -sc 18-Apr-01)-->
-    <java fork="yes" 
-          classname="org.apache.fop.apps.CommandLine"
-      classpath="${java.class.path}:${build.xalan.jar}:${bin.dir}/fop.jar:${bin.dir}/w3c.jar">
-      <arg line="${build.docs}/xalan-collate.fo build/docs/xalan.pdf"/>
-    </java>
-  </target>
-
-  <!-- =================================================================== -->  
-   <!-- for developers only; compiles xalan-j1 samples with compat jar and xalan-j2 xalan.jar-->
-   <target name="compat.samples" depends="jar,compat.jar" 
-    description="Compile and jar Xalan-J 1.x backwards compat samples" >
-     <property name="exclude" value="*.xml,*.xsl,*.txt,*.html.*.properties"/>
-     <property name="samplesj1.dir" value="/xml-xalan/samples"/>
-     <property name="build.compat.samples" value="./build/compat_samples"/>
-     <mkdir dir="${build.compat.samples}"/>     
-
-    <!--need to use the XalanJ2 XPathAPI, so cannot compile ApplyXPath as is -->   
-    <javac srcdir="${samplesj1.dir}/Pipe" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}"  excludes="${exclude}"
-           debug="${debug}"/> 
-    <javac srcdir="${samplesj1.dir}/SimpleTransform" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samplesj1.dir}/TransformToDom" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samplesj1.dir}/PureSAX" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}"  excludes="${exclude}"
-           debug="${debug}"/>          
-    <javac srcdir="${samplesj1.dir}/UseStylesheetParam" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}"  excludes="${exclude}"
-           debug="${debug}"/>
-    <javac srcdir="${samplesj1.dir}/Servlet" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}" excludes="${exclude}"
-           debug="${debug}"/>
-    <jar   jarfile="${build.compat.samples}/xalanjcompatsamples.jar" basedir="${build.compat.samples}"
-            includes="*.class"/> 
-     <!--put the servlet in a separate jar -->
-     <javac srcdir="${samplesj1.dir}/Servlet" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}" 
-           destdir="${build.compat.samples}"
-           debug="${debug}"/>
-      <copy todir="${build.compat.samples}/servlet">
-          <fileset dir="${samplesj1.dir}/Servlet" 
-                includes="media.properties,default.xsl,default2.xsl"/>
-        </copy>  		         
-    <jar jarfile="${build.compat.samples}/xalancompatservlet.jar" basedir="${build.compat.samples}"
-         includes="servlet/**"/>
- </target>
- 
-  <!-- =================================================================== -->
-  <!-- Build XSLTC design documentation. Eventually intend to incorporate -->
-  <!-- XSLTC into the Xalan book.                                         -->
-  <!-- =================================================================== -->
-
-
-  <target name="xsltc.prepare.docs" depends="prepare.docs">
-      <echo message="Transform xsltc_todo.xml and put the result in ${build.docs}/xsltc"/>
-   <mkdir dir="${build.docs}/xsltc"/>
-    <java fork="yes" classname="${xalan.cmdline.class}">
-      <classpath refid="docs.class.path" />
-      <arg line="-in xsltc_todo.xml -xsl todo.xsl -out build/docs/xsltc/todo.html"/>
-    </java>
-  </target>  
- 
- <target name="xsltc.docs" depends="xsltc.prepare.docs">
-   <echo message="Build the XSLTC Architectural documentation"/>
-   <java fork="yes" 
-         classname="${doc.generator}" 
-         classpathref="docs.class.path" >
-      <arg line="targetDirectory=${build.docs}/xsltc ${xdocs.dir}/sources/xsltc.xml ${xdocs.style}"/>
-    </java>	 
- </target>
- 
-   <!-- pack all doc for transfer to website -->
- <target name="pack.docs">
-    <tar tarfile="./build/xalan-j-docs.tar" basedir="./xml-site/target/xalan-j" includes="**"/>
-    <gzip src="./build/xalan-j-docs.tar" zipfile="./build/xalan-j-docs.tar.gz"/>
-    <!--zip zipfile="./build/xalan-j-docs.zip" basedir="./xml-site/target/xalan-j" includes="**"/-->
-  </target>
-
- 
-</project>
diff --git a/commits.xml b/commits.xml
deleted file mode 100644
index e344c7d..0000000
--- a/commits.xml
+++ /dev/null
@@ -1,619 +0,0 @@
-<?xml version="1.0"?>
-<Commits>
-<Commit category="core">
-<Who>garyp@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java</Modified>
-<Log>Fix bugzilla bug 3056 
-(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3056). SAX2DTM now keeps 
-track if it is receiving events inside a DTD and ignores comment events when 
-inside the DTD.</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler Parser.java</Modified>
-<Log>I added a flag to the compiler/Parser class that is set if the outermost 
-element
- in the stylesheet contains a definition of the XSL namespace. The parser 
-already
- has a global variable '_target' that is set if the stylesheet contains a
- &lt;?xml-stylesheet?&gt; PI or not. The compiler will now flag an error if neither
- flags are set after the whole XSL/XML input document has been parsed.
- PR: bugzilla 1780
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler UnionPathExpr.java</Modified>
-<Log>Added a small fix that orders the expressions inside a union in such a way 
-that
- expressions with an attribute axis or attribute node type will be put first.
- PR: bugzilla 2921
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler Parser.java</Modified>
-<Log>A small fix that will allow top-level elements of an unknown URI.
- XSLTC now ignored the element(s), while it previously reported an error
- of an unsupported XSLT extension.
- PR: bugzilla 2840
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- TextOutput.java</Modified>
-<Log>A start on a fix for output DOCTYPE declarations based on the attributes
- of the &lt;xsl:output&gt; element. I also added a fix for bug 2863, to prevent
- us from outputting namespace delcaration that point a prefix to the null
- URI (such as 'xmlns:blob=""').
- PR: bugzilla 2863
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler xpath.cup</Modified>
-<Log>bug 2553, fixes AbbreviatedAbsoluteLocationPath,
- some relative location paths still give duplicates, will need to filter.</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/13/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/res XSLTInfo.properties</Modified>
-<Log>Update version for 2.2.D9 build</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/14/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/cmdline Transform.java
- java/src/org/apache/xalan/xsltc/compiler Output.java
- java/src/org/apache/xalan/xsltc/runtime DefaultRun.java
- DefaultSAXOutputHandler.java TextOutput.java
- java/src/org/apache/xalan/xsltc/trax TransformerImpl.java</Modified>
-<Log>Implemented support for the doctype-system and doctype-public attributes
- of the &lt;xsl:output/&gt; element. The translet post-processor (TextOutput) can
- now be instanciated with a ContentHandler and an optional LexicalHandler.
- The LexicalHandler will receive notofications of the DOCTYPE declaration.
- The default SAX output handler now implements both ContentHandler and
- LexicalHandler. The LexicalHandler only handles the startDTD() method,
- by outputting the DOCTYPE declaration, and all other methods are empty.
- The trax.Transformer implementation has also been updated to use the
- LexicalHandler, but I still have not found any way in which a SAX client
- can set the LexicalHandler.
- PR: bugzilla 1504
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/14/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler XslElement.java</Modified>
-<Log>A minor change to the class handling the &lt;xsl:element&gt; element to be more
- in-sync with the XSLT 1.0 spec (and M.Kay's book). This in order to make
- it more readable and maintainable. I was trying to debug the code for
- something I thought was a bug, and it was just impossible to navigate.
- This change was necessary, even though the code functioned as it should.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/14/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler LiteralElement.java
- Parser.java</Modified>
-<Log>Fix for outputting all necessary namespace declarations with LREs.
- PR: bugzilla 2863
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/14/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/dom ReverseIterator.java</Modified>
-<Log>A fix to allow reverse iterators to be reset (inside nested for-each loops).
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org</Log>
-</Commit>
-<Commit category="core">
-<Who>johng@apache.org</Who>
-<DateCommitted>08/14/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/lib/sql ConnectionPool.java
- DefaultConnectionPool.java SQLDocument.java
- XConnection.java</Modified>
-<Log>Fixed bug in connect method where User and Password were not
- correctly being passed to the JDBC Driver. Requires chnage in
- ConnectionPool Interface
- Submitted by: John Gentilin</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/15/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/lib/sql XConnection.java</Modified>
-<Log>Use defined constant DTMManager.IDENT_DTM_NODE_BITS for shifting DTM nodes, 
-not hard coded value.</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/15/2001</DateCommitted>
-<Added>java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java</Added>
-<Log>bug fix 2553, new iterator to get rid of dups</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/15/2001</DateCommitted>
-<Added>java/src/org/apache/xalan/xsltc/compiler
- FilteredAbsoluteLocationPath.java</Added>
-<Log>bug fix 2553, new abs location path</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/15/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler xpath.cup
- Constants.java</Modified>
-<Log>bug fix 2553, updated Constants for dup processing
- and updated CUP rule for AbbreviatedAbsoluteLocationPaths</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/15/2001</DateCommitted>
-<Modified>java/src/org/apache/xml/utils SystemIDResolver.java</Modified>
-<Log>Fix problem with resolving a relative URI from a processing instruction</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/dom AbsoluteIterator.java
- DOMImpl.java DupFilterIterator.java
- StepIterator.java UnionIterator.java</Modified>
-<Log>Implementation of id() and key() pattern - finally!
- Added a small fix to the DOMImpl$DescendantIterator to prevent NPEs.
- PR: bugzilla 1376
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler IdKeyPattern.java
- KeyCall.java Mode.java Output.java Parser.java
- TestSeq.java xpath.cup</Modified>
-<Log>Forgot an 'import' in DupFilterIterator
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- SAXAdapter.java TextOutput.java
- TransletOutputBase.java</Modified>
-<Log>missing file</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java</Modified>
-<Log>Added another fix for the missing DOCTYPE declaration. XSLTC will now output
- DOCTYPE declarations for HTML output if either doctype-system or doctype-
- public is declared in the &lt;xsl:output&gt; element. XSL output will get a
- DOCTYPE declaration only if doctype-system is declared.
- PR: 1504
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/dom AbsoluteIterator.java</Modified>
-<Log>
-
-
-</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler xpath.cup</Modified>
-<Log>turning on filtering, bug 2553</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/16/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java</Modified>
-<Log>Removed a bad optimisation in the duplicate filter iterator.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/17/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler xpath.cup</Modified>
-<Log>re-activated the no dups filtering, dont know how
- this got reverted back to no filtering, but it is fixed again.</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/17/2001</DateCommitted>
-<Modified>java/src/org/apache/xml/utils SystemIDResolver.java</Modified>
-<Log>Make sure base is not null before checking for its contents.</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/17/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler IdKeyPattern.java
- Key.java KeyCall.java Parser.java Sort.java
- xpath.cup
- java/src/org/apache/xalan/xsltc/compiler/util
- CompareGenerator.java NodeSortRecordGenerator.java
- java/src/org/apache/xalan/xsltc/dom DTDMonitor.java
- DupFilterIterator.java KeyIndex.java
- NodeSortRecord.java NodeSortRecordFactory.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java BasisLibrary.java</Modified>
-<Log>Major update for id() and key(). Patterns containing id() and key() are
- now 100% supported (about time), and id() and key() expressions should
- now work in all (at least most) combinations.
- PR: bugzilla 1376 (!!!) and 2624
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/17/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/templates FuncDocument.java</Modified>
-<Log>Fix document function so that if only one argument is passed and it is a 
-nodetest, the base to be used to resolve relative URIs is the base of the each 
-node in the nodeset.</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/17/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/processor XSLTSchema.java</Modified>
-<Log>Allow multiple iterations of xsl:with-param within an xsl:call-template or 
-xsl:apply-template</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/20/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java</Modified>
-<Log>A small fix for a cleanup I did in the basis library (it broke the
- substring() function)&gt;
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/20/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/runtime TextOutput.java</Modified>
-<Log>Added small fix to prevent NPE in output handler.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/20/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/compiler Variable.java
- VariableRef.java VariableRefBase.java
- java/src/org/apache/xalan/xsltc/compiler/util
- MultiHashtable.java
- java/src/org/apache/xalan/xsltc/dom DOMImpl.java
- java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
- TextOutput.java TransletOutputBase.java</Modified>
-<Log>Added element/attribute prefix information in the internal DOM.
- This should fix some problems we have had with the copy and copy-of
- elements. Added a few lines of code in an attempt to speed up the DOM builder.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="core">
-<Who>sboag@apache.org</Who>
-<DateCommitted>08/20/2001</DateCommitted>
-<Modified>java/src/org/apache/xpath XPathContext.java</Modified>
-<Log>Added getCurrentNodeList() for getting the current node list as defined
- by http://www.w3.org/TR/xslt#dt-current-node-list.
- This looks up the stack of the SubContextLists to find the top-level
- LocPathIterator. I'm fairly unhappy with this fix, and hope to restructure
- the context list stuff a bit to avoid the casts in the getCurrentNodeList(),
- and to fix getCurrentNode() so that it properly defines the current
- node as defined by the XSLT spec. As a matter of fact, I would
- like to break up XPathContext into an XSLTContext.
- Part of the http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3031
- fix.</Log>
-</Commit>
-<Commit category="core">
-<Who>sboag@apache.org</Who>
-<DateCommitted>08/20/2001</DateCommitted>
-<Modified>java/src/org/apache/xpath/functions FuncCurrent.java</Modified>
-<Log>Call new XPathContext#getCurrentNodeList. Fixes
- http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3031.</Log>
-</Commit>
-<Commit category="core">
-<Who>sboag@apache.org</Who>
-<DateCommitted>08/20/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/transformer KeyRefIterator.java
- java/src/org/apache/xpath/axes ChildIterator.java
- ChildTestIterator.java DescendantIterator.java
- MatchPatternIterator.java
- SelfIteratorNoPredicate.java UnionPathIterator.java</Modified>
-<Log>Fix for problem reported by Mike Starr &lt;mike.starr@air2web.com&gt;,
- where the transformation hangs for "foo[2] | bang"
- patters, i.e. unions with positional predicates. The fix
- is to have the iterators#nextNode() set m_lastFetched to DTM.NULL
- when m_foundLast is found to be true on function entry
- (after the cache check). This allows getCurrentNode() to
- fullfill it's contract of returning null if the last fetch was
- null. The bug occured after an optimization for positional
- predicates to have them not continue searching once
- the positional node was found, by setting m_foundLast
- to true.</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/21/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/dom DTDMonitor.java</Modified>
-<Log>An attempt to optimise the building of the ID index. The previous version of
- this code would traverse the DOM once for each type of element that had a
- defined ID attribute. The new version traverses the DOM once, and looks up
- each element's type in a hashtable to determine its ID attribute type (if 
-any).
- The new version of the code does not use string comparisons, like the old one.
- This update was done to compensate for the possible performance degradation of
- having implemented an element/attribute prefix array in the internal DOM.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/21/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/trax
- TemplatesHandlerImpl.java TemplatesImpl.java
- TransformerHandlerImpl.java TransformerImpl.java</Modified>
-<Log>Protected some methods in our TrAX code that are not defined in the TrAX API.
- These methods were never intended for public use and should have been defined
- as "protected" to begin with.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/22/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler XslElement.java</Modified>
-<Log>Fix for a problem with some combinations of &lt;xsl:element&gt; and namespace
- aliasing. The output lacked the necessary namespace definitions when an
- element created with &lt;xsl:element&gt; was given a qname with a prefix that
- was mapped to some other prefix.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/23/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler ParameterRef.java</Modified>
-<Log>removed typeCheck(), uses the base classes method now</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/23/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler
- VariableRefBase.java</Modified>
-<Log>added default typeCheck() to this base class</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>tmiller@apache.org</Who>
-<DateCommitted>08/23/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler RelationalExpr.java</Modified>
-<Log>bug fix 2838, cast to type real if both operands are
- ResultTreeType</Log>
-</Commit>
-<Commit category="core">
-<Who>johng@apache.org</Who>
-<DateCommitted>08/24/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/lib/sql SQLDocument.java</Modified>
-<Log>Removed debug flag
- Submitted by:John Gentilin</Log>
-</Commit>
-<Commit category="core">
-<Who>johng@apache.org</Who>
-<DateCommitted>08/24/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/lib/sql SQLDocument.java
- XConnection.java</Modified>
-<Log>Fixed Streaming Mode
- Submitted by: John Gentilin</Log>
-</Commit>
-<Commit category="core">
-<Who>johng@apache.org</Who>
-<DateCommitted>08/24/2001</DateCommitted>
-<Modified>java/src/org/apache/xml/dtm DTM.java
- java/src/org/apache/xml/dtm/ref DTMDefaultBase.java
- DTMDocumentImpl.java DTMManagerDefault.java</Modified>
-<Log>added document registration and release events to the DTM interface
- Submitted by: John Gentilin</Log>
-</Commit>
-<Commit category="core">
-<Who>garyp@apache.org</Who>
-<DateCommitted>08/25/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/lib Extensions.java</Modified>
-<Log>Fix bug 3112 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3112). Fix 
-tokenize to work with DTM by obtaining a new DocumentBuilder and not using the 
-document from the context node.</Log>
-</Commit>
-<Commit category="core">
-<Who>garyp@apache.org</Who>
-<DateCommitted>08/26/2001</DateCommitted>
-<Modified>java/src/org/apache/xpath VariableStack.java
- java/src/org/apache/xpath/operations Variable.java</Modified>
-<Log>Fix bug 3265 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3265). Using 
-an expression in the evaluate extension function that contains a top-level 
-variable was cause an NPE.</Log>
-</Commit>
-<Commit category="core">
-<Who>sboag@apache.org</Who>
-<DateCommitted>08/26/2001</DateCommitted>
-<Modified>java/src/org/apache/xpath/objects XStringForChars.java</Modified>
-<Log>Fixed two bugs, one in getChars and one in charAt where the m_start
- offset wasn't being used correctly. This manifested itself in some
- stuff I was doing with the startsWith function, but likely caused
- many other bugs with other functionality.</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/27/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc DOM.java
- java/src/org/apache/xalan/xsltc/compiler
- AbsoluteLocationPath.java AbsolutePathPattern.java
- AncestorPattern.java ApplyTemplates.java
- BooleanExpr.java CallTemplate.java CastExpr.java
- Constants.java Copy.java CopyOf.java
- DocumentCall.java FilterExpr.java
- FilteredAbsoluteLocationPath.java ForEach.java
- FunctionCall.java Key.java KeyCall.java
- LastCall.java LocalNameCall.java Mode.java
- NameCall.java NamespaceUriCall.java Number.java
- Param.java ParameterRef.java
- ParentLocationPath.java ParentPattern.java
- PositionCall.java Predicate.java
- RelationalExpr.java Sort.java Step.java
- StepPattern.java Stylesheet.java
- SyntaxTreeNode.java Template.java TestSeq.java
- Text.java TransletOutput.java ValueOf.java
- Variable.java VariableRef.java Whitespace.java
- XSLTC.java
- java/src/org/apache/xalan/xsltc/compiler/util
- ClassGenerator.java ErrorMsg.java
- MethodGenerator.java NodeSetType.java NodeType.java
- ResultTreeType.java
- java/src/org/apache/xalan/xsltc/dom Axis.java
- DOMAdapter.java DOMImpl.java LoadDocument.java
- MultiDOM.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java BasisLibrary.java</Modified>
-<Log>Changes all calls from the compiled translet code to the DOM to be calls
- to the DOM interface (and not to a specific DOM class). I did this to make
- it possible to plugi in any DOM implementation.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="core">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/27/2001</DateCommitted>
-<Added>java/src/org/apache/xalan/xsltc StripFilter.java</Added>
-<Log>Forgot to add this file in my last putback.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/27/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/compiler Constants.java
- TransletOutput.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- TextOutput.java TransletOutputBase.java</Modified>
-<Log>Added an &lt;xsltc:output&gt; extension to allow for multiple output files. I know
- that this is not a prioritised task, but I need this for a little project I
- am working on.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/28/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/compiler Param.java
- ParameterRef.java Variable.java VariableBase.java
- VariableRef.java
- java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetType.java NodeType.java ReferenceType.java
- ResultTreeType.java StringType.java Type.java</Modified>
-<Log>A few fixes for the regression caused by my last (huge) putback.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="xsltc">
-<Who>morten@apache.org</Who>
-<DateCommitted>08/28/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java</Modified>
-<Log>A fix for the position() function when using duplicate filter iterators.
- PR: n/
- Obtained from: N/A
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org</Log>
-</Commit>
-<Commit category="core">
-<Who>jkesselm@apache.org</Who>
-<DateCommitted>08/28/2001</DateCommitted>
-<Modified>java/src/org/apache/xml/dtm/ref DTMDefaultBase.java</Modified>
-<Log>added dumpNode method, convenience for debugging.
-
- We might want to move this function up to DTMDefaultBase, or
- perhaps to the DTM API itself.</Log>
-</Commit>
-<Commit category="core">
-<Who>sboag@apache.org</Who>
-<DateCommitted>08/28/2001</DateCommitted>
-<Modified>java/src/org/apache/xalan/serialize SerializerToText.java</Modified>
-<Log>Fix http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3131 by
- overriding writeNormalizedChars and writeUTF16Surrogate to
- not do any XML escaping.</Log>
-</Commit>
-<Commit category="core">
-<Who>mmidy@apache.org</Who>
-<DateCommitted>08/28/2001</DateCommitted>
-<Modified>java/src/org/apache/xml/dtm/ref DTMDefaultBase.java</Modified>
-<Log>The index was being stored as opposed to the node handle when we were 
-replacing namespace nodes. Store the actual node handle.</Log>
-</Commit>
-</Commits>
diff --git a/compat_src/compatOverview.html b/compat_src/compatOverview.html
deleted file mode 100644
index cf64817..0000000
--- a/compat_src/compatOverview.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<HTML><HEAD></HEAD><BODY>
-    <P>This compatibility API supports limited use of the Xalan-Java 1 API in the Xalan-Java 2 environment. For the Xalan-Java 2 API, see <A href="../apidocs/index.html" target="_top">Xalan-Java 2 API</A>.</P>
-  
-     <P><B>Basic procedure for performing transformations:</B></P>
-    <OL>
-      <LI>Use one of the {@link org.apache.xalan.xslt.XSLTProcessorFactory} static getProcessor methods to
-      instantiate an {@link org.apache.xalan.xslt.XSLTProcessor}.<BR><BR>
-       The XSLT and XPath engines are independent from any given DOM or XML implementation. All parser-dependent
-       calls are funneled through the {@link org.apache.xalan.xpath.xml.XMLParserLiaison}.<BR><BR></LI>     
-       <LI>Set up {@link org.apache.xalan.xslt.XSLTInputSource} objects for the XML input and XSL stylesheet. 
-       You can use a file name or URL, character stream, byte stream, or SAX input stream to instantiate an
-       XSLTInputSource object.<BR><BR>
-       If the XML document contains a stylesheet Processing Instruction (PI), you do not need to create a separate
-       XSLTInputSource object for an XSL stylesheet.<BR><BR>
-       <B>Note:</B> For improved performance with a series of transformations, use the XSLTProcessor
-       processStylesheet method to compile the XSL stylesheet. The result is a 
-       {@link org.apache.xalan.xslt.StylesheetRoot} object with its own process() method for performing transformations.
-        Compiling the stylesheet is also useful when you need to get information from the
-       stylesheet before the transformation occurs. You also must compile the stylesheet if you are using the
-        XSLTProcessor as a SAX document handler.<BR><BR></LI>
-       <LI>Set up an {@link org.apache.xalan.xslt.XSLTResultTarget} for the transformation output. You can use a
-       file name or URL, character stream, byte stream, or SAX document handler to instantiate an XSLTResultTarget
-       object.<BR><BR></LI>
-       <LI>Use the XSLTProcessor or (if you have compiled the stylesheet) the(@link org.apache.xalan.xslt.StylesheetRoot}
-       process method to perform the transformation.<BR><BR>
-        Xalan-Java is thread-safe for one instance per thread. If you are using the same instance of XSLTProcessor to
-         perform more than one transformation, call the reset method between transformations.</LI>
-    </OL>
-  </BODY></HTML>
\ No newline at end of file
diff --git a/compat_src/org/apache/xalan/xpath/XBoolean.java b/compat_src/org/apache/xalan/xpath/XBoolean.java
deleted file mode 100644
index 00e72ed..0000000
--- a/compat_src/org/apache/xalan/xpath/XBoolean.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class represents an XPath boolean object, and is capable of 
- * converting the boolean to other types, such as a string.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XBoolean extends XObject
-{
-  org.apache.xpath.objects.XBoolean m_xboolean;
-  
-  /**
-   * Construct a XBoolean object.
-   */
-  public XBoolean(boolean b)
-  {
-    super(); 
-     m_xboolean = new org.apache.xpath.objects.XBoolean(b);
-  }
-  
-  /**
-   * Tell that this is a CLASS_BOOLEAN.
-   */
-  public int getType()
-  {
-    return m_xboolean.getType();
-  }
-  
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  public String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return m_xboolean.getTypeString();
-  }
-  
-  /**
-   * Cast result object to a number.
-   */
-  public double num()
-  {
-    return m_xboolean.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-  {
-    return m_xboolean.bool();
-  }
-
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xboolean.str();
-  }
-  
-  /**
-   * Return a java object that's closes to the represenation 
-   * that should be handed to an extension.
-   */
-  public Object object()
-  {
-    return m_xboolean.object();
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {    
-    return m_xboolean.equals(obj2);
-  }
-  
-  
-}
-
diff --git a/compat_src/org/apache/xalan/xpath/XBooleanStatic.java b/compat_src/org/apache/xalan/xpath/XBooleanStatic.java
deleted file mode 100644
index 4669bca..0000000
--- a/compat_src/org/apache/xalan/xpath/XBooleanStatic.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class doesn't have any XPathSupport, so override 
- * whatever to ensure it works OK.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XBooleanStatic extends XBoolean
-{
-  org.apache.xpath.objects.XBooleanStatic m_xboolean;
-  
-  /**
-   * Construct a XNodeSet object.
-   */
-  public XBooleanStatic(boolean b)
-  {
-    super(b); 
-    m_xboolean = new org.apache.xpath.objects.XBooleanStatic(b);
-  } 
-  
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {
-    return m_xboolean.equals(obj2);
-  }
-
-}
-
diff --git a/compat_src/org/apache/xalan/xpath/XNodeSet.java b/compat_src/org/apache/xalan/xpath/XNodeSet.java
deleted file mode 100644
index 819690c..0000000
--- a/compat_src/org/apache/xalan/xpath/XNodeSet.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-import org.w3c.dom.Text;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.NodeFilter;
-import java.text.*;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSet;
-import org.apache.xpath.DOMHelper;
-import org.apache.xml.dtm.ref.DTMNodeIterator;
-import org.apache.xml.dtm.ref.DTMNodeList;
-import org.apache.xml.dtm.ref.DTMManagerDefault;
-import org.apache.xml.dtm.DTM;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath nodeset object, and is capable of 
- * converting the nodeset to other types, such as a string.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XNodeSet extends XObject  
-{
-  org.apache.xpath.objects.XNodeSet m_xnodeset;
-  DTMManagerDefault dtmMgr = new DTMManagerDefault(); 
-  
-  /**
-   * Construct a XNodeSet object.
-   */
-  public XNodeSet(NodeList val)
-  {
-    super();
-    int node = dtmMgr.getDTMHandleFromNode(val.item(0));
-    m_xnodeset = new org.apache.xpath.objects.XNodeSet(dtmMgr.createDTMIterator(node)) ;
-  }
-  
-  /**
-   * Construct an empty XNodeSet object.
-   */
-  public XNodeSet()
-  {
-    super();
-    m_xnodeset = new org.apache.xpath.objects.XNodeSet(dtmMgr);
-  }
-
-  /**
-   * Construct a XNodeSet object for one node.
-   */
-  public XNodeSet(Node n)
-  {
-    super(n);    
-    m_xnodeset = new org.apache.xpath.objects.XNodeSet(dtmMgr.getDTMHandleFromNode(n), dtmMgr);
-  }
-  
-  
-  /**
-   * Tell that this is a CLASS_NODESET.
-   */
-  public int getType()
-  {
-    return m_xnodeset.getType();
-  }
-  
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  public String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return m_xnodeset.getTypeString();
-  }
-  
-  /**
-   * Get the string conversion from a single node.
-   */
-  double getNumberFromNode(Node n)
-  {
-    return m_xnodeset.getNumberFromNode(dtmMgr.getDTMHandleFromNode(n));
-  }
-
-  /**
-   * Cast result object to a number.
-   */
-  public double num()
-  {
-    return m_xnodeset.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-  {
-    return m_xnodeset.bool();
-  }
-  
-
-  /**
-   * Get the string conversion from a single node.
-   */
-  static String getStringFromNode(Node n)
-  {
-    switch (n.getNodeType())
-    {
-    case Node.ELEMENT_NODE :
-    case Node.DOCUMENT_NODE :
-      return DOMHelper.getNodeData(n);
-    case Node.CDATA_SECTION_NODE :
-    case Node.TEXT_NODE :
-      return ((Text) n).getData();
-    case Node.COMMENT_NODE :
-    case Node.PROCESSING_INSTRUCTION_NODE :
-    case Node.ATTRIBUTE_NODE :
-      return n.getNodeValue();
-    default :
-      return DOMHelper.getNodeData(n);
-    }
-  }
-  
-
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xnodeset.str();
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathSupport support)
-  {    
-    return rtree((XPathContext) support);
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support The XPath context to use for the conversion 
-   *
-   * @return the nodeset as a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathContext support)
-  {
-    org.apache.xpath.XPathContext context = (org.apache.xpath.XPathContext)support;
-    return m_xnodeset.rtree(context);
-    //return (DocumentFragment)context.getDTMManager().getDTM(result).getNode(result);    
-  }
-
-  /**
-   * Cast result object to a nodelist.
-   */
-  public NodeList nodeset() throws javax.xml.transform.TransformerException
-  {
-    return new DTMNodeList(m_xnodeset.iter());
-  }  
-
-  /**
-   * Cast result object to a nodelist.
-   */
-  public NodeList mutableNodeset()
-  {
-   return new DTMNodeList(m_xnodeset.mutableNodeset());
-  }  
-  
-  /**
-   * Tell if one object is less than the other.
-   */
-  public boolean lessThan(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xnodeset.lessThan(obj2.m_xObject);
-  }
-  
-  /**
-   * Tell if one object is less than or equal to the other.
-   */
-  public boolean lessThanOrEqual(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xnodeset.lessThanOrEqual(obj2.m_xObject);
-  }
-  
-  /**
-   * Tell if one object is greater than the other.
-   */
-  public boolean greaterThan(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xnodeset.greaterThan(obj2.m_xObject);
-  }
-  
-  /**
-   * Tell if one object is greater than the other.
-   */
-  public boolean greaterThanOrEqual(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xnodeset.greaterThanOrEqual(obj2.m_xObject);
-  }   
-  
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {
-    return m_xnodeset.equals(obj2);
-  }  
-  
-  /**
-   * Tell if two objects are functionally not equal.
-   */
-  public boolean notEquals(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xnodeset.notEquals(obj2.m_xObject);
-  }  
- 
- static class NodeIteratorWrapper extends org.apache.xpath.NodeSetDTM
-  {
-
-    /** Position of next node          */
-    private int m_pos = 0;
-
-    /** Document fragment instance this will wrap         */
-    private NodeList m_list;
-    private org.apache.xml.dtm.DTMManager dtmManager; 
-
-    /**
-     * Constructor NodeIteratorWrapper
-     *
-     *
-     * @param df Document fragment instance this will wrap
-     */
-    NodeIteratorWrapper(NodeList list)
-    {
-      super(new org.apache.xml.dtm.ref.DTMManagerDefault());
-      m_list = list;
-      dtmManager = getDTMManager(); 
-    }
-
-  
-    /**
-     *  Returns the next node in the set and advances the position of the
-     * iterator in the set. After a NodeIterator is created, the first call
-     * to nextNode() returns the first node in the set.
-     * @return  The next <code>Node</code> in the set being iterated over, or
-     *   <code>null</code> if there are no more members in that set.
-     * @throws DOMException
-     *    INVALID_STATE_ERR: Raised if this method is called after the
-     *   <code>detach</code> method was invoked.
-     */
-    public int nextNode() throws DOMException
-    {
-
-      Node n;
-      if (m_pos < m_list.getLength())
-      {
-       n = m_list.item(m_pos++);
-       return dtmManager.getDTMHandleFromNode(n);
-      }
-      
-      else
-        return DTM.NULL;
-    }
-
-    /**
-     *  Returns the previous node in the set and moves the position of the
-     * iterator backwards in the set.
-     * @return  The previous <code>Node</code> in the set being iterated over,
-     *   or<code>null</code> if there are no more members in that set.
-     * @throws DOMException
-     *    INVALID_STATE_ERR: Raised if this method is called after the
-     *   <code>detach</code> method was invoked.
-     */
-    public int previousNode() throws DOMException
-    {
-
-      Node n;
-      if (m_pos >0)
-      {
-        n = m_list.item(m_pos-1);
-        return dtmManager.getDTMHandleFromNode(n);
-      }
-      else
-        return DTM.NULL;
-    }
-
-    /**
-     *  Detaches the iterator from the set which it iterated over, releasing
-     * any computational resources and placing the iterator in the INVALID
-     * state. After<code>detach</code> has been invoked, calls to
-     * <code>nextNode</code> or<code>previousNode</code> will raise the
-     * exception INVALID_STATE_ERR.
-     */
-    public void detach(){}
-  }
-  
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/XNull.java b/compat_src/org/apache/xalan/xpath/XNull.java
deleted file mode 100644
index d7e46b6..0000000
--- a/compat_src/org/apache/xalan/xpath/XNull.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.apache.xpath.XPathContext;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath null object, and is capable of 
- * converting the null to other types, such as a string.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XNull extends XObject
-{
-  org.apache.xpath.objects.XNull m_xnull;
-  /**
-   * Create an XObject.
-   */
-  public XNull()
-  {
-    super();
-    m_xnull = new org.apache.xpath.objects.XNull() ;
-  }
-  
-  /**
-   * Tell what kind of class this is.
-   */
-  public int getType()
-  {
-    return m_xnull.getType();
-  }
-
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  public String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return m_xnull.getTypeString();
-  }
-  
-  /**
-   * Cast result object to a number.
-   */
-  public double num()
-  {
-    return m_xnull.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-  {
-    return m_xnull.bool();
-  }
-
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xnull.str();
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathSupport support)
-  {
-    return rtree((XPathContext)support);
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support XPath context to use for the conversion
-   *
-   * @return The object as a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathContext support)
-  {
-    org.apache.xpath.XPathContext context = (org.apache.xpath.XPathContext)support;
-    return m_xnull.rtree(context);
-    //return (DocumentFragment)context.getDTMManager().getDTM(result).getNode(result);    
-  } 
-
-  /**
-   * Cast result object to a nodelist.
-   */
-  public NodeList nodeset()
-  {
-    return null;
-  }  
-   
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-  {
-    return m_xnull.equals(obj2);
-  }
-
-  
-}
diff --git a/compat_src/org/apache/xalan/xpath/XNumber.java b/compat_src/org/apache/xalan/xpath/XNumber.java
deleted file mode 100644
index 79e1b0d..0000000
--- a/compat_src/org/apache/xalan/xpath/XNumber.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-import java.text.DecimalFormat;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath number, and is capable of 
- * converting the number to other types, such as a string.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XNumber extends XObject
-{
-  
-  org.apache.xpath.objects.XNumber m_xnumber;
-  /**
-   * Construct a XNodeSet object.
-   */
-  public XNumber(double d)
-  {
-    super();
-    m_xnumber = new org.apache.xpath.objects.XNumber(d);
-  }
-  
-  /**
-   * Tell that this is a CLASS_NUMBER.
-   */
-  public int getType()
-  {
-    return m_xnumber.getType();
-  }
-  
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  public String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return m_xnumber.getTypeString();
-  }
-  
-  /**
-   * Cast result object to a number.
-   */
-  public double num()
-  {
-    return m_xnumber.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-  {
-    return m_xnumber.bool();
-  }
-  
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xnumber.str();
-  }
-  
-  /**
-   * Return a java object that's closes to the represenation 
-   * that should be handed to an extension.
-   */
-  public Object object()
-  {
-    return m_xnumber.object();
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {
-    return m_xnumber.equals(obj2);
-  }
-  
-  
-}
-
diff --git a/compat_src/org/apache/xalan/xpath/XObject.java b/compat_src/org/apache/xalan/xpath/XObject.java
deleted file mode 100644
index 12639bb..0000000
--- a/compat_src/org/apache/xalan/xpath/XObject.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * The Apache Software License, Version 1.1 
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>. 
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-import java.io.Serializable;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath object, and is capable of 
- * converting the object to various types, such as a string.
- * This class acts as the base class to other XPath type objects, 
- * such as XString, and provides polymorphic casting capabilities.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XObject extends Object implements Serializable    
-{
-  org.apache.xpath.objects.XObject m_xObject;
-  
-  /**
-   * Create an XObject.
-   */
-  public XObject()
-  {
-    m_xObject = new org.apache.xpath.objects.XObject() ;
-  }
-
-  /**
-   * Create an XObject.
-   */
-  public XObject(Object obj)
-  {
-    m_xObject = new org.apache.xpath.objects.XObject(obj) ;
-  }
-  
-    /**
-   * Tell what kind of class this is.
-   */
-  public int getType()
-  {
-    return m_xObject.getType();
-  }
-
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  protected String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return "#UNKNOWN";
-  }
-  
-  /**
-   * Cast result object to a number.
-   */
-  public double num()
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-	  return m_xObject.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xObject.bool();
-  }
-
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xObject.str();
-  }
-  
-  public String toString()
-  {
-    return m_xObject.toString();
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathSupport support)
-  {
-    org.apache.xpath.XPathContext context = (org.apache.xpath.XPathContext)support;
-    return m_xObject.rtree(context);
-    //return  (DocumentFragment)context.getDTMManager().getDTM(result).getNode(result);         
-  }
-  
-  /**
-   * For functions to override.
-   */
-  public DocumentFragment rtree()
-  {
-    return null;
-  }
-  
-  /**
-   * Return a java object that's closes to the represenation 
-   * that should be handed to an extension.
-   */
-  public Object object()
-  {
-    return m_xObject.object();
-  }
-
-  /**
-   * Cast result object to a nodelist.
-   */
-  public NodeList nodeset()
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[] {getTypeString()}); //"Can not convert "+getTypeString()+" to a NodeList!");
-    return null;
-  }  
-  
-  /**
-   * Cast result object to a nodelist.
-   */
-  public NodeList mutableNodeset()
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return new org.apache.xml.dtm.ref.DTMNodeList(m_xObject.mutableNodeset());
-  }  
- 
-  /**
-   * Cast object to type t.
-   */
-  public Object castToType(int t, XPathSupport support)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {   
-    return m_xObject.castToType(t, (org.apache.xpath.XPathContext) support);
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   */
-  public boolean lessThan(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-   
-    return m_xObject.lessThan(obj2.m_xObject);
-  }
-
-  /**
-   * Tell if one object is less than or equal to the other.
-   */
-  public boolean lessThanOrEqual(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xObject.lessThanOrEqual(obj2.m_xObject);
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   */
-  public boolean greaterThan(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xObject.greaterThan(obj2.m_xObject);
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   */
-  public boolean greaterThanOrEqual(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xObject.greaterThanOrEqual(obj2.m_xObject);
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {
-    return m_xObject.equals(obj2.m_xObject);
-  }
-  
-  /**
-   * Tell if two objects are functionally not equal.
-   */
-  public boolean notEquals(XObject obj2)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    return m_xObject.notEquals(obj2.m_xObject);
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an 
-   * exception.
-   */
-  protected void error(int msg)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-	  error (msg, null);
-  }	   
-
-  /**
-   * Tell the user of an error, and probably throw an 
-   * exception.
-   */
-  protected void error(int msg, Object[] args)
-    throws org.xml.sax.SAXException, javax.xml.transform.TransformerException
-  {
-    String fmsg = XSLMessages.createXPATHMessage(msg, args);
-
-    
-    throw new org.xml.sax.SAXException(fmsg);
-  }
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/XPathSupport.java b/compat_src/org/apache/xalan/xpath/XPathSupport.java
deleted file mode 100644
index cfb19f3..0000000
--- a/compat_src/org/apache/xalan/xpath/XPathSupport.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-import java.util.*;
-import java.net.URL;
-import org.xml.sax.*;
-
-
-
-
-/**
- * <meta name="usage" content="advanced"/>
- * Provides basic support for independent use of XPath.  This interface 
- * is used in order that there may be loose coupling between the 
- * XPath package and the support services, such as the variable store, 
- * parser services, DOM implementation, etc.  Most if all implementations
- * of this should derive from XPathSupportDefault (hence, it should 
- * probably be an abstract class instead of an interface).
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public interface XPathSupport 
-{
-  
-}
diff --git a/compat_src/org/apache/xalan/xpath/XPathSupportDefault.java b/compat_src/org/apache/xalan/xpath/XPathSupportDefault.java
deleted file mode 100644
index b898b32..0000000
--- a/compat_src/org/apache/xalan/xpath/XPathSupportDefault.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import java.util.*;
-import org.w3c.dom.*;
-
-
-
-/**
- * <meta name="usage" content="advanced"/>
- * Default class for execution context when XPath is used by itself. Many 
- * of the functions in this class need to be overridden in order to 
- * perform correct execution of the XPath (for instance, variable 
- * execution).  This class will likely eventually replace XMLParserLiaisons.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XPathSupportDefault extends org.apache.xpath.XPathContext implements XPathSupport 
-{
-  
-}
diff --git a/compat_src/org/apache/xalan/xpath/XRTreeFrag.java b/compat_src/org/apache/xalan/xpath/XRTreeFrag.java
deleted file mode 100644
index b9a2984..0000000
--- a/compat_src/org/apache/xalan/xpath/XRTreeFrag.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-import org.w3c.dom.*;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath result tree fragment object, and is capable of 
- * converting the RTF to other types, such as a string.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XRTreeFrag extends XObject 
-{ 
-  
-  org.apache.xpath.objects.XRTreeFrag m_xrtreefrag;
-  org.apache.xpath.XPathContext context = new org.apache.xpath.XPathContext();
-    
-  
-  /**
-   * Create an XObject.
-   */
-  public XRTreeFrag(DocumentFragment frag)
-  {
-    super(frag);   
-    m_xrtreefrag = new org.apache.xpath.objects.XRTreeFrag(context.getDTMHandleFromNode(frag), context); 
-  }
-  
-  /**
-   * Tell what kind of class this is.
-   */
-  public int getType()
-  {
-    return m_xrtreefrag.getType();
-  }
-
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  public String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return m_xrtreefrag.getTypeString();
-  }
-  
-  /**
-   * Cast result object to a number.
-   */
-  public double num() throws javax.xml.transform.TransformerException
-  {    
-    return m_xrtreefrag.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-  {
-    return m_xrtreefrag.bool();
-  }
-
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xrtreefrag.str();
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   */
-  public DocumentFragment rtree()
-  {
-    return m_xrtreefrag.rtree(context);
-    //return  (DocumentFragment)context.getDTMManager().getDTM(result).getNode(result);    
-  }  
-  
-  /**
-   * Cast result object to a nodelist. (special function).
-   */
-  public NodeList convertToNodeset()
-  {
-    return ((DocumentFragment)this.object()).getChildNodes();    
-  }  
-  
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {   
-      return m_xrtreefrag.equals(obj2);    
-  }
-  
-  
-}
diff --git a/compat_src/org/apache/xalan/xpath/XString.java b/compat_src/org/apache/xalan/xpath/XString.java
deleted file mode 100644
index b0e79ae..0000000
--- a/compat_src/org/apache/xalan/xpath/XString.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath;
-
-
-import org.w3c.dom.*;
-
-import org.apache.xpath.XPathContext;
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath string object, and is capable of 
- * converting the string to other types, such as a number.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XString extends XObject
-{
-  
-  org.apache.xpath.objects.XString m_xstring;
-  
-  /**
-   * Construct a XString object.
-   */
-  public XString(String val)
-  {
-    super(val);
-    m_xstring = new org.apache.xpath.objects.XString(val);
-  }
-  
-   /**
-   * Tell that this is a CLASS_STRING.
-   */
-  public int getType()
-  {
-    return m_xstring.getType();
-  }
-  
-  /**
-   * Given a request type, return the equivalent string. 
-   * For diagnostic purposes.
-   */
-  public String getTypeString() // PR:DMAN4MBJ4D Submitted by:<garyp@firstech.com> change to protected
-  {
-    return m_xstring.getTypeString();
-  }
-  
-  /**
-   * Cast a string to a number.
-   */
-  public static double castToNum(String s)
-  {  
-    double result;
-
-    if (null == s)
-      result = 0.0;
-    else
-    {
-      try
-      {
-
-        /**
-         * TODO: Adjust this for locale. Need to take into
-         * account the lang parameter on the xsl:sort
-         */
-
-        // It seems we can not use this as it just parses the 
-        // start of the string until it finds a non-number char, 
-        // which is not what we want according to the XSLT spec.  
-        // Also, I *think* this is a local-specific
-        // parse, which is also not what we want according to the 
-        // XSLT spec (see below).
-        // NumberFormat formatter = NumberFormat.getNumberInstance();
-        // result = formatter.parse(s.trim()).doubleValue();
-        // The dumb XSLT spec says: "The number function should 
-        // not be used for conversion of numeric data occurring 
-        // in an element in an XML document unless the element 
-        // is of a type that represents numeric data in a 
-        // language-neutral format (which would typically be 
-        // transformed into a language-specific format for 
-        // presentation to a user). In addition, the number 
-        // function cannot be used unless the language-neutral 
-        // format used by the element is consistent with the 
-        // XPath syntax for a Number."
-        // So I guess we need to check, if the default local 
-        // is french, does Double.valueOf use the local specific 
-        // parse?  Or does it use the ieee parse?
-        result = Double.valueOf(s.trim()).doubleValue();
-      }
-
-      // catch (ParseException e) 
-      catch (NumberFormatException nfe)
-      {
-        result = Double.NaN;
-      }
-    }
-
-    return result;  
-  }
-  
-  /**
-   * Cast result object to a number.
-   */
-  public double num()
-  {
-    return m_xstring.num();
-  }
-
-  /**
-   * Cast result object to a boolean.
-   */
-  public boolean bool()
-  {
-    return m_xstring.bool();
-  }
-
-  /**
-   * Cast result object to a string.
-   */
-  public String str()
-  {
-    return m_xstring.str();
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathSupport support)
-  {  
-    org.apache.xpath.XPathContext context = (org.apache.xpath.XPathContext)support;
-    return m_xstring.rtree(context);
-    //return (DocumentFragment)context.getDTMManager().getDTM(result).getNode(result);    
-  }
-  
-  
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support Xpath context to use for the conversion 
-   *
-   * @return A document fragment with this string as a child node
-   */
-  public DocumentFragment rtree(XPathContext support)
-  {
-    org.apache.xpath.XPathContext context = (org.apache.xpath.XPathContext)support;
-    return m_xstring.rtree(context);
-    //return (DocumentFragment)context.getDTMManager().getDTM(result).getNode(result);    
-  } 
-  
-  
-  /**
-   * Tell if two objects are functionally equal.
-   */
-  public boolean equals(XObject obj2)
-    throws org.xml.sax.SAXException
-  {
-    return m_xstring.equals(obj2);
-  }
-
-  
-}
diff --git a/compat_src/org/apache/xalan/xpath/package.html b/compat_src/org/apache/xalan/xpath/package.html
deleted file mode 100644
index 29a55da..0000000
--- a/compat_src/org/apache/xalan/xpath/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<HTML><HEAD></HEAD><BODY>
-     <P>Infrastructure for processing XPATH expressions</P>
-   
-     <P></P>
-   </BODY></HTML>
\ No newline at end of file
diff --git a/compat_src/org/apache/xalan/xpath/xdom/XercesLiaison.java b/compat_src/org/apache/xalan/xpath/xdom/XercesLiaison.java
deleted file mode 100644
index 8c4478b..0000000
--- a/compat_src/org/apache/xalan/xpath/xdom/XercesLiaison.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xdom;
-
-import java.net.*;
-import java.io.*;
-import java.util.*;
-import org.apache.xerces.dom.*;
-import org.apache.xerces.parsers.*;
-import org.apache.xerces.framework.*;
-import org.xml.sax.*;
-import org.w3c.dom.*;
-import org.apache.xalan.xpath.xml.*;
-import org.apache.xalan.xpath.*;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.parsers.*;
-
-
-/**
- * <meta name="usage" content="general"/>
- * Provides XSLTProcessor an interface to the Xerces XML parser.  This 
- * liaison should be used if Xerces DOM nodes are being process as 
- * the source tree or as the result tree.
- * @see org.apache.xalan.xslt.XSLTProcessor
- * @see org.apache.xml.parsers
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XercesLiaison extends XMLParserLiaisonDefault //implements XPathSupport
-{
-  /**
-   * Return a string suitible for telling the user what parser is being used.
-   */
-  public String getParserDescription()
-  {
-    return "XML4J Version "+ getXML4JVersionString();
-  }
-
-	private org.xml.sax.ErrorHandler m_errorHandler;
-  /**
-   * Constructor that takes SAX ErrorHandler as an argument. The error handler
-   * is registered with the XML Parser. Any XML-related errors will be reported
-   * to the calling application using this error handler.
-   *
-   * @param	errorHandler SAX ErrorHandler instance.
-   */
-  public XercesLiaison(org.xml.sax.ErrorHandler errorHandler)
-  {
-    m_errorHandler = errorHandler;
-  }
-
-  /**
-   * Construct an instance.
-   *
-  public XercesLiaison(XPathEnvSupport envSupport)
-  {
-    m_envSupport = envSupport;
-  }*/
-
-  /**
-   * Construct an instance.
-   */
-  public XercesLiaison()
-  {
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Check node to see if it matches this liaison.
-   */
-  public void checkNode(Node node)
-    throws TransformerException
-  {
-    if(!(node instanceof org.apache.xerces.dom.NodeImpl))
-      throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"XercesLiaison can not handle nodes of type"
-        //+((Object)node).getClass());
-  }
-
-  /**
-   * Returns true that this implementation does support
-   * the SAX DocumentHandler interface.
-   */
-  public boolean supportsSAX()
-  {
-    return true;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get Xerces version field... we have to do this 'cause
-   * the "public static final" fields seem to get bound
-   * at compile time otherwise.
-   */
-  private String getXML4JVersionString()
-  {
-    // return Version.fVersion;
-    String version = "";
-    try
-    {
-      java.lang.reflect.Field versionField = Version.class.getField("fVersion");
-      version = (String)versionField.get(null);
-    }
-    catch(Exception e)
-    {
-    }
-    return version;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get one of the Xerces version numbers...
-   * we have to do this 'cause the "public static final"
-   * fields seem to get bound at compile time otherwise.
-   */
-  private int getXML4JVersionNum(int field)
-  {
-    int versionNum = 0;
-    String ver = getXML4JVersionString();
-    StringTokenizer tokenizer = new StringTokenizer(ver, " .");
-    for(int i = 0; tokenizer.hasMoreTokens(); i++)
-    {
-      String tok = tokenizer.nextToken();
-      if(field == i)
-      {
-        versionNum = Integer.parseInt(tok);
-      }
-    }
-    return versionNum;
-  }
-  
-  /**
-   * Pool the DOM parsers for reuse.
-   *
-  private ObjectPool m_domParserPool = new ObjectPool(DOMParser.class);
-  
-  /**
-   * Pool the SAX parsers for reuse.
-   *
-  private ObjectPool m_saxParserPool = new ObjectPool(SAXParser.class);
- 
-  /**
-   * Count the parses since the last garbage collection.  GC every 
-   * 10 parses or so.  (This might be a bad idea, but it seems to 
-   * help...)
-   *
-  protected int m_parseCountSinceGC = 0;
-*/
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Parse an XML document.
-   *
-   * <p>The application can use this method to instruct the SAX parser
-   * to begin parsing an XML document from any valid input
-   * source (a character stream, a byte stream, or a URI).</p>
-   *
-   * <p>Applications may not invoke this method while a parse is in
-   * progress (they should create a new Parser instead for each
-   * additional XML document).  Once a parse is complete, an
-   * application may reuse the same Parser object, possibly with a
-   * different input source.</p>
-   *
-   * @param source The input source for the top-level of the
-   *        XML document.
-   * @exception org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @exception java.io.IOException An IO exception from the parser,
-   *            possibly from a byte stream or character stream
-   *            supplied by the application.
-   * @see org.xml.sax.InputSource
-   * @see #parse(java.lang.String)
-   * @see #setEntityResolver
-   * @see #setDTDHandler
-   * @see #setDocumentHandler
-   * @see #setErrorHandler
-   */
-  public void parse (InputSource source)
-    throws javax.xml.transform.TransformerException
-  {
-   try
-    {
-
-      // I guess I should use JAXP factory here... when it's legal.
-      // org.apache.xerces.parsers.DOMParser parser 
-      //  = new org.apache.xerces.parsers.DOMParser();
-      DocumentBuilderFactory builderFactory =
-        DocumentBuilderFactory.newInstance();
-
-      builderFactory.setNamespaceAware(true);      
-
-      DocumentBuilder parser = builderFactory.newDocumentBuilder();
-			if (m_errorHandler == null)
-				parser.setErrorHandler(new org.apache.xml.utils.DefaultErrorHandler());
-			else
-				parser.setErrorHandler(m_errorHandler);
-
-      // if(null != m_entityResolver)
-      // {
-      // System.out.println("Setting the entity resolver.");
-      //  parser.setEntityResolver(m_entityResolver);
-      // }
-      setDocument(parser.parse(source));
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-    catch (ParserConfigurationException pce)
-    {
-      throw new TransformerException(pce);
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerException(ioe);
-    }
-  }
-  
-  public void copyFromOtherLiaison(XMLParserLiaisonDefault from)
-    throws SAXException
-  {
-    //super.copyFromOtherLiaison(from);
-    if(null != from) // defensive
-    {
-      if(from instanceof XercesLiaison)
-        this.m_useDOM2getNamespaceURI = ((XercesLiaison)from).m_useDOM2getNamespaceURI;
-    }
- }
-
-
-  /**
-   * Create an empty DOM Document.  Mainly used for creating an
-   * output document.  Implementation of XMLParserLiaison
-   * interface method.
-   */
-  static public Document createDocument()
-  {
-    org.apache.xerces.dom.DocumentImpl doc = new org.apache.xerces.dom.DocumentImpl();
-    return doc;
-  }
-
-  /**
-   * Given an ID, return the element.
-   */
-  public Element getElementByID(String id, Document doc)
-  {
-    return ((DocumentImpl)doc).getIdentifier(id);
-  }
-
-  /**
-   * Tell if the node is ignorable whitespace.
-   * @deprecated
-   */
-  public boolean isIgnorableWhitespace(Text node)
-  {
-    boolean isIgnorable;
-    if( node instanceof org.apache.xerces.dom.TextImpl)
-    {
-      isIgnorable = ((org.apache.xerces.dom.TextImpl)node).isIgnorableWhitespace();
-    }
-    else
-    {
-      isIgnorable = false;
-    }
-    return isIgnorable;
-  }
-  
-  protected boolean m_useDOM2getNamespaceURI = true;
-  
-  /**
-   * Set whether or not getNamespaceOfNode should use the Xerces/DOM2
-   * getNamespaceURI.  This has to be set to true if the 
-   * http://xml.org/sax/features/namespaces is set to false, or if 
-   * the tree is mutated.
-   */
-  public void setUseDOM2getNamespaceURI(boolean b)
-  {
-    m_useDOM2getNamespaceURI = b;
-  }
-
-  
-  /**
-   * Get the namespace of the node.  Calls org.apache.xerces.dom.NodeImpl's
-   * getNamespaceURI() if setUseDOM2getNamespaceURI(true) has been called.
-   */
-  public String getNamespaceOfNode(Node n)
-  {
-    return(m_useDOM2getNamespaceURI) ?
-          ((org.apache.xerces.dom.NodeImpl)n).getNamespaceURI()
-          : super.getNamespaceOfNode(n);
-  }
-  
-
-  /**
-  * Returns the local name of the given node.
-  */
-  // public String getLocalNameOfNode(Node n)
-  // {
-  //   return ((org.apache.xerces.dom.NodeImpl)n).getLocalName();
-  // }
-
-  /**
-  * Returns the element name with the namespace expanded.
-  */
-  // public String getExpandedElementName(Element elem)
-  // {
-  //  String namespace = getNamespaceOfNode(elem);
-  //   return (null != namespace) ? namespace+":"+ getLocalNameOfNode(elem)
-  //                                : getLocalNameOfNode(elem);
-  // }
-
-  /**
-  * Returns the attribute name with the namespace expanded.
-  */
-  // public String getExpandedAttributeName(Attr attr)
-  // {
-  //  String namespace = getNamespaceOfNode(attr);
-  //   return (null != namespace) ? namespace+":"+ getLocalNameOfNode(attr)
-  //                               : getLocalNameOfNode(attr);
-  // }
-
-  /**
-   * Get the parent of a node.
-   */
-  static public Node getParentOfNode(Node node)
-    throws RuntimeException
-  {
-    return (Node.ATTRIBUTE_NODE == node.getNodeType())
-           ? ((Attr)node).getOwnerElement() : node.getParentNode();
-  }
-
-}
-
-
diff --git a/compat_src/org/apache/xalan/xpath/xml/FormatterToDOM.java b/compat_src/org/apache/xalan/xpath/xml/FormatterToDOM.java
deleted file mode 100644
index 490c968..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/FormatterToDOM.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import org.w3c.dom.*;
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-//import org.apache.xml.serialize.BaseMarkupSerializer;
-import org.apache.xalan.serialize.DOMSerializer;
-import org.apache.xalan.serialize.SerializerToXML;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.SAXException;
-
-
-/**
- * <meta name="usage" content="general"/>
- * This class takes SAX events (in addition to some extra events 
- * that SAX doesn't handle yet) and adds the result to a document 
- * or document fragment.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class FormatterToDOM extends ParserAdapter
-{ 
-  DOMSerializer m_serializer;
-    
-  /**
-   * FormatterToDOM instance constructor... it will add the DOM nodes 
-   * to the document fragment.
-   */
-  public FormatterToDOM(Document doc, Element elem) throws SAXException
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    try{
-      m_serializer = (new SerializerToXML()).asDOMSerializer();
-      this.setContentHandler((SerializerToXML)m_serializer);
-    }
-    catch (java.io.IOException ioe)
-    {}
-  }
-
-  /**
-   * FormatterToDOM instance constructor... it will add the DOM nodes 
-   * to the document fragment.
-   */
-  public FormatterToDOM(Document doc, DocumentFragment docFrag) throws SAXException
-  {
-    super(new org.apache.xerces.parsers.SAXParser()); 
-    try{
-      m_serializer = (new SerializerToXML()).asDOMSerializer();
-      this.setContentHandler((SerializerToXML)m_serializer);
-    }
-    catch (java.io.IOException ioe)
-    {}
-  }
-
-  /**
-   * FormatterToDOM instance constructor... it will add the DOM nodes 
-   * to the document.
-   */
-  public FormatterToDOM(Document doc) throws SAXException
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    try{
-      m_serializer = (new SerializerToXML()).asDOMSerializer();
-      this.setContentHandler((SerializerToXML)m_serializer);
-    }
-    catch (java.io.IOException ioe)
-    {}
-  }
-  
-  public SerializerToXML getSerializerObject()
-  {
-    return (SerializerToXML)m_serializer;
-  }
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/xml/FormatterToHTML.java b/compat_src/org/apache/xalan/xpath/xml/FormatterToHTML.java
deleted file mode 100644
index 5f8411b..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/FormatterToHTML.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import java.io.Writer;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.serialize.SerializerToHTML;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.SAXException;
-//import org.apache.xml.serialize.OutputFormat;
-
-/**
- * <meta name="usage" content="general"/>
- * FormatterToHTML formats SAX-style events into XML.
- * Warning: this class will be replaced by the Xerces Serializer classes.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class FormatterToHTML extends ParserAdapter
-{ 
-  
-  SerializerToHTML m_serializer;
-  
-  public FormatterToHTML() throws SAXException 
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToHTML();
-    this.setContentHandler(m_serializer);  
-  }
-  
-  /**
-   * Constructor using a writer.
-   * @param writer        The character output stream to use.
-   */
-  public FormatterToHTML(Writer writer) throws SAXException  
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToHTML();
-    m_serializer.setWriter(writer);
-    this.setContentHandler(m_serializer);    
-  }
-  
-  /**
-   * Constructor using an output stream, and a simple OutputFormat.
-   * @param writer        The character output stream to use.
-   */
-  public FormatterToHTML(java.io.OutputStream os)  
-    throws UnsupportedEncodingException, SAXException 
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToHTML();
-    m_serializer.setOutputStream(os);
-    this.setContentHandler(m_serializer);
-    
-  }
-  
-  /**
-   * Constructor using a writer.
-   * @param writer        The character output stream to use.
-   */
-  public FormatterToHTML(FormatterToXML xmlListener) throws SAXException 
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToHTML();
-    m_serializer.CopyFrom(xmlListener.m_serializer);
-    this.setContentHandler(m_serializer);
-  }
-  
-  public SerializerToHTML getSerializerObject()
-  {
-    return m_serializer;
-  }
-  
-}
-
diff --git a/compat_src/org/apache/xalan/xpath/xml/FormatterToText.java b/compat_src/org/apache/xalan/xpath/xml/FormatterToText.java
deleted file mode 100644
index 889eda0..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/FormatterToText.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import java.io.Writer;
-
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.serialize.SerializerToText;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.SAXException;
-
-/**
- * <meta name="usage" content="general"/>
- * This class takes SAX events (in addition to some extra events 
- * that SAX doesn't handle yet) and produces simple text only.
- * Warning: this class will be replaced by the Xerces Serializer classes.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class FormatterToText extends ParserAdapter
-{
-  
-  private SerializerToText m_serializer;
-  /**
-   * FormatterToText instance constructor... it will add the DOM nodes 
-   * to the document fragment.
-   */
-  public FormatterToText(Writer pw) throws SAXException
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToText(); 
-    m_serializer.setWriter(pw);
-    this.setContentHandler(m_serializer);
-  }
-  
-  public SerializerToText getSerializerObject()
-  {
-    return m_serializer;
-  }
-
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/xml/FormatterToXML.java b/compat_src/org/apache/xalan/xpath/xml/FormatterToXML.java
deleted file mode 100644
index 70eaade..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/FormatterToXML.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import java.io.Writer;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.serialize.SerializerToXML;
-//import org.apache.xml.serialize.BaseMarkupSerializer;
-import org.apache.xalan.serialize.Method;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.SAXException;
-
-
-/**
- * <meta name="usage" content="general"/>
- * FormatterToXML formats SAX-style events into XML.
- * Warning: this class will be replaced by the Xerces Serializer classes.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class FormatterToXML extends ParserAdapter
-{
-  SerializerToXML m_serializer;
-  
-  public FormatterToXML()
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToXML();
-    this.setContentHandler(m_serializer);
-    //super( new OutputFormat( Method.XML, null, false ) );     
-  }
-  
-  /**
-   * Constructor using a writer.
-   * @param writer        The character output stream to use.
-   */
-  public FormatterToXML(Writer writer) throws SAXException 
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToXML();
-   // super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
-    //_format.setMethod( Method.XML );
-    m_serializer.setWriter( writer );
-    this.setContentHandler(m_serializer);
-  }
-  
-  /**
-   * Constructor using an output stream, and a simple OutputFormat.
-   * @param writer        The character output stream to use.
-   */
-  public FormatterToXML(java.io.OutputStream os) 
-    throws UnsupportedEncodingException , SAXException 
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToXML();
-    //super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
-    //_format.setMethod( Method.XML );
-    m_serializer.setOutputStream( os );
-    this.setContentHandler(m_serializer);
-  }
-  
-  /**
-   * Constructor using a writer.
-   * @param writer        The character output stream to use.
-   */
-  public FormatterToXML(FormatterToXML xmlListener) throws SAXException 
-  {
-    super(new org.apache.xerces.parsers.SAXParser());
-    m_serializer = new SerializerToXML();
-    m_serializer.CopyFrom(xmlListener.m_serializer);
-    //super( new OutputFormat( Method.XML, null, false ) );
-    this.setContentHandler(m_serializer);
-  }
-  
-  public SerializerToXML getSerializerObject()
-  {
-    return m_serializer;
-  }
-  
-
-}  //ToXMLStringVisitor
diff --git a/compat_src/org/apache/xalan/xpath/xml/ProblemListener.java b/compat_src/org/apache/xalan/xpath/xml/ProblemListener.java
deleted file mode 100644
index feaf996..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/ProblemListener.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import org.w3c.dom.*;
-
-/**
- * <meta name="usage" content="general"/>
- * This is the interface that the XSL processor calls when it 
- * has a problem of some kind, either an error or a warning.
- * Users should ass the XSLTEngineImpl class to setProblemListener
- * if they wish an object instance to be called when a problem
- * event occurs.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public interface ProblemListener
-{
-  public static final short    WARNING         = 1;
-  public static final short    ERROR           = 2;
-  public static final short    MESSAGE         = 3;
-
-  public static final short    XMLPARSER       = 1;
-  public static final short    XSLPROCESSOR    = 2;
-  public static final short    QUERYENGINE     = 3;
-  public static final short    XPATHPROCESSOR  = 4;
-  public static final short    XPATHPARSER  = 5;
-
-  /**
-   * Function that is called when a problem event occurs.
-   * 
-   * @param   where             Either and XMLPARSER, XSLPROCESSOR, or QUERYENGINE.
-   * @param   classification    Either ERROR or WARNING.
-   * @param   styleNode         The style tree node where the problem
-   *                            occurred.  May be null.
-   * @param   sourceNode        The source tree node where the problem
-   *                            occurred.  May be null.
-   * @param   msg               A string message explaining the problem.
-   * @param   lineNo            The line number where the problem occurred,  
-   *                            if it is known. May be zero.
-   * @param   charOffset        The character offset where the problem,  
-   *                            occurred if it is known. May be zero.
-   * 
-   * @return  true if the return is an ERROR, in which case
-   *          exception will be thrown.  Otherwise the processor will 
-   *          continue to process.
-   */
-  public boolean problem(short where, short classification, 
-                       Object styleNode, Node sourceNode,
-                       String msg, String id, int lineNo, int charOffset)
-    throws org.xml.sax.SAXException  ;
-  
-  /**
-   * Function that is called to issue a message.
-   * @param   msg               A string message to output.
-   */
-  public boolean message(String msg);
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/xml/ProblemListenerDefault.java b/compat_src/org/apache/xalan/xpath/xml/ProblemListenerDefault.java
deleted file mode 100644
index f1a7ba2..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/ProblemListenerDefault.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import org.w3c.dom.*;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXException;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="general"/>
- * This is the interface that the XSL processor calls when it 
- * has a problem of some kind, either an error or a warning.
- * Users should ass the XSLTEngineImpl class to setProblemListener
- * if they wish an object instance to be called when a problem
- * event occurs.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class ProblemListenerDefault extends org.apache.xml.utils.DefaultErrorHandler implements ProblemListener 
-{
-  //ErrorHandler m_errorHandler = null;
-  ProblemListener m_problemListener = null;
-  
-  public ProblemListenerDefault()
-  {
-    super();    
-  }
-  
-  public ProblemListenerDefault(ProblemListener l)
-  { 
-    //m_errorHandler = handler;
-    m_problemListener = l;
-  }
-  /*
-  public void setErrorHandler (ErrorHandler handler)
-  {
-    m_errorHandler = handler;
-  }
-  */
-  public void setProblemListener (ProblemListener l)
-  {
-    m_problemListener = l;
-  }
-  
-  public ErrorHandler getErrorHandler ()
-  {
-    return this; // m_errorHandler;
-  }
-  
-  public ProblemListener getProblemListener ()
-  {
-    if (m_problemListener != null)
-      return m_problemListener;
-    else
-      return this;
-  }
-  
-  /**
-   * Function that is called to issue a message.
-   * @param   msg               A string message to output.
-   */
-  public boolean message(String msg)
-  {
-      if (m_problemListener != null)
-        m_problemListener.message(msg);
-      synchronized (this)
-      {  
-        new java.io.PrintWriter(  System.err, true ).println( msg );
-      } 
-   
-    return false;                    // we don't know this is an error 
-  }
-  
-  public boolean problem(short where, short classification, 
-                       Object styleNode, Node sourceNode,
-                       String msg, String id, int lineNo, int charOffset)
-  throws org.xml.sax.SAXException   
-  {
-    if (m_problemListener != null)
-      return m_problemListener.problem(where, classification, styleNode, sourceNode, msg, id, lineNo, charOffset);
-    else
-    {  
-      this.error(new SAXParseException(msg, null, id, lineNo, charOffset));
-      return false;   
-    }
-  } 
-  
-  public void warning(SAXParseException exception) throws SAXException
-  {
-    if (m_problemListener == null)
-    {
-      super.warning(exception);    
-    }
-    else
-    {
-      boolean shouldthrow = m_problemListener.problem(XSLPROCESSOR, WARNING,
-                                null, null,
-                                exception.getMessage(),
-                                exception.getSystemId(),
-                                exception.getLineNumber(),  
-                                exception.getColumnNumber()); 
-      if (shouldthrow)
-        throw new SAXException(exception);
-    }
-  }
-  
-  public void error(SAXParseException exception) throws SAXException
-  {
-    if (m_problemListener == null)
-    {
-      super.error(exception);    
-    }
-    else
-    {
-      boolean shouldthrow = m_problemListener.problem(XSLPROCESSOR, ERROR,
-                                null, null,
-                                exception.getMessage(),
-                                exception.getSystemId(),
-                                exception.getLineNumber(),  
-                                exception.getColumnNumber()); 
-      if (shouldthrow)
-        throw new SAXException(exception);
-    }
-  }
-  
-  public void fatalError(SAXParseException exception) throws SAXException
-  {
-    if (m_problemListener == null)
-    {
-      super.fatalError(exception);    
-    }
-    else
-    {
-      boolean shouldthrow = m_problemListener.problem(XSLPROCESSOR, ERROR,
-                                null, null,
-                                exception.getMessage(),
-                                exception.getSystemId(),
-                                exception.getLineNumber(),  
-                                exception.getColumnNumber()); 
-      if (shouldthrow)
-        throw new SAXException(exception);
-    }
-  }
-  
-  public void warning(TransformerException exception) throws TransformerException
-  {
-    if (m_problemListener == null)
-    {
-      super.warning(exception);    
-    }
-    else
-    {
-      boolean shouldthrow = true;
-      try{
-        javax.xml.transform.SourceLocator locator = exception.getLocator();
-        if (locator != null)
-        {
-          shouldthrow = m_problemListener.problem(XSLPROCESSOR, WARNING,
-                                                  null, null,
-                                                  exception.getMessage(),
-                                                  locator.getSystemId(),
-                                                  locator.getLineNumber(),  
-                                                  locator.getColumnNumber());
-        }
-        else 
-        {
-          shouldthrow = m_problemListener.problem(XSLPROCESSOR, MESSAGE,
-                                                  null, null,
-                                                  exception.getMessage(),
-                                                  null,
-                                                  0,  
-                                                  0);
-        }
-      }
-      catch (SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      if (shouldthrow)
-        throw new TransformerException(exception);
-    }
-  }
-  
-  public void error(TransformerException exception) throws TransformerException
-  {
-    if (m_problemListener == null)
-    {
-      super.error(exception);    
-    }
-    else
-    {
-      boolean shouldthrow = true;
-      try{
-        javax.xml.transform.SourceLocator locator = exception.getLocator();
-        if (locator != null)
-        {
-          shouldthrow = m_problemListener.problem(XSLPROCESSOR, ERROR,
-                                                  null, null,
-                                                  exception.getMessage(),
-                                                  locator.getSystemId(),
-                                                  locator.getLineNumber(),  
-                                                  locator.getColumnNumber());
-        }
-        else 
-        {
-          shouldthrow = m_problemListener.problem(XSLPROCESSOR, ERROR,
-                                                  null, null,
-                                                  exception.getMessage(),
-                                                  null,
-                                                  0,  
-                                                  0);
-        }
-      }
-      catch (SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      if (shouldthrow)
-        throw new TransformerException(exception);
-    }
-  }
-  
-  public void fatalError(TransformerException exception) throws TransformerException
-  {
-    if (m_problemListener == null)
-    {
-      super.fatalError(exception);    
-    }
-    else
-    {
-      boolean shouldthrow = true;
-      try{
-        javax.xml.transform.SourceLocator locator = exception.getLocator();
-        if (locator != null)
-        {
-          shouldthrow = m_problemListener.problem(XSLPROCESSOR, ERROR,
-                                                  null, null,
-                                                  exception.getMessage(),
-                                                  locator.getSystemId(),
-                                                  locator.getLineNumber(),  
-                                                  locator.getColumnNumber());
-        }
-        else 
-        {
-          shouldthrow = m_problemListener.problem(XSLPROCESSOR, ERROR,
-                                                  null, null,
-                                                  exception.getMessage(),
-                                                  null,
-                                                  0,  
-                                                  0);
-        }
-      }
-      catch (SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      if (shouldthrow)
-        throw new TransformerException(exception);
-    }
-  }
-  /*
-  private class MessageMgr extends org.apache.xalan.transformer.MsgMgr 
-  {
-    void MessageMgr()
-    {}
-  }*/
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/xml/TreeWalker.java b/compat_src/org/apache/xalan/xpath/xml/TreeWalker.java
deleted file mode 100644
index 0bc4701..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/TreeWalker.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The Apache Software License, Version 1.1 
- * 
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xml.utils.AttList;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class does a pre-order walk of the DOM tree, calling the FormatterListener
- * interface as it goes.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class TreeWalker //extends org.apache.xml.utils.TreeWalker
-{
-  
-  org.apache.xml.utils.TreeWalker m_walker; 
-  
-  /**
-   * Constructor.
-   * @param   formatterListener The implemention of the 
-   * FormatterListener operation (toXMLString, digest, ...)
-   */
-  public TreeWalker(DocumentHandler formatterListener) 
-  {
-    if(formatterListener instanceof FormatterToXML)
-      m_walker = new org.apache.xml.utils.TreeWalker(((FormatterToXML)formatterListener).getSerializerObject(), new org.apache.xpath.DOM2Helper());
-    //super(formatterListener);
-  } 
- 
-  /**
-   * Perform a pre-order traversal non-recursive style.
-   */
-  public void traverse(Node pos) throws SAXException 
-  {
-    m_walker.traverse(pos);
-  }
-  
-  /**
-   * Perform a pre-order traversal non-recursive style.
-   */
-  public void traverse(Node pos, Node top) throws SAXException 
-  {
-    m_walker.traverse(pos, top);
-  }
-  
-  
-  
-}  //TreeWalker
diff --git a/compat_src/org/apache/xalan/xpath/xml/XMLParserLiaison.java b/compat_src/org/apache/xalan/xpath/xml/XMLParserLiaison.java
deleted file mode 100644
index 822b46b..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/XMLParserLiaison.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import org.w3c.dom.*;
-import org.apache.xpath.DOM2Helper;
-
-/**
- * <meta name="usage" content="general"/>
- * This is the interface that the XSL processor calls when it 
- * has a problem of some kind, either an error or a warning.
- * Users should ass the XSLTEngineImpl class to setProblemListener
- * if they wish an object instance to be called when a problem
- * event occurs.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XMLParserLiaison extends DOM2Helper
-{
-  
-
-}
diff --git a/compat_src/org/apache/xalan/xpath/xml/XMLParserLiaisonDefault.java b/compat_src/org/apache/xalan/xpath/xml/XMLParserLiaisonDefault.java
deleted file mode 100644
index f3ade6c..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/XMLParserLiaisonDefault.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xpath.xml;
-
-import javax.xml.parsers.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-import org.xml.sax.*;
-import org.w3c.dom.*;
-
-import org.apache.xalan.xpath.*;
-import org.apache.xpath.*;
-import org.apache.xalan.xpath.xml.XMLParserLiaison;
-
-/**
- * A class that handles interfacing IBM's XML4J2 to the 
- * Lotus XSL Processor.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XMLParserLiaisonDefault extends XMLParserLiaison 
-{
-  
-}
-
-
diff --git a/compat_src/org/apache/xalan/xpath/xml/package.html b/compat_src/org/apache/xalan/xpath/xml/package.html
deleted file mode 100644
index 57ee7d1..0000000
--- a/compat_src/org/apache/xalan/xpath/xml/package.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<HTML><HEAD></HEAD><BODY>
-     <P>Infrastructure for working with an XML parser.</P>
-   
-      <P>An implementation of the {@link org.apache.xalan.xpath.xml.XMLParserLiaison} interface provides a liaison
-     between the XSLT processor and an XML parser. Unless you specify an XML parser and your own implementation of 
-     the XMLParserLiaison interface, Xalan-Java uses the 
-     {@link org.apache.xalan.xpath.xml.XMLParserLiaisonDefault}:</P>
-     <P>This package also includes four implementations of the <A href="http://www.megginson.com/SAX/sax.html" target="_top">SAX</A> <A href="http://www.megginson.com/SAX/javadoc/org.xml.sax.DocumentHandler.html#_top" target="_top">org.xml.sax.DocumentHandler</A> interface:</P>
-     <UL>
-     <LI>{@link org.apache.xalan.xpath.xml.FormatterToDOM}</LI>
-     <LI>{@link org.apache.xalan.xpath.xml.FormatterToXML}</LI>
-     <LI>{@link org.apache.xalan.xpath.xml.FormatterToHTML} (an extension of FormatterToXML)</LI>
-     <LI>{@link org.apache.xalan.xpath.xml.FormatterToText}</LI>
-     </UL>
-   </BODY></HTML>
\ No newline at end of file
diff --git a/compat_src/org/apache/xalan/xslt/Stylesheet.java b/compat_src/org/apache/xalan/xslt/Stylesheet.java
deleted file mode 100644
index 1a4243b..0000000
--- a/compat_src/org/apache/xalan/xslt/Stylesheet.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.xslt;
-
-import java.net.*;
-import java.io.*;
-import org.xml.sax.*;
-
-
-/**
- * Represents the base stylesheet or an
- * "import" stylesheet; "include" stylesheets are
- * combined with the including stylesheet.
- * At the moment these stylesheets can not be reused within the
- * stylesheet tree or between trees.  This needs to be fixed
- * in the future.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class Stylesheet  extends org.apache.xalan.templates.Stylesheet
-{ 
-	
-	 /**
-   * Constructor for a Stylesheet needs a Document.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public Stylesheet(StylesheetRoot root,
-                    XSLTEngineImpl processor,
-                    String baseIdentifier)
-    throws XSLProcessorException,
-           MalformedURLException,
-           FileNotFoundException,
-           IOException,
-           SAXException
-  {
-		super(root.getObject());    
-  }
-	
-	/**
-   * Constructor using an org.apache.xalan.templates.StylesheetRoot.
-   * 
-   * @param s an org.apache.xalan.templates.Stylesheet object
-   */
-  public Stylesheet(org.apache.xalan.templates.Stylesheet s)    
-  { 
-		super(s);
-       
-  }
-	
-}
diff --git a/compat_src/org/apache/xalan/xslt/StylesheetHandler.java b/compat_src/org/apache/xalan/xslt/StylesheetHandler.java
deleted file mode 100644
index 3bc29af..0000000
--- a/compat_src/org/apache/xalan/xslt/StylesheetHandler.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import java.util.*;
-import org.xml.sax.*;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.helpers.ParserAdapter;
-import org.w3c.dom.*;
-import java.util.Vector;
-import java.io.*;
-import java.net.*;
-
-import org.apache.xalan.templates.Stylesheet; 
-
-/**
- * <meta name="usage" content="advanced"/>
- * Initializes and processes a stylesheet via SAX events.
- * If you need to alter the code in here,
- * it is not for the faint-of-heart, due to the state tracking
- * that has to be done due to the SAX event model.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class StylesheetHandler extends ParserAdapter
-  
-{
-  
-  /**
-   * Instance constructor... 
-   * @param processor  The XSLTProcessor implementation.
-   * @param stylesheet The root stylesheet.
-   *    
-   */
-  public StylesheetHandler(XSLTEngineImpl processor, Stylesheet stylesheetTree)    
-    throws javax.xml.transform.TransformerConfigurationException, SAXException 
-  {
-    
-      super(new org.apache.xerces.parsers.SAXParser());
-      //try{
-      org.apache.xalan.processor.StylesheetHandler handler = 
-            new org.apache.xalan.processor.StylesheetHandler(processor.getTransformerFactory());
-      handler.pushStylesheet(stylesheetTree);
-      this.setContentHandler(handler);
-    //}
-    //catch (javax.xml.transform.TransformerConfigurationException tce)
-    //{}
-  } 
-  
-  /**
-   * Instance constructor... 
-   * @param processor  The XSLTProcessor implementation.
-   * @param stylesheet The root stylesheet. 
-   * @exception TransformerConfigurationException  
-   */
-  public StylesheetHandler(XSLTEngineImpl processor, StylesheetRoot stylesheetTree)    
-    throws javax.xml.transform.TransformerConfigurationException, SAXException 
-  {
-    //try{
-      super(new org.apache.xerces.parsers.SAXParser());
-      org.apache.xalan.processor.StylesheetHandler handler = 
-            new org.apache.xalan.processor.StylesheetHandler(processor.getTransformerFactory());
-      handler.pushStylesheet(stylesheetTree.getObject());
-      this.setContentHandler(handler);
-    //}
-    //catch (javax.xml.transform.TransformerConfigurationException tce)
-    //{}
-  } 
-  
-  
-}
diff --git a/compat_src/org/apache/xalan/xslt/StylesheetRoot.java b/compat_src/org/apache/xalan/xslt/StylesheetRoot.java
deleted file mode 100644
index 88c2f94..0000000
--- a/compat_src/org/apache/xalan/xslt/StylesheetRoot.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.w3c.dom.*;
-import java.util.*;
-import java.net.*;
-import java.io.*;
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import org.apache.xml.serialize.*;
-import org.apache.xalan.serialize.*;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.OutputProperties;
-import javax.xml.transform.OutputKeys;
-import org.apache.xalan.xpath.xml.FormatterToXML;
-import org.apache.xalan.xpath.xml.FormatterToHTML;
-import org.apache.xalan.xpath.xml.FormatterToText;
-import org.apache.xalan.xpath.xml.FormatterToDOM;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * <meta name="usage" content="general"/> 
- * Binary representation of a stylesheet -- use the {@link org.apache.xalan.xslt.XSLTProcessor} ProcessStylesheet
- * method to create a StylesheetRoot and improve performance for a stylesheet performing multiple transformations.
- * Also required for XSLTProcessor to function as SAX DocumentHandler.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class StylesheetRoot extends Stylesheet
-{
-  
-  private String m_liaisonClassUsedToCreate = null;
-  private org.apache.xalan.templates.StylesheetRoot m_sRootObject;
-  
-  /**
-   * Uses an XSL stylesheet document.
-   * @param processor  The XSLTProcessor implementation.
-   * @param baseIdentifier The file name or URL for the XSL stylesheet.
-   * @exception TransformerConfigurationException thrown 
-   */
-  public StylesheetRoot(XSLTEngineImpl processor,
-                        String baseIdentifier)
-    throws TransformerConfigurationException
-  { 
-		super(null);
-    m_sRootObject = new org.apache.xalan.templates.StylesheetRoot(processor.getTransformerFactory().getErrorListener()); 
-    if (processor.getXMLProcessorLiaison()!= null)
-      m_liaisonClassUsedToCreate = ((Object)processor.getXMLProcessorLiaison()).getClass().getName();
-    
-  }  
-
-
-  /**
-   * Constructor using an org.apache.xalan.templates.StylesheetRoot.
-   * 
-   * @param s an org.apache.xalan.templates.StylesheetRoot object
-   */
-  public StylesheetRoot(org.apache.xalan.templates.StylesheetRoot s)    
-  { 
-		super(null);
-    m_sRootObject = s;     
-  }
-  
-  /**
-   * Return the org.apache.xalan.templates.StylesheetRoot object
-   * associated with this stylesheet root.
-   *  
-   * @return an org.apache.xalan.templates.StylesheetRoot object
-   */
-  public org.apache.xalan.templates.StylesheetRoot getObject()
-  {
-    return m_sRootObject;
-  }  
-  
-  /**
-   * Transform the XML source tree and place the output in the result tree target.
-   * This method uses a new XSLTProcessor instance to track the running state.
-   * @param xmlSource  The XML input source tree.
-   * @param outputTarget The output result tree.
-   * @exception SAXException
-   * @see org.apache.xalan.xslt.XSLTProcessor#process(org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)
-   */
-  public void process( XSLTInputSource xmlSource,
-                       XSLTResultTarget outputTarget)
-    throws SAXException,
-           MalformedURLException,
-           FileNotFoundException,
-           IOException
-  {
-    XSLTProcessor iprocessor =
-                              (null != m_liaisonClassUsedToCreate) ?
-                              new XSLTProcessorFactory().getProcessorUsingLiaisonName(m_liaisonClassUsedToCreate)
-                              : new XSLTProcessorFactory().getProcessor();
-    process(iprocessor, xmlSource, outputTarget);
-    
-  }
-
-  /**
-   * Transform the XML source tree and place the output in the result tree target.
-   * Use this version of the StylesheetRoot process() method if you have used an
-   * XSLTProcessor object to set a stylesheet parameter. That object is now the iprocessor parameter.
-   * @param iprocessor  The XSLTProcessor that will track the running state.
-   * @param xmlSource  The XML input source tree.
-   * @param outputTarget The output result tree.
-   * @exception SAXException
-   * @see org.apache.xalan.xslt.XSLTProcessor#process(org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)
-   */
-  public void process( XSLTProcessor iprocessor, XSLTInputSource xmlSource,
-                       XSLTResultTarget outputTarget)
-    throws SAXException,
-           MalformedURLException,
-           FileNotFoundException,
-           IOException
-  {
-    //process(iprocessor, iprocessor.getSourceTreeFromInput(xmlSource), outputTarget);
-		XSLTEngineImpl processor = (XSLTEngineImpl)iprocessor; // TODO: Check for class cast exception
-		
-    synchronized(processor)
-    {      
-      processor.setStylesheet(this);
-
-      try
-      {
-				processor.getTransformer().transform(xmlSource.getSourceObject(),
-																						 outputTarget.getResultObject());
-			}
-      catch (TransformerException te)
-      {
-        throw new SAXException(te); 
-      }             
-    }
-       
-  }
-
-  /**
-   * Transform the XML source tree (a DOM Node) and place the output in the result tree target.
-   * This is a convenience method. You can also use a DOM Node to instantiate an XSLTInputSource object,
-   * and call {@link #process(org.apache.xalan.xslt.XSLTProcessor, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)} or
-   * {@link org.apache.xalan.xslt.XSLTProcessor#process(org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)}.
-   * @param iprocessor  The processor that will track the running state.
-   * @param sourceTree  The input source tree in the form of a DOM Node.
-   * @param outputTarget The output result tree.
-   * @exception SAXException
-   */
-  public void process( XSLTProcessor iprocessor, Node sourceTree,
-                       XSLTResultTarget outputTarget)
-    throws SAXException,
-           MalformedURLException,
-           FileNotFoundException,
-           IOException
-  {
-		
-    XSLTEngineImpl processor = (XSLTEngineImpl)iprocessor; // TODO: Check for class cast exception
-		//checkInit(processor);
-    synchronized(processor)
-    {
-      //processor.switchLiaisonsIfNeeded(sourceTree, outputTarget.getNode());
-
-      processor.setStylesheet(this);
-
-      OutputStream ostream = null;
-
-      try
-      {
-				processor.getTransformer().transform(new javax.xml.transform.dom.DOMSource(sourceTree),
-																						 outputTarget.getResultObject());
-       
-      }
-      catch (TransformerException te)
-      {
-        throw new SAXException(te); 
-      }
-       
-      finally
-      {
-        if (null != ostream)
-        {
-          ostream.close();
-        }
-      }
-    }
-
-  }
-  
-  /**
-   * Creates a compatible SAX serializer for the specified writer
-   * and output format. If the output format is missing, the default
-   * is an XML format with UTF8 encoding.
-   *
-   * @param writer The writer
-   * @param format The output format
-   * @return A compatible SAX serializer
-   */
-  public DocumentHandler makeSAXSerializer( Writer writer, OutputFormat format )
-    throws IOException, SAXException 
-  {
-    DocumentHandler handler;
-    if ( format == null )
-    {
-      format = new OutputFormat( "xml", "UTF-8", false );
-      handler = null;
-    }
-    else 
-    {
-      handler = new ParserAdapter(new org.apache.xerces.parsers.SAXParser());
-      OutputProperties props = m_sRootObject.getOutputComposed();
-      
-      if ( format.getMethod().equalsIgnoreCase( "html" ) )
-      {
-        FormatterToHTML serializer = new FormatterToHTML(writer);
-        serializer.getSerializerObject().setOutputFormat(props.getProperties());
-        ((ParserAdapter)handler).setContentHandler(serializer.getSerializerObject());
-      }
-      else if ( format.getMethod().equalsIgnoreCase( "xml" ) )
-      {
-        FormatterToXML serializer = new FormatterToXML(writer);
-        serializer.getSerializerObject().setOutputFormat(props.getProperties());
-        ((ParserAdapter)handler).setContentHandler(serializer.getSerializerObject());
-      }
-      else if ( format.getMethod().equalsIgnoreCase( "text" ) )
-      {
-        FormatterToText serializer = new FormatterToText(writer); 
-        ((ParserAdapter)handler).setContentHandler(serializer.getSerializerObject());
-      }
-      else
-      {
-        handler = null;
-      }
-    }
-    
-    if(null == handler)
-    {
-      String method = format.getMethod();
-      org.apache.xml.serialize.SerializerFactory factory = org.apache.xml.serialize.SerializerFactory.getSerializerFactory(method);
-      org.apache.xml.serialize.Serializer serializer = factory.makeSerializer(writer, format);
-      handler = serializer.asDocumentHandler();
-    }
-
-    return handler;
-  }
-  
-  /**
-   * Creates a compatible SAX serializer for the specified output stream
-   * and output format. If the output format is missing, the default
-   * is an XML format with UTF8 encoding.
-   *
-   * @param ostream The output stream.
-   * @param format The output format
-   * @return A compatible SAX serializer
-   */
-  public DocumentHandler makeSAXSerializer( OutputStream ostream, OutputFormat format )
-    throws UnsupportedEncodingException, IOException, SAXException
-  {
-    DocumentHandler handler;
-    OutputProperties props;
-        
-    if ( format == null )
-    {
-      props = new OutputProperties();
-      handler = null;
-    }
-    else
-    { 
-      handler = new ParserAdapter(new org.apache.xerces.parsers.SAXParser());
-      props = m_sRootObject.getOutputComposed();
-      if ( format.getMethod().equalsIgnoreCase( "html" ) )
-      {
-        FormatterToHTML serializer = new FormatterToHTML(ostream);
-        serializer.getSerializerObject().setOutputFormat(props.getProperties());
-        ((ParserAdapter)handler).setContentHandler(serializer.getSerializerObject());
-      }
-      else if ( format.getMethod().equalsIgnoreCase( "xml" ) )
-      {
-        FormatterToXML serializer = new FormatterToXML(ostream);
-        serializer.getSerializerObject().setOutputFormat(props.getProperties());
-        ((ParserAdapter)handler).setContentHandler(serializer.getSerializerObject());
-      }
-      else if ( format.getMethod().equalsIgnoreCase( "text" ) )
-      {
-        String encoding = format.getEncoding();
-        if(null == encoding)
-        {
-          try
-          {
-            encoding = System.getProperty("file.encoding");
-            encoding = (null != encoding) ?
-                       org.apache.xalan.serialize.Encodings.convertJava2MimeEncoding( encoding ) : "ASCII";
-            if(null == encoding)
-            {
-              encoding = "ASCII";
-            }
-          }
-          catch(SecurityException se)
-          {
-            encoding = "ASCII";
-          }
-        }
-
-        //this.m_encoding =   encoding;
-
-        String javaEncoding = org.apache.xalan.serialize.Encodings.convertMime2JavaEncoding(encoding);
-
-        Writer w = new OutputStreamWriter( ostream, javaEncoding );
-        ((ParserAdapter)handler).setContentHandler(new FormatterToText(w).getSerializerObject());
-      }
-      else if ( format.getMethod().equalsIgnoreCase( "xhtml" ) )
-      {
-        handler = new XMLSerializer(ostream, format);
-        //handler = Serializer.makeSAXSerializer(ostream, format);
-      }
-      else
-      {
-        handler = new XMLSerializer(ostream, format);
-        //handler = Serializer.makeSAXSerializer(ostream, format);
-      }
-    }
-    if(null == handler)
-    {
-      String method = props.getProperty(OutputKeys.METHOD);
-      org.apache.xml.serialize.SerializerFactory factory = org.apache.xml.serialize.SerializerFactory.getSerializerFactory(method);
-      org.apache.xml.serialize.Serializer serializer = factory.makeSerializer(ostream, format);
-      handler = serializer.asDocumentHandler();
-    }
-
-    return handler;
-  }
-
-  /**
-   * Creates a compatible SAX serializer for the specified output stream
-   * and output format. If the output format is missing, the default
-   * is an XML format with UTF8 encoding.
-   *
-   * @param ostream The output stream.
-   * @return A compatible SAX serializer
-   */
-  public DocumentHandler getSAXSerializer( OutputStream ostream )
-    throws UnsupportedEncodingException, IOException, SAXException
-  {
-   return makeSAXSerializer(ostream, getOutputFormat());
-  }
-  
-  /**
-   * Get a new OutputFormat object according to the xsl:output attributes.
-   */
-  public OutputFormat getOutputFormat()
-  {
-    OutputProperties outputFormat = m_sRootObject.getOutputComposed();
-    if (outputFormat == null)
-      return null;
-    OutputFormat formatter = new OutputFormat(outputFormat.getProperty(OutputKeys.METHOD),
-                                              outputFormat.getProperty(OutputKeys.ENCODING),
-                                              OutputProperties.getBooleanProperty(OutputKeys.INDENT, outputFormat.getProperties()));
-    formatter.setDoctype(outputFormat.getProperty(OutputKeys.DOCTYPE_PUBLIC), 
-                         outputFormat.getProperty(OutputKeys.DOCTYPE_SYSTEM));
-    formatter.setOmitXMLDeclaration(OutputProperties.getBooleanProperty(OutputKeys.OMIT_XML_DECLARATION, outputFormat.getProperties()));
-    formatter.setStandalone(OutputProperties.getBooleanProperty(OutputKeys.STANDALONE, outputFormat.getProperties()));
-    formatter.setMediaType(outputFormat.getProperty(OutputKeys.MEDIA_TYPE));
-    formatter.setVersion(outputFormat.getProperty(OutputKeys.VERSION));
-    // This is to get around differences between Xalan and Xerces.
-    // Xalan uses -1 as default for no indenting, Xerces uses 0.
-    // So we just bump up the indent value here because we will
-    // subtract from it at output time (FormatterToXML.init());
-   // if (getOutputIndent())
-   //   formatter.setIndent(formatter.getIndent()+1);
-
-    
-    return formatter;
-  }
-  
-  /** 
-   * Get the encoding string that was specified in the stylesheet. 
-   */
-  public String getOutputEncoding()
-  {
-    return m_sRootObject.getOutputComposed().getProperty(OutputKeys.ENCODING);
-  }
-
-  /** 
-   * Get the media-type string that was specified in the stylesheet. 
-   */
-  public String getOutputMediaType() 
-  { 
-    return m_sRootObject.getOutputComposed().getProperty(OutputKeys.MEDIA_TYPE); 
-  }
-  
-  /** 
-   * Get the output method that was specified in the stylesheet. 
-   */
-  public String getOutputMethod() 
-  { 
-    return m_sRootObject.getOutputComposed().getProperty(OutputKeys.METHOD); 
-  }
-  
-  /**
-   * Get the base identifier with which this stylesheet is associated.
-   */
-  public String getBaseIdentifier()
-  {
-    return m_sRootObject.getBaseIdentifier();
-  }
-
-  /**
-   * Get the base identifier with which this stylesheet is associated.
-   */
-  public void setBaseIdentifier(String baseIdent)
-  {
-    m_sRootObject.setHref(baseIdent);
-  }
-  
-}
diff --git a/compat_src/org/apache/xalan/xslt/StylesheetSpec.java b/compat_src/org/apache/xalan/xslt/StylesheetSpec.java
deleted file mode 100644
index dad1527..0000000
--- a/compat_src/org/apache/xalan/xslt/StylesheetSpec.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import javax.xml.transform.stream.StreamSource;
-
-/**
- * <meta name="usage" content="general"/>
- * This class implements the representation of a stylesheet 
- * specification via xml-stylesheet in an XML document.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class StylesheetSpec extends StreamSource
-{
-  String type; // CDATA #REQUIRED
-  String title; // CDATA #IMPLIED
-  String media; // CDATA #IMPLIED
-  String encoding; // CDATA #IMPLIED
-  boolean alternate; // (yes|no) "no"
-  
-  /**
-   * Create a StylesheetSpec object.
-   */
-  public StylesheetSpec(String href, String type, String title, 
-                        String media, boolean alternate,
-                        String encoding)
-  {
-    this.setSystemId(href);
-    this.encoding = encoding;
-    this.type = type;
-    this.title = title;
-    this.media = media;
-    this.alternate = alternate;
-  }
-  
-  /**
-   * Get the encoding of the stylesheet.
-   */
-  public String       getEncoding()
-  {
-    return encoding;
-  }
-
-  /**
-   * Get the type of the stylesheet, i.e. "text/xsl".
-   */
-  public String       getType()
-  {
-    return type;
-  }
-  
-  /**
-   * Get the title of the element (in other words, the 
-   * item to be presented to the user agent).
-   */
-  public String       getTitle()
-  {
-    return title;
-  }
-  
-  /**
-   * Get the media attribute of the stylesheet.
-   */
-  public String       getMedia()
-  {
-    return media;
-  }
-  /**
-   * Get whether or not the stylesheet is specified as 
-   * an alternate.
-   */
-  public boolean    getIsAlternate()
-  {
-    return alternate;
-  }
-}
diff --git a/compat_src/org/apache/xalan/xslt/XSLProcessorContext.java b/compat_src/org/apache/xalan/xslt/XSLProcessorContext.java
deleted file mode 100644
index ffe7d92..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLProcessorContext.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.w3c.dom.*;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.transformer.TransformerImpl;
-
-// import org.apache.xalan.xslt.*;
-
-/**
- * <meta name="usage" content="general"/>
- * Captures processor context to be
- * passed to an extension element.
- *
- * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XSLProcessorContext extends org.apache.xalan.extensions.XSLProcessorContext
-{ 
-  public XSLProcessorContext (XSLTEngineImpl processor,
-			      Stylesheet stylesheetTree,
-			      Node sourceTree, Node sourceNode, QName mode) 
-    
-  {
-    super((TransformerImpl)(processor.getTransformer()),
-          stylesheetTree);
-  }
-
-  
-}
diff --git a/compat_src/org/apache/xalan/xslt/XSLProcessorException.java b/compat_src/org/apache/xalan/xslt/XSLProcessorException.java
deleted file mode 100644
index baab5a0..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLProcessorException.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.xml.sax.SAXException;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * <meta name="usage" content="general"/>
- * The exception used for most XSLT errors.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XSLProcessorException extends SAXException
-{
-  private Exception m_exception;
-  
-  /**
-   * Create an XSLProcessorException object that holds 
-   * an error message.
-   * @param message The error message.
-   */
-  public XSLProcessorException(String message) 
-  {
-     super((null == message) ? XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) : message);
-     m_exception = null;
-  }
-  
-  /**
-   * Create an XSLProcessorException object that holds 
-   * an error message, and another exception 
-   * that caused this exception.
-   * @param message The error message.
-   * @param e The exception that caused this exception.
-   */
-  public XSLProcessorException (String message, Exception e)
-  {
-    super((null == message) ? XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) : message);
-    this.m_exception = e;
-  }
-  
-  /**
-   * Create an XSLProcessorException object that holds 
-   * another exception that caused this exception.
-   * @param e The exception that caused this exception.
-   */
-  public XSLProcessorException (Exception e)
-  {
-    super((null == e.getMessage()) ? XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) : e.getMessage());
-    this.m_exception = e;
-  }
-    
-}
diff --git a/compat_src/org/apache/xalan/xslt/XSLTEngineImpl.java b/compat_src/org/apache/xalan/xslt/XSLTEngineImpl.java
deleted file mode 100644
index d6fbc2c..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLTEngineImpl.java
+++ /dev/null
@@ -1,2426 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.apache.xpath.*;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xalan.xpath.XObject;
-import org.apache.xalan.xpath.XString;
-import org.apache.xalan.xpath.XNodeSet;
-import org.apache.xalan.xpath.XBoolean;
-import org.apache.xalan.xpath.XNumber;
-import org.apache.xalan.xpath.XNull;
-
-import org.w3c.dom.*;
-import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-import org.xml.sax.ext.*;
-import org.xml.sax.helpers.ParserAdapter;
-import org.apache.xml.serialize.XMLSerializer;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Source;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.ErrorListener;
-
-import java.util.*;
-import java.net.*;
-import java.io.*;
-import java.lang.reflect.*;
-
-import org.apache.xalan.templates.Stylesheet;
-//import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.xpath.xml.XMLParserLiaison;
-import org.apache.xalan.xpath.xml.ProblemListenerDefault;
-import org.apache.xalan.xpath.xml.ProblemListener;
-import org.apache.xalan.templates.StylesheetComposed;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.processor.StylesheetHandler;
-import org.apache.xalan.processor.TransformerFactoryImpl;
-//import org.apache.xalan.processor.ProcessorStylesheet;
-//import org.apache.xalan.xslt.StylesheetSpec;
-import org.apache.xalan.trace.*;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xml.utils.PrefixResolverDefault;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.DefaultErrorHandler;
-import org.apache.xalan.transformer.TransformerHandlerImpl;
-
-// Imported JAVA API for XML Parsing 1.0 classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-
-/**
- * <meta name="usage" content="advanced"/>
- * The Xalan workhorse -- Collaborates with the XML parser liaison, the DOM,
- * and the XPath engine, to transform a source tree of nodes into a result tree
- * according to instructions and templates specified by a stylesheet tree.
- * We suggest you use one of the
- * static XSLTProcessorFactory getProcessor() methods to instantiate the processor
- * and return an interface that greatly simplifies the process of manipulating
- * XSLTEngineImpl.
- *
- * <p>The methods <code>process(...)</code> are the primary public entry points.
- * The best way to perform transformations is to use the
- * {@link org.apache.xalan.xslt.XSLTProcessor#process(org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)} method,
- * but you may use any of process methods defined in XSLTEngineImpl.</p>
- * 
- * <p>Please note that this class is not safe per instance over multiple 
- * threads.  If you are in a multithreaded environment, you should 
- * keep a pool of these objects, or create a new one each time.  In a 
- * multithreaded environment, the right way to do things is to create a 
- * StylesheetRoot via processStylesheet, and then reuse this object 
- * over multiple threads.</p>
- *
- * <p>If you reuse the processor instance, you should call reset() between transformations.</p>
- * @see XSLTProcessorFactory
- * @see XSLTProcessor
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XSLTEngineImpl implements  XSLTProcessor
-{
-  //private Processor m_processor;
-  private TransformerFactory m_tfactory;
-  private TransformerImpl m_transformerImpl;
-  private DOM2Helper m_liaison;
-  private String m_outputFileName;
-  private DocumentHandler m_documentHandler = null;
-  private ProblemListenerDefault m_problemListener;
-  private Hashtable m_stylesheetParams;
-  StylesheetRoot m_stylesheetRoot = null;
-  
-  Vector m_evalList = null;
-  boolean m_needToEval = false;
-  
-  /*
-  * If this is true, then the diag function will
-  * be called.
-  */
-  private boolean m_traceTemplateChildren = false;
-
-  /*
-  * If this is true, then the simple tracing of templates
-  * will be performed.
-  */
-  private boolean m_traceTemplates = false;
-  
-  /*
-  * If this is true, then diagnostics of each select
-  * will be performed.
-  */
-  boolean m_traceSelects = false;
-
-  /*
-  * A stream to print diagnostics to.
-  */
-  java.io.PrintWriter m_diagnosticsPrintWriter = null;
-
-  /* For diagnostics */
-  Hashtable m_durationsTable = new Hashtable();
-  
-  /**
-   * A XSLMessages instance capable of producing user messages.
-   */
-  private static XSLMessages m_XSLMessages = new XSLMessages();
-  
-    
- /**
-   * Construct an XSLT processor that uses the default DTM (Document Table Model) liaison
-   * and XML parser. As a general rule, you should use XSLTProcessorFactory to create an
-   * instance of this class and provide access to the instance via the XSLTProcessor interface.
-   *
-   * @see XSLTProcessorFactory
-   * @see XSLTProcessor
-   */
-  protected XSLTEngineImpl()
-    throws org.xml.sax.SAXException
-  {    
-    m_tfactory = TransformerFactory.newInstance();
-    m_problemListener = new ProblemListenerDefault();
-    //m_liaison =  (DOM2Helper)createLiaison();
-  }
-
-  /**
-   * Construct an XSLT processor that uses the the given parser liaison.
-   * As a general rule, you should use XSLTProcessorFactory to create an
-   * instance of this class and provide access to the instance via the XSLTProcessor interface.
-   *
-   * @see XSLTProcessorFactory
-   * @see XSLTProcessor
-   */
-  public XSLTEngineImpl(String liaisonClassName)
-    throws SAXException 
-  {   
-    m_tfactory = TransformerFactory.newInstance();
-    m_problemListener = new ProblemListenerDefault();
-    
-    try 
-      {
-        m_liaison =  (DOM2Helper)(Class.forName(liaisonClassName).newInstance());
-        //org.apache.xpath.XPathContext xctxt = this.getTransformer().getXPathContext();
-
-        //xctxt.setDOMHelper(m_liaison);        
-      } 
-      catch (ClassNotFoundException e1) 
-      {
-        throw new SAXException("XML Liaison class " + liaisonClassName +
-          " specified but not found", e1);
-      } 
-      catch (IllegalAccessException e2) 
-      {
-          throw new SAXException("XML Liaison class " + liaisonClassName +
-            " found but cannot be loaded", e2);
-      } 
-      catch (InstantiationException e3) 
-      {
-          throw new SAXException("XML Liaison class " + liaisonClassName +
-            " loaded but cannot be instantiated (no empty public constructor?)",
-            e3);
-      } 
-      catch (ClassCastException e4) 
-      {
-          throw new SAXException("XML Liaison class " + liaisonClassName +
-            " does not implement DOM2Helper", e4);
-      }
-   
-  }
-    
-    
-
-  /**
-   * Construct an XSL processor that uses the the given parser liaison.
-   * As a general rule, you should use XSLTProcessorFactory to create an
-   * instance of this class and provide access to the instance via the XSLTProcessor interface.
-   *
-   * @param XMLParserLiaison A liaison to an XML parser.
-   *
-   * @see org.apache.xalan.xpath.xml.XMLParserLiaison
-   * @see XSLTProcessorFactory
-   * @see XSLTProcessor
-   */
-  public XSLTEngineImpl(XMLParserLiaison parserLiaison)
-    throws org.xml.sax.SAXException
-  {
-    m_tfactory = TransformerFactory.newInstance();
-    m_problemListener = new ProblemListenerDefault();
-    
-    m_liaison =  (DOM2Helper)parserLiaison;
-   // org.apache.xpath.XPathContext xctxt = this.getTransformer().getXPathContext();
-
-    //xctxt.setDOMHelper(m_liaison);    
-  }
-
-  /**
-   * Construct an XSLT processor that can call back to the XML parser, in order to handle
-   * included files and the like.
-   *
-   * @param XMLParserLiaison A liaison to an XML parser.
-   *
-   * @see org.apache.xalan.xpath.xml.XMLParserLiaison
-   * @see XSLTProcessorFactory
-   * @see XSLTProcessor
-   */
-  XSLTEngineImpl(XMLParserLiaison parserLiaison, XPathFactory xpathFactory)    
-    throws SAXException
-  {   
-    m_tfactory = TransformerFactory.newInstance();
-    m_problemListener = new ProblemListenerDefault();
-    
-    m_liaison =  (DOM2Helper)parserLiaison;
-   // org.apache.xpath.XPathContext xctxt = this.getTransformer().getXPathContext();
-
-    //xctxt.setDOMHelper(m_liaison);    
-  }
-  
-  /** 
-   * Get a Liaison class
-   */
-  public XMLParserLiaison createLiaison()
-    throws org.xml.sax.SAXException
-  {
-    return new org.apache.xalan.xpath.xml.XMLParserLiaisonDefault();    
-  }
- 
-  /**
-   * Reset the state.  This needs to be called after a process() call
-   * is invoked, if the processor is to be used again.
-   */
-  public void reset()
-  {
-    if (m_transformerImpl != null)
-      m_transformerImpl.reset(); 
-    m_stylesheetParams = null;
-  }
-  
- 
-
-  /**
-   * Transform the source tree to the output in the given
-   * result tree target. As a general rule, we recommend you use the
-   * {@link org.apache.xalan.xslt.XSLTProcessor#process(org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)} method.
-   * @param inputSource  The input source.
-   * @param stylesheetSource  The stylesheet source.  May be null if source has a xml-stylesheet PI.
-   * @param outputTarget The output source tree.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void process( XSLTInputSource inputSource,
-                       XSLTInputSource stylesheetSource,
-                       XSLTResultTarget outputTarget)
-    throws SAXException
-  {
-    try
-    {
-      Boolean totalTimeID = new Boolean(true);
-      pushTime(totalTimeID);
-      Node sourceTree = null;
-      
-      Templates templates = null;
-      if (m_needToEval)
-      {
-        Node node = null;
-        if (null != stylesheetSource)
-        {
-          Source ssSource = stylesheetSource.getSourceObject();
-          if(ssSource instanceof DOMSource)
-          {
-            node = ((DOMSource)ssSource).getNode();
-          }
-        }
-        if (null == node)
-        {
-          node = new DOM2Helper().createDocument() ; 
-        }
-        for (int i=0; i< m_evalList.size(); i++)
-        {
-          String name = (String)m_evalList.elementAt(i);
-          String expression = (String)m_stylesheetParams.get(name);
-          try{
-            org.apache.xpath.objects.XObject val = org.apache.xpath.XPathAPI.eval(node, expression);
-            
-            m_stylesheetParams.put(name, val);
-          }
-          catch(TransformerException te)
-          {
-            throw new SAXException(te);
-          }
-        }
-        m_needToEval = false;
-        m_evalList = null;
-      }
-      
-      sourceTree = getSourceTreeFromInput(inputSource);
-      
-      if(null != stylesheetSource)
-      {
-        try{
-        templates = m_tfactory.newTemplates(stylesheetSource.getSourceObject());
-        }
-        catch (TransformerConfigurationException tce)
-        {
-          throw new SAXException(tce);
-        }  
-        
-      }      
-      else if( null != inputSource)
-      { 
-        if(null != sourceTree)
-        {
-          String stylesheetURI = null;
-          Stack hrefs = new Stack();
-          for(Node child=sourceTree.getFirstChild(); null != child; child=child.getNextSibling())
-          {
-            if(Node.PROCESSING_INSTRUCTION_NODE == child.getNodeType())
-            {
-              ProcessingInstruction pi = (ProcessingInstruction)child;
-              if(pi.getNodeName().equals("xml-stylesheet")
-                 || pi.getNodeName().equals("xml:stylesheet"))
-              {
-                boolean isOK = true;
-                StringTokenizer tokenizer = new StringTokenizer(pi.getNodeValue(), " \t=");
-                while(tokenizer.hasMoreTokens())
-                {
-                  if(tokenizer.nextToken().equals("type"))
-                  {
-                    String typeVal = tokenizer.nextToken();
-                    typeVal = typeVal.substring(1, typeVal.length()-1);
-                    if(!typeVal.equals("text/xsl") && !typeVal.equals("text/xml") && !typeVal.equals("application/xml+xslt"))
-                    {
-                      isOK = false;
-                    }
-                  }
-                }
-
-                if(isOK)
-                {
-                  tokenizer = new StringTokenizer(pi.getNodeValue(), " \t=");
-                  while(tokenizer.hasMoreTokens())
-                  {
-                    if(tokenizer.nextToken().equals("href"))
-                    {
-                      stylesheetURI = tokenizer.nextToken();
-                      stylesheetURI = stylesheetURI.substring(1, stylesheetURI.length()-1);
-                      hrefs.push(stylesheetURI);
-                    }
-                  }                
-                }
-              }
-            }
-          } // end for(int i = 0; i < nNodes; i++)
-          boolean isRoot = true;
-          Stylesheet prevStylesheet = null;
-          while(!hrefs.isEmpty())
-          {
-            Stylesheet stylesheet = getStylesheetFromPIURL((String)hrefs.pop(), sourceTree,
-                                                           (null != inputSource)
-                                                           ? inputSource.getSystemId() : null,
-                                                           isRoot);
-            if(false == isRoot)
-            {
-              prevStylesheet.setImport((StylesheetComposed)stylesheet);
-            }
-            prevStylesheet = stylesheet;
-            isRoot = false;
-          }
-        }        
-      }
-      else
-      {
-        error(XSLTErrorResources.ER_NO_INPUT_STYLESHEET); //"Stylesheet input was not specified!");
-      }
-      
-     
-      if(null == templates)
-      {
-        if (m_stylesheetRoot != null)
-          templates = m_stylesheetRoot.getObject();
-        else
-        {  
-          error(XSLTErrorResources.ER_FAILED_PROCESS_STYLESHEET); //"Failed to process stylesheet!");
-          return;
-        }  
-      }
-
-      if(null != templates)
-      {
-        try{
-          m_transformerImpl = (TransformerImpl)templates.newTransformer(); 
-          if (m_problemListener != null)
-            m_transformerImpl.setErrorListener(m_problemListener);
-        //  if (m_liaison != null)
-        //    m_transformerImpl.getXPathContext().setDOMHelper(m_liaison);
-   
-        }
-        catch (TransformerConfigurationException tce)
-        {
-          throw new SAXException(tce);
-        }  
-        
-        if (m_stylesheetParams != null)
-        {
-          Enumeration keys = m_stylesheetParams.keys();
-          while (keys.hasMoreElements())
-          {
-            String name = (String)keys.nextElement();
-            Object value = m_stylesheetParams.get(name); 
-            m_transformerImpl.setParameter(name, null, value);
-          } 
-        }  
-        
-        try{
-          m_transformerImpl.transform(new DOMSource(sourceTree),
-                    outputTarget.getResultObject());
-        }
-        catch (TransformerException te)
-        {
-          throw new SAXException(te);
-        }  
-        if(null != m_diagnosticsPrintWriter)
-        {
-          displayDuration("Total time", totalTimeID);
-        }
-      }
-    }
-    catch(MalformedURLException mue)
-    {
-      error(XSLTErrorResources.ERROR0000, new Object[] {mue.getMessage()}, mue);
-      // throw se;
-    }
-    catch(FileNotFoundException fnfe)
-    {
-      error(XSLTErrorResources.ERROR0000, new Object[] {fnfe.getMessage()}, fnfe);
-      // throw se;
-    }
-    catch(IOException ioe)
-    {
-      error(XSLTErrorResources.ERROR0000, new Object[] {ioe.getMessage()}, ioe);
-      // throw se;
-    }
-    catch(SAXException se)
-    {
-      error(XSLTErrorResources.ER_SAX_EXCEPTION, se); //"SAX Exception", se);
-      // throw se;
-    }
-  }
-
-  /**
-   * Bottleneck the creation of the stylesheet for derivation purposes.
-   */
-  public StylesheetRoot createStylesheetRoot(String baseIdentifier)
-    throws MalformedURLException, FileNotFoundException,
-           IOException, SAXException
-  {
-    try{
-      if (baseIdentifier == null)
-        return new StylesheetRoot(this, baseIdentifier); 
-      
-      Source inSource = new XSLTInputSource(baseIdentifier).getSourceObject();
-      Templates templates = m_tfactory.newTemplates(inSource);
-      StylesheetRoot stylesheet = new StylesheetRoot((org.apache.xalan.templates.StylesheetRoot)templates);      
-      return stylesheet;      
-    }
-    catch (TransformerConfigurationException tce)
-    {
-      throw new SAXException(tce);
-    }
-  }
-  
-  /**
-   * Bottleneck the creation of the stylesheet for derivation purposes.
-   */
-  StylesheetRoot createStylesheetRoot(String baseIdentifier, XSLTInputSource source)
-    throws MalformedURLException, FileNotFoundException,
-           IOException, SAXException
-  {
-    try{
-      Source inSource = source.getSourceObject();
-      Templates templates = m_tfactory.newTemplates(inSource);
-      StylesheetRoot stylesheet = new StylesheetRoot((org.apache.xalan.templates.StylesheetRoot)templates);      
-      return stylesheet;      
-    }
-    catch (TransformerConfigurationException tce)
-    {
-      throw new SAXException(tce);
-    }
-  }
-
-  /**
-   * Given a URI to an XSL stylesheet,
-   * Compile the stylesheet into an internal representation.
-   * This calls reset() before processing if the stylesheet root has been set
-   * to non-null.
-   * @param xmldocURLString  The URL to the input XML document.
-   * @return The compiled stylesheet object.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public StylesheetRoot processStylesheet(XSLTInputSource stylesheetSource)
-    throws SAXException
-  {
-    try{
-      if(null != ((TransformerFactoryImpl)m_tfactory).newTemplatesHandler().getTemplates())
-        reset();
-    }
-    catch (TransformerConfigurationException tce)
-    {
-      throw new SAXException(tce);
-    }
-
-    String xslIdentifier = ((null == stylesheetSource) ||
-                            (null == stylesheetSource.getSystemId()))
-                           ? "Input XSL" : stylesheetSource.getSystemId();
-
-    // In case we have a fragment identifier, go ahead and
-    // try and parse the XML here.
-    m_stylesheetRoot = null;
-    try
-    {
-      StylesheetHandler stylesheetProcessor
-          = new StylesheetHandler((TransformerFactoryImpl)m_tfactory); //this, m_stylesheetRoot); 
-        
-      Source ssSource = stylesheetSource.getSourceObject();
-      if(ssSource instanceof DOMSource)
-      {
-        if(((DOMSource)ssSource).getNode() instanceof StylesheetRoot)
-        {
-          m_stylesheetRoot = (StylesheetRoot)((DOMSource)ssSource).getNode();
-        }
-        else
-        {
-          stylesheetProcessor.setSystemId(stylesheetSource.getSystemId());
-          TreeWalker tw = new TreeWalker(stylesheetProcessor, new org.apache.xpath.DOM2Helper());
-          tw.traverse(((DOMSource)ssSource).getNode());
-          m_stylesheetRoot = new StylesheetRoot(stylesheetProcessor.getStylesheetRoot());
-        }
-      }
-      else
-      {
-				if(null != m_liaison)
-        {
-         // DOM2Helper liaison =  (DOM2Helper)(Class.forName(liaisonClassName).newInstance());
-          m_liaison.parse(SAXSource.sourceToInputSource(ssSource));
-					DOMSource source = new DOMSource(m_liaison.getDocument());
-					Templates templates = m_tfactory.newTemplates(source);
-					m_stylesheetRoot = new StylesheetRoot(
-																(org.apache.xalan.templates.StylesheetRoot)templates);																 
-        }  
-				else
-				{
-					m_stylesheetRoot = createStylesheetRoot(stylesheetSource.getSystemId(), stylesheetSource);
-				}
-        addTraceListenersToStylesheet();
-        
-        
-        stylesheetProcessor.pushStylesheet(m_stylesheetRoot.getObject());      
-        diag("========= Parsing "+xslIdentifier+" ==========");
-        pushTime(xslIdentifier);
-        //String liaisonClassName = System.getProperty("org.apache.xalan.source.liaison");
-
-        
-        if(null != m_diagnosticsPrintWriter)
-          displayDuration("Parse of "+xslIdentifier, xslIdentifier);
-      }
-    }
-    catch(Exception e)
-    {
-      error(XSLTErrorResources.ER_COULDNT_PARSE_DOC, new Object[] {xslIdentifier}, e); //"Could not parse "+xslIdentifier+" document!", e);
-    }
-    return m_stylesheetRoot;
-  }
-
-  /**
-   * Given a URI to an XSL stylesheet,
-   * Compile the stylesheet into an internal representation.
-   * This calls reset() before processing if the stylesheet root has been set
-   * to non-null.
-   * @param xmldocURLString  The URL to the input XML document.
-   * @return The compiled stylesheet object.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public StylesheetRoot processStylesheet(String xsldocURLString)
-    throws SAXException
-  {
-    try
-    {
-      XSLTInputSource input = new XSLTInputSource(getURLFromString(xsldocURLString, null).toString());
-      return processStylesheet(input);
-    }
-    catch(SAXException se)
-    {
-      error(XSLTErrorResources.ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL, se); //"processStylesheet not succesfull!", se);
-      return null; // shut up compiler
-    }
-  }
-
-  /**
-   * Set the stylesheet for this processor.  If this is set, then the
-   * process calls that take only the input .xml will use
-   * this instead of looking for a stylesheet PI.  Also,
-   * setting the stylesheet is needed if you are going
-   * to use the processor as a SAX DocumentHandler.
-   */
-  public void setStylesheet(StylesheetRoot stylesheetRoot)
-  {
-    m_stylesheetRoot = stylesheetRoot;
-    org.apache.xalan.templates.StylesheetRoot sr = stylesheetRoot.getObject();
-    if (m_transformerImpl == null)
-      m_transformerImpl = (TransformerImpl)sr.newTransformer();
-    m_transformerImpl.setStylesheet(sr);
-    if (m_problemListener != null)
-      m_transformerImpl.setErrorListener(m_problemListener);
-  }
-
-  /**
-   * Get the current stylesheet for this processor.
-   */
-  public StylesheetRoot getStylesheet()    
-  {
-    return m_stylesheetRoot;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the filename of the output document, if it was set.
-   * This is for use by multiple output documents, to determine
-   * the base directory for the output document.  It needs to
-   * be set by the caller.
-   */
-  public String getOutputFileName()
-  {
-    return m_outputFileName;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Set the filename of the output document.
-   * This is for use by multiple output documents, to determine
-   * the base directory for the output document.  It needs to
-   * be set by the caller.
-   */
-  public void setOutputFileName(String filename)
-  {
-    m_outputFileName = filename;
-  }
-
-  
-
-  /**
-   * Given an input source, get the source tree.
-   */
-  public Node getSourceTreeFromInput(XSLTInputSource inputSource)
-    throws org.xml.sax.SAXException
-  {
-    Node sourceTree = null;
-    String xmlIdentifier = ((null == inputSource) ||
-                            (null == inputSource.getSystemId()))
-                           ? "Input XML" : inputSource.getSystemId();
-    
-    Source iSource = inputSource.getSourceObject(); 
-
-    if(iSource instanceof DOMSource)
-    {
-      //if(getXMLProcessorLiaison() instanceof org.apache.xalan.xpath.dtm.DTMLiaison)
-       // error(XSLTErrorResources.ER_CANT_USE_DTM_FOR_INPUT);
-
-      sourceTree = ((DOMSource)iSource).getNode();
-    }
-    else
-    {
-      // In case we have a fragment identifier, go ahead and
-      // try and parse the XML here.
-      try
-      {
-        diag("========= Parsing "+xmlIdentifier+" ==========");
-        pushTime(xmlIdentifier);
-        
-        //String liaisonClassName = System.getProperty("org.apache.xalan.source.liaison");
-
-        if(null != m_liaison)
-        {
-          //DOM2Helper liaison =  (DOM2Helper)(Class.forName(liaisonClassName).newInstance());
-          m_liaison.parse(SAXSource.sourceToInputSource(iSource));
-          if(null != m_diagnosticsPrintWriter)
-            displayDuration("Parse of "+xmlIdentifier, xmlIdentifier);
-          sourceTree = m_liaison.getDocument();
-        }
-				else
-				{
-					try
-					{
-
-						// Use an implementation of the JAVA API for XML Parsing 1.0 to
-						// create a DOM Document node to contain the result.
-						DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-
-						dfactory.setNamespaceAware(true);
-						dfactory.setValidating(false);
-
-						DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-						sourceTree = docBuilder.parse(xmlIdentifier);
-
-					}
-					catch (ParserConfigurationException pce)
-					{
-						error(XSLTErrorResources.ER_COULDNT_PARSE_DOC, new Object[] {xmlIdentifier}, pce); 
-					}
-				}							
-      }
-      catch(Exception e)
-      {
-        // Unwrap exception
-        if((e instanceof SAXException) && (null != ((SAXException)e).getException()))
-        {
-          // ((SAXException)e).getException().printStackTrace();
-          e = ((SAXException)e).getException();
-        }
-        sourceTree = null; // shutup compiler
-        error(XSLTErrorResources.ER_COULDNT_PARSE_DOC, new Object[] {xmlIdentifier}, e); //"Could not parse "+xmlIdentifier+" document!", e);
-      }
-    }
-
-    return sourceTree;
-  }
-
-  /**
-   * Get Stylesheet from PI URL
-   * 
-   * @param xslURLString a valid URI to an XSL stylesheet.
-   * @param fragbase Document fragment Node.
-   * @param xmlBaseIdent Base URI to resolve stylesheet URL 
-   * @param isRoot Flag indicating if root node
-   */
-  Stylesheet getStylesheetFromPIURL(String xslURLString, Node fragBase,
-                                    String xmlBaseIdent, boolean isRoot)
-    throws SAXException,
-    MalformedURLException,
-    FileNotFoundException,
-    IOException
-  {
-    Stylesheet stylesheet = null;
-    String[] stringHolder =
-    {
-      null};
-    xslURLString = xslURLString.trim();
-    int fragIndex = xslURLString.indexOf('#');
-    String fragID = null;
-    Document stylesheetDoc;
-    if(fragIndex == 0)
-    {
-      diag("Locating stylesheet from fragment identifier...");
-      fragID = xslURLString.substring(1);
-      
-      // Try a bunch of really ugly stuff to find the fragment.
-      // What's the right way to do this?
-
-      // Create a XPath parser.
-      XPathParser parser = new XPathParser((ErrorListener)m_problemListener.getErrorHandler(), null);
-      XPathContext xpathContext = new XPathContext();
-      PrefixResolverDefault nsNode = new PrefixResolverDefault(fragBase); //xpathContext.getNamespaceContext();
-
-      NodeIterator nl = null;
-      // Create the XPath object.
-      try{
-      XPath xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
-      Compiler compiler = new Compiler();
-      // Parse the xpath
-      parser.initXPath(compiler, "id("+fragID+")", nsNode);
-      org.apache.xpath.objects.XObject xobj = xpath.execute(xpathContext, fragBase, nsNode);
-
-      nl = new org.apache.xml.dtm.ref.DTMNodeIterator(xobj.iter());
-      if(nl.nextNode() == null)
-      {
-        // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@id='"+fragID+"']", fragBase, nsNode);
-        // Create the XPath object.
-        xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
-
-        // Parse the xpath
-        parser.initXPath(compiler, "//*[@id='"+fragID+"']", nsNode);
-        xobj = xpath.execute(xpathContext, fragBase, nsNode);
-
-        nl = new org.apache.xml.dtm.ref.DTMNodeIterator(xobj.iter());
-        if(nl.nextNode() == null)
-        {
-          // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@name='"+fragID+"']", fragBase, nsNode);
-          // Create the XPath object.
-          xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
-
-          // Parse the xpath
-          parser.initXPath(compiler, "//*[@name='"+fragID+"']", nsNode);
-          xobj = xpath.execute(xpathContext, fragBase, nsNode);
-          nl = new org.apache.xml.dtm.ref.DTMNodeIterator(xobj.iter());
-          if(nl.nextNode() == null)
-          {
-            // Well, hell, maybe it's an XPath...
-            // xobj = Stylesheet.evalXPathStr(getExecContext(), fragID, fragBase, nsNode);
-            // Create the XPath object.
-            //((StylesheetHandler)( m_processor.getTemplatesBuilder())).getLocator()
-            xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
-
-            // Parse the xpath
-            parser.initXPath(compiler, fragID, nsNode);
-            xobj = xpath.execute(xpathContext, fragBase, nsNode);
-            nl = new org.apache.xml.dtm.ref.DTMNodeIterator(xobj.iter());
-          }
-        }
-      }
-      }
-      catch (TransformerException te)
-      {
-        throw new SAXException(te);
-      }
-      if(nl.nextNode() == null)
-      {
-        error(XSLTErrorResources.ER_COULDNT_FIND_FRAGMENT, new Object[] {fragID}); //"Could not find fragment: "+fragID);
-      }
-      // Use previous because the previous call moved the pointer.
-      // or should we use getRoot??
-      Node frag = nl.previousNode(); //.item(0);
-
-      if(Node.ELEMENT_NODE == frag.getNodeType())
-      {
-        pushTime(frag);
-        if(isRoot)
-        {
-          m_stylesheetRoot = createStylesheetRoot(stringHolder[0]);
-          stylesheet = m_stylesheetRoot.getObject();
-        }
-        else
-        {
-          //stylesheet = new Stylesheet(m_stylesheetRoot);
-          // stylesheet = ((StylesheetHandler)(m_processor.getTemplatesBuilder())).getStylesheetRoot();
-          try{
-            Source source = new XSLTInputSource(fragID).getSourceObject(); 
-            Templates templates = m_tfactory.newTemplates(source);
-            stylesheet = (org.apache.xalan.templates.StylesheetRoot)templates;
-          }
-          catch (TransformerConfigurationException tce)
-          {
-            throw new SAXException(tce);
-          }
-        }
-        addTraceListenersToStylesheet();
-
-        try{
-        StylesheetHandler stylesheetProcessor
-          = new StylesheetHandler((TransformerFactoryImpl)m_tfactory);
-           
-        stylesheetProcessor.pushStylesheet(stylesheet);
-        TreeWalker tw = new TreeWalker(stylesheetProcessor, new org.apache.xpath.DOM2Helper());
-        tw.traverse(frag);
-
-        displayDuration("Setup of "+xslURLString, frag);
-        }
-        catch (TransformerConfigurationException tce)
-        {
-          throw new SAXException(tce);
-        }
-      }
-      else
-      {
-        stylesheetDoc = null;
-        error(XSLTErrorResources.ER_NODE_NOT_ELEMENT, new Object[] {fragID}); //"Node pointed to by fragment identifier was not an element: "+fragID);
-      }
-    }
-    else
-    {
-      // TODO: Use Reader here??
-      // hmmm.. for now I'll rely on the XML parser to handle
-      // fragment URLs.
-      diag(XSLMessages.createMessage(XSLTErrorResources.WG_PARSING_AND_PREPARING, new Object[] {xslURLString})); //"========= Parsing and preparing "+xslURLString+" ==========");
-      pushTime(xslURLString);
-
-			URL xslURL = getURLFromString(xslURLString, xmlBaseIdent);
-
-      XSLTInputSource inputSource = new XSLTInputSource(xslURL.toString());
-      
-			if(isRoot)
-			{				
-				if(null != m_liaison)
-				{
-					try{
-						m_liaison.parse(SAXSource.sourceToInputSource(inputSource.getSourceObject()));
-						DOMSource source = new DOMSource(m_liaison.getDocument());
-						Templates templates = m_tfactory.newTemplates(source);
-						m_stylesheetRoot = new StylesheetRoot(
-																		(org.apache.xalan.templates.StylesheetRoot)templates);
-					}					
-					catch (TransformerException tce)
-					{
-						throw new SAXException(tce);
-					}
-				}
-				else
-				{
-					m_stylesheetRoot = createStylesheetRoot(xslURLString);
-				}
-				stylesheet = m_stylesheetRoot.getObject();
-			}
-      else
-      {
-        stylesheet = new Stylesheet(m_stylesheetRoot.getObject());
-      }
-      addTraceListenersToStylesheet();
-
-      try{
-      org.apache.xalan.processor.StylesheetHandler stylesheetProcessor
-        = new StylesheetHandler((TransformerFactoryImpl)m_tfactory); //this, stylesheet); 
-      stylesheetProcessor.pushStylesheet(stylesheet);
-         // new StylesheetHandler(this, stylesheet);
-      }
-      catch (TransformerConfigurationException tce)
-      {
-        throw new SAXException(tce);
-      }
-      
-       
-      //m_parserLiaison.setDocumentHandler(stylesheetProcessor);
-      //m_parserLiaison.parse(inputSource);
-
-      displayDuration("Parsing and init of "+xslURLString, xslURLString);
-    }
-    return stylesheet;
-  }
-
-        
-  /**
-   * Take a user string and try and parse XML, and also return 
-   * the url.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XPathContext decide 
-   * the error condition is severe enough to halt processing.
-   */
-  public static URL getURLFromString(String urlString, String base)
-    throws SAXException 
-  {
-    String origURLString = urlString;
-    String origBase = base;
-    
-    // System.out.println("getURLFromString - urlString: "+urlString+", base: "+base);
-    Object doc;
-    URL url = null;
-    int fileStartType = 0;
-    try
-    {
-      
-      if(null != base)
-      {
-        if(base.toLowerCase().startsWith("file:/"))
-        {
-          fileStartType = 1;
-        }
-        else if(base.toLowerCase().startsWith("file:"))
-        {
-          fileStartType = 2;
-        }
-      }
-      
-      boolean isAbsoluteURL;
-      
-      // From http://www.ics.uci.edu/pub/ietf/uri/rfc1630.txt
-      // A partial form can be distinguished from an absolute form in that the
-      // latter must have a colon and that colon must occur before any slash
-      // characters. Systems not requiring partial forms should not use any
-      // unencoded slashes in their naming schemes.  If they do, absolute URIs
-      // will still work, but confusion may result.
-      int indexOfColon = urlString.indexOf(':');
-      int indexOfSlash = urlString.indexOf('/');
-      if((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash))
-      {
-        // The url (or filename, for that matter) is absolute.
-        isAbsoluteURL = true;
-      }
-      else
-      {
-        isAbsoluteURL = false;
-      }
-      
-      if(isAbsoluteURL || (null == base) || (base.length() == 0))
-      {
-        try 
-        {
-          url = new URL(urlString);
-        }
-        catch (MalformedURLException e) {}
-      }
-      // The Java URL handling doesn't seem to handle relative file names.
-      else if(!((urlString.charAt(0) == '.') || (fileStartType > 0)))
-      {
-        try 
-        {
-          URL baseUrl = new URL(base);
-          url = new URL(baseUrl, urlString);
-        }
-        catch (MalformedURLException e) 
-        {
-        }
-      }
-      
-      if(null == url)
-      {
-        // Then we're going to try and make a file URL below, so strip 
-        // off the protocol header.
-        if(urlString.toLowerCase().startsWith("file:/"))
-        {
-          urlString = urlString.substring(6);
-        }
-        else if(urlString.toLowerCase().startsWith("file:"))
-        {
-          urlString = urlString.substring(5);
-        }
-      }
-      
-      if((null == url) && ((null == base) || (fileStartType > 0)))
-      {
-        if(1 == fileStartType)
-        {
-          if(null != base)
-            base = base.substring(6);
-          fileStartType = 1;
-        }
-        else if(2 == fileStartType)
-        {
-          if(null != base)
-            base = base.substring(5);
-          fileStartType = 2;
-        }
-        
-        File f = new File(urlString);
-        
-        if(!f.isAbsolute() && (null != base))
-        {
-          // String dir = f.isDirectory() ? f.getAbsolutePath() : f.getParent();
-          // System.out.println("prebuiltUrlString (1): "+base);
-          StringTokenizer tokenizer = new StringTokenizer(base, "\\/");
-          String fixedBase = null;
-          while(tokenizer.hasMoreTokens())
-          {
-            String token = tokenizer.nextToken();
-            if (null == fixedBase) 
-            {
-              // Thanks to Rick Maddy for the bug fix for UNIX here.
-              if (base.charAt(0) == '\\' || base.charAt(0) == '/') 
-              {
-                fixedBase = File.separator + token;
-              }
-              else 
-              {
-                fixedBase = token;
-              }
-            }
-            else 
-            {
-              fixedBase+= File.separator + token;
-            }
-          }
-          // System.out.println("rebuiltUrlString (1): "+fixedBase);
-          f = new File(fixedBase);
-          String dir = f.isDirectory() ? f.getAbsolutePath() : f.getParent();
-          // System.out.println("dir: "+dir);
-          // System.out.println("urlString: "+urlString);
-          // f = new File(dir, urlString);
-          // System.out.println("f (1): "+f.toString());
-          // urlString = f.getAbsolutePath();
-          f = new File(urlString); 
-          boolean isAbsolute =  f.isAbsolute() 
-                                || (urlString.charAt( 0 ) == '\\')
-                                || (urlString.charAt( 0 ) == '/');
-          if(!isAbsolute)
-          {
-            // Getting more and more ugly...
-            if(dir.charAt( dir.length()-1 ) != File.separator.charAt(0) && 
-               urlString.charAt( 0 ) != File.separator.charAt(0))
-            {
-              urlString = dir + File.separator + urlString;
-            }
-            else
-            {
-              urlString = dir + urlString;
-            }
-
-            // System.out.println("prebuiltUrlString (2): "+urlString);
-            tokenizer = new StringTokenizer(urlString, "\\/");
-            String rebuiltUrlString = null;
-            while(tokenizer.hasMoreTokens())
-            {
-              String token = tokenizer.nextToken();
-              if (null == rebuiltUrlString) 
-              {
-                // Thanks to Rick Maddy for the bug fix for UNIX here.
-                if (urlString.charAt(0) == '\\' || urlString.charAt(0) == '/') 
-                {
-                  rebuiltUrlString = File.separator + token;
-                }
-                else 
-                {
-                  rebuiltUrlString = token;
-                }
-              }
-              else 
-              {
-                rebuiltUrlString+= File.separator + token;
-              }
-            }
-            // System.out.println("rebuiltUrlString (2): "+rebuiltUrlString);
-            if(null != rebuiltUrlString)
-              urlString = rebuiltUrlString;
-          }
-          // System.out.println("fileStartType: "+fileStartType);
-          if(1 == fileStartType)
-          {
-            if (urlString.charAt(0) == '/') 
-            {
-              urlString = "file://"+urlString;
-            }
-            else
-            {
-              urlString = "file:/"+urlString;
-            }
-          }
-          else if(2 == fileStartType)
-          {
-            urlString = "file:"+urlString;
-          }
-          try 
-          {
-            // System.out.println("Final before try: "+urlString);
-            url = new URL(urlString);
-          }
-          catch (MalformedURLException e) 
-          {
-            // System.out.println("Error trying to make URL from "+urlString);
-          }
-        }
-      }
-      if(null == url)
-      {
-        // The sun java VM doesn't do this correctly, but I'll 
-        // try it here as a second-to-last resort.
-        if((null != origBase) && (origBase.length() > 0))
-        {
-          try 
-          {
-            URL baseURL = new URL(origBase);
-            // System.out.println("Trying to make URL from "+origBase+" and "+origURLString);
-            url = new URL(baseURL, origURLString);
-            // System.out.println("Success! New URL is: "+url.toString());
-          }
-          catch (MalformedURLException e) 
-          {
-            // System.out.println("Error trying to make URL from "+origBase+" and "+origURLString);
-          }
-        }
-        
-        if(null == url)
-        {
-          try 
-          {
-            String lastPart;
-            if(null != origBase)
-            {
-              File baseFile = new File(origBase);
-              if(baseFile.isDirectory())
-              {
-                lastPart = new File(baseFile, urlString).getAbsolutePath ();
-              }
-              else
-              {
-                String parentDir = baseFile.getParent();
-                lastPart = new File(parentDir, urlString).getAbsolutePath ();
-              }
-            }
-            else
-            {
-              lastPart = new File (urlString).getAbsolutePath ();
-            }
-            // Hack
-            // if((lastPart.charAt(0) == '/') && (lastPart.charAt(2) == ':'))
-            //   lastPart = lastPart.substring(1, lastPart.length() - 1);
-            
-            String fullpath;
-            if (lastPart.charAt(0) == '\\' || lastPart.charAt(0) == '/') 
-            {
-              fullpath = "file://" + lastPart;
-            }
-            else
-            {
-              fullpath = "file:" + lastPart;
-            }
-            url = new URL(fullpath);
-          }
-          catch (MalformedURLException e2)
-          {
-            throw new SAXException("Cannot create url for: " + urlString, e2 ); 
-              //XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CREATE_URL, new Object[]{urlString}),e2); //"Cannot create url for: " + urlString, e2 );
-          }
-        }
-      }
-    }
-    catch(SecurityException se)
-    {
-      try
-      {
-        url = new URL("http://xml.apache.org/xslt/"+java.lang.Math.random()); // dummy
-      }
-      catch (MalformedURLException e2)
-      {
-        // I give up
-      }
-    }
-    // System.out.println("url: "+url.toString());
-    return url;
-  }
-
-   /**
-   * Add a trace listener for the purposes of debugging and diagnosis.
-   * @param tl Trace listener to be added.
-   */
-  void addTraceListenersToStylesheet()
-    throws SAXException
-  {
-    /*try
-    {
-      TraceManager tm = m_transformerImpl.getTraceManager();
-      if(tm.hasTraceListeners)
-      {
-        int nListeners = tm.size();
-        for(int i = 0; i < nListeners; i++)
-        {
-          TraceListener tl = (TraceListener)m_traceListeners.elementAt(i);
-          if(null != m_stylesheetRoot)
-            m_stylesheetRoot.addTraceListener(tl);
-        }
-      }
-    }
-    catch(TooManyListenersException tmle)
-    {
-      throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_TOO_MANY_LISTENERS, null),tmle ); //"addTraceListenersToStylesheet - TooManyListenersException", tmle);
-    }*/
-  }
-  
-  /**
-   * Warn the user of an problem.
-   * This is public for access by extensions.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void message(String msg)
-    throws SAXException
-  {
-    message(null, null, msg);
-  }
-
-
-
-  /**
-   * Warn the user of an problem.
-   * This is public for access by extensions.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void message(Node styleNode, Node sourceNode, String msg)
-    throws SAXException
-  {
-    m_problemListener.message(msg);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of an problem.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void warn(int msg)
-    throws SAXException
-  {
-    warn(null, null, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of an problem.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void warn(int msg, Object[] args)
-    throws SAXException
-  {
-    warn(null, null, msg, args);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of an problem.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void warn(Node styleNode, Node sourceNode, int msg)
-    throws SAXException
-  {
-    warn(styleNode, sourceNode, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of an problem.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void warn(Node styleNode, Node sourceNode, int msg, Object args[])
-    throws SAXException
-  {
-    Exception e = null;
-    String fmsg = m_XSLMessages.createWarning(msg, args);
-    SourceLocator locator = null;
-    try{
-     locator = ((StylesheetHandler)(((TransformerFactoryImpl)this.m_tfactory).newTemplatesHandler())).getLocator();
-    }
-    catch (TransformerConfigurationException tce)
-    {
-    }
-    
-    DefaultErrorHandler handler;
-    if (m_problemListener == null)
-      handler = (DefaultErrorHandler)m_tfactory.getErrorListener();
-    else
-      handler = (DefaultErrorHandler)m_problemListener.getErrorHandler();
-    TransformerException te = (null == e) ? new TransformerException(fmsg, locator) :
-                                          new TransformerException(fmsg, locator, e);
-    if(null != handler)
-    {
-      try{
-      handler.warning(te);
-      }
-      catch (TransformerException te2)
-      {
-        throw new SAXException(te2);
-      } 
-    }
-    else
-      throw new SAXException(te);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(String msg)
-    throws SAXException
-  {
-    Exception e = null;
-    SourceLocator locator = null;
-    try{
-    locator = ((StylesheetHandler)(((TransformerFactoryImpl)this.m_tfactory).newTemplatesHandler())).getLocator();
-    }
-    catch (TransformerConfigurationException tce)
-    {
-    }
-    DefaultErrorHandler handler;
-    if (m_problemListener == null)
-      handler = (DefaultErrorHandler)m_tfactory.getErrorListener();
-    else
-      handler = (DefaultErrorHandler)m_problemListener.getErrorHandler();
-    TransformerException te = (null == e) ? new TransformerException(msg, locator) :
-                                          new TransformerException(msg, locator, e);
-    if(null != handler)
-    {  
-      try{
-      handler.fatalError(te);
-    }
-      catch (TransformerException te2)
-      {
-        throw new SAXException(te2);
-      } 
-    }
-    else
-      throw new SAXException(te);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(int msg)
-    throws SAXException
-  {
-    error(null, null, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(int msg, Object[] args)
-    throws SAXException
-  {
-    error(null, null, msg, args);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(int msg, Exception e)
-    throws SAXException
-  {
-    error(msg, null, e);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(int msg, Object args[], Exception e)
-    throws SAXException
-  {
-    String fmsg = m_XSLMessages.createMessage(msg, args);
-    SourceLocator locator = null;
-    try{
-      locator = ((StylesheetHandler)(((TransformerFactoryImpl)this.m_tfactory).newTemplatesHandler())).getLocator();
-    }
-    catch (TransformerConfigurationException tce)
-    {
-    }
-    DefaultErrorHandler handler;
-    if (m_problemListener == null)
-      handler = (DefaultErrorHandler)m_tfactory.getErrorListener();
-    else
-      handler = (DefaultErrorHandler)m_problemListener.getErrorHandler();
-    TransformerException te = (null == e) ? new TransformerException(fmsg, locator) :
-                                          new TransformerException(fmsg, locator, e);
-    if(null != handler)
-    {
-      try{
-      handler.fatalError(te);
-    }
-      catch (TransformerException te2)
-      {
-        throw new SAXException(te2);
-      } 
-    }
-    else
-      throw new SAXException(te);
-  }
-
-  /**
-    * <meta name="usage" content="internal"/>
-  * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(Node styleNode, Node sourceNode, int msg)
-    throws SAXException
-  {
-    error(styleNode, sourceNode, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void error(Node styleNode, Node sourceNode, int msg, Object args[])
-    throws SAXException
-  {
-    Exception e = null;
-    String fmsg = m_XSLMessages.createMessage(msg, args);
-    SourceLocator locator = null;
-    try{
-     locator = ((StylesheetHandler)(((TransformerFactoryImpl)this.m_tfactory).newTemplatesHandler())).getLocator();
-    }
-    catch (TransformerConfigurationException tce)
-    {
-    }
-    DefaultErrorHandler handler;
-    if (m_problemListener == null)
-      handler = (DefaultErrorHandler)m_tfactory.getErrorListener();
-    else
-      handler = (DefaultErrorHandler)m_problemListener.getErrorHandler();
-    TransformerException te = (null == e) ? new TransformerException(fmsg, locator) :
-                                          new TransformerException(fmsg, locator, e);
-    if(null != handler)
-    {  
-      try{
-       handler.fatalError(te);
-      }
-      catch (TransformerException te2)
-      {
-        throw new SAXException(te2);
-      }
-    }
-    else
-      throw new SAXException(te);
-    
-   
-  }
-  
-  /**
-   * Mark the time, so that displayDuration can later
-   * display the elapse.
-   */
-  void pushTime(Object key)
-  {
-    if(null != key)
-    {
-      m_durationsTable.put(key, new Long(System.currentTimeMillis()));
-    }
-  }
-
-  /**
-   * Returns the duration since pushTime was called,
-   * in milliseconds.
-   */
-  long popDuration(Object key)
-  {
-    long millisecondsDuration = 0;
-    if(null != key)
-    {
-      long start = ((Long)m_durationsTable.get(key)).longValue();
-      long stop = System.currentTimeMillis();
-      millisecondsDuration = stop - start;
-      m_durationsTable.remove(key);
-    }
-    return millisecondsDuration;
-  }
-  
-   /**
-   * Display the duration since pushTime was called.
-   */
-  protected void displayDuration(String info, Object key)
-  {
-    long millisecondsDuration = 0;
-    if(null != key)
-    {
-      long start = ((Long)m_durationsTable.get(key)).longValue();
-      long stop = System.currentTimeMillis();
-      millisecondsDuration = stop - start;
-      if(null != m_diagnosticsPrintWriter)
-      {
-        m_diagnosticsPrintWriter.println(info + " took " + millisecondsDuration + " milliseconds");
-      }
-      m_durationsTable.remove(key);
-    }
-  }
-  
-  /**
-   * If this is set, diagnostics will be
-   * written to the m_diagnosticsPrintWriter stream. If
-   * the value is null, then diagnostics will be turned
-   * off.
-   */
-  public void setDiagnosticsOutput(java.io.OutputStream out)
-  {
-    setDiagnosticsOutput(new PrintWriter(out));
-  }
-
-  /**
-   * If this is set, diagnostics will be
-   * written to the m_diagnosticsPrintWriter stream. If
-   * the value is null, then diagnostics will be turned
-   * off.
-   */
-  public void setDiagnosticsOutput(java.io.PrintWriter pw)
-  {
-    m_diagnosticsPrintWriter = pw;
-   /* if(getProblemListener() instanceof ProblemListenerDefault)
-    {
-      ((ProblemListenerDefault)getProblemListener()).setDiagnosticsOutput(pw);
-    }*/
-  }
-
-  /**
-   * Bottleneck output of diagnostics.
-   */
-  protected void diag(String s)
-  {
-    if(null != m_diagnosticsPrintWriter)
-    {
-      m_diagnosticsPrintWriter.println(s);
-    }
-  }
-
-  /**
-   * If this is set to true, simple traces of
-   * template calls are made.
-   */
-  public void setTraceTemplates(boolean b)
-  {
-    m_traceTemplates = b;
-  }
-
-  /**
-   * If this is set to true, simple traces of
-   * template calls are made.
-   */
-  public void setTraceSelect(boolean b)
-  {
-    m_traceSelects = b;
-  }
-
-  /**
-   * If this is set to true, debug diagnostics about
-   * template children as they are being constructed
-   * will be written to the m_diagnosticsPrintWriter
-   * stream.  diagnoseTemplateChildren is false by
-   * default.
-   */
-  public void setTraceTemplateChildren(boolean b)
-  {
-    m_traceTemplateChildren = b;
-  }
-  
-  //
-  // Lexical handler interface
-  //
-
-    /**
-     * Report the start of DTD declarations, if any.
-     *
-     * <p>Any declarations are assumed to be in the internal subset
-     * unless otherwise indicated by a {@link #startEntity startEntity}
-     * event.</p>
-     *
-     * <p>Note that the start/endDTD events will appear within
-     * the start/endDocument events from ContentHandler and
-     * before the first startElement event.</p>
-     *
-     * @param name The document type name.
-     * @param publicId The declared public identifier for the
-     *        external DTD subset, or null if none was declared.
-     * @param systemId The declared system identifier for the
-     *        external DTD subset, or null if none was declared.
-     * @exception SAXException The application may raise an
-     *            exception.
-     * @see #endDTD
-     * @see #startEntity
-     */
-    public void startDTD (String name, String publicId, String systemId)
-	throws SAXException
-    {
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().startDTD(name, publicId, systemId);
-    }
-
-
-    /**
-     * Report the end of DTD declarations.
-     *
-     * @exception SAXException The application may raise an exception.
-     * @see #startDTD
-     */
-    public void endDTD ()
-	throws SAXException
-    {
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().endDTD();
-    }
-    
-    public void startEntity (String name)
-	throws SAXException
-    {
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().startEntity (name);
-    }
-
-
-    /**
-     * Report the end of an entity.
-     *
-     * @param name The name of the entity that is ending.
-     * @exception SAXException The application may raise an exception.
-     * @see #startEntity
-     */
-    public void endEntity (String name)
-	throws SAXException
-      {
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().endEntity (name);
-    }
-
-
-    /**
-     * Report the start of a CDATA section.
-     *
-     * <p>The contents of the CDATA section will be reported through
-     * the regular {@link org.xml.sax.ContentHandler#characters
-     * characters} event.</p>
-     *
-     * @exception SAXException The application may raise an exception.
-     * @see #endCDATA
-     */
-    public  void startCDATA ()
-	throws SAXException
-    { 
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().startCDATA();
-    }
-
-
-    /**
-     * Report the end of a CDATA section.
-     *
-     * @exception SAXException The application may raise an exception.
-     * @see #startCDATA
-     */
-    public void endCDATA ()
-	throws SAXException
-    {
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().endCDATA();
-    }
-
-
-    /**
-     * Report an XML comment anywhere in the document.
-     *
-     * <p>This callback will be used for comments inside or outside the
-     * document element, including comments in the external DTD
-     * subset (if read).</p>
-     *
-     * @param ch An array holding the characters in the comment.
-     * @param start The starting position in the array.
-     * @param length The number of characters to use from the array.
-     * @exception SAXException The application may raise an exception.
-     */
-    public  void comment (char ch[], int start, int length)
-	throws SAXException
-      {
-      if (m_transformerImpl != null && m_transformerImpl.getInputLexicalHandler() != null)
-        m_transformerImpl.getInputLexicalHandler().comment (ch, start, length);
-    }
-    
-    // DocumentHandler interface
-    
-        /**
-     * Receive an object for locating the origin of SAX document events.
-     *
-     * <p>SAX parsers are strongly encouraged (though not absolutely
-     * required) to supply a locator: if it does so, it must supply
-     * the locator to the application by invoking this method before
-     * invoking any of the other methods in the DocumentHandler
-     * interface.</p>
-     *
-     * <p>The locator allows the application to determine the end
-     * position of any document-related event, even if the parser is
-     * not reporting an error.  Typically, the application will
-     * use this information for reporting its own errors (such as
-     * character content that does not match an application's
-     * business rules).  The information returned by the locator
-     * is probably not sufficient for use with a search engine.</p>
-     *
-     * <p>Note that the locator will return correct information only
-     * during the invocation of the events in this interface.  The
-     * application should not attempt to use it at any other time.</p>
-     *
-     * @param locator An object that can return the location of
-     *                any SAX document event.
-     * @see org.xml.sax.Locator
-     */
-    public void setDocumentLocator (Locator locator)
-    {}
-    
-    
-    /**
-     * Receive notification of the beginning of a document.
-     *
-     * <p>The SAX parser will invoke this method only once, before any
-     * other methods in this interface or in DTDHandler (except for
-     * setDocumentLocator).</p>
-     *
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     */
-    public void startDocument ()
-	throws SAXException
-    {
-      if (m_documentHandler != null)
-        m_documentHandler.startDocument();
-      else if (m_transformerImpl != null)
-        m_transformerImpl.getInputContentHandler().startDocument();
-      //m_transformerImpl.getResultTreeHandler().startDocument();
-      
-    }
-    
-    
-    /**
-     * Receive notification of the end of a document.
-     *
-     * <p>The SAX parser will invoke this method only once, and it will
-     * be the last method invoked during the parse.  The parser shall
-     * not invoke this method until it has either abandoned parsing
-     * (because of an unrecoverable error) or reached the end of
-     * input.</p>
-     *
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     */
-    public void endDocument ()
-	throws SAXException
-    {
-      if (m_documentHandler != null)
-        m_documentHandler.endDocument();
-      else if (m_transformerImpl != null)
-        m_transformerImpl.getInputContentHandler().endDocument();
-      //m_transformerImpl.getResultTreeHandler().endDocument();
-    }
-    
-    
-    /**
-     * Receive notification of the beginning of an element.
-     *
-     * <p>The Parser will invoke this method at the beginning of every
-     * element in the XML document; there will be a corresponding
-     * endElement() event for every startElement() event (even when the
-     * element is empty). All of the element's content will be
-     * reported, in order, before the corresponding endElement()
-     * event.</p>
-     *
-     * <p>If the element name has a namespace prefix, the prefix will
-     * still be attached.  Note that the attribute list provided will
-     * contain only attributes with explicit values (specified or
-     * defaulted): #IMPLIED attributes will be omitted.</p>
-     *
-     * @param name The element type name.
-     * @param atts The attributes attached to the element, if any.
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     * @see #endElement
-     * @see org.xml.sax.AttributeList 
-     */
-    public void startElement (String name, AttributeList atts)
-	throws SAXException
-    {
-      if (m_documentHandler == null)       
-      { 
-        m_documentHandler = new ParserAdapter(new org.apache.xerces.parsers.SAXParser());
-        if (m_transformerImpl != null)
-        {  
-          ((ParserAdapter)m_documentHandler).setContentHandler(m_transformerImpl.getInputContentHandler());
-        }
-        /* else if (m_transformerImpl != null)
-        {
-        int index = name.indexOf(":");
-        if (index < 0 )
-        m_transformerImpl.getInputContentHandler().startElement(null, name, name, (Attributes)atts);
-        //getResultTreeHandler().startElement(null, name, name, (Attributes)atts);
-        else
-        m_transformerImpl.getInputContentHandler().startElement(name.substring(0,index), name.substring(index+1), name, (Attributes)atts);        
-        //m_transformerImpl.getResultTreeHandler().startElement(name.substring(0,index), name.substring(index+1), name, (Attributes)atts);
-        */ 
-      } 
-      m_documentHandler.startElement(name, atts);
-    }   
-    
-    /**
-     * Receive notification of the end of an element.
-     *
-     * <p>The SAX parser will invoke this method at the end of every
-     * element in the XML document; there will be a corresponding
-     * startElement() event for every endElement() event (even when the
-     * element is empty).</p>
-     *
-     * <p>If the element name has a namespace prefix, the prefix will
-     * still be attached to the name.</p>
-     *
-     * @param name The element type name
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     */
-    public void endElement (String name)
-	throws SAXException
-    {
-      if (m_documentHandler == null)        
-      {         
-        m_documentHandler = new ParserAdapter(new org.apache.xerces.parsers.SAXParser());
-        if (m_transformerImpl != null)
-        {
-          ((ParserAdapter)m_documentHandler).setContentHandler(m_transformerImpl.getInputContentHandler());
-        }
-     /* else if (m_transformerImpl != null)
-      {
-        int index = name.indexOf(":");
-        if (index < 0 )
-          m_transformerImpl.getInputContentHandler().endElement(null, name, name);
-          //m_transformerImpl.getResultTreeHandler().endElement(null, name, name);        
-        else
-          m_transformerImpl.getInputContentHandler().endElement(name.substring(0,index), name.substring(index+1), name);
-          //m_transformerImpl.getResultTreeHandler().endElement(name.substring(0,index), name.substring(index+1), name);
-        */
-      } 
-      m_documentHandler.endElement(name);      
-    }     
-    
-    
-    /**
-     * Receive notification of character data.
-     *
-     * <p>The Parser will call this method to report each chunk of
-     * character data.  SAX parsers may return all contiguous character
-     * data in a single chunk, or they may split it into several
-     * chunks; however, all of the characters in any single event
-     * must come from the same external entity, so that the Locator
-     * provides useful information.</p>
-     *
-     * <p>The application must not attempt to read from the array
-     * outside of the specified range.</p>
-     *
-     * <p>Note that some parsers will report whitespace using the
-     * ignorableWhitespace() method rather than this one (validating
-     * parsers must do so).</p>
-     *
-     * @param ch The characters from the XML document.
-     * @param start The start position in the array.
-     * @param length The number of characters to read from the array.
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     * @see #ignorableWhitespace 
-     * @see org.xml.sax.Locator
-     */
-    public void characters (char ch[], int start, int length)
-	throws SAXException
-    {
-      if (m_documentHandler != null)
-        m_documentHandler.characters(ch, start, length);
-      else if (m_transformerImpl != null)
-      m_transformerImpl.getInputContentHandler().characters(ch, start, length);
-      //m_transformerImpl.getResultTreeHandler().characters(ch, start, length);
-    }  
-    
-    
-    /**
-     * Receive notification of ignorable whitespace in element content.
-     *
-     * <p>Validating Parsers must use this method to report each chunk
-     * of ignorable whitespace (see the W3C XML 1.0 recommendation,
-     * section 2.10): non-validating parsers may also use this method
-     * if they are capable of parsing and using content models.</p>
-     *
-     * <p>SAX parsers may return all contiguous whitespace in a single
-     * chunk, or they may split it into several chunks; however, all of
-     * the characters in any single event must come from the same
-     * external entity, so that the Locator provides useful
-     * information.</p>
-     *
-     * <p>The application must not attempt to read from the array
-     * outside of the specified range.</p>
-     *
-     * @param ch The characters from the XML document.
-     * @param start The start position in the array.
-     * @param length The number of characters to read from the array.
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     * @see #characters
-     */
-    public void ignorableWhitespace (char ch[], int start, int length)
-	throws SAXException
-    {
-      if (m_documentHandler != null)
-        m_documentHandler.ignorableWhitespace(ch, start, length);
-      else if (m_transformerImpl != null)
-      m_transformerImpl.getInputContentHandler().ignorableWhitespace(ch, start, length);
-      //m_transformerImpl.getResultTreeHandler().ignorableWhitespace(ch, start, length);
-    }
-    
-    
-    /**
-     * Receive notification of a processing instruction.
-     *
-     * <p>The Parser will invoke this method once for each processing
-     * instruction found: note that processing instructions may occur
-     * before or after the main document element.</p>
-     *
-     * <p>A SAX parser should never report an XML declaration (XML 1.0,
-     * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
-     * using this method.</p>
-     *
-     * @param target The processing instruction target.
-     * @param data The processing instruction data, or null if
-     *        none was supplied.
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
-     */
-    public  void processingInstruction (String target, String data)
-	throws SAXException
-    {
-      if (m_documentHandler != null)
-        m_documentHandler.processingInstruction(target, data);
-      else if (m_transformerImpl != null)
-      m_transformerImpl.getInputContentHandler().processingInstruction(target, data);
-      //m_transformerImpl.getResultTreeHandler().processingInstruction(target, data);
-    }
-    
-    // Implement XSLTProcessor
-    
-    /**
-   * Set the output stream. Required when the XSLTProcessor is being used
-   * as a SAX DocumentHandler.
-   */
-  public void setOutputStream(java.io.OutputStream os)
-  {
-    TransformerHandlerImpl handler = new TransformerHandlerImpl(m_transformerImpl, false, null);
-    handler.setResult(new StreamResult(os));   
-  }
-  
-  /**
-   * Convenience function to create an XString.
-   * @param s A valid string.
-   * @return An XString object.
-   */
-  public XString createXString(String s)
-  {
-    return new XString(s);
-  }
-
-  /**
-   * Convenience function to create an XObject.
-   * @param o Any java object.
-   * @return An XObject object.
-   */
-  public XObject createXObject(Object o)
-  {
-    return new XObject(o);
-  }
-
-  /**
-   * Convenience function to create an XNumber.
-   * @param d Any double number.
-   * @return An XNumber object.
-   */
-  public XNumber createXNumber(double d)
-  {
-    return new XNumber(d);
-  }
-
-  /**
-   * Convenience function to create an XBoolean.
-   * @param b boolean value.
-   * @return An XBoolean object.
-   */
-  public XBoolean createXBoolean(boolean b)
-  {
-    return new XBoolean(b);
-  }
-
-  /**
-   * Convenience function to create an XNodeSet.
-   * @param nl A NodeList object.
-   * @return An XNodeSet object.
-   */
-  public XNodeSet createXNodeSet(NodeList nl)
-  {
-    return new XNodeSet(nl);
-  }
-
-  /**
-   * Convenience function to create an XNodeSet from a node.
-   * @param n A DOM node.
-   * @return An XNodeSet object.
-   */
-  public XNodeSet createXNodeSet(Node n)
-  {
-    return new XNodeSet(n);
-  }
-
-  /**
-   * Convenience function to create an XNull.
-   * @return An XNull object.
-   */
-  public XNull createXNull()
-  {
-    return new XNull();
-  }
-  
-  /**
-   * Get the XMLParserLiaison that this processor uses.
-   */
-  public XMLParserLiaison getXMLProcessorLiaison()
-  {
-    return (XMLParserLiaison)m_liaison;
-  }
-
-  /**
-   * Get the preferred stylesheet for the XSLTInputSource XML document,
-   * as identified by the xml-stylesheet PI, and matching the media and
-   * charset criteria. See <a href="http://www.w3.org/TR/xml-stylesheet/">
-   * Associating Style Sheets with XML documents</a>.
-   * Does not yet handle the LINK REL="stylesheet" syntax.
-   *
-   * @param media The media attribute to be matched.  May be null, in which
-   *              case the prefered stylesheet will be used (i.e., alternate = no).
-   * @param title The value of the title attribute to match.  May be null.
-   * @param charset The value of the charset attribute to match.  May be null.
-   * @returns StylesheetSpec extends XSLTInputSource extedns SAX InputSource; the return value
-   * can be passed to the processStylesheet method.
-   */
-  public StylesheetSpec getAssociatedStylesheet(XSLTInputSource source,
-                                                      String media,
-                                                      String charset)
-    throws SAXException
-  {
-    /*InputSource[]in = m_processor.getAssociatedStylesheets(source, media, null, charset);
-    if (in.length >0)
-      return (StylesheetSpec)in[0];
-    else 
-      return null; */
-    try{
-    Source s = m_tfactory.getAssociatedStylesheet(source.getSourceObject(), media, null, charset);
-    return (StylesheetSpec)s; 
-    }
-    catch (TransformerConfigurationException tce) 
-    {
-      throw new SAXException(tce); 
-    }
-  }
-
-  /**
-   * Get a list of stylesheet specifications for the XSLTInputSource XML document,
-   * as identified by the xml-stylesheet PI, and matching the media and
-   * charset criteria. See <a href="http://www.w3.org/TR/xml-stylesheet/">
-   * Associating Style Sheets with XML documents</a>.
-   * Does not yet handle the LINK REL="stylesheet" syntax.
-   *
-   * @param media The media attribute to be matched.  May be null, in which
-   *              case the prefered stylesheet will be used (i.e., alternate = no).
-   * @param title The value of the title attribute to match.  May be null.
-   * @param charset The value of the charset attribute to match.  May be null.
-   * @returns list of StylesheetSpecs (extend XSLTInputSources extend SAX InputSources; a
-   * list member may be passsed to the processStylesheet method.
-   */
-  public Vector getAssociatedStylesheets(XSLTInputSource source,
-                                                      String media,
-                                                      String charset)
-    throws SAXException
-  {
-    try{
-      Source s = m_tfactory.getAssociatedStylesheet(source.getSourceObject(), media, null, charset);
-      Vector v = new Vector();
-      //for (int i = 0; i< in.length; i++)
-      v.addElement((StylesheetSpec)s);
-      return v;
-    }
-    catch (TransformerConfigurationException tce)
-    {
-      throw new SAXException(tce);
-    }                                              
-  }
-  
-  /**
-   * Submit a top-level stylesheet parameter.  This value can
-   * be evaluated in the stylesheet via xsl:param-variable.
-   * @param key The name of the param.
-   * @param value An XObject that will be used.
-   */
-  public void setStylesheetParam(String key, XObject value)
-  {
-    setParameter(key, value.object());
-  }
-
-  /**
-   * Set a top-level stylesheet parameter.  This value can
-   * be evaluated via xsl:param-variable.  Note that the value
-   * passed is an expression, and not a string.  This means that
-   * setStylesheetParam("foo", "hello"); will look for the
-   * element "hello".  If you want to pass a string, you'll
-   * need to put quotes around it:
-   * setStylesheetParam("foo", "'hello'"); will look for the
-   * @param key The name of the param.
-   * @param expression An expression that will be evaluated.
-   */
-  public void setStylesheetParam(String key, String expression)
-  {    
-    if (m_evalList == null)
-      m_evalList = new Vector();
-    if (!m_evalList.contains(key))
-      m_evalList.addElement(key);
-    setParameter(key, expression);
-    m_needToEval = true;
-  }
-  
-  /**
-   * Set a top-level stylesheet parameter.  This value can
-   * be evaluated via xsl:param-variable.  Note that the value
-   * passed is an expression, and not a string.  This means that
-   * setStylesheetParam("foo", "hello"); will look for the
-   * element "hello".  If you want to pass a string, you'll
-   * need to put quotes around it:
-   * setStylesheetParam("foo", "'hello'"); will look for the
-   * @param key The name of the param.
-   * @param expression An expression that will be evaluated.
-   */
-  public void setParameter(String key,  Object value)
-  {
-    if (m_stylesheetParams == null)
-      m_stylesheetParams = new Hashtable();
-    m_stylesheetParams.put(key, value); 
-  }
-
-  /**
-   * Get the current FormatterListener (SAX DocumentHandler), or null if none has been set.
-   */
-  public DocumentHandler getFormatterListener()
-  {
-    return m_documentHandler;
-    
-  }
-
-  /**
-   * Set the FormatterListener (the SAX DocumentHandler).
-   */
-  public void setFormatterListener(DocumentHandler flistener)
-  {
-    m_documentHandler = flistener;
-  }
-
-  /**
-   * Get the current SAX DocumentHandler (the same object as the FormatterListener), or null if none has been set.
-   */
-  public DocumentHandler getDocumentHandler()
-  {
-    return m_documentHandler;
-  }
-
-  /**
-   * Set the current SAX DocumentHandler (the same
-   * object as the FormatterListener).
-   */
-  public void setDocumentHandler(DocumentHandler listener)
-  {
-    if (listener instanceof ParserAdapter)      
-      m_transformerImpl.setContentHandler(((ParserAdapter)listener).getContentHandler());
-    else if (listener instanceof XSLTEngineImpl)
-      m_transformerImpl.setContentHandler(((XSLTEngineImpl)listener).getTransformer().getContentHandler());
-    else if (listener instanceof XMLSerializer)
-    {
-      try{
-        m_transformerImpl.setContentHandler(((XMLSerializer)listener).asContentHandler());
-      }
-      catch (IOException ioe)
-      {}
-    }
-    m_documentHandler = listener;
-  }
-
-  /**
-   * Add a trace listener for the purposes of debugging and diagnosis.
-   * @param tl Trace listener to be added.
-   */
-  public void addTraceListener(TraceListener tl)
-    throws TooManyListenersException
-  {
-    if (m_transformerImpl != null)
-      m_transformerImpl.getTraceManager().addTraceListener(tl);
-  }
-  
-  /**
-   * If set to true (the default), pattern conflict warnings are not printed to the diagnostics stream.
-   * @param b true if conflict warnings should be suppressed.
-   */
-  public void setQuietConflictWarnings(boolean b)
-  {
-    if (m_transformerImpl != null)
-      m_transformerImpl.setQuietConflictWarnings(b);
-  }
-
-  /**
-   * Remove a trace listener.
-   * @param tl Trace listener to be removed.
-   */
-  public void removeTraceListener(TraceListener tl)
-  {
-    if (m_transformerImpl != null)
-      m_transformerImpl.getTraceManager().removeTraceListener(tl);
-  }
-  
-  /**
-   * Set the problem listener property.
-   * The XSL class can have a single listener to be informed
-   * of errors and warnings. The problem listener normally controls whether an exception
-   * is thrown or not (or the problem listeners can throw its own RuntimeException).
-   * @param l A ProblemListener interface.
-   */
-  public void setProblemListener(ProblemListener l)
-  {
-    if (l instanceof ProblemListenerDefault)
-      m_problemListener = (ProblemListenerDefault)l;
-    else
-      m_problemListener = new ProblemListenerDefault(l); 
-    if (m_transformerImpl != null)
-      m_transformerImpl.setErrorListener(m_problemListener);
-    m_tfactory.setErrorListener(m_problemListener);
-  }
-
-  /**
-   * Get the problem listener property.
-   * The XSL class can have a single listener to be informed
-   * of errors and warnings. The problem listener normally controls whether an exception
-   * is thrown or not (or the problem listener can throw its own RuntimeException).
-   * @return A ProblemListener interface.
-   */
-  public ProblemListener getProblemListener()
-  {
-    if (m_problemListener.getProblemListener() != null)
-      return m_problemListener.getProblemListener();
-    else
-      return m_problemListener;
-  }
-  
-  public TransformerImpl getTransformer()
-  {
-    return m_transformerImpl;  
-    //return (StylesheetProcessor)m_processor;
-  }  
-
-  public TransformerFactoryImpl getTransformerFactory()
-  {
-    return (TransformerFactoryImpl)m_tfactory;    
-  } 
-
-  
-} // end XSLTEngineImpl class
diff --git a/compat_src/org/apache/xalan/xslt/XSLTInputSource.java b/compat_src/org/apache/xalan/xslt/XSLTInputSource.java
deleted file mode 100644
index 4b0c780..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLTInputSource.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import javax.xml.transform.Source;
-import org.w3c.dom.Node;
-import java.io.InputStream;
-import java.io.Reader;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.dom.DOMSource;
-
-/**
- * <meta name="usage" content="general"/>
- * Represents an XML source document or XSL stylesheet.
- * Use XSLTInputSource objects to provide input to the XSLTProcessor process() method
- * for a transformation. This class extends the SAX input source to handle
- * DOM nodes as input as well as files, character streams, byte streams and SAX DocumentHandlers.
- *
- * @see XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XSLTInputSource //extends SAXSource 
-{
-  
-  private StreamSource streamSource = null;
-  private SAXSource saxSource = null;
-  private DOMSource domSource = null;
-  
-  /**
-    * Zero-argument default constructor -- Before you can use the new XSLTInputSource object in a transformation,
-    * you must define the document source with setSystemId(), setNode(), setInputStream(), or setCharacterStream().
-    *
-    * @see #setSystemId(String)
-    * @see #setNode(Node)
-    * @see #setInputStream
-    * @see #setCharacterStream
-    * @see #setEncoding(String)
-    */
-  public XSLTInputSource ()
-  {
-    saxSource = new SAXSource();
-  }
-
-  /**
-    * Create a new input source with a system identifier (for a URL or file name) --
-    * the equivalent of creating an input source with the zero-argument
-    * constructor and setting the new object's SystemId property.
-
-    * If the system identifier is a URL, it must be fully resolved.
-    *
-    * If the system identifier is a URL, it must be fully resolved.
-    *
-    * @param systemId The system identifier (URI).
-    * @see #setSystemId(String)
-    * @see #setNode(Node)
-    * @see #setInputStream
-    * @see #setEncoding(String)
-    * @see #setCharacterStream
-    */
-  public XSLTInputSource (String systemId)
-  {
-    saxSource = new SAXSource();
-    this.setSystemId(systemId);
-  }
-
-
-  /**
-    * Create a new input source with a byte stream -- the equivalent of creating an input source
-    * with the zero-argument constructor and setting the new object's ByteStream property.
-    *
-    * @param byteStream The raw byte stream containing the document.
-    * @see #setInputStream
-    * @see #setSystemId(String)
-    * @see #setNode(Node)
-    * @see #setEncoding(String)
-    * @see #setCharacterStream
-    */
-  public XSLTInputSource (InputStream byteStream)
-  {
-    streamSource = new StreamSource();
-    streamSource.setInputStream(byteStream);
-  }
-
-  /**
-    * Create a new input source with a character stream -- the equivalent of creating an input source
-    * with the zero-argument constructor and setting the new object's CharacterStream property.
-    * <p>The character stream shall not include a byte order mark.</p>
-    *
-    * @param characterStream The character stream containing the document.
-    * @see #setCharacterStream
-    * @see #setInputStream
-    * @see #setSystemId(String)
-    * @see #setNode(Node)
-    * @see #setEncoding(String)
-    */
-  public XSLTInputSource (Reader characterStream)
-  {
-    streamSource = new StreamSource();
-    streamSource.setReader(characterStream);
-  }
-
-  /**
-    * Create a new input source with a DOM Node -- the equivalent of creating an input source
-    * with the zero-argument constructor and setting the new object's Node property.
-    *
-    * @param node The DOM Node containing the document.
-    * @see #setNode(Node)
-    * @see #setCharacterStream
-    * @see #setInputStream
-    * @see #setSystemId(String)
-    * @see #setEncoding(String)
-    */
-  public XSLTInputSource (Node node)
-  {
-    domSource = new DOMSource();
-    domSource.setNode(node);
-  }
-
-  /**
-    * Create a new XSLTInputSource source from a SAX input source.
-    * This operation sets the ByteStream, CharacterStream, SystemId, PublicID, and Encoding properties.
-    *
-   * @param isource The SAX input source.
-    * @see #setCharacterStream
-    * @see #setInputStream
-    * @see #setSystemId(String)
-    * @see #setEncoding(String)
-    * @see #setNode(Node)
-    */
-  public XSLTInputSource (InputSource isource)
-  {
-    saxSource = new SAXSource();
-    saxSource.setInputSource(isource);
-    //saxSource.setXMLReader(isource.getCharacterStream());
-    this.setEncoding(isource.getEncoding());
-    this.setSystemId(isource.getSystemId());
-  }
-
-  /**
-    * Set the DOM Node for this input source.
-    *
-    * @param node The DOM node containing the
-    *        XML document or XSL stylesheet.
-    * @see #XSLTInputSource(Node)
-    * @see #getCharacterStream()    * 
-    * @see java.io.Reader
-    */
-  public void setNode (Node node)
-  {
-    if (domSource == null)
-      domSource = new DOMSource();
-    domSource.setNode(node);
-  }
-
-  /**
-    * Get the DOM Node for this input source.
-    *
-    * @return The DOM node containing the document, or null if none was supplied.
-    * @see #XSLTInputSource(Node)
-    * @see #setNode(Node)
-    */
-  public Node getNode ()
-  {
-    if (domSource != null)
-      return domSource.getNode();
-    else
-      return null;
-  }
-
-  
-  
-   /** 
-     * Set the character encoding, if known.
-     *
-     * <p>The encoding must be a string acceptable for an
-     * XML encoding declaration (see section 4.3.3 of the XML 1.0
-     * recommendation).</p>
-     *
-     * <p>This method has no effect when the application provides a
-     * character stream.</p>
-     *
-     * @param encoding A string describing the character encoding.
-     * @see #setSystemId
-     * @see #getEncoding
-     */
-    public void setEncoding (String encoding)
-    {
-	this.encoding = encoding;
-    }
-    
-    
-    /**
-     * Get the character encoding for a byte stream or URI.
-     *
-     * @return The encoding, or null if none was supplied.
-     * @see #getSystemId
-     */
-    public String getEncoding ()
-    {
-	return encoding;
-    }
-    
-    private String encoding = null;
-    
-    /**
-     * Set the character stream for this input source.
-     *
-     * <p>If there is a character stream specified, the SAX parser
-     * will ignore any byte stream and will not attempt to open
-     * a URI connection to the system identifier.</p>
-     *
-     * @param characterStream The character stream containing the
-     *        XML document or other entity.
-     * @see java.io.Reader
-     */
-    public void setCharacterStream (Reader characterStream)
-    {
-      if (streamSource == null)
-	      streamSource = new StreamSource();
-      streamSource.setReader(characterStream);
-    }
-    
-    
-    /**
-     * Get the character stream for this input source.
-     *
-     * @return The character stream, or null if none was supplied.
-     */
-    public Reader getCharacterStream ()
-    {
-      if (streamSource != null)
-        return streamSource.getReader();
-      else
-        return null;
-    }
-    
-    
-    
-    /**
-     * Set the base ID (URL or system ID) from where URLs
-     * will be resolved.
-     *
-     * @param baseID Base URL for this.
-     */
-    public void setSystemId(String baseID) 
-    {
-      this.baseID = baseID;
-      
-      if (saxSource != null)
-        saxSource.setSystemId(baseID);
-      else if (domSource != null)
-        domSource.setSystemId(baseID);
-      else if (streamSource != null)
-        streamSource.setSystemId(baseID);      
-    }
-
-    /**
-     * Get the base ID (URL or system ID) from where URLs
-     * will be resolved.
-     *
-     * @return Base URL for this.
-     */
-    public String getSystemId() {
-        return this.baseID;
-    }
-    
-    private String baseID = null;
-
-    
-    /**
-     * Set the byte stream to be used as input.  Normally,
-     * a stream should be used rather than a reader, so that
-     * the XML parser can resolve character encoding specified
-     * by the XML declaration.
-     *
-     * <p>If this Source object is used to process a stylesheet, normally
-     * setSystemId should also be called, so that relative URL references
-     * can be resolved.</p>
-     *
-     * @param inputStream A valid InputStream reference to an XML stream.
-     */
-    public void setInputStream(InputStream inputStream) 
-    {
-      if (streamSource == null)
-        streamSource = new StreamSource();
-      streamSource.setInputStream(inputStream);
-    }
-
-    /**
-     * Get the byte stream that was set with setInputStream.
-     *
-     * @return The byte stream that was set with setInputStream, or null
-     * if setByteStream or the ByteStream constructor was not called.
-     */
-    public InputStream getInputStream() {
-      if (streamSource != null)
-        return streamSource.getInputStream();
-      else
-        return null;
-    }
-    
-    
-     /**
-     * Get the Result object associated with this XSLTResultTarget object .
-     *
-     * @return The Result object associated with this XSLTResultTarget object
-     * 
-     */
-    public Source getSourceObject() 
-    {
-      if (streamSource != null)        
-        return streamSource;
-      else if (domSource != null)
-        return domSource;
-      else 
-        return saxSource;
-    } 
-}
diff --git a/compat_src/org/apache/xalan/xslt/XSLTProcessor.java b/compat_src/org/apache/xalan/xslt/XSLTProcessor.java
deleted file mode 100644
index d60f371..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLTProcessor.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import java.util.TooManyListenersException;
-import java.util.Vector;
-
-import org.apache.xalan.xpath.XObject;
-import org.apache.xalan.xpath.XNodeSet;
-import org.apache.xalan.xpath.XBoolean;
-import org.apache.xalan.xpath.XNumber;
-import org.apache.xalan.xpath.XNull;
-import org.apache.xalan.xpath.XString;
-import org.apache.xalan.xpath.xml.XMLParserLiaison;
-import org.apache.xalan.xpath.xml.ProblemListener;
-
-import org.apache.xalan.templates.Stylesheet;
-//import org.apache.xalan.templates.StylesheetRoot;
-//import org.apache.xalan.xslt.StylesheetSpec;
-import org.apache.xalan.trace.*;
-
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Node;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.SAXException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import org.apache.xml.serialize.OutputFormat;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * <meta name="usage" content="general"/>
- * The transformation processor -- use {@link org.apache.xalan.xslt.XSLTProcessorFactory} to instantiate an implementation of this interface.
- * It's the responsibility of the implementation (XSLTEngineImpl),
- * collaborating with a XMLParserLiaison, the DOM,
- * and the XPath engine, to transform a source tree
- * of nodes into a result tree according to instructions
- * and templates specified by a stylesheet tree.
- * Use the <code>process(...)</code> are the primary
- * public entry points.
- *
- * Look at the Process class main() method for
- * for an advanced usage example.
- *
- * <p>If you reuse the processor instance, you should call reset() between transformations.</p>
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public interface XSLTProcessor extends DocumentHandler, LexicalHandler
-{
-  /**
-   * Use the XSL stylesheet to transform the XML input, placing the result in the result tree.
-   * @param xmlSource  The XML input to be transformed.
-   * @param xslStylesheet  The XSL stylesheet to be used for the transformation.  May be null if XML input
-   * has an XSL stylesheet PI.
-   * @param resultTree The tree where the result of the transformation is placed.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public void process( XSLTInputSource xmlSource,
-                       XSLTInputSource xslStylesheet,
-                       XSLTResultTarget resultTree)
-    throws SAXException;
-
-  /**
-   * Compile the XSL stylesheet represented by an XSLTInputSource object into an internal representation,
-   * and use it to set the XSLTProcessor Stylesheet property.
-   * This operation is required if the XSLTProcessor is to function as a
-   * SAX DocumentHandler.
-   * If the Stylesheet property has already been set to non-null, this operation
-   * calls reset() before a transformation is performed.
-   *
-   * @param stylesheetSource  The XSL stylesheet.
-   * @return The compiled stylesheet object.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public StylesheetRoot processStylesheet(XSLTInputSource stylesheetSource)
-    throws SAXException;
-
-  /**
-   * Given a URL to (or file name of) an XSL stylesheet,
-   * Compile the stylesheet into an internal representation, and use it to
-   * set the XSLTProcessor Stylesheet property.
-   * This operation is required if the XSLTProcessor is to function as a
-   * SAX DocumentHandler.
-   * If the Stylesheet property has already been set to non-null, this operation
-   * calls reset() before a transformation is performed.
-   *
-   * @param xsldocURLString  The URL to the XSL stylesheet.
-   * @return The compiled stylesheet object.
-   * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
-   * the error condition is severe enough to halt processing.
-   */
-  public StylesheetRoot processStylesheet(String xsldocURLString)
-    throws SAXException;
-
-  /**
-   * Set the output stream. Required when the XSLTProcessor is being used
-   * as a SAX DocumentHandler.
-   */
-  public void setOutputStream(java.io.OutputStream os);
-
-  /**
-   * Reset the XSLTProcessor state.  Must be used after a process() call
-   * if the XSLTProcessor instance is to be used again.
-   */
-  public void reset();
-
-  /**
-   * Get the DOM Node from the XSLTInputSource object. Returns null if the XSLTInputSource
-   * object does not contain a Node (it may, for example, contain an input stream).
-   */
-  public Node getSourceTreeFromInput(XSLTInputSource inputSource)
-    throws org.xml.sax.SAXException;
-
-  /**
-   * Use a compiled stylesheet to set the Stylesheet property for this processor.
-   * When this property is set, the process method uses this stylesheet rather than
-   * looking for a stylesheet PI if the stylesheet parameter is null.  Also required
-   * if you are going to use the XSLTProcessor as a SAX DocumentHandler.
-   */
-  public void setStylesheet(StylesheetRoot stylesheetRoot);
-
-  /**
-   * Get the current Stylesheet setting for this XSLTProcessor.
-   */
-  public StylesheetRoot getStylesheet();
-
-  /**
-   * Get the XMLParserLiaison that this processor uses.
-   */
-  public XMLParserLiaison getXMLProcessorLiaison();
-
-  /**
-   * Get the preferred stylesheet for the XSLTInputSource XML document,
-   * as identified by the xml-stylesheet PI, and matching the media and
-   * charset criteria. See <a href="http://www.w3.org/TR/xml-stylesheet/">
-   * Associating Style Sheets with XML documents</a>.
-   * Does not yet handle the LINK REL="stylesheet" syntax.
-   *
-   * @param media The media attribute to be matched.  May be null, in which
-   *              case the prefered stylesheet will be used (i.e., alternate = no).
-   * @param title The value of the title attribute to match.  May be null.
-   * @param charset The value of the charset attribute to match.  May be null.
-   * @returns StylesheetSpec extends XSLTInputSource extends SAX InputSource; the return value
-   * can be passed to the processStylesheet method.
-   */
-  public StylesheetSpec getAssociatedStylesheet(XSLTInputSource source,
-                                                      String media,
-                                                      String charset)
-    throws SAXException;
-
-  /**
-   * Get a list of stylesheet specifications for the XSLTInputSource XML document,
-   * as identified by the xml-stylesheet PI, and matching the media and
-   * charset criteria. See <a href="http://www.w3.org/TR/xml-stylesheet/">
-   * Associating Style Sheets with XML documents</a>.
-   * Does not yet handle the LINK REL="stylesheet" syntax.
-   *
-   * @param media The media attribute to be matched.  May be null, in which
-   *              case the prefered stylesheet will be used (i.e., alternate = no).
-   * @param title The value of the title attribute to match.  May be null.
-   * @param charset The value of the charset attribute to match.  May be null.
-   * @returns list of StylesheetSpecs (extend XSLTInputSources extend SAX InputSources; a
-   * list member may be passsed to the processStylesheet method.
-   */
-  public Vector getAssociatedStylesheets(XSLTInputSource source,
-                                                      String media,
-                                                      String charset)
-    throws SAXException;
-
-
-  /**
-   * Convenience function to create an XString.
-   * @param s A valid string.
-   * @return An XString object.
-   */
-  public XString createXString(String s);
-
-  /**
-   * Convenience function to create an XObject.
-   * @param o Any java object.
-   * @return An XObject object.
-   */
-  public XObject createXObject(Object o);
-
-  /**
-   * Convenience function to create an XNumber.
-   * @param d Any double number.
-   * @return An XNumber object.
-   */
-  public XNumber createXNumber(double d);
-
-  /**
-   * Convenience function to create an XBoolean.
-   * @param b boolean value.
-   * @return An XBoolean object.
-   */
-  public XBoolean createXBoolean(boolean b);
-
-  /**
-   * Convenience function to create an XNodeSet.
-   * @param nl A NodeList object.
-   * @return An XNodeSet object.
-   */
-  public XNodeSet createXNodeSet(NodeList nl);
-
-  /**
-   * Convenience function to create an XNodeSet from a node.
-   * @param n A DOM node.
-   * @return An XNodeSet object.
-   */
-  public XNodeSet createXNodeSet(Node n);
-
-  /**
-   * Convenience function to create an XNull.
-   * @return An XNull object.
-   */
-  public XNull createXNull();
-
-  /**
-   * Submit a top-level stylesheet parameter.  This value can
-   * be evaluated in the stylesheet via xsl:param-variable.
-   * @param key The name of the param.
-   * @param value An XObject that will be used.
-   */
-  public void setStylesheetParam(String key, XObject value);
-
-  /**
-   * Set a top-level stylesheet parameter.  This value can
-   * be evaluated via xsl:param-variable.  Note that the value
-   * passed is an expression, and not a string.  This means that
-   * setStylesheetParam("foo", "hello"); will look for the
-   * element "hello".  If you want to pass a string, you'll
-   * need to put quotes around it:
-   * setStylesheetParam("foo", "'hello'"); will look for the
-   * @param key The name of the param.
-   * @param expression An expression that will be evaluated.
-   */
-  public void setStylesheetParam(String key, String expression);
-
-  /**
-   * Get the current FormatterListener (SAX DocumentHandler), or null if none has been set.
-   */
-  public DocumentHandler getFormatterListener();
-
-  /**
-   * Set the FormatterListener (the SAX DocumentHandler).
-   */
-  public void setFormatterListener(DocumentHandler flistener);
-
-  /**
-   * Get the current SAX DocumentHandler (the same object as the FormatterListener), or null if none has been set.
-   */
-  public DocumentHandler getDocumentHandler();
-
-  /**
-   * Set the current SAX DocumentHandler (the same
-   * object as the FormatterListener).
-   */
-  public void setDocumentHandler(DocumentHandler listener);
-
-  /**
-   * Add a trace listener for the purposes of debugging and diagnosis.
-   * @param tl Trace listener to be added.
-   */
-  public void addTraceListener(TraceListener tl)
-    throws TooManyListenersException;
-
-  /**
-   * If set to true, template calls are traced.
-   */
-  public void setTraceTemplates(boolean b);
-
-  /**
-   * If set to true, selection events are traced.
-   */
-  public void setTraceSelect(boolean b);
-
-  /**
-   * If set to true (the default is false), as template children are being constructed, debug diagnostics
-   * are written to the m_diagnosticsPrintWriter
-   * stream.
-   */
-  public void setTraceTemplateChildren(boolean b);
-
-  /**
-   * If set to true (the default), pattern conflict warnings are not printed to the diagnostics stream.
-   * @param b true if conflict warnings should be suppressed.
-   */
-  public void setQuietConflictWarnings(boolean b);
-
-  /**
-   * Remove a trace listener.
-   * @param tl Trace listener to be removed.
-   */
-  public void removeTraceListener(TraceListener tl);
-
-  /**
-   * If set, diagnostics will be
-   * written to the m_diagnosticsPrintWriter stream. If
-   * null, diagnostics are turned off. This convenience method calls
-   * {@link #setDiagnosticsOutput(java.io.PrintWriter)}.
-   */
-  public void setDiagnosticsOutput(java.io.OutputStream out);
-
-  /**
-   * If set, diagnostics will be
-   * written to the m_diagnosticsPrintWriter stream. If
-   * null, diagnostics are turned off.
-   */
-  public void setDiagnosticsOutput(java.io.PrintWriter pw);
-
-  /**
-   * Set the problem listener property.
-   * The XSL class can have a single listener to be informed
-   * of errors and warnings. The problem listener normally controls whether an exception
-   * is thrown or not (or the problem listeners can throw its own RuntimeException).
-   * @param l A ProblemListener interface.
-   */
-  public void setProblemListener(ProblemListener l);
-
-  /**
-   * Get the problem listener property.
-   * The XSL class can have a single listener to be informed
-   * of errors and warnings. The problem listener normally controls whether an exception
-   * is thrown or not (or the problem listener can throw its own RuntimeException).
-   * @return A ProblemListener interface.
-   */
-  public ProblemListener getProblemListener();
-
-}
diff --git a/compat_src/org/apache/xalan/xslt/XSLTProcessorFactory.java b/compat_src/org/apache/xalan/xslt/XSLTProcessorFactory.java
deleted file mode 100644
index 785cb4b..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLTProcessorFactory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.apache.xalan.xpath.xml.XMLParserLiaison;
-import org.apache.xpath.XPathFactory;
-//import javax.xml.transform.Processor;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.Templates;
-import org.apache.xml.utils.TreeWalker;
-
-/**
- * <meta name="usage" content="general"/>
- * Manufactures the processor for performing transformations. Use one of the static getProcessor methods
- * to create an XSLTProcessor object.
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XSLTProcessorFactory
-{
-  /**
-   * Get a new XSLTProcessor.
-   */
-  public static XSLTProcessor getProcessor()
-    throws org.xml.sax.SAXException
-  {
-    //Processor processor = Processor.newInstance("xslt"); 
-    return new XSLTEngineImpl();
-  }
-
-  /**
-   * Get a new XSLTProcessor (parserLiaisonClassName no longre used).
-   * *
-   * @see #getProcessor()
-   * @see org.apache.xalan.xpath.xml.XMLParserLiaison
-   */
-  public static XSLTProcessor getProcessorUsingLiaisonName(String parserLiaisonClassName)
-    throws org.xml.sax.SAXException
-  {
-    //return new XSLTEngineImpl(parserLiaisonClassName);
-    //Processor processor = Processor.newInstance("xslt"); 
-    return new XSLTEngineImpl();
-  }
-
-  /**
-   * Get a new XSLTProcessor (XMLParserLiaison no longer used).
-   *
-   * @param parserLiaison the XMLParserLiaison set up to interact with a given XML parser.
-   * @return An implementation of the XSLTProcessor interface with which you can perform transformations.
-   *
-   * @see #getProcessor()
-   * @see org.apache.xalan.xpath.xml.XMLParserLiaison
-   */
-  public static XSLTProcessor getProcessor(XMLParserLiaison parserLiaison)
-  {
-    //return new XSLTEngineImpl(parserLiaison);
-    try{
-      //Processor processor = Processor.newInstance("xslt"); 
-      return new XSLTEngineImpl();
-    }
-   /* catch (TransformerConfigurationException tce)
-    {
-      return null;
-    }*/
-    catch (org.xml.sax.SAXException e)
-    {
-      return null;
-    }
-    
-  }
-
-  /**
-   * Get a new XSLTProcessor (XMLParserLiaison and XPathFactory no longer used).
-   *
-   * @param parserLiaison the XMLParserLiaison set up to interact with a given XML parser.
-   * @param xpathFactory A custom XPathFactory.
-   * @return An implentation of the XSLTProcessor interface with which you
-   * can perform transformations.
-   *
-   * @see #getProcessor()
-   * @see org.apache.xalan.xpath.xml.XMLParserLiaison
-   */
-  public static XSLTProcessor getProcessor(XMLParserLiaison parserLiaison,
-                                                  XPathFactory xpathFactory)
-  {
-    //return new XSLTEngineImpl(parserLiaison, xpathFactory);
-    try{
-      //Processor processor = Processor.newInstance("xslt"); 
-      return new XSLTEngineImpl();
-    }
-  /*  catch (TransformerConfigurationException pe)
-    {
-      return null;
-    }*/
-    catch (org.xml.sax.SAXException e)
-    {
-      return null;
-    }
-  }
-}
diff --git a/compat_src/org/apache/xalan/xslt/XSLTResultTarget.java b/compat_src/org/apache/xalan/xslt/XSLTResultTarget.java
deleted file mode 100644
index 0810595..0000000
--- a/compat_src/org/apache/xalan/xslt/XSLTResultTarget.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * The Apache Software License, Version 1.1  
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import org.w3c.dom.Node;
-import java.io.OutputStream;
-import java.io.Writer;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.ParserAdapter;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXResult;
-
-
-/**
- * <meta name="usage" content="general"/>
- * Contains the result of a transformation that you perform with the
- * XSLTProcessor process() method or one of the StylesheetRoot process() methods.
- * Create an instance of this class to provide the process() method a container
- * for the transformation result tree.
- * You can use a file name or URL, character stream, byte stream, DOM Node, or SAX DocumentHandler
- * to instantiate an XSLTResultTarget object.
- *
- * @see XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
- * @see StylesheetRoot
- * @deprecated This compatibility layer will be removed in later releases. 
- */
-public class XSLTResultTarget //implements Result //extends StreamResult
-{
-  
-  private StreamResult sr = null;
-  private SAXResult saxResult = null;
-  private DOMResult dr = null;
-  
-  
-  /**
-    * Zero-argument default constructor  -- Before you can use the new XSLTResultTarget object in a transformation,
-    * you must define the output container by setting its FileName, CharacterStrea, ByteStream, or Node property.
-    *
-    * @see #setFileName(String)
-    * @see #setCharacterStream(Writer)
-    * @see #setByteStream(OutputStream)
-    * @see #setNode(Node)
-    * @see #setDocumentHandler(DocumentHandler)
-    * @see #setEncoding(String)
-    */
-  public XSLTResultTarget ()
-  {
-     sr = new StreamResult();
-  }
-
-  /**
-   * Create a new output target with a file name -- the equivalent of creating an output target
-   * with the zero-argument constructor and setting the new object's FileName property.
-   *
-   * @param fileName Identifies the file that will contain the transformation result (must be a valid system file name).
-   *
-   * @see #setFileName(String)
-   * @see #setCharacterStream(Writer)
-   * @see #setByteStream(OutputStream)
-   * @see #setNode(Node)
-   * @see #setDocumentHandler(DocumentHandler)
-   * @see #setEncoding(String)
-   */
-  public XSLTResultTarget (String fileName) // File?
-  {
-    sr = new StreamResult();
-    sr.setSystemId(fileName);
-  }
-
-
-  /**
-   * Create a new output target with a byte stream -- the equivalent of creating an output target
-   * with the zero-argument constructor and setting the new object's ByteStream property.
-   *
-   * @param byteStream The raw byte stream that will contain the transformation result.
-   *
-   * @see #setByteStream(OutputStream)
-   * @see #setFileName(String)
-   * @see #setCharacterStream(Writer)
-   * @see #setNode(Node)
-   * @see #setDocumentHandler(DocumentHandler)
-   * @see #setEncoding(String)
-   */
-
-  public XSLTResultTarget (OutputStream byteStream)
-  {
-    sr = new StreamResult();
-    sr.setOutputStream(byteStream);
-  }
-
-
-  /**
-   * Create a new output target with a character stream -- the equivalent of creating an output target
-   * with the zero-argument constructor and setting the new object's CharacterStream property.
-   *
-   * @param characterStream The character stream where the transformation result is written.
-   *
-   * @see #setCharacterStream(Writer)
-   * @see #setByteStream(OutputStream)
-   * @see #setFileName(String)
-   * @see #setNode(Node)
-   * @see #setDocumentHandler(DocumentHandler)
-   * @see #setEncoding(String)
-   */
-  public XSLTResultTarget (Writer characterStream)
-  {
-    sr = new StreamResult();
-    sr.setWriter(characterStream);
-  }    
-
-  /**
-   * Create a new output target with a DOM Node -- the equivalent of creating an output target
-   * with the zero-argument constructor and setting the new object's Node property.
-   *
-   * @param node The DOM Node that will contain the transformation result.
-   *
-  * @see #setNode(Node)
-   * @see #setCharacterStream(Writer)
-   * @see #setByteStream(OutputStream)
-   * @see #setFileName(String)
-   * @see #setDocumentHandler(DocumentHandler)
-   * @see #setEncoding(String)
-   */
-  public XSLTResultTarget (Node n)
-  {
-    dr = new DOMResult();
-    dr.setNode(n);
-  }    
-
-  /**
-   * Create a new output target with a SAX Document handler, which
-   * will handle result events -- the equivalent of creating an output target with the
-   * zero-argument constructor and setting the new object's DocyumentHandler property.
-   *
-   * @param handler The SAX Document handler to which the result is written.
-   *
-  * @see #setDocumentHandler(DocumentHandler)
-   * @see #setNode(Node)
-   * @see #setCharacterStream(Writer)
-   * @see #setByteStream(OutputStream)
-   * @see #setFileName(String)
-   * @see #setEncoding(String)
-   */
-  public XSLTResultTarget(DocumentHandler handler)
-  { 
-    saxResult = new SAXResult();    
-    setDocumentHandler(handler);
-  }
-    
-
-  /**
-   * Set the file name or URL where the transformation result will be written.
-   *
-   * @param fileName The system identifier as a string.
-   *
-   * @see #XSLTResultTarget(String)
-   * @see #getFileName
-   */
-  public void setFileName (String fileName) // File?
-  {
-    if (sr == null)
-      sr = new StreamResult();
-    sr.setSystemId(fileName);
-  }
-
-
-  /**
-   * Get the file name where the results are or will be written, or null if none was supplied.
-   *
-   * @return The file name or URL.
-   *
-   * @see #XSLTResultTarget(String)
-   * @see #setFileName(String)
-   */
-  public String getFileName ()
-  {
-    if (sr != null)
-      return sr.getSystemId();
-    else
-      return null;
-  } 
-
-
-
-  /**
-   * Set the character encoding, if known.
-   *
-   * @param encoding The character encoding.
-   */
-  public void setEncoding (String encoding)
-  {
-    this.encoding = encoding;
-  }
-
-
-  /**
-   * Get the character encoding that was used.
-   *
-   * @return The encoding, or null if none was supplied.
-   */
-  public String getEncoding ()
-  {
-    return encoding;
-  }
-  
-  private String encoding;
-
-
-  /**
-   * Set a SAX DocumentHandler to process the result tree events.
-   * You can process events as they occur
-   * rather than waiting for the transformation to be completed.
-   *
-   * @param handler The SAX DocumentHandler to process result tree events.
-   *
-   * @see #XSLTResultTarget(DocumentHandler)
-   * @see #getDocumentHandler()
-   */
-  public void setDocumentHandler (DocumentHandler handler)
-  {
-    this.formatterListener = handler;
-		if (handler instanceof XSLTEngineImpl)
-			saxResult.setHandler(((XSLTEngineImpl)handler).getTransformer().getContentHandler());
-    if (handler instanceof ParserAdapter)
-    {
-      if (saxResult == null)
-        saxResult = new SAXResult();
-      saxResult.setHandler(((ParserAdapter)handler).getContentHandler());
-    }  
-  }
-
-  /**
-   * Get the SAX DocumentHandler that processes the result tree events.
-   * You can use the DocumentHandler to process events as they occur
-   * rather than waiting for the transformation to be completed.
-   *
-   * @return The SAX DocumentHandler that processes result tree events.
-   *
-   * @see #XSLTResultTarget(DocumentHandler)
-   * @see #setDocumentHandler(DocumentHandler)
-   */
-  public DocumentHandler getDocumentHandler ()
-  {
-    return formatterListener;
-  }
-  
-  private DocumentHandler formatterListener = null;
-  
-  /**
-     * Set the node that will contain the result DOM tree.  In practice,
-     * the node should be a {@link org.w3c.dom.Document} node,
-     * a {@link org.w3c.dom.DocumentFragment} node, or a
-     * {@link org.w3c.dom.Element} node.  In other words, a node
-     * that accepts children.
-     *
-     * @param node The node to which the transformation
-     * will be appended.
-     */
-    public void setNode(Node node) {
-      if (dr == null)
-        dr = new DOMResult();
-      dr.setNode(node);
-    }
-
-    /**
-     * Get the node that will contain the result DOM tree.
-     * If no node was set via setNode, the node will be
-     * set by the transformation, and may be obtained from
-     * this method once the transformation is complete.
-     *
-     * @return The node to which the transformation
-     * will be appended.
-     */
-    public Node getNode() {
-      if (dr != null)
-        return dr.getNode();
-      else
-        return null;
-    }
-    
- /**
-   * Set the byte stream to contain the transformation result.
-   *
-   * @param byteStream A byte stream that will contain the transformation result.
-   *
-   * @see #XSLTResultTarget(OutputStream)
-   * @see #setByteStream(OutputStream)
-   */
-    public void setByteStream(OutputStream byteStrm) {
-        if (sr == null)
-          sr = new StreamResult();
-        sr.setOutputStream(byteStrm);
-    }
-
- /**
-   * Get the byte stream that contains or will contain the transformation result.
-   *
-   * @return The byte stream, or null if none was supplied.
-   *
-   * @see #XSLTResultTarget(OutputStream)
-   * @see #setByteStream(OutputStream)
-   */
-    public OutputStream getByteStream() {
-      if (sr != null)
-        return sr.getOutputStream();
-      else
-        return null;
-    }
-    
-    /**
-     * Set the system identifier for this Result.
-     *
-     * <p>If the Result is not to be written to a file, the system identifier is optional.
-     * The application may still want to provide one, however, for use in error messages
-     * and warnings, or to resolve relative output identifiers.</p>
-     *
-     * @param systemId The system identifier as a URI string.
-     */
-    public void setSystemId(String systemID)
-    {
-      if (sr != null)
-        sr.setSystemId(systemID);
-      else if (dr != null)
-        dr.setSystemId(systemID);
-      else if (saxResult != null)
-        saxResult.setSystemId(systemID);
-    }
-
-    /**
-     * Get the system identifier that was set with setSystemId.
-     *
-     * @return The system identifier that was set with setSystemId,
-     * or null if setSystemId was not called.
-     */
-    public String getSystemId()
-    {
-      if (sr != null)
-        return sr.getSystemId();
-      else if (dr != null)
-        dr.getSystemId();
-      else if (saxResult != null)
-        saxResult.getSystemId();
-      
-      return null;
-    }
-    
-     /**
-     * Set the writer that is to receive the result.  Normally,
-     * a stream should be used rather than a writer, so that
-     * the transformer may use instructions contained in the
-     * transformation instructions to control the encoding.  However,
-     * there are times when it is useful to write to a writer,
-     * such as when using a StringWriter.
-     *
-     * @param writer  A valid Writer reference.
-     */
-    public void setCharacterStream(Writer writer) {      
-      if (sr == null)
-        sr = new StreamResult();
-      sr.setWriter(writer);
-    }
-
-    /**
-     * Get the character stream that was set with setWriter.
-     *
-     * @return The character stream that was set with setWriter, or null
-     * if setWriter or the Writer constructor was not called.
-     */
-    public Writer getCharacterStream() {
-      if (sr != null)
-        return sr.getWriter();
-      else
-        return null;
-    }
-  
-  
-    /**
-     * Get the Result object associated with this XSLTResultTarget object .
-     *
-     * @return The Result object associated with this XSLTResultTarget object
-     * 
-     */
-    public Result getResultObject() 
-    {
-      if (sr != null)        
-        return sr;
-      else if (dr != null)
-        return dr;
-      else 
-        return saxResult;
-    } 
-    
-}
diff --git a/compat_src/org/apache/xalan/xslt/package.html b/compat_src/org/apache/xalan/xslt/package.html
deleted file mode 100644
index 76e39f2..0000000
--- a/compat_src/org/apache/xalan/xslt/package.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<HTML><HEAD></HEAD><BODY>
-     <P><B>The main Xalan-Java 1 compatability package</B> -- facilities for setting up and performing XSL transformations.</P>
-   
-     <P>Use one of the {@link org.apache.xalan.xslt.XSLTProcessorFactory} static getProcessor methods to
-      instantiate an {@link org.apache.xalan.xslt.XSLTProcessor}. The XSLTProcessor interface defines the 
-      XSLT processor API. You should never need to call the underlying implementation 
-      ({@link org.apache.xalan.xslt.XSLTEngineImpl}) directly.</P>
-      
-      <P>Instantiate {@link org.apache.xalan.xslt.XSLTInputSource} objects for the XML input and the XSL
-      stylesheet, and an {@link org.apache.xalan.xslt.XSLTResultTarget} object for the transformation output. 
-      You may construct these objects with a variety of containers/formats, including files or URLs, character
-      streams,byte streams, SAX input streams or document handlers, and a DOM tree.</P>
-      <P>As a general rule, use the XSLTProcessor process method to perform a transformation, thereby filling the
-      XSLTResultTarget object. For repeated transformations, to gather information from the stylesheet before you
-      perform the transformation, or to set up the processor to function as a SAX document handler, use the
-       XSLTProcessor processStylesheet method to compile the XSL stylesheet, which returns a 
-       {@link org.apache.xalan.xslt.StylesheetRoot} object with its own process method.</P>
-   </BODY></HTML>
\ No newline at end of file
diff --git a/readme.html b/readme.html
deleted file mode 100644
index dae48ad..0000000
--- a/readme.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-<html>
-<head>
-<title>
-</title>
-</head>
-<body>
-<meta content="0; URL=docs/whatsnew.html" http-equiv="Refresh">
-      Redirecting to <a href="docs/whatsnew.html">What's New in Xalan_Java 2</a>
-</body>
-</html>
-
-
-
-
-            
-            
-
-
-
-
-            
-   
diff --git a/samples/AppletXMLtoHTML/README.html b/samples/AppletXMLtoHTML/README.html
deleted file mode 100644
index c0b584d..0000000
--- a/samples/AppletXMLtoHTML/README.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title></title>Xalan Sample Applets</title>
-</head>
-<body bgcolor="#808080" text="#ffffff">
-  <table>
-    <tr>
-      <td><img border="0" hspace="0" vspace="0" align="left" src="rabbitwhorn.jpg"></td>
-      <td><h2>&nbsp;Running the Xalan sample applets</h2></td>
-    </tr>
-  </table>
-  <hr>
-  <ul>
-  <li>appletXMLtoHTML.html transforms XML into HTML, and displays the XML document and XSL stylesheet as well as the HTML transformation result.<br/><br/></li>
-  <li>get-todo-list.html uses todo.xsl to transform todo.xml and display the transformation result. The XML source is a snapshot of todo.xml in the xml-xalan CVS repository, an ongoing list of tasks and task completions for the Xalan-Java 2 development project.</li>
-  <p>Both applets look for xalan.jar and xerces.jar in the bin directory. If the JAR files are elsewhere, you must move them or adjust the applet archive setting in client.html and get-todo-list.html.</p>
-</ul>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/AppletXMLtoHTML/appletXMLtoHTML.html b/samples/AppletXMLtoHTML/appletXMLtoHTML.html
deleted file mode 100644
index 0aaa900..0000000
--- a/samples/AppletXMLtoHTML/appletXMLtoHTML.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Using an applet to perform XSL transformations</title>
-</head>
-  <FRAMESET ROWS="125,*" >
-    <FRAME NAME="processor" SRC="client.html" SCROLLING="auto" >
-      <frameset cols="33%, 33%, *">
-        <FRAME NAME="targetArea0" SRC="target.html" >
-        <FRAME NAME="targetArea1" SRC="target.html" >
-        <FRAME NAME="targetArea2" SRC="target.html" >        
-      </frameset>
-  </FRAMESET>
-
-</html>
diff --git a/samples/AppletXMLtoHTML/client.html b/samples/AppletXMLtoHTML/client.html
deleted file mode 100644
index 00a4382..0000000
--- a/samples/AppletXMLtoHTML/client.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-  <head>
-	  <title>Untitled</title>
-  </head>
-  <script language="JavaScript">
-
-    
-    function writeSource(sourceString)
-    {
-
-      var escString=document.xslControl.escapeString(sourceString);
-      var title="XML Source Doc";
-      var doc=top.frames[1].document;      
-      doc.open();
-      doc.write("<h3>" + title + "</h3>");
-      doc.write("<PRE>");
-      doc.write(escString);
-      doc.write("</PRE>");
-      doc.close();    
-    }
-  
-    function writeStylesheet(styleString)
-    {
-      var escString=document.xslControl.escapeString(styleString);
-      var title="XSL Stylesheet";
-      var doc=top.frames[2].document;          
-      doc.open();
-      doc.write("<h3>" + title + "</h3>");
-      doc.write("<PRE>");
-      doc.write(escString);
-      doc.write("</PRE>");
-      doc.close();     
-    } 
-
-    function writeTarget(targetString)
-    {
-      var doc=top.frames[3].document;
-      doc.open();
-      var title="HTML Output";      
-      doc.write("<h3>" + title + "</h3>");
-      if (document.xmlTransform.displayMode[0].checked) //display HTML
-      {
-        doc.write(targetString);
-      }
-      else // display source
-      {
-        var escString=document.xslControl.escapeString(targetString);
-        doc.write("<PRE>");
-        doc.write(escString);
-        doc.write("</PRE>");
-      }
-      doc.close();    
-    }
-  
-    function clearFrames()
-    {
-      document.xslControl.freeCache();
-      for (i=1; i<4; i++)
-        {
-        var doc=top.frames[i].document;
-        doc.open();
-        doc.clear();
-        doc.close();
-        }
-    }
-  
-    function transform()
-    {  
-      clearFrames();
-      var xmlSource=document.xmlTransform.xmlSourceList.options[document.xmlTransform.xmlSourceList.selectedIndex].value;
-      document.xslControl.setDocumentURL(xmlSource);
-      var sourceString=document.xslControl.getSourceTreeAsText();
-      var styleString=document.xslControl.getStyleTreeAsText();
-      var targetString=document.xslControl.getHtmlText();      
-      writeSource(sourceString);
-      writeStylesheet(styleString);
-      writeTarget(targetString);
-    }
-  </script>
-  <body onLoad="clearFrames();" bgcolor="#808080" text="#ffffff">
-    <form name="xmlTransform" action="" method="POST">
-      <h2><img border="0" hspace="0" vspace="0" align="left" src="rabbitwhorn.jpg">&nbsp;Transform XML Document</h2>
-        <table>
-          <tr>
-            <td width="50"></td>
-            <td align="center"><i>Document to transform</i></td>
-            <td align="center"><i>Display output as</i></td>
-          </tr>
-          <tr>
-          <td></td>
-          <td align="center">
-            <select name="xmlSourceList">
-              <option value="xalanApplets.xml" selected>&nbsp;xalanApplets.xml&nbsp;
-              <option value="foo-s1.xml">&nbsp;foo-s1.xml&nbsp;
-            </select>
-          </td>
-          <td align="center">
-            <input type="radio" name="displayMode" checked>HTML&nbsp;&nbsp;
-            <input type="radio" name="displayMode">HTML Source
-          </td>
-          <td>&nbsp;&nbsp;&nbsp;&nbsp;
-            <input type="button" name="transformButton" value="Transform" 
-            onClick="transform();">
-          </td>
-        </tr>
-      </table>
-    </form>
-    <!-- Be sure you have applet archive attribute set
-         so the applet can find xalan.jar and xerces.jar -->  
-    <applet  
-      name="xslControl"
-      code="org.apache.xalan.client.XSLTProcessorApplet.class"
-      archive="../../bin/xalan.jar,../../bin/xerces.jar"
-      height="0"
-      width"0">
-      <param name="documentURL" value="xalanApplets.xml"/>  <!--default setting-->
-      <param name="styleURL" value="s1ToHTML.xsl"/> <!--doesn't change-->
-    </applet>
-  </body>
-</html>
diff --git a/samples/AppletXMLtoHTML/foo-s1.xml b/samples/AppletXMLtoHTML/foo-s1.xml
deleted file mode 100644
index e8ce033..0000000
--- a/samples/AppletXMLtoHTML/foo-s1.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<s1 title="s1 foo">
-  <s2 title="Foo">
-    <p>Hello</p>
-  </s2>
-</s1>
\ No newline at end of file
diff --git a/samples/AppletXMLtoHTML/get-todo-list.html b/samples/AppletXMLtoHTML/get-todo-list.html
deleted file mode 100644
index 30d9073..0000000
--- a/samples/AppletXMLtoHTML/get-todo-list.html
+++ /dev/null
@@ -1,26 +0,0 @@
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-  <head>
-	<title>Xalan-Java 2 "to do" list</title>
-  </head>
-  <script language="JavaScript">
- 
-    function transform()
-    { 
-      var todolist = xslControl.getHtmlText();
-      document.write(todolist);
-    }
-  </script>
-  <body onLoad="transform();">
-    <applet  
-      name="xslControl"
-      code="org.apache.xalan.client.XSLTProcessorApplet.class"
-      archive="../../bin/xalan.jar,../../bin/xerces.jar"
-      height="0"
-      width="0">
-      <param name="documentURL" value="../../todo.xml"/> 
-      <param name="styleURL" value="../../todo.xsl"/>
-    </applet>
-  </body>
-</html>
diff --git a/samples/AppletXMLtoHTML/lts3611beac.jpg b/samples/AppletXMLtoHTML/lts3611beac.jpg
deleted file mode 100644
index c249149..0000000
--- a/samples/AppletXMLtoHTML/lts3611beac.jpg
+++ /dev/null
@@ -1 +0,0 @@
-OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
\ No newline at end of file
diff --git a/samples/AppletXMLtoHTML/rabbitwhorn.jpg b/samples/AppletXMLtoHTML/rabbitwhorn.jpg
deleted file mode 100644
index 4544a38..0000000
--- a/samples/AppletXMLtoHTML/rabbitwhorn.jpg
+++ /dev/null
Binary files differ
diff --git a/samples/AppletXMLtoHTML/s1ToHTML.xsl b/samples/AppletXMLtoHTML/s1ToHTML.xsl
deleted file mode 100644
index 2605e6f..0000000
--- a/samples/AppletXMLtoHTML/s1ToHTML.xsl
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:output method="html" indent="yes"/>
-    
-  <xsl:template match="/">
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="s1">
-    <html>
-      <head><title><xsl:value-of select="@title"/></title></head>
-      <body  bgcolor="#ffffff" text="#000000">
-        <xsl:apply-templates select="s2"/>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="s2">
-    <table width="100%" border="0" cellspacing="0" cellpadding="4">
-      <tr>
-        <td bgcolor="#006699">
-          <font color="#ffffff" size="+1">
-            <b><xsl:value-of select="@title"/></b>
-          </font>
-        </td>
-      </tr>
-    </table>
-    <xsl:apply-templates/>
-    <br/>
-  </xsl:template>
-
-  <xsl:template match="p">
-    <p><xsl:apply-templates/></p>
-  </xsl:template>
-
-  <xsl:template match="note">
-    <table border="0" width="100%">
-      <tr>
-        <td width="20">&#160;</td>
-        <td bgcolor="#88aacc">
-          <font size="-1"><i>NOTE: <xsl:apply-templates/></i></font>
-        </td>
-        <td width="20">&#160;</td>
-      </tr>
-    </table>
-  </xsl:template>
-  
-  <xsl:template match="ul">
-    <ul><xsl:apply-templates/></ul>
-  </xsl:template>
-
-  <xsl:template match="ol">
-    <ol><xsl:apply-templates/></ol>
-  </xsl:template>
-  
-  <xsl:template match="gloss">
-    <dl><xsl:apply-templates/></dl>
-  </xsl:template>
-   <!-- <term> contains a single-word, multi-word or symbolic 
-       designation which is regarded as a technical term. --> 
-  <xsl:template match="term">
-    <dfn><xsl:apply-templates/></dfn>
-  </xsl:template>
-
-  <xsl:template match="label" priority="1">
-    <dt><xsl:apply-templates/></dt>
-  </xsl:template>
-
-  <xsl:template match="item" priority="2">
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-
-  <xsl:template match="table">
-    <p align="center"><table border="0"><xsl:apply-templates/></table></p>
-  </xsl:template>
-
-  <xsl:template match="source">
-    <table border="0" width="100%">
-      <tr>
-        <td width="20">&#160;</td>
-        <td bgcolor="#88aacc"><pre><xsl:apply-templates/></pre></td>
-        <td width="20">&#160;</td>
-      </tr>
-    </table>
-  </xsl:template>
-
-  <xsl:template match="li">
-    <li><xsl:apply-templates/></li>
-  </xsl:template>
-
-  <xsl:template match="tr">
-    <tr><xsl:apply-templates/></tr>
-  </xsl:template>
-
-  <xsl:template match="th">
-    <td bgcolor="#006699" align="center">
-      <font color="#ffffff"><b><xsl:apply-templates/></b></font>
-    </td>
-  </xsl:template>
-
-  <xsl:template match="td">
-    <td bgcolor="#88aacc"><xsl:apply-templates/>&#160;</td>
-  </xsl:template>
-
-  <xsl:template match="tn">
-    <td>&#160;</td>
-  </xsl:template>
-
-  <xsl:template match="em">
-    <b><xsl:apply-templates/></b>
-  </xsl:template>
-
-  <xsl:template match="ref">
-    <i><xsl:apply-templates/></i>
-  </xsl:template>
-
-  <xsl:template match="code">
-    <code><xsl:apply-templates/></code>
-  </xsl:template>
-
-  <xsl:template match="br">
-    <br/>
-  </xsl:template>
-
-
-  <xsl:template match="jump">
-    <a href="{@href}" target="_top"><xsl:apply-templates/></a>
-  </xsl:template>  
-
-  <xsl:template match="anchor">
-    <a name="{@id}"> </a>
-  </xsl:template>
-
-  <xsl:template match="img">
-    <img src="{@src}" align="right" border="0" vspace="4" hspace="4"/>
-  </xsl:template>
-  
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/AppletXMLtoHTML/target.html b/samples/AppletXMLtoHTML/target.html
deleted file mode 100644
index ea8545c..0000000
--- a/samples/AppletXMLtoHTML/target.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-  <head>
-    <title>Untitled</title>
-  </head>
-  <body>&nbsp;</body>
-</html>
diff --git a/samples/AppletXMLtoHTML/xalanApplets.xml b/samples/AppletXMLtoHTML/xalanApplets.xml
deleted file mode 100644
index ef86fc1..0000000
--- a/samples/AppletXMLtoHTML/xalanApplets.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?> 
-<s1 title="About Xalan Applets">
-  <s2 title="Transforming XML to HTML in an Applet">
-    <ol> 
-      <li>
-        <p>Include
-        org.apache.xalan.xslt.client.XSLTProcessorApplet
-        in an HTML client.</p>
-      </li>
-      <li>
-        <p>Specify the XML source document and XSL
-        stylesheet.</p>
-        <p>You can use the DocumentURL and StyleURL PARAM tags 
-        or the setDocumentURL() and setStyleURL() methods. 
-        If the XML document contains a stylesheet Processing
-        Instruction (PI), you do not need to specify an XSL
-        stylesheet.</p>
-      </li>
-      <li>
-        <p>Call the getHtmlText() method, which performs
-        the transformation and returns the new document as a
-        String.</p>
-      </li>
-    </ol>
-  </s2>
-</s1>
\ No newline at end of file
diff --git a/samples/ApplyXPath/ApplyXPath.java b/samples/ApplyXPath/ApplyXPath.java
deleted file mode 100644
index c5a9298..0000000
--- a/samples/ApplyXPath/ApplyXPath.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-// This file uses 4 space indents, no tabs.
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.Properties;
-import org.apache.xerces.parsers.DOMParser;
-import org.apache.xpath.XPathAPI;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.DOMBuilder;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.SAXException;
-import org.xml.sax.InputSource;
-
-// Imported JAVA API for XML Parsing 1.0 classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException; 
-
-// Imported Serializer classes
-import javax.xml.transform.*;
-import javax.xml.transform.stream.*;
-import javax.xml.transform.dom.*;
-
-/**
- *  Very basic utility for applying an XPath epxression to an xml file and printing information
- /  about the execution of the XPath object and the nodes it finds.
- *  Takes 2 arguments:
- *     (1) an xml filename
- *     (2) an XPath expression to apply to the file
- *  Examples:
- *     java ApplyXPath foo.xml /
- *     java ApplyXPath foo.xml /doc/name[1]/@last
- * @see XPathAPI
- */
-public class ApplyXPath
-{
-  protected String filename = null;
-  protected String xpath = null;
-
-  /** Process input args and execute the XPath.  */
-  public void doMain(String[] args)
-    throws Exception
-  {
-    filename = args[0];
-    xpath = args[1];
-
-    if ((filename != null) && (filename.length() > 0)
-        && (xpath != null) && (xpath.length() > 0))
-    {
-      // Tell that we're loading classes and parsing, so the time it 
-      // takes to do this doesn't get confused with the time to do 
-      // the actual query and serialization.
-      System.out.println("Loading classes, parsing "+filename+", and setting up serializer");
-      
-      // Set up a DOM tree to query.
-      InputSource in = new InputSource(new FileInputStream(filename));
-      DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-      dfactory.setNamespaceAware(true);
-      Document doc = dfactory.newDocumentBuilder().parse(in);
-      
-      // Set up an identity transformer to use as serializer.
-      Transformer serializer = TransformerFactory.newInstance().newTransformer();
-      serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-
-      // Use the simple XPath API to select a nodeIterator.
-      System.out.println("Querying DOM using "+xpath);
-      NodeIterator nl = XPathAPI.selectNodeIterator(doc, xpath);
-
-      // Serialize the found nodes to System.out.
-      System.out.println("<output>");
-                  
-      Node n;
-      while ((n = nl.nextNode())!= null)
-      {         
-        serializer.transform(new DOMSource(n), new StreamResult(System.out));
-        System.out.println();
-      }
-      System.out.println("</output>");
-    }
-    else
-    {
-      System.out.println("Bad input args: " + filename + ", " + xpath);
-    }
-  }
-  
-  /** Main method to run from the command line.    */
-  public static void main (String[] args)
-    throws Exception
-  {
-    if (args.length != 2)
-    {
-      System.out.println("java ApplyXPath filename.xml xpath\n"
-                         + "Reads filename.xml and applies the xpath; prints the nodelist found.");
-      return;
-    }
-        
-    ApplyXPath app = new ApplyXPath();
-    app.doMain(args);
-  }	
-  
-} // end of class ApplyXPath
-
diff --git a/samples/ApplyXPath/foo.xml b/samples/ApplyXPath/foo.xml
deleted file mode 100644
index 0423708..0000000
--- a/samples/ApplyXPath/foo.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<doc>
-  <name first="David" last="Marston"/>
-  <name first="David" last="Bertoni"/>
-  <name first="Donald" last="Leslie"/>
-  <name first="Emily" last="Farmer"/>
-  <name first="Joseph" last="Kesselman"/>
-  <name first="Myriam" last="Midy"/>
-  <name first="Paul" last="Dick"/>
-  <name first="Stephen" last="Auriemma"/>
-  <name first="Scott" last="Boag"/>
-  <name first="Shane" last="Curcuru"/>
-</doc>
\ No newline at end of file
diff --git a/samples/ApplyXPath/readme.html b/samples/ApplyXPath/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/ApplyXPath/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/CompiledApplet/README.applet b/samples/CompiledApplet/README.applet
deleted file mode 100644
index 0f43ba3..0000000
--- a/samples/CompiledApplet/README.applet
+++ /dev/null
@@ -1,91 +0,0 @@
-======================================================================
-The Sun XSLT Compiler (XSLTC) is a Java-based tool for compiling XSL
-stylesheets into extremely lightweight and portable Java byte code.
-The XSLTC Java Runtime environment can then process XML files against
-these compiled stylesheets (Translets) to generate any manner of
-output per the stylesheet instructions.
-
-This Applet Demo shows you how translets can be run in a client 
-browser as Java applets to perform XSLT transformations on XML 
-source documents residing on a Web server. Because of XSLTC's small 
-footprint, it is possible to download the compiled stylesheets 
-(translets) and the runtime classes in the applet. Whereas, this
-would not be easy with a fullsize Java-based XSLT processor. 
-
-There are two important advatages of this approach: 
-
-  1) It offloads XSLT processing from the server
-  2) It enables browsers, such as Netscape 4.x, that do not have native 
-     XSLT support to perform XSLT transformations today!
-
------------------------------------------------------------------------
-DEMO CONTENTS
------------------------------------------------------------------------
-The applet demo is very generic. It will let you run any pre-compiled
-translet through an applet, and it lets you use that on any XML file
-you can refer to using an URL. The contents of this demo are:
-
-  TransformApplet.java -  The applet that wraps the XSLTC runtime 
-      classes and your translet(s).
-
-  index.html - Your main HTML document (displays two frames)
-
-  menu.html  - The HTML document for your dialog frame. This is the
-      document that invokes the TransformApplet
-
------------------------------------------------------------------------
-HOW TO SET UP THE DEMO ON YOUR SITE
------------------------------------------------------------------------
-1. Install and configure Xalan with XSLTC
-
-2. Compile the stylesheets you want to export. This will result in one
-   or more small Java classes (translets).
-
-3. Create a JAR file with your the applet class (compile it first, of
-   cource), your translet classes and these classes from the xalan/xsltc
-   package:
-
-     org/apache/xalan/xsltc/*.class
-     org/apache/xalan/xsltc/dom/*.class
-     org/apache/xalan/xsltc/runtime/*.class
-     org/apache/xalan/xsltc/util/*.class
-
-   Be sure to make the JAR file world readable!
-
-4. Make your XML source documents readable through a URL (either place
-   them behind a web server or make them readable for your browser as
-   a file).
-
-5. Open the supplied index.html and try out the demo!
-
-----------------------------------------------------------------------
-KNOW PROBLEMS
-----------------------------------------------------------------------
-The following problems are specific to the Netscape 4.x browser.
-
-Class Already Loaded - If you start up the Netscape client browser on 
-a Unix system where you have been running XSLTC, and consequently 
-have a CLASSPATH that includes xml.jar, and xlstcrt.jar, the applet 
-demo fails. You'll see a message saying a class has already been 
-loaded in the Javascript console. To bring up the Javascript console,
-you type
-
-    javascript:
-
-in the location/URL field of the browser. To work around this problem, 
-unset your CLASSPATH before starting Netscape from a terminal window.
-This still may not resolve the problem if Netscape is started from 
-a wrapper that sets your environment from your startup file (e.g., 
-your .cshrc file for the C-shell).
-
-Parser Exception - This problem only applies to Netscape on the 
-Windows platform with XML documents that have an external DTD.
-If you see the following message:
-
-    org.xml.sax.SAXParseException: 
-    External parameter entity "%(DOCTYPE);"
-    has characters after markup.
-
-try removing the reference to an external DTD in your XML source.
-----------------------------------------------------------------------
-END OF README
diff --git a/samples/CompiledApplet/TransformApplet.java b/samples/CompiledApplet/TransformApplet.java
deleted file mode 100644
index 8b24fe7..0000000
--- a/samples/CompiledApplet/TransformApplet.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- * @author Jacek Ambroziak
- *
- */
-
-import java.io.*;
-import java.applet.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.*;
-import org.apache.xalan.xsltc.dom.*;
-
-/**
- * This applet demonstrates how XSL transformations can be made run in
- * browsers without native XSLT support.
- *
- * Note that the XSLTC transformation engine is invoked through its native
- * interface and not the javax.xml.transform (JAXP) interface. This because
- * XSLTC still does not offer precompiled transformations through JAXP.
- */
-public final class TransformApplet extends Applet {
-
-    // Single document cache
-    private String _documentUrl = "";
-    private DOMImpl _dom = null;
-    private DTDMonitor _dtdMonitor = null;
-
-    private static final String NAMESPACE_FEATURE =
-	"http://xml.org/sax/features/namespaces";
-
-    /**
-     * This class implements a dialog box used for XSL messages/comments
-     */
-    public class MessageFrame extends Frame {
-
-	public Frame frame;
-
-        public class ButtonHandler implements ActionListener {
-	    public void actionPerformed(ActionEvent e) {
-	        frame.setVisible(false);
-	    }
-	}
-
-	/**
-	 * This method handles xml:message and xsl:comment by displaying
-	 * the message/comment in a dialog box.
-	 */
-	public MessageFrame(String title, String message) {
-	    super(title);
-	    frame = this; // Make visible to ButtonHandler
-	    setSize(320,200);
-
-	    // Create a panel for the message itself
-	    Panel center = new Panel();
-	    center.add(new Label(message));
-
-	    // Create a panel for the 'OK' button
-	    Panel bottom = new Panel();
-	    Button okButton = new Button("   OK   ");
-	    okButton.addActionListener(new ButtonHandler());
-	    bottom.add(okButton);
-	    
-	    // Add the two panels to the window/frame
-	    add(center, BorderLayout.CENTER);
-	    add(bottom,BorderLayout.SOUTH);
-
-	    // Show the fecking thing
-	    setVisible(true);
-	}
-
-    }
-
-    /**
-     * The appled uses this method to display messages and comments
-     * generated by xsl:message and xsl:comment elements.
-     */
-    public class AppletMessageHandler extends MessageHandler {
-	public void displayMessage(String msg) {
-	    MessageFrame z = new MessageFrame("XSL transformation alert",msg);
-	}
-    }
-
-    /**
-     * Reads the input document from the supplied URL and builds the
-     * internal "DOM" tree.
-     */
-    private DOM getDOM(String url) throws Exception {
-	// Check if the document is already in the 1-document cache
-	if (url.equals(_documentUrl) == false) {
-
-	    // Create a SAX parser and get the XMLReader object it uses
-	    final SAXParserFactory factory = SAXParserFactory.newInstance();
-	    try {
-		factory.setFeature(NAMESPACE_FEATURE,true);
-	    }
-	    catch (Exception e) {
-		factory.setNamespaceAware(true);
-	    }
-	    final SAXParser parser = factory.newSAXParser();
-	    final XMLReader reader = parser.getXMLReader();
-
-	    // Set the DOM's builder as the XMLReader's SAX2 content handler
-	    _dom = new DOMImpl();
-	    reader.setContentHandler(_dom.getBuilder());
-
-	    // Create a DTD monitor and pass it to the XMLReader object
-	    _dtdMonitor = new DTDMonitor();
-	    _dtdMonitor.handleDTD(reader);
-
-	    // Parse the input document
-	    reader.parse(url);
-
-	    // Update the 1-document cahce with this DOM
-	    _documentUrl = url;
-	}
-	return _dom;
-    }
-
-    /**
-     * This method is the main body of the applet. The method is called
-     * by some JavaScript code in an HTML document.
-     */ 
-    public String transform(Object arg1, Object arg2) {
-
-	// Convert the two arguments to strings.
-	final String transletName = (String)arg1;
-	final String documentUrl = (String)arg2;
-
-	// Initialise the output stream
-	final StringWriter sout = new StringWriter();
-	final PrintWriter out = new PrintWriter(sout);
-
-	try {
-	    // Check that the parameters are valid
-	    if (transletName == null || documentUrl == null) {
-		out.println("<h1>Transformation error</h1>");
-		out.println("The parameters <b><tt>class</tt></b> "+
-			    "and <b><tt>source</tt></b> must be specified");
-	    }
-	    else {
-		// Instanciate a message handler for xsl:message/xsl:comment
-		AppletMessageHandler msgHandler = new AppletMessageHandler();
-
-		// Get a refenrence to the translet class
-		final Class tc = Class.forName(transletName);
-
-		// Instanciate and initialise the tranlet object
-		AbstractTranslet translet = (AbstractTranslet)tc.newInstance();
-		((AbstractTranslet)translet).setMessageHandler(msgHandler);
-
-		// Initialise the translet's output handler
-		DefaultSAXOutputHandler saxHandler = 
-		    new DefaultSAXOutputHandler(out);
-		TextOutput textOutput = new TextOutput(saxHandler);
-
-		getDOM(documentUrl);
-
-		final long start = System.currentTimeMillis();
-
-		// Set size of key/id indices
-		translet.setIndexSize(_dom.getSize());
-		// If there are any elements with ID attributes, build an index
-
-		_dtdMonitor.buildIdIndex(_dom, 0, translet);
-		// Pass unparsed entities to translet
-		translet.setUnparsedEntityURIs(_dtdMonitor.
-					       getUnparsedEntityURIs());
-		// Do the actual transformation
-		translet.transform(_dom, textOutput);
-
-		final long done = System.currentTimeMillis() - start;
-		out.println("<!-- transformed by XSLTC in "+done+"msecs -->");
-	    }
-	    // Now close up the sink, and return the HTML output in the
-	    // StringWrite object as a string.
-	    out.close();
-	    System.err.println("Transformation complete!");
-	    System.err.println(sout.toString());
-	    return sout.toString();
-	}
-	catch (RuntimeException e) {
-	    out.close();
-	    return sout.toString();
-	}
-	catch (Exception e) {
-	    out.println("<h1>exception</h1>");
-	    out.println(e.toString());
-	    out.close();
-	    return sout.toString();
-	}
-    }
-}
diff --git a/samples/CompiledApplet/index.html b/samples/CompiledApplet/index.html
deleted file mode 100755
index bde5656..0000000
--- a/samples/CompiledApplet/index.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head><title>XSLT Applet Demonstration</title></head>
-
-<backgroundcolor=#ffffff>
-
-<frameset border="1" cols="25%,*">
-<frame src="menu.html" name="demo_ctrl">
-<frame src="about:blank" name="demo_output">
-</frameset>
-
-</html>
diff --git a/samples/CompiledApplet/menu.html b/samples/CompiledApplet/menu.html
deleted file mode 100755
index 265501a..0000000
--- a/samples/CompiledApplet/menu.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<html>
-<head></head>
-<body bgcolor=#ffffff>
-<hr>
-
-<center><h3>Xalan/XSLTC Applet Demo</h3></center>
-Each of these examples illustrate the use of translets
-within a Java applet:
-<p>
-
-  <script language="JavaScript">
-
-    function run_transform(form) {
-      /* Get the input document and translet class name from input form */
-      var translet = form.translet;
-      var document = form.document;
-
-      /* Get the frame to output to */
-      var output_frame = parent.frames.demo_output.document;
-
-      /* Display the output in this frame */
-      output_frame.clear();
-      output_frame.writeln(document.TransformApplet.transform(translet, document));
-      output_frame.close();
-      return(true);
-    }
-
-  </script>
-
-  <form name="xslt_form" onSubmit="run_transform(this.form)">
-    <p>Select translet:</p>
-    <p><input name="translet" width="64"></p>
-    <p>Select XML source document:</p>
-    <p><input name="document" width="64"></p>
-    <p><input type="button" value="Run" onClick="run_transform(this.form)"></p>
-
-  </form>
-
-  <!--
-    The xsltc.jar file must contain the XSLTC runtime classes and your
-    pre-compiled translets, as described in the README.applet file.
-  -->
-  <applet archive="xsltc.jar"
-          code="TransformApplet"
-          name="TransformApplet"
-          width="10"
-          height="10">
-  </applet>
-
-</body>
diff --git a/samples/CompiledBrazil/README.brazil b/samples/CompiledBrazil/README.brazil
deleted file mode 100644
index 39890e0..0000000
--- a/samples/CompiledBrazil/README.brazil
+++ /dev/null
@@ -1,161 +0,0 @@
-============================================================
-CONTENTS OF THIS DOCUMENT:
-
-  o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
-  o) HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER
-  o) BUILDING YOUR OWN DOM CACHE
-
-------------------------------------------------------------
-HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
-
-This sample code illustrates how Xalan/XSLTC can be used to
-offer XSL transformations as a web service without using a
-full web server. We have chosen to use the Brazil prototype
-for the web interface, available from Sunlabs:
-    http://www.sun.com/research/brazil/
-but we could easily have used some other web interface such
-as Tomcat. The supplied Java code implements a Brazil
-"handler", which very much resembles a servlet.
-
-The CompiledEJB and CompiledServlet sample code
-demonstrate other aproaches to providing XSL transformations
-as a web service.
-
-------------------------------------------------------------
-HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER
-
-The .CompiledBrazil directory contains the example source code:
-
-    TransformHandler.java
-
-This file contains a minimal implementation of an XSL
-transformation handler. The handler performs the same basic
-steps as the class implementing the XSLTC command-line tool:
-
-    // Obtain a reference to the translet class
-    Class cls = Class.forName(transletName);
-    // Instanciate a translet object (inherits AbstractTranslet)
-    AbstractTranslet translet = (AbstractTranslet)cls.newInstance();
-
-    // Prepare the internal DOM tree
-    final DOMImpl dom = new DOMImpl();
-    dom.setDocumentURI(inputURI);
-
-    // Create a parser for the input document
-    // org.apache.xalan.xsltc.runtime.Constants sets NAMESPACE_FEATURE
-    final SAXParserFactory facory = SAXFactory.newInstance();
-    try {
-      factory.setFeature(NAMESPACE_FEATURE,true);
-    }
-    catch (Exception e) {
-      factory.setNamespaceAware(true);
-    }
-    parser = factory.newSAXParser();
-    reader = parser.getXMLReader();
-    reader.setContentHandler(dom.getBuilder());
-
-    // Create a DTDMonitor for handling ID references in the DTD
-    DTDMonitor dtdMonitor = new DTDMonitor();
-    dtdMonitor.handleDTD(reader);
-
-    // Create output handler (you can plug in your own)
-    DefaultSAXOutputHandler saxHandler;
-    saxHandler = new DefaultSAXOutputHandler(out);
-
-    // Parse the document and build the internal DOM
-    reader.parse(inputURI);
-
-    // Pass information on id/key indicies to the translet
-    translet.setIndexSize(dom.getSize());
-    dtdMonitor.buildIdIndex(dom, 0, translet);
-    translet.setUnparsedEntityURIs(dtdMonitor.getUnparsedEntityURIs());
-
-    // Start the transformation
-    translet.transform(dom, new TextOutput(saxHandler));
-
-Alternatively the handler can use a cache for storing
-frequently accessed XML documents. This is not only a matter
-of reading the initial input document from the cache, as
-the translet may load other XML input documents as runtime.
-(If the xsl:document() function was used in the stylesheet.)
-
-    // Get a reference to the translet class
-    Class cls = Class.forName(transletName);
-
-    // Instanciate a translet object (inherits AbstractTranslet)
-    AbstractTranslet translet = (AbstractTranslet)cls.newInstance();
-
-    // The translet needs a reference to the cache in case
-    // in needs to load additional XML documents.
-    translet.setDOMCache(cache);
-
-    // Get the DOM from the DOM cache
-    DOMImpl dom = cache.retrieveDocument(documentURI, 0, translet);
-
-    // Create output handler (you can plug in your own)
-    DefaultSAXOutputHandler saxHandler;
-    saxHandler = new DefaultSAXOutputHandler(out);
-
-    // Start the transformation
-    translet.transform(dom, new TextOutput(saxHandler));
-
-------------------------------------------------------------
-BUILDING YOUR OWN DOM CACHE
-
-The interface for the DOM cache consists of a single method,
-and its definition can be found in:
-
-    org/apache/xalan/xsltc/DOMCache.java
-
-The method contained in the interface is:
-
-    public DOMImpl retrieveDocument(String uri,
-                                    int mask,
-                                    Translet translet);
-
-The responsibilities of this method are:
-
- A) Build new a DOMImpl and DTDMonitor for XML documents
-    that are not already in the cache:
-
-        // Instanciate a DOMImpl object
-        Parser  parser = new Parser();
-        DOMImpl dom = new DOMImpl();
-        dom.setDocumentURI(uri);
-        parser.setDocumentHandler(dom.getBuilder());
-
-        // Use a DTDMonitor to track ID references in DTD
-        DTDMonitor dtdMonitor = new DTDMonitor();
-        parser.setDTDHandler(dtdMonitor);
-
-        // Parse the input document and build DOM
-        parser.parse(uri);
-
-    At this point the DOMImpl and DTDMonitor objects are
-    populated with the necessary data. The two objects
-    are ready to be put in the cache (using the URI as
-    the lookup key).
-
- B) For each time a new document is requested by a translet:
-
-        // Expand translet's index array to fit this DOM
-        translet.setIndexSize(dom.getSize());
-
-        // Build indices for this DOM's DTD's ID references
-        dtd.buildIdIndex(dom, mask, translet);
-
-        // Pass unparsed entity URIs to the translet
-        translet.setUnparsedEntityURIs(dtd.getUnparsedEntityURIs());
-
-Step A) must be done every time a document is read into the
-cache, and step B) every time a document is given to a
-translet.
-
-The XSLTC package contains an example implementation of a
-DOM cache, based on a very simple round-robin caching
-algorithm:
-
-    org/apache/xalan/xsltc/dom/DocumentCache.java
-
-------------------------------------------------------------
-END OF README
diff --git a/samples/CompiledBrazil/TransformHandler.java b/samples/CompiledBrazil/TransformHandler.java
deleted file mode 100644
index c7c7d90..0000000
--- a/samples/CompiledBrazil/TransformHandler.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- *
- */
-
-import java.io.*;
-import java.util.NoSuchElementException;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.*;
-import org.apache.xalan.xsltc.dom.*;
-
-import sunlabs.brazil.server.Handler;
-import sunlabs.brazil.server.Request;
-import sunlabs.brazil.server.Server;
-
-/**
- * This Brazil handler demonstrates how XSL transformations can be made
- * available as a web service without using a full web server. This class
- * implements the Handler interface from the Brazil project, see:
- * http://www.sun.com/research/brazil/
- *
- * Note that the XSLTC transformation engine is invoked through its native
- * interface and not the javax.xml.transform (JAXP) interface. This because
- * XSLTC still does not offer precompiled transformations through JAXP.
- */
-public class TransformHandler implements Handler {
-
-    // A cache for internal DOM structures
-    private static DocumentCache cache = null;
-
-    // These two are used while parsing the parameters in the URL
-    private final String PARAM_TRANSLET = "translet=";
-    private final String PARAM_DOCUMENT = "document=";
-    private final String PARAM_STATS = "stats=";
-
-    // All output goes here:
-    private PrintWriter _out = null;
-
-    /**
-     * Dump an error message to output
-     */
-    public void errorMessage(String message, Exception e) {
-	if (_out == null) return;
-	_out.println("<h1>XSL transformation error</h1>"+message);
-	_out.println("<br>Exception:</br>"+e.toString());
-    }
-
-    public void errorMessage(String message) {
-	if (_out == null) return;
-	_out.println("<h1>XSL transformation error</h1>"+message);
-    }
-
-    /**
-     * This method is run when the Brazil proxy is loaded
-     */
-    public boolean init(Server server, String prefix) {
-	return true;
-    }
-
-    /**
-     * This method is run for every HTTP request sent to the proxy
-     */
-    public boolean respond(Request request) throws IOException {
-
-	// Initialise the output buffer
-	final StringWriter sout = new StringWriter();
-	_out = new PrintWriter(sout);
-
-	// These two hold the parameters from the URL 'translet' and 'document'
-	String transletName = null;
-	String document = null;
-	String stats = null;
-
-	// Get the parameters from the URL
-	final StringTokenizer params = new StringTokenizer(request.query,"&");
-	while (params.hasMoreElements()) {
-	    final String param = params.nextToken();
-	    if (param.startsWith(PARAM_TRANSLET)) {
-		transletName = param.substring(PARAM_TRANSLET.length());
-	    }
-	    else if (param.startsWith(PARAM_DOCUMENT)) {
-		document = param.substring(PARAM_DOCUMENT.length());
-	    }
-	    else if (param.startsWith(PARAM_STATS)) {
-		stats = param.substring(PARAM_STATS.length());
-	    }
-	}
-
-	try {
-	    // Initialize the document cache with 32 DOM slots
-	    if (cache == null) cache = new DocumentCache(32);
-
-	    // Output statistics if user looked up "server:port/?stats=xxx"
-	    if (stats != null) {
-		cache.getStatistics(_out); // get cache statistics (in HTML)
-	    }
-	    // Make sure that both parameters were specified
-	    else if ((transletName == null) || (document == null)) {
-		errorMessage("Parameters <b><tt>translet</tt></b> and/or "+
-			     "<b><tt>document</tt></b> not specified.");
-	    }
-	    else {
-		// Get a reference to the translet class
-	        Class transletClass = Class.forName(transletName);
-		// Instanciate the translet object (inherits AbstractTranslet)
-		AbstractTranslet translet =
-		    (AbstractTranslet)transletClass.newInstance();
-		translet.setDOMCache(cache);
-
-		// Get the DOM from the DOM cache
-		DOMImpl dom = cache.retrieveDocument(document, 0, translet);
-
-		if (dom == null) {
-		    errorMessage("Could not locate: \"<b>"+document+"\"</b>");
-		}
-		else {
-		    // Initialise the translet's output handler
-		    DefaultSAXOutputHandler saxHandler = 
-			new DefaultSAXOutputHandler(_out);
-
-		    // Do the actual transformation
-		    final long start = System.currentTimeMillis();
-		    translet.transform(dom, new TextOutput(saxHandler));
-		    final long done = System.currentTimeMillis() - start;
-		    _out.println("<!-- transformed by XSLTC in "+done+"ms -->");
-		}
-	    }
-	}
-	catch (SAXException e) {
-	    errorMessage("Error parsing document \""+document+"\"");
-	}
-	catch (ClassNotFoundException e) {
-	    errorMessage("Could not locate the translet class: \""+
-			 transletName+"\"<br>Exception:</br>",e);
-	}
-	catch (Exception e) {
-	    errorMessage("Internal error.",e);
-	}
-
-	// Pass the transformation output as the HTTP response
-	request.sendResponse(sout.toString());
-	return true;
-    }
-
-
-}
diff --git a/samples/CompiledEJB/README.ejb b/samples/CompiledEJB/README.ejb
deleted file mode 100644
index 3a6f9f9..0000000
--- a/samples/CompiledEJB/README.ejb
+++ /dev/null
@@ -1,85 +0,0 @@
-============================================================
-CONTENTS OF THIS DOCUMENT:
-
-  o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
-  o) HOW TO INVOKE TRANSLETS FROM AN ENTERPRISE JAVA BEAN
-
-------------------------------------------------------------
-HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
-
-With XSLTC, XSL transformations can be run from within a
-an Enterprise Java Bean (EJB) and exported through a servlet.
-This sample code demonstrates how that can be implemented.
-
-The CompiledServlet and CompiledBrazil sample code
-demonstrates other aproaches to providing XSL transformations
-as a web service.
-
-------------------------------------------------------------
-HOW TO INVOKE TRANSLETS FROM AN ENTERPRISE JAVA BEAN
-
- o) Create an EJB that implements SessionBean and has a
-    single transform() entry point:
-
-    public class TransformBean implements SessionBean {
-        public String transform(String document, String transletName) {
-            // instanciate translet
-            // build internal DOM
-            // run transformation
-            :
-            :
-        }
-        :
-        :
-    }
-
- o) Create this EJB's remote interface (this is the interface
-    your servlet will use to call the bean's entry point):
-
-    public interface TransformRemote extends EJBObject {
-        public String transform(String document, String transletName) 
-        throws RemoteException;
-    }
-
- o) Create the EJB's home interface, which your servlet
-    will use to instanciate the remote interface:
-
-    public interface TransformHome extends EJBHome {
-        TransformRemote create()
-            throws CreateException, RemoteException;
-    }
-
- o) Create a servlet that uses the EJB's home interface to
-    create a remote interface to the EJB, and then calls
-    the EJB's transform() method through that remote
-    interface:
-
-    public class TransformServlet extends HttpServlet {
-
-        public void init(ServletConfig config) {
-            // look up the EJB's home interface using JNDI
-        }
-
-        public void doGet (HttpServletRequest request, 
-                           HttpServletResponse response) 
-            throws ServletException, IOException {
-            // create the remote interface
-            // pass the parameters from teh request to the EJB
-            // display results passed back from EJB
-        }
-    }
-
- o) Set up your J2EE_CLASSPATH to include JAXP and the XSLTC
-    runtime jars.
-
- o) Compile your XSL stylesheets and place them either in
-    your J2EE_CLASSPATH or wrap them in your EJB jar.
-
- o) Deploy your EJB
-
- o) Call the servlet with the necessary parameters (at least
-    an URI to the source XML document and the name of the
-    translet class).
-
-------------------------------------------------------------
-END OF README
diff --git a/samples/CompiledEJB/TransformBean.java b/samples/CompiledEJB/TransformBean.java
deleted file mode 100644
index 1914a89..0000000
--- a/samples/CompiledEJB/TransformBean.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- *
- */
-
-import java.io.*;
-import java.text.*;
-import java.util.*;
-
-import java.rmi.RemoteException;
-import javax.ejb.SessionBean;
-import javax.ejb.SessionContext;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.*;
-import org.apache.xalan.xsltc.dom.*;
-
-public class TransformBean implements SessionBean {
-
-    private SessionContext _context = null;
-    
-    private final static String nullErrorMsg =
-	"<h1>XSL transformation error</h1>"+
-	"<p>'null' parameters sent to the XSL transformation bean's "+
-	"<tt>transform(String document, String translet)</tt> method.</p>";
-
-    private static final String NAMESPACE_FEATURE =
-	"http://xml.org/sax/features/namespaces";
-
-    /**
-     * Read the input document and build the internal "DOM" tree.
-     */
-    private DOMImpl getDOM(String url, AbstractTranslet translet)
-	throws Exception {
-
-	// Create a SAX parser and get the XMLReader object it uses
-	final SAXParserFactory factory = SAXParserFactory.newInstance();
-	try {
-	    factory.setFeature(NAMESPACE_FEATURE,true);
-	}
-	catch (Exception e) {
-	    factory.setNamespaceAware(true);
-	}
-	final SAXParser parser = factory.newSAXParser();
-	final XMLReader reader = parser.getXMLReader();
-
-	// Set the DOM's builder as the XMLReader's SAX2 content handler
-	DOMImpl dom = new DOMImpl();
-	reader.setContentHandler(dom.getBuilder());
-
-	// Create a DTD monitor and pass it to the XMLReader object
-	final DTDMonitor dtdMonitor = new DTDMonitor();
-	dtdMonitor.handleDTD(reader);
-	translet.setDTDMonitor(dtdMonitor);
-
-	// Parse the input document
-	reader.parse(url);
-
-	return dom;
-    }
-
-    /**
-     * Generates HTML from a basic error message and an exception
-     */
-    private void errorMsg(PrintWriter out, Exception e, String msg) {
-	out.println("<h1>Error</h1>");
-	out.println("<p>"+msg+"</p><br>");
-	out.println(e.toString());
-    }
-
-    /**
-     * Main bean entry point
-     */
-    public String transform(String document, String transletName) {
-
-	// Initialise the output stream
-	final StringWriter sout = new StringWriter();
-	final PrintWriter out = new PrintWriter(sout);
-
-	try {
-	    if ((document == null) || (transletName == null)) {
-		out.println(nullErrorMsg);
-	    }
-	    else {
-		// Instanciate a translet object (inherits AbstractTranslet)
-	        Class tc = Class.forName(transletName);
-		AbstractTranslet translet = (AbstractTranslet)tc.newInstance();
-
-		// Read input document from the DOM cache
-		DOMImpl dom = getDOM(document, translet);
-
-		// Initialize the (default) SAX output handler
-		DefaultSAXOutputHandler saxHandler = 
-		    new DefaultSAXOutputHandler(out);
-
-		// Start the transformation
-		final long start = System.currentTimeMillis();
-		translet.transform(dom, new TextOutput(saxHandler));
-		final long done = System.currentTimeMillis() - start;
-		out.println("<!-- transformed by XSLTC in "+done+"msecs -->");
-	    }
-	}
-
-	catch (IOException e) {
-	    errorMsg(out, e, "Could not locate source document: "+document);
-	}
-	catch (ClassNotFoundException e) {
-	    errorMsg(out, e, "Could not locate the translet class: "+
-		     transletName);
-	}
-	catch (SAXException e) {
-	    errorMsg(out, e, "Error parsing document "+document);
-	}
-	catch (Exception e) {
-	    errorMsg(out, e, "Impossible state reached.");
-	}
-
-	// Now close up the sink, and return the HTML output in the
-	// StringWrite object as a string.
-	out.close();
-	return sout.toString();
-    }
-
-    /**
-     *
-     */
-    public void setSessionContext(SessionContext context) {
-	_context = context;
-    }
-
-    // General EJB entry points
-    public void ejbCreate() { }
-    public void ejbRemove() { }
-    public void ejbActivate() { }
-    public void ejbPassivate() { }
-    public void ejbLoad() { }
-    public void ejbStore() { }
-}
diff --git a/samples/CompiledEJB/TransformHome.java b/samples/CompiledEJB/TransformHome.java
deleted file mode 100644
index ac5f9a7..0000000
--- a/samples/CompiledEJB/TransformHome.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- *
- */
-
-import java.rmi.RemoteException;
-import javax.ejb.CreateException;
-import javax.ejb.EJBHome;
-
-/**
- * XSL transformation bean home interface
- */
-public interface TransformHome extends EJBHome {
-    TransformRemote create() throws CreateException, RemoteException;
-}
diff --git a/samples/CompiledEJB/TransformRemote.java b/samples/CompiledEJB/TransformRemote.java
deleted file mode 100644
index 8cbaeed..0000000
--- a/samples/CompiledEJB/TransformRemote.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- *
- */
-
-import javax.ejb.EJBObject;
-import java.rmi.RemoteException;
-
-/**
- * XSL transformation bean remote interface
- */
-public interface TransformRemote extends EJBObject {
-    public String transform(String document, String transletName) 
-	throws RemoteException;
-}
diff --git a/samples/CompiledEJB/TransformServlet.java b/samples/CompiledEJB/TransformServlet.java
deleted file mode 100644
index 4bdab4a..0000000
--- a/samples/CompiledEJB/TransformServlet.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- *
- */
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.*;
-import javax.naming.*;
-import javax.rmi.PortableRemoteObject;
-
-public class TransformServlet extends HttpServlet {
-
-    // Error message used when the XSL transformation bean cannot be created
-    private final static String createErrorMsg =
-	"<h1>XSL transformation bean error</h1>"+
-	"<p>An XSL transformation bean could not be created.</p>";
-
-    // Transformer - "more than meets the eye".
-    private TransformHome transformer;
-
-    /**
-     * Servlet initializer - look up the bean's home interface
-     */
-    public void init(ServletConfig config) 
-	throws ServletException{
-	try{
-	    InitialContext context = new InitialContext();
-	    Object transformRef = context.lookup("transform");
-	    transformer =
-		(TransformHome)PortableRemoteObject.narrow(transformRef,
-							   TransformHome.class);
-	} catch (Exception NamingException) {
-	    NamingException.printStackTrace();
-	}
-    }
-
-    /**
-     * Handles "GET" HTTP requests - ie. runs the actual transformation
-     */
-    public void doGet (HttpServletRequest request, 
-		       HttpServletResponse response) 
-	throws ServletException, IOException {
-
-	String document = request.getParameter("document");
-	String translet = request.getParameter("translet");
-
-	response.setContentType("text/html");
-
-	PrintWriter out = response.getWriter();
-	try{
-	    // Get the insult from the bean
-	    TransformRemote xslt = transformer.create();
-	    String result = xslt.transform(document, translet);
-	    out.println(result);
-	} catch(Exception CreateException){
-	    out.println(createErrorMsg);
-	}
-	out.close();
-    }
-
-    public void destroy() {
-	System.out.println("Destroy");
-    }
-}
diff --git a/samples/CompiledEJB/bottom_frame.html b/samples/CompiledEJB/bottom_frame.html
deleted file mode 100644
index edc1918..0000000
--- a/samples/CompiledEJB/bottom_frame.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-  <head></head>
-  <body>
-    <backgroundcolor=#ffffff>
-  </body>
-</html>
-
diff --git a/samples/CompiledEJB/index.html b/samples/CompiledEJB/index.html
deleted file mode 100644
index 641c2b4..0000000
--- a/samples/CompiledEJB/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
-  <head><title>XML Technology Center</title></head>
-    <backgroundcolor=#ffffff>
-
-    <frameset border="0" rows="30%,70%">
-      <frame src="top_frame.html" NAME="top" scrolling="off">
-      <frame src="bottom_frame.html" NAME="bottom" scrolling="on">
-    </frameset>
-
-    <noframes>
-    </noframes>
-
-</html>
-
diff --git a/samples/CompiledEJB/top_frame.html b/samples/CompiledEJB/top_frame.html
deleted file mode 100644
index c529088..0000000
--- a/samples/CompiledEJB/top_frame.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<html>
-
-  <head>
-    <base target=xtc_menu>
-  </head>
-
-  <body bgcolor=#ffffff>
-
-    <center><h1>Server-side XSL transformations</h1><p></center>
-
-    <script language="JavaScript">
-
-      function getURI() {
-        var root = "http://gobsheen.ireland/morten/Sun/XTC/demo/plays/";
-	var menu = document.XMLinput.elements[0];
-        var play = menu.options[menu.selectedIndex].value;
-        return(root+play);
-      }
-
-      function getTranslet() {
-	var menu = document.XMLinput.elements[1];
-        var translet = menu.options[menu.selectedIndex].value;
-	return(translet);
-      }
-
-      function setHTMLlocation(translet) {
-        var uri = getURI();
-        var translet = getTranslet();
-        var source = "http://gobsheen:8000/Transform/Transform?"+
-                     "document="+uri+"&translet="+translet;
-        open(source,"bottom");
-      }
-
-      function setXMLlocation() {
-        var target = parent.frames.demo_bottom;
-        var uri = getURI();
-        open(uri,"bottom");
-      }
-
-    </script>
-
-    <form name="XMLinput">
-
-    <table>
-    <tr>
-      <td>
-        <b>Source document:</b>
-      </td>
-      <td>
-        <select name="dropdown">
-          <option value="AsYouLikeIt.xml">As You Like It
-          <option value="Cymbeline.xml">Cymbeline
-          <option value="Hamlet.xml">The Tragedy of Hamlet
-          <option value="HenryV.xml">The Life of Henry V
-          <option value="HenryVIII.xml">The Famous History of the Life of Henry VIII
-          <option value="KingJohn.xml">The Life and Death of King John
-          <option value="KingLear.xml">The Tragedy of King Lear
-          <option value="KingRichardII.xml">The Tragedy of King Richard II
-          <option value="MeasureForMeasure.xml">Measure for Measure
-          <option value="MerchantOfVenice.xml">The Merchant of Venice
-          <option value="MerryWivesOfWindsor.xml">The Merry Wives of Windsor
-          <option value="MidsummerNightsDream.xml">A Midsummer Night's Dream
-          <option value="MuchAdoAboutNothing.xml">Much Ado about Nothing
-          <option value="PericlesPrinceOfTyre.xml">Pericles, Prince of Tyre
-          <option value="RomeoAndJuliet.xml">The Tragedy of Romeo and Juliet
-          <option value="TamingOfTheShrew.xml">The Taming of the Shrew
-          <option value="TheTempest.xml">The Tempest
-          <option value="TimonOfAthens.xml">The Life of Timon of Athens
-          <option value="TragedyOfCoriolanus.xml">The Tragedy of Coriolanus
-          <option value="TragedyOfJuliusCaesar.xml">The Tragedy of Julius Caesar
-          <option value="TragedyOfOthello.xml">The Tragedy of Othello, the Moor of Venice
-          <option value="TroilusAndCresida.xml">The History of Troilus and Cressida
-          <option value="TwelfthNight.xml">Twelfth Night, or What You Will
-          <option value="TwoGentlementOfVerona.xml">The Two Gentlemen of Verona
-          <option value="WintersTale.xml">The Winter's Tale
-        </select>
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <b>Transformation:</b>
-      </td>
-      <td>
-        <select name="dropdown">
-          <option value="PlayToHTML">Full
-          <option value="PlayToSpeakers">Speakers
-          <option value="PlayToIndex">Index
-        </select>
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <b>Method:</b>
-      </td>
-      <td>
-        <input type="button" value="Transform" onClick="setHTMLlocation()">
-        <input type="button" value="XML source" onClick="setXMLlocation()">
-      </td>
-    </tr>
-  </table>
-  </form>
-
-  </body>
-
-</html>
diff --git a/samples/CompiledJAXP/Compile.java b/samples/CompiledJAXP/Compile.java
deleted file mode 100644
index c42dbaa..0000000
--- a/samples/CompiledJAXP/Compile.java
+++ /dev/null
@@ -1,77 +0,0 @@
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.ObjectOutputStream;
-
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.xalan.xsltc.trax.TransformerFactoryImpl;
-
-public class Compile {
-
-    public static void main(String[] args){
-        Compile app = new Compile();
-        app.run(args[0]);
-    }
-
-    /**
-     * Compiles an XSL stylesheet into a translet, wraps the translet
-     * inside a Templates object and dumps it to a file.
-     */
-    public void run(String xsl) {
-        try {
-	    // Get an input stream for the XSL stylesheet
-	    StreamSource stylesheet = new StreamSource(xsl);
-
-	    // The TransformerFactory will compile the stylesheet and
-	    // put the translet classes inside the Templates object
-	    TransformerFactory factory = TransformerFactory.newInstance();
-	    Templates templates = factory.newTemplates(stylesheet);
-
-	    // Send the Templates object to a '.translet' file
-	    dumpTemplate(getBaseName(xsl)+".translet", templates);
-        }
-	catch (Exception e) {
-            System.err.println("Exception: " + e); 
-	    e.printStackTrace();
-        }
-        System.exit(0);
-    }
-
-    /**
-     * Returns the base-name of a file/url
-     */
-    private String getBaseName(String filename) {
-	int start = filename.lastIndexOf(File.separatorChar);
-	int stop  = filename.lastIndexOf('.');
-	if (stop <= start) stop = filename.length() - 1;
-	return filename.substring(start+1, stop);
-    }
-
-    /**
-     * Writes a Templates object to a file
-     */
-    private void dumpTemplate(String file, Templates templates) {
-	try {
-	    FileOutputStream ostream = new FileOutputStream(file);
-	    ObjectOutputStream p = new ObjectOutputStream(ostream);
-	    p.writeObject(templates);
-	    p.flush();
-	    ostream.close();
-	}
-	catch (Exception e) {
-	    System.err.println(e);
-	    e.printStackTrace();
-	    System.err.println("Could not write file "+file);
-	}
-    }
-
-    private void usage() {
-        System.err.println("Usage: compile <xsl_file>");
-        System.exit(1);
-    }
-
-}
diff --git a/samples/CompiledJAXP/Transform.java b/samples/CompiledJAXP/Transform.java
deleted file mode 100644
index 102d745..0000000
--- a/samples/CompiledJAXP/Transform.java
+++ /dev/null
@@ -1,77 +0,0 @@
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.ObjectInputStream;
-
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.xalan.xsltc.trax.TransformerFactoryImpl;
-
-public class Transform {
-
-    public static void main(String[] args){
-        Transform app = new Transform();
-        app.run(args);
-    }
-
-    /**
-     * Reads a Templates object from a file, the Templates object creates
-     * a translet and wraps it in a Transformer. The translet performs the
-     * transformation on behalf of the Transformer.transform() method.
-     */
-    public void run(String[] args){
-        String xml = args[0];
-        String translet = args[1];
-
-        try {
-	    StreamSource document = new StreamSource(xml);
-	    StreamResult result = new StreamResult(System.out);
-	    Templates templates = readTemplates(translet);
-	    Transformer transformer = templates.newTransformer();
-            transformer.transform(document, result);
-        }
-	catch (Exception e) {
-            System.err.println("Exception: " + e); 
-	    e.printStackTrace();
-        }
-        System.exit(0);
-    }
-
-    /**
-     * Reads a Templates object from a file
-     */
-    private Templates readTemplates(String file) {
-	try {
-	    FileInputStream ostream = new FileInputStream(file);
-	    ObjectInputStream p = new ObjectInputStream(ostream);
-	    Templates templates = (Templates)p.readObject();
-	    ostream.close();
-	    return(templates);
-	}
-	catch (Exception e) {
-	    System.err.println(e);
-	    e.printStackTrace();
-	    System.err.println("Could not write file "+file);
-	    return null;
-	}
-    }
-
-    /**
-     * Returns the base-name of a file/url
-     */
-    private String getBaseName(String filename) {
-	int start = filename.lastIndexOf(File.separatorChar);
-	int stop  = filename.lastIndexOf('.');
-	if (stop <= start) stop = filename.length() - 1;
-	return filename.substring(start+1, stop);
-    }
-
-    public void usage() {
-        System.err.println("Usage: run <xml_file> <xsl_file>");
-        System.exit(1);
-    }
-
-}
diff --git a/samples/CompiledServlet/CompileServlet.java b/samples/CompiledServlet/CompileServlet.java
deleted file mode 100644
index 644b4d7..0000000
--- a/samples/CompiledServlet/CompileServlet.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- * @author Jacek Ambroziak
- *
- */
-
-package org.apache.xalan.xsltc.demo.servlet;
-
-import java.io.*;
-import java.text.*;
-import java.util.*;
-import java.net.URL;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-import org.apache.xalan.xsltc.compiler.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.util.getopt.*;
-
-public class CompileServlet extends HttpServlet {
-
-    /**
-     * Main servlet entry point. The servlet reads a stylesheet from the
-     * URI specified by the "sheet" parameter. The compiled Java class
-     * ends up in the CWD of the web server (a better solution would be
-     * to have an environment variable point to a translet directory).
-     */
-    public void doGet(HttpServletRequest request,
-		      HttpServletResponse response)
-	throws IOException, ServletException {
-
-	response.setContentType("text/html");
-	PrintWriter out = response.getWriter();
-		
-	String stylesheetName = request.getParameter("sheet");
-	
-	out.println("<html><head>");
-	out.println("<title>Servlet Stylesheet Compilation</title>");
-	out.println("</head><body>");
-
-	if (stylesheetName == null) {
-	    out.println("<h1>Compilation error</h1>");
-	    out.println("The parameter <b><tt>sheet</tt></b> "+
-			"must be specified");
-	}
-	else {
-	    XSLTC xsltc = new XSLTC();
-
-	    xsltc.init();
-	    xsltc.compile(new URL(stylesheetName));
-	    out.println("<h1>Compilation successful</h1>");
-	    out.println("The stylesheet was compiled into the translet "+
-			"class "+xsltc.getClassName() + " and is now "+
-			"available for transformations on this server.");
-	}
-	out.println("</body></html>");
-    }
-}
diff --git a/samples/CompiledServlet/README.servlet b/samples/CompiledServlet/README.servlet
deleted file mode 100644
index bd704cf..0000000
--- a/samples/CompiledServlet/README.servlet
+++ /dev/null
@@ -1,170 +0,0 @@
-=======================================================================
-CONTENTS OF THIS DOCUMENT:
-
-  o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
-  o) HOW TO INVOKE TRANSLETS FROM A SERVLET
-  o) BUILDING YOUR OWN DOM CACHE
-
------------------------------------------------------------------------
-HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
-
-With XSLTC, XSL transformations can be run from within a servlet. 
-This sample code demonstrates how that can be implemented.
-
-The CompiledEJB and CompiledBrazil sample code demonstrate other 
-aproaches to providing XSL transformations as a web service.
-
------------------------------------------------------------------------
-HOW TO INVOKE TRANSLETS FROM A SERVLET
-
-The CompiledServlet directory contains the example source code:
-
-    TransformServlet.java
-
-This file contains a minimal implementation of an XSL transformation 
-servlet. It utilizes a cache to store the DOM trees for frequently 
-accessed XML documents. These are not W3C DOM objects; They are 
-specialized DOMs, native to XSLTC and optimzed for use with compiled 
-translets. In addition to the initial input XML documents, the cache 
-may contain DOMs for other XML input documents the translet requires 
-at runtime, when the xsl:document() function is used in the stylesheet.
-
-Here's the essential code in the servlet for doing the transformation:
-
-    // Get a reference to the translet class
-    Class cls = Class.forName(transletName);
-
-    // Instanciate a translet object (inherits AbstractTranslet)
-    AbstractTranslet translet = (AbstractTranslet)cls.newInstance();
-
-    // The translet needs a reference to the cache in case
-    // in needs to load additional XML documents.
-    translet.setDOMCache(cache);
-
-    // Get the DOM from the DOM cache if current, otherwise
-    // build and cache the DOM first
-    DOMImpl dom = cache.retrieveDocument(documentURI, 0, translet);
-
-    // Create output handler (you can plug in your own)
-    DefaultSAXOutputHandler saxHandler;
-    saxHandler = new DefaultSAXOutputHandler(out);
-
-    // Start the transformation
-    translet.transform(dom, new TextOutput(saxHandler));
-
------------------------------------------------------------------------
-BUILDING YOUR OWN DOM CACHE
-
-The interface for the DOM cache consists of a single method,
-and its definition can be found in:
-
-    org/apache/xalan/xsltc/DOMCache.java
-
-The method contained in the interface is:
-
-    public DOMImpl retrieveDocument(String uri,
-                                    int mask,
-                                    Translet translet);
-
-The responsibilities of this method are:
-
- A) Build new a DOMImpl and DTDMonitor for XML documents
-    that are not already in the cache:
-
-        // Instanciate a DOMImpl object
-        Parser  parser = new Parser();
-        DOMImpl dom = new DOMImpl();
-        // Set URI for imports, includes, and document() functions
-        dom.setDocumentURI(uri);
-        parser = factory.newSAXParser();
-        reader = parser.getXMLReader();
-        reader.setContentHandler(dom.getBuilder());
-
-        // Use a DTDMonitor to track ID references in DTD
-        DTDMonitor dtdMonitor = new DTDMonitor();
-        dtdMonitor.handleDTD(reader);
-
-        // Parse the input document and build DOM
-        reader.parse(uri);
-
-    At this point the DOMImpl and DTDMonitor objects are
-    populated with the necessary data. The two objects
-    are ready to be put in the cache (using the URI as
-    the lookup key).
-
- B) For each time a new document is requested by a translet:
-
-        // Expand translet's index array to fit this DOM
-        translet.setIndexSize(dom.getSize());
-
-        // Build indices for this DOM's DTD's ID references
-        dtdMonitor.buildIdIndex(dom, mask, translet);
-
-        // Pass unparsed entity URIs to the translet
-        translet.setUnparsedEntityURIs(dtd.getUnparsedEntityURIs());
-
-Step A) must be done every time a document is read into the
-cache, and step B) every time a document is given to a
-translet.
-
-The XSLTC package contains an example implementation of a
-DOM cache, based on a very simple round-robin caching
-algorithm:
-
-    org/apache/xalan/xsltc/dom/DocumentCache.java
-
------------------------------------------------------------------------
-DOING TRANSFORMATIONS WITHOUT A DOM CACHE
-
-Alternatively, you can program a servlet to perform the same basic
-steps as the XSLTC command-line tool
-
-    org.apache.xalan.xsltc.cmdline.Transform
-
-as follows:
-
-
-    // Obtain a reference to the translet class
-    Class cls = Class.forName(transletName);
-    // Instanciate a translet object (inherits AbstractTranslet)
-    AbstractTranslet translet = (AbstractTranslet)cls.newInstance();
-
-    // Prepare the internal DOM tree
-    final DOMImpl dom = new DOMImpl();
-    dom.setDocumentURI(inputURI);
-
-    // Create a parser for the input document
-    // org.apache.xalan.xsltc.runtime.Constants sets NAMESPACE_FEATURE
-    final SAXParserFactory facory = SAXFactory.newInstance();
-    try {
-      factory.setFeature(NAMESPACE_FEATURE,true);
-    }
-    catch (Exception e) {
-      factory.setNamespaceAware(true);
-    }
-    parser = factory.newSAXParser();
-    reader = parser.getXMLReader();
-    reader.setContentHandler(dom.getBuilder());
-
-    // Create a DTDMonitor for handling ID references in the DTD
-    DTDMonitor dtdMonitor = new DTDMonitor();
-    dtdMonitor.handleDTD(reader);
-
-    // Create output handler (you can plug in your own)
-    DefaultSAXOutputHandler saxHandler;
-    saxHandler = new DefaultSAXOutputHandler(out);
-
-    // Parse the document and build the internal DOM
-    reader.parse(inputURI);
-
-    // Pass information on id/key indicies to the translet
-    translet.setIndexSize(dom.getSize());
-    dtdMonitor.buildIdIndex(dom, 0, translet);
-    translet.setUnparsedEntityURIs(dtdMonitor.getUnparsedEntityURIs());
-
-    // Start the transformation
-    translet.transform(dom, new TextOutput(saxHandler));
-
-
-------------------------------------------------------------
-END OF README
diff --git a/samples/CompiledServlet/TransformServlet.java b/samples/CompiledServlet/TransformServlet.java
deleted file mode 100644
index 8bb4fdf..0000000
--- a/samples/CompiledServlet/TransformServlet.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
- * @author Morten Jorgensen
- * @author Jacek Ambroziak
- *
- */
-
-import java.io.*;
-import java.text.*;
-import java.util.*;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.*;
-import org.apache.xalan.xsltc.dom.*;
-
-/**
- * This servlet demonstrates how XSL transformations can be made available as
- * a web service. See the CompileServlet for an example on how stylesheets
- * can be pre-compiled before this servlet is invoked.
- *
- * Note that the XSLTC transformation engine is invoked through its native
- * interface and not the javax.xml.transform (JAXP) interface. This because
- * XSLTC still does not offer precompiled transformations through JAXP.
- */
-public final class TransformServlet extends HttpServlet {
-
-    /*
-     * This is a document cache with 32 document slots. This servlet returns
-     * cache statistics if the 'stats' parameter is passed with the HTTP
-     * request in doGet().
-     */
-    private static DocumentCache cache = null;
-
-    /**
-     * Main servlet entry point
-     */
-    public void doGet(HttpServletRequest request,
-		      HttpServletResponse response)
-	throws IOException, ServletException {
-
-	// Initialise the output writer
-	response.setContentType("text/html");
-	PrintWriter out = response.getWriter();
-
-	// Get the two paramters "class" and "source".
-	String className   = request.getParameter("class");
-	String documentURI = request.getParameter("source");
-
-	try {
-	    // Initialize document cache with 32 DOM slots
-	    if (cache == null) cache = new DocumentCache(32);
-
-	    if (request.getParameter("stats") != null) {
-		cache.getStatistics(out);
-	    }
-	    else if ((className == null) || (documentURI == null)) {
-	        out.println("<h1>XSL transformation error</h1>");
-		out.println("The parameters <b><tt>class</tt></b> and " +
-			    "<b><tt>source</tt></b> must be specified");
-	    }
-	    else {
-		// Get a reference to the translet class (not object yet)
-	        Class tc = Class.forName(className);
-		// Instanciate a translet object (inherits AbstractTranslet)
-		AbstractTranslet translet = (AbstractTranslet)tc.newInstance();
-
-		// Set the document cache for the translet. This is needed in
-		// case the translet uses the document() function.
-		translet.setDOMCache(cache);
-
-		// Read input document from the DOM cache
-		DOMImpl dom = cache.retrieveDocument(documentURI, 0, translet);
-
-		// Initialize the output handler
-		DefaultSAXOutputHandler saxHandler = 
-		    new DefaultSAXOutputHandler(out);
-
-		// Start the transformation
-		final long start = System.currentTimeMillis();
-		translet.transform(dom, new TextOutput(saxHandler));
-		final long done = System.currentTimeMillis() - start;
-		out.println("<!-- transformed by XSLTC in "+done+"msecs -->");
-	    }
-	}
-	catch (IOException e) {
-	    out.println("<h1>Error</h1>");
-	    out.println("Could not locate source document: " + documentURI);
-	    out.println(e.toString());
-	}
-	catch (ClassNotFoundException e) {
-	  out.println("<h1>Error</h1>");
-	  out.println("Could not locate the translet class: " + className);
-	  out.println(e.toString());
-	}
-	catch (SAXException e) {
-	    out.println("<h1>Error</h1>");
-	    out.println("Error parsing document " + documentURI);
-	}
-	catch (Exception e) {
-	    out.println("<h1>Error</h1>");
-	    out.println(e.toString());
-	}
-    }
-}
diff --git a/samples/DOM2DOM/DOM2DOM.java b/samples/DOM2DOM/DOM2DOM.java
deleted file mode 100644
index 98c3269..0000000
--- a/samples/DOM2DOM/DOM2DOM.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.dom.DOMResult;
-
-// Imported java.io classes
-import java.io.IOException;
-import java.io.FileNotFoundException;
-
-// Imported SAX classes
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-// Imported DOM classes
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-// Imported Serializer classes
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-
-import org.apache.xalan.templates.OutputProperties;
-
-// Imported JAVA API for XML Parsing classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException; 
-
-  /**
-   * Show how to transform a DOM tree into another DOM tree.  
-   * This uses the javax.xml.parsers to parse both an XSL file 
-   * and the XML file into a DOM, and create an output DOM.
-   */
-public class DOM2DOM
-{
-	public static void main(String[] args)
-    throws TransformerException, TransformerConfigurationException, FileNotFoundException,
-           ParserConfigurationException, SAXException, IOException
-  {    
-	  TransformerFactory tFactory = TransformerFactory.newInstance();
-
-    if(tFactory.getFeature(DOMSource.FEATURE) && tFactory.getFeature(DOMResult.FEATURE))
-    {
-      //Instantiate a DocumentBuilderFactory.
-      DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
-
-      // And setNamespaceAware, which is required when parsing xsl files
-      dFactory.setNamespaceAware(true);
-      
-      //Use the DocumentBuilderFactory to create a DocumentBuilder.
-      DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
-      
-      //Use the DocumentBuilder to parse the XSL stylesheet.
-      Document xslDoc = dBuilder.parse("birds.xsl");
-
-      // Use the DOM Document to define a DOMSource object.
-      DOMSource xslDomSource = new DOMSource(xslDoc);
-
-      // Set the systemId: note this is actually a URL, not a local filename
-      xslDomSource.setSystemId("birds.xsl");
-
-      // Process the stylesheet DOMSource and generate a Transformer.
-      Transformer transformer = tFactory.newTransformer(xslDomSource);
-
-      //Use the DocumentBuilder to parse the XML input.
-      Document xmlDoc = dBuilder.parse("birds.xml");
-      
-      // Use the DOM Document to define a DOMSource object.
-      DOMSource xmlDomSource = new DOMSource(xmlDoc);
-      
-      // Set the base URI for the DOMSource so any relative URIs it contains can
-      // be resolved.
-      xmlDomSource.setSystemId("birds.xml");
-      
-      // Create an empty DOMResult for the Result.
-      DOMResult domResult = new DOMResult();
-  
-  	  // Perform the transformation, placing the output in the DOMResult.
-      transformer.transform(xmlDomSource, domResult);
-	  
-	    //Instantiate an Xalan XML serializer and use it to serialize the output DOM to System.out
-	    // using a default output format.
-      Serializer serializer = SerializerFactory.getSerializer
-                                   (OutputProperties.getDefaultMethodProperties("xml"));
-      serializer.setOutputStream(System.out);
-      serializer.asDOMSerializer().serialize(domResult.getNode());
-	}
-    else
-    {
-      throw new org.xml.sax.SAXNotSupportedException("DOM node processing not supported!");
-    }
-  }
-}
diff --git a/samples/DOM2DOM/birds.xml b/samples/DOM2DOM/birds.xml
deleted file mode 100644
index 7027642..0000000
--- a/samples/DOM2DOM/birds.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Class>
-<Order Name="TINAMIFORMES">
-        <Family Name="TINAMIDAE">
-            <Species Scientific_Name="Tinamus major">  Great Tinamou.</Species>
-            <Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus soui">Little Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus cinnamomeus">Thicket Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus boucardi">Slaty-breasted Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus kerriae">Choco Tinamou.</Species>
-        </Family>
-    </Order>
-<Order Name="GAVIIFORMES">
-        <Family Name="GAVIIDAE">
-            <Species Scientific_Name="Gavia stellata">Red-throated Loon.</Species>
-            <Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
-            <Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
-            <Species Scientific_Name="Gavia immer">Common Loon.</Species>
-            <Species Scientific_Name="Gavia adamsii">Yellow-billed Loon.</Species>
-        </Family>
-    </Order>
-
-
-<Order Name="PODICIPEDIFORMES">
-        <Family Name="PODICIPEDIDAE">
-            <Species Scientific_Name="Tachybaptus dominicus">Least Grebe.</Species>
-            <Species Scientific_Name="Podilymbus podiceps">Pied-billed Grebe.</Species>
-            <Species Scientific_Name="">Atitlan Grebe.</Species>
-            <Species Scientific_Name="">Horned Grebe.</Species>
-            <Species Scientific_Name="">Red-necked Grebe.</Species>
-            <Species Scientific_Name="">Eared Grebe.</Species>
-            <Species Scientific_Name="">Western Grebe.</Species>
-            <Species Scientific_Name="">Clark's Grebe.</Species>
-            <Species Scientific_Name=""/>
-        </Family>
-    </Order>
-
-
-<Order Name="PROCELLARIIFORMES">
-        <Family Name="DIOMEDEIDAE">
-            <Species Scientific_Name="Thalassarche chlororhynchos">Yellow-nosed Albatross. (A)</Species>
-            <Species Scientific_Name="Thalassarche cauta">Shy Albatross. (A)</Species>
-            <Species Scientific_Name="Thalassarche melanophris">Black-browed Albatross. (A)</Species>
-            <Species Scientific_Name="Phoebetria palpebrata">Light-mantled Albatross. (A)</Species>
-            <Species Scientific_Name="Diomedea exulans">Wandering Albatross. (A)</Species>
-            <Species Scientific_Name="Phoebastria immutabilis">Laysan Albatross.</Species>
-            <Species Scientific_Name="Phoebastria nigripes">Black-footed Albatross.</Species>
-            <Species Scientific_Name="Phoebastria albatrus">Short-tailed Albatross. (N)</Species>
-        </Family>
-        <Family Name="PROCELLARIIDAE">
-            <Species Scientific_Name="Fulmarus glacialis">Northern Fulmar.</Species>
-            <Species Scientific_Name="Pterodroma neglecta">Kermadec Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma arminjoniana">Herald Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma ultima">Murphy's Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma inexpectata">Mottled Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma cahow">Bermuda Petrel.</Species>
-            <Species Scientific_Name="Pterodroma hasitata">Black-capped Petrel.</Species>
-            <Species Scientific_Name="Pterodroma externa">Juan Fernandez Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma phaeopygia">Dark-rumped Petrel.</Species>
-            <Species Scientific_Name="Pterodroma cervicalis">White-necked Petrel. (H)</Species>
-            <Species Scientific_Name="Pterodroma hypoleuca">Bonin Petrel. (H)</Species>
-            <Species Scientific_Name="Pterodroma nigripennis">Black-winged Petrel. (H, A)</Species>
-            <Species Scientific_Name="Pterodroma cookii">Cook's Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma longirostris">Stejneger's Petrel. (A)</Species>
-            <Species Scientific_Name="Bulweria bulwerii">Bulwer's Petrel. (H)</Species>
-            <Species Scientific_Name="Bulweria fallax">Jouanin's Petrel. (H, A)</Species>
-            <Species Scientific_Name="Procellaria parkinsoni">Parkinson's Petrel. (N)</Species>
-            <Species Scientific_Name="Calonectris leucomelas">Streaked Shearwater. (A)</Species>
-            <Species Scientific_Name="Calonectris diomedea">Cory's Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus creatopus">Pink-footed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus carneipes">Flesh-footed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus gravis">Greater Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus pacificus">Wedge-tailed Shearwater.</Species>
-            <Species Scientific_Name="Puffinus bulleri">Buller's Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus griseus">Sooty Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus tenuirostris">Short-tailed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus nativitatis">Christmas Shearwater. (H)</Species>
-            <Species Scientific_Name="Puffinus puffinus">Manx Shearwater.</Species>
-            <Species Scientific_Name="Puffinus auricularis">Townsend's Shearwater.</Species>
-            <Species Scientific_Name="Puffinus opisthomelas">Black-vented Shearwater.</Species>
-            <Species Scientific_Name="Puffinus lherminieri">Audubon's Shearwater.</Species>
-            <Species Scientific_Name="Puffinus assimilis">Little Shearwater. (A)</Species>
-        </Family>
-        <Family Name="HYDROBATIDAE">
-            <Species Scientific_Name="Oceanites oceanicus">Wilson's Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Pelagodroma marina">White-faced Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Hydrobates pelagicus">European Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Oceanodroma furcata">Fork-tailed Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma leucorhoa">Leach's Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma homochroa">Ashy Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma castro">Band-rumped Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Oceanodroma tethys">Wedge-rumped Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Oceanodroma melania">Black Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma macrodactyla">Guadalupe Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma markhami">Markham's Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Oceanodroma tristrami">Tristram's Storm-Petrel. (H)</Species>
-            <Species Scientific_Name="Oceanodroma microsoma">Least Storm-Petrel.</Species>
-        </Family>
-    </Order>
-
-<Order Name="PELECANIFORMES">
-        <Family Name="PHAETHONTIDAE">
-            <Species Scientific_Name="Phaethon lepturus">White-tailed Tropicbird.</Species>
-            <Species Scientific_Name="Phaethon aethereus">Red-billed Tropicbird.</Species>
-            <Species Scientific_Name="Phaethon rubricauda">Red-tailed Tropicbird.</Species>
-        </Family>
-        <Family Name="SULIDAE">
-            <Species Scientific_Name="Sula dactylatra">Masked Booby.</Species>
-            <Species Scientific_Name="Sula nebouxii">Blue-footed Booby.</Species>
-            <Species Scientific_Name="Sula variegata">Peruvian Booby. (A)</Species>
-            <Species Scientific_Name="Sula leucogaster">Brown Booby.</Species>
-            <Species Scientific_Name="Sula sula">Red-footed Booby.</Species>
-            <Species Scientific_Name="Morus bassanus">Northern Gannet.</Species>
-        </Family>
-        <Family Name="PELECANIDAE">
-            <Species Scientific_Name="Pelecanus erythrorhynchos">American White Pelican.</Species>
-            <Species Scientific_Name="Pelecanus occidentalis">Brown Pelican.</Species>
-        </Family>
-        <Family Name="PHALACROCORACIDAE">
-            <Species Scientific_Name="Phalacrocorax penicillatus">Brandt's Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax brasilianus">Neotropic Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax auritus">Double-crested Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax carbo">Great Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax urile">Red-faced Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax pelagicus">Pelagic Cormorant.</Species>
-        </Family>
-        <Family Name="ANHINGIDAE">
-            <Species Scientific_Name="Anhinga anhinga">Anhinga.</Species>
-        </Family>
-        <Family Name="FREGATIDAE">
-            <Species Scientific_Name="Fregata magnificens">Magnificent Frigatebird.</Species>
-            <Species Scientific_Name="Fregata minor">Great Frigatebird.</Species>
-            <Species Scientific_Name="Fregata ariel">Lesser Frigatebird. (A)</Species>
-        </Family>
-    </Order>
-</Class>
diff --git a/samples/DOM2DOM/birds.xsl b/samples/DOM2DOM/birds.xsl
deleted file mode 100644
index 4d6f8e1..0000000
--- a/samples/DOM2DOM/birds.xsl
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:output method="xml" indent="yes"/>
-
-<xsl:template match="Class">
-<BirdInfo>
-	<xsl:apply-templates select="Order"/>
-</BirdInfo>
-</xsl:template>
-
-<xsl:template match="Order">
-Order is:  <xsl:value-of select="@Name"/>
-	<xsl:apply-templates select="Family"/><xsl:text>
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="Family">
-	Family is:  <xsl:value-of select="@Name"/>
-	<xsl:apply-templates select="Species | SubFamily | text()"/>
-</xsl:template>
-
-<xsl:template match="SubFamily">
-		SubFamily is <xsl:value-of select="@Name"/>
-    <xsl:apply-templates select="Species | text()"/>
-</xsl:template>
-
-<xsl:template match="Species">
-	<xsl:choose>
-	  <xsl:when test="name(..)='SubFamily'">
-		<xsl:text>	</xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-		<xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/samples/DOM2DOM/readme.html b/samples/DOM2DOM/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/DOM2DOM/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/Pipe/Pipe.java b/samples/Pipe/Pipe.java
deleted file mode 100644
index 40e25da..0000000
--- a/samples/Pipe/Pipe.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.dom.DOMResult;
-
-// Imported SAX classes
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.Parser;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-// Imported DOM classes
-import org.w3c.dom.Node;
-
-// Imported Serializer classes
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.templates.OutputProperties;
-
-// Imported JAVA API for XML Parsing 1.0 classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException; 
-
-// Imported java.io classes
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.IOException;
-
-import org.apache.xalan.transformer.TransformerImpl;
-
-  /**
-   * This example shows how to chain a series of transformations by
-   * piping SAX events from one Transformer to another. Each Transformer
-   * operates as a SAX2 XMLFilter/XMLReader.
-   */
-public class Pipe
-{
-	public static void main(String[] args)
-	throws TransformerException, TransformerConfigurationException, 
-         SAXException, IOException	   
-	{
-    // Instantiate  a TransformerFactory.
-  	TransformerFactory tFactory = TransformerFactory.newInstance();
-    // Determine whether the TransformerFactory supports The use uf SAXSource 
-    // and SAXResult
-    if (tFactory.getFeature(SAXSource.FEATURE) && tFactory.getFeature(SAXResult.FEATURE))
-    { 
-      // Cast the TransformerFactory to SAXTransformerFactory.
-      SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);	  
-      // Create a TransformerHandler for each stylesheet.
-      TransformerHandler tHandler1 = saxTFactory.newTransformerHandler(new StreamSource("foo1.xsl"));
-      TransformerHandler tHandler2 = saxTFactory.newTransformerHandler(new StreamSource("foo2.xsl"));
-      TransformerHandler tHandler3 = saxTFactory.newTransformerHandler(new StreamSource("foo3.xsl"));
-    
-      // Create an XMLReader.
-	    XMLReader reader = XMLReaderFactory.createXMLReader();
-      reader.setContentHandler(tHandler1);
-      reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHandler1);
-
-      tHandler1.setResult(new SAXResult(tHandler2));
-      tHandler2.setResult(new SAXResult(tHandler3));
-
-      // transformer3 outputs SAX events to the serializer.
-      Serializer serializer = SerializerFactory.getSerializer
-                                   (OutputProperties.getDefaultMethodProperties("xml"));        
-      serializer.setOutputStream(System.out);
-      tHandler3.setResult(new SAXResult(serializer.asContentHandler()));
-
-	    // Parse the XML input document. The input ContentHandler and output ContentHandler
-      // work in separate threads to optimize performance.   
-      reader.parse("foo.xml");
-    }
-  }
-}
\ No newline at end of file
diff --git a/samples/Pipe/foo.xml b/samples/Pipe/foo.xml
deleted file mode 100644
index da9f79b..0000000
--- a/samples/Pipe/foo.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<doc>Hello</doc>
\ No newline at end of file
diff --git a/samples/Pipe/foo1.xsl b/samples/Pipe/foo1.xsl
deleted file mode 100644
index 5da8d5e..0000000
--- a/samples/Pipe/foo1.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="doc">
-    <out><xsl:value-of select="."/></out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/Pipe/foo2.xsl b/samples/Pipe/foo2.xsl
deleted file mode 100644
index 67cd197..0000000
--- a/samples/Pipe/foo2.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="out">
-    <out><xsl:value-of select="."/> ...good to see you again!</out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/Pipe/foo3.xsl b/samples/Pipe/foo3.xsl
deleted file mode 100644
index 83cfaa6..0000000
--- a/samples/Pipe/foo3.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="out">
-    <out><xsl:value-of select="."/> ...and goodby!</out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/Pipe/readme.html b/samples/Pipe/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/Pipe/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/SAX2SAX/SAX2SAX.java b/samples/SAX2SAX/SAX2SAX.java
deleted file mode 100644
index 7d208ab..0000000
--- a/samples/SAX2SAX/SAX2SAX.java
+++ /dev/null
@@ -1,148 +0,0 @@
-
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- *  Replicate the SimpleTransform sample, explicitly using the SAX model to handle the
- *  stylesheet, the XML input, and the transformation.
- */
-
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Templates;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.Result;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.sax.TransformerHandler;              
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.templates.OutputProperties;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-
-public class SAX2SAX
-{
-  public static void main(String[] args)
-	throws TransformerException, TransformerConfigurationException, 
-         SAXException, IOException	   
-	{
-
-    // Instantiate a TransformerFactory.
-  	TransformerFactory tFactory = TransformerFactory.newInstance();
-    // Determine whether the TransformerFactory supports The use of SAXSource 
-    // and SAXResult
-    if (tFactory.getFeature(SAXSource.FEATURE) && tFactory.getFeature(SAXResult.FEATURE))
-    { 
-      // Cast the TransformerFactory.
-      SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
-      // Create a ContentHandler to handle parsing of the stylesheet.
-      TemplatesHandler templatesHandler = saxTFactory.newTemplatesHandler();
-
-      // Create an XMLReader and set its ContentHandler.
-      XMLReader reader = XMLReaderFactory.createXMLReader();
-      reader.setContentHandler(templatesHandler);
-    
-      // Parse the stylesheet.                       
-      reader.parse("birds.xsl");
-
-      //Get the Templates object from the ContentHandler.
-      Templates templates = templatesHandler.getTemplates();
-      // Create a ContentHandler to handle parsing of the XML source.  
-      TransformerHandler handler 
-        = saxTFactory.newTransformerHandler(templates);
-      // Reset the XMLReader's ContentHandler.
-      reader.setContentHandler(handler);  
-
-      // Set the ContentHandler to also function as a LexicalHandler, which
-      // includes "lexical" events (e.g., comments and CDATA). 
-      reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
-      
-   	  FileOutputStream fos = new FileOutputStream("birds.out");
-      
-      Serializer serializer = SerializerFactory.getSerializer
-                              (OutputProperties.getDefaultMethodProperties("xml"));
-      serializer.setOutputStream(fos);
-   
-      
-      // Set the result handling to be a serialization to the file output stream.
-      Result result = new SAXResult(serializer.asContentHandler());
-      handler.setResult(result);
-      
-      // Parse the XML input document.
-      reader.parse("birds.xml");
-      
-    	System.out.println("************* The result is in birds.out *************");	
-    }	
-    else
-      System.out.println("The TransformerFactory does not support SAX input and SAX output");
-  }
-}
\ No newline at end of file
diff --git a/samples/SAX2SAX/birds.xml b/samples/SAX2SAX/birds.xml
deleted file mode 100644
index 7027642..0000000
--- a/samples/SAX2SAX/birds.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Class>
-<Order Name="TINAMIFORMES">
-        <Family Name="TINAMIDAE">
-            <Species Scientific_Name="Tinamus major">  Great Tinamou.</Species>
-            <Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus soui">Little Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus cinnamomeus">Thicket Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus boucardi">Slaty-breasted Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus kerriae">Choco Tinamou.</Species>
-        </Family>
-    </Order>
-<Order Name="GAVIIFORMES">
-        <Family Name="GAVIIDAE">
-            <Species Scientific_Name="Gavia stellata">Red-throated Loon.</Species>
-            <Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
-            <Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
-            <Species Scientific_Name="Gavia immer">Common Loon.</Species>
-            <Species Scientific_Name="Gavia adamsii">Yellow-billed Loon.</Species>
-        </Family>
-    </Order>
-
-
-<Order Name="PODICIPEDIFORMES">
-        <Family Name="PODICIPEDIDAE">
-            <Species Scientific_Name="Tachybaptus dominicus">Least Grebe.</Species>
-            <Species Scientific_Name="Podilymbus podiceps">Pied-billed Grebe.</Species>
-            <Species Scientific_Name="">Atitlan Grebe.</Species>
-            <Species Scientific_Name="">Horned Grebe.</Species>
-            <Species Scientific_Name="">Red-necked Grebe.</Species>
-            <Species Scientific_Name="">Eared Grebe.</Species>
-            <Species Scientific_Name="">Western Grebe.</Species>
-            <Species Scientific_Name="">Clark's Grebe.</Species>
-            <Species Scientific_Name=""/>
-        </Family>
-    </Order>
-
-
-<Order Name="PROCELLARIIFORMES">
-        <Family Name="DIOMEDEIDAE">
-            <Species Scientific_Name="Thalassarche chlororhynchos">Yellow-nosed Albatross. (A)</Species>
-            <Species Scientific_Name="Thalassarche cauta">Shy Albatross. (A)</Species>
-            <Species Scientific_Name="Thalassarche melanophris">Black-browed Albatross. (A)</Species>
-            <Species Scientific_Name="Phoebetria palpebrata">Light-mantled Albatross. (A)</Species>
-            <Species Scientific_Name="Diomedea exulans">Wandering Albatross. (A)</Species>
-            <Species Scientific_Name="Phoebastria immutabilis">Laysan Albatross.</Species>
-            <Species Scientific_Name="Phoebastria nigripes">Black-footed Albatross.</Species>
-            <Species Scientific_Name="Phoebastria albatrus">Short-tailed Albatross. (N)</Species>
-        </Family>
-        <Family Name="PROCELLARIIDAE">
-            <Species Scientific_Name="Fulmarus glacialis">Northern Fulmar.</Species>
-            <Species Scientific_Name="Pterodroma neglecta">Kermadec Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma arminjoniana">Herald Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma ultima">Murphy's Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma inexpectata">Mottled Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma cahow">Bermuda Petrel.</Species>
-            <Species Scientific_Name="Pterodroma hasitata">Black-capped Petrel.</Species>
-            <Species Scientific_Name="Pterodroma externa">Juan Fernandez Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma phaeopygia">Dark-rumped Petrel.</Species>
-            <Species Scientific_Name="Pterodroma cervicalis">White-necked Petrel. (H)</Species>
-            <Species Scientific_Name="Pterodroma hypoleuca">Bonin Petrel. (H)</Species>
-            <Species Scientific_Name="Pterodroma nigripennis">Black-winged Petrel. (H, A)</Species>
-            <Species Scientific_Name="Pterodroma cookii">Cook's Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma longirostris">Stejneger's Petrel. (A)</Species>
-            <Species Scientific_Name="Bulweria bulwerii">Bulwer's Petrel. (H)</Species>
-            <Species Scientific_Name="Bulweria fallax">Jouanin's Petrel. (H, A)</Species>
-            <Species Scientific_Name="Procellaria parkinsoni">Parkinson's Petrel. (N)</Species>
-            <Species Scientific_Name="Calonectris leucomelas">Streaked Shearwater. (A)</Species>
-            <Species Scientific_Name="Calonectris diomedea">Cory's Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus creatopus">Pink-footed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus carneipes">Flesh-footed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus gravis">Greater Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus pacificus">Wedge-tailed Shearwater.</Species>
-            <Species Scientific_Name="Puffinus bulleri">Buller's Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus griseus">Sooty Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus tenuirostris">Short-tailed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus nativitatis">Christmas Shearwater. (H)</Species>
-            <Species Scientific_Name="Puffinus puffinus">Manx Shearwater.</Species>
-            <Species Scientific_Name="Puffinus auricularis">Townsend's Shearwater.</Species>
-            <Species Scientific_Name="Puffinus opisthomelas">Black-vented Shearwater.</Species>
-            <Species Scientific_Name="Puffinus lherminieri">Audubon's Shearwater.</Species>
-            <Species Scientific_Name="Puffinus assimilis">Little Shearwater. (A)</Species>
-        </Family>
-        <Family Name="HYDROBATIDAE">
-            <Species Scientific_Name="Oceanites oceanicus">Wilson's Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Pelagodroma marina">White-faced Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Hydrobates pelagicus">European Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Oceanodroma furcata">Fork-tailed Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma leucorhoa">Leach's Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma homochroa">Ashy Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma castro">Band-rumped Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Oceanodroma tethys">Wedge-rumped Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Oceanodroma melania">Black Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma macrodactyla">Guadalupe Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma markhami">Markham's Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Oceanodroma tristrami">Tristram's Storm-Petrel. (H)</Species>
-            <Species Scientific_Name="Oceanodroma microsoma">Least Storm-Petrel.</Species>
-        </Family>
-    </Order>
-
-<Order Name="PELECANIFORMES">
-        <Family Name="PHAETHONTIDAE">
-            <Species Scientific_Name="Phaethon lepturus">White-tailed Tropicbird.</Species>
-            <Species Scientific_Name="Phaethon aethereus">Red-billed Tropicbird.</Species>
-            <Species Scientific_Name="Phaethon rubricauda">Red-tailed Tropicbird.</Species>
-        </Family>
-        <Family Name="SULIDAE">
-            <Species Scientific_Name="Sula dactylatra">Masked Booby.</Species>
-            <Species Scientific_Name="Sula nebouxii">Blue-footed Booby.</Species>
-            <Species Scientific_Name="Sula variegata">Peruvian Booby. (A)</Species>
-            <Species Scientific_Name="Sula leucogaster">Brown Booby.</Species>
-            <Species Scientific_Name="Sula sula">Red-footed Booby.</Species>
-            <Species Scientific_Name="Morus bassanus">Northern Gannet.</Species>
-        </Family>
-        <Family Name="PELECANIDAE">
-            <Species Scientific_Name="Pelecanus erythrorhynchos">American White Pelican.</Species>
-            <Species Scientific_Name="Pelecanus occidentalis">Brown Pelican.</Species>
-        </Family>
-        <Family Name="PHALACROCORACIDAE">
-            <Species Scientific_Name="Phalacrocorax penicillatus">Brandt's Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax brasilianus">Neotropic Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax auritus">Double-crested Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax carbo">Great Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax urile">Red-faced Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax pelagicus">Pelagic Cormorant.</Species>
-        </Family>
-        <Family Name="ANHINGIDAE">
-            <Species Scientific_Name="Anhinga anhinga">Anhinga.</Species>
-        </Family>
-        <Family Name="FREGATIDAE">
-            <Species Scientific_Name="Fregata magnificens">Magnificent Frigatebird.</Species>
-            <Species Scientific_Name="Fregata minor">Great Frigatebird.</Species>
-            <Species Scientific_Name="Fregata ariel">Lesser Frigatebird. (A)</Species>
-        </Family>
-    </Order>
-</Class>
diff --git a/samples/SAX2SAX/birds.xsl b/samples/SAX2SAX/birds.xsl
deleted file mode 100644
index 4d6f8e1..0000000
--- a/samples/SAX2SAX/birds.xsl
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:output method="xml" indent="yes"/>
-
-<xsl:template match="Class">
-<BirdInfo>
-	<xsl:apply-templates select="Order"/>
-</BirdInfo>
-</xsl:template>
-
-<xsl:template match="Order">
-Order is:  <xsl:value-of select="@Name"/>
-	<xsl:apply-templates select="Family"/><xsl:text>
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="Family">
-	Family is:  <xsl:value-of select="@Name"/>
-	<xsl:apply-templates select="Species | SubFamily | text()"/>
-</xsl:template>
-
-<xsl:template match="SubFamily">
-		SubFamily is <xsl:value-of select="@Name"/>
-    <xsl:apply-templates select="Species | text()"/>
-</xsl:template>
-
-<xsl:template match="Species">
-	<xsl:choose>
-	  <xsl:when test="name(..)='SubFamily'">
-		<xsl:text>	</xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-		<xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/samples/SAX2SAX/foo.xml b/samples/SAX2SAX/foo.xml
deleted file mode 100644
index da9f79b..0000000
--- a/samples/SAX2SAX/foo.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<doc>Hello</doc>
\ No newline at end of file
diff --git a/samples/SAX2SAX/foo.xsl b/samples/SAX2SAX/foo.xsl
deleted file mode 100644
index 5da8d5e..0000000
--- a/samples/SAX2SAX/foo.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="doc">
-    <out><xsl:value-of select="."/></out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/SimpleTransform/SimpleTransform.java b/samples/SimpleTransform/SimpleTransform.java
deleted file mode 100644
index 0b46a25..0000000
--- a/samples/SimpleTransform/SimpleTransform.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-
-// Imported java classes
-import java.io.FileOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-/**
- *  Use the TraX interface to perform a transformation in the simplest manner possible
- *  (3 statements).
- */
-public class SimpleTransform
-{
-	public static void main(String[] args)
-    throws TransformerException, TransformerConfigurationException, 
-           FileNotFoundException, IOException
-  {  
-  // Use the static TransformerFactory.newInstance() method to instantiate 
-  // a TransformerFactory. The javax.xml.transform.TransformerFactory 
-  // system property setting determines the actual class to instantiate --
-  // org.apache.xalan.transformer.TransformerImpl.
-	TransformerFactory tFactory = TransformerFactory.newInstance();
-	
-	// Use the TransformerFactory to instantiate a Transformer that will work with  
-	// the stylesheet you specify. This method call also processes the stylesheet
-  // into a compiled Templates object.
-	Transformer transformer = tFactory.newTransformer(new StreamSource("birds.xsl"));
-
-	// Use the Transformer to apply the associated Templates object to an XML document
-	// (foo.xml) and write the output to a file (foo.out).
-	transformer.transform(new StreamSource("birds.xml"), new StreamResult(new FileOutputStream("birds.out")));
-	
-	System.out.println("************* The result is in birds.out *************");
-  }
-}
\ No newline at end of file
diff --git a/samples/SimpleTransform/birds.xml b/samples/SimpleTransform/birds.xml
deleted file mode 100644
index 7027642..0000000
--- a/samples/SimpleTransform/birds.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Class>
-<Order Name="TINAMIFORMES">
-        <Family Name="TINAMIDAE">
-            <Species Scientific_Name="Tinamus major">  Great Tinamou.</Species>
-            <Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus soui">Little Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus cinnamomeus">Thicket Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus boucardi">Slaty-breasted Tinamou.</Species>
-            <Species Scientific_Name="Crypturellus kerriae">Choco Tinamou.</Species>
-        </Family>
-    </Order>
-<Order Name="GAVIIFORMES">
-        <Family Name="GAVIIDAE">
-            <Species Scientific_Name="Gavia stellata">Red-throated Loon.</Species>
-            <Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
-            <Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
-            <Species Scientific_Name="Gavia immer">Common Loon.</Species>
-            <Species Scientific_Name="Gavia adamsii">Yellow-billed Loon.</Species>
-        </Family>
-    </Order>
-
-
-<Order Name="PODICIPEDIFORMES">
-        <Family Name="PODICIPEDIDAE">
-            <Species Scientific_Name="Tachybaptus dominicus">Least Grebe.</Species>
-            <Species Scientific_Name="Podilymbus podiceps">Pied-billed Grebe.</Species>
-            <Species Scientific_Name="">Atitlan Grebe.</Species>
-            <Species Scientific_Name="">Horned Grebe.</Species>
-            <Species Scientific_Name="">Red-necked Grebe.</Species>
-            <Species Scientific_Name="">Eared Grebe.</Species>
-            <Species Scientific_Name="">Western Grebe.</Species>
-            <Species Scientific_Name="">Clark's Grebe.</Species>
-            <Species Scientific_Name=""/>
-        </Family>
-    </Order>
-
-
-<Order Name="PROCELLARIIFORMES">
-        <Family Name="DIOMEDEIDAE">
-            <Species Scientific_Name="Thalassarche chlororhynchos">Yellow-nosed Albatross. (A)</Species>
-            <Species Scientific_Name="Thalassarche cauta">Shy Albatross. (A)</Species>
-            <Species Scientific_Name="Thalassarche melanophris">Black-browed Albatross. (A)</Species>
-            <Species Scientific_Name="Phoebetria palpebrata">Light-mantled Albatross. (A)</Species>
-            <Species Scientific_Name="Diomedea exulans">Wandering Albatross. (A)</Species>
-            <Species Scientific_Name="Phoebastria immutabilis">Laysan Albatross.</Species>
-            <Species Scientific_Name="Phoebastria nigripes">Black-footed Albatross.</Species>
-            <Species Scientific_Name="Phoebastria albatrus">Short-tailed Albatross. (N)</Species>
-        </Family>
-        <Family Name="PROCELLARIIDAE">
-            <Species Scientific_Name="Fulmarus glacialis">Northern Fulmar.</Species>
-            <Species Scientific_Name="Pterodroma neglecta">Kermadec Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma arminjoniana">Herald Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma ultima">Murphy's Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma inexpectata">Mottled Petrel. (A)</Species>
-            <Species Scientific_Name="Pterodroma cahow">Bermuda Petrel.</Species>
-            <Species Scientific_Name="Pterodroma hasitata">Black-capped Petrel.</Species>
-            <Species Scientific_Name="Pterodroma externa">Juan Fernandez Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma phaeopygia">Dark-rumped Petrel.</Species>
-            <Species Scientific_Name="Pterodroma cervicalis">White-necked Petrel. (H)</Species>
-            <Species Scientific_Name="Pterodroma hypoleuca">Bonin Petrel. (H)</Species>
-            <Species Scientific_Name="Pterodroma nigripennis">Black-winged Petrel. (H, A)</Species>
-            <Species Scientific_Name="Pterodroma cookii">Cook's Petrel. (N)</Species>
-            <Species Scientific_Name="Pterodroma longirostris">Stejneger's Petrel. (A)</Species>
-            <Species Scientific_Name="Bulweria bulwerii">Bulwer's Petrel. (H)</Species>
-            <Species Scientific_Name="Bulweria fallax">Jouanin's Petrel. (H, A)</Species>
-            <Species Scientific_Name="Procellaria parkinsoni">Parkinson's Petrel. (N)</Species>
-            <Species Scientific_Name="Calonectris leucomelas">Streaked Shearwater. (A)</Species>
-            <Species Scientific_Name="Calonectris diomedea">Cory's Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus creatopus">Pink-footed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus carneipes">Flesh-footed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus gravis">Greater Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus pacificus">Wedge-tailed Shearwater.</Species>
-            <Species Scientific_Name="Puffinus bulleri">Buller's Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus griseus">Sooty Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus tenuirostris">Short-tailed Shearwater. (N)</Species>
-            <Species Scientific_Name="Puffinus nativitatis">Christmas Shearwater. (H)</Species>
-            <Species Scientific_Name="Puffinus puffinus">Manx Shearwater.</Species>
-            <Species Scientific_Name="Puffinus auricularis">Townsend's Shearwater.</Species>
-            <Species Scientific_Name="Puffinus opisthomelas">Black-vented Shearwater.</Species>
-            <Species Scientific_Name="Puffinus lherminieri">Audubon's Shearwater.</Species>
-            <Species Scientific_Name="Puffinus assimilis">Little Shearwater. (A)</Species>
-        </Family>
-        <Family Name="HYDROBATIDAE">
-            <Species Scientific_Name="Oceanites oceanicus">Wilson's Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Pelagodroma marina">White-faced Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Hydrobates pelagicus">European Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Oceanodroma furcata">Fork-tailed Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma leucorhoa">Leach's Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma homochroa">Ashy Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma castro">Band-rumped Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Oceanodroma tethys">Wedge-rumped Storm-Petrel. (N)</Species>
-            <Species Scientific_Name="Oceanodroma melania">Black Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma macrodactyla">Guadalupe Storm-Petrel.</Species>
-            <Species Scientific_Name="Oceanodroma markhami">Markham's Storm-Petrel. (A)</Species>
-            <Species Scientific_Name="Oceanodroma tristrami">Tristram's Storm-Petrel. (H)</Species>
-            <Species Scientific_Name="Oceanodroma microsoma">Least Storm-Petrel.</Species>
-        </Family>
-    </Order>
-
-<Order Name="PELECANIFORMES">
-        <Family Name="PHAETHONTIDAE">
-            <Species Scientific_Name="Phaethon lepturus">White-tailed Tropicbird.</Species>
-            <Species Scientific_Name="Phaethon aethereus">Red-billed Tropicbird.</Species>
-            <Species Scientific_Name="Phaethon rubricauda">Red-tailed Tropicbird.</Species>
-        </Family>
-        <Family Name="SULIDAE">
-            <Species Scientific_Name="Sula dactylatra">Masked Booby.</Species>
-            <Species Scientific_Name="Sula nebouxii">Blue-footed Booby.</Species>
-            <Species Scientific_Name="Sula variegata">Peruvian Booby. (A)</Species>
-            <Species Scientific_Name="Sula leucogaster">Brown Booby.</Species>
-            <Species Scientific_Name="Sula sula">Red-footed Booby.</Species>
-            <Species Scientific_Name="Morus bassanus">Northern Gannet.</Species>
-        </Family>
-        <Family Name="PELECANIDAE">
-            <Species Scientific_Name="Pelecanus erythrorhynchos">American White Pelican.</Species>
-            <Species Scientific_Name="Pelecanus occidentalis">Brown Pelican.</Species>
-        </Family>
-        <Family Name="PHALACROCORACIDAE">
-            <Species Scientific_Name="Phalacrocorax penicillatus">Brandt's Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax brasilianus">Neotropic Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax auritus">Double-crested Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax carbo">Great Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax urile">Red-faced Cormorant.</Species>
-            <Species Scientific_Name="Phalacrocorax pelagicus">Pelagic Cormorant.</Species>
-        </Family>
-        <Family Name="ANHINGIDAE">
-            <Species Scientific_Name="Anhinga anhinga">Anhinga.</Species>
-        </Family>
-        <Family Name="FREGATIDAE">
-            <Species Scientific_Name="Fregata magnificens">Magnificent Frigatebird.</Species>
-            <Species Scientific_Name="Fregata minor">Great Frigatebird.</Species>
-            <Species Scientific_Name="Fregata ariel">Lesser Frigatebird. (A)</Species>
-        </Family>
-    </Order>
-</Class>
diff --git a/samples/SimpleTransform/birds.xsl b/samples/SimpleTransform/birds.xsl
deleted file mode 100644
index 4d6f8e1..0000000
--- a/samples/SimpleTransform/birds.xsl
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:output method="xml" indent="yes"/>
-
-<xsl:template match="Class">
-<BirdInfo>
-	<xsl:apply-templates select="Order"/>
-</BirdInfo>
-</xsl:template>
-
-<xsl:template match="Order">
-Order is:  <xsl:value-of select="@Name"/>
-	<xsl:apply-templates select="Family"/><xsl:text>
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="Family">
-	Family is:  <xsl:value-of select="@Name"/>
-	<xsl:apply-templates select="Species | SubFamily | text()"/>
-</xsl:template>
-
-<xsl:template match="SubFamily">
-		SubFamily is <xsl:value-of select="@Name"/>
-    <xsl:apply-templates select="Species | text()"/>
-</xsl:template>
-
-<xsl:template match="Species">
-	<xsl:choose>
-	  <xsl:when test="name(..)='SubFamily'">
-		<xsl:text>	</xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-		<xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/samples/SimpleTransform/foo.xml b/samples/SimpleTransform/foo.xml
deleted file mode 100644
index da9f79b..0000000
--- a/samples/SimpleTransform/foo.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<doc>Hello</doc>
\ No newline at end of file
diff --git a/samples/SimpleTransform/foo.xsl b/samples/SimpleTransform/foo.xsl
deleted file mode 100644
index 5da8d5e..0000000
--- a/samples/SimpleTransform/foo.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="doc">
-    <out><xsl:value-of select="."/></out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/SimpleTransform/readme.html b/samples/SimpleTransform/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/SimpleTransform/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/Trace/Trace.java b/samples/Trace/Trace.java
deleted file mode 100644
index d059e4b..0000000
--- a/samples/Trace/Trace.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.trace.PrintTraceListener;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-public class Trace
-{	
-  public static void main (String[] args)
-	  throws java.io.IOException, 
-			 TransformerException, TransformerConfigurationException,
-			 java.util.TooManyListenersException, 
-			 org.xml.sax.SAXException			 
-  {
-    // Set up a PrintTraceListener object to print to a file.
-    java.io.FileWriter fw = new java.io.FileWriter("events.log");  
-    java.io.PrintWriter pw = new java.io.PrintWriter(fw, true);
-    PrintTraceListener ptl = new PrintTraceListener(pw);
-
-    // Print information as each node is 'executed' in the stylesheet.
-    ptl.m_traceElements = true;
-    // Print information after each result-tree generation event.
-    ptl.m_traceGeneration = true;
-    // Print information after each selection event.
-    ptl.m_traceSelection = true;
-    // Print information whenever a template is invoked.
-    ptl.m_traceTemplates = true;
-
-    // Set up the transformation    
-   	TransformerFactory tFactory = TransformerFactory.newInstance();
-    Transformer transformer = tFactory.newTransformer(new StreamSource("foo.xsl"));
-
-    // Cast the Transformer object to TransformerImpl.
-    if (transformer instanceof TransformerImpl) 
-	  {
-      TransformerImpl transformerImpl = (TransformerImpl)transformer;
-      // Register the TraceListener with a TraceManager associated 
-      // with the TransformerImpl.
-      TraceManager trMgr = transformerImpl.getTraceManager();
-      trMgr.addTraceListener(ptl);
-                     
-      // Perform the transformation --printing information to
-      // the events log during the process.
-      transformer.transform
-                         ( new StreamSource("foo.xml"), 
-                           new StreamResult(new java.io.FileWriter("foo.out")) );
-    }
-    // Close the PrintWriter and FileWriter.
-    pw.close();
-    fw.close();
-   	System.out.println("**The output is in foo.out; the log is in events.log ****");	
-    
-  }
-}
\ No newline at end of file
diff --git a/samples/Trace/foo.xml b/samples/Trace/foo.xml
deleted file mode 100644
index 5e72e15..0000000
--- a/samples/Trace/foo.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<upload>
-  <day>
-    <dow>tue</dow>
-    <order>
-      <line>
-         <product>Belt</product>
-         <price>5.54</price>
-      </line>
-    </order>
-  </day>
-  <day>
-    <dow>wed</dow>
-  </day>
-  <day>
-    <dow>thu</dow>
-    <order>
-      <line>
-         <product>Boots</product>
-         <price>9.23</price>
-      </line>
-    </order>
-  </day>
-  <day>
-    <dow>fri</dow>
-    <order>
-    </order>
-    <order>
-    </order>
-  </day>
-  <day>
-    <dow>sat</dow>
-    <order>
-      <line>
-         <product>Jacket</product>
-         <price>9.84</price>
-      </line>
-    </order>
-  </day>
-  <day>
-    <dow>mon</dow>
-    <order>
-    </order>
-    <order>
-      <line>
-         <product>Tie</product>
-         <price>5.37</price>
-      </line>
-    </order>
-  </day>
-  <day>
-    <dow>tue</dow>
-  </day>
-  <day>
-    <dow>wed</dow>
-    <order>
-    </order>
-  </day>
-  <day>
-    <dow>thu</dow>
-    <order>
-      <line>
-         <product>Overalls</product>
-         <price>3.16</price>
-      </line>
-    </order>
-  </day>
-</upload>
diff --git a/samples/Trace/foo.xsl b/samples/Trace/foo.xsl
deleted file mode 100644
index 2775ee7..0000000
--- a/samples/Trace/foo.xsl
+++ /dev/null
@@ -1,69 +0,0 @@
-<xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
-  xmlns="http://www.w3.org/TR/REC-html40">
-
-  <!-- FileName: misc-evans -->
-  <!-- Document: http://www.w3.org/TR/xslt -->
-  <!-- DocVersion: 19991116 -->
-  <!-- Purpose: COPY of perf test;"A Practical Suggestion for XSLT Performance Improvement" by Clark Evans. -->
-
-   <xsl:variable name="day-list" 
-     select="//dow[not(.=following::dow)]" />
-
-   <xsl:variable name="product-list" 
-            select="//product[not(.=following::product)]" />
-     
-<xsl:template match="/">
-  <xsl:variable name="my-test"><a><b/></a></xsl:variable>
-  <html>
-    <xsl:copy-of select="$my-test"/>
-    <body>
-    <table>
-      <tr>
-        <td><xsl:text> </xsl:text></td>
-        <xsl:for-each select="$day-list">
-          <xsl:sort order="ascending" select="." />
-          <th><xsl:value-of select="."/></th>
-        </xsl:for-each>
-      </tr>
-      <xsl:for-each select="$product-list">
-        <xsl:sort    order="ascending" select="." />
-        <xsl:variable name="product" select="." />
-        <tr>
-          <td>
-            <xsl:value-of select="$product" />
-          </td>
-          <xsl:for-each select="$day-list">
-            <xsl:sort order="ascending" select="." />
-            <xsl:variable name="day" select="." />
-            <td>
-              <xsl:value-of 
-             select="sum(//price[../product=$product][../../../dow=$day])"
-/> .
-            </td>
-          </xsl:for-each>
-          <td>
-            <xsl:value-of 
-              select="sum(//price[../product=$product])" /> .
-           </td>
-        </tr>
-      </xsl:for-each>
-      <tr>
-        <td><xsl:text> </xsl:text></td>
-        <xsl:for-each select="$day-list">
-          <xsl:sort    order="ascending" select="." />
-          <xsl:variable name="day" select="." />
-          <td>
-            <xsl:value-of 
-              select="sum(//price[../../../dow=$day])" />
-          </td>
-        </xsl:for-each>
-        <td>
-          <xsl:value-of select="sum(//price)" />
-        </td>
-      </tr>
-    </table>
-    </body>
-  </html>
-</xsl:template>
-</xsl:stylesheet>
diff --git a/samples/UseStylesheetPI/UseStylesheetPI.java b/samples/UseStylesheetPI/UseStylesheetPI.java
deleted file mode 100644
index aa0c714..0000000
--- a/samples/UseStylesheetPI/UseStylesheetPI.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-// Imported java.io classes
-import java.io.FileOutputStream;
-import java.io.IOException;	
-
-public class UseStylesheetPI
-{
-  public static void main(String[] args)
-	  throws TransformerException, TransformerConfigurationException
-	{
-	  String media= null , title = null, charset = null;
-	  try
-	  {	
-    	TransformerFactory tFactory = TransformerFactory.newInstance();
-      Source stylesheet = tFactory.getAssociatedStylesheet
-        (new StreamSource("fooX.xml"),media, title, charset);
-      
-      Transformer transformer = tFactory.newTransformer(stylesheet);
-        
-		   transformer.transform(new StreamSource("fooX.xml"), 
-                             new StreamResult(new java.io.FileOutputStream("foo.out")));
-       
-      System.out.println("************* The result is in foo.out *************");
-       
-	  }
-  	  catch (Exception e)
-	  {
-	    e.printStackTrace();
-	  }
-  }
-}
diff --git a/samples/UseStylesheetPI/foo.xsl b/samples/UseStylesheetPI/foo.xsl
deleted file mode 100644
index 5da8d5e..0000000
--- a/samples/UseStylesheetPI/foo.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="doc">
-    <out><xsl:value-of select="."/></out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/UseStylesheetPI/fooX.xml b/samples/UseStylesheetPI/fooX.xml
deleted file mode 100644
index cd4b743..0000000
--- a/samples/UseStylesheetPI/fooX.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="foo.xsl"?>
-<doc>Hello</doc>
\ No newline at end of file
diff --git a/samples/UseStylesheetParam/UseStylesheetParam.java b/samples/UseStylesheetParam/UseStylesheetParam.java
deleted file mode 100644
index a8b3c91..0000000
--- a/samples/UseStylesheetParam/UseStylesheetParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-// Imported TraX classes
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-// Imported SAX classes
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-// Imported java classes
-import java.io.IOException;
-
-  /**
-   * Use command-line input as a stylesheet parameter.
-   */
-
-public class UseStylesheetParam
-{
-  public static void main(String[] args)
-	throws TransformerException, TransformerConfigurationException, 
-         SAXException, IOException	   
-	{
-    if(args.length != 1)
-    {
-      System.err.println("Please pass one string to this program");
-      return;
-    }
-  	// Get the parameter value from the command line.
-    String paramValue = args[0];
-	
-   	TransformerFactory tFactory = TransformerFactory.newInstance();
-    Transformer transformer = tFactory.newTransformer(new StreamSource("foo.xsl"));
-
-	// Set the parameter. I can't get non-null namespaces to work!!
-    transformer.setParameter("param1",	/* parameter name */
-               							 paramValue /* parameter value */ );
-    
-    transformer.transform(new StreamSource("foo.xml"), new StreamResult(System.out));
-  }   
-}
\ No newline at end of file
diff --git a/samples/UseStylesheetParam/foo.xml b/samples/UseStylesheetParam/foo.xml
deleted file mode 100644
index 03c32b5..0000000
--- a/samples/UseStylesheetParam/foo.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<doc>Hello</doc>
diff --git a/samples/UseStylesheetParam/foo.xsl b/samples/UseStylesheetParam/foo.xsl
deleted file mode 100644
index 5ee19dc..0000000
--- a/samples/UseStylesheetParam/foo.xsl
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:param name="param1" select="'default value'"/>
-  <xsl:template match="doc">
-    <out><xsl:value-of select="$param1"/></out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/UseStylesheetParam/readme.html b/samples/UseStylesheetParam/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/UseStylesheetParam/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/UseXMLFilters/UseXMLFilters.java b/samples/UseXMLFilters/UseXMLFilters.java
deleted file mode 100644
index 2fe78fd..0000000
--- a/samples/UseXMLFilters/UseXMLFilters.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Templates;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.Result;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.sax.TransformerHandler;              
-
-// Imported SAX classes
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.Parser;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.XMLReader;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.ContentHandler;
-
-// Imported DOM classes
-import org.w3c.dom.Node;
-
-// Imported Serializer classes
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.templates.OutputProperties;
-
-// Imported JAVA API for XML Parsing classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException; 
-
-// Imported java.io classes
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.IOException;
-
-  /**
-   * This example shows how to chain a series of transformations by
-   * piping SAX events from one Transformer to another. Each Transformer
-   * operates as a SAX2 XMLFilter/XMLReader.
-   */
-public class UseXMLFilters
-{
-  public static void main(String[] args)
-	throws TransformerException, TransformerConfigurationException, 
-         SAXException, IOException	   
-	{
-    // Instantiate  a TransformerFactory.
-  	TransformerFactory tFactory = TransformerFactory.newInstance();
-    // Determine whether the TransformerFactory supports The use uf SAXSource 
-    // and SAXResult
-    if (tFactory.getFeature(SAXSource.FEATURE) && tFactory.getFeature(SAXResult.FEATURE))
-    { 
-      // Cast the TransformerFactory to SAXTransformerFactory.
-      SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
-  	  // Create an XMLFilter for each stylesheet.
-      XMLFilter xmlFilter1 = saxTFactory.newXMLFilter(new StreamSource("foo1.xsl"));
-      XMLFilter xmlFilter2 = saxTFactory.newXMLFilter(new StreamSource("foo2.xsl"));
-      XMLFilter xmlFilter3 = saxTFactory.newXMLFilter(new StreamSource("foo3.xsl"));
-    
-      // Create an XMLReader.
-	    XMLReader reader = XMLReaderFactory.createXMLReader();
-    
-      // xmlFilter1 uses the XMLReader as its reader.
-      xmlFilter1.setParent(reader);
-    
-      // xmlFilter2 uses xmlFilter1 as its reader.
-      xmlFilter2.setParent(xmlFilter1);
-    
-      // xmlFilter3 uses xmlFilter2 as its reader.
-      xmlFilter3.setParent(xmlFilter2);
-    
-      // xmlFilter3 outputs SAX events to the serializer.
-      Serializer serializer = SerializerFactory.getSerializer
-                                   (OutputProperties.getDefaultMethodProperties("xml"));        
-      serializer.setOutputStream(System.out);
-      xmlFilter3.setContentHandler(serializer.asContentHandler());
-
-  	  // Perform the series of transformations as follows:
-	    //   - transformer3 gets its parent (transformer2) as the XMLReader/XMLFilter
-	    //     and calls transformer2.parse(new InputSource("foo.xml")).
-      //   - transformer2 gets its parent (transformer1) as the XMLReader/XMLFilter
-	    //     and calls transformer1.parse(new InputSource("foo.xml")). 
-      //   - transformer1 gets its parent (reader, a SAXParser) as the XMLReader 
-      //     and calls reader.parse(new InputSource("foo.xml")).
-	    //   - reader parses the XML document and sends the SAX parse events to transformer1, 
-	    //     which performs transformation 1 and sends the output to transformer2.
-  	  //   - transformer2 parses the transformation 1 output, performs transformation 2, and 
-	    //     sends the output to transformer3.
-	    //   - transformer3 parses the transformation 2 output, performs transformation 3,
-  	  //     and sends the output to the serializer.
-      xmlFilter3.parse(new InputSource("foo.xml"));
-    }
-  }
-}
\ No newline at end of file
diff --git a/samples/UseXMLFilters/foo.xml b/samples/UseXMLFilters/foo.xml
deleted file mode 100644
index da9f79b..0000000
--- a/samples/UseXMLFilters/foo.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<doc>Hello</doc>
\ No newline at end of file
diff --git a/samples/UseXMLFilters/foo1.xsl b/samples/UseXMLFilters/foo1.xsl
deleted file mode 100644
index 5da8d5e..0000000
--- a/samples/UseXMLFilters/foo1.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="doc">
-    <out><xsl:value-of select="."/></out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/UseXMLFilters/foo2.xsl b/samples/UseXMLFilters/foo2.xsl
deleted file mode 100644
index 67cd197..0000000
--- a/samples/UseXMLFilters/foo2.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="out">
-    <out><xsl:value-of select="."/> ...good to see you again!</out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/UseXMLFilters/foo3.xsl b/samples/UseXMLFilters/foo3.xsl
deleted file mode 100644
index 83cfaa6..0000000
--- a/samples/UseXMLFilters/foo3.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:template match="out">
-    <out><xsl:value-of select="."/> ...and goodby!</out>
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/UseXMLFilters/readme.html b/samples/UseXMLFilters/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/UseXMLFilters/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/Validate/Validate.java b/samples/Validate/Validate.java
deleted file mode 100644
index 6532f76..0000000
--- a/samples/Validate/Validate.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-// Imported JAXP classes
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.ParserConfigurationException;
-
-// SAX import
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-
-// Imported java.io classes
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FilenameFilter;
-import java.io.FileWriter;
-
-/* Use JAXP SAXParser to parse 1 .xml file or all the .xml files in a directory.
- * Takes 1 or 2 command-line arguments:
- *   Argument 1 (required) is a file name or directory name.
- *   Argument 2 (optional) is a log file name. If ommitted, messages are written to screen.
- */
-public class Validate
-{
-  static int numXMLFiles = 0;
-  static int numValidFiles = 0;
-  static int numInvalidFiles = 0;
-  static int numFilesMissingDoctype = 0;
-  static int numMalformedFiles = 0;
-  static boolean useLogFile = false;
-  static StringBuffer buff = new StringBuffer();
-
-  public static void main(String[] args)
-    throws FileNotFoundException, IOException, ParserConfigurationException, SAXException
-  {
-    if (args.length == 0 || args.length > 2)
-    {
-      System.out.println("\nEnter 'java validate -help' for information about running Validate");
-      return;
-    }
-    if (args[0].toLowerCase().equals("-help"))
-    { 
-      String sep = "\n====================================================\n";
-      String a = "Validate uses Xerces to parse the xml files in the directory you specify or the individual xml file you specify. The parser validates each document (checks that it conforms to its DOCTYPE).\n";
-      String b = "Each xml file should contain a DOCTYPE declaration.\n\n";
-      String c = "Validate takes 1 or 2 arguments:\n";
-      String d = " Argument 1 specifies a directory or an individual xml file.\n";
-      String e = " Argument 2 specifies a log file. If you include this argument, Validate appends messages to this file. If you do not, Validate writes messages to the screen.\n";
-      System.out.println(sep+a+b+c+d+e+sep);
-      return;
-    }    
-    try
-    {
-      Validate v = new Validate();
-      v.validate(args);
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }    
-  }
-  
-  void validate(String[] args)
-    throws FileNotFoundException, IOException, ParserConfigurationException, SAXException
-  {
-    File dir = new File(args[0]);
-   
-    // User may include a 2nd argument for the log file. 
-    useLogFile = (args.length == 2);
-   
-    if (dir.isFile()) // Just checking one file.
-    {
-      parse(null,args[0]);
-    }
-    else if (dir.isDirectory())  // Checking the contents of a directory.
-    {
-      // Only interested in .xml files.
-      XMLFileFilter filter = new XMLFileFilter();
-      String [] files = dir.list(filter);
-      for (int i = 0; i <files.length; i++)
-      { 
-        parse(dir.toString(),files[i]); // All the work is done here.
-        
-        if (!useLogFile) 
-        // Write messages to screen after parsing each file.
-        {
-          System.out.print(buff.toString());
-          buff = new StringBuffer();
-        }
-      }
-    }
-    else // Command-line argument is no good!
-    {
-      System.out.println(args[0] + " not found!");
-      return;
-    }
-    // Provide user with a summary.
-    buff.append("================SUMMARY=============================\n");
-    if (numXMLFiles > 1)
-      buff.append("Parsed " + numXMLFiles + " .xml files in " +  args[0] + ".\n");
-    if (numValidFiles > 1)
-      buff.append( numValidFiles + " files are valid.\n");
-    else if (numValidFiles == 1)
-      buff.append( numValidFiles + " file is valid.\n");
-    if (numInvalidFiles > 1)
-      buff.append(numInvalidFiles + " files are not valid.\n");
-    else if (numInvalidFiles == 1)
-      buff.append( numInvalidFiles + " file is not valid.\n");
-    if (numMalformedFiles > 1)
-      buff.append(numMalformedFiles + " files are not well-formed.\n");
-    else if (numMalformedFiles == 1)
-      buff.append( numMalformedFiles + " file is not well-formed.\n");
-    if (numFilesMissingDoctype > 1)
-      buff.append(numFilesMissingDoctype + " files do not contain a DOCTYPE declaration.\n");
-    else if (numFilesMissingDoctype == 1)
-      buff.append(numFilesMissingDoctype + " file does not contain a DOCTYPE declaration.\n");
-     
-    if (!useLogFile)
-      System.out.print(buff.toString());
-    else
-    {
-      // If log file exists, append.
-      FileWriter writer = new FileWriter(args[1], true);
-      writer.write(new java.util.Date().toString()+ "\n");
-      writer.write(buff.toString());
-      writer.close();     
-      System.out.println("Done with validation. See " + args[1] + ".");
-    }
-  }
-  
-  // Parse each XML file.
-  void parse(String dir, String filename)
-     throws FileNotFoundException, IOException, ParserConfigurationException, SAXException
-  {
-    try 
-    {
-      File f = new File(dir, filename);
-      StringBuffer errorBuff = new StringBuffer();
-      InputSource input = new InputSource(new FileInputStream(f));
-      // Set systemID so parser can find the dtd with a relative URL in the source document.
-      input.setSystemId(f.toString());
-      SAXParserFactory spfact = SAXParserFactory.newInstance();
-       
-      spfact.setValidating(true);
-      spfact.setNamespaceAware(true);
-            
-      SAXParser parser = spfact.newSAXParser();
-      XMLReader reader = parser.getXMLReader();
-      
-      //Instantiate inner-class error and lexical handler.
-      Handler handler = new Handler(filename, errorBuff);
-      reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
-      parser.parse(input, handler);
-
-      if (handler.containsDTD && !handler.errorOrWarning) // valid
-      {
-        buff.append("VALID " + filename +"\n");
-        numValidFiles++;
-      }
-      else if (handler.containsDTD) // not valid
-      {
-        buff.append ("NOT VALID " + filename + "\n");
-        buff.append(errorBuff.toString());
-        numInvalidFiles++;
-      }
-      else // no DOCTYPE to use for validation
-      {
-        buff.append("NO DOCTYPE DECLARATION " + filename + "\n");
-        numFilesMissingDoctype++;
-      }
-    }
-    catch (Exception e) // Serious problem!
-    {
-      buff.append("NOT WELL-FORMED " + filename + ". " + e.getMessage() + "\n");
-      numMalformedFiles++;
-    }
-    finally
-    {
-      numXMLFiles++;
-    }
-  }
-  // Inner classes
-  
-  // Only interested in parsing .xml files.
-  class XMLFileFilter implements FilenameFilter
-  {
-    public boolean accept(File dir, String fileName)
-    {
-      return fileName.toLowerCase().endsWith(".xml") && new File(dir.toString(),fileName).isFile();
-    }
-  }
-  
-  // Catch any errors or warnings, and verify presence of doctype statement.
-  class Handler extends DefaultHandler implements LexicalHandler
-  {
-    boolean errorOrWarning;
-    boolean containsDTD;
-    String sourceFile;
-    StringBuffer errorBuff;  
-  
-    Handler(String sourceFile, StringBuffer errorBuff)
-    {
-      super();
-      this.sourceFile = sourceFile;
-      this.errorBuff = errorBuff;
-      errorOrWarning = false;
-      containsDTD = false;
-    }
-    
-    public void error(SAXParseException exc)
-    {
-      errorBuff.append(sourceFile + " Error: " + exc.getMessage()+ "\n");    
-      errorOrWarning = true;
-    }
-    public void warning(SAXParseException exc)
-    {
-      errorBuff.append(sourceFile + " Warning:" + exc.getMessage()+ "\n");   
-      errorOrWarning = true;
-    }
-
-    // LexicalHandler methods; all no-op except startDTD().
-    
-    // Set containsDTD to true when startDTD event occurs.
-    public void startDTD (String name, String publicId, String systemId)
-	    throws SAXException
-    {
-      containsDTD = true;
-    }
- 
-    public void endDTD () throws SAXException
-    {}  
-  
-    public void startEntity (String name) throws SAXException
-    {}
-  
-    public void endEntity (String name) throws SAXException
-    {}
-  
-    public void startCDATA () throws SAXException
-    {}
-  
-    public void endCDATA () throws SAXException
-    {}
-  
-    public void comment (char ch[], int start, int length) throws SAXException
-    {}
-  }
-}
\ No newline at end of file
diff --git a/samples/Validate/readme.html b/samples/Validate/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/Validate/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/1-redir.xml b/samples/extensions/1-redir.xml
deleted file mode 100644
index e99f05a..0000000
--- a/samples/extensions/1-redir.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?> 
-<doc>
-  <foo file="1-redir.out">
-    Testing Redirect extension:
-    <bar>A foo subelement text node</bar>
-  </foo>
-  <main>
-    Everything else
-  </main>  
-</doc>
diff --git a/samples/extensions/1-redir.xsl b/samples/extensions/1-redir.xsl
deleted file mode 100644
index b3e69c2..0000000
--- a/samples/extensions/1-redir.xsl
+++ /dev/null
@@ -1,43 +0,0 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="1.0"
-    xmlns:lxslt="http://xml.apache.org/xslt"
-    xmlns:redirect="org.apache.xalan.lib.Redirect"
-    extension-element-prefixes="redirect">
-
-  <lxslt:component prefix="redirect" elements="write open close" functions="">
-    <lxslt:script lang="javaclass" src="org.apache.xalan.lib.Redirect"/>
-  </lxslt:component>  
-    
-  <xsl:template match="/">
-    <standard-out>
-      Standard output:
-      <xsl:apply-templates/>
-    </standard-out>
-  </xsl:template>
-
-  <!-- not redirected -->
-  <xsl:template match="doc/main">
-    <main>
-    -- look in <xsl:value-of select="/doc/foo/@file"/> for the redirected output --
-      <xsl:apply-templates/>
-    </main>
-  </xsl:template>
-  
-  <!-- redirected -->
-  <xsl:template match="doc/foo">
-    <!-- get redirect file name from XML input -->
-    <redirect:write select="@file">
-      <foo-out>
-        <xsl:apply-templates/>
-      </foo-out>
-    </redirect:write>
-  </xsl:template>
-  
-<!-- redirected (from the xsl:apply-templates above. I.e., bar is in /doc/foo -->  
-  <xsl:template match="bar">
-    <foobar-out>
-      <xsl:apply-templates/>
-    </foobar-out>
-  </xsl:template>
-  
-</xsl:stylesheet>
diff --git a/samples/extensions/2-basicJscript.xml b/samples/extensions/2-basicJscript.xml
deleted file mode 100644
index 9c66ca1..0000000
--- a/samples/extensions/2-basicJscript.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-<doc>
-  <deadline numdays="2"/>
-</doc>  
- 
\ No newline at end of file
diff --git a/samples/extensions/2-basicJscript.xsl b/samples/extensions/2-basicJscript.xsl
deleted file mode 100644
index a219cf7..0000000
--- a/samples/extensions/2-basicJscript.xsl
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<!--Namespaces are global if you set them in the stylesheet element-->
-<xsl:stylesheet 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="1.0"   
-    xmlns:lxslt="http://xml.apache.org/xslt"
-    xmlns:my-ext="ext2"
-    extension-element-prefixes="my-ext">
-    
-  <!--The component and its script are in the lxslt namespace and define the implementation-->
-  <lxslt:component prefix="my-ext" elements="timelapse" functions="getdate">
-    <lxslt:script lang="javascript">
-      var multiplier=1;
-      // Extension element implementations always take two arguments. The first
-      // argument is the XSL Processor context; the second argument is the element.
-      function timelapse(xslProcessorContext, elem)
-      {
-        multiplier=parseInt(elem.getAttribute("multiplier"));
-        // The element return value is placed in the result tree.
-        // If you do not want a return value, return null.
-        return null;
-      }
-      function getdate(numdays)
-      {
-        var d = new Date();
-        d.setDate(d.getDate() + parseInt(numdays*multiplier));
-        return d.toLocaleString();
-      }
-    </lxslt:script>
-  </lxslt:component>
-      
-  <xsl:template match="deadline">
-    <p><my-ext:timelapse multiplier="2"/>We have received your enquiry and will 
-      respond by <xsl:value-of select="my-ext:getdate(string(@numdays))"/></p>
-  </xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/3-java-namespace.xml b/samples/extensions/3-java-namespace.xml
deleted file mode 100644
index 6f2eb44..0000000
--- a/samples/extensions/3-java-namespace.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?> 
-<doc>
-   <date
-    year="2001" month="5" day="27"
-    format="EEEE, MMM dd, yyyy"/>
-</doc>
\ No newline at end of file
diff --git a/samples/extensions/3-java-namespace.xsl b/samples/extensions/3-java-namespace.xsl
deleted file mode 100644
index 45b6e59..0000000
--- a/samples/extensions/3-java-namespace.xsl
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:java="http://xml.apache.org/xslt/java"
-                version="1.0">
-                
-  <xsl:template match="/">
-    <xsl:apply-templates select="/doc/date"/> 
-  </xsl:template>
- 
-  <xsl:template match="date">
-    <xsl:variable name="year" select="string(@year)"/>
-    <xsl:variable name="month" select="string(@month)"/> 
-    <xsl:variable name="day" select="string(@day)"/>          
-    <xsl:variable name="format" select="string(@format)"/>
-    <xsl:variable name="formatter"       
-         select="java:java.text.SimpleDateFormat.new($format)"/>
-    <xsl:variable name="date" 
-         select="java:IntDate.getDate($year,$month,$day)"/>
-    <p>Date: <xsl:value-of select="java:format($formatter, $date)"/></p>
-  </xsl:template>
- 
-</xsl:stylesheet>
diff --git a/samples/extensions/4-numlistJava.xsl b/samples/extensions/4-numlistJava.xsl
deleted file mode 100644
index bff9924..0000000
--- a/samples/extensions/4-numlistJava.xsl
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:lxslt="http://xml.apache.org/xslt"
-                xmlns:counter="MyCounter"
-                extension-element-prefixes="counter"
-                version="1.0">
-
-
-  <lxslt:component prefix="counter"
-                   elements="init incr" functions="read">
-    <lxslt:script lang="javaclass" src="MyCounter"/>
-  </lxslt:component>
-
-  <xsl:template match="/">
-    <HTML>
-      <H1>Java Example</H1>
-      <counter:init name="index" value="1"/>
-      <p>Here are the names in alphabetical order by last name:</p>
-      <xsl:for-each select="doc/name">
-        <xsl:sort select="@last"/>
-        <xsl:sort select="@first"/>
-        <p>
-        <xsl:text>[</xsl:text>
-        <xsl:value-of select="counter:read('index')"/>
-        <xsl:text>]. </xsl:text>
-        <xsl:value-of select="@last"/>
-        <xsl:text>, </xsl:text>
-        <xsl:value-of select="@first"/>
-        </p>
-        <counter:incr name="index"/>
-      </xsl:for-each>
-    </HTML>
-  </xsl:template>
- 
-</xsl:stylesheet>
diff --git a/samples/extensions/5-numlistJscript.xsl b/samples/extensions/5-numlistJscript.xsl
deleted file mode 100644
index 0f351cb..0000000
--- a/samples/extensions/5-numlistJscript.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:lxslt="http://xml.apache.org/xslt"
-                xmlns:counter="MyCounter"
-                extension-element-prefixes="counter"
-                version="1.0">
-
-  <lxslt:component prefix="counter"
-                   elements="init incr" functions="read">
-    <lxslt:script lang="javascript">
-      var counters = new Array();
-
-      function init (xslproc, elem) {
-        name = elem.getAttribute ("name");
-        value = parseInt(elem.getAttribute ("value"));
-        counters[name] = value;
-        return null;
-      }
-
-      function read (name) {
-        return "" + (counters[name]);
-      }
-
-      function incr (xslproc, elem)
-      {
-        name = elem.getAttribute ("name");
-        counters[name]++;
-        return null;
-      }
-    </lxslt:script>
-  </lxslt:component>
-
-  <xsl:template match="/">
-    <HTML>
-      <H1>JavaScript Example.</H1>
-      <counter:init name="index" value="1"/>
-      <p>Here are the names in alphabetical order by last name:</p>
-      <xsl:for-each select="doc/name">
-        <xsl:sort select="@last"/>
-        <xsl:sort select="@first"/>
-        <p>
-        <xsl:text>[</xsl:text>
-        <xsl:value-of select="counter:read('index')"/>
-        <xsl:text>]. </xsl:text>
-        <xsl:value-of select="@last"/>
-        <xsl:text>, </xsl:text>
-        <xsl:value-of select="@first"/>
-        </p>
-        <counter:incr name="index"/>
-      </xsl:for-each>
-    </HTML>
-  </xsl:template>
- 
-</xsl:stylesheet>
diff --git a/samples/extensions/6-sqllib-instantdb.xsl b/samples/extensions/6-sqllib-instantdb.xsl
deleted file mode 100644
index 7e5359d..0000000
--- a/samples/extensions/6-sqllib-instantdb.xsl
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-  <xsl:output method="html" indent="yes"/>
-  <xsl:param name="query" select="'SELECT * FROM import1'"/>
- 
-  <xsl:template match="/">
-    <!-- 1. Make the connection -->
-    <xsl:variable name="products"
-                  select="sql:new('org.enhydra.instantdb.jdbc.idbDriver',
-                                'jdbc:idb:./instantdb/sample.prp')"/>
-    <HTML>
-      <HEAD>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-        <!--2. Execute the query -->
-        <xsl:variable name="table" select='sql:query($products, $query)'/>
-          <TR>
-          <!-- Get column-label attribute from each column-header-->
-          <xsl:for-each select="$table/row-set/column-header">
-            <TH><xsl:value-of select="@column-label"/></TH>
-          </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/row-set/row"/>
-          <xsl:text>&#10;</xsl:text>
-        </TABLE>
-      </BODY>
-    </HTML> 
-    <!-- 3. Close the connection -->
-    <xsl:value-of select="sql:close($products)"/>
-  </xsl:template>
-
-  <xsl:template match="row">
-        <TR>
-          <xsl:apply-templates select="col"/>
-        </TR>
-  </xsl:template>
-
-  <xsl:template match="col">
-    <TD>
-      <!-- Here is the column data -->
-      <xsl:value-of select="text()"/>
-    </TD>
-  </xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/IntDate.java b/samples/extensions/IntDate.java
deleted file mode 100644
index cc9c6c3..0000000
--- a/samples/extensions/IntDate.java
+++ /dev/null
@@ -1,17 +0,0 @@
-
-import java.util.Date;
-import java.util.Calendar;
-
-public class IntDate
-{
-  public static Date getDate(String year, String month, String day)
-    {
-      // Date(int, int, int) has been deprecated, so use Calendar to
-      // set the year, month, and day.
-      Calendar c = Calendar.getInstance();
-      // Convert each argument to int.
-      c.set(Integer.parseInt(year),Integer.parseInt(month),Integer.parseInt(day));
-      return c.getTime();
-    }
-}
-
diff --git a/samples/extensions/MyCounter.java b/samples/extensions/MyCounter.java
deleted file mode 100644
index 2b5f54a..0000000
--- a/samples/extensions/MyCounter.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.util.Hashtable;
-
-public class MyCounter {
-  static Hashtable counters = new Hashtable ();
-
-
-  public void init(org.apache.xalan.extensions.XSLProcessorContext context, 
-                   org.w3c.dom.Element elem) 
-  {
-    String name = elem.getAttribute("name");
-    String value = elem.getAttribute("value");
-    int val;
-    try 
-    {
-      val = Integer.parseInt (value);
-    } 
-    catch (NumberFormatException e) 
-    {
-      e.printStackTrace ();
-      val = 0;
-    }
-    counters.put (name, new Integer (val));
-  }
-
-  public int read(String name) 
-  { 
-    Integer cval = (Integer)counters.get(name);
-    return (cval == null) ? 0 : cval.intValue();
-  }
-
-  public void incr(org.apache.xalan.extensions.XSLProcessorContext context,  
-                   org.w3c.dom.Element elem) {
-    String name = elem.getAttribute("name");
-    Integer cval = (Integer) counters.get(name);
-    int nval = (cval == null) ? 0 : (cval.intValue () + 1);
-    counters.put (name, new Integer (nval));
-  }
-}
\ No newline at end of file
diff --git a/samples/extensions/instantdb/idb.jar b/samples/extensions/instantdb/idb.jar
deleted file mode 100644
index b501833..0000000
--- a/samples/extensions/instantdb/idb.jar
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/sample.prp b/samples/extensions/instantdb/sample.prp
deleted file mode 100644
index 9d5b246..0000000
--- a/samples/extensions/instantdb/sample.prp
+++ /dev/null
@@ -1,316 +0,0 @@
-!---------------------------------------------------------------------
-!
-! BASIC PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! Path where index tables are held. Can be absolute or relative 
-! to the properties file. Defaults to tablePath.
-!
-!indexPath=./indexes
-!
-! Path where system tables are held. Can be absolute or relative to 
-! the properties file. Defaults to tablePath.
-!
-!systemPath=./system
-!
-! Path where database tables are held. Can be absolute or relative 
-! to the properties file. Defaults to "current" directory.
-!
-tablePath=./tables
-!
-! Path where results set tables are held. Can be absolute or relative 
-! to the properties file. Defaults to tablePath.
-!
-!tmpPath=./tmp
-!
-! Non-zero means paths are relative to the properties file. 
-! Default is absolute paths for files.
-!
-relativeToProperties=1
-!
-! Alternative partitions can be defined so that tables can be placed
-! in multiple locations. Each partition is numbered: 1, 2, 3,... Tables
-! can be created on partitions using the syntax 
-!
-!   CREATE TABLE <name> ON PARTITION <number>...
-!
-! The partition count has to be supplied.
-!
-!partitionCount=2
-!
-! The locations of each partition must be supplied. These are always
-! absolute path names.
-!
-!partition1=d:/petes
-!partition2=c:/temp
-
-
-!---------------------------------------------------------------------
-!
-! TUNING PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! The amount of each column to cache, expressed either as an absolute 
-! number of rows or as a percentage figure. Defaults to 256 or 10 respectively.
-!
-! This value applies only when tables are first created. It has no effect
-! when a table is being re-opened.
-!
-cacheAmount=512
-!
-! CACHE_ROWS Must be one of CACHE_ROWS or CACHE_PERCENT. Determines whether 
-! to cache columns in tables based on an absolute number of rows, or the 
-! percentage number of rows in the table. 
-!
-! This value applies only when tables are first created. It has no effect
-! when a table is being re-opened.
-!
-cacheCondition=CACHE_ROWS
-!
-! The amount of the system tables to be cached. Defaults to 100.
-!
-! This value applies only when tables are first created. It has no effect
-! when a table is being re-opened.
-!
-!systemCacheSize=10
-!
-! Similar to cacheCondition, but applies only to the system tables.
-!
-! This value applies only when tables are first created. It has no effect
-! when a table is being re-opened.
-!
-!systemCacheCondition=CACHE_ROWS
-!
-! The percentage cache hit improvement required in order to move the 
-! cache to a new location in a column. 
-!
-! (Currently not implemented).
-!
-cacheResetPercent=10
-!
-! Non-zero means that database changes do not get written to the 
-! database immediately. See tuning.html. 
-!
-fastUpdate=0
-!
-! Percentage of free space in an index that must be present before 
-! the index reorganises itself. High values means frequent index
-! reorganisation. Low values means slow index inserts.
-!
-indexLoad=5
-!
-! The number of cache misses to include in calculations of the next 
-! base for the cache. 
-!
-! (Currently not implemented).
-!
-missesInCacheStats=100
-!
-! Non-zero means that results sets get instantiated on disk. By default
-! InstantDB holds results sets emtirely in memory (apart from Binary
-! columns). For large results sets this can be a problem. This property
-! forces all results sets to be held on disk.
-!
-resultsOnDisk=0
-!
-! Similar to cacheCondition but applies only to disk based
-! results sets. Default is CACHE_ROWS.
-!
-resultsSetCache=CACHE_ROWS
-!
-! Similar to cacheAmount but applies only to disk based
-! results sets. Default is 100.
-!
-resultsSetCacheAmount=100
-!
-! Number of rows to read into the disk read ahead buffer. 
-! Recommended to be set somewhere around 128 to 256. 
-! Default is 20.
-!
-rowCacheSize=128
-!
-! The read ahead buffer is effective at speeding up full
-! table scans. However for indexed lookups or multiple
-! simultaneous scans it is better to read a single row at
-! a time. Each table holds a small number of single row
-! buffers to improve such operations. Default is 8.
-!
-!singleRowCount=4
-!
-! Sometimes the look ahead buffer can be held by a single
-! thread even though it is not retrieveing many values from it.
-! If too many lookups retrieve data from the single row
-! buffers then it is better to flush the look ahead buffer and
-! make it available for re-use. Default is 128.
-!
-!flushAfterCacheMisses=64
-!
-! Number of rows to read ahead for system tables. By default
-! system tables cache everything, so it is wasteful to have large
-! read ahead buffers since they will very rarely be used. This
-! allows the size of the system read ahead buffers to be reduced
-! if necessary. Defaults to rowCacheSize.
-!
-!systemRows=20
-!
-! The control column in all tables normally has a large cache
-! since this speeds up all operation on that table. This can be
-! varied to either improve performance or to reduce space.
-! default is 8192.
-!
-! This value applies only when tables are first created. It has no effect
-! when a table is being re-opened.
-!
-!controlColCacheSize=512
-!
-! By default, InstantDB only does a cursory search for deleted rows during 
-! UPDATE statements. Setting searchDeletes=1 causes more detailed searches 
-! for deleted rows. This slows down UPDATE executions, but reults in more 
-! compact tables.  Default is 0.
-!
-searchDeletes=0
-!
-! The interval, in milliseconds, between checks for statement execution
-! timeouts. Default is 5000.
-!
-!timerCheck=5000
-
-!---------------------------------------------------------------------
-!
-! LOGGING AND DEBUGGING PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! Non-zero means include SQL statements in the export file. 
-!
-exportSQL=0
-!
-! Non-zero means trace output also directed to console. 
-! Defaults to 0.
-!
-traceConsole=1
-!
-! Relative or absolute path where exporting and tracing goes.
-!
-traceFile=./trace.log
-!
-! Bitmap of various items that can be traced. See debug.html. 
-! Defaults to 0.
-!
-traceLevel=2
-
-!---------------------------------------------------------------------
-!
-! TRANSACTION AND RECOVERY PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! 0 means do not perform recovery on startup.
-! 1 means perform automatic recovery
-! 2 (default) means prompt the user using standard in 
-!
-recoveryPolicy=2
-!
-! Sets the level of transaction journalling. See trans.html.
-! Defaults to 1.
-!
-! 0 - No journalling takes place.
-! 1 - Normal journalling (default).
-! 2 - Full journalling.
-!
-transLevel=1
-!
-! When doing an import, defines the number of rows imported 
-! before the transaction is committed. Recommended value 8192.
-! defaults to 100.
-!
-transImports=100
-
-!---------------------------------------------------------------------
-!
-! DATE, TIME AND CURRENCY PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! Number of digits after decimal point in currency outputs. Defaults to 2.
-!
-currencyDecimal=2
-!
-! Currency symbol used in currency outputs. Defaults to $.
-!
-currencySymbol=$
-!
-! Default format for date columns. Defaults to "yyyy-mm-dd".
-!
-dateFormat=yyyy-mm-dd
-!
-! Default format for timestamp columns. Defaults to "yyyy-mm-dd hh:mm:ss.lll".
-!
-dateTimeFormat=yyyy-mm-dd hh:mm:ss.lll
-!
-! If set, then all two digit dates less than its value are interpreted 
-! as 21st century dates. 
-!
-!milleniumBoundary=50
-!
-! Set to 1 causes the date string "now" to store a full timestamp. 
-! Default is to store only the date for fields with now hour in the 
-! format string.
-!
-nowMeansTime=0
-
-!---------------------------------------------------------------------
-!
-! STRING HANDLING PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! If set to 1 then String hashes use the JDK Object.hashCode() function.
-! By default, uses InstantDB's String hashing.
-!
-altStringHashing=0
-!
-! Set to 1 to cause LIKE clauses to always perform case insensitive 
-! comparisons. 
-!
-likeIgnoreCase=0
-!
-! Same as SET LITERAL STRICT_ON. Prevents string literals being interpreted
-! as column names or numbers. Default is 0.
-!
-strictLiterals=0
-!
-! Set this value to 1 (one) if you would like PreparedStatement.setString()
-! to ignore "\" (backslash) characters when proceesing string constants.
-! When set, InstantDB will not attempt to interpret \ as the start of an
-! escape sequence. Default is 0.
-!
-!prepareIgnoresEscapes=1
-
-!---------------------------------------------------------------------
-!
-! MISCELLANEOUS PROPERTIES
-!
-!---------------------------------------------------------------------
-
-!
-! Allows selected InstantDB keywords to be un-reserved. 
-! e.g. ignoreKeywords=url,quote would allow the keywords 
-! url and quote to be used as table or column names. 
-!
-! This faciliy is provided for compatatbility reasons only.
-! It's use is not recommended AND IS NOT SUPPORTED.
-!
-!ignoreKeywords
-!
-! Non-zero means database is opened in read only mode.
-!
-readOnly=0
diff --git a/samples/extensions/instantdb/tables/$db$types.tbl b/samples/extensions/instantdb/tables/$db$types.tbl
deleted file mode 100644
index 8e78192..0000000
--- a/samples/extensions/instantdb/tables/$db$types.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/import1.tbl b/samples/extensions/instantdb/tables/import1.tbl
deleted file mode 100644
index cb20871..0000000
--- a/samples/extensions/instantdb/tables/import1.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/sample$db$Cols$pKey.tbl b/samples/extensions/instantdb/tables/sample$db$Cols$pKey.tbl
deleted file mode 100644
index c23982a..0000000
--- a/samples/extensions/instantdb/tables/sample$db$Cols$pKey.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/sample$db$Cols.tbl b/samples/extensions/instantdb/tables/sample$db$Cols.tbl
deleted file mode 100644
index 3092d01..0000000
--- a/samples/extensions/instantdb/tables/sample$db$Cols.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/sample$db$Indexes.tbl b/samples/extensions/instantdb/tables/sample$db$Indexes.tbl
deleted file mode 100644
index 3aa1517..0000000
--- a/samples/extensions/instantdb/tables/sample$db$Indexes.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/sample$db$Tables$pKey.tbl b/samples/extensions/instantdb/tables/sample$db$Tables$pKey.tbl
deleted file mode 100644
index 28f0c09..0000000
--- a/samples/extensions/instantdb/tables/sample$db$Tables$pKey.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/sample$db$Tables.tbl b/samples/extensions/instantdb/tables/sample$db$Tables.tbl
deleted file mode 100644
index 744194d..0000000
--- a/samples/extensions/instantdb/tables/sample$db$Tables.tbl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/instantdb/tables/sample.jrl b/samples/extensions/instantdb/tables/sample.jrl
deleted file mode 100644
index 78bef4f..0000000
--- a/samples/extensions/instantdb/tables/sample.jrl
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/numlist.xml b/samples/extensions/numlist.xml
deleted file mode 100644
index 76d41c2..0000000
--- a/samples/extensions/numlist.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<doc>
-  <name first="Sanjiva" last="Weerawarana"/>
-  <name first="Joseph" last="Kesselman"/>
-  <name first="Stephen" last="Auriemma"/>
-  <name first="Igor" last="Belakovskiy"/>    
-  <name first="David" last="Marston"/>
-  <name first="David" last="Bertoni"/>
-  <name first="Donald" last="Leslie"/>
-  <name first="Emily" last="Farmer"/>
-  <name first="Myriam" last="Midy"/>
-  <name first="Paul" last="Dick"/>
-  <name first="Scott" last="Boag"/>
-  <name first="Shane" last="Curcuru"/>
-  <name first="Marcia" last="Hoffman"/>
-  <name first="Noah" last="Mendelsohn"/>
-  <name first="Alex" last="Morrow"/>    
-</doc>
\ No newline at end of file
diff --git a/samples/extensions/readme.html b/samples/extensions/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/extensions/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/Xalan SQL Extension.doc b/samples/extensions/sql/Xalan SQL Extension.doc
deleted file mode 100644
index 6aa566d..0000000
--- a/samples/extensions/sql/Xalan SQL Extension.doc
+++ /dev/null
Binary files differ
diff --git a/samples/extensions/sql/Xalan SQL Extension.htm b/samples/extensions/sql/Xalan SQL Extension.htm
deleted file mode 100644
index 31abf3d..0000000
--- a/samples/extensions/sql/Xalan SQL Extension.htm
+++ /dev/null
@@ -1,161 +0,0 @@
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
-<META NAME="Generator" CONTENT="Microsoft Word 97">
-<TITLE>Xalan SQL Extension</TITLE>
-</HEAD>
-<BODY LINK="#0000ff" VLINK="#800080">
-
-<B><FONT FACE="Arial" SIZE=5><P ALIGN="CENTER"><A NAME="_Toc509062553">Xalan SQL Extension</A></P>
-<P ALIGN="CENTER"><A NAME="_Toc509062554">Connections and Queries</A></P>
-</FONT><FONT SIZE=2><P>Database Connections&#9;</B></FONT><A HREF="#_Toc509119435">*</A><DIR>
-
-<FONT SIZE=2><P>Providing Connection information in the XSL File&#9;</FONT><A HREF="#_Toc509119436">*</A></P>
-<I><FONT SIZE=2><P>XConnection(Sring DBDriver, String DBurl)&#9;</I></FONT><A HREF="#_Toc509119437">*</A></P>
-<I><FONT SIZE=2><P>XConnection(String DBDriver, String DBurl, String User, String Password)&#9;</I></FONT><A HREF="#_Toc509119438">*</A></P>
-<I><FONT SIZE=2><P>XConnection(String DBDriver, String DBurl, NodeList Properties)&#9;</I></FONT><A HREF="#_Toc509119439">*</A></P>
-<FONT SIZE=2><P>Providing Connection information in the XML File&#9;</FONT><A HREF="#_Toc509119440">*</A></P>
-<I><FONT SIZE=2><P>XConnection(NodeList ConnectionData)&#9;</I></FONT><A HREF="#_Toc509119441">*</A></P>
-<FONT SIZE=2><P>Using Existing Connections in a connection pool&#9;</FONT><A HREF="#_Toc509119442">*</A></P>
-<I><FONT SIZE=2><P>XConnection(String ConnectionName)&#9;</I></FONT><A HREF="#_Toc509119443">*</A></P></DIR>
-
-<B><FONT SIZE=2><P>Connection Pools&#9;</B></FONT><A HREF="#_Toc509119444">*</A></P><DIR>
-
-<FONT SIZE=2><P>Overview&#9;</FONT><A HREF="#_Toc509119445">*</A></P>
-<FONT SIZE=2><P>Creating a new wrapper&#9;</FONT><A HREF="#_Toc509119446">*</A></P>
-<FONT SIZE=2><P>The Default Connection Pool&#9;</FONT><A HREF="#_Toc509119447">*</A></P></DIR>
-
-<B><FONT SIZE=2><P>Queries&#9;</B></FONT><A HREF="#_Toc509119448">*</A></P><DIR>
-
-<FONT SIZE=2><P>Standard queries&#9;</FONT><A HREF="#_Toc509119449">*</A></P>
-<FONT SIZE=2><P>Parameter based queries&#9;</FONT><A HREF="#_Toc509119450">*</A></P>
-<I><FONT SIZE=2><P>Overview&#9;</I></FONT><A HREF="#_Toc509119451">*</A></P>
-<I><FONT SIZE=2><P>Handling Value and Type Information&#9;</I></FONT><A HREF="#_Toc509119452">*</A></P></DIR>
-
-<B><FONT SIZE=2><P>Examples&#9;</B></FONT><A HREF="#_Toc509119453">*</A></P><DIR>
-
-<FONT SIZE=2><P>Basic&#9;</FONT><A HREF="#_Toc509119454">*</A></P>
-<FONT SIZE=2><P>External Connections&#9;</FONT><A HREF="#_Toc509119455">*</A></P>
-<FONT SIZE=2><P>PQuery&#9;</FONT><A HREF="#_Toc509119456">*</A></P>
-<FONT SIZE=2></DIR>
-</P>
-</FONT><B><FONT FACE="Arial" SIZE=4><P><A NAME="_Toc509062555"><A NAME="_Toc509119435">Database Connection</A>s</A></P><DIR>
-
-</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The SQL Extension provides 2 basic mechanisms to connect to the database. The connection information can either be provided in the XSL/XML or pulled from a Connection Pool that was created outside the Xalan library.</P>
-<P ALIGN="JUSTIFY">The XConnection object is used to represent a connection to the database. The actual connection is established through the object constructor. Each of the different mechanisms differs with the signature of the extension.</P>
-<P ALIGN="JUSTIFY">When the connection information is provided in the XSL or XML sources, a default connection pool will be created on its behalf but due to restrictions in some drivers, the actual pooling of connections will disabled by default. See Connection Pools, The Default Connection Pool.</P>
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119436">Providing Connection information in the XSL File</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">When providing Connection Information from the XSL or XML input sources, the XConnection object will create a default connection pool that will exist for the lifetime of the Transformation object.</P>
-</FONT><FONT FACE="Arial"><P><A NAME="_Toc509119437">XConnection(Sring DBDriver, String DBurl)</A></P>
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Create a standard JDBC connection using the specified driver and URL. This is used primarily for local databases that do not return user identification.</P>
-</FONT><FONT FACE="Arial"><P><A NAME="_Toc509119438">XConnection(String DBDriver, String DBurl, String User, String Password)</A></P><DIR>
-
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Create a standard JDBC Connection, which also provides user identification.</P></DIR>
-
-</FONT><FONT FACE="Arial"><P><A NAME="_Toc509119439">XConnection(String DBDriver, String DBurl, NodeList Properties)</A></P><DIR>
-
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Create a standard JDBC connection that loads the database driver using the specified URL. The NodeList provides will then be converted into a properties object which will be passes in when getting the JDBC connection.</P></DIR>
-</DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119440">Providing Connection information in the XML File</A></P><DIR>
-
-</B></I><P><A NAME="_Toc509119441">XConnection(NodeList ConnectionData)</A></P><DIR>
-
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Create connection and pass in the complete connection information as a Nodelist. This allows the XML data to provide the connection information. The node list will be used to create a named value pair list where the Node Name will represent the name and the Node Value will be the value. Required Tags consist of &quot;dbdriver&quot; and &quot;dburl&quot;. Optional tags can include &quot;user&quot; and &quot;password&quot; to specify the user identification but can also include any other database connection property.</P></DIR>
-</DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119442">Using Existing Connections in a connection pool</A></P><DIR>
-
-</B></I><P><A NAME="_Toc509119443">XConnection(String ConnectionName)</A></P><DIR>
-
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The Xalan SQL Extensions allows the controlling program to create an external JDBC Connection Pool and reference the connection pools by name inside the Stylsheet. Besides providing a mechanism to share connection resources with Xalan, is also allows the Stylesheet to not be concerned with the Connection properties all together.</P></DIR>
-</DIR>
-</DIR>
-
-</FONT><B><FONT FACE="Arial" SIZE=4><P><A NAME="_Toc509119444">Connection Pools</A></P><DIR>
-
-</FONT><I><FONT FACE="Arial"><P><A NAME="_Toc509119445">Overview</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Connection pools allow the Xalan Transformer to share connections with the rest of the application. Any existing JDBC Connection pool should be compatible with the Xalan Transformer by creating a wrapper class around the specific connection pool and registering it with the XConnectionPoolManager.</P></DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119446">Creating a new wrapper</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The org.apache.xalan.lib.sql.connection is the interface that needs to be implemented be compatible with the Xalan Transformer.</P></DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119447">The Default Connection Pool</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">To provide a uniform internal programming model, the XConnection object will create an instance of the DefaultConnectionPool. By default the Default Connection Pool will</P></DIR>
-</DIR>
-
-</FONT><B><FONT FACE="Arial" SIZE=4><P><A NAME="_Toc509119448">Queries</A></P><DIR>
-
-</FONT><I><FONT FACE="Arial"><P><A NAME="_Toc509119449">Standard queries</A></P><DIR>
-<DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">query(XConnection conn, String SQL)</P>
-<P ALIGN="JUSTIFY">Standard queries take a connection as arguments, an XConnection and the SQL String. It is the responsibility of the Stylesheet designer to format the SQL String completely including any quotes that are necessary. For static queries this is fine because the sting can be assembled at design time.</P></DIR>
-</DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119450">Parameter based queries</A></P><DIR>
-
-</B></I><P><A NAME="_Toc509119451">Overview</A></P><DIR>
-
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Parameter based queries are used when data that dynamically changes the query needs to be supplied from the XML Data.</P>
-<P ALIGN="JUSTIFY">The Stylesheet will provide the skeleton template of the query with place holders where the data goes, then provides several mechanisms to apply that data from the XML Data.</P>
-<P ALIGN="JUSTIFY">Parameter based queries take advantage of the JDBC Prepared statement semantics.</P></DIR>
-
-</FONT><FONT FACE="Arial"><P><A NAME="_Toc509119452">Handling Value and Type Information</A></P><DIR>
-
-</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">When using parameterized query the place markers in the query (a &quot;?&quot;) will be replaced with data that is provided using one of the addParameter.. methods. When adding data to a parameter based query, the type of each value must also be included so that real query can be produced. The type information can be passed in as a component of the Query or the Data which ever is more convenient to the Stylesheet designer. </P>
-<P ALIGN="JUSTIFY">If the type information is missing for a data point, the default type is set to String.</P>
-<P ALIGN="JUSTIFY">The list of possible value types include, string,  bigdecimal, boolean, bytes, date, double, float, long, short, time, timestamp.</P></DIR>
-
-</FONT><B><FONT FACE="Arial"><P>pquery(XConnection, query)</P><DIR>
-
-</B></FONT><FONT SIZE=2><P>When just the query statement is passed as a parameter, the Type information must be passed in as a component of the data. </P></DIR>
-
-</FONT><B><FONT FACE="Arial"><P>pquery(XConnection, query, typeinfo)</P><DIR>
-
-</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">This allows the query to be specified using the &quot;?&quot; place holders and defining the type for each of the placeholders as a comma separated value string. i.e. &quot;string,int,string,datetime&quot;</P></DIR>
-
-</FONT><B><FONT FACE="Arial"><P>addParameter(XConnection, value)</P><DIR>
-
-</B></FONT><FONT SIZE=2><P>Add a new value to be used with a pquery, each new value is appended to a list that will be merged into the query statement when the pquery statement is executed. All data points must be added prior to executing the pquery statement.</P></DIR>
-
-</FONT><B><FONT FACE="Arial"><P>addParameterWithType(XConnection, value,type)</P><DIR>
-
-</B></FONT><FONT SIZE=2><P>Add a new value specifying the type information also.</P></DIR>
-
-</FONT><B><FONT FACE="Arial"><P>addParameterFromElement(XConnection, NodeList)</P><DIR>
-
-</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">Add a block of data points from a node list queried from the XML Data Source.  Each tag name at the START_TAG and TAG1 level are irrelevant, the only significant information is the value and possibly the type attribute.</P>
-<P ALIGN="JUSTIFY">If the type attribute is present, it will set the current type. If the type information is missing, it will either be provide through one of the other mechanisms or default to a string.</P>
-<P ALIGN="JUSTIFY">&lt;START_TAG&gt;</P>
-<P ALIGN="JUSTIFY">  &lt;TAG1&gt; type=&quot;int&quot;&gt;value&lt;/TAG1&gt;</P>
-<P ALIGN="JUSTIFY">&lt;/START_TAG</P>
-<P ALIGN="JUSTIFY"></P>
-<P ALIGN="JUSTIFY">Typical implementation </P>
-<P ALIGN="JUSTIFY">&lt;xsl:param name=&quot;plist&quot; select=&quot;/START_TAG&quot; /&gt;</P>
-<P ALIGN="JUSTIFY">&lt;xsl:addParameterFromElement( $conn, $plist);</P></DIR>
-</DIR>
-</DIR>
-
-</FONT><B><FONT FACE="Arial" SIZE=4><P><A NAME="_Toc509119453">Examples</A></P><DIR>
-
-</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">All of the following examples use the Enhydra InstantDB which is included as part of the Xalan distribution to operate. Please read the Enhydra documentation on managing an InstantDB http://www.instantdb.co.uk/</P>
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119454">Basic</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The XML/XSL Files (dbinfo.xml and dbtest.xsl) provide an example of implementing a basic connection where the connection information is provided in the XSL file using a static query.</P>
-<P ALIGN="JUSTIFY">The XML/XSL Files (dbinfo.xml and dbtest-cinfo.xsl) provide an example of implementing a basic connection where the connection information is provided as a node list in the XML file using a static query.</P></DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119455">External Connections</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The java file ExternalConnection demonstrates how to build a JDBC connection pool that is independent of Xalan. The actual connection pool used is the Default Connection pool inside the Xalan SQL Extension, which already implements the ConnectionPool interface so no wrapper was required. To implement a third party connection pool, a wrapper function must be implemented.</P></DIR>
-
-</FONT><B><I><FONT FACE="Arial"><P><A NAME="_Toc509119456">PQuery</A></P><DIR>
-
-</B></I></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The XML/XSL file (dbInfo.xml and dbtest.xsl) provide an example of implementing a parameter based query.</P></DIR>
-</DIR>
-</FONT></BODY>
-</HTML>
diff --git a/samples/extensions/sql/basic-connection/DumpSQL.xsl b/samples/extensions/sql/basic-connection/DumpSQL.xsl
deleted file mode 100755
index 14d6caa..0000000
--- a/samples/extensions/sql/basic-connection/DumpSQL.xsl
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new($driver, $datasource)"/>
-    <xsl:variable name="table" select='sql:query($db, $query)'/>
-    <xsl:copy-of select="$table" />
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/basic-connection/dbinfo.xml b/samples/extensions/sql/basic-connection/dbinfo.xml
deleted file mode 100755
index 19e640f..0000000
--- a/samples/extensions/sql/basic-connection/dbinfo.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<dbtest>
- <description>This file contains information required to make a connection to the DBMS</description>
-
- <DBINFO>
-   <dbdriver>org.enhydra.instantdb.jdbc.idbDriver</dbdriver>
-   <dburl>jdbc:idb:../../instantdb/sample.prp</dburl>
-   <user />
-   <password/>
- </DBINFO>
- 
-
-</dbtest>
diff --git a/samples/extensions/sql/basic-connection/dbtest-cinfo.xsl b/samples/extensions/sql/basic-connection/dbtest-cinfo.xsl
deleted file mode 100755
index fcdcc7f..0000000
--- a/samples/extensions/sql/basic-connection/dbtest-cinfo.xsl
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="cinfo" select="//DBINFO"/>
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new()"/>
-
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $cinfo))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-          <xsl:variable name="table" select='sql:query($db, $query)'/>
-          
-          <!-- 
-          	Let's include Error Checking, the error is actually stored 
-            in the connection since $table will be either data or null
-          -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          
-          <TR>
-             <xsl:for-each select="$table/sql/metadaata/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/sql/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/basic-connection/dbtest.xsl b/samples/extensions/sql/basic-connection/dbtest.xsl
deleted file mode 100755
index fe17ebb..0000000
--- a/samples/extensions/sql/basic-connection/dbtest.xsl
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-          <xsl:variable name="table" select='sql:query($db, $query)'/>
-          
-          <!-- 
-          	Let's include Error Checking, the error is actually stored 
-            in the connection since $table will be either data or null
-          -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          <TR>
-             <xsl:for-each select="$table/sql/metadata/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/sql/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/basic-connection/readme.html b/samples/extensions/sql/basic-connection/readme.html
deleted file mode 100644
index 5f9d69e..0000000
--- a/samples/extensions/sql/basic-connection/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/ext-connection/ExternalConnection.java b/samples/extensions/sql/ext-connection/ExternalConnection.java
deleted file mode 100755
index 47eac80..0000000
--- a/samples/extensions/sql/ext-connection/ExternalConnection.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-import org.apache.xalan.lib.sql.DefaultConnectionPool;
-import org.apache.xalan.lib.sql.ConnectionPoolManager;
-
-
-// Imported java classes
-import java.io.StringReader;
-import java.io.FileOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-/**
- *  Use the TraX interface to perform a transformation in the simplest manner possible
- *  (3 statements).
- */
-public class ExternalConnection
-{
-	public static void main(String[] args)
-    throws TransformerException, TransformerConfigurationException,
-           FileNotFoundException, IOException
-  {
-
-  // Create a connection to the database server
-  // Up the connection pool count for testing
-  DefaultConnectionPool cp = new DefaultConnectionPool();
-  cp.setDriver("org.enhydra.instantdb.jdbc.idbDriver");
-  cp.setURL("jdbc:idb:../../instantdb/sample.prp");
-  //cp.setUser("sa");
-  //cp.setPassword("");
-  cp.setMinConnections(10);
-  cp.setPoolEnabled(true);
-
-  // Now let's register our connection pool so we can use
-  // in a stylesheet
-  ConnectionPoolManager pm = new ConnectionPoolManager();
-  pm.registerPool("extpool", cp);
-
-
-  // Use the static TransformerFactory.newInstance() method to instantiate
-  // a TransformerFactory. The javax.xml.transform.TransformerFactory
-  // system property setting determines the actual class to instantiate --
-  // org.apache.xalan.transformer.TransformerImpl.
-	TransformerFactory tFactory = TransformerFactory.newInstance();
-
-	// Use the TransformerFactory to instantiate a Transformer that will work with
-	// the stylesheet you specify. This method call also processes the stylesheet
-  // into a compiled Templates object.
-	Transformer transformer = tFactory.newTransformer(
-        new StreamSource("dbtest.xsl"));
-
-	// For this transformation, all the required information is in the stylesheet, so generate 
-  // a minimal XML source document for the input.
-  // Note: the command-line processor (org.apache.xalan.xslt.Process) uses this strategy when 
-  // the user does not provide an -IN parameter.
-  StringReader reader =
-              new StringReader("<?xml version=\"1.0\"?> <doc/>");
-
-  // Use the Transformer to apply the associated Templates object to an XML document
-	// and write the output to a file.
-	transformer.transform(
-        new StreamSource(reader),
-        new StreamResult(new FileOutputStream("dbtest-out.html")));
-
-	System.out.println("************* The result is in dbtest-out.html *************");
-  
-  cp.setPoolEnabled(false);
-  }
-}
diff --git a/samples/extensions/sql/ext-connection/dbtest.xsl b/samples/extensions/sql/ext-connection/dbtest.xsl
deleted file mode 100755
index a33dd57..0000000
--- a/samples/extensions/sql/ext-connection/dbtest.xsl
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new()"/>
-
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, 'extpool'))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-          <xsl:variable name="table" select='sql:query($db, $query)'/>
-          
-          <!-- 
-          	Let's include Error Checking, the error is actually stored 
-            in the connection since $table will be either data or null
-          -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          <TR>
-             <xsl:for-each select="$table/sql/metadata/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/sql/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/ext-connection/readme.html b/samples/extensions/sql/ext-connection/readme.html
deleted file mode 100644
index 5f9d69e..0000000
--- a/samples/extensions/sql/ext-connection/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/pquery/dbinfo.xml b/samples/extensions/sql/pquery/dbinfo.xml
deleted file mode 100755
index c4bf245..0000000
--- a/samples/extensions/sql/pquery/dbinfo.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<XMLSTORE>
-
- <QUERY>
-   <ProductID>1</ProductID>
- </QUERY>
-  
- <DBINFO>
-   <dbdriver>org.enhydra.instantdb.jdbc.idbDriver</dbdriver>
-   <dburl>jdbc:idb:../../instantdb/sample.prp</dburl>
-   <user/>
-   <password/>
- </DBINFO>
-
-</XMLSTORE>
diff --git a/samples/extensions/sql/pquery/dbtest.xsl b/samples/extensions/sql/pquery/dbtest.xsl
deleted file mode 100755
index 88534b2..0000000
--- a/samples/extensions/sql/pquery/dbtest.xsl
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<!-- Build a Parameter Type Query -->
-<xsl:param name="q1" select="'SELECT * FROM import1 where ProductID = ?'"/>
-
-<!-- Build a CSV list of parameter types -->
-<xsl:param name="q1type" select="int" />
-
-<!-- Pull out connection information from the Document Source -->
-<xsl:param name="cinfo" select="//DBINFO" />
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $cinfo))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-          <xsl:variable name="qparam" select="//QUERY"/>
-          <xsl:value-of select="sql:addParameterFromElement($db, $qparam)"/>
-
-          <xsl:variable name="table" select='sql:pquery($db, $q1, $q1type )'/>
-          
-          <!-- 
-          	Let's include Error Checking, the error is actually stored 
-            in the connection since $table will be either data or null
-          -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          
-          <TR>
-             <xsl:for-each select="$table/sql/metadata/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/sql/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/samples/extensions/sql/pquery/readme.html b/samples/extensions/sql/pquery/readme.html
deleted file mode 100644
index 5f9d69e..0000000
--- a/samples/extensions/sql/pquery/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/readme.html b/samples/extensions/sql/readme.html
deleted file mode 100644
index 4f598d0..0000000
--- a/samples/extensions/sql/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/show-error/dbinfo.xml b/samples/extensions/sql/show-error/dbinfo.xml
deleted file mode 100755
index c4bf245..0000000
--- a/samples/extensions/sql/show-error/dbinfo.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<XMLSTORE>
-
- <QUERY>
-   <ProductID>1</ProductID>
- </QUERY>
-  
- <DBINFO>
-   <dbdriver>org.enhydra.instantdb.jdbc.idbDriver</dbdriver>
-   <dburl>jdbc:idb:../../instantdb/sample.prp</dburl>
-   <user/>
-   <password/>
- </DBINFO>
-
-</XMLSTORE>
diff --git a/samples/extensions/sql/show-error/invalidConn.xsl b/samples/extensions/sql/show-error/invalidConn.xsl
deleted file mode 100755
index dc8da29..0000000
--- a/samples/extensions/sql/show-error/invalidConn.xsl
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"                version="1.0"                xmlns:sql="org.apache.xalan.lib.sql.XConnection"                extension-element-prefixes="sql"><xsl:output method="html" indent="yes"/><xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/><!-- ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR         We are specifying a database that does not exist,                which will cause a connection errorERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR--><xsl:param name="datasource" select="'jdbc:idb:../../instantdb/DoesNotExist.prp'"/><xsl:param name="query" select="'SELECT * FROM import2'"/><xsl:template match="/">        <xsl:variable name="db" select="sql:new()"/>        <!-- Connect to the database with minimal error detection -->		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >    	<xsl:message>Error Connecting to the Database</xsl:message>      <xsl:copy-of select="sql:getError($db)/ext-error" />    </xsl:if>        <HTML>      <HEAD>        <TITLE>List of products</TITLE>      </HEAD>      <BODY>        <TABLE border="1">          <xsl:variable name="table" select='sql:query($db, $query)'/>                    <!--           	Let's include Error Checking, the error is actually stored             in the connection since $table will be either data or null          -->                       <xsl:if test="not($table)" >          	<xsl:message>Error in Query</xsl:message>            <xsl:copy-of select="sql:getError($db)/ext-error" />          </xsl:if>                    <TR>             <xsl:for-each select="$table/row-set/column-header">               <TH><xsl:value-of select="@column-label"/></TH>             </xsl:for-each>          </TR>          <xsl:apply-templates select="$table/row-set/row"/>        </TABLE>      </BODY>    </HTML>    <xsl:value-of select="sql:close($db)"/></xsl:template><xsl:template match="row">  <TR><xsl:apply-templates select="col"/></TR></xsl:template><xsl:template match="col">  <TD><xsl:value-of select="text()"/></TD></xsl:template></xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/show-error/invalidPQuery.xsl b/samples/extensions/sql/show-error/invalidPQuery.xsl
deleted file mode 100755
index c1905b2..0000000
--- a/samples/extensions/sql/show-error/invalidPQuery.xsl
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-
-
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-
-
-<xsl:param name="query" select="'SELECT * FROM import1 where ProductID = ?'"/>
-
-<xsl:template match="/">
-    
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-        
-<!-- 
-ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
-   We are specifying an extra value where are query only expects one
-ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
--->
-
-          <xsl:value-of select="sql:clearParameters()"/>
-          <xsl:value-of select="sql:addParameterWithType($db, '1', 'short')"/>
-          <xsl:value-of select="sql:addParameterWithType($db, '1', 'short')"/>
-          <xsl:variable name="table" select='sql:pquery($db, $query)'/>
-          
-          <!-- 
-          	Let's include Error Checking, the error is actually stored 
-            in the connection since $table will be either data or null
-          -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          <TR>
-             <xsl:for-each select="$table/sql/metadata/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/sql/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/show-error/invalidQuery.xsl b/samples/extensions/sql/show-error/invalidQuery.xsl
deleted file mode 100755
index 9181e40..0000000
--- a/samples/extensions/sql/show-error/invalidQuery.xsl
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-
-
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-
-<!-- 
-ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
-              We will specify a table that does not exist
-              in our Database, causing the Query to Fail
-ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
--->
-
-
-<xsl:param name="query" select="'SELECT * FROM TableNotDefined'"/>
-
-<xsl:template match="/">
-    
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-          <xsl:variable name="table" select='sql:query($db, $query)'/>
-          
-          <!-- 
-          	Let's include Error Checking, the error is actually stored 
-            in the connection since $table will be either data or null
-          -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          <TR>
-             <xsl:for-each select="$table/sql/metadata/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/sql/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/show-error/readme.html b/samples/extensions/sql/show-error/readme.html
deleted file mode 100644
index 5f9d69e..0000000
--- a/samples/extensions/sql/show-error/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/streamable/cachedNodes.xsl b/samples/extensions/sql/streamable/cachedNodes.xsl
deleted file mode 100644
index f83de30..0000000
--- a/samples/extensions/sql/streamable/cachedNodes.xsl
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-        	<xsl:value-of select="sql:disableStreamingMode($db)" />
-          <xsl:variable name="table" select='sql:query($db, $query)'/>
-      
-      <!-- 
-        	Let's include Error Checking, the error is actually stored 
-          in the connection since $table will be either data or null
-       -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-          <TR>
-             <xsl:for-each select="$table/row-set/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/streamable/dbinfo.xml b/samples/extensions/sql/streamable/dbinfo.xml
deleted file mode 100755
index 19e640f..0000000
--- a/samples/extensions/sql/streamable/dbinfo.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<dbtest>
- <description>This file contains information required to make a connection to the DBMS</description>
-
- <DBINFO>
-   <dbdriver>org.enhydra.instantdb.jdbc.idbDriver</dbdriver>
-   <dburl>jdbc:idb:../../instantdb/sample.prp</dburl>
-   <user />
-   <password/>
- </DBINFO>
- 
-
-</dbtest>
diff --git a/samples/extensions/sql/streamable/pivot.xsl b/samples/extensions/sql/streamable/pivot.xsl
deleted file mode 100644
index 7972098..0000000
--- a/samples/extensions/sql/streamable/pivot.xsl
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-      
-      <!-- Turn off Streaming -->
-      <xsl:value-of select="sql:disableStreamingMode()" />
-      
-      <xsl:variable name="table" select='sql:query($db, $query)'/>
-      
-      <!-- 
-        	Let's include Error Checking, the error is actually stored 
-          in the connection since $table will be either data or null
-       -->
-             
-          <xsl:if test="not($table)" >
-          	<xsl:message>Error in Query</xsl:message>
-            <xsl:copy-of select="sql:getError($db)/ext-error" />
-          </xsl:if>
-          
-      
-      
-        <TABLE border="1">
-          <TR>
-             <xsl:for-each select="$table/row-set/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/row-set/row"/>
-        </TABLE>
-        
-        <TABLE border="1">
-
-        <xsl:for-each select="$table/row-set/column-header">
-        <xsl:variable name="column" select="@column-label" />
-
-        	<TR>
-          	<TD><TH><xsl:value-of select="$column"/></TH></TD>
-            	<xsl:apply-templates
-               	select="$table/row-set/row/col[@column-label=$column]" />
-          </TR>
-          </xsl:for-each>
-
-        </TABLE>
-       
-        
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/extensions/sql/streamable/readme.html b/samples/extensions/sql/streamable/readme.html
deleted file mode 100644
index 5f9d69e..0000000
--- a/samples/extensions/sql/streamable/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/extensions/sql/streamable/streamNodes.xsl b/samples/extensions/sql/streamable/streamNodes.xsl
deleted file mode 100644
index a37a1af..0000000
--- a/samples/extensions/sql/streamable/streamNodes.xsl
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql">
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/>
-<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
-<xsl:param name="query" select="'SELECT * FROM import1'"/>
-
-<xsl:template match="/">
-    <xsl:variable name="db" select="sql:new()"/>
-    
-    <!-- Connect to the database with minimal error detection -->
-		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
-    	<xsl:message>Error Connecting to the Database</xsl:message>
-      <xsl:copy-of select="sql:getError($db)/ext-error" />
-    </xsl:if>
-    
-
-    <HTML>
-      <HEAD>
-        <TITLE>List of products</TITLE>
-      </HEAD>
-      <BODY>
-        <TABLE border="1">
-        	<xsl:value-of select="sql:enableStreamingMode($db)" />
-          <xsl:variable name="table" select='sql:query($db, $query)'/>
-          <TR>
-             <xsl:for-each select="$table/row-set/column-header">
-               <TH><xsl:value-of select="@column-label"/></TH>
-             </xsl:for-each>
-          </TR>
-          <xsl:apply-templates select="$table/row-set/row"/>
-        </TABLE>
-      </BODY>
-    </HTML>
-    <xsl:value-of select="sql:close($db)"/>
-</xsl:template>
-
-<xsl:template match="row">
-  <TR><xsl:apply-templates select="col"/></TR>
-</xsl:template>
-
-<xsl:template match="col">
-  <TD><xsl:value-of select="text()"/></TD>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/servlet/ApplyXSLT.java b/samples/servlet/ApplyXSLT.java
deleted file mode 100644
index c235a84..0000000
--- a/samples/servlet/ApplyXSLT.java
+++ /dev/null
@@ -1,963 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package servlet;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.net.URLConnection;
-import javax.xml.transform.OutputKeys;
-
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.OutputProperties;
-// SAX2 Imports
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-import org.w3c.dom.*;
-import javax.xml.transform.*;
-import javax.xml.transform.stream.*;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xalan.processor.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.helpers.XMLFilterImpl;
-
-/*****************************************************************************************************
- *
- * ApplyXSLT supplies the basic
- * functions for transforming XML data using XSL stylesheets.
- *
- * @author Spencer Shepard (sshepard@us.ibm.com)
- * @author R. Adam King (rak@us.ibm.com)
- * @author Tom Rowe (trowe@us.ibm.com)
- * @author Don Leslie (donald_leslie@lotus.com)
- *
- *****************************************************************************************************/
-
-public class ApplyXSLT extends HttpServlet
-{
-
-  /**
-   * Operational parameters for this class.
-   * <p>Request-time values override init-time values which override class defaults.</p>
-   * @see #init
-   * @serial
-   */
-  protected ApplyXSLTProperties ourDefaultParameters = null;
-  private boolean useDefaultTemplates = false;
-  private Templates defaultTemplates = null;
-
-  /**
-   * String representing the end of line characters for the System.
-   */
-  public final static String EOL = System.getProperty("line.separator");
-
-  /**
-   * String representing the file separator characters for the System.
-   */
-  public final static String FS = System.getProperty("file.separator");
-
-   /**
-   * String representing the current directory for properties files. See init().
-   */
-  public final static String ROOT = System.getProperty("server.root");
-  public static String CURRENTDIR;
-
-  /**
-   * Initialize operational parameters from the configuration.
-   * @param config Configuration
-   * @exception ServletException Never thrown
-   */
-  public void init(ServletConfig config)
-    throws ServletException
-  {
-    super.init(config);
-    // If the server.root property --see above-- is null, use current working directory
-    // as default location for media.properties.
-    if (ROOT != null)
-      CURRENTDIR= ROOT + FS + "servlets" + FS;
-    else
-      CURRENTDIR = System.getProperty("user.dir")+ FS;
-    
-	  setDefaultParameters(config);
-	
-    setMediaProps(config.getInitParameter("mediaURL"));
-    String defaultXSL = config.getInitParameter("xslURL");
-    try
-    {
-    if (defaultXSL !=null && defaultXSL.length() > 0)
-      compileXSL(defaultXSL);
-    }
-    catch (Exception e){}
-  }
-  
- /**
-  * If a default setting exists for xslURL, create a Templates object
-  * for rapid transformations.
-  */ 
-  protected void compileXSL(String defaultXSL)
-    throws TransformerConfigurationException
-  {
-    TransformerFactory tFactory = TransformerFactory.newInstance();
-    defaultTemplates = tFactory.newTemplates(new StreamSource(defaultXSL));
-    useDefaultTemplates = true;
-  }
-  
- /**
-   * Sets the default parameters for the servlet from the configuration.
-   * Also sets required system properties until we figure out why servlet 
-   * sometimess fails to read properties from properties files.
-   * @param config Configuration
-   */
-  protected void setDefaultParameters(ServletConfig config)
-  {
-    ourDefaultParameters = new DefaultApplyXSLTProperties(config);
-  }
-  
-  /**
-   *	Loads the media properties file specified by the given string.
-   * @param mediaURLstring Location of the media properties file.  Can be either a full URL or a path relative
-   * to the System's server.root /servlets directory.  If this parameter is null,
-   * server.root/servlets/media.properties will be used.
-   * @see ApplyXSL#CURRENTDIR
-   */
-  protected void setMediaProps(String mediaURLstring)
-  {
-    if (mediaURLstring != null)
-    {
-      URL url = null;
-      try
-      {
-        url = new URL(mediaURLstring);
-      }
-      catch (MalformedURLException mue1)
-      {
-        try
-        {
-          url = new URL("file", "", CURRENTDIR + mediaURLstring);
-        }
-        catch (MalformedURLException mue2)
-        {
-          writeLog("Unable to find the media properties file based on parameter 'mediaURL' = "
-                   + mediaURLstring, HttpServletResponse.SC_ACCEPTED, mue2);
-          url = null;
-        }
-      }
-      if (url != null)
-      {
-        try
-        {
-          ourMediaProps = new OrderedProps(url.openStream());
-        }
-        catch (IOException ioe1)
-        {
-          writeLog("Exception occurred while opening media properties file: " + mediaURLstring +
-                   ".  Media table may be invalid.", HttpServletResponse.SC_ACCEPTED, ioe1);
-        }
-      }
-    }
-    else
-    {
-      String defaultProp = CURRENTDIR + "media.properties";
-      try
-      {
-        ourMediaProps = new OrderedProps(new FileInputStream(defaultProp));
-      }
-      catch (IOException ioe2)
-      {
-        writeLog("Default media properties file " + defaultProp + " not found.",
-                 HttpServletResponse.SC_ACCEPTED, ioe2);
-      }
-    }
-  }
-
-  public String getMedia(HttpServletRequest request)
-  {
-    return ourMediaProps.getValue(request.getHeader(HEADER_NAME));
-  }
-  
-  // doPost removed for security reasons due to the possibility of sending
-  // unsecure XML and XSL XSLTInputSources through the request input stream
-
-  /**
-   * HTTP Get method passed on to process().
-   * @param request The request
-   * @param response The response
-   * @see #process
-   * @exception ServletException Never thrown
-   * @exception IOException Never thrown
-   */
-  public void doGet (HttpServletRequest request,
-                     HttpServletResponse response)
-    throws ServletException, IOException
-  {
-    try
-    {	
-      TransformerFactory tFactory = TransformerFactory.newInstance();
-      process(tFactory, request, response);
-    }
-    catch (Exception e)
-    {
-    }
-  }
-  
-  /**
-   * Coordinates applying an XSL stylesheet to XML data using operational parameters.
-   * <p>If successfully applied, the result tree will be streamed to the response object
-   * and the content type set according to the XSL stylesheet's &lt;xsl:output> element(s).</p>
-   * <p>If there is a problem in parsing the XML/XSL or if there is a problem in applying
-   * the XSL to the XML, an exception will be streamed to the response object.  The detail
-   * of the information returned in the response object will depend on whether we're
-   * running in debug mode or not.</p>
-   * @param processor implementation of TRaX processor
-   * @param request  May contain information relevant to creating XML and XSL XSLTInputSource's
-   * @param response Where to write the transformation result
-   * @see #getDocument
-   * @see #getStylesheet
-   * @see #getContentType
-   * @see #displayException
-   * @see #setStylesheetParams
-   * @exception ServletException Never thrown
-   * @exception IOException Never thrown
-   */
-  
-  public void process(TransformerFactory tFactory, 
-		          			  HttpServletRequest request,
-                      HttpServletResponse response)
-    throws ServletException, IOException, SAXException
-  {
-    boolean debug = ourDefaultParameters.isDebug(request);
-
-    long time = 0;
-    if (debug)
-      time = System.currentTimeMillis();
-
-    // Listener to be used for all reporting
-    ApplyXSLTListener listener = new ApplyXSLTListener();
-	  listener.out.println("debug is " + debug);
-
-    Source xmlSource = null;
-	  Source xslSource = null;
-    try
-    {
-      if ((xmlSource = getDocument(request, listener)) == null)
-        throw new ApplyXSLTException("getDocument() returned null",
-                                     new NullPointerException(),
-                                     response.SC_NOT_FOUND);
-    }
-    catch (ApplyXSLTException axe)
-    {
-      axe.appendMessage(EOL + "getDocument() resulted in ApplyXSLTException" + EOL
-                        + listener.getMessage());
-      if (debug) writeLog(axe);
-      displayException(response, axe, debug);
-      xmlSource = null;
-    }
-    // creating XSL Stylesheet
-    if (xmlSource != null)
-	  {
-      try
-      {
-        if ((xslSource = getStylesheet(tFactory, request, xmlSource, listener)) == null)
-          throw new ApplyXSLTException("getStylesheet() returned null",
-                                      new NullPointerException(),
-                                      response.SC_NOT_FOUND);
- 
-        // Must "reset" xmlSource (a StreamSource) after looking for stylesheet PI
-		    xmlSource = getDocument(request, listener); 
-      }
-      catch (ApplyXSLTException axe)
-      {
-        axe.appendMessage(EOL + "getStylesheet() resulted in ApplyXSLTException" + EOL
-                          + listener.getMessage());
-        if (debug) writeLog(axe);
-        displayException(response, axe, debug);
-        xslSource = null;
-      }
-    // perform Transformation
-	  
-    if (useDefaultTemplates)
-    {
-      try
-      {
-        listener.out.println("Using default templates");
-        if (defaultTemplates == null)
-        {
-          listener.out.println("Must recompile default templates");
-          defaultTemplates = tFactory.newTemplates(xslSource);
-        }
-        Transformer transformer = defaultTemplates.newTransformer();
-            String contentType = null;
-			      contentType = getContentType(defaultTemplates);
-            if (contentType != null);
-              response.setContentType(contentType);
-
-			      if (transformer instanceof TransformerImpl)
-			      {
-			        TransformerImpl transformerImpl = (TransformerImpl)transformer;
-              transformerImpl.setQuietConflictWarnings(ourDefaultParameters.isNoCW(request));
-			      }
-			
-			      setStylesheetParams(transformer, request);			
-	          transformer.transform(xmlSource, new StreamResult(response.getOutputStream()));
-			
-			      if (debug)              
-              writeLog(listener.getMessage(), response.SC_OK);
-        
-      }
-      catch (Exception exc)
-      {
-        ApplyXSLTException axe = new ApplyXSLTException
-				          ("Exception occurred during Transformation:"
-                    + EOL + listener.getMessage() + EOL
-                    + exc.getMessage(), 
-					          exc,
-                    response.SC_INTERNAL_SERVER_ERROR);
-        if (debug) writeLog(axe);
-          displayException(response, axe, debug);      
-       }
-     }   
-      
-     else if ((xmlSource != null) && (xslSource != null))
-     {
-	     try
-	     {
-         listener.out.println("Performing transformation...");		
-         Templates templates = tFactory.newTemplates(xslSource);
-         Transformer transformer = templates.newTransformer();
- 
-         try
-         {
-           String contentType = null;
-			     contentType = getContentType(templates);
-           if (contentType != null);
-             response.setContentType(contentType);
-
-			     if (transformer instanceof TransformerImpl)
-			     {
-			       TransformerImpl transformerImpl = (TransformerImpl)transformer;
-             transformerImpl.setQuietConflictWarnings(ourDefaultParameters.isNoCW(request));
-			     }
-			
-			     setStylesheetParams(transformer, request);			
-	         transformer.transform(xmlSource, new StreamResult(response.getOutputStream()));
-			
-			     if (debug)              
-             writeLog(listener.getMessage(), response.SC_OK);
-          }
-          catch (Exception exc)
-          {
-            ApplyXSLTException axe = new ApplyXSLTException
-				                     ("Exception occurred during Transformation:"
-                                          + EOL + listener.getMessage() + EOL
-                                          + exc.getMessage(), 
-									              exc,
-                                response.SC_INTERNAL_SERVER_ERROR);
-            if (debug) writeLog(axe);
-            displayException(response, axe, debug);
-          }
-          finally
-          {
-            // transformer.reset();
-          } // end of try ... catch ... finally
-		    }
-        catch (/*org.xml.sax.SAX*/Exception saxExc)
-        {
-          ApplyXSLTException axe = new ApplyXSLTException
-			                     ("Exception occurred during ctor/Transformation:"
-                             + EOL + listener.getMessage() + EOL
-                             + saxExc.getMessage(), 
-			             					 saxExc,
-                             response.SC_INTERNAL_SERVER_ERROR);
-          if (debug) writeLog(axe);
-          displayException(response, axe, debug);
-        } // end of new try ... catch
-      } // end of if((stylesheetRoot != null) ...
-      if (debug)
-      {
-        time = System.currentTimeMillis() - time;
-        writeLog("  No Conflict Warnings = " + ourDefaultParameters.isNoCW(request) +
-                 "  Transformation time: " + time + " ms", response.SC_OK);
-      }
-    }
-  }  
-
-  /**
-   * Returns a Source object with the XML document to be transformed. Attempts will be make to create the 
-   * Source object from the following:
-   * <ol>
-   * <li>A relative URL specified in the HTTP request's path information. This capability is intended
-   * for use by <b>servlet engines that map</b> some or all XML data to be processed at the server.</li>
-   * <li>A URL specified in the HTTP request's <code>URL=</code> parameter.  This capability
-   * is intended for <b>clients wishing to selectively process</b> XML data at the server.  For
-   * security reasons, this URL will be forced to the local IP host.</li>
-   * <li>The HTTP request's XML input stream. This capability is intended for use by chained servlets.</li>
-   * </ol>
-   * @param request client HTTPRequest object
-   * @param listener To record detailed parsing messages for possible return to requestor
-   * @return Source with XML document to be transformed, or null if the Source could not be located
-   * @exception ApplyXSLTException Thrown if exception occurs while handling request
-   */
-  protected Source getDocument(HttpServletRequest request,
-                                     ApplyXSLTListener listener)
-    throws ApplyXSLTException
-  {
-    try
-    {
-      String xmlURL = null;
-      // document from PathInfo
-      if ((xmlURL = request.getPathInfo()) != null)
-      {
-        listener.out.println("Parsing XML Document from PathInfo: " + xmlURL);
-        return new StreamSource(new URL("http", ((DefaultApplyXSLTProperties)
-                                         ourDefaultParameters).getLocalHost(),
-                                         xmlURL.replace('\\', '/')).openStream());		
-      }
-      // document from Request parameter
-      if ((xmlURL = ourDefaultParameters.getXMLurl(request)) != null)
-      {
-        listener.out.println("Parsing XML Document from request parameter: " + xmlURL);
-        return new StreamSource(new URL(xmlURL).openStream());
-      }
-      // document from chain
-      String contentType = request.getContentType();
-      if ((contentType != null) && contentType.startsWith("text/xml"))
-      {
-        listener.out.println("Parsing XML Document from request chain");
-        return new StreamSource(request.getInputStream());
-      }
-    }
-    catch (IOException ioe)
-    {
-      throw new ApplyXSLTException(ioe, HttpServletResponse.SC_NOT_FOUND);
-    }
-    catch (Exception e)
-    {
-      throw new ApplyXSLTException(e, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-    }
-    return null;
-  }
-
-  /**
-   * Returns a Source object containing the stylesheet.  Attempts will be make to obtain the stylesheet 
-   * from the following sources:
-   * <ol>
-   * <li>A URL specified in the HTTP request's <code>xslURL=</code> parameter. For security reasons, 
-   * this URL will be forced to the local IP host.</li>
-   * <li>A URL specified in the XML document xsl:stylesheet Processing Instruction.  XML documents may contain 
-   * Processing Instruction references to one or more stylesheets using the
-   * <a HREF="http://www.w3.org/TR/xml-stylesheet/>Associating Style Sheets with XML documents</a> 
-   * W3C ecommendation.
-   * If the XML document does contain such references, a best match will be chosen based on the browser
-   * type making the request and the default association.  This capability enables relationships to be
-   * defined between client capabilities and stylesheets capable of acting on these capabilities.</li>
-   * <li>A default stylesheet URL specified when the servlet is loaded. During init(), the servlet
-   * uses this xslURL startup parameter to create a Templates object, which is the used for transformations
-   * where no other stylesheet is designated.</li>
-   * </ol>
-   * @param request the client HTTP request, which may include an xslURL parameter
-   * @param xmlSource  the XML document to be transformed
-   * @param listener To record detailed parsing messages for possible return to requestor
-   * @return Source, or null if the stylesheet could not be located.
-   * @see #getMedia
-   * @see #STYLESHEET_ATTRIBUTE
-   * @see #toAcceptLanguageConnection
-   * @exception ApplyXSLTException Thrown if exception occurs while locating the stylesheet
-   */
-  protected Source getStylesheet(TransformerFactory tFactory,
-				   	        	  			   HttpServletRequest request,
-                                 Source xmlSource,
-                                 ApplyXSLTListener listener)
-    throws ApplyXSLTException
-  {
-    try
-    {
-      //stylesheet URL from request
-      String xslURL = ((DefaultApplyXSLTProperties) ourDefaultParameters).getXSLRequestURL(request);
-
-      if (xslURL != null)
-      {
-        listener.out.println("Parsing XSL Stylesheet Document from request parameter: "
-                             + xslURL);
-        useDefaultTemplates = false;
-      }
-      else 
-      {
-        // find stylesheet from XML Document, Media tag preference
-        SAXTransformerFactory stf = (SAXTransformerFactory)tFactory;
-        Source styleSource =
-               stf.getAssociatedStylesheet(xmlSource,getMedia(request), null, null);
-        if (styleSource != null)
-        {
-          listener.out.println("Parsing XSL Stylesheet from XML document stylesheet PI.");
-          useDefaultTemplates = false;
-          return styleSource;
-        }
-        
-        // Configuration Default
-        if ((xslURL = ourDefaultParameters.getXSLurl(null)) != null)
-        {
-          listener.out.println("Parsing XSL Stylesheet Document from configuration: " + xslURL);
-          useDefaultTemplates = true;
-        }
-      }
-      return new StreamSource(xslURL);
-    }
-    catch (IOException ioe)
-    {
-      throw new ApplyXSLTException(ioe, HttpServletResponse.SC_NOT_FOUND);
-    }
-    catch (Exception e)
-    {
-      throw new ApplyXSLTException(e, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-    }
-  }
-
-  /**
-   * Returns the response content type specified by the media-type and encoding attributes of
-   * the &lt;xsl:output> element(s) of the stylesheet.
-   * Default output property settings are used for any properties not set by the stylesheet. 
-   * @param xslSourceRoot XSL Stylesheet to be examined for &lt;xsl:output> elements.
-   * @return The response content type (MIME type and charset) of the stylesheet output
-   * @see #process
-   */
-  public String getContentType(Templates templates)
-  {
-    Properties oprops = templates.getOutputProperties();
-    String method = oprops.getProperty(OutputKeys.METHOD);
-    if (method == null) method = "xml"; // the default.
-    
-    Properties defoprops = null;
-    if (method.equals("html"))
-      defoprops = OutputProperties.getDefaultMethodProperties("html");
-    else if (method.equals("text"))
-      defoprops = OutputProperties.getDefaultMethodProperties("text");
-    else
-      defoprops = OutputProperties.getDefaultMethodProperties("xml");
-    
-    String encoding = oprops.getProperty(OutputKeys.ENCODING);
-    if (encoding == null) 
-      encoding = defoprops.getProperty(OutputKeys.ENCODING);
-    
-    String media = oprops.getProperty(OutputKeys.MEDIA_TYPE);
-    if (media == null) 
-      media = defoprops.getProperty(OutputKeys.MEDIA_TYPE);
-    
-    return media + "; charset=" + encoding;
-  }  
-  
-
-  /**
-   * Defines and sets select top-level XSL stylesheet variables from the HTTP request, which
-   * can be evaluated using &lt;xsl:param-variable&gt;.  The following variables will be
-   * automatically set:
-   * <dl>
-   * <dt><i>ParameterName</i></dt>
-   * <dd>Each non-reserved request parameter returned from request.getParameterNames().  If a
-   *     parameter contains more than a single value, only the first value is available.</dd>
-   * <dt>servlet-RemoteAddr</dt>
-   * <dd>Contains String output from request.getRemoteAddr(), which is the IP address
-   *     of the client machine.</dd>
-   * <dt>servlet-RemoteHost</dt>
-   * <dd>Contains String output from request.getRemoteHost(), which is the host name
-   *     of the client machine.</dd>
-   * <dt>servlet-RemoteUser</dt>
-   * <dd>Contains String output from request.getRemoteUser(), which was the user name
-   *     accepted by the server to grant access to this servlet.</dd>
-   * <dt>servlet-Request</dt>
-   * <dd>Contains the request object.</dd>
-   * </dl>
-   * @param xslprocessor Where to register parameters to be set
-   * @param request Provides access to all meaningful parameters to set
-   * @see #process
-   */
-  public void setStylesheetParams(Transformer transformer, HttpServletRequest request)
-  {
-    Enumeration paramNames = request.getParameterNames();
-    while (paramNames.hasMoreElements())
-    {
-      String paramName = (String) paramNames.nextElement();
-      try
-      {
-        String[] paramVals = request.getParameterValues(paramName);
-        if (paramVals != null)
-            transformer.setParameter(paramName, new XString(paramVals[0]));
-                                            
-      }
-      catch (Exception e)
-      {
-      }
-    }
-    try
-    {
-      transformer.setParameter("servlet-RemoteAddr", new XString(request.getRemoteAddr()));
-                                      
-    }
-    catch (Exception e)
-    {
-    }
-    try
-    {
-      transformer.setParameter("servlet-RemoteHost", new XString(request.getRemoteHost()));
-                                      
-    }
-    catch (Exception e)
-    {
-    }
-    try
-    {
-      transformer.setParameter("servlet-RemoteUser", new XString(request.getRemoteUser()));
-                                      
-    }
-    catch (Exception e)
-    {
-    }
-  }
-
-
-  /**
-   * Writes the following information to the servlet log:
-   * <ol>
-   * <li>HTTP status code</li>
-   * <li>Message</li>
-   * <li>Stack trace</li>
-   * </ol>
-   * @param axe Contains valid HTTP status code, message, and stack trace (optional)
-   */
-  protected void writeLog(ApplyXSLTException axe)
-  {
-    writeLog(axe.getMessage(), axe.getStatusCode(), axe.getException());
-  }
-
-  /**
-   * Writes the following information to the servlet log:
-   * <ol>
-   * <li>HTTP status code</li>
-   * <li>Message</li>
-   * <li>Stack trace</li>
-   * </ol>
-   * @param msg Message to be logged
-   * @param statusCode Valid status code from javax.servlet.http.HttpServletResponse
-   * @param t Used to generate stack trace (may be =null to suppress stack trace)
-   */
-  protected void writeLog(String msg, int statusCode, Throwable t)
-  {
-    if (t == null)
-      writeLog(msg, statusCode);
-    else
-    {
-      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
-      PrintWriter writer = new PrintWriter(bytes, true);
-      System.out.println("Exception is " + t.getClass().getName());
-      t.printStackTrace(writer);
-      log("HTTP Status Code: " + statusCode + " - " + msg + EOL + bytes.toString());
-    }
-  }
-
-  /**
-   * Writes the following information to the servlet log:
-   * <ol>
-   * <li>HTTP status code</li>
-   * <li>Message</li>
-   * </ol>
-   * @param msg Message to be logged
-   * @param statusCode Valid status code from javax.servlet.http.HttpServletResponse
-   */
-  protected void writeLog(String msg, int statusCode)
-  {
-    log("HTTP Status Code: " + statusCode + " - " + msg);
-  }
-
-  /**
-   * Invokes response.sendError setting an HTTP status code and optionally an error message
-   * as an HTML page.
-   * <p>If running in debug mode, also try to return a stack trace of the exception and
-   * and xml/xsl processor messages.</p>
-   * @param response Where to stream the exception to
-   * @param xse The wrapper which contains the exception and its HTTP status code
-   * @param debug Indicates whether to include stack trace, etc.
-   */
-  protected void displayException(HttpServletResponse response, ApplyXSLTException xse, boolean debug)
-  {
-    String mesg = xse.getMessage();
-    if (mesg == null)
-      mesg = "";
-    else mesg = "<B>" + mesg + "</B>";
-    StringTokenizer tokens = new StringTokenizer(mesg, EOL);
-    StringBuffer strBuf = new StringBuffer();
-    while (tokens.hasMoreTokens())
-      strBuf.append(tokens.nextToken() + EOL + "<BR>");
-    mesg = strBuf.toString();
-    if (debug)
-    {
-      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
-      PrintWriter writer = new PrintWriter(bytes, true);
-      xse.getException().printStackTrace(writer);
-      mesg += " <PRE> " + bytes.toString() + " </PRE> ";
-    }
-    response.setContentType("text/html");
-    try
-    {
-      response.sendError(xse.getStatusCode(), mesg);
-    }
-    catch (IOException ioe)
-    {
-      System.err.println("IOException is occurring when sendError is called");
-    }
-  }
-
-  /**
-   * Mapping of HTTP request's user-Agent values to stylesheet media= values.
-   * <p>This mapping is defined by a file pointed to by the operational parameter "mediaURL" which can
-   *  either contain a full URL or a path relative to the System's server.root /servlets directory.</p>
-   * @see #setMediaProps
-   * @see #getMedia
-   * @serial
-   */
-  protected OrderedProps ourMediaProps = null;
-
-  /**
-   * Returns a connection which respects the Accept-Language header of the HTTP request.  This
-   * is useful when XSL files are internationalized for use with Web servers which respect this
-   * header.
-   * <p>For example, Apache 1.3.6 may be configured for multiviews.  Under this configuration,
-   * requests for http://myhost/index.html would return http://myhost/index.html.fr to French browsers
-   * and http://myhost/index.html.en to English browsers.</p>
-   * @param url Location to connect to
-   * @param request Could contain an Accept-Language header
-   * @return An Accept-Language-enabled URL connection
-   * @see #getStylesheet
-   */
-  protected URLConnection toAcceptLanguageConnection(URL url, HttpServletRequest request)
-    throws Exception
-  {
-    URLConnection tempConnection = url.openConnection();
-    tempConnection.setRequestProperty("Accept-Language", request.getHeader("Accept-Language"));
-    return tempConnection;
-  }
-
-
-  /**
-   * Returns the XSL stylesheet URL associated with the specified XML document.  If multiple XSL
-   * stylesheets are associated with the XML document, preference will be given to the stylesheet
-   * which contains an attribute name/value pair that corresponds to the specified attributeName
-   * and attributeValue.
-   * @param xmlSource XML XSLTInputSource to be searched for associated XSL stylesheets
-   * @param attributeName  Attribute name to provide preferential matching
-   * @param attributeValue Attribute value to provide preferential matching
-   * @return The preferred XSL stylesheet URL, or null if no XSL stylesheet association is found
-   * @see #getStylesheet
-   */
-/*  public static String getXSLURLfromDoc(StreamSource xmlSource,
-                                        String attributeName,
-                                        String attributeValue,
-                                        TransformerFactory tFactory)
-  {
-    String tempURL = null, returnURL = null;
-    try
-    {
-	  DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-      DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-      Node sourceTree = docBuilder.parse(xmlSource.getInputStream());
-      for(Node child=sourceTree.getFirstChild(); null != child; child=child.getNextSibling())
-      {
-        if(Node.PROCESSING_INSTRUCTION_NODE == child.getNodeType())
-        {
-          ProcessingInstruction pi = (ProcessingInstruction)child;
-          if(pi.getNodeName().equals("xml-stylesheet"))
-          {
-            PIA pia = new PIA(pi);
-            if("text/xsl".equals(pia.getAttribute("type")))
-            {
-              tempURL = pia.getAttribute("href");
-              String attribute = pia.getAttribute(attributeName);
-              if ((attribute != null) && (attribute.indexOf(attributeValue) > -1))
-                return tempURL;
-              if (!"yes".equals(pia.getAttribute("alternate")))
-                returnURL = tempURL;
-            }
-          }
-        }
-      }
-    }
-    catch(Exception saxExc)
-    {
-    }
-    return returnURL;
-  }  
-*/
- /**
-   * The attribute name in the <?xml-stylesheet> tag used in stylesheet selection.
-   */
-  protected static final String STYLESHEET_ATTRIBUTE = "media";
-
-  /**
-   *	The HTTP Header used for matching the Stylesheet attribute via the
-   * media properties file selected.
-   */
-  protected static final String HEADER_NAME = "user-Agent";
-}
-
-/**
- *  Stores the keys and values from a file (similar to a properties file) and
- *  can return the first value which has a key contained in its string.
- *  File can have comment lines starting with '#" and for each line the entries are
- *  separated by tabs and '=' char.
- */
-class OrderedProps
-{
-
-  /**
-   * Stores the Key and Values as an array of Strings
-   */
-  private Vector attVec = new Vector(15);
-
-  /**
-   * Constructor.
-   * @param inputStream Stream containing the properties file.
-   * @exception IOException Thrown if unable to read from stream
-   */
-  OrderedProps(InputStream inputStream)
-    throws IOException
-  {
-    BufferedReader input  = new BufferedReader(new InputStreamReader(inputStream));
-    String currentLine, Key = null;
-    StringTokenizer currentTokens;
-    while ((currentLine = input.readLine()) != null)
-    {
-      currentTokens = new StringTokenizer(currentLine, "=\t\r\n");
-      if (currentTokens.hasMoreTokens()) Key = currentTokens.nextToken().trim();
-      if ((Key != null) && !Key.startsWith("#") && currentTokens.hasMoreTokens())
-      {
-        String temp[] = new String[2];
-        temp[0] = Key; temp[1] = currentTokens.nextToken().trim();
-        attVec.addElement(temp);
-      }
-    }
-  }
-
-  /**
-   * Iterates through the Key list and returns the first value for whose
-   * key the given string contains.  Returns "unknown" if no key is contained
-   * in the string.
-   * @param s String being searched for a key.
-   * @return Value for key found in string, otherwise "unknown"
-   */
-  String getValue(String s)
-  {
-    int i, j = attVec.size();
-    for (i = 0; i < j; i++)
-    {
-      String temp[] = (String[]) attVec.elementAt(i);
-      if (s.indexOf(temp[0]) > -1)
-        return temp[1];
-    }
-    return "unknown";
-  }
-}
-
-/**
- * Parses a processing instruction's (PI) attributes for easy retrieval.
- */
-class PIA
-{
-
-  private Hashtable piAttributes = null;
-
-  /**
-   * Constructor.
-   * @param pi The processing instruction whose attributes are to be parsed
-   */
-  PIA(ProcessingInstruction pi)
-  {
-    piAttributes = new Hashtable();
-    StringTokenizer tokenizer = new StringTokenizer(pi.getNodeValue(), "=\"");
-    while(tokenizer.hasMoreTokens())
-    {
-      piAttributes.put(tokenizer.nextToken().trim(), tokenizer.nextToken().trim());
-    }
-  }
-
-  /**
-   * Returns value of specified attribute.
-   *  @param name Attribute name
-   *  @return Attribute value, or null if the attribute name does not exist
-   */
-  String getAttribute(String name)
-  {
-    return (String) piAttributes.get(name);
-  }  
-}
\ No newline at end of file
diff --git a/samples/servlet/ApplyXSLTException.java b/samples/servlet/ApplyXSLTException.java
deleted file mode 100644
index f63c6a1..0000000
--- a/samples/servlet/ApplyXSLTException.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- * 
-/*****************************************************************************************************
- *
- * Wrapper for exceptions occurring during apply XSL processing.  
- * Allows for exceptions to be returned with an associated HTTP Status Code.
- *
- * @author Spencer Shepard (sshepard@us.ibm.com)
- * @author R. Adam King (rak@us.ibm.com)
- * @author Tom Rowe (trowe@us.ibm.com)
- *
- *****************************************************************************************************/
-package servlet;
-
-public class ApplyXSLTException extends Exception {
-
-    /**
-      * Exception Message.
-      * @serial
-      */ 
-    private String myMessage = "";
-
-    /**
-      * HTTP Status Code. Default= internal server error.
-      * @serial
-      */
-    private int  myHttpStatusCode = javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR; 
-
-    /**
-      * Wrapped exception
-      * @serial
-      */
-    private Exception myException = null;
-
-    /**
-      * Constructor for exception with no additional detail.
-      */
-    public ApplyXSLTException() 
-    { 
-        super(); 
-    }
-
-    /**
-      * Constructor for exception with message.
-      * @param s Exception message
-      */
-    public ApplyXSLTException(String s) 
-    { 
-        super(); 
-	myMessage = s;
-    }
-
-    /**
-      * Constructor for exception with HTTP status code.
-      * @param hsc Valid status code from javax.servlet.http.HttpServletResponse
-      */
-    public ApplyXSLTException(int hsc) 
-    {
-	super();
-	myHttpStatusCode = hsc;
-    }
-
-    /**
-      * Constructor for exception with message and HTTP status code.
-      * @param s Exception message
-      * @param hsc Valid status code from javax.servlet.http.HttpServletResponse
-      */
-    public ApplyXSLTException(String s, int hsc)
-    {
-	super();
-	myHttpStatusCode = hsc;
-    }
-
-    /**
-      * Constructor for exception.
-      * @param e Exception to be wrapped.
-      */
-    public ApplyXSLTException(Exception e)
-    {
-	super();
-	myMessage = e.getMessage();
-	myException = e;
-    }
-
-    /**
-      * Constructor for passed exception with message.
-      * @param s Exception message
-      * @param e Exception to be wrapped.
-      */
-    public ApplyXSLTException (String s, Exception e)
-    {
-	super();
-	myMessage = s;
-	myException = e;
-    }
-
-    /**
-      * Constructor for passed exception with HTTP status code.
-      * @param e Exception to be wrapped.
-      * @param hsc Valid status code from javax.servlet.http.HttpServletResponse
-      */
-    public ApplyXSLTException(Exception e, int hsc)
-    {
-	super();
-	myMessage = e.getMessage();
-	myException = e;
-	myHttpStatusCode = hsc;
-    }
-
-    /**
-      * Constructor for passed exception with HTTP status code and message.
-      * @param s Exception message
-      * @param e Exception to be wrapped.
-      * @param hsc Valid status code from javax.servlet.http.HttpServletResponse
-      */
-    public ApplyXSLTException(String s, Exception e, int hsc)
-    {
-	super();
-	myMessage = s;
-	myException = e;
-	myHttpStatusCode = hsc;
-    }
-
-    /**
-      * Returns exception message.
-      * @return exception message
-      */
-    public String getMessage()
-    {
-	return myMessage;
-    }
-
-    /**
-      * Appends string to exception message.
-      * @param s String to be added to message
-      */
-    public void appendMessage(String s)
-    {
-	myMessage += s;
-    }
-
-    /**
-      * Returns the wrapped exception.
-      * @return Wrapped exception
-      */
-    public Exception getException()
-    {
-	return myException;
-    }
-
-    /**
-      * Returns the HTTP status code associated with the exception.
-      * @return Valid status code from javax.servlet.http.HttpServletResponse
-      */
-    public int getStatusCode()
-    {
-	return myHttpStatusCode;
-    }
-}
-
diff --git a/samples/servlet/ApplyXSLTListener.java b/samples/servlet/ApplyXSLTListener.java
deleted file mode 100644
index 2e46e26..0000000
--- a/samples/servlet/ApplyXSLTListener.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package servlet;
-
-import java.io.*;
-import org.xml.sax.*;
-import org.apache.xml.utils.DefaultErrorHandler;
-
-/*****************************************************************************************************
- * ApplyXSLTListener provides a buffered listener essential for capturing, and then subsequently
- * reporting, XML and XSL processor messages which may be of use in debugging XML+XSL processed at
- * the server.
- *
- * @author Spencer Shepard (sshepard@us.ibm.com)
- * @author R. Adam King (rak@us.ibm.com)
- * @author Tom Rowe (trowe@us.ibm.com)
- *
- *****************************************************************************************************/
-
-public class ApplyXSLTListener extends DefaultErrorHandler implements ErrorHandler
-{
-
-    /**
-      * Output stream
-      */
-    private ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-
-    /**
-      * Buffered output stream
-      */
-    public PrintWriter out = null;
-
-    /**
-      * Constructor.
-      */
-    public ApplyXSLTListener()
-    {
-      out = new PrintWriter(new BufferedOutputStream(outStream), true);
-    }
-
-    /**
-      * Receive notification of a warning.
-      *
-      * @param spe The warning information encapsulated in a SAX parse exception.
-      */
-    public void warning(SAXParseException spe)
-    {
-	out.println("Parser Warning: " + spe.getMessage());
-    }
-
-    /**
-      * Receive notification of a recoverable error.
-      *
-      * @param spe The error information encapsulated in a SAX parse exception.
-      */
-    public void error(SAXParseException spe)
-    {
-	out.println("Parser Error: " + spe.getMessage());
-    }
-
-    /**
-      * Receive notification of a non-recoverable error.
-      *
-      * @param spe The error information encapsulated in a SAX parse exception.
-      * @exception SAXException Always thrown
-      */
-    public void fatalError(SAXParseException spe)
-    throws SAXException
-    {
-	out.println("Parser Fatal Error: " + spe.getMessage());
-	throw spe;
-    }
-
-    /**
-      * Returns the buffered processing message(s).
-      * @return Buffered processing message(s)
-      */
-    public String getMessage()
-    {
-	return outStream.toString();
-    }
-}
-
diff --git a/samples/servlet/ApplyXSLTProperties.java b/samples/servlet/ApplyXSLTProperties.java
deleted file mode 100644
index 69e0ed4..0000000
--- a/samples/servlet/ApplyXSLTProperties.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package servlet;
-
-import java.net.MalformedURLException;
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-/*****************************************************************************************************
- * 
- * ApplyXSLTProperties contains operational parameters for ApplyXSLT based 
- * on program defaults and configuration.  
- * <p>This class is also used to return values for request-time parameters.</p>
- *
- * @author Spencer Shepard (sshepard@us.ibm.com)
- * @author R. Adam King (rak@us.ibm.com)
- * @author Tom Rowe (trowe@us.ibm.com)
- *
- *****************************************************************************************************/
-
-public class ApplyXSLTProperties {
-
-    /**
-      * Program default for parameter "URL"
-      */
-    private final String DEFAULT_URL;
-
-    /**
-      * Program default for parameter "xslURL"
-      */
-    private final String DEFAULT_xslURL;
-    
-    /**
-      * Program default for parameter "debug"
-      */
-    private final boolean DEFAULT_debug;
-
-    /**
-      * Program default for parameter "noConflictWarnings"
-      */
-    private final boolean DEFAULT_noCW;
-    
-    /**
-      * Constructor to use program defaults.
-      */
-    public ApplyXSLTProperties() 
-    {
-	DEFAULT_URL = null;
-	DEFAULT_xslURL = null;
-	DEFAULT_debug = false;
-	DEFAULT_noCW = false;
-    }
-
-    /**
-      * Constructor to use to override program defaults.
-      * @param config Servlet configuration
-      */
-    public ApplyXSLTProperties(ServletConfig config)
-    {
-	String xm = config.getInitParameter("URL"),
-	       xu = config.getInitParameter("xslURL"),
-	       db = config.getInitParameter("debug"),
-	       cw = config.getInitParameter("noConflictWarnings");
-	       
-	if (xm != null) DEFAULT_URL = xm;
-	else DEFAULT_URL = null;
-	if (xu != null) DEFAULT_xslURL = xu;
-	else DEFAULT_xslURL = null;
-	if (db != null) DEFAULT_debug = new Boolean(db).booleanValue();
-	else DEFAULT_debug = false;
-	if (cw != null) DEFAULT_noCW = new Boolean(cw).booleanValue();
-	else DEFAULT_noCW = false;
-    }
-   
-    /**
-      * Given a parameter name, returns the HTTP request's String value; 
-      * if not present in request, returns default String value.
-      * @param request Request to check for default override
-      * @param param Name of the parameter
-      * @return String value of named parameter
-      */
-    public String getRequestParmString(HttpServletRequest request, String param)
-    {
-	if (request != null) { 
-	    String[] paramVals = request.getParameterValues(param); 
-	    if (paramVals != null) 
-		return paramVals[0];
-	}
-	return null;
-    }
-
-    /**
-      * Returns the current setting for "URL".
-      * @param request Request to check for parameter value
-      * @return String value for "URL"
-      * @exception MalformedURLException Will not be thrown
-      */
-    public String getXMLurl(HttpServletRequest request)
-    throws MalformedURLException
-    {
-	String temp = getRequestParmString(request, "URL");
-	if (temp != null)
-	    return temp;
-	return DEFAULT_URL;
-    }     
-    
-    /**
-      * Returns the current setting for "xslURL".
-      * @param request Request to check for parameter value
-      * @return String value for "xslURL"
-      * @exception MalformedURLException Will not be thrown
-      */
-    public String getXSLurl(HttpServletRequest request)
-    throws MalformedURLException
-    {  
-	String temp = getRequestParmString(request, "xslURL");
-	if (temp != null)
-	    return temp;
-	return DEFAULT_xslURL;
-    }
-    
-    /**
-      * Returns the current setting for "debug".
-      * @param request Request to check for parameter value
-      * @return Boolean value for "debug"
-      */
-    public boolean isDebug(HttpServletRequest request)
-    {
-	String temp = getRequestParmString(request, "debug");
-	if (temp != null)
-	    return new Boolean(temp).booleanValue();
-	return DEFAULT_debug;
-    }
-
-    /**
-      * Returns the current setting for "noConflictWarnings".
-      * @param request Request to check for parameter value
-      * @return Boolean value for "noConflictWarnings"
-      */
-    boolean isNoCW(HttpServletRequest request)
-    {
-	String temp = getRequestParmString(request, "noConflictWarnings");
-	if (temp != null)
-	    return new Boolean(temp).booleanValue();
-	return DEFAULT_noCW;
-    }    
-}
\ No newline at end of file
diff --git a/samples/servlet/DefaultApplyXSLTProperties.java b/samples/servlet/DefaultApplyXSLTProperties.java
deleted file mode 100644
index 1fdb967..0000000
--- a/samples/servlet/DefaultApplyXSLTProperties.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package servlet;
-
-import java.net.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.util.Enumeration;
-import java.util.Properties;
-
-/*****************************************************************************************************
- * 
- * DefaultApplyXSLTProperties contains operational parameters for DefaultApplyXSLT based 
- * on program defaults and configuration.  
- * <p>This class is also used to return values for request-time parameters.</p>
- *
- * @author Spencer Shepard (sshepard@us.ibm.com)
- * @author R. Adam King (rak@us.ibm.com)
- * @author Tom Rowe (trowe@us.ibm.com)
- *
- *****************************************************************************************************/
-
-public class DefaultApplyXSLTProperties extends ApplyXSLTProperties {
-    
-    /**
-      * Program default for parameter "catalog".
-      * @see #getCatalog
-      */
-    private final String DEFAULT_catalog;
-
-    /**
-      * Host used for local context comparisons.
-      * @see #getLocalHost
-      * @see #setLocalHost
-      */
-    protected transient String localHost = null;
-    
-    /**
-     * Server port. Used in toSafeURL() -- fix submitted by Ritesh Kumar.
-     */
-    protected static int port =0;
-
-    /**
-      * Constructor to use program defaults.
-      */
-    public DefaultApplyXSLTProperties()
-    {
-	super();
-	DEFAULT_catalog = null;
-	setLocalHost();
-	// setSystemProperties();
-    }
-
-    /**
-      * Constructor to use to override program defaults.
-      * @param config Servlet configuration
-      * @see #setLocalHost
-      */
-    public DefaultApplyXSLTProperties(ServletConfig config)
-    {
-	    super(config);
-	    String cat = config.getInitParameter("catalog");
-	    if (cat != null) DEFAULT_catalog = cat;
-	    else DEFAULT_catalog = null;
-	    setLocalHost();
-	    setSystemProperties();
-    }
-
-    /**
-      * Sets the name of the local IP host name; this value will be used to constrain untrusted 
-      * XML document and XSL stylesheet URLs to this trusted host.
-      * @see #getLocalHost
-      */
-    protected void setLocalHost()
-    {
-	    try 
-	    { 
-	        localHost = InetAddress.getLocalHost().getHostName();
-	    } 
-	    catch (Exception uhe) 
-	    {
-	      localHost = null;
-	    }
-    }
-
-    /**
-      * Returns the name of trusted IP host.
-      * @return Name of trusted host
-      * @see #setLocalHost
-      */
-    public String getLocalHost()
-    {
-	    return localHost;
-    }
-
-    /**
-      * Returns a URL which is constrained to a trusted IP host.
-      * @param xURL URL or file path to be made safe 
-      * @return Safe URL
-      * @exception MalformedURLException Thrown when xURL is not a valid URL
-      * @see #setLocalHost
-      * @see #getLocalHost
-      */
-    public URL toSafeURL(String xURL, HttpServletRequest request)
-    throws MalformedURLException
-    {
-      // Fix submitted by Ritesh Kumar. Port is included in construction of URL that is returned.
-      if (port == 0)
-        port = request.getServerPort();
-      
-	    if (xURL == null)
-	      return null;
-
-	    if (xURL.startsWith("/")) 
-      {
-	      try 
-        {
-		      return new URL("http", localHost, port, xURL);
-	      }
-        catch (MalformedURLException mue) 
-        {
-	        throw new MalformedURLException("toSafeURL(): " + xURL + 
-					                                " did not map to local");
-	      }
-	    }
-	    URL tempURL = null;
-	    try 
-      { 
-	      tempURL = new URL(xURL);
-	    } 
-      catch (MalformedURLException mue) 
-      {
-	      throw new MalformedURLException("toSafeURL(): " + xURL + 
-					                              " not a valid URL"); 
-	    }
-	    try 
-      { 
-	      return new URL(tempURL.getProtocol(), localHost, 
-			                 port, tempURL.getFile());
-	    } 
-      catch (MalformedURLException mue) 
-      {
-	      throw new MalformedURLException("toSafeURL(): " + xURL + 
-				                          	    " could not be converted to local host");
-	    }
-    }
-
-    /**
-      *	Returns a string representing the constrained URL for the XML document.
-      * If there is no request parameter for the XML document, return the configured default.
-      * @param request May contain an XML document URL parameter
-      * @return String form of XML URL
-      * @exception MalformedURLException Thrown when request URL is not a valid URL or path
-      * @see #toSafeURL
-      */
-    public String getXMLurl(HttpServletRequest request)
-    throws MalformedURLException
-    {
-	    URL url = toSafeURL(getRequestParmString(request, "URL"),request);
-	    if (url == null)
-	      return super.getXMLurl(null);
-	    return url.toExternalForm();
-    }
-
-    /**
-      * Returns a string representing the constrained URL for the XSL stylesheet 
-      * from the request.
-      * @param request May contain an XSL stylesheet URL parameter
-      * @return String form of request XSL URL, or null if request contains no xslURL parameter
-      * @exception MalformedURLException Thrown when request URL is not a valid URL or path
-      * @see #toSafeURL
-      */
-    public String getXSLRequestURL(HttpServletRequest request)
-    throws MalformedURLException
-    {
-	    URL url = toSafeURL(getRequestParmString(request, "xslURL"),request);
-	    if (url == null)
-	        return null;
-	    return url.toExternalForm();
-    }
-
-    /**
-      * Returns a string representing the constrained request URL for the XSL stylesheet.
-      * If there is no request parameter for the XSL stylesheet, return the configured default.
-      * @param request May contain an XSL stylesheet URL parameter
-      * @return String form of XSL URL
-      * @exception MalformedURLException Thrown when request URL is not a valid URL or path
-      * @see #toSafeURL
-      */
-    public String getXSLurl(HttpServletRequest request)
-    throws MalformedURLException
-    {
-	    String reqURL = getXSLRequestURL(request);
-	    if (reqURL != null)
-	        return reqURL;
-	    return super.getXSLurl(null);
-    }
-
-    /**
-      * Returns URLs for all <a href="http://www.ccil.org/~cowan/XML/XCatalog.html">XCatalogs</a> 
-      * that are to be used to process the request.  Catalogs are used to resolve XML public identifiers
-      * into system identifiers.
-      * <p>A single XCatalog can be configured as a default,
-      * but multiple XCatalogs can be specified at request time to augment the configured default.
-      * @param request May contain one or more XCatalog parameters
-      * @return Array of strings for all catalog URLs
-      */
-    public String[] getCatalog(HttpServletRequest request)
-    {
-	    String temp[] = request.getParameterValues("catalog");
-	    if (DEFAULT_catalog == null)
-	        return temp;
-	    if (temp == null) 
-      {
-	      String defaultArray[] = new String [1];
-	      defaultArray[0] = DEFAULT_catalog;
-	      return defaultArray;
-	    }
-	    int i, len = temp.length + 1;
-	    String newCatalogs[] = new String[len];
-	    newCatalogs[0] = DEFAULT_catalog;
-	    for (i=1; i < len; i++) 
-      {
-	      newCatalogs[i] = temp[i-1];
-	    }
-	    return newCatalogs;
-    }
-	
-	 /**
-   * I think we no longer need this. Sets the 3 jaxp core system properties.
-   */	
-    protected void setSystemProperties()
-	{
-	  Properties props = new Properties();
-    props.put("javax.xml.transform.TransformerFactory", 
-              "org.apache.xalan.processor.TransformerFactoryImpl");
-    props.put("javax.xml.parsers.DocumentBuilderFactory", 
-              "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
-    props.put("javax.xml.parsers.SAXParserFactory", 
-              "org.apache.xerces.jaxp.SAXParserFactoryImpl");
-    
-      Properties systemProps = System.getProperties();
-      Enumeration propEnum = props.propertyNames();
-      while(propEnum.hasMoreElements())
-      {
-        String prop = (String)propEnum.nextElement();
-        if(!systemProps.containsKey(prop))
-          systemProps.put(prop, props.getProperty(prop));
-      }
-      System.setProperties(systemProps);
-	}
-
-}
diff --git a/samples/servlet/SimpleXSLTServlet.java b/samples/servlet/SimpleXSLTServlet.java
deleted file mode 100644
index 1ecefd7..0000000
--- a/samples/servlet/SimpleXSLTServlet.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package servlet;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.*;
-import java.net.URL;
-
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-/*
- * This sample applies the todo.xsl stylesheet to the
- * todo.xml XML document, and returns the transformation
- * output (HTML) to the client browser.
- *
- * IMPORTANT: For this to work, you must place todo.xsl and todo.xml 
- * in the servlet root directory for documents.
- *
- */
-
-public class SimpleXSLTServlet extends HttpServlet {
-
-  public void init(ServletConfig config) throws ServletException
-  {
-    super.init(config);
-  }
-
-  public void doGet (HttpServletRequest request,
-                     HttpServletResponse response)
-    throws ServletException, IOException, java.net.MalformedURLException
-  {
-    // The servlet returns HTML.
-    response.setContentType("text/html; charset=UTF-8");    
-    // Output goes in the response stream.
-    PrintWriter out = response.getWriter();
-    try
-    {	
-      TransformerFactory tFactory = TransformerFactory.newInstance();
-      // Get the XML input document and the stylesheet.
-      Source xmlSource = new StreamSource(new URL("file:todo.xml").openStream());
-      Source xslSource = new StreamSource(new URL("file:todo.xsl").openStream());
-      // Generate the transformer.
-      Transformer transformer = tFactory.newTransformer(xslSource);
-      // Perform the transformation, sending the output to the response.
-      transformer.transform(xmlSource, new StreamResult(out));
-    }
-    catch (Exception e)
-    {
-      out.write(e.getMessage());
-      e.printStackTrace(out);    
-    }
-    out.close();
-  }
-  
-}
diff --git a/samples/servlet/UseStylesheetParamServlet.java b/samples/servlet/UseStylesheetParamServlet.java
deleted file mode 100644
index 1df946f..0000000
--- a/samples/servlet/UseStylesheetParamServlet.java
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/*
-Simple Servlet Example using a stylesheet parameter
- */
-package servlet;
-// Imported TraX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-// Imported SAX classes
-import org.xml.sax.SAXException;
-
-// Imported java.io and javax.servlet classes
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-public class UseStylesheetParamServlet extends HttpServlet {
-	
-	PrintWriter out;
-	String xslFile, xmlFile, paramValue;
-	public void doGet(HttpServletRequest req,
-		HttpServletResponse res)
-			throws ServletException, IOException {
-		try {
-			res.setContentType("text/html; charset=UTF-8");
-			out = res.getWriter();
-
-      paramValue = req.getParameter("PVAL");
-			xmlFile    = req.getParameter("XML");
-			xslFile    = req.getParameter("XSL");
- 		if (paramValue == null) {
-			out.println(
-			"<h1>No input for paramValue</h1>");
-			return;
-		}
- 		if ( xmlFile == null) {
-			out.println(
-			"<h1>No input for xmlFile</h1>");
-			return;
-		}	
-		if ( xslFile == null) {
-			out.println(
-			"<h1>No input for xslFile</h1>");
-			return;
-		}
-		TransformerFactory tFactory =
-			TransformerFactory.newInstance();
-		Transformer transformer =
-			tFactory.newTransformer(new StreamSource(xslFile));
-
-    // Set the stylesheet parameter (named param1).
-			transformer.setParameter("param1", paramValue);
-    // Perform the transformation.
-			transformer.transform(new StreamSource(xmlFile),
-					                  new StreamResult(out));
-		}		
-    catch (IOException e) {			
-			e.printStackTrace();
-			System.exit(-1);
-		}
-		catch (TransformerException e) {
-      e.printStackTrace(out);
-			return;
-		}
-	}
-}
diff --git a/samples/servlet/XSLTServletWithParams.java b/samples/servlet/XSLTServletWithParams.java
deleted file mode 100644
index b466560..0000000
--- a/samples/servlet/XSLTServletWithParams.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package servlet;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.*;
-import java.util.Enumeration;
-import java.net.URL;
-
-import org.xml.sax.*;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-/*
- * This sample takes input parameters in the request URL: a URL
- * parameter for the XML input, an xslURL parameter for the stylesheet,
- * and optional stylesheet parameters.
- * To run the equivalent of SimplestXSLServlet (with the documents in the
- * servlet document root directory), the request URL is
- * http://<server/servletpath>servlet.SimpleXSLServlet?URL=file:todo.xml&xslURL=file:todo.xsl
- *
- * Using a stylesheet Processing Instruction:
- * If the XML document includes a stylesheet PI that you want to use, 
- * omit the xslURL parameter.
- *
- * Sending stylesheet parameters: 
- * If, for example, a servlet takes a stylesheet parameter named param1
- * param1 that you want to set to foo, include param1=foo in the URL.
- */
-
-public class XSLTServletWithParams extends HttpServlet {
-
-  public void init(ServletConfig config) throws ServletException
-  {
-    super.init(config);
-  }
-
-  public void doGet (HttpServletRequest request,
-                     HttpServletResponse response)
-    throws ServletException, IOException
-  {
-    // The servlet returns HTML; charset is UTF8.
-    // See ApplyXSLT.getContentType() to get output properties from <xsl:output>.
-    response.setContentType("text/html; charset=UTF-8"); 
-    PrintWriter out = response.getWriter();
-    try
-    {	
-      TransformerFactory tFactory = TransformerFactory.newInstance();
-      // Get params from URL.
-      String xml = getRequestParam(request, "URL");
-      String xsl = getRequestParam(request, "xslURL");
-      Source xmlSource = null;
-      Source xslSource = null;
-      Transformer transformer = null;
-      // Get the XML input document.
-      if (xml != null && xml.length()> 0)
-        xmlSource = new StreamSource(new URL(xml).openStream());
-      // Get the stylesheet.
-      if (xsl != null && xsl.length()> 0)
-        xslSource = new StreamSource(new URL(xsl).openStream());
-      if (xmlSource != null) // We have an XML input document.
-      {
-        if (xslSource == null) // If no stylesheet, look for PI in XML input document.
-        {
-     	    String media= null , title = null, charset = null;
-          xslSource = tFactory.getAssociatedStylesheet(xmlSource,media, title, charset);
-        }
-        if (xslSource != null) // Now do we have a stylesheet?
-        {
-          transformer = tFactory.newTransformer(xslSource);
-          setParameters(transformer, request); // Set stylesheet params.
-          // Perform the transformation.
-          transformer.transform(xmlSource, new StreamResult(out)); 
-        }
-        else
-          out.write("No Stylesheet!");
-      }
-      else
-        out.write("No XML Input Document!");
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace(out);    
-    }
-    out.close();
-  }
-  
-  // Get parameters from the request URL.
-  String getRequestParam(HttpServletRequest request, String param)
-  {
-	  if (request != null) 
-    { 
-	    String paramVal = request.getParameter(param); 
-		  return paramVal;
-	  }
-	  return null;
-  }
-  
-  // Set stylesheet parameters from the request URL.
-  void setParameters(Transformer transformer, HttpServletRequest request)
-  {
-    Enumeration paramNames = request.getParameterNames();
-    while (paramNames.hasMoreElements())
-    {
-      String paramName = (String) paramNames.nextElement();
-      try
-      {
-        String paramVal = request.getParameter(paramName);
-        if (paramVal != null)
-          transformer.setParameter(paramName, paramVal);                                            
-      }
-      catch (Exception e)
-      {
-      }
-    }
-  }  
-}
diff --git a/samples/servlet/default.xsl b/samples/servlet/default.xsl
deleted file mode 100644
index e1a85e0..0000000
--- a/samples/servlet/default.xsl
+++ /dev/null
@@ -1,276 +0,0 @@
-<?xml version="1.0"?>
-
-<!--                                                                                -->
-<!--  Default XSL stylesheet for use by com.lotus.xsl.server#DefaultApplyXSL.       -->
-<!--                                                                                -->
-<!--  This stylesheet mimics the default behavior of IE when XML data is displayed  -->
-<!--  without a corresponding XSL stylesheet.  This stylesheet uses JavaScript      -->
-<!--  to accommodate node expansion and contraction.                                -->
-<!--                                                                                -->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
-                xmlns="http://www.w3.org/TR/REC-html40">
-                
-<xsl:output method="html" indent="no"/>
-<xsl:strip-space elements="*"/>
-
-<xsl:template match="/">
-  <HTML>
-    <HEAD>
-      <STYLE type="text/css">
-        BODY {font:x-small 'Verdana'; margin-right:1.5em}
-      <!-- container for expanding/collapsing content -->
-        .c  {cursor:hand}
-      <!-- button - contains +/-/nbsp -->
-        .b  {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none}
-      <!-- element container -->
-        .e  {margin-left:1em; text-indent:-1em; margin-right:1em}
-      <!-- comment or cdata -->
-        .k  {margin-left:1em; text-indent:-1em; margin-right:1em}
-      <!-- tag -->
-        .t  {color:#990000}
-      <!-- tag in xsl namespace -->
-        .xt {color:#990099}
-      <!-- attribute in xml or xmlns namespace -->
-        .ns {color:red}
-      <!-- markup characters -->
-        .m  {color:blue}
-      <!-- text node -->
-        .tx {font-weight:bold}
-      <!-- multi-line (block) cdata -->
-        .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;
-             padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier}
-      <!-- single-line (inline) cdata -->
-        .di {font:small Courier}
-      <!-- DOCTYPE declaration -->
-        .d  {color:blue}
-      <!-- pi -->
-        .pi {color:blue}
-      <!-- multi-line (block) comment -->
-        .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;
-             padding-left:.3em; font:small Courier; color:#888888}
-      <!-- single-line (inline) comment -->
-        .ci {font:small Courier; color:#888888}
-        PRE {margin:0px; display:inline}
-      </STYLE>
-
-      <SCRIPT type="text/javascript"><xsl:comment><![CDATA[
-        // Detect and switch the display of CDATA and comments from an inline view
-        //  to a block view if the comment or CDATA is multi-line.
-        function f(e)
-        {
-          // if this element is an inline comment, and contains more than a single
-          //  line, turn it into a block comment.
-          if (e.className == "ci") {
-            if (e.children(0).innerText.indexOf("\n") > 0)
-              fix(e, "cb");
-          }
-          
-          // if this element is an inline cdata, and contains more than a single
-          //  line, turn it into a block cdata.
-          if (e.className == "di") {
-            if (e.children(0).innerText.indexOf("\n") > 0)
-              fix(e, "db");
-          }
-          
-          // remove the id since we only used it for cleanup
-          e.id = "";
-        }
-        
-        // Fix up the element as a "block" display and enable expand/collapse on it
-        function fix(e, cl)
-        {
-          // change the class name and display value
-          e.className = cl;
-          e.style.display = "block";
-          
-          // mark the comment or cdata display as a expandable container
-          j = e.parentElement.children(0);
-          j.className = "c";
-
-          // find the +/- symbol and make it visible - the dummy link enables tabbing
-          k = j.children(0);
-          k.style.visibility = "visible";
-          k.href = "#";
-        }
-
-        // Change the +/- symbol and hide the children.  This function works on "element"
-        //  displays
-        function ch(e)
-        {
-          // find the +/- symbol
-          mark = e.children(0).children(0);
-          
-          // if it is already collapsed, expand it by showing the children
-          if (mark.innerText == "+")
-          {
-            mark.innerText = "-";
-            for (var i = 1; i < e.children.length; i++)
-              e.children(i).style.display = "block";
-          }
-          
-          // if it is expanded, collapse it by hiding the children
-          else if (mark.innerText == "-")
-          {
-            mark.innerText = "+";
-            for (var i = 1; i < e.children.length; i++)
-              e.children(i).style.display="none";
-          }
-        }
-        
-        // Change the +/- symbol and hide the children.  This function work on "comment"
-        //  and "cdata" displays
-        function ch2(e)
-        {
-          // find the +/- symbol, and the "PRE" element that contains the content
-          mark = e.children(0).children(0);
-          contents = e.children(1);
-          
-          // if it is already collapsed, expand it by showing the children
-          if (mark.innerText == "+")
-          {
-            mark.innerText = "-";
-            // restore the correct "block"/"inline" display type to the PRE
-            if (contents.className == "db" || contents.className == "cb")
-              contents.style.display = "block";
-            else contents.style.display = "inline";
-          }
-          
-          // if it is expanded, collapse it by hiding the children
-          else if (mark.innerText == "-")
-          {
-            mark.innerText = "+";
-            contents.style.display = "none";
-          }
-        }
-        
-        // Handle a mouse click
-        function cl()
-        {
-          e = window.event.srcElement;
-          
-          // make sure we are handling clicks upon expandable container elements
-          if (e.className != "c")
-          {
-            e = e.parentElement;
-            if (e.className != "c")
-            {
-              return;
-            }
-          }
-          e = e.parentElement;
-          
-          // call the correct funtion to change the collapse/expand state and display
-          if (e.className == "e")
-            ch(e);
-          if (e.className == "k")
-            ch2(e);
-        }
-        
-        // Erase bogus link info from the status window
-        function h()
-        {
-          window.status=" ";
-        }
-
-        // Set the onclick handler
-        document.onclick = cl;
-        
-      ]]>//</xsl:comment></SCRIPT>
-    </HEAD>
-
-    <BODY class="st"><xsl:apply-templates/></BODY>
-
-  </HTML>
-</xsl:template>
-
-<!-- Templates for each node type follows.  The output of each template has a similar structure
-  to enable script to walk the result tree easily for handling user interaction. -->
-  
-<!-- Template for pis not handled elsewhere -->
-<xsl:template match="processing-instruction()">
-  <DIV class="e">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="m">&lt;?</SPAN><SPAN class="pi"><xsl:value-of select="name(.)"/> <xsl:value-of select="."/></SPAN><SPAN class="m">?&gt;</SPAN>
-  </DIV>
-</xsl:template>
-
-<!-- Template for the XML declaration.  Need a separate template because the pseudo-attributes
-    are actually exposed as attributes instead of just element content, as in other pis 
-<xsl:template match="processing-instruction('xml')">
-  <DIV class="e">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="m">&lt;?</SPAN><SPAN class="pi">xml <xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="."/>" </xsl:for-each></SPAN><SPAN class="m">?&gt;</SPAN>
-  </DIV>
-</xsl:template>
--->
-
-<!-- Template for attributes not handled elsewhere -->
-<xsl:template match="@*"><SPAN class="t"><xsl:text> </xsl:text><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
-
-<!-- Template for attributes in the xmlns or xml namespace
-<xsl:template match="@xmlns:*|@xmlns|@xml:*"><SPAN class="ns"> <xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B class="ns"><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
--->
-
-<!-- Template for text nodes -->
-<xsl:template match="text()">
-  <xsl:choose><xsl:when test="name(.) = '#cdata-section'"><xsl:call-template name="cdata"/></xsl:when>
-  <xsl:otherwise><DIV class="e">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="tx"><xsl:value-of select="."/></SPAN>
-  </DIV></xsl:otherwise></xsl:choose>
-</xsl:template>
-  
-<!-- Template for comment nodes -->
-<xsl:template match="comment()">
-  <DIV class="k">
-  <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m">&lt;!--</SPAN></SPAN>
-  <SPAN id="clean" class="ci"><PRE><xsl:value-of select="."/></PRE></SPAN>
-  <SPAN class="b">&#160;</SPAN> <SPAN class="m">--&gt;</SPAN>
-  <SCRIPT>f(clean);</SCRIPT></DIV>
-</xsl:template>
-
-<!-- Template for cdata nodes -->
-<xsl:template name="cdata">
-  <DIV class="k">
-  <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m">&lt;![CDATA[</SPAN></SPAN>
-  <SPAN id="clean" class="di"><PRE><xsl:value-of select="."/></PRE></SPAN>
-  <SPAN class="b">&#160;</SPAN> <SPAN class="m">]]&gt;</SPAN>
-  <SCRIPT>f(clean);</SCRIPT></DIV>
-</xsl:template>
-
-<!-- Template for elements not handled elsewhere (leaf nodes) -->
-<xsl:template match="*">
-  <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="m">&lt;</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN> <xsl:apply-templates select="@*"/><SPAN class="m"> /&gt;</SPAN>
-  </DIV></DIV>
-</xsl:template>
-  
-<!-- Template for elements with comment, pi and/or cdata children
-<xsl:template match="*[comment() or processing-instruction() or cdata()]">
-  <DIV class="e">
-  <DIV class="c"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m">&lt;</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates select="@*"/> <SPAN class="m">&gt;</SPAN></DIV>
-  <DIV><xsl:apply-templates/>
-  <DIV><SPAN class="b">&#160;</SPAN> <SPAN class="m">&lt;/</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">&gt;</SPAN></DIV>
-  </DIV></DIV>
-</xsl:template> -->
-
-<!-- Template for elements with only text children -->
-<xsl:template match="*[text() and not(comment() or processing-instruction() or *)]">
-  <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
-  <SPAN class="b">&#160;</SPAN> <SPAN class="m">&lt;</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates select="@*"/>
-  <SPAN class="m">&gt;</SPAN><SPAN class="tx"><xsl:value-of select="."/></SPAN><SPAN class="m">&lt;/</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">&gt;</SPAN>
-  </DIV></DIV>
-</xsl:template>
-
-<!-- Template for elements with element children -->
-<xsl:template match="*[*]">
-  <DIV class="e">
-  <DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m">&lt;</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates select="@*"/><SPAN class="m">&gt;</SPAN></DIV>
-  <DIV><xsl:apply-templates/>
-  <DIV><SPAN class="b">&#160;</SPAN><SPAN class="m">&lt;/</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">&gt;</SPAN></DIV>
-  </DIV></DIV>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/servlet/default2.xsl b/samples/servlet/default2.xsl
deleted file mode 100644
index 1619f3f..0000000
--- a/samples/servlet/default2.xsl
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0"?>
-
-<!--                                                                                -->
-<!--  Default XSL stylesheet for use by com.lotus.xsl.server#DefaultApplyXSL.       -->
-<!--                                                                                -->
-<!--  This stylesheet mimics the default behavior of IE when XML data is displayed  -->
-<!--  without a corresponding XSL stylesheet.  This stylesheet uses no JavaScript   -->
-<!--  and displays all nodes as fully expanded.                                     -->
-<!--                                                                                -->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
-                xmlns="http://www.w3.org/TR/REC-html40">
-                
-<xsl:output method="html" indent="no"/>
-<xsl:strip-space elements="*"/>
-
-<xsl:template match="/">
-  <HTML>
-    <HEAD>
-      <STYLE type="text/css">
-        BODY {font:x-small 'Verdana'; margin-right:1.5em}
-      <!-- container for expanding/collapsing content -->
-        .c  {cursor:hand}
-      <!-- button - contains +/-/nbsp -->
-        .b  {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none}
-      <!-- element container -->
-        .e  {margin-left:1em; text-indent:-1em; margin-right:1em}
-      <!-- comment or cdata -->
-        .k  {margin-left:1em; text-indent:-1em; margin-right:1em}
-      <!-- tag -->
-        .t  {color:#990000}
-      <!-- tag in xsl namespace -->
-        .xt {color:#990099}
-      <!-- attribute in xml or xmlns namespace -->
-        .ns {color:red}
-      <!-- markup characters -->
-        .m  {color:blue}
-      <!-- text node -->
-        .tx {font-weight:bold}
-      <!-- multi-line (block) cdata -->
-        .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;
-             padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier}
-      <!-- single-line (inline) cdata -->
-        .di {font:small Courier}
-      <!-- DOCTYPE declaration -->
-        .d  {color:blue}
-      <!-- pi -->
-        .pi {color:blue}
-      <!-- multi-line (block) comment -->
-        .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;
-             padding-left:.3em; font:small Courier; color:#888888}
-      <!-- single-line (inline) comment -->
-        .ci {font:small Courier; color:#888888}
-        PRE {margin:0px; display:inline}
-      </STYLE>
-    </HEAD>
-
-    <BODY class="st"><xsl:apply-templates/></BODY>
-
-  </HTML>
-</xsl:template>
-
-<!-- Templates for each node type follows.  The output of each template has a similar structure
-  to enable script to walk the result tree easily for handling user interaction. -->
-  
-<!-- Template for pis not handled elsewhere -->
-<xsl:template match="processing-instruction()">
-  <DIV class="e">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="m">&lt;?</SPAN><SPAN class="pi"><xsl:value-of select="name(.)"/> <xsl:value-of select="."/></SPAN><SPAN class="m">?&gt;</SPAN>
-  </DIV>
-</xsl:template>
-
-<!-- Template for the XML declaration.  Need a separate template because the pseudo-attributes
-    are actually exposed as attributes instead of just element content, as in other pis 
-<xsl:template match="processing-instruction('xml')">
-  <DIV class="e">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="m">&lt;?</SPAN><SPAN class="pi">xml <xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="."/>" </xsl:for-each></SPAN><SPAN class="m">?&gt;</SPAN>
-  </DIV>
-</xsl:template>
--->
-
-<!-- Template for attributes not handled elsewhere -->
-<xsl:template match="@*"><SPAN class="t"><xsl:text> </xsl:text><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
-
-<!-- Template for attributes in the xmlns or xml namespace
-<xsl:template match="@xmlns:*|@xmlns|@xml:*"><SPAN class="ns"> <xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B class="ns"><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
--->
-
-<!-- Template for text nodes -->
-<xsl:template match="text()">
-  <xsl:choose><xsl:when test="name(.) = '#cdata-section'"><xsl:call-template name="cdata"/></xsl:when>
-  <xsl:otherwise><DIV class="e">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="tx"><xsl:value-of select="."/></SPAN>
-  </DIV></xsl:otherwise></xsl:choose>
-</xsl:template>
-  
-<!-- Template for comment nodes -->
-<xsl:template match="comment()">
-  <DIV class="k">
-  <SPAN><SPAN class="b" STYLE="visibility:hidden">-</SPAN> <SPAN class="m">&lt;!--</SPAN></SPAN>
-  <SPAN class="cb"><PRE><xsl:value-of select="."/></PRE></SPAN>
-  <SPAN class="b">&#160;</SPAN> <SPAN class="m">--&gt;</SPAN>
-  </DIV>
-</xsl:template>
-
-<!-- Template for cdata nodes -->
-<xsl:template name="cdata">
-  <DIV class="k">
-  <SPAN><SPAN class="b" STYLE="visibility:hidden">-</SPAN> <SPAN class="m">&lt;![CDATA[</SPAN></SPAN>
-  <SPAN class="db"><PRE><xsl:value-of select="."/></PRE></SPAN>
-  <SPAN class="b">&#160;</SPAN> <SPAN class="m">]]&gt;</SPAN>
-  </DIV>
-</xsl:template>
-
-<!-- Template for elements not handled elsewhere (leaf nodes) -->
-<xsl:template match="*">
-  <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
-  <SPAN class="b">&#160;</SPAN>
-  <SPAN class="m">&lt;</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN> <xsl:apply-templates select="@*"/><SPAN class="m"> /&gt;</SPAN>
-  </DIV></DIV>
-</xsl:template>
-  
-<!-- Template for elements with comment, pi and/or cdata children
-<xsl:template match="*[comment() or processing-instruction() or cdata()]">
-  <DIV class="e">
-  <DIV class="c"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m">&lt;</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates select="@*"/> <SPAN class="m">&gt;</SPAN></DIV>
-  <DIV><xsl:apply-templates/>
-  <DIV><SPAN class="b">&#160;</SPAN> <SPAN class="m">&lt;/</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">&gt;</SPAN></DIV>
-  </DIV></DIV>
-</xsl:template> -->
-
-<!-- Template for elements with only text children -->
-<xsl:template match="*[text() and not(comment() or processing-instruction() or *)]">
-  <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
-  <SPAN class="b">&#160;</SPAN> <SPAN class="m">&lt;</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates select="@*"/>
-  <SPAN class="m">&gt;</SPAN><SPAN class="tx"><xsl:value-of select="."/></SPAN><SPAN class="m">&lt;/</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">&gt;</SPAN>
-  </DIV></DIV>
-</xsl:template>
-
-<!-- Template for elements with element children -->
-<xsl:template match="*[*]">
-  <DIV class="e">
-  <DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><SPAN class="b">-</SPAN><SPAN class="m">&lt;</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates select="@*"/> <SPAN class="m">&gt;</SPAN></DIV>
-  <DIV><xsl:apply-templates/>
-  <DIV><SPAN class="b">&#160;</SPAN> <SPAN class="m">&lt;/</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">&gt;</SPAN></DIV>
-  </DIV></DIV>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/servlet/fooparam.xml b/samples/servlet/fooparam.xml
deleted file mode 100644
index 03c32b5..0000000
--- a/samples/servlet/fooparam.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<doc>Hello</doc>
diff --git a/samples/servlet/fooparam.xsl b/samples/servlet/fooparam.xsl
deleted file mode 100644
index 34d0fce..0000000
--- a/samples/servlet/fooparam.xsl
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  <xsl:param name="param1" select="'default value'"/>
-  <xsl:template match="doc">
-    <html>
-      <head><title>Stylesheet parameter</title></head>
-      <body>
-        <h2>XML source</h2>
-          <p><xsl:value-of select="."/></p>
-        <h2>Stylesheet parameter</h2>
-          <p>The param1 stylesheet parameter has been set to <xsl:value-of select="$param1"/>.</p>
-      </body>
-     </html>          
-  </xsl:template>
-</xsl:stylesheet>
diff --git a/samples/servlet/jspSample.jsp b/samples/servlet/jspSample.jsp
deleted file mode 100644
index 773930c..0000000
--- a/samples/servlet/jspSample.jsp
+++ /dev/null
@@ -1,42 +0,0 @@
-<%@ page language="java" contentType="text/html" %>
-<%@ page import="javax.xml.transform.*"%>
-<%@ page import="javax.xml.transform.stream.*"%>
-<html>
-<head>
-<title>JSP sample passing a parameter to XSL</title>
-</head>
-<body>
-<%
-/**
- * This JSP uses PMA to set param1 in the
-*  foo.xsl stylesheet before using the
- * stylesheet to transform foo.xml
- * and outputing the result.
- *
- * Invoke the jsp from the appropriate
- * context for your servlet/jsp server.
- * For example: http://localhost:8080/samples/jspSample.jsp?HellowWorld!&XML=foo.xml&XSL=foo.xsl
- * This example assumes that foo.xsl and foo.xml
- * are in the same directory. 
- * Output should be Hello (from foo.xsml) and HelloWorld!
- * (value of param1 in foo.xsl).
-
- *@author Paul Campbell seapwc@halcyon.com
- *@version $Id$
- */
- 
-
-String paramValue = request.getParameter("PMA");
-String xmlFile    = request.getParameter("XML");
-String xslFile    = request.getParameter("XSL");
-
-TransformerFactory tFactory = 
-	TransformerFactory.newInstance();
-Transformer transformer =
-	tFactory.newTransformer(new StreamSource(xslFile));
-	transformer.setParameter("param1", paramValue);
-	transformer.transform(
-		 new StreamSource(xmlFile), new StreamResult(out));
-%>
-</body>
-</html>
diff --git a/samples/servlet/media.properties b/samples/servlet/media.properties
deleted file mode 100644
index 1b3cf45..0000000
--- a/samples/servlet/media.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-# This property file is used by com.lotus.xsl.server.DefaultApplyXSL.
-#
-# Each line below specifies a mapping rule between a value contained in the HTTP request's user-Agent 
-# field and a value to be scanned for in XSL stylesheet(s) associated with the XML data. This mapping 
-# enables relationships to be defined between client capabilities and stylesheets capable of acting 
-# on these capabilities.
-#
-# The rules defined below are order-significant.  In other words, if the first rule is unsuccessful,
-# the second rule will be tried, etc.  The media value "unknown" will be used when no rules are
-# satisfied.
-#
-# Example: 
-#
-# Mapping rules of...
-#
-#   MSIE=explorer
-#   MSPIE=pocketexplorer
-#
-# ...and XML data that contains XSL stylesheet associations of...
-#
-# <?xml-stylesheet                 media="explorer"       href="alldata.xsl"  type="text/xsl"?>
-# <?xml-stylesheet alternate="yes" media="pocketexplorer" href="somedata.xsl" type="text/xsl"?>
-#
-# ...and an HTTP request that contains a user-Agent value of...
-#    
-#   foo MSPIE bar
-#
-# ...will apply the XSL stylesheet somedata.xsl.
-#
-MSIE=explorer
-MSPIE=pocketexplorer
-HandHTTP=handweb
-Mozilla=netscape
-Lynx=lynx
-Opera=opera
-Java=java
-AvantGo=avantgo
-Nokia=nokia
-UP.Browser=up
-DoCoMo=imode
diff --git a/samples/servlet/readme.html b/samples/servlet/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/servlet/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/translets/JAXPTransletMultipleTransformations.java b/samples/translets/JAXPTransletMultipleTransformations.java
deleted file mode 100644
index 97e4884..0000000
--- a/samples/translets/JAXPTransletMultipleTransformations.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Donald Leslie
- *
- */
-import java.util.Properties;
-import java.io.FileOutputStream;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Templates;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import org.xml.sax.SAXException;
-import javax.xml.parsers.ParserConfigurationException;
-
-
-/**
- * Using the TrAX/JAXP 1.1 interface to compile a translet and use it 
- * to perform multiple transformations. The translet implements 
- * the Templates interface. If you want to use the translet to perform a 
- * single transformation, see JAXPTransletOneTransformation.java.
- * 
- * 
- */
-public class JAXPTransletMultipleTransformations 
-{
- static void doTransform(Templates translet, String xmlInURI, String htmlOutURI)
-        throws TransformerException, FileNotFoundException     
-  {
-    // For each transformation, instantiate a new Transformer, and perform
-    // the transformation from a StreamSource to a StreamResult;
-    Transformer transformer = translet.newTransformer();
-    transformer.transform( new StreamSource(xmlInURI),
-                           new StreamResult(new FileOutputStream(htmlOutURI)));
-  }
-
-  public static void main(String argv[])        
-  { 
-    // Set the TransformerFactory system property to generate and use translets.
-    // Note: To make this sample more flexible, load properties from a properties file.
-    // The setting for the Xalan Transformer is "org.apache.xalan.processor.TransformerFactoryImpl"
-    String key = "javax.xml.transform.TransformerFactory";
-    String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
-    Properties props = System.getProperties();
-    props.put(key, value);
-    
-    System.setProperties(props);
-
-    String xslInURI = "todo.xsl";
-    
-    try
-    {
-      // Instantiate the TransformerFactory, and use it along with a SteamSource
-      // XSL stylesheet to create a translet as a Templates object.
-      TransformerFactory tFactory = TransformerFactory.newInstance();
-      Templates translet = tFactory.newTemplates(new StreamSource(xslInURI));
-    
-      // Perform each transformation
-      doTransform(translet, "../../xsltc_todo.xml", "todo-xsltc.html");
-      System.out.println("Produced todo-xsltc.html");
-    
-      doTransform(translet, "../../todo.xml", "todo-xalan.html");
-      System.out.println("Produced todo-xalan.html");
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }    
-  } 
-}
\ No newline at end of file
diff --git a/samples/translets/JAXPTransletOneTransformation.java b/samples/translets/JAXPTransletOneTransformation.java
deleted file mode 100644
index 30e2d4e..0000000
--- a/samples/translets/JAXPTransletOneTransformation.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Donald Leslie
- *
- */
-import java.util.Properties;
-import java.io.FileOutputStream;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Templates;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import org.xml.sax.SAXException;
-import javax.xml.parsers.ParserConfigurationException;
-
-
-/**
- * Using the TrAX/JAXP 1.1 interface to compile and run a translet. The translet
- * extends the abstract Transformer class and is used to perform a single
- * transformation. If you want to use the translet to perform multiple 
- * transformations, see JAXPTransletMultipleTransformations.java.
- * 
- */
-public class JAXPTransletOneTransformation
-{
-  public static void main(String argv[])
-          throws TransformerException, TransformerConfigurationException, IOException, SAXException,
-                 ParserConfigurationException, FileNotFoundException
-  { 
-    // Set the TransformerFactory system property to generate and use a translet.
-    // Note: To make this sample more flexible, load properties from a properties file.    
-    // The setting for the Xalan Transformer is "org.apache.xalan.processor.TransformerFactoryImpl"
-    String key = "javax.xml.transform.TransformerFactory";
-    String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
-    Properties props = System.getProperties();
-    props.put(key, value);
-    System.setProperties(props);    
-
-    String xslInURI = "todo.xsl";
-    String xmlInURI = "../../xsltc_todo.xml";
-    String htmlOutURI = "todo-xsltc.html";
-    try
-    {
-      // Instantiate the TransformerFactory, and use it along with a SteamSource
-      // XSL stylesheet to create a Transformer.
-      TransformerFactory tFactory = TransformerFactory.newInstance();
-      Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
-      // Perform the transformation from a StreamSource to a StreamResult;
-      transformer.transform(new StreamSource(xmlInURI),
-                            new StreamResult(new FileOutputStream(htmlOutURI)));  
-      System.out.println("Produced todo-xsltc.html");  
-    }
-    catch (Exception e) 
-    {
-     System.out.println(e.toString());
-     e.printStackTrace();
-    }      
-  }
-}
\ No newline at end of file
diff --git a/samples/translets/readme.html b/samples/translets/readme.html
deleted file mode 100644
index ec8936f..0000000
--- a/samples/translets/readme.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>Xalan Samples</title>
-</head>
-<body>
-<h2>Xalan Samples</h2>
-<p>For information about the samples (what they illustrate and how to run them), see <a href="../../docs/samples.html">Samples</a>.</p>
-
-
-</body>
-</html>
diff --git a/samples/translets/todo.xsl b/samples/translets/todo.xsl
deleted file mode 100644
index 6ff8cac..0000000
--- a/samples/translets/todo.xsl
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-<xsl:variable name="title" select="concat(todo/@project, ' ', todo/@major-version)"/>
-  <xsl:template match="/">
-    <HTML>
-      <HEAD>
-         <TITLE><xsl:value-of select="$title"/></TITLE>
-      </HEAD>
-      <BODY>
-
-        <H2><xsl:value-of select="concat($title, ': ', todo/@title)"/></H2>
-        <p><font size="-1">See a 
-          <xsl:element name="a">
-            <xsl:attribute name="href">#developer-list</xsl:attribute>
-            <xsl:text>list of developers/initials.</xsl:text>
-          </xsl:element>
-        </font></p>
-        <font size="-1"><p>Planned releases: 
-            <BR/><xsl:for-each select="todo/actions/target-release-description">
-              <xsl:element name="a">
-                <xsl:attribute name="href">#release-date-<xsl:value-of select="date"/></xsl:attribute>
-                <xsl:value-of select="date"/>
-              </xsl:element><xsl:text> </xsl:text><xsl:text> </xsl:text>
-            </xsl:for-each>
-            <xsl:element name="a">
-                <xsl:attribute name="href">#release-date-completed</xsl:attribute>
-                <xsl:text>Completed</xsl:text>
-              </xsl:element>
-
-        </p></font>
-        <xsl:for-each select="todo">
-          <xsl:for-each select="actions">
-              <xsl:for-each select="target-release-description">
-                <p>
-                  <xsl:apply-templates/>
-                </p>
-              </xsl:for-each>
-              <xsl:for-each select="action">
-                <xsl:if test="normalize-space(.)">
-                  <p>
-                   <xsl:number/>) <xsl:apply-templates/>
-                   <xsl:if test="@*">
-                    <BR/>
-                   </xsl:if>
-                   <xsl:apply-templates select="@*"/>
-                  </p>
-                </xsl:if>
-            </xsl:for-each>
-            <HR/>
-          </xsl:for-each>
-
-          <xsl:for-each select="completed">
-              <xsl:element name="a">
-                <xsl:attribute name="name">release-date-completed</xsl:attribute>
-                <H3>Completed: </H3>
-              </xsl:element>
-            <xsl:for-each select="action">
-              <xsl:if test="normalize-space(.)">
-                <p>
-                 <xsl:number/>) <xsl:apply-templates/>
-                 <xsl:if test="@*">
-                  <BR/>
-                 </xsl:if>
-                 <xsl:apply-templates select="@*"/>
-                </p>
-              </xsl:if>
-          </xsl:for-each>
-          <HR/>
-        </xsl:for-each>
-
-        <xsl:call-template name="developer-list"/>
-       </xsl:for-each>
-
-      </BODY>
-    </HTML>
-  </xsl:template>
-
-  <xsl:template match="action/@*">
-  <!-- Add link to the who attributes to corresponding item in developer-list -->
-    <b><xsl:value-of select="name(.)"/>:</b><xsl:text> </xsl:text>
-      <xsl:choose>
-        <xsl:when test="name(.)='who'">
-          <xsl:element name="a">
-            <xsl:attribute name="href">#personref-<xsl:value-of select="."/></xsl:attribute>
-            <xsl:value-of select="."/>
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."/>
-        </xsl:otherwise>
-      </xsl:choose>
-    <xsl:if test="not (position()=last())">
-      <xsl:text>, </xsl:text>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="target-release-description/date">
-      <xsl:element name="a">
-        <xsl:attribute name="name">release-date-<xsl:value-of select="."/></xsl:attribute>
-        <b><xsl:text>For release: </xsl:text><xsl:value-of select="."/></b>
-      </xsl:element>
-    
-  </xsl:template>
-
-  <xsl:template match="issue">
-    <BR/><b>Issue </b><xsl:text>[</xsl:text><xsl:value-of select="@id"/>
-    <xsl:text>]: </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="target-release-description/level">
-    <xsl:text>, </xsl:text><xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="target-release-description/goal">
-    <BR/><b>Goal </b><xsl:text>[</xsl:text><xsl:value-of select="@type"/>
-    <xsl:text>]: </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-
-
-  <xsl:template name="developer-list">
-    <H3>
-      <xsl:element name="a">
-        <xsl:attribute name="name">developer-list</xsl:attribute>
-        <xsl:text>Developers:</xsl:text>
-      </xsl:element>
-    </H3>
-    <p>A list of some of people currently working on working on <xsl:value-of select="/todo/@project"/>:</p>
-    <ul>
-    <xsl:for-each select="devs/person">
-      <li>
-        <a href="mailto:{@email}">
-          <xsl:value-of select="@name"/>
-        </a>
-         <xsl:element name="a">
-           <xsl:attribute name="name"><xsl:text>personref-</xsl:text><xsl:value-of select="@id"/></xsl:attribute>
-           <xsl:text> (</xsl:text><xsl:value-of select="@id"/><xsl:text>)</xsl:text>
-         </xsl:element>
-         <BR/><xsl:value-of select="."/>
-      </li>
-    </xsl:for-each>
-    </ul>
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/samples/trax/ExampleContentHandler.java b/samples/trax/ExampleContentHandler.java
deleted file mode 100644
index 3e308f4..0000000
--- a/samples/trax/ExampleContentHandler.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.Locator;
-
-public class ExampleContentHandler implements ContentHandler
-{
-  public void setDocumentLocator (Locator locator)
-  {
-    System.out.println("setDocumentLocator");
-  }
-
-
-  public void startDocument ()
-    throws SAXException
-  {
-    System.out.println("startDocument");
-  }
-
-
-  public void endDocument()
-    throws SAXException
-  {
-    System.out.println("endDocument");
-  }
-
-
-  public void startPrefixMapping (String prefix, String uri)
-    throws SAXException
-  {
-    System.out.println("startPrefixMapping: "+prefix+", "+uri);
-  }
-
-
-  public void endPrefixMapping (String prefix)
-    throws SAXException
-  {
-    System.out.println("endPrefixMapping: "+prefix);
-  }
-
-
-  public void startElement (String namespaceURI, String localName,
-                            String qName, Attributes atts)
-    throws SAXException
-  {
-    System.out.print("startElement: "+namespaceURI+", "+namespaceURI+
-                       ", "+qName);
-    int n = atts.getLength();
-    for(int i = 0; i < n; i++)
-    {
-      System.out.print(", "+atts.getQName(i));
-    }
-    System.out.println("");
-  }
-
-
-  public void endElement (String namespaceURI, String localName,
-                          String qName)
-    throws SAXException
-  {
-    System.out.println("endElement: "+namespaceURI+", "+namespaceURI+
-                       ", "+qName);
-  }
-
-
-  public void characters (char ch[], int start, int length)
-    throws SAXException
-  {
-    String s = new String(ch, start, (length > 30) ? 30 : length);
-    if(length > 30)
-      System.out.println("characters: \""+s+"\"...");
-    else
-      System.out.println("characters: \""+s+"\"");
-  }
-
-
-  public void ignorableWhitespace (char ch[], int start, int length)
-    throws SAXException
-  {
-    System.out.println("ignorableWhitespace");
-  }
-
-
-  public void processingInstruction (String target, String data)
-    throws SAXException
-  {
-    System.out.println("processingInstruction: "+target+", "+target);
-  }
-
-
-  public void skippedEntity (String name)
-    throws SAXException
-  {
-    System.out.println("skippedEntity: "+name);
-  }
-
-}
diff --git a/samples/trax/Examples.java b/samples/trax/Examples.java
deleted file mode 100644
index c753268..0000000
--- a/samples/trax/Examples.java
+++ /dev/null
@@ -1,880 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import javax.xml.transform.*;
-import javax.xml.transform.sax.*;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.stream.*;
-
-// Needed java classes
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-
-import java.util.Properties;
-
-// Needed SAX classes
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.Parser;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.XMLReader;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ext.DeclHandler;
-
-// Needed DOM classes
-import org.w3c.dom.Node;
-
-// Needed JAXP classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import java.io.BufferedInputStream;    // dml
-
-/**
- * Some examples to show how the Simple API for Transformations
- * could be used.
- * 
- * Xalan Developers: please see 
- * xml-xalan/test/java/src/org/apache/qetest/trax/ExamplesTest.java
- * when updating this file, and update that test file as well.
- *
- * @author <a href="mailto:scott_boag@lotus.com">Scott Boag</a>
- */
-public class Examples
-{
-  /**
-   * Method main
-   */
-  public static void main(String argv[])
-          throws TransformerException, TransformerConfigurationException, IOException, SAXException,
-                 ParserConfigurationException, FileNotFoundException
-  {
-    System.out.println("\n\n==== exampleSimple ====");
-    try {
-        exampleSimple1("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleSimple2 (see foo.out) ====");
-    try {
-        exampleSimple2("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleFromStream ====");
-    try {
-        exampleFromStream("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleFromReader ====");
-    try {
-        exampleFromReader("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleUseTemplatesObj ====");
-    try {
-        exampleUseTemplatesObj("xml/foo.xml", "xml/baz.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleContentHandlerToContentHandler ====");
-    try {
-        exampleContentHandlerToContentHandler("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleXMLReader ====");
-    try {
-        exampleXMLReader("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleXMLFilter ====");
-    try {
-        exampleXMLFilter("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleXMLFilterChain ====");
-    try {
-        exampleXMLFilterChain("xml/foo.xml", "xsl/foo.xsl", "xsl/foo2.xsl", "xsl/foo3.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleDOM2DOM ====");
-    try {
-        exampleDOM2DOM("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleParam ====");
-    try {
-        exampleParam("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleTransformerReuse ====");
-    try {
-        exampleTransformerReuse("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleOutputProperties ====");
-    try {
-        exampleOutputProperties("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleUseAssociated ====");
-    try {
-        exampleUseAssociated("xml/foo.xml");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleContentHandler2DOM ====");
-    try {
-        exampleContentHandler2DOM("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleAsSerializer ====");
-    try {
-        exampleAsSerializer("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-    
-    System.out.println("\n\n==== exampleContentHandler2DOM ====");
-    try {
-        exampleContentHandler2DOM("xml/foo.xml", "xsl/foo.xsl");
-    } catch( Exception ex ) { 
-        handleException(ex);
-    } 
-
-    System.out.println("\n==== done! ====");
-  }
-  
-  /**
-   * Show the simplest possible transformation from system id 
-   * to output stream.
-   */
-  public static void exampleSimple1(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException
-  {
-    // Create a transform factory instance.
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    
-    // Create a transformer for the stylesheet.
-    Transformer transformer 
-      = tfactory.newTransformer(new StreamSource(xslID));
-    
-    // Transform the source XML to System.out.
-    transformer.transform( new StreamSource(sourceID),
-                           new StreamResult(System.out));
-  }
-  
-  /**
-   * Show the simplest possible transformation from File 
-   * to a File.
-   */
-  public static void exampleSimple2(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException
-  {
-    // Create a transform factory instance.
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    
-    // Create a transformer for the stylesheet.
-    Transformer transformer 
-      = tfactory.newTransformer(new StreamSource(xslID));
-    
-    // Transform the source XML to foo.out.
-    transformer.transform( new StreamSource(new File(sourceID)),
-                           new StreamResult(new File("foo.out")));
-  }
-
-  
-  /**
-   * Show simple transformation from input stream to output stream.
-   */
-  public static void exampleFromStream(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException,
-           FileNotFoundException
-  {
-    // Create a transform factory instance.
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    InputStream xslIS = new BufferedInputStream(new FileInputStream(xslID));
-    StreamSource xslSource = new StreamSource(xslIS);
-    // Note that if we don't do this, relative URLs can not be resolved correctly!
-    xslSource.setSystemId(xslID);
-
-    // Create a transformer for the stylesheet.
-    Transformer transformer = tfactory.newTransformer(xslSource);
-    
-    InputStream xmlIS = new BufferedInputStream(new FileInputStream(sourceID));
-    StreamSource xmlSource = new StreamSource(xmlIS);
-    // Note that if we don't do this, relative URLs can not be resolved correctly!
-    xmlSource.setSystemId(sourceID);
-    
-    // Transform the source XML to System.out.
-    transformer.transform( xmlSource, new StreamResult(System.out));
-  }
-  
-  /**
-   * Show simple transformation from reader to output stream.  In general 
-   * this use case is discouraged, since the XML encoding can not be 
-   * processed.
-   */
-  public static void exampleFromReader(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException,
-           FileNotFoundException
-  {
-    // Create a transform factory instance.
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    // Note that in this case the XML encoding can not be processed!
-    Reader xslReader = new BufferedReader(new FileReader(xslID));
-    StreamSource xslSource = new StreamSource(xslReader);
-    // Note that if we don't do this, relative URLs can not be resolved correctly!
-    xslSource.setSystemId(xslID);
-
-    // Create a transformer for the stylesheet.
-    Transformer transformer = tfactory.newTransformer(xslSource);
-    
-    // Note that in this case the XML encoding can not be processed!
-    Reader xmlReader = new BufferedReader(new FileReader(sourceID));
-    StreamSource xmlSource = new StreamSource(xmlReader);
-    // Note that if we don't do this, relative URLs can not be resolved correctly!
-    xmlSource.setSystemId(sourceID);
-    
-    // Transform the source XML to System.out.
-    transformer.transform( xmlSource, new StreamResult(System.out));
-  }
-
-
- 
-  /**
-   * Show the simplest possible transformation from system id to output stream.
-   */
-  public static void exampleUseTemplatesObj(String sourceID1, 
-                                    String sourceID2, 
-                                    String xslID)
-          throws TransformerException, TransformerConfigurationException
-  {
-
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    
-    // Create a templates object, which is the processed, 
-    // thread-safe representation of the stylesheet.
-    Templates templates = tfactory.newTemplates(new StreamSource(xslID));
-
-    // Illustrate the fact that you can make multiple transformers 
-    // from the same template.
-    Transformer transformer1 = templates.newTransformer();
-    Transformer transformer2 = templates.newTransformer();
-    
-    System.out.println("\n\n----- transform of "+sourceID1+" -----");
-    
-    transformer1.transform(new StreamSource(sourceID1),
-                          new StreamResult(System.out));
-    
-    System.out.println("\n\n----- transform of "+sourceID2+" -----");
-    
-    transformer2.transform(new StreamSource(sourceID2),
-                          new StreamResult(System.out));
-  }
-  
-
-
-  /**
-   * Show the Transformer using SAX events in and SAX events out.
-   */
-  public static void exampleContentHandlerToContentHandler(String sourceID, 
-                                                           String xslID)
-          throws TransformerException, 
-                 TransformerConfigurationException, 
-                 SAXException, IOException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    // Does this factory support SAX features?
-    if (tfactory.getFeature(SAXSource.FEATURE))
-    {
-      // If so, we can safely cast.
-      SAXTransformerFactory stfactory = ((SAXTransformerFactory) tfactory);
-      
-      // A TransformerHandler is a ContentHandler that will listen for 
-      // SAX events, and transform them to the result.
-      TransformerHandler handler 
-        = stfactory.newTransformerHandler(new StreamSource(xslID));
-
-      // Set the result handling to be a serialization to System.out.
-      Result result = new SAXResult(new ExampleContentHandler());
-      handler.setResult(result);
-      
-      // Create a reader, and set it's content handler to be the TransformerHandler.
-      XMLReader reader=null;
-
-      // Use JAXP1.1 ( if possible )
-      try {
-	  javax.xml.parsers.SAXParserFactory factory=
-	      javax.xml.parsers.SAXParserFactory.newInstance();
-	  factory.setNamespaceAware( true );
-	  javax.xml.parsers.SAXParser jaxpParser=
-	      factory.newSAXParser();
-	  reader=jaxpParser.getXMLReader();
-	  
-      } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-	  throw new org.xml.sax.SAXException( ex );
-      } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-	  throw new org.xml.sax.SAXException( ex1.toString() );
-      } catch( NoSuchMethodError ex2 ) {
-      }
-      if( reader==null ) reader = XMLReaderFactory.createXMLReader();
-      reader.setContentHandler(handler);
-      
-      // It's a good idea for the parser to send lexical events.
-      // The TransformerHandler is also a LexicalHandler.
-      reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
-      
-      // Parse the source XML, and send the parse events to the TransformerHandler.
-      reader.parse(sourceID);
-    }
-    else
-    {
-      System.out.println(
-        "Can't do exampleContentHandlerToContentHandler because tfactory is not a SAXTransformerFactory");
-    }
-  }
-  
-  /**
-   * Show the Transformer as a SAX2 XMLReader.  An XMLFilter obtained 
-   * from newXMLFilter should act as a transforming XMLReader if setParent is not
-   * called.  Internally, an XMLReader is created as the parent for the XMLFilter.
-   */
-  public static void exampleXMLReader(String sourceID, String xslID)
-          throws TransformerException, TransformerConfigurationException, SAXException, IOException    // , ParserConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    if(tfactory.getFeature(SAXSource.FEATURE))
-    {
-      XMLReader reader 
-        = ((SAXTransformerFactory) tfactory).newXMLFilter(new StreamSource(xslID));
-      
-      reader.setContentHandler(new ExampleContentHandler());
-
-      reader.parse(new InputSource(sourceID));
-    }
-    else
-      System.out.println("tfactory does not support SAX features!");
-  }
-
-  /**
-   * Show the Transformer as a simple XMLFilter.  This is pretty similar
-   * to exampleXMLReader, except that here the parent XMLReader is created 
-   * by the caller, instead of automatically within the XMLFilter.  This 
-   * gives the caller more direct control over the parent reader.
-   */
-  public static void exampleXMLFilter(String sourceID, String xslID)
-          throws TransformerException, TransformerConfigurationException, SAXException, IOException    // , ParserConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    XMLReader reader=null;
-    
-    // Use JAXP1.1 ( if possible )
-    try {
-	javax.xml.parsers.SAXParserFactory factory=
-	    javax.xml.parsers.SAXParserFactory.newInstance();
-	  factory.setNamespaceAware( true );
-	  javax.xml.parsers.SAXParser jaxpParser=
-	    factory.newSAXParser();
-	reader=jaxpParser.getXMLReader();
-	
-    } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-	throw new org.xml.sax.SAXException( ex );
-    } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-	throw new org.xml.sax.SAXException( ex1.toString() );
-    } catch( NoSuchMethodError ex2 ) {
-    }
-    if( reader==null ) reader = XMLReaderFactory.createXMLReader();
-    // The transformer will use a SAX parser as it's reader.    
-    reader.setContentHandler(new ExampleContentHandler());
-    try
-    {
-      reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                        true);
-      reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-                        true);
-    }
-    catch (SAXException se)
-    {
-
-      // What can we do?
-      // TODO: User diagnostics.
-    }
-
-    XMLFilter filter 
-      = ((SAXTransformerFactory) tfactory).newXMLFilter(new StreamSource(xslID));
-
-    filter.setParent(reader);
-
-    // Now, when you call transformer.parse, it will set itself as 
-    // the content handler for the parser object (it's "parent"), and 
-    // will then call the parse method on the parser.
-    filter.parse(new InputSource(sourceID));
-  }
-
-  /**
-   * This example shows how to chain events from one Transformer
-   * to another transformer, using the Transformer as a
-   * SAX2 XMLFilter/XMLReader.
-   */
-  public static void exampleXMLFilterChain(
-                                           String sourceID, String xslID_1, 
-                                           String xslID_2, String xslID_3)
-    throws TransformerException, TransformerConfigurationException, SAXException, IOException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    
-    Templates stylesheet1 = tfactory.newTemplates(new StreamSource(xslID_1));
-    Transformer transformer1 = stylesheet1.newTransformer();
-    
-     // If one success, assume all will succeed.
-    if (tfactory.getFeature(SAXSource.FEATURE))
-    {
-      SAXTransformerFactory stf = (SAXTransformerFactory)tfactory;
-      XMLReader reader=null;
-
-      // Use JAXP1.1 ( if possible )
-      try {
-	  javax.xml.parsers.SAXParserFactory factory=
-	      javax.xml.parsers.SAXParserFactory.newInstance();
-	  factory.setNamespaceAware( true );
-	  javax.xml.parsers.SAXParser jaxpParser=
-	      factory.newSAXParser();
-	  reader=jaxpParser.getXMLReader();
-	  
-      } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-	  throw new org.xml.sax.SAXException( ex );
-      } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-	  throw new org.xml.sax.SAXException( ex1.toString() );
-      } catch( NoSuchMethodError ex2 ) {
-      }
-      if( reader==null ) reader = XMLReaderFactory.createXMLReader();
-
-      XMLFilter filter1 = stf.newXMLFilter(new StreamSource(xslID_1));
-      XMLFilter filter2 = stf.newXMLFilter(new StreamSource(xslID_2));
-      XMLFilter filter3 = stf.newXMLFilter(new StreamSource(xslID_3));
-
-      if (null != filter1) // If one success, assume all were success.
-      {
-        // transformer1 will use a SAX parser as it's reader.    
-        filter1.setParent(reader);
-
-        // transformer2 will use transformer1 as it's reader.
-        filter2.setParent(filter1);
-
-        // transform3 will use transform2 as it's reader.
-        filter3.setParent(filter2);
-
-        filter3.setContentHandler(new ExampleContentHandler());
-        // filter3.setContentHandler(new org.xml.sax.helpers.DefaultHandler());
-
-        // Now, when you call transformer3 to parse, it will set  
-        // itself as the ContentHandler for transform2, and 
-        // call transform2.parse, which will set itself as the 
-        // content handler for transform1, and call transform1.parse, 
-        // which will set itself as the content listener for the 
-        // SAX parser, and call parser.parse(new InputSource("xml/foo.xml")).
-        filter3.parse(new InputSource(sourceID));
-      }
-      else
-      {
-        System.out.println(
-                           "Can't do exampleXMLFilter because "+
-                           "tfactory doesn't support asXMLFilter()");
-      }
-    }
-    else
-    {
-      System.out.println(
-                         "Can't do exampleXMLFilter because "+
-                         "tfactory is not a SAXTransformerFactory");
-    }
-  }
-
-  /**
-   * Show how to transform a DOM tree into another DOM tree.
-   * This uses the javax.xml.parsers to parse an XML file into a
-   * DOM, and create an output DOM.
-   */
-  public static Node exampleDOM2DOM(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException, SAXException, IOException,
-    ParserConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    if (tfactory.getFeature(DOMSource.FEATURE))
-    {
-      Templates templates;
-
-      {
-        DocumentBuilderFactory dfactory =
-          DocumentBuilderFactory.newInstance();
-        dfactory.setNamespaceAware(true);
-        DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-        org.w3c.dom.Document outNode = docBuilder.newDocument();
-        Node doc = docBuilder.parse(new InputSource(xslID));
- 
-        DOMSource dsource = new DOMSource(doc);
-        // If we don't do this, the transformer won't know how to 
-        // resolve relative URLs in the stylesheet.
-        dsource.setSystemId(xslID);
-
-        templates = tfactory.newTemplates(dsource);
-      }
-
-      Transformer transformer = templates.newTransformer();
-      DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-      DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-      org.w3c.dom.Document outNode = docBuilder.newDocument();
-      Node doc = docBuilder.parse(new InputSource(sourceID));
-
-      transformer.transform(new DOMSource(doc), new DOMResult(outNode));
-      
-      Transformer serializer = tfactory.newTransformer();
-      serializer.transform(new DOMSource(outNode), new StreamResult(System.out));
-
-      return outNode;
-    }
-    else
-    {
-      throw new org.xml.sax
-        .SAXNotSupportedException("DOM node processing not supported!");
-    }
-  } 
-
-  /**
-   * This shows how to set a parameter for use by the templates. Use 
-   * two transformers to show that different parameters may be set 
-   * on different transformers.
-   */
-  public static void exampleParam(String sourceID, 
-                                  String xslID)
-    throws TransformerException, TransformerConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    Templates templates = tfactory.newTemplates(new StreamSource(xslID));
-    Transformer transformer1 = templates.newTransformer();
-    Transformer transformer2 = templates.newTransformer();
-
-    transformer1.setParameter("a-param",
-                              "hello to you!");
-    transformer1.transform(new StreamSource(sourceID),
-                           new StreamResult(System.out));
-    
-    System.out.println("\n=========");
-    
-    transformer2.setOutputProperty(OutputKeys.INDENT, "yes");
-    transformer2.transform(new StreamSource(sourceID),
-                           new StreamResult(System.out));
-  }
-  
-  /**
-   * Show the that a transformer can be reused, and show resetting 
-   * a parameter on the transformer.
-   */
-  public static void exampleTransformerReuse(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException
-  {
-    // Create a transform factory instance.
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    
-    // Create a transformer for the stylesheet.
-    Transformer transformer 
-      = tfactory.newTransformer(new StreamSource(xslID));
-    
-    transformer.setParameter("a-param",
-                              "hello to you!");
-    
-    // Transform the source XML to System.out.
-    transformer.transform( new StreamSource(sourceID),
-                           new StreamResult(System.out));
-
-    System.out.println("\n=========\n");
-
-    transformer.setParameter("a-param",
-                              "hello to me!");
-    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-
-    // Transform the source XML to System.out.
-    transformer.transform( new StreamSource(sourceID),
-                           new StreamResult(System.out));
-  }
-
-  /**
-   * Show how to override output properties.
-   */
-  public static void exampleOutputProperties(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException
-  {
-
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-    Templates templates = tfactory.newTemplates(new StreamSource(xslID));
-    Properties oprops = templates.getOutputProperties();
-
-    oprops.put(OutputKeys.INDENT, "yes");
-
-    Transformer transformer = templates.newTransformer();
-
-    transformer.setOutputProperties(oprops);
-    transformer.transform(new StreamSource(sourceID),
-                          new StreamResult(System.out));
-  }
-
-  /**
-   * Show how to get stylesheets that are associated with a given
-   * xml document via the xml-stylesheet PI (see http://www.w3.org/TR/xml-stylesheet/).
-   */
-  public static void exampleUseAssociated(String sourceID)
-    throws TransformerException, TransformerConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    // The DOM tfactory will have it's own way, based on DOM2, 
-    // of getting associated stylesheets.
-    if (tfactory instanceof SAXTransformerFactory)
-    {
-      SAXTransformerFactory stf = ((SAXTransformerFactory) tfactory);
-      Source sources =
-        stf.getAssociatedStylesheet(new StreamSource(sourceID),
-          null, null, null);
-
-      if(null != sources)
-      {
-        Transformer transformer = tfactory.newTransformer(sources);
-
-        transformer.transform(new StreamSource(sourceID),
-                              new StreamResult(System.out));
-      }
-      else
-      {
-        System.out.println("Can't find the associated stylesheet!");
-      }
-    }
-  }
-  
-  /**
-   * Show the Transformer using SAX events in and DOM nodes out.
-   */
-  public static void exampleContentHandler2DOM(String sourceID, String xslID)
-          throws TransformerException, TransformerConfigurationException, SAXException, IOException, ParserConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance();
-
-    // Make sure the transformer factory we obtained supports both
-    // DOM and SAX.
-    if (tfactory.getFeature(SAXSource.FEATURE)
-        && tfactory.getFeature(DOMSource.FEATURE))
-    {
-      // We can now safely cast to a SAXTransformerFactory.
-      SAXTransformerFactory sfactory = (SAXTransformerFactory) tfactory;
-      
-      // Create an Document node as the root for the output.
-      DocumentBuilderFactory dfactory 
-        = DocumentBuilderFactory.newInstance();
-      DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-      org.w3c.dom.Document outNode = docBuilder.newDocument();
-      
-      // Create a ContentHandler that can liston to SAX events 
-      // and transform the output to DOM nodes.
-      TransformerHandler handler 
-        = sfactory.newTransformerHandler(new StreamSource(xslID));
-      handler.setResult(new DOMResult(outNode));
-      
-      // Create a reader and set it's ContentHandler to be the 
-      // transformer.
-      XMLReader reader=null;
-
-      // Use JAXP1.1 ( if possible )
-      try {
-	  javax.xml.parsers.SAXParserFactory factory=
-	      javax.xml.parsers.SAXParserFactory.newInstance();
-	  factory.setNamespaceAware( true );
-	  javax.xml.parsers.SAXParser jaxpParser=
-	      factory.newSAXParser();
-	  reader=jaxpParser.getXMLReader();
-	  
-      } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-	  throw new org.xml.sax.SAXException( ex );
-      } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-	  throw new org.xml.sax.SAXException( ex1.toString() );
-      } catch( NoSuchMethodError ex2 ) {
-      }
-      if( reader==null ) reader= XMLReaderFactory.createXMLReader();
-      reader.setContentHandler(handler);
-      reader.setProperty("http://xml.org/sax/properties/lexical-handler",
-                         handler);
-      
-      // Send the SAX events from the parser to the transformer,
-      // and thus to the DOM tree.
-      reader.parse(sourceID);
-      
-      // Serialize the node for diagnosis.
-      exampleSerializeNode(outNode);
-    }
-    else
-    {
-      System.out.println(
-        "Can't do exampleContentHandlerToContentHandler because tfactory is not a SAXTransformerFactory");
-    }
-  }
-  
-  /**
-   * Serialize a node to System.out.
-   */
-  public static void exampleSerializeNode(Node node)
-    throws TransformerException, TransformerConfigurationException, SAXException, IOException,
-    ParserConfigurationException
-  {
-    TransformerFactory tfactory = TransformerFactory.newInstance(); 
-    
-    // This creates a transformer that does a simple identity transform, 
-    // and thus can be used for all intents and purposes as a serializer.
-    Transformer serializer = tfactory.newTransformer();
-    
-    serializer.setOutputProperty(OutputKeys.INDENT, "yes");
-    serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-    serializer.transform(new DOMSource(node), 
-                         new StreamResult(System.out));
-  }  
-  
-  /**
-   * A fuller example showing how the TrAX interface can be used 
-   * to serialize a DOM tree.
-   */
-  public static void exampleAsSerializer(String sourceID, String xslID)
-    throws TransformerException, TransformerConfigurationException, SAXException, IOException,
-    ParserConfigurationException
-  {
-    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-    DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-    org.w3c.dom.Document outNode = docBuilder.newDocument();
-    Node doc = docBuilder.parse(new InputSource(sourceID));
-
-    TransformerFactory tfactory = TransformerFactory.newInstance(); 
-    
-    // This creates a transformer that does a simple identity transform, 
-    // and thus can be used for all intents and purposes as a serializer.
-    Transformer serializer = tfactory.newTransformer();
-    
-    Properties oprops = new Properties();
-    oprops.put("method", "html");
-    oprops.put("indent-amount", "2");
-    serializer.setOutputProperties(oprops);
-    serializer.transform(new DOMSource(doc), 
-                         new StreamResult(System.out));
-  }
-  
-
-  private static void  handleException( Exception ex ) {
-    System.out.println("EXCEPTION: " );
-    ex.printStackTrace();
-    
-    if( ex instanceof TransformerConfigurationException ) {
-      System.out.println();
-      System.out.println("Internal exception: " );
-      Throwable ex1=((TransformerConfigurationException)ex).getException();
-      ex1.printStackTrace();
-
-      if( ex1 instanceof SAXException ) {
-	  Exception ex2=((SAXException)ex1).getException();
-	  System.out.println("Internal sub-exception: " );
-	  ex2.printStackTrace();
-      }
-    }
-  }
-
-}
diff --git a/samples/trax/xml/baz.xml b/samples/trax/xml/baz.xml
deleted file mode 100644
index 9ecf473..0000000
--- a/samples/trax/xml/baz.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version='1.0'?>
-<foo:document 
-		  xmlns:foo="http://apache.org/foo"
-		  xmlns:bar="http://apache.org/bar">
-<bar:element>MyBaz</bar:element>
-</foo:document>
\ No newline at end of file
diff --git a/samples/trax/xml/foo.xml b/samples/trax/xml/foo.xml
deleted file mode 100644
index 79597ab..0000000
--- a/samples/trax/xml/foo.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version='1.0'?>
-<?xml-stylesheet type="text/xsl" href="../xsl/foo.xsl"?>
-<foo:document 
-		  xmlns:foo="http://apache.org/foo"
-		  xmlns:bar="http://apache.org/bar"
-		  file-name="test"
-         file-path="work"
-		  creation-date="971255692078">
-<bar:element>MyBar</bar:element>
-</foo:document>
\ No newline at end of file
diff --git a/samples/trax/xml/subdir1/foo2.xml b/samples/trax/xml/subdir1/foo2.xml
deleted file mode 100644
index 5708ae4..0000000
--- a/samples/trax/xml/subdir1/foo2.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version='1.0'?>
-<doc>text in foo2.xml</doc>
\ No newline at end of file
diff --git a/samples/trax/xml/subdir1/subdir2/foo3.xml b/samples/trax/xml/subdir1/subdir2/foo3.xml
deleted file mode 100644
index 77da1f0..0000000
--- a/samples/trax/xml/subdir1/subdir2/foo3.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version='1.0'?>
-<doc>text in foo3.xml</doc>
\ No newline at end of file
diff --git a/samples/trax/xsl/baz.xsl b/samples/trax/xsl/baz.xsl
deleted file mode 100644
index c1843b3..0000000
--- a/samples/trax/xsl/baz.xsl
+++ /dev/null
@@ -1,18 +0,0 @@
-<xsl:stylesheet 
-      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-    
-  <!-- same as foo.xsl but doesn't include the param because of a bug -->  
-  <xsl:template match="/">
-    <out>
-      <xsl:apply-templates/>
-    </out>
-  </xsl:template>
-      
-  <xsl:template 
-      match="@*|*|text()|processing-instruction()">
-    <xsl:copy>
-      <xsl:apply-templates 
-         select="@*|*|text()|processing-instruction()"/>
-    </xsl:copy>
-  </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/trax/xsl/foo.xsl b/samples/trax/xsl/foo.xsl
deleted file mode 100644
index b13b945..0000000
--- a/samples/trax/xsl/foo.xsl
+++ /dev/null
@@ -1,27 +0,0 @@
-<xsl:stylesheet 
-      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'
-      xmlns:bar="http://apache.org/bar"
-      exclude-result-prefixes="bar">
-      
-  <xsl:include href="inc1/inc1.xsl"/>
-      
-  <xsl:param name="a-param">default param value</xsl:param>
-  
-  <xsl:template match="bar:element">
-    <bar>
-      <param-val>
-        <xsl:value-of select="$a-param"/><xsl:text>, </xsl:text>
-        <xsl:value-of select="$my-var"/>
-      </param-val>
-      <data><xsl:apply-templates/></data>
-    </bar>
-  </xsl:template>
-      
-  <xsl:template 
-      match="@*|*|text()|processing-instruction()">
-    <xsl:copy>
-      <xsl:apply-templates 
-         select="@*|*|text()|processing-instruction()"/>
-    </xsl:copy>
-  </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/trax/xsl/foo2.xsl b/samples/trax/xsl/foo2.xsl
deleted file mode 100644
index b04f5f0..0000000
--- a/samples/trax/xsl/foo2.xsl
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
-                xmlns:bar="http://apache.org/bar">
-  
-  <xsl:template match="bar">
-    <out>
-      <xsl:value-of select="."/>
-    </out>
-  </xsl:template>
-  
-  <xsl:template match="text()">
-  </xsl:template>  
- 
-</xsl:stylesheet>
diff --git a/samples/trax/xsl/foo3.xsl b/samples/trax/xsl/foo3.xsl
deleted file mode 100644
index a1bf42a..0000000
--- a/samples/trax/xsl/foo3.xsl
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-  
-  <xsl:template match="out">
-    <out>
-      <xsl:apply-templates/>
-    </out>
-  </xsl:template>
-  
-  <xsl:template match="text()">
-    <some-text><xsl:value-of select="."/></some-text>
-  </xsl:template>  
-   
-</xsl:stylesheet>
diff --git a/samples/trax/xsl/inc1/inc1.xsl b/samples/trax/xsl/inc1/inc1.xsl
deleted file mode 100644
index 04ebb25..0000000
--- a/samples/trax/xsl/inc1/inc1.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<xsl:stylesheet 
-      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-      
-  <xsl:include href="inc2/inc2.xsl"/>
-  
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/samples/trax/xsl/inc1/inc2/inc2.xsl b/samples/trax/xsl/inc1/inc2/inc2.xsl
deleted file mode 100644
index 36728eb..0000000
--- a/samples/trax/xsl/inc1/inc2/inc2.xsl
+++ /dev/null
@@ -1,4 +0,0 @@
-<xsl:stylesheet 
-      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-  <xsl:variable name="my-var" select="'text from my-var in inc2.xsl'"/>
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/src/MANIFEST.MF b/src/MANIFEST.MF
deleted file mode 100644
index e81fdb8..0000000
--- a/src/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Created-By: 1.2.2 (Sun Microsystems Inc.)
-Main-Class: org.apache.xalan.xslt.Process
-Class-Path: jaxp.jar xerces.jar crimson.jar
-
-
diff --git a/src/META-INF/services/javax.xml.parsers.DocumentBuilderFactory b/src/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
deleted file mode 100644
index 3845cc1..0000000
--- a/src/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
diff --git a/src/META-INF/services/javax.xml.parsers.SAXParserFactory b/src/META-INF/services/javax.xml.parsers.SAXParserFactory
deleted file mode 100644
index 88b247c..0000000
--- a/src/META-INF/services/javax.xml.parsers.SAXParserFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.xerces.jaxp.SAXParserFactoryImpl
diff --git a/src/META-INF/services/javax.xml.transform.TransformerFactory b/src/META-INF/services/javax.xml.transform.TransformerFactory
deleted file mode 100644
index 8e877dc..0000000
--- a/src/META-INF/services/javax.xml.transform.TransformerFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.xalan.processor.TransformerFactoryImpl
diff --git a/src/javadocOverview.html b/src/javadocOverview.html
deleted file mode 100644
index 835d278..0000000
--- a/src/javadocOverview.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>
-  <head></head>
-  <body>
-    <p>Xalan-Java implements the <A href="http://www.w3.org/TR/xslt" target="_top">W3C Recommendation 16 November 1999 XSL
-    Transformations (XSLT) Version 1.0</A>.</p>
-  
-    <p>XLST is a stylesheet language for transforming XML documents into other XML documents, HTML documents, 
-    or other document types. The language includes the XSL Transformation vocabulary and XPath, a language for
-    addressing parts of an XML document. An XSL stylesheet describes how to transform the tree of nodes in the XML
-    input into another tree of nodes.</p>
-    <dl>
-      <dt><b>Version: </b></dt><dd>Alpha, 2.0.0, July 05, 2000</dd>
-      <dt><b>Author: </b></dt><dd><a href="mailto:scott_boag@lotus.com">Scott Boag</a></dd>
-    </dl>
-  </body></html>
\ No newline at end of file
diff --git a/src/org/apache/xalan/client/XSLTProcessorApplet.java b/src/org/apache/xalan/client/XSLTProcessorApplet.java
deleted file mode 100644
index f4d2fda..0000000
--- a/src/org/apache/xalan/client/XSLTProcessorApplet.java
+++ /dev/null
@@ -1,798 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.client;
-
-import java.applet.Applet;
-
-import java.awt.Graphics;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.StringReader;
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.util.Properties;
-
-// Needed Xalan classes
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-// Needed TRaX classes
-import javax.xml.transform.Result;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Source;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-/**
- * <meta name="usage" content="general"/>
- * Provides applet host for the XSLT processor. To perform transformations on an HTML client:
- * <ol>
- * <li>Use an &lt;applet&gt; tag to embed this applet in the HTML client.</li>
- * <li>Use the DocumentURL and StyleURL PARAM tags or the {@link #setDocumentURL} and
- * {@link #setStyleURL} methods to specify the XML source document and XSL stylesheet.</li>
- * <li>Call the {@link #getHtmlText} method (or one of the transformToHtml() methods)
- * to perform the transformation and return the result as a String.</li>
- * </ol>
- */
-public class XSLTProcessorApplet extends Applet
-{
-
-  /**
-   * The stylesheet processor.
-   * @serial
-   */
-  TransformerFactory m_tfactory = null;
-
-  /**
-   * @serial
-   */
-  private String m_styleURL;
-
-  /**
-   * @serial
-   */
-  private String m_documentURL;
-
-  // Parameter names.  To change a name of a parameter, you need only make
-  // a single change.  Simply modify the value of the parameter string below.
-  //--------------------------------------------------------------------------
-
-  /**
-   * @serial
-   */
-  private final String PARAM_styleURL = "styleURL";
-
-  /**
-   * @serial
-   */
-  private final String PARAM_documentURL = "documentURL";
-
-
-  // We'll keep the DOM trees around, so tell which trees
-  // are cached.
-
-  /**
-   * @serial
-   */
-  private String m_styleURLOfCached = null;
-
-  /**
-   * @serial
-   */
-  private String m_documentURLOfCached = null;
-
-  /**
-   * Save this for use on the worker thread; may not be necessary.
-   * @serial
-   */
-  private URL m_codeBase = null;
-  
-  /**
-   * @serial
-   */
-  private String m_treeURL = null;
-
-  /** 
-   * DocumentBase URL
-   * @serial       
-   */
-  private URL m_documentBase = null;
-
-  /**
-   * Thread stuff for the trusted worker thread.
-   */
-  transient private Thread m_callThread = null;
-
-  /**
-   */
-  transient private TrustedAgent m_trustedAgent = null;
-
-  /**
-   * Thread for running TrustedAgent.
-   */
-  transient private Thread m_trustedWorker = null;
-
-  /**
-   * Where the worker thread puts the HTML text.
-   */
-  transient private String m_htmlText = null;
-  
-  /**
-   * Where the worker thread puts the document/stylesheet text.
-   */
-  transient private String m_sourceText = null;
-  
-  /**
-   * Stylesheet attribute name and value that the caller can set.
-   */
-  transient private String m_nameOfIDAttrOfElemToModify = null;
-
-  /**
-   */
-  transient private String m_elemIdToModify = null;
-
-  /**
-   */
-  transient private String m_attrNameToSet = null;
-
-  /**
-   */
-  transient private String m_attrValueToSet = null;
-
-  /**
-   * The XSLTProcessorApplet constructor takes no arguments.
-   */
-  public XSLTProcessorApplet(){}
-
-  /**
-   * Get basic information about the applet
-   * @return A String with the applet name and author.
-   */
-  public String getAppletInfo()
-  {
-    return "Name: XSLTProcessorApplet\r\n" + "Author: Scott Boag";
-  }
-
-  /**
-   * Get descriptions of the applet parameters.
-   * @return A two-dimensional array of Strings with Name, Type, and Description
-   * for each parameter.
-   */
-  public String[][] getParameterInfo()
-  {
-
-    String[][] info =
-    {
-      { PARAM_styleURL, "String", "URL to an XSL stylesheet" },
-      { PARAM_documentURL, "String", "URL to an XML document" },
-    };
-
-    return info;
-  }
-
-  /**
-   * Standard applet initialization.
-   */
-  public void init()
-  {
-
-    // PARAMETER SUPPORT
-    //          The following code retrieves the value of each parameter
-    // specified with the <PARAM> tag and stores it in a member
-    // variable.
-    //----------------------------------------------------------------------
-    String param;
-
-    // styleURL: Parameter description
-    //----------------------------------------------------------------------
-    param = getParameter(PARAM_styleURL);
-
-    if (param != null)
-      setStyleURL(param);
-
-    // documentURL: Parameter description
-    //----------------------------------------------------------------------
-    param = getParameter(PARAM_documentURL);
-
-    if (param != null)
-      setDocumentURL(param);
-
-    m_codeBase = this.getCodeBase();
-    m_documentBase = this.getDocumentBase();
-
-    // If you use a ResourceWizard-generated "control creator" class to
-    // arrange controls in your applet, you may want to call its
-    // CreateControls() method from within this method. Remove the following
-    // call to resize() before adding the call to CreateControls();
-    // CreateControls() does its own resizing.
-    //----------------------------------------------------------------------
-    resize(320, 240);
-  }
-  
-    /**
-   *  Automatically called when the HTML client containing the applet loads.
-   *  This method starts execution of the applet thread.
-   */
-  public void start()
-  {
-
-    m_trustedAgent = new TrustedAgent();
-    Thread currentThread = Thread.currentThread();
-    m_trustedWorker = new Thread(currentThread.getThreadGroup(),
-                                 m_trustedAgent);
-    m_trustedWorker.start();
-    try
-    {
-      m_tfactory = TransformerFactory.newInstance();
-      this.showStatus("Causing Transformer and Parser to Load and JIT...");
-
-      // Prime the pump so that subsequent transforms are faster.
-      StringReader xmlbuf = new StringReader("<?xml version='1.0'?><foo/>");
-      StringReader xslbuf = new StringReader(
-        "<?xml version='1.0'?><xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'><xsl:template match='foo'><out/></xsl:template></xsl:stylesheet>");
-      PrintWriter pw = new PrintWriter(new StringWriter());
-
-      synchronized (m_tfactory)
-      {
-        Templates templates = m_tfactory.newTemplates(new StreamSource(xslbuf));
-        Transformer transformer = templates.newTransformer();
-        transformer.transform(new StreamSource(xmlbuf), new StreamResult(pw));
-      }
-      System.out.println("Primed the pump!");
-      this.showStatus("Ready to go!");
-    }
-    catch (Exception e)
-    {
-      this.showStatus("Could not prime the pump!");
-      System.out.println("Could not prime the pump!");
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Do not call; this applet contains no UI or visual components.
-   *
-   */
-  public void paint(Graphics g){}  
-  
-  /**
-   * Automatically called when the HTML page containing the applet is no longer
-   * on the screen. Stops execution of the applet thread.
-   */
-  public void stop()
-  {
-    if (null != m_trustedWorker)
-    {
-      m_trustedWorker.stop();
-
-      // m_trustedWorker.destroy();
-      m_trustedWorker = null;
-    }
-
-    m_styleURLOfCached = null;
-    m_documentURLOfCached = null;
-  }   
-  
-  /**
-   * Cleanup; called when applet is terminated and unloaded.
-   */
-  public void destroy()
-  {
-    if (null != m_trustedWorker)
-    {
-      m_trustedWorker.stop();
-
-      // m_trustedWorker.destroy();
-      m_trustedWorker = null;
-    }
-    m_styleURLOfCached = null;
-    m_documentURLOfCached = null;
-  }
-
-  /**
-   * Set the URL to the XSL stylesheet that will be used
-   * to transform the input XML.  No processing is done yet.
-   * @param urlString valid URL string for XSL stylesheet.
-   */
-  public void setStyleURL(String urlString)
-  {
-    m_styleURL = urlString;
-  }
-
-  /**
-   * Set the URL to the XML document that will be transformed
-   * with the XSL stylesheet.  No processing is done yet.
-   * @param urlString valid URL string for XML document.
-   */
-  public void setDocumentURL(String urlString)
-  {
-    m_documentURL = urlString;
-  }
-
-  /**
-   * The processor keeps a cache of the source and
-   * style trees, so call this method if they have changed
-   * or you want to do garbage collection.
-   */
-  public void freeCache()
-  {
-    m_styleURLOfCached = null;
-    m_documentURLOfCached = null;
-  }
-
-  /**
-   * Set an attribute in the stylesheet, which gives the ability
-   * to have some dynamic selection control.
-   * @param nameOfIDAttrOfElemToModify The name of an attribute to search for a unique id.
-   * @param elemId The unique ID to look for.
-   * @param attrName Once the element is found, the name of the attribute to set.
-   * @param value The value to set the attribute to.
-   */
-  public void setStyleSheetAttribute(String nameOfIDAttrOfElemToModify,
-                                     String elemId, String attrName,
-                                     String value)
-  {
-    m_nameOfIDAttrOfElemToModify = nameOfIDAttrOfElemToModify;
-    m_elemIdToModify = elemId;
-    m_attrNameToSet = attrName;
-    m_attrValueToSet = value;
-  }
-
-  /** 
-   * Stylesheet parameter key
-   */
-  transient String m_key;
-
-  /** 
-   * Stylesheet parameter value
-   */
-  transient String m_expression;
-
-  /**
-   * Submit a stylesheet parameter.
-   *
-   * @param key stylesheet parameter key
-   * @param expr the parameter expression to be submitted.
-   * @see javax.xml.transform.Transformer#setParameter(String,Object)
-   */
-  public void setStylesheetParam(String key, String expr)
-  {
-    m_key = key;
-    m_expression = expr;
-  }
-
-  /**
-   * Given a String containing markup, escape the markup so it
-   * can be displayed in the browser.
-   *
-   * @param s String to escape
-   *
-   * The escaped string.
-   */
-  public String escapeString(String s)
-  {
-    StringBuffer sb = new StringBuffer();
-    int length = s.length();
-
-    for (int i = 0; i < length; i++)
-    {
-      char ch = s.charAt(i);
-
-      if ('<' == ch)
-      {
-        sb.append("&lt;");
-      }
-      else if ('>' == ch)
-      {
-        sb.append("&gt;");
-      }
-      else if ('&' == ch)
-      {
-        sb.append("&amp;");
-      }
-      else if (0xd800 <= ch && ch < 0xdc00)
-      {
-        // UTF-16 surrogate
-        int next;
-
-        if (i + 1 >= length)
-        {
-          throw new RuntimeException(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_INVALID_UTF16_SURROGATE,
-              new Object[]{ Integer.toHexString(ch) }));  //"Invalid UTF-16 surrogate detected: "
-
-          //+Integer.toHexString(ch)+ " ?");
-        }
-        else
-        {
-          next = s.charAt(++i);
-
-          if (!(0xdc00 <= next && next < 0xe000))
-            throw new RuntimeException(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_INVALID_UTF16_SURROGATE,
-                new Object[]{
-                  Integer.toHexString(ch) + " "
-                  + Integer.toHexString(next) }));  //"Invalid UTF-16 surrogate detected: "
-
-          //+Integer.toHexString(ch)+" "+Integer.toHexString(next));
-          next = ((ch - 0xd800) << 10) + next - 0xdc00 + 0x00010000;
-        }
-        sb.append("&#x");
-        sb.append(Integer.toHexString(next));
-        sb.append(";");
-      }
-      else
-      {
-        sb.append(ch);
-      }
-    }
-    return sb.toString();
-  }
-
-  /**
-   * Assuming the stylesheet URL and the input XML URL have been set,
-   * perform the transformation and return the result as a String.
-   *
-   * @return A string that contains the contents pointed to by the URL.
-   *
-   */
-  public String getHtmlText()
-  {
-    m_trustedAgent.m_getData = true;
-    m_callThread = Thread.currentThread();
-    try
-    {
-      synchronized (m_callThread)
-      {
-        m_callThread.wait();
-      }
-    }
-    catch (InterruptedException ie)
-    {
-      System.out.println(ie.getMessage());
-    }
-    return m_htmlText;
-  }
-
-  /**
-   * Get an XML document (or stylesheet)
-   *
-   * @param treeURL valid URL string for the document.
-   *
-   * @return document
-   *
-   * @throws IOException
-   */
-  public String getTreeAsText(String treeURL) throws IOException
-  {
-    m_treeURL = treeURL;
-    m_trustedAgent.m_getData = true;
-    m_trustedAgent.m_getSource = true;
-    m_callThread = Thread.currentThread();
-    try
-    {
-      synchronized (m_callThread)
-      {
-        m_callThread.wait();
-      }
-    }
-    catch (InterruptedException ie)
-    {
-      System.out.println(ie.getMessage());
-    }
-    return m_sourceText;
-  }
-  
-  /**
-   * Use a Transformer to copy the source document
-   * to a StreamResult.
-   * 
-   * @return the document as a string
-   */
-  private String getSource() throws TransformerException
-  {
-    StringWriter osw = new StringWriter();
-    PrintWriter pw = new PrintWriter(osw, false);
-    String text = "";
-    try
-    {
-      URL docURL = new URL(m_documentBase, m_treeURL);
-      synchronized (m_tfactory)
-      {
-        Transformer transformer = m_tfactory.newTransformer();
-        StreamSource source = new StreamSource(docURL.toString());    
-        StreamResult result = new StreamResult(pw);
-        transformer.transform(source, result);
-        text = osw.toString();
-      }
-    }
-    catch (MalformedURLException e)
-    {
-      e.printStackTrace();
-      System.exit(-1);
-    }      
-    catch (Exception any_error)
-    {
-      any_error.printStackTrace();
-    }
-    return text;
-  }
-
-  /**
-   * Get the XML source Tree as a text string suitable
-   * for display in a browser.  Note that this is for display of the
-   * XML itself, not for rendering of HTML by the browser.
-   *
-   * @return XML source document as a string.
-   * @throws Exception thrown if tree can not be converted.
-   */
-  public String getSourceTreeAsText() throws Exception
-  {
-    return getTreeAsText(m_documentURL);
-  }
-
-  /**
-   * Get the XSL style Tree as a text string suitable
-   * for display in a browser.  Note that this is for display of the
-   * XML itself, not for rendering of HTML by the browser.
-   *
-   * @return The XSL stylesheet as a string.
-   * @throws Exception thrown if tree can not be converted.
-   */
-  public String getStyleTreeAsText() throws Exception
-  {
-    return getTreeAsText(m_styleURL);
-  }
-
-  /**
-   * Get the HTML result Tree as a text string suitable
-   * for display in a browser.  Note that this is for display of the
-   * XML itself, not for rendering of HTML by the browser.
-   *
-   * @return Transformation result as unmarked text.
-   * @throws Exception thrown if tree can not be converted.
-   */
-  public String getResultTreeAsText() throws Exception
-  {
-    return escapeString(getHtmlText());
-  }
-
-  /**
-   * Process a document and a stylesheet and return
-   * the transformation result.  If one of these is null, the
-   * existing value (of a previous transformation) is not affected.
-   *
-   * @param doc URL string to XML document
-   * @param style URL string to XSL stylesheet
-   *
-   * @return HTML transformation result
-   */
-  public String transformToHtml(String doc, String style)
-  {
-
-    if (null != doc)
-    {
-      m_documentURL = doc;
-    }
-
-    if (null != style)
-    {
-      m_styleURL = style;
-    }
-
-    return getHtmlText();
-  }
-
-  /**
-   * Process a document and a stylesheet and return
-   * the transformation result. Use the xsl:stylesheet PI to find the
-   * document, if one exists.
-   *
-   * @param doc  URL string to XML document containing an xsl:stylesheet PI.
-   *
-   * @return HTML transformation result
-   */
-  public String transformToHtml(String doc)
-  {
-
-    if (null != doc)
-    {
-      m_documentURL = doc;
-    }
-
-    m_styleURL = null;
-
-    return getHtmlText();
-  }
-
-
-  /**
-   * Process the transformation.
-   *
-   * @return The transformation result as a string.
-   *
-   * @throws TransformerException
-   */
-  private String processTransformation() throws TransformerException
-  {
-    String htmlData = null;
-    this.showStatus("Waiting for Transformer and Parser to finish loading and JITing...");
-    
-    synchronized (m_tfactory)
-    {
-     URL documentURL = null;
-      URL styleURL = null;
-      StringWriter osw = new StringWriter();
-      PrintWriter pw = new PrintWriter(osw, false);
-      StreamResult result = new StreamResult(pw);
-    
-      this.showStatus("Begin Transformation...");
-      try
-      {
-        documentURL = new URL(m_codeBase, m_documentURL);
-        StreamSource xmlSource = new StreamSource(documentURL.toString());
-
-        styleURL = new URL(m_codeBase, m_styleURL);
-        StreamSource xslSource = new StreamSource(styleURL.toString());
-
-        Transformer transformer = m_tfactory.newTransformer(xslSource);
-
-        if (null != m_key)
-          transformer.setParameter(m_key, m_expression);
-      
-         transformer.transform(xmlSource, result);
-      }
-      catch (TransformerConfigurationException tfe)
-      {
-        tfe.printStackTrace();
-        System.exit(-1);
-      }
-      catch (MalformedURLException e)
-      {
-        e.printStackTrace();
-        System.exit(-1);
-      }
-	  
-      this.showStatus("Transformation Done!");
-      htmlData = osw.toString();
-    }
-    return htmlData;
-  }
-
-  /**
-   * This class maintains a worker thread that that is
-   * trusted and can do things like access data.  You need
-   * this because the thread that is called by the browser
-   * is not trusted and can't access data from the URLs.
-   */
-  class TrustedAgent implements Runnable
-  {
-
-    /** 
-     * Specifies whether the worker thread should perform a transformation.
-     */
-    public boolean m_getData = false;
-
-    /** 
-     * Specifies whether the worker thread should get an XML document or XSL stylesheet.
-     */
-    public boolean m_getSource = false;
-
-    /**
-     * The real work is done from here.
-     *
-     */
-    public void run()
-    {
-      while (true)
-      {
-        m_trustedWorker.yield();
-
-        if (m_getData)  // Perform a transformation or get a document.
-        {
-          try
-          {
-            m_getData = false;
-            m_htmlText = null;
-            m_sourceText = null;
-            if (m_getSource)  // Get a document.
-            {
-              m_getSource = false;
-              m_sourceText = getSource();
-            }
-            else              // Perform a transformation.
-              m_htmlText = processTransformation();
-          }
-          catch (Exception e)
-          {
-            e.printStackTrace();
-          }
-          finally
-          {
-            synchronized (m_callThread)
-            {
-              m_callThread.notify();
-            }
-          }
-        }
-        else
-        {
-          try
-          {
-            m_trustedWorker.sleep(50);
-          }
-          catch (InterruptedException ie)
-          {
-            ie.printStackTrace();
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xalan/client/package.html b/src/org/apache/xalan/client/package.html
deleted file mode 100644
index 3fd6f4e..0000000
--- a/src/org/apache/xalan/client/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>Xalan Client Package.</title>
-  <body>
-    <p>Implementation of Xalan applet.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/extensions/ExpressionContext.java b/src/org/apache/xalan/extensions/ExpressionContext.java
deleted file mode 100644
index 6522f67..0000000
--- a/src/org/apache/xalan/extensions/ExpressionContext.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.Node;
-import org.apache.xpath.objects.XObject;
-
-/**
- * An object that implements this interface can supply
- * information about the current XPath expression context.
- */
-public interface ExpressionContext
-{
-
-  /**
-   * Get the current context node.
-   * @return The current context node.
-   */
-  public Node getContextNode();
-
-  /**
-   * Get the current context node list.
-   * @return An iterator for the current context list, as
-   * defined in XSLT.
-   */
-  public NodeIterator getContextNodes();
-
-  /**
-   * Get the value of a node as a number.
-   * @param n Node to be converted to a number.  May be null.
-   * @return value of n as a number.
-   */
-  public double toNumber(Node n);
-
-  /**
-   * Get the value of a node as a string.
-   * @param n Node to be converted to a string.  May be null.
-   * @return value of n as a string, or an empty string if n is null.
-   */
-  public String toString(Node n);
-
-  /**
-   * Get a variable based on it's qualified name.
-   *
-   * @param qname The qualified name of the variable.
-   *
-   * @return The evaluated value of the variable.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-
-  public XObject getVariableOrParam(org.apache.xml.utils.QName qname)
-            throws javax.xml.transform.TransformerException;
-
-}
diff --git a/src/org/apache/xalan/extensions/ExtensionHandler.java b/src/org/apache/xalan/extensions/ExtensionHandler.java
deleted file mode 100644
index 9ebbe73..0000000
--- a/src/org/apache/xalan/extensions/ExtensionHandler.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import java.util.Vector;
-import java.lang.reflect.Method;
-
-import java.io.IOException;
-
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xml.utils.QName;
-
-// Temp??
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="internal"/>
- * Abstract base class for handling an extension namespace for XPath.
- * Provides functions to test a function's existence and call a function.
- * Also provides functions for calling an element and testing for
- * an element's existence.
- *
- * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
- */
-public abstract class ExtensionHandler
-{
-
-  /** uri of the extension namespace          */
-  protected String m_namespaceUri; 
-
-  /** scripting language of implementation          */
-  protected String m_scriptLang;
-
-  /** a zero length Object array used in getClassForName() */
-  private static final Object NO_OBJS[] = new Object[0];
-
-  /** the Method object for getContextClassLoader */
-  private static Method getCCL;
-
-  static
-  {
-    try
-    {
-      getCCL = Thread.class.getMethod("getContextClassLoader", new Class[0]);
-    }
-    catch (Exception e)
-    {
-      getCCL = null;
-    }
-  }
-
-  /**
-   * Replacement for Class.forName.  This method loads a class using the context class loader
-   * if we're running under Java2 or higher.  If we're running under Java1, this
-   * method just uses Class.forName to load the class.
-   * 
-   * @param className Name of the class to load
-   */
-  public static Class getClassForName(String className)
-      throws ClassNotFoundException
-  {
-    Class result = null;
-    
-    // Hack for backwards compatibility with XalanJ1 stylesheets
-    if(className.equals("org.apache.xalan.xslt.extensions.Redirect"))
-      className = "org.apache.xalan.lib.Redirect";
-      
-    if (getCCL != null)
-    {
-      try {
-        ClassLoader contextClassLoader =
-                              (ClassLoader) getCCL.invoke(Thread.currentThread(), NO_OBJS);
-        result = contextClassLoader.loadClass(className);
-      }
-      catch (ClassNotFoundException cnfe)
-      {
-        result = Class.forName(className);
-      }
-      catch (Exception e)
-      {
-        getCCL = null;
-        result = Class.forName(className);
-      }
-    }
-
-    else
-       result = Class.forName(className);
-
-    return result;
- }
-
-
-  /**
-   * Construct a new extension namespace handler given all the information
-   * needed.
-   *
-   * @param namespaceUri the extension namespace URI that I'm implementing
-   * @param scriptLang   language of code implementing the extension
-   */
-  protected ExtensionHandler(String namespaceUri, String scriptLang)
-  {
-    m_namespaceUri = namespaceUri;
-    m_scriptLang = scriptLang;
-  }
-
-  /**
-   * Tests whether a certain function name is known within this namespace.
-   * @param function name of the function being tested
-   * @return true if its known, false if not.
-   */
-  public abstract boolean isFunctionAvailable(String function);
-
-  /**
-   * Tests whether a certain element name is known within this namespace.
-   * @param function name of the function being tested
-   *
-   * @param element Name of element to check
-   * @return true if its known, false if not.
-   */
-  public abstract boolean isElementAvailable(String element);
-
-  /**
-   * Process a call to a function.
-   *
-   * @param funcName Function name.
-   * @param args     The arguments of the function call.
-   * @param methodKey A key that uniquely identifies this class and method call.
-   * @param exprContext The context in which this expression is being executed.
-   *
-   * @return the return value of the function evaluation.
-   *
-   * @throws TransformerException          if parsing trouble
-   */
-  public abstract Object callFunction(
-    String funcName, Vector args, Object methodKey,
-      ExpressionContext exprContext) throws TransformerException;
-
-  /**
-   * Process a call to this extension namespace via an element. As a side
-   * effect, the results are sent to the TransformerImpl's result tree.
-   *
-   * @param localPart      Element name's local part.
-   * @param element        The extension element being processed.
-   * @param transformer      Handle to TransformerImpl.
-   * @param stylesheetTree The compiled stylesheet tree.
-   * @param mode           The current mode.
-   * @param sourceTree     The root of the source tree (but don't assume
-   *                       it's a Document).
-   * @param sourceNode     The current context node.
-   * @param methodKey      A key that uniquely identifies this class and method call.
-   *
-   * @throws XSLProcessorException thrown if something goes wrong
-   *            while running the extension handler.
-   * @throws MalformedURLException if loading trouble
-   * @throws FileNotFoundException if loading trouble
-   * @throws IOException           if loading trouble
-   * @throws TransformerException          if parsing trouble
-   */
-  public abstract void processElement(
-    String localPart, ElemTemplateElement element, TransformerImpl transformer,
-      Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException;
-}
diff --git a/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java b/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
deleted file mode 100644
index 66d09e8..0000000
--- a/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.io.InputStream;
-
-//import org.w3c.dom.Element;
-//import org.w3c.dom.Node;
-import org.apache.xml.dtm.DTM;
-
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.SystemIDResolver;
-
-import javax.xml.transform.TransformerException;
-
-// Temp??
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPathProcessorException;
-import org.apache.xml.utils.StringVector;
-
-import java.lang.reflect.Method;
-
-import org.apache.xml.dtm.ref.DTMNodeIterator;
-import org.apache.xml.dtm.ref.DTMNodeList;
-import org.apache.xml.dtm.DTMIterator;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class handling an extension namespace for XPath. Provides functions
- * to test a function's existence and call a function
- *
- * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
- */
-public class ExtensionHandlerGeneral extends ExtensionHandler
-{
-
-  /** script source to run (if any)      */
-  private String m_scriptSrc;   
-
-  /** URL of source of script (if any)         */
-  private String m_scriptSrcURL;  
-
-  /** functions of namespace        */
-  private Hashtable m_functions = new Hashtable();  
-
-  /** elements of namespace         */
-  private Hashtable m_elements = new Hashtable();   
-
-  // BSF objects used to invoke BSF by reflection.  Do not import the BSF classes
-  // since we don't want a compile dependency on BSF.
-
-  /** Instance of Manager class          */
-  private Object m_mgr;  // 
-
-  /** BSF manager used to run scripts         */
-  private Object m_engine;  
-
-  // static fields
-
-  /** BSFManager package name          */
-  private static final String BSF_MANAGER = "com.ibm.bsf.BSFManager";
-
-  /** Manager class          */
-  private static Class managerClass;
-
-  /** Manager load scripting engine          */
-  private static Method mgrLoadScriptingEngine;
-
-  /** BSFEngine package name          */
-  private static final String BSF_ENGINE = "com.ibm.bsf.BSFEngine";
-
-  /** Engine call to "compile" scripts         */
-  private static Method engineExec;   
-
-  /** Engine call to invoke scripts          */
-  private static Method engineCall;   
-
-  /** Negative one integer         */
-  private static final Integer NEG1INT = new Integer(-1);
-
-  static
-  {
-    try
-    {
-      //managerClass = Class.forName(BSF_MANAGER);
-                        managerClass = ExtensionHandler.getClassForName(BSF_MANAGER);
-      mgrLoadScriptingEngine = managerClass.getMethod("loadScriptingEngine",
-              new Class[]{ String.class });
-
-      //Class engineClass = Class.forName(BSF_ENGINE);
-                        Class engineClass = ExtensionHandler.getClassForName(BSF_ENGINE);
-
-      engineExec = engineClass.getMethod("exec", new Class[]{ String.class,
-                                                              Integer.TYPE,
-                                                              Integer.TYPE,
-                                                              Object.class });
-      engineCall = engineClass.getMethod("call", new Class[]{ Object.class,
-                                                              String.class,
-                                                              Class.forName(
-                                                                "[Ljava.lang.Object;") });
-    }
-    catch (Exception e)
-    {
-      managerClass = null;
-      mgrLoadScriptingEngine = null;
-      engineExec = null;
-      engineCall = null;
-
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Construct a new extension namespace handler given all the information
-   * needed.
-   *
-   * @param namespaceUri the extension namespace URI that I'm implementing
-   * @param elemNames Vector of element names
-   * @param funcNames    string containing list of functions of extension NS
-   * @param lang         language of code implementing the extension
-   * @param srcURL       value of src attribute (if any) - treated as a URL
-   *                     or a classname depending on the value of lang. If
-   *                     srcURL is not null, then scriptSrc is ignored.
-   * @param scriptLang Scripting language of implementation
-   * @param scriptSrcURL URL of source script
-   * @param scriptSrc    the actual script code (if any)
-   *
-   * @throws TransformerException
-   */
-  public ExtensionHandlerGeneral(
-          String namespaceUri, StringVector elemNames, StringVector funcNames, String scriptLang, String scriptSrcURL, String scriptSrc, String systemId)
-            throws TransformerException
-  {
-
-    super(namespaceUri, scriptLang);
-
-    if (elemNames != null)
-    {
-      Object junk = new Object();
-      int n = elemNames.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        String tok = elemNames.elementAt(i);
-
-        m_elements.put(tok, junk);  // just stick it in there basically
-      }
-    }
-
-    if (funcNames != null)
-    {
-      Object junk = new Object();
-      int n = funcNames.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        String tok = funcNames.elementAt(i);
-
-        m_functions.put(tok, junk);  // just stick it in there basically
-      }
-    }
-
-    m_scriptSrcURL = scriptSrcURL;
-    m_scriptSrc = scriptSrc;
-
-    if (m_scriptSrcURL != null)
-    {
-      URL url = null;
-      try{
-        url = new URL(m_scriptSrcURL);
-      }
-      catch (java.net.MalformedURLException mue)
-      {
-        int indexOfColon = m_scriptSrcURL.indexOf(':');
-        int indexOfSlash = m_scriptSrcURL.indexOf('/');
-
-        if ((indexOfColon != -1) && (indexOfSlash != -1)
-            && (indexOfColon < indexOfSlash))
-        {
-          // The url is absolute.
-          url = null;
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for "
-          //+ scriptLang);
-        }
-        else
-        {
-          try{
-            url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL);          
-          }        
-          catch (java.net.MalformedURLException mue2)
-          {
-            throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for "
-          //+ scriptLang);
-          }
-        }
-      }
-      if (url != null)
-      {
-        try
-        {
-          URLConnection uc = url.openConnection();
-          InputStream is = uc.getInputStream();
-          byte []bArray = new byte[uc.getContentLength()];
-          is.read(bArray);
-          m_scriptSrc = new String(bArray);
-          
-        }
-        catch (IOException ioe)
-        {
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for "
-          //+ scriptLang);
-        }
-      }
-      
-    }
-   
-    if (null == managerClass)
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_BSFMGR, null)); //"Could not initialize BSF manager");
-
-    try
-    {
-      m_mgr = managerClass.newInstance();
-      m_engine = mgrLoadScriptingEngine.invoke(m_mgr,
-                                               new Object[]{ scriptLang });
-
-      // "Compile" the program
-      engineExec.invoke(m_engine, new Object[]{ "XalanScript", NEG1INT,
-                                                NEG1INT, m_scriptSrc });
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e);
-    }
-  }
-
-  /**
-   * Tests whether a certain function name is known within this namespace.
-   * @param function name of the function being tested
-   * @return true if its known, false if not.
-   */
-  public boolean isFunctionAvailable(String function)
-  {
-    return (m_functions.get(function) != null);
-  }
-
-  /**
-   * Tests whether a certain element name is known within this namespace.
-   * @param function name of the function being tested
-   *
-   * @param element name of the element being tested
-   * @return true if its known, false if not.
-   */
-  public boolean isElementAvailable(String element)
-  {
-    return (m_elements.get(element) != null);
-  }
-
-  /**
-   * Process a call to a function.
-   *
-   * @param funcName Function name.
-   * @param args     The arguments of the function call.
-   * @param methodKey A key that uniquely identifies this class and method call.
-   * @param exprContext The context in which this expression is being executed.
-   *
-   * @return the return value of the function evaluation.
-   *
-   * @throws TransformerException          if parsing trouble
-   */
-  public Object callFunction(
-          String funcName, Vector args, Object methodKey, ExpressionContext exprContext)
-            throws TransformerException
-  {
-
-    Object[] argArray;
-
-    try
-    {
-      argArray = new Object[args.size()];
-
-      for (int i = 0; i < argArray.length; i++)
-      {
-        Object o = args.elementAt(i);
-
-        argArray[i] = (o instanceof XObject) ? ((XObject) o).object() : o;
-        o = argArray[i];
-        if(null != o && o instanceof DTMIterator)
-        {
-          argArray[i] = new DTMNodeList((DTMIterator)o);
-        }
-      }
-
-      return engineCall.invoke(m_engine, new Object[]{ null, funcName,
-                                                       argArray });
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-
-      String msg = e.getMessage();
-
-      if (null != msg)
-      {
-        if (msg.startsWith("Stopping after fatal error:"))
-        {
-          msg = msg.substring("Stopping after fatal error:".length());
-        }
-
-        // System.out.println("Call to extension function failed: "+msg);
-        throw new TransformerException(e);
-      }
-      else
-      {
-
-        // Should probably make a TRaX Extension Exception.
-        throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName
-                               //+ " because of: " + e);
-      }
-    }
-  }
-
-  /**
-   * Process a call to this extension namespace via an element. As a side
-   * effect, the results are sent to the TransformerImpl's result tree.
-   *
-   * @param localPart      Element name's local part.
-   * @param element        The extension element being processed.
-   * @param transformer      Handle to TransformerImpl.
-   * @param stylesheetTree The compiled stylesheet tree.
-   * @param mode           The current mode.
-   * @param sourceTree     The root of the source tree (but don't assume
-   *                       it's a Document).
-   * @param sourceNode     The current context node.
-   * @param methodKey A key that uniquely identifies this class and method call.
-   *
-   * @throws XSLProcessorException thrown if something goes wrong
-   *            while running the extension handler.
-   * @throws MalformedURLException if loading trouble
-   * @throws FileNotFoundException if loading trouble
-   * @throws IOException           if loading trouble
-   * @throws TransformerException          if parsing trouble
-   */
-  public void processElement(
-          String localPart, ElemTemplateElement element, TransformerImpl transformer, 
-          Stylesheet stylesheetTree, Object methodKey)
-            throws TransformerException, IOException
-  {
-
-    Object result = null;
-    XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree);
-
-    try
-    {
-      Vector argv = new Vector(2);
-
-      argv.addElement(xpc);
-      argv.addElement(element);
-
-      result = callFunction(localPart, argv, methodKey,
-                            transformer.getXPathContext().getExpressionContext());
-    }
-    catch (XPathProcessorException e)
-    {
-
-      // e.printStackTrace ();
-      throw new TransformerException(e.getMessage(), e);
-    }
-
-    if (result != null)
-    {
-      xpc.outputToResultTree(stylesheetTree, result);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/extensions/ExtensionHandlerJava.java b/src/org/apache/xalan/extensions/ExtensionHandlerJava.java
deleted file mode 100644
index 68e3a2c..0000000
--- a/src/org/apache/xalan/extensions/ExtensionHandlerJava.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import java.util.Hashtable;
-
-/**
- * <meta name="usage" content="internal"/>
- * Abstract base class handling the java language extensions for XPath.
- * This base class provides cache management shared by all of the
- * various java extension handlers.
- *
- */
-public abstract class ExtensionHandlerJava extends ExtensionHandler
-{
-
-  /** Extension class name         */
-  protected String m_className = "";
-
-  /** Table of cached methods          */
-  private Hashtable m_cachedMethods = new Hashtable();
-
-  /**
-   * Construct a new extension handler given all the information
-   * needed.
-   *
-   * @param namespaceUri the extension namespace URI that I'm implementing
-   * @param funcNames    string containing list of functions of extension NS
-   * @param lang         language of code implementing the extension
-   * @param srcURL       value of src attribute (if any) - treated as a URL
-   *                     or a classname depending on the value of lang. If
-   *                     srcURL is not null, then scriptSrc is ignored.
-   * @param scriptSrc    the actual script code (if any)
-   * @param scriptLang   the scripting language
-   * @param className    the extension class name 
-   */
-  protected ExtensionHandlerJava(String namespaceUri, String scriptLang,
-                                 String className)
-  {
-
-    super(namespaceUri, scriptLang);
-
-    m_className = className;
-  }
-
-  /**
-   * Look up the entry in the method cache.
-   * @param methodKey   A key that uniquely identifies this invocation in
-   *                    the stylesheet.
-   * @param objType     A Class object or instance object representing the type
-   * @param methodArgs  An array of the XObject arguments to be used for
-   *                    function mangling.
-   *
-   * @return The given method from the method cache
-   */
-  public Object getFromCache(Object methodKey, Object objType,
-                             Object[] methodArgs)
-  {
-
-    // Eventually, we want to insert code to mangle the methodKey with methodArgs
-    return m_cachedMethods.get(methodKey);
-  }
-
-  /**
-   * Add a new entry into the method cache.
-   * @param methodKey   A key that uniquely identifies this invocation in
-   *                    the stylesheet.
-   * @param objType     A Class object or instance object representing the type
-   * @param methodArgs  An array of the XObject arguments to be used for
-   *                    function mangling.
-   * @param methodObj   A Class object or instance object representing the method
-   *
-   * @return The cached method object
-   */
-  public Object putToCache(Object methodKey, Object objType,
-                           Object[] methodArgs, Object methodObj)
-  {
-
-    // Eventually, we want to insert code to mangle the methodKey with methodArgs
-    return m_cachedMethods.put(methodKey, methodObj);
-  }
-}
diff --git a/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java b/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
deleted file mode 100644
index 67effd3..0000000
--- a/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.extensions;
-
-import java.util.Vector;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.io.IOException;
-
-//import org.w3c.dom.Element;
-//import org.w3c.dom.Node;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xml.utils.QName;
-
-import org.apache.xpath.objects.XObject;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Represents an extension namespace for XPath that handles java classes.
- * It is recommended that the class URI be of the form:
- * <pre>
- *   xalan://fully.qualified.class.name
- * </pre>
- * However, we do not enforce this.  If the class name contains a
- * a /, we only use the part to the right of the rightmost slash.
- * In addition, we ignore any "class:" prefix.
- * Provides functions to test a function's existence and call a function.
- * Also provides functions to test an element's existence and call an
- * element.
- *
- * @author <a href="mailto:garyp@firstech.com">Gary L Peskin</a>
- */
-
-public class ExtensionHandlerJavaClass extends ExtensionHandlerJava
-{
-
-  private Class m_classObj = null;
-
-  /**
-   * Provides a default Instance for use by elements that need to call 
-   * an instance method.
-   */
-
-  private Object m_defaultInstance = null;
-
-
-  /**
-   * Construct a new extension namespace handler given all the information
-   * needed. 
-   * @param namespaceUri the extension namespace URI that I'm implementing
-   * @param scriptLang   language of code implementing the extension
-   * @param className    the fully qualified class name of the class
-   */
-  public ExtensionHandlerJavaClass(String namespaceUri,
-                                   String scriptLang,
-                                   String className)
-  {
-    super(namespaceUri, scriptLang, className);
-    try
-    {
-      m_classObj = getClassForName(className);
-    }
-    catch (ClassNotFoundException e)
-    {
-      // For now, just let this go.  We'll catch it when we try to invoke a method.
-    }
-  }
-
-
-  /**
-   * Tests whether a certain function name is known within this namespace.
-   * Simply looks for a method with the appropriate name.  There is
-   * no information regarding the arguments to the function call or
-   * whether the method implementing the function is a static method or
-   * an instance method.
-   * @param function name of the function being tested
-   * @return true if its known, false if not.
-   */
-
-  public boolean isFunctionAvailable(String function) 
-  {
-    Method[] methods = m_classObj.getMethods();
-    int nMethods = methods.length;
-    for (int i = 0; i < nMethods; i++)
-    {
-      if (methods[i].getName().equals(function))
-        return true;
-    }
-    return false;
-  }
-
-
-  /**
-   * Tests whether a certain element name is known within this namespace.
-   * Looks for a method with the appropriate name and signature.
-   * This method examines both static and instance methods.
-   * @param element name of the element being tested
-   * @return true if its known, false if not.
-   */
-
-  public boolean isElementAvailable(String element) 
-  {
-    Method[] methods = m_classObj.getMethods();
-    int nMethods = methods.length;
-    for (int i = 0; i < nMethods; i++)
-    {
-      if (methods[i].getName().equals(element))
-      {
-        Class[] paramTypes = methods[i].getParameterTypes();
-        if ( (paramTypes.length == 2)
-          && paramTypes[0].isAssignableFrom(
-                                     org.apache.xalan.extensions.XSLProcessorContext.class)
-          && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) )
-        {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
-
-  /**
-   * Process a call to a function in the java class represented by
-   * this <code>ExtensionHandlerJavaClass<code>.
-   * There are three possible types of calls:
-   * <pre>
-   *   Constructor:
-   *     classns:new(arg1, arg2, ...)
-   *
-   *   Static method:
-   *     classns:method(arg1, arg2, ...)
-   *
-   *   Instance method:
-   *     classns:method(obj, arg1, arg2, ...)
-   * </pre>
-   * We use the following rules to determine the type of call made:
-   * <ol type="1">
-   * <li>If the function name is "new", call the best constructor for
-   *     class represented by the namespace URI</li>
-   * <li>If the first argument to the function is of the class specified
-   *     in the namespace or is a subclass of that class, look for the best
-   *     method of the class specified in the namespace with the specified
-   *     arguments.  Compare all static and instance methods with the correct
-   *     method name.  For static methods, use all arguments in the compare.
-   *     For instance methods, use all arguments after the first.</li>
-   * <li>Otherwise, select the best static or instance method matching
-   *     all of the arguments.  If the best method is an instance method,
-   *     call the function using a default object, creating it if needed.</li>
-   * </ol>
-   *
-   * @param funcName Function name.
-   * @param args     The arguments of the function call.
-   * @param methodKey A key that uniquely identifies this class and method call.
-   * @param exprContext The context in which this expression is being executed.
-   * @return the return value of the function evaluation.
-   * @throws TransformerException
-   */
-
-  public Object callFunction (String funcName, 
-                              Vector args, 
-                              Object methodKey,
-                              ExpressionContext exprContext)
-    throws TransformerException 
-  {
-
-    Object[] methodArgs;
-    Object[][] convertedArgs;
-    Class[] paramTypes;
-
-    try
-    {
-      if (funcName.equals("new")) {                   // Handle constructor call
-
-        methodArgs = new Object[args.size()];
-        convertedArgs = new Object[1][];
-        for (int i = 0; i < methodArgs.length; i++)
-        {
-          methodArgs[i] = args.elementAt(i);
-        }
-        Constructor c = (Constructor) getFromCache(methodKey, null, methodArgs);
-        if (c != null)
-        {
-          try
-          {
-            paramTypes = c.getParameterTypes();
-            MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext);
-            return c.newInstance(convertedArgs[0]);
-          }
-          catch(Exception e)
-          {
-            // Must not have been the right one
-          }
-        }
-        c = MethodResolver.getConstructor(m_classObj, 
-                                          methodArgs,
-                                          convertedArgs,
-                                          exprContext);
-        putToCache(methodKey, null, methodArgs, c);
-        return c.newInstance(convertedArgs[0]);
-      }
-
-      else
-      {
-
-        int resolveType;
-        Object targetObject = null;
-        methodArgs = new Object[args.size()];
-        convertedArgs = new Object[1][];
-        for (int i = 0; i < methodArgs.length; i++)
-        {
-          methodArgs[i] = args.elementAt(i);
-        }
-        Method m = (Method) getFromCache(methodKey, null, methodArgs);
-        if (m != null)
-        {
-          try
-          {
-            paramTypes = m.getParameterTypes();
-            MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext);
-            if (Modifier.isStatic(m.getModifiers()))
-              return m.invoke(null, convertedArgs[0]);
-            else
-            {
-              // This is tricky.  We get the actual number of target arguments (excluding any
-              //   ExpressionContext).  If we passed in the same number, we need the implied object.
-              int nTargetArgs = convertedArgs[0].length;
-              if (ExpressionContext.class.isAssignableFrom(paramTypes[0]))
-                nTargetArgs--;
-              if (methodArgs.length <= nTargetArgs)
-                return m.invoke(m_defaultInstance, convertedArgs[0]);
-              else  
-                return m.invoke(methodArgs[0], convertedArgs[0]);
-            }
-          }
-          catch(Exception e)
-          {
-            // Must not have been the right one
-          }
-        }
-
-        if (args.size() > 0)
-        {
-          targetObject = methodArgs[0];
-
-          if (targetObject instanceof XObject)
-            targetObject = ((XObject) targetObject).object();
-
-          if (m_classObj.isAssignableFrom(targetObject.getClass()))
-            resolveType = MethodResolver.DYNAMIC;
-          else
-            resolveType = MethodResolver.STATIC_AND_INSTANCE;
-        }
-        else
-        {
-          targetObject = null;
-          resolveType = MethodResolver.STATIC_AND_INSTANCE;
-        }
-
-        m = MethodResolver.getMethod(m_classObj,
-                                     funcName,
-                                     methodArgs, 
-                                     convertedArgs,
-                                     exprContext,
-                                     resolveType);
-        putToCache(methodKey, null, methodArgs, m);
-
-        if (MethodResolver.DYNAMIC == resolveType)          // First argument was object type
-          return m.invoke(targetObject, convertedArgs[0]);
-        else                                  // First arg was not object.  See if we need the implied object.
-        {
-          if (Modifier.isStatic(m.getModifiers()))
-            return m.invoke(null, convertedArgs[0]);
-          else
-          {
-            if (null == m_defaultInstance)
-            {
-              m_defaultInstance = m_classObj.newInstance();
-            }
-            return m.invoke(m_defaultInstance, convertedArgs[0]);
-          }  
-        }
-
-      }
-    }
-    catch (InvocationTargetException ite)
-    {
-      Throwable realException = ite.getTargetException();
-      if (realException instanceof Exception)
-        throw new TransformerException((Exception) realException);
-      else
-        throw new TransformerException(ite);
-    }
-    catch (Exception e)
-    {
-      // e.printStackTrace();
-      throw new TransformerException(e);
-    }
-  }
-
-
-  /**
-   * Process a call to this extension namespace via an element. As a side
-   * effect, the results are sent to the TransformerImpl's result tree. 
-   * We invoke the static or instance method in the class represented by
-   * by the namespace URI.  If we don't already have an instance of this class,
-   * we create one upon the first call.
-   *
-   * @param localPart      Element name's local part.
-   * @param element        The extension element being processed.
-   * @param transformer      Handle to TransformerImpl.
-   * @param stylesheetTree The compiled stylesheet tree.
-   * @param sourceTree     The root of the source tree (but don't assume
-   *                       it's a Document).
-   * @param sourceNode     The current context node.
-   * @param mode           The current mode.
-   * @param methodKey      A key that uniquely identifies this element call.
-   * @throws IOException           if loading trouble
-   * @throws TransformerException          if parsing trouble
-   */
-
-  public void processElement(String localPart,
-                             ElemTemplateElement element,
-                             TransformerImpl transformer,
-                             Stylesheet stylesheetTree,
-                             Object methodKey)
-    throws TransformerException, IOException
-  {
-    Object result = null;
-
-    Method m = (Method) getFromCache(methodKey, null, null);
-    if (null == m)
-    {
-      try
-      {
-        m = MethodResolver.getElementMethod(m_classObj, localPart);
-        if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) )
-          m_defaultInstance = m_classObj.newInstance();
-      }
-      catch (Exception e)
-      {
-        // e.printStackTrace ();
-        throw new TransformerException (e.getMessage (), e);
-      }
-      putToCache(methodKey, null, null, m);
-    }
-
-    XSLProcessorContext xpc = new XSLProcessorContext(transformer, 
-                                                      stylesheetTree);
-
-    try
-    {
-      result = m.invoke(m_defaultInstance, new Object[] {xpc, element});
-    }
-    catch (Exception e)
-    {
-      // e.printStackTrace ();
-      throw new TransformerException (e.getMessage (), e);
-    }
-
-    if (result != null)
-    {
-      xpc.outputToResultTree (stylesheetTree, result);
-    }
- 
-  }
- 
-}
diff --git a/src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java b/src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
deleted file mode 100644
index c659750..0000000
--- a/src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.io.IOException;
-
-//import org.w3c.dom.Element;
-//import org.w3c.dom.Node;
-
-import org.apache.xml.dtm.DTM;
-
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xml.utils.QName;
-
-import org.apache.xpath.objects.XObject;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Represents an extension namespace for XPath that handles java packages
- * that may be fully or partially specified.
- * It is recommended that the class URI be of one of the following forms:
- * <pre>
- *   xalan://partial.class.name
- *   xalan://
- *   http://xml.apache.org/xslt/java (which is the same as xalan://)
- * </pre>
- * However, we do not enforce this.  If the class name contains a
- * a /, we only use the part to the right of the rightmost slash.
- * In addition, we ignore any "class:" prefix.
- * Provides functions to test a function's existence and call a function.
- * Also provides functions to test an element's existence and call an
- * element.
- *
- * @author <a href="mailto:garyp@firstech.com">Gary L Peskin</a>
- *
- */
-
-
-public class ExtensionHandlerJavaPackage extends ExtensionHandlerJava
-{
-
-  /**
-   * Construct a new extension namespace handler given all the information
-   * needed. 
-   * 
-   * @param namespaceUri the extension namespace URI that I'm implementing
-   * @param scriptLang   language of code implementing the extension
-   * @param className    the beginning of the class name of the class.  This
-   *                     should be followed by a dot (.)
-   */
-  public ExtensionHandlerJavaPackage(String namespaceUri,
-                                     String scriptLang,
-                                     String className)
-  {
-    super(namespaceUri, scriptLang, className);
-  }
-
-
-  /**
-   * Tests whether a certain function name is known within this namespace.
-   * Since this is for a package, we concatenate the package name used when
-   * this handler was created and the function name specified in the argument.
-   * There is
-   * no information regarding the arguments to the function call or
-   * whether the method implementing the function is a static method or
-   * an instance method.
-   * @param function name of the function being tested
-   * @return true if its known, false if not.
-   */
-
-  public boolean isFunctionAvailable(String function) 
-  {
-    try
-    {
-      String fullName = m_className + function;
-      int lastDot = fullName.lastIndexOf(".");
-      if (lastDot >= 0)
-      {
-        Class myClass = getClassForName(fullName.substring(0, lastDot));
-        Method[] methods = myClass.getMethods();
-        int nMethods = methods.length;
-        function = fullName.substring(lastDot + 1);
-        for (int i = 0; i < nMethods; i++)
-        {
-          if (methods[i].getName().equals(function))
-            return true;
-        }
-      }
-    }
-    catch (ClassNotFoundException cnfe) {}
-
-    return false;
-  }
-
-
-  /**
-   * Tests whether a certain element name is known within this namespace.
-   * Looks for a method with the appropriate name and signature.
-   * This method examines both static and instance methods.
-   * @param function name of the function being tested
-   * @return true if its known, false if not.
-   */
-
-  public boolean isElementAvailable(String element) 
-  {
-    try
-    {
-      String fullName = m_className + element;
-      int lastDot = fullName.lastIndexOf(".");
-      if (lastDot >= 0)
-      {
-        Class myClass = getClassForName(fullName.substring(0, lastDot));
-        Method[] methods = myClass.getMethods();
-        int nMethods = methods.length;
-        element = fullName.substring(lastDot + 1);
-        for (int i = 0; i < nMethods; i++)
-        {
-          if (methods[i].getName().equals(element))
-          {
-            Class[] paramTypes = methods[i].getParameterTypes();
-            if ( (paramTypes.length == 2)
-              && paramTypes[0].isAssignableFrom(
-                                     org.apache.xalan.extensions.XSLProcessorContext.class)
-              && paramTypes[1].isAssignableFrom(
-                                       org.apache.xalan.templates.ElemExtensionCall.class) )
-            {
-              return true;
-            }
-          }
-        }
-      }
-    }
-    catch (ClassNotFoundException cnfe) {}
-
-    return false;
-  }
-
-
-  /**
-   * Process a call to a function in the package java namespace.
-   * There are three possible types of calls:
-   * <pre>
-   *   Constructor:
-   *     packagens:class.name.new(arg1, arg2, ...)
-   *
-   *   Static method:
-   *     packagens:class.name.method(arg1, arg2, ...)
-   *
-   *   Instance method:
-   *     packagens:method(obj, arg1, arg2, ...)
-   * </pre>
-   * We use the following rules to determine the type of call made:
-   * <ol type="1">
-   * <li>If the function name ends with a ".new", call the best constructor for
-   *     class whose name is formed by concatenating the value specified on
-   *     the namespace with the value specified in the function invocation
-   *     before ".new".</li>
-   * <li>If the function name contains a period, call the best static method "method"
-   *     in the class whose name is formed by concatenating the value specified on
-   *     the namespace with the value specified in the function invocation.</li>
-   * <li>Otherwise, call the best instance method "method"
-   *     in the class whose name is formed by concatenating the value specified on
-   *     the namespace with the value specified in the function invocation.
-   *     Note that a static method of the same
-   *     name will <i>not</i> be called in the current implementation.  This
-   *     module does not verify that the obj argument is a member of the
-   *     package namespace.</li>
-   * </ol>
-   *
-   * @param funcName Function name.
-   * @param args     The arguments of the function call.
-   *
-   * @return the return value of the function evaluation.
-   *
-   * @throws TransformerException          if parsing trouble
-   */
-
-  public Object callFunction (String funcName, 
-                              Vector args, 
-                              Object methodKey,
-                              ExpressionContext exprContext)
-    throws TransformerException 
-  {
-
-    String className;
-    String methodName;
-    Class  classObj;
-    Object targetObject;
-    int lastDot = funcName.lastIndexOf(".");
-    Object[] methodArgs;
-    Object[][] convertedArgs;
-    Class[] paramTypes;
-
-    try
-    {
-
-      if (funcName.endsWith(".new")) {                   // Handle constructor call
-
-        methodArgs = new Object[args.size()];
-        convertedArgs = new Object[1][];
-        for (int i = 0; i < methodArgs.length; i++)
-        {
-          methodArgs[i] = args.elementAt(i);
-        }
-        Constructor c = (Constructor) getFromCache(methodKey, null, methodArgs);
-        if (c != null)
-        {
-          try
-          {
-            paramTypes = c.getParameterTypes();
-            MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext);
-            return c.newInstance(convertedArgs[0]);
-          }
-          catch(Exception e)
-          {
-            // Must not have been the right one
-          }
-        }
-        className = m_className + funcName.substring(0, lastDot);
-        try
-        {
-          classObj = getClassForName(className);
-        }
-        catch (ClassNotFoundException e) 
-        {
-          throw new TransformerException(e);
-        }
-        c = MethodResolver.getConstructor(classObj, 
-                                          methodArgs,
-                                          convertedArgs,
-                                          exprContext);
-        putToCache(methodKey, null, methodArgs, c);
-        return c.newInstance(convertedArgs[0]);
-      }
-
-      else if (-1 != lastDot) {                         // Handle static method call
-
-        methodArgs = new Object[args.size()];
-        convertedArgs = new Object[1][];
-        for (int i = 0; i < methodArgs.length; i++)
-        {
-          methodArgs[i] = args.elementAt(i);
-        }
-        Method m = (Method) getFromCache(methodKey, null, methodArgs);
-        if (m != null)
-        {
-          try
-          {
-            paramTypes = m.getParameterTypes();
-            MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext);
-            return m.invoke(null, convertedArgs[0]);
-          }
-          catch(Exception e)
-          {
-            // Must not have been the right one
-          }
-        }
-        className = m_className + funcName.substring(0, lastDot);
-        methodName = funcName.substring(lastDot + 1);
-        try
-        {
-          classObj = getClassForName(className);
-        }
-        catch (ClassNotFoundException e) 
-        {
-          throw new TransformerException(e);
-        }
-        m = MethodResolver.getMethod(classObj,
-                                     methodName,
-                                     methodArgs, 
-                                     convertedArgs,
-                                     exprContext,
-                                     MethodResolver.STATIC_ONLY);
-        putToCache(methodKey, null, methodArgs, m);
-        return m.invoke(null, convertedArgs[0]);
-      }
-
-      else {                                            // Handle instance method call
-
-        if (args.size() < 1)
-        {
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INSTANCE_MTHD_CALL_REQUIRES, new Object[]{funcName })); //"Instance method call to method " + funcName
-                                    //+ " requires an Object instance as first argument");
-        }
-        targetObject = args.elementAt(0);
-        if (targetObject instanceof XObject)          // Next level down for XObjects
-          targetObject = ((XObject) targetObject).object();
-        methodArgs = new Object[args.size() - 1];
-        convertedArgs = new Object[1][];
-        for (int i = 0; i < methodArgs.length; i++)
-        {
-          methodArgs[i] = args.elementAt(i+1);
-        }
-        Method m = (Method) getFromCache(methodKey, targetObject, methodArgs);
-        if (m != null)
-        {
-          try
-          {
-            paramTypes = m.getParameterTypes();
-            MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext);
-            return m.invoke(targetObject, convertedArgs[0]);
-          }
-          catch(Exception e)
-          {
-            // Must not have been the right one
-          }
-        }
-        classObj = targetObject.getClass();
-        m = MethodResolver.getMethod(classObj,
-                                     funcName,
-                                     methodArgs, 
-                                     convertedArgs,
-                                     exprContext,
-                                     MethodResolver.INSTANCE_ONLY);
-        putToCache(methodKey, targetObject, methodArgs, m);
-        return m.invoke(targetObject, convertedArgs[0]);
-      }
-    }
-    catch (InvocationTargetException ite)
-    {
-      Throwable realException = ite.getTargetException();
-      if (realException instanceof Exception)
-        throw new TransformerException((Exception) realException);
-      else
-        throw new TransformerException(ite);
-    }
-    catch (Exception e)
-    {
-      // e.printStackTrace();
-      throw new TransformerException(e);
-    }
-  }
-
-
-  /**
-   * Process a call to this extension namespace via an element. As a side
-   * effect, the results are sent to the TransformerImpl's result tree.
-   * For this namespace, only static element methods are currently supported.
-   * If instance methods are needed, please let us know your requirements.
-   * @param localPart      Element name's local part.
-   * @param element        The extension element being processed.
-   * @param transformer      Handle to TransformerImpl.
-   * @param stylesheetTree The compiled stylesheet tree.
-   * @param mode           The current mode.
-   * @param sourceTree     The root of the source tree (but don't assume
-   *                       it's a Document).
-   * @param sourceNode     The current context node.
-   * @param mode           The current mode.
-   * @param methodKey      A key that uniquely identifies this element call.
-   * @throws IOException           if loading trouble
-   * @throws TransformerException          if parsing trouble
-   */
-
-  public void processElement (String localPart,
-                              ElemTemplateElement element,
-                              TransformerImpl transformer,
-                              Stylesheet stylesheetTree,
-                              Object methodKey)
-    throws TransformerException, IOException
-  {
-    Object result = null;
-    Class classObj;
-
-    Method m = (Method) getFromCache(methodKey, null, null);
-    if (null == m)
-    {
-      try
-      {
-        String fullName = m_className + localPart;
-        int lastDot = fullName.lastIndexOf(".");
-        if (lastDot < 0)
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName);
-        try
-        {
-          classObj = getClassForName(fullName.substring(0, lastDot));
-        }
-        catch (ClassNotFoundException e) 
-        {
-          throw new TransformerException(e);
-        }
-        localPart = fullName.substring(lastDot + 1);
-        m = MethodResolver.getElementMethod(classObj, localPart);
-        if (!Modifier.isStatic(m.getModifiers()))
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName);
-      }
-      catch (Exception e)
-      {
-        // e.printStackTrace ();
-        throw new TransformerException (e);
-      }
-      putToCache(methodKey, null, null, m);
-    }
-
-    XSLProcessorContext xpc = new XSLProcessorContext(transformer, 
-                                                      stylesheetTree);
-
-    try
-    {
-      result = m.invoke(null, new Object[] {xpc, element});
-    }
-    catch (Exception e)
-    {
-      // e.printStackTrace ();
-      throw new TransformerException (e);
-    }
-
-    if (result != null)
-    {
-      xpc.outputToResultTree (stylesheetTree, result);
-    }
- 
-  }
-
-}
diff --git a/src/org/apache/xalan/extensions/ExtensionsTable.java b/src/org/apache/xalan/extensions/ExtensionsTable.java
deleted file mode 100644
index ad46a89..0000000
--- a/src/org/apache/xalan/extensions/ExtensionsTable.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.xpath.objects.XNull;
-import org.apache.xpath.XPathProcessorException;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class holding a table registered extension namespace handlers
- */
-public class ExtensionsTable
-{
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Table of extensions that may be called from the expression language
-   * via the call(name, ...) function.  Objects are keyed on the call
-   * name.
-   */
-  public Hashtable m_extensionFunctionNamespaces = new Hashtable();
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Primes the new ExtensionsTable object with built-in namespaces.
-   */
-  public ExtensionsTable()
-  {
-
-    // register the java namespace as being implemented by the 
-    // xslt-javaclass engine. Note that there's no real code
-    // per se for this extension as the functions carry the 
-    // object on which to call etc. and all the logic of breaking
-    // that up is in the xslt-javaclass engine.
-    String uri = "http://xml.apache.org/xslt/java";
-    ExtensionHandler fh = new ExtensionHandlerJavaPackage(uri,
-                            "xslt-javaclass", "");
-
-    addExtensionNamespace(uri, fh);
-
-    uri = "http://xsl.lotus.com/java";
-
-    addExtensionNamespace(uri, fh);
-
-    uri = "http://xml.apache.org/xalan";
-    fh = new ExtensionHandlerJavaClass(uri, "javaclass",
-                                       "org.apache.xalan.lib.Extensions");
-
-    addExtensionNamespace(uri, fh);
-  }
-
-  /**
-   * Get an ExtensionHandler object that represents the
-   * given namespace.
-   * @param extns A valid extension namespace.
-   *
-   * @return ExtensionHandler object that represents the
-   * given namespace.
-   */
-  public ExtensionHandler get(String extns)
-  {
-    return (ExtensionHandler) m_extensionFunctionNamespaces.get(extns);
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Register an extension namespace handler. This handler provides
-   * functions for testing whether a function is known within the
-   * namespace and also for invoking the functions.
-   *
-   * @param uri the URI for the extension.
-   * @param extNS the extension handler.
-   */
-  public void addExtensionNamespace(String uri, ExtensionHandler extNS)
-  {
-    m_extensionFunctionNamespaces.put(uri, extNS);
-  }
-
-  /**
-   * Execute the function-available() function.
-   * @param ns       the URI of namespace in which the function is needed
-   * @param funcName the function name being tested
-   *
-   * @return whether the given function is available or not.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean functionAvailable(String ns, String funcName)
-          throws javax.xml.transform.TransformerException
-  {
-
-    boolean isAvailable = false;
-
-    if (null != ns)
-    {
-      ExtensionHandler extNS =
-        (ExtensionHandler) m_extensionFunctionNamespaces.get(ns);
-
-      if (extNS == null)
-      {
-        extNS = makeJavaNamespace(ns);
-
-        addExtensionNamespace(ns, extNS);
-      }
-
-      if (extNS != null)
-      {
-        isAvailable = extNS.isFunctionAvailable(funcName);
-      }
-    }
-
-    // System.err.println (">>> functionAvailable (ns=" + ns + 
-    //                    ", func=" + funcName + ") = " + isAvailable);
-    return isAvailable;
-  }
-
-  /**
-   * Execute the element-available() function.
-   * @param ns       the URI of namespace in which the function is needed
-   * @param funcName the function name being tested
-   * @param elemName name of element being tested
-   *
-   * @return whether the given function is available or not.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean elementAvailable(String ns, String elemName)
-          throws javax.xml.transform.TransformerException
-  {
-
-    boolean isAvailable = false;
-
-    if (null != ns)
-    {
-      ExtensionHandler extNS =
-        (ExtensionHandler) m_extensionFunctionNamespaces.get(ns);
-
-      if (extNS == null)
-      {
-        extNS = makeJavaNamespace(ns);
-
-        addExtensionNamespace(ns, extNS);
-      }
-
-      if (extNS != null)
-      {
-        isAvailable = extNS.isElementAvailable(elemName);
-      }
-    }
-
-    // System.err.println (">>> elementAvailable (ns=" + ns + 
-    //                    ", elem=" + elemName + ") = " + isAvailable);
-    return isAvailable;
-  }
-
-  /**
-   * Handle an extension function.
-   * @param ns        the URI of namespace in which the function is needed
-   * @param funcName  the function name being called
-   * @param argVec    arguments to the function in a vector
-   * @param methodKey a unique key identifying this function instance in the
-   *                  stylesheet
-   * @param exprContext a context which may be passed to an extension function
-   *                  and provides callback functions to access various
-   *                  areas in the environment
-   *
-   * @return result of executing the function
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public Object extFunction(
-          String ns, String funcName, Vector argVec, Object methodKey, 
-          ExpressionContext exprContext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    Object result = null;
-
-    if (null != ns)
-    {
-      ExtensionHandler extNS =
-        (ExtensionHandler) m_extensionFunctionNamespaces.get(ns);
-
-      // If the handler for this extension URI is not found try to auto declare 
-      // this extension namespace:
-      if (null == extNS)
-      {
-        extNS = makeJavaNamespace(ns);
-
-        addExtensionNamespace(ns, extNS);
-      }
-
-      if (null != extNS)
-      {
-        try
-        {
-          result = extNS.callFunction(funcName, argVec, methodKey,
-                                      exprContext);
-        }
-        catch (javax.xml.transform.TransformerException e)
-        {
-          throw e;
-        }
-        catch (Exception e)
-        {
-          throw new javax.xml.transform.TransformerException(e);
-        }
-      }
-      else
-      {
-        throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":"
-                                         // + funcName + "' is unknown");
-      }
-    }
-
-    return result;
-  }
-
-  /**
-   * Declare the appropriate java extension handler.
-   * @param ns        the URI of namespace in which the function is needed
-   * @return          an ExtensionHandler for this namespace, or null if 
-   *                  not found.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public ExtensionHandler makeJavaNamespace(String ns)
-          throws javax.xml.transform.TransformerException
-  {
-    if(null == ns || ns.trim().length() == 0) // defensive. I don't think it's needed.  -sb
-      return null;
-
-    // First, prepare the name of the actual class or package.  We strip
-    // out any leading "class:".  Next, we see if there is a /.  If so,
-    // only look at anything to the right of the rightmost /.
-    // In the documentation, we state that any classes or packages
-    // declared using this technique must start with xalan://.  However,
-    // in this version, we don't enforce that.
-    String className = ns;
-
-    if (className.startsWith("class:"))
-    {
-      className = className.substring(6);
-    }
-
-    int lastSlash = className.lastIndexOf("/");
-
-    if (-1 != lastSlash)
-      className = className.substring(lastSlash + 1);
-      
-    // The className can be null here, and can cause an error in getClassForName
-    // in JDK 1.8.
-    if(null == className || className.trim().length() == 0) 
-      return null;
-
-    try
-    {
-      ExtensionHandler.getClassForName(className);
-
-      return new ExtensionHandlerJavaClass(ns, "javaclass", className);
-    }
-    catch (ClassNotFoundException e)
-    {
-      return new ExtensionHandlerJavaPackage(ns, "javapackage",
-                                             className + ".");
-    }
-  }
-}
diff --git a/src/org/apache/xalan/extensions/MethodResolver.java b/src/org/apache/xalan/extensions/MethodResolver.java
deleted file mode 100644
index 0432832..0000000
--- a/src/org/apache/xalan/extensions/MethodResolver.java
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.extensions;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Modifier;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xml.dtm.*;
-import org.apache.xml.dtm.ref.DTMNodeIterator;
-import org.apache.xml.dtm.ref.DTMNodeList;
-import org.apache.xml.dtm.ref.DTMNodeProxy;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * Utility class to help resolve method overloading with Xalan XSLT 
- * argument types.
- */
-public class MethodResolver
-{
-
-  /**
-   * Specifies a search for static methods only.
-   */
-  public static final int STATIC_ONLY         = 1;
-
-  /**
-   * Specifies a search for instance methods only.
-   */
-  public static final int INSTANCE_ONLY       = 2;
-
-  /**
-   * Specifies a search for both static and instance methods.
-   */
-  public static final int STATIC_AND_INSTANCE = 3;
-
-  /**
-   * Specifies a Dynamic method search.  If the method being
-   * evaluated is a static method, all arguments are used.
-   * Otherwise, it is an instance method and only arguments
-   * beginning with the second argument are used.
-   */
-  public static final int DYNAMIC             = 4;
-
-  /**
-   * Given a class, figure out the resolution of 
-   * the Java Constructor from the XSLT argument types, and perform the 
-   * conversion of the arguments.
-   * @param classObj the Class of the object to be constructed.
-   * @param argsIn An array of XSLT/XPath arguments.
-   * @param argsOut An array of the exact size as argsIn, which will be 
-   * populated with converted arguments if a suitable method is found.
-   * @return A constructor that will work with the argsOut array.
-   * @throws TransformerException may be thrown for Xalan conversion
-   * exceptions.
-   */
-  public static Constructor getConstructor(Class classObj, 
-                                           Object[] argsIn, 
-                                           Object[][] argsOut,
-                                           ExpressionContext exprContext)
-    throws NoSuchMethodException,
-           SecurityException,
-           TransformerException
-  {
-    Constructor bestConstructor = null;
-    Class[] bestParamTypes = null;
-    Constructor[] constructors = classObj.getConstructors();
-    int nMethods = constructors.length;
-    int bestScore = Integer.MAX_VALUE;
-    int bestScoreCount = 0;
-    for(int i = 0; i < nMethods; i++)
-    {
-      Constructor ctor = constructors[i];
-      Class[] paramTypes = ctor.getParameterTypes();
-      int numberMethodParams = paramTypes.length;
-      int paramStart = 0;
-      boolean isFirstExpressionContext = false;
-      int scoreStart;
-      // System.out.println("numberMethodParams: "+numberMethodParams);
-      // System.out.println("argsIn.length: "+argsIn.length);
-      // System.out.println("exprContext: "+exprContext);
-      if(numberMethodParams == (argsIn.length+1))
-      {
-        Class javaClass = paramTypes[0];
-        // System.out.println("first javaClass: "+javaClass.getName());
-        if(ExpressionContext.class.isAssignableFrom(javaClass))
-        {
-          isFirstExpressionContext = true;
-          scoreStart = 0;
-          paramStart++;
-          // System.out.println("Incrementing paramStart: "+paramStart);
-        }
-        else
-          continue;
-      }
-      else
-          scoreStart = 1000;
-      
-      if(argsIn.length == (numberMethodParams - paramStart))
-      {
-        // then we have our candidate.
-        int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart);
-        // System.out.println("score: "+score);
-        if(-1 == score)	
-          continue;
-        if(score < bestScore)
-        {
-          // System.out.println("Assigning best ctor: "+ctor);
-          bestConstructor = ctor;
-          bestParamTypes = paramTypes;
-          bestScore = score;
-          bestScoreCount = 1;
-        }
-        else if (score == bestScore)
-          bestScoreCount++;
-      }
-    }
-
-    if(null == bestConstructor)
-    {
-      throw new NoSuchMethodException(errString("function", "constructor", classObj,
-                                                                        "", 0, argsIn));
-    }
-    /*** This is commented out until we can do a better object -> object scoring 
-    else if (bestScoreCount > 1)
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for "
-                                                                   + classObj.getName());
-    ***/
-    else
-      convertParams(argsIn, argsOut, bestParamTypes, exprContext);
-    
-    return bestConstructor;
-  }
-
-  
-  /**
-   * Given the name of a method, figure out the resolution of 
-   * the Java Method from the XSLT argument types, and perform the 
-   * conversion of the arguments.
-   * @param classObj The Class of the object that should have the method.
-   * @param name The name of the method to be invoked.
-   * @param argsIn An array of XSLT/XPath arguments.
-   * @param argsOut An array of the exact size as argsIn, which will be 
-   * populated with converted arguments if a suitable method is found.
-   * @return A method that will work with the argsOut array.
-   * @throws TransformerException may be thrown for Xalan conversion
-   * exceptions.
-   */
-  public static Method getMethod(Class classObj,
-                                 String name, 
-                                 Object[] argsIn, 
-                                 Object[][] argsOut,
-                                 ExpressionContext exprContext,
-                                 int searchMethod)
-    throws NoSuchMethodException,
-           SecurityException,
-           TransformerException
-  {
-    // System.out.println("---> Looking for method: "+name);
-    // System.out.println("---> classObj: "+classObj);
-    Method bestMethod = null;
-    Class[] bestParamTypes = null;
-    Method[] methods = classObj.getMethods();
-    int nMethods = methods.length;
-    int bestScore = Integer.MAX_VALUE;
-    int bestScoreCount = 0;
-    boolean isStatic;
-    for(int i = 0; i < nMethods; i++)
-    {
-      Method method = methods[i];
-      // System.out.println("looking at method: "+method);
-      int xsltParamStart = 0;
-      if(method.getName().equals(name))
-      {
-        isStatic = Modifier.isStatic(method.getModifiers());
-        switch(searchMethod)
-        {
-          case STATIC_ONLY:
-            if (!isStatic)
-            {
-              continue;
-            }
-            break;
-
-          case INSTANCE_ONLY:
-            if (isStatic)
-            {
-              continue;
-            }
-            break;
-
-          case STATIC_AND_INSTANCE:
-            break;
-
-          case DYNAMIC:
-            if (!isStatic)
-              xsltParamStart = 1;
-        }
-        int javaParamStart = 0;
-        Class[] paramTypes = method.getParameterTypes();
-        int numberMethodParams = paramTypes.length;
-        boolean isFirstExpressionContext = false;
-        int scoreStart;
-        // System.out.println("numberMethodParams: "+numberMethodParams);
-        // System.out.println("argsIn.length: "+argsIn.length);
-        // System.out.println("exprContext: "+exprContext);
-        int argsLen = (null != argsIn) ? argsIn.length : 0;
-        if(numberMethodParams == (argsLen-xsltParamStart+1))
-        {
-          Class javaClass = paramTypes[0];
-          if(ExpressionContext.class.isAssignableFrom(javaClass))
-          {
-            isFirstExpressionContext = true;
-            scoreStart = 0;
-            javaParamStart++;
-          }
-          else
-          {
-            continue;
-          }
-        }
-        else
-            scoreStart = 1000;
-        
-        if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart))
-        {
-          // then we have our candidate.
-          int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart);
-          // System.out.println("score: "+score);
-          if(-1 == score)
-            continue;
-          if(score < bestScore)
-          {
-            // System.out.println("Assigning best method: "+method);
-            bestMethod = method;
-            bestParamTypes = paramTypes;
-            bestScore = score;
-            bestScoreCount = 1;
-          }
-          else if (score == bestScore)
-            bestScoreCount++;
-        }
-      }
-    }
-    
-    if (null == bestMethod)
-    {
-      throw new NoSuchMethodException(errString("function", "method", classObj,
-                                                                name, searchMethod, argsIn));
-    }
-    /*** This is commented out until we can do a better object -> object scoring 
-    else if (bestScoreCount > 1)
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name);
-    ***/
-    else
-      convertParams(argsIn, argsOut, bestParamTypes, exprContext);
-    
-    return bestMethod;
-  }
-
-  
-  /**
-   * Given the name of a method, figure out the resolution of 
-   * the Java Method
-   * @param classObj The Class of the object that should have the method.
-   * @param name The name of the method to be invoked.
-   * @return A method that will work to be called as an element.
-   * @throws TransformerException may be thrown for Xalan conversion
-   * exceptions.
-   */
-  public static Method getElementMethod(Class classObj,
-                                        String name)
-    throws NoSuchMethodException,
-           SecurityException,
-           TransformerException
-  {
-    // System.out.println("---> Looking for element method: "+name);
-    // System.out.println("---> classObj: "+classObj);
-    Method bestMethod = null;
-    Method[] methods = classObj.getMethods();
-    int nMethods = methods.length;
-    int bestScoreCount = 0;
-    for(int i = 0; i < nMethods; i++)
-    {
-      Method method = methods[i];
-      // System.out.println("looking at method: "+method);
-      if(method.getName().equals(name))
-      {
-        Class[] paramTypes = method.getParameterTypes();
-        if ( (paramTypes.length == 2)
-           && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class)
-                                         && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) )
-        {
-          if ( ++bestScoreCount == 1 )
-            bestMethod = method;
-          else
-            break;
-        }
-      }
-    }
-    
-    if (null == bestMethod)
-    {
-      throw new NoSuchMethodException(errString("element", "method", classObj,
-                                                                        name, 0, null));
-    }
-    else if (bestScoreCount > 1)
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name);
-    
-    return bestMethod;
-  }
-  
-
-  /**
-   * Convert a set of parameters based on a set of paramTypes.
-   * @param argsIn An array of XSLT/XPath arguments.
-   * @param argsOut An array of the exact size as argsIn, which will be 
-   * populated with converted arguments.
-   * @param paramTypes An array of class objects, of the exact same 
-   * size as argsIn and argsOut.
-   * @throws TransformerException may be thrown for Xalan conversion
-   * exceptions.
-   */
-  public static void convertParams(Object[] argsIn, 
-                                   Object[][] argsOut, Class[] paramTypes,
-                                   ExpressionContext exprContext)
-    throws javax.xml.transform.TransformerException
-  {
-    // System.out.println("In convertParams");
-    if (paramTypes == null)
-      argsOut[0] = null;
-    else
-    {
-      int nParams = paramTypes.length;
-      argsOut[0] = new Object[nParams];
-      int paramIndex = 0;
-      if((nParams > 0) 
-         && ExpressionContext.class.isAssignableFrom(paramTypes[0]))
-      {
-        argsOut[0][0] = exprContext;
-        // System.out.println("Incrementing paramIndex in convertParams: "+paramIndex);
-        paramIndex++;
-      }
-
-      if (argsIn != null)
-      {
-        for(int i = argsIn.length - nParams + paramIndex ; paramIndex < nParams; i++, paramIndex++)
-        {
-          // System.out.println("paramTypes[i]: "+paramTypes[i]);
-          argsOut[0][paramIndex] = convert(argsIn[i], paramTypes[paramIndex]);
-        }
-      }
-    }
-  }
-  
-  /**
-   * Simple class to hold information about allowed conversions 
-   * and their relative scores, for use by the table below.
-   */
-  static class ConversionInfo
-  {
-    ConversionInfo(Class cl, int score)
-    {
-      m_class = cl;
-      m_score = score;
-    }
-    
-    Class m_class;  // Java class to convert to.
-    int m_score; // Match score, closer to zero is more matched.
-  }
-  
-  private static final int SCOREBASE=1;
-  
-  /**
-   * Specification of conversions from XSLT type CLASS_UNKNOWN
-   * (i.e. some unknown Java object) to allowed Java types.
-   */
-  static ConversionInfo[] m_javaObjConversions = {
-    new ConversionInfo(Double.TYPE, 11),
-    new ConversionInfo(Float.TYPE, 12),
-    new ConversionInfo(Long.TYPE, 13),
-    new ConversionInfo(Integer.TYPE, 14),
-    new ConversionInfo(Short.TYPE, 15),
-    new ConversionInfo(Character.TYPE, 16),
-    new ConversionInfo(Byte.TYPE, 17),
-    new ConversionInfo(java.lang.String.class, 18)
-  };
-  
-  /**
-   * Specification of conversions from XSLT type CLASS_BOOLEAN
-   * to allowed Java types.
-   */
-  static ConversionInfo[] m_booleanConversions = {
-    new ConversionInfo(Boolean.TYPE, 0),
-    new ConversionInfo(java.lang.Boolean.class, 1),
-    new ConversionInfo(java.lang.Object.class, 2),
-    new ConversionInfo(java.lang.String.class, 3)
-  };
-
-  /**
-   * Specification of conversions from XSLT type CLASS_NUMBER
-   * to allowed Java types.
-   */
-  static ConversionInfo[] m_numberConversions = {
-    new ConversionInfo(Double.TYPE, 0),
-    new ConversionInfo(java.lang.Double.class, 1),
-    new ConversionInfo(Float.TYPE, 3),
-    new ConversionInfo(Long.TYPE, 4),
-    new ConversionInfo(Integer.TYPE, 5),
-    new ConversionInfo(Short.TYPE, 6),
-    new ConversionInfo(Character.TYPE, 7),
-    new ConversionInfo(Byte.TYPE, 8),
-    new ConversionInfo(Boolean.TYPE, 9),
-    new ConversionInfo(java.lang.String.class, 10),
-    new ConversionInfo(java.lang.Object.class, 11)
-  };
-
-  /**
-   * Specification of conversions from XSLT type CLASS_STRING
-   * to allowed Java types.
-   */
-  static ConversionInfo[] m_stringConversions = {
-    new ConversionInfo(java.lang.String.class, 0),
-    new ConversionInfo(java.lang.Object.class, 1),
-    new ConversionInfo(Character.TYPE, 2),
-    new ConversionInfo(Double.TYPE, 3),
-    new ConversionInfo(Float.TYPE, 3),
-    new ConversionInfo(Long.TYPE, 3),
-    new ConversionInfo(Integer.TYPE, 3),
-    new ConversionInfo(Short.TYPE, 3),
-    new ConversionInfo(Byte.TYPE, 3),
-    new ConversionInfo(Boolean.TYPE, 4)
-  };
-
-  /**
-   * Specification of conversions from XSLT type CLASS_RTREEFRAG
-   * to allowed Java types.
-   */
-  static ConversionInfo[] m_rtfConversions = {
-    new ConversionInfo(org.w3c.dom.traversal.NodeIterator.class, 0),
-    new ConversionInfo(org.w3c.dom.NodeList.class, 1),
-    new ConversionInfo(org.w3c.dom.Node.class, 2),
-    new ConversionInfo(java.lang.String.class, 3),
-    new ConversionInfo(java.lang.Object.class, 5),
-    new ConversionInfo(Character.TYPE, 6),
-    new ConversionInfo(Double.TYPE, 7),
-    new ConversionInfo(Float.TYPE, 7),
-    new ConversionInfo(Long.TYPE, 7),
-    new ConversionInfo(Integer.TYPE, 7),
-    new ConversionInfo(Short.TYPE, 7),
-    new ConversionInfo(Byte.TYPE, 7),
-    new ConversionInfo(Boolean.TYPE, 8)
-  };
-  
-  /**
-   * Specification of conversions from XSLT type CLASS_NODESET
-   * to allowed Java types.  (This is the same as for CLASS_RTREEFRAG)
-   */
-  static ConversionInfo[] m_nodesetConversions = {
-    new ConversionInfo(org.w3c.dom.traversal.NodeIterator.class, 0),
-    new ConversionInfo(org.w3c.dom.NodeList.class, 1),
-    new ConversionInfo(org.w3c.dom.Node.class, 2),
-    new ConversionInfo(java.lang.String.class, 3),
-    new ConversionInfo(java.lang.Object.class, 5),
-    new ConversionInfo(Character.TYPE, 6),
-    new ConversionInfo(Double.TYPE, 7),
-    new ConversionInfo(Float.TYPE, 7),
-    new ConversionInfo(Long.TYPE, 7),
-    new ConversionInfo(Integer.TYPE, 7),
-    new ConversionInfo(Short.TYPE, 7),
-    new ConversionInfo(Byte.TYPE, 7),
-    new ConversionInfo(Boolean.TYPE, 8)
-  };
-  
-  /**
-   * Order is significant in the list below, based on 
-   * XObject.CLASS_XXX values.
-   */
-  static ConversionInfo[][] m_conversions = 
-  {
-    m_javaObjConversions, // CLASS_UNKNOWN = 0;
-    m_booleanConversions, // CLASS_BOOLEAN = 1;
-    m_numberConversions,  // CLASS_NUMBER = 2;
-    m_stringConversions,  // CLASS_STRING = 3;
-    m_nodesetConversions, // CLASS_NODESET = 4;
-    m_rtfConversions      // CLASS_RTREEFRAG = 5;
-  };
-  
-  /**
-   * Score the conversion of a set of XSLT arguments to a 
-   * given set of Java parameters.
-   * If any invocations of this function for a method with 
-   * the same name return the same positive value, then a conflict 
-   * has occured, and an error should be signaled.
-   * @param javaParamTypes Must be filled with valid class names, and 
-   * of the same length as xsltArgs.
-   * @param xsltArgs Must be filled with valid object instances, and 
-   * of the same length as javeParamTypes.
-   * @return -1 for no allowed conversion, or a positive score 
-   * that is closer to zero for more preferred, or further from 
-   * zero for less preferred.
-   */
-  public static int scoreMatch(Class[] javaParamTypes, int javaParamsStart,
-                               Object[] xsltArgs, int score)
-  {
-    if ((xsltArgs == null) || (javaParamTypes == null))
-      return score;
-    int nParams = xsltArgs.length;
-    for(int i = nParams - javaParamTypes.length + javaParamsStart, javaParamTypesIndex = javaParamsStart; 
-        i < nParams; 
-        i++, javaParamTypesIndex++)
-    {
-      Object xsltObj = xsltArgs[i];
-      int xsltClassType = (xsltObj instanceof XObject) 
-                          ? ((XObject)xsltObj).getType() 
-                            : XObject.CLASS_UNKNOWN;
-      Class javaClass = javaParamTypes[javaParamTypesIndex];
-      
-      // System.out.println("Checking xslt: "+xsltObj.getClass().getName()+
-      //                   " against java: "+javaClass.getName());
-      
-      if(xsltClassType == XObject.CLASS_NULL)
-      {
-        // In Xalan I have objects of CLASS_NULL, though I'm not 
-        // sure they're used any more.  For now, do something funky.
-        if(!javaClass.isPrimitive())
-        {
-          // Then assume that a null can be used, but give it a low score.
-          score += 10;
-          continue;
-        }
-        else
-          return -1;  // no match.
-      }
-      
-      ConversionInfo[] convInfo = m_conversions[xsltClassType];
-      int nConversions = convInfo.length;
-      int k;
-      for(k = 0; k < nConversions; k++)
-      {
-        ConversionInfo cinfo = convInfo[k];
-        if(javaClass.isAssignableFrom(cinfo.m_class))
-        {
-          score += cinfo.m_score;
-          break; // from k loop
-        }
-      }
-
-      if (k == nConversions)
-      {
-        // If we get here, we haven't made a match on this parameter using 
-        // the ConversionInfo array.  We now try to handle the object -> object
-        // mapping which we can't handle through the array mechanism.  To do this,
-        // we must determine the class of the argument passed from the stylesheet.
-
-        // If we were passed a subclass of XObject, representing one of the actual
-        // XSLT types, and we are here, we reject this extension method as a candidate
-        // because a match should have been made using the ConversionInfo array.  If we 
-        // were passed an XObject that encapsulates a non-XSLT type or we
-        // were passed a non-XSLT type directly, we continue.
-
-        // The current implementation (contributed by Kelly Campbell <camk@channelpoint.com>)
-        // checks to see if we were passed an XObject from the XSLT stylesheet.  If not,
-        // we use the class of the object that was passed and make sure that it will
-        // map to the class type of the parameter in the extension function.
-        // If we were passed an XObject, we attempt to get the class of the actual
-        // object encapsulated inside the XObject.  If the encapsulated object is null,
-        // we judge this method as a match but give it a low score.  
-        // If the encapsulated object is not null, we use its type to determine
-        // whether this java method is a valid match for this extension function call.
-        // This approach eliminates the NullPointerException in the earlier implementation
-        // that resulted from passing an XObject encapsulating the null java object.
-                                
-        // TODO:  This needs to be improved to assign relative scores to subclasses,
-        // etc. 
-
-        if (XObject.CLASS_UNKNOWN == xsltClassType)
-        {
-          Class realClass = null;
-
-          if (xsltObj instanceof XObject)
-          {
-            Object realObj = ((XObject) xsltObj).object();
-            if (null != realObj)
-            {
-              realClass = realObj.getClass();
-            }
-            else
-            {
-              // do the same as if we were passed XObject.CLASS_NULL
-              score += 10;
-              continue;
-            }
-          }
-          else
-          {
-            realClass = xsltObj.getClass();
-          }
-
-          if (javaClass.isAssignableFrom(realClass))
-          {
-            score += 0;         // TODO: To be assigned based on subclass "distance"
-          }
-          else
-            return -1;
-        }
-        else
-          return -1;
-      }
-    }
-    return score;
-  }
-  
-  /**
-   * Convert the given XSLT object to an object of 
-   * the given class.
-   * @param xsltObj The XSLT object that needs conversion.
-   * @param javaClass The type of object to convert to.
-   * @returns An object suitable for passing to the Method.invoke 
-   * function in the args array, which may be null in some cases.
-   * @throws TransformerException may be thrown for Xalan conversion
-   * exceptions.
-   */
-  static Object convert(Object xsltObj, Class javaClass)
-    throws javax.xml.transform.TransformerException
-  {
-    if(xsltObj instanceof XObject)
-    {
-      XObject xobj = ((XObject)xsltObj);
-      int xsltClassType = xobj.getType();
-
-      switch(xsltClassType)
-      {
-      case XObject.CLASS_NULL:
-        return null;
-        
-      case XObject.CLASS_BOOLEAN:
-        {
-          if(javaClass == java.lang.String.class)
-            return xobj.str();
-          else
-            return new Boolean(xobj.bool());
-        }
-        // break; Unreachable
-      case XObject.CLASS_NUMBER:
-        {
-          if(javaClass == java.lang.String.class)
-            return xobj.str();
-          else if(javaClass == Boolean.TYPE)
-            return new Boolean(xobj.bool());
-          else 
-          {
-            return convertDoubleToNumber(xobj.num(), javaClass);
-          }
-        }
-        // break; Unreachable
-        
-      case XObject.CLASS_STRING:
-        {
-          if((javaClass == java.lang.String.class) ||
-             (javaClass == java.lang.Object.class))
-            return xobj.str();
-          else if(javaClass == Character.TYPE)
-          {
-            String str = xobj.str();
-            if(str.length() > 0)
-              return new Character(str.charAt(0));
-            else
-              return null; // ??
-          }
-          else if(javaClass == Boolean.TYPE)
-            return new Boolean(xobj.bool());
-          else 
-          {
-            return convertDoubleToNumber(xobj.num(), javaClass);
-          }
-        }
-        // break; Unreachable
-        
-      case XObject.CLASS_RTREEFRAG:
-        {
-          // GLP:  I don't see the reason for the isAssignableFrom call
-          //       instead of an == test as is used everywhere else.
-          //       Besides, if the javaClass is a subclass of NodeIterator
-          //       the condition will be true and we'll create a NodeIterator
-          //       which may not match the javaClass, causing a RuntimeException.
-          // if((NodeIterator.class.isAssignableFrom(javaClass)) ||
-          if ( (javaClass == NodeIterator.class) ||
-               (javaClass == java.lang.Object.class) )
-          {
-            DTMIterator dtmIter = ((XRTreeFrag) xobj).asNodeIterator();
-            return new DTMNodeIterator(dtmIter);
-          }
-          else if (javaClass == NodeList.class)
-          {
-            return ((XRTreeFrag) xobj).convertToNodeset();
-          }
-          // Same comment as above
-          // else if(Node.class.isAssignableFrom(javaClass))
-          else if(javaClass == Node.class)
-          {
-            DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator();
-            int rootHandle = iter.nextNode();
-            DTM dtm = iter.getDTM(rootHandle);
-            return dtm.getNode(dtm.getFirstChild(rootHandle));
-          }
-          else if(javaClass == java.lang.String.class)
-          {
-            return xobj.str();
-          }
-          else if(javaClass == Boolean.TYPE)
-          {
-            return new Boolean(xobj.bool());
-          }
-          else if(javaClass.isPrimitive())
-          {
-            return convertDoubleToNumber(xobj.num(), javaClass);
-          }
-          else
-          {
-            DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator();
-            int rootHandle = iter.nextNode();
-            DTM dtm = iter.getDTM(rootHandle);
-            Node child = dtm.getNode(dtm.getFirstChild(rootHandle));
-
-            if(javaClass.isAssignableFrom(child.getClass()))
-              return child;
-            else
-              return null;
-          }
-        }
-        // break; Unreachable
-        
-      case XObject.CLASS_NODESET:
-        {
-          // GLP:  I don't see the reason for the isAssignableFrom call
-          //       instead of an == test as is used everywhere else.
-          //       Besides, if the javaClass is a subclass of NodeIterator
-          //       the condition will be true and we'll create a NodeIterator
-          //       which may not match the javaClass, causing a RuntimeException.
-          // if((NodeIterator.class.isAssignableFrom(javaClass)) ||
-          if ( (javaClass == NodeIterator.class) ||
-               (javaClass == java.lang.Object.class) )
-          {
-            return xobj.nodeset();
-          }
-          // Same comment as above
-          // else if(NodeList.class.isAssignableFrom(javaClass))
-          else if(javaClass == NodeList.class)
-          {
-            return xobj.nodelist();
-          }
-          // Same comment as above
-          // else if(Node.class.isAssignableFrom(javaClass))
-          else if(javaClass == Node.class)
-          {
-            // Xalan ensures that iter() always returns an
-            // iterator positioned at the beginning.
-            DTMIterator ni = xobj.iter();
-            int handle = ni.nextNode();           
-            return ni.getDTM(handle).getNode(handle); // may be null.
-          }
-          else if(javaClass == java.lang.String.class)
-          {
-            return xobj.str();
-          }
-          else if(javaClass == Boolean.TYPE)
-          {
-            return new Boolean(xobj.bool());
-          }
-          else if(javaClass.isPrimitive())
-          {
-            return convertDoubleToNumber(xobj.num(), javaClass);
-          }
-          else
-          {
-            DTMIterator iter = xobj.iter();
-            int childHandle = iter.nextNode();
-            DTM dtm = iter.getDTM(childHandle);
-            Node child = dtm.getNode(childHandle);
-            if(javaClass.isAssignableFrom(child.getClass()))
-              return child;
-            else
-              return null;
-          }
-        }
-        // break; Unreachable
-        
-        // No default:, fall-through on purpose
-      } // end switch
-      xsltObj = xobj.object();
-      
-    } // end if if(xsltObj instanceof XObject)
-    
-    // At this point, we have a raw java object, not an XObject.
-    if (null != xsltObj)
-    {
-      if(javaClass == java.lang.String.class)
-      {
-        return xsltObj.toString();
-      }
-      else if(javaClass.isPrimitive())
-      {
-        // Assume a number conversion
-        XString xstr = new XString(xsltObj.toString());
-        double num = xstr.num();
-        return convertDoubleToNumber(num, javaClass);
-      }
-      else if(javaClass == java.lang.Class.class)
-      {
-        return xsltObj.getClass();
-      }
-      else
-      {
-        // Just pass the object directly, and hope for the best.
-        return xsltObj;
-      }
-                }
-    else
-    {
-      // Just pass the object directly, and hope for the best.
-      return xsltObj;
-    }
-  }
-  
-  /**
-   * Do a standard conversion of a double to the specified type.
-   * @param num The number to be converted.
-   * @param javaClass The class type to be converted to.
-   * @return An object specified by javaClass, or a Double instance.
-   */
-  static Object convertDoubleToNumber(double num, Class javaClass)
-  {
-    // In the code below, I don't check for NaN, etc., instead 
-    // using the standard Java conversion, as I think we should 
-    // specify.  See issue-runtime-errors.
-    if((javaClass == Double.TYPE) ||
-       (javaClass == java.lang.Double.class))
-      return new Double(num);
-    else if(javaClass == Float.TYPE)
-      return new Float(num);
-    else if(javaClass == Long.TYPE)
-    {
-      // Use standard Java Narrowing Primitive Conversion
-      // See http://java.sun.com/docs/books/jls/html/5.doc.html#175672
-      return new Long((long)num);
-    }
-    else if(javaClass == Integer.TYPE)
-    {
-      // Use standard Java Narrowing Primitive Conversion
-      // See http://java.sun.com/docs/books/jls/html/5.doc.html#175672
-      return new Integer((int)num);
-    }
-    else if(javaClass == Short.TYPE)
-    {
-      // Use standard Java Narrowing Primitive Conversion
-      // See http://java.sun.com/docs/books/jls/html/5.doc.html#175672
-      return new Short((short)num);
-    }
-    else if(javaClass == Character.TYPE)
-    {
-      // Use standard Java Narrowing Primitive Conversion
-      // See http://java.sun.com/docs/books/jls/html/5.doc.html#175672
-      return new Character((char)num);
-    }
-    else if(javaClass == Byte.TYPE)
-    {
-      // Use standard Java Narrowing Primitive Conversion
-      // See http://java.sun.com/docs/books/jls/html/5.doc.html#175672
-      return new Byte((byte)num);
-    }
-    else     // Some other type of object
-    {
-      return new Double(num);
-    }
-  }
-
-
-  /**
-   * Format the message for the NoSuchMethodException containing 
-   * all the information about the method we're looking for.
-   */
-  private static String errString(String callType,    // "function" or "element"
-                                  String searchType,  // "method" or "constructor"
-                                  Class classObj,
-                                  String funcName,
-                                  int searchMethod,
-                                  Object[] xsltArgs)
-  {
-    String resultString = "For extension " + callType
-                                              + ", could not find " + searchType + " ";
-    switch (searchMethod)
-    {
-      case STATIC_ONLY:
-        return resultString + "static " + classObj.getName() + "." 
-                            + funcName + "([ExpressionContext,] " + errArgs(xsltArgs, 0) + ").";
-
-      case INSTANCE_ONLY:
-        return resultString + classObj.getName() + "."
-                            + funcName + "([ExpressionContext,] " + errArgs(xsltArgs, 0) + ").";
-
-      case STATIC_AND_INSTANCE:
-        return resultString + classObj.getName() + "." + funcName + "([ExpressionContext,] " + errArgs(xsltArgs, 0) + ").\n"
-                            + "Checked both static and instance methods.";
-
-      case DYNAMIC:
-        return resultString + "static " + classObj.getName() + "." + funcName
-                            + "([ExpressionContext, ]" + errArgs(xsltArgs, 0) + ") nor\n"
-                            + classObj + "." + funcName + "([ExpressionContext,] " + errArgs(xsltArgs, 1) + ").";
-
-      default:
-        if (callType.equals("function"))      // must be a constructor
-        {
-          return resultString + classObj.getName()
-                                  + "([ExpressionContext,] " + errArgs(xsltArgs, 0) + ").";
-        }
-        else                                  // must be an element call
-        {
-          return resultString + classObj.getName() + "." + funcName
-                    + "(org.apache.xalan.extensions.XSLProcessorContext, "
-                    + "org.apache.xalan.templates.ElemExtensionCall).";
-        }
-    }
-    
-  }
-
-
-  private static String errArgs(Object[] xsltArgs, int startingArg)
-  {
-    StringBuffer returnArgs = new StringBuffer();
-    for (int i = startingArg; i < xsltArgs.length; i++)
-    {
-      if (i != startingArg)
-        returnArgs.append(", ");
-      if (xsltArgs[i] instanceof XObject)
-        returnArgs.append(((XObject) xsltArgs[i]).getTypeString());      
-      else
-        returnArgs.append(xsltArgs[i].getClass().getName());
-    }
-    return returnArgs.toString();
-  }
-
-}
diff --git a/src/org/apache/xalan/extensions/XSLProcessorContext.java b/src/org/apache/xalan/extensions/XSLProcessorContext.java
deleted file mode 100644
index 4a938ed..0000000
--- a/src/org/apache/xalan/extensions/XSLProcessorContext.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.extensions;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.*;
-
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xalan.transformer.ClonerToResultTree;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xml.utils.QName;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XBoolean;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.axes.DescendantIterator;
-import org.apache.xpath.axes.OneStepIterator;
-
-import org.apache.xml.dtm.DTM;
-
-// import org.apache.xalan.xslt.*;
-
-/**
- * <meta name="usage" content="general"/>
- * Provides transformer context to be passed to an extension element.
- *
- * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
- */
-public class XSLProcessorContext
-{
-
-  /**
-   * Create a processor context to be passed to an extension.
-   * (Notice it is a package-only constructor).
-   *
-   * @param transformer non-null transformer instance
-   * @param stylesheetTree The owning stylesheet
-   * @param sourceTree The source document
-   * @param sourceNode The current source node
-   * @param mode the current mode being executed.
-   */
-  public XSLProcessorContext(TransformerImpl transformer,
-                             Stylesheet stylesheetTree)
-  {
-
-    this.transformer = transformer;
-    this.stylesheetTree = stylesheetTree;
-    // %TBD%
-    org.apache.xpath.XPathContext xctxt = transformer.getXPathContext();
-    this.mode = transformer.getMode();
-    this.sourceNode = xctxt.getCurrentNode();
-    this.sourceTree = xctxt.getDTM(this.sourceNode);
-  }
-
-  /** An instance of a transformer          */
-  private TransformerImpl transformer;
-
-  /**
-   * Get the transformer.
-   *
-   * @return the transformer instance for this context
-   */
-  public TransformerImpl getTransformer()
-  {
-    return transformer;
-  }
-
-  /** The owning stylesheet for this context          */
-  private Stylesheet stylesheetTree;
-
-  /**
-   * Get the Stylesheet being executed.
-   *
-   * @return the Stylesheet being executed.
-   */
-  public Stylesheet getStylesheet()
-  {
-    return stylesheetTree;
-  }
-
-  /**  The root of the source tree being executed.        */
-  private org.apache.xml.dtm.DTM sourceTree;
-
-  /**
-   * Get the root of the source tree being executed.
-   *
-   * @return the root of the source tree being executed.
-   */
-  public org.w3c.dom.Node getSourceTree()
-  {
-    return sourceTree.getNode(sourceTree.getDocument());
-  }
-
-  /** the current context node.          */
-  private int sourceNode;
-
-  /**
-   * Get the current context node.
-   *
-   * @return the current context node.
-   */
-  public org.w3c.dom.Node getContextNode()
-  {
-    return sourceTree.getNode(sourceNode);
-  }
-
-  /** the current mode being executed.         */
-  private QName mode;
-
-  /**
-   * Get the current mode being executed.
-   *
-   * @return the current mode being executed.
-   */
-  public QName getMode()
-  {
-    return mode;
-  }
-
-  /**
-   * Output an object to the result tree by doing the right conversions.
-   * This is public for access by extensions.
-   *
-   *
-   * @param stylesheetTree The owning stylesheet
-   * @param obj the Java object to output. If its of an X<something> type
-   *        then that conversion is done first and then sent out.
-   *
-   * @throws TransformerException
-   * @throws java.io.FileNotFoundException
-   * @throws java.io.IOException
-   * @throws java.net.MalformedURLException
-   */
-  public void outputToResultTree(Stylesheet stylesheetTree, Object obj)
-          throws TransformerException, java.net.MalformedURLException,
-                 java.io.FileNotFoundException, java.io.IOException
-  {
-
-    try
-    {
-      ResultTreeHandler rtreeHandler = transformer.getResultTreeHandler();
-      XPathContext xctxt = transformer.getXPathContext();
-      XObject value;
-
-      // Make the return object into an XObject because it
-      // will be easier below.  One of the reasons to do this
-      // is to keep all the conversion functionality in the
-      // XObject classes.
-      if (obj instanceof XObject)
-      {
-        value = (XObject) obj;
-      }
-      else if (obj instanceof String)
-      {
-        value = new XString((String) obj);
-      }
-      else if (obj instanceof Boolean)
-      {
-        value = new XBoolean(((Boolean) obj).booleanValue());
-      }
-      else if (obj instanceof Double)
-      {
-        value = new XNumber(((Double) obj).doubleValue());
-      }
-      else if (obj instanceof DocumentFragment)
-      {
-        int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj);
-        
-        value = new XRTreeFrag(handle, xctxt);
-      }
-      else if (obj instanceof DTM)
-      {
-        DTM dtm = (DTM)obj;
-        DTMIterator iterator = new DescendantIterator();
-        iterator.setRoot(dtm.getDocument(), xctxt);
-        value = new XNodeSet(iterator);
-      }
-      else if (obj instanceof DTMAxisIterator)
-      {
-        DTMAxisIterator iter = (DTMAxisIterator)obj;
-        DTMIterator iterator = new OneStepIterator(iter, -1);
-        value = new XNodeSet(iterator);
-      }
-      else if (obj instanceof DTMIterator)
-      {
-        value = new XNodeSet((DTMIterator) obj);
-      }
-      else if (obj instanceof NodeIterator)
-      {
-        value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt));
-      }
-      else if (obj instanceof org.w3c.dom.Node)
-      {
-        value =
-          new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj),
-                       xctxt.getDTMManager());
-      }
-      else
-      {
-        value = new XString(obj.toString());
-      }
-
-      int type = value.getType();
-      String s;
-
-      switch (type)
-      {
-      case XObject.CLASS_BOOLEAN :
-      case XObject.CLASS_NUMBER :
-      case XObject.CLASS_STRING :
-        s = value.str();
-
-        rtreeHandler.characters(s.toCharArray(), 0, s.length());
-        break;
-
-      case XObject.CLASS_NODESET :  // System.out.println(value);
-        DTMIterator nl = value.iter();
-        
-        int pos;
-
-        while (DTM.NULL != (pos = nl.nextNode()))
-        {
-          DTM dtm = nl.getDTM(pos);
-          int top = pos;
-
-          while (DTM.NULL != pos)
-          {
-            rtreeHandler.flushPending();
-            ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), 
-                                                   dtm, rtreeHandler, true);
-
-            int nextNode = dtm.getFirstChild(pos);
-
-            while (DTM.NULL == nextNode)
-            {
-              if (DTM.ELEMENT_NODE == dtm.getNodeType(pos))
-              {
-                rtreeHandler.endElement("", "", dtm.getNodeName(pos));
-              }
-
-              if (top == pos)
-                break;
-
-              nextNode = dtm.getNextSibling(pos);
-
-              if (DTM.NULL == nextNode)
-              {
-                pos = dtm.getParent(pos);
-
-                if (top == pos)
-                {
-                  if (DTM.ELEMENT_NODE == dtm.getNodeType(pos))
-                  {
-                    rtreeHandler.endElement("", "", dtm.getNodeName(pos));
-                  }
-
-                  nextNode = DTM.NULL;
-
-                  break;
-                }
-              }
-            }
-
-            pos = nextNode;
-          }
-        }
-        break;
-      case XObject.CLASS_RTREEFRAG :
-        rtreeHandler.outputResultTreeFragment(value,
-                                              transformer.getXPathContext());
-        break;
-      }
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * I need a "Node transformNode (Node)" method somewhere that the
-   * user can call to process the transformation of a node but not
-   * serialize out automatically. ????????????????
-   *
-   * Does ElemTemplateElement.executeChildTemplates() cut it? It sends
-   * results out to the stream directly, so that could be a problem.
-   */
-}
diff --git a/src/org/apache/xalan/extensions/extensions.dfPackage b/src/org/apache/xalan/extensions/extensions.dfPackage
deleted file mode 100644
index e218c24..0000000
--- a/src/org/apache/xalan/extensions/extensions.dfPackage
+++ /dev/null
@@ -1,22 +0,0 @@
-package idcowc6wt02wac6wt9osw;
-
-/**
-@version 2.0
-@physicalPackage
-@__modelType diagram 
-*/
-class diagram {
-}/**
-@__tags
-@shapeType ClassDiagram 
-*/
-class __tags {
-}/**
-@__options 
-*/
-class __options {
-}/**
-@__positions 
-*/
-class __positions {
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/extensions/package.html b/src/org/apache/xalan/extensions/package.html
deleted file mode 100644
index 7be318c..0000000
--- a/src/org/apache/xalan/extensions/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>Xalan Extension Mechanism Package.</title>
-  <body>
-    <p>Implementation of Xalan Extension Mechanism.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/lib/Extensions.java b/src/org/apache/xalan/lib/Extensions.java
deleted file mode 100644
index a0eed87..0000000
--- a/src/org/apache/xalan/lib/Extensions.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.lib;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.apache.xpath.NodeSet;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.DOMHelper;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.ref.DTMNodeIterator;
-import org.apache.xml.utils.XMLString;
-
-import org.xml.sax.SAXNotSupportedException;
-
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.extensions.ExpressionContext;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-// Note: we should consider loading EnvironmentCheck at runtime
-//  to simplify inter-package dependencies Sep-01 -sc
-import org.apache.xalan.xslt.EnvironmentCheck;
-
-import javax.xml.parsers.*;
-
-/**
- * <meta name="usage" content="general"/>
- * This class contains many of the Xalan-supplied extensions.
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- *    xmlns:xalan="http://xml.apache.org/xalan"
- * </pre>
- */
-public class Extensions
-{
-
-  /**
-   * Constructor Extensions
-   *
-   */
-  private Extensions(){}  // Make sure class cannot be instantiated
-
-  /**
-   * This method is an extension that implements as a Xalan extension
-   * the node-set function also found in xt and saxon.
-   * If the argument is a Result Tree Fragment, then <code>nodeset</code>
-   * returns a node-set consisting of a single root node as described in
-   * section 11.1 of the XSLT 1.0 Recommendation.  If the argument is a
-   * node-set, <code>nodeset</code> returns a node-set.  If the argument
-   * is a string, number, or boolean, then <code>nodeset</code> returns
-   * a node-set consisting of a single root node with a single text node
-   * child that is the result of calling the XPath string() function on the
-   * passed parameter.  If the argument is anything else, then a node-set
-   * is returned consisting of a single root node with a single text node
-   * child that is the result of calling the java <code>toString()</code>
-   * method on the passed argument.
-   * Most of the
-   * actual work here is done in <code>MethodResolver</code> and
-   * <code>XRTreeFrag</code>.
-   * @param myProcessor Context passed by the extension processor
-   * @param rtf Argument in the stylesheet to the nodeset extension function
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public static NodeSet nodeset(ExpressionContext myProcessor, Object rtf)
-  {
-
-    String textNodeValue;
-
-    if (rtf instanceof NodeIterator)
-    {
-      return new NodeSet((NodeIterator) rtf);
-    }
-    else
-    {
-      if (rtf instanceof String)
-      {
-        textNodeValue = (String) rtf;
-      }
-      else if (rtf instanceof Boolean)
-      {
-        textNodeValue = new XBoolean(((Boolean) rtf).booleanValue()).str();
-      }
-      else if (rtf instanceof Double)
-      {
-        textNodeValue = new XNumber(((Double) rtf).doubleValue()).str();
-      }
-      else
-      {
-        textNodeValue = rtf.toString();
-      }
-
-      // This no longer will work right since the DTM.
-      // Document myDoc = myProcessor.getContextNode().getOwnerDocument();
-      try
-      {
-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-        DocumentBuilder db = dbf.newDocumentBuilder();
-        Document myDoc = db.newDocument();
-        
-        Text textNode = myDoc.createTextNode(textNodeValue);
-        DocumentFragment docFrag = myDoc.createDocumentFragment();
-  
-        docFrag.appendChild(textNode);
-  
-        return new NodeSet(docFrag);
-      }
-      catch(ParserConfigurationException pce)
-      {
-        throw new org.apache.xml.utils.WrappedRuntimeException(pce);
-      }
-    }
-  }
-
-  /**
-   * Returns the intersection of two node-sets.
-   * @param n1 NodeIterator for first node-set
-   *
-   * NEEDSDOC @param ni1
-   * @param ni2 NodeIterator for second node-set
-   * @return a NodeSet containing the nodes in ni1 that are also
-   * in ni2
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public static NodeSet intersection(NodeIterator ni1, NodeIterator ni2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    NodeSet ns1 = new NodeSet(ni1);
-    NodeSet ns2 = new NodeSet(ni2);
-    NodeSet inter = new NodeSet();
-
-    inter.setShouldCacheNodes(true);
-
-    for (int i = 0; i < ns1.getLength(); i++)
-    {
-      Node n = ns1.elementAt(i);
-
-      if (ns2.contains(n))
-        inter.addElement(n);
-    }
-
-    return inter;
-  }
-
-  /**
-   * Returns the difference between two node-sets.
-   * @param n1 NodeIterator for first node-set
-   *
-   * NEEDSDOC @param ni1
-   * @param ni2 NodeIterator for second node-set
-   * @return a NodeSet containing the nodes in ni1 that are not
-   * in ni2
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public static NodeSet difference(NodeIterator ni1, NodeIterator ni2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    NodeSet ns1 = new NodeSet(ni1);
-    NodeSet ns2 = new NodeSet(ni2);
-
-    // NodeSet inter= new NodeSet();
-    NodeSet diff = new NodeSet();
-
-    diff.setShouldCacheNodes(true);
-
-    for (int i = 0; i < ns1.getLength(); i++)
-    {
-      Node n = ns1.elementAt(i);
-
-      if (!ns2.contains(n))
-        diff.addElement(n);
-    }
-
-    return diff;
-  }
-
-  /**
-   * Returns node-set containing distinct string values.
-   * @param ni NodeIterator for node-set
-   * @return a NodeSet with nodes from ni containing distinct string values.
-   * In other words, if more than one node in ni contains the same string value,
-   * only include the first such node found.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public static NodeSet distinct(ExpressionContext myContext, NodeIterator ni)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // Set up our resulting NodeSet and the hashtable we use to keep track of duplicate
-    // strings.
-
-    NodeSet dist = new NodeSet();
-    dist.setShouldCacheNodes(true);
-
-    Hashtable stringTable = new Hashtable();
-
-    Node currNode = ni.nextNode();
-
-    while (currNode != null)
-    {
-      String key = myContext.toString(currNode);
-
-      if (!stringTable.containsKey(key))
-      {
-        stringTable.put(key, currNode);
-        dist.addElement(currNode);
-      }
-      currNode = ni.nextNode();
-    }
-
-    return dist;
-  }
-
-  /**
-   * Returns true of both node-sets contain the same set of nodes.
-   * @param n1 NodeIterator for first node-set
-   *
-   * NEEDSDOC @param ni1
-   * @param ni2 NodeIterator for second node-set
-   * @return true if ni1 and ni2 contain exactly the same set of nodes.
-   */
-  public static boolean hasSameNodes(NodeIterator ni1, NodeIterator ni2)
-  {
-
-    NodeSet ns1 = new NodeSet(ni1);
-    NodeSet ns2 = new NodeSet(ni2);
-
-    if (ns1.getLength() != ns2.getLength())
-      return false;
-
-    for (int i = 0; i < ns1.getLength(); i++)
-    {
-      Node n = ns1.elementAt(i);
-
-      if (!ns2.contains(n))
-        return false;
-    }
-
-    return true;
-  }
-
-  /**
-   * Returns the result of evaluating the argument as a string containing
-   * an XPath expression.  Used where the XPath expression is not known until
-   * run-time.  The expression is evaluated as if the run-time value of the
-   * argument appeared in place of the evaluate function call at compile time.
-   * @param myContext an <code>ExpressionContext</code> passed in by the
-   *                  extension mechanism.  This must be an XPathContext.
-   * @param xpathExtr The XPath expression to be evaluated.
-   * NEEDSDOC @param xpathExpr
-   * @return the XObject resulting from evaluating the XPath
-   *
-   * @throws Exception
-   * @throws SAXNotSupportedException
-   */
-  public static XObject evaluate(
-          ExpressionContext myContext, String xpathExpr)
-            throws SAXNotSupportedException, Exception
-  {
-
-    if (myContext instanceof XPathContext.XPathExpressionContext)
-    {
-      try
-      {
-        XPathContext xctxt =
-                    ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
-        XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(),
-                                       xctxt.getNamespaceContext(),
-                                       XPath.SELECT);
-
-        return dynamicXPath.execute(xctxt, myContext.getContextNode(),
-                                    xctxt.getNamespaceContext());
-      }
-      catch (Exception e)
-      {
-        throw e;
-      }
-    }
-    else
-      throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate "
-                                         //+ myContext);
-  }
-
-  /**
-   * Returns a NodeSet containing one text node for each token in the first argument.
-   * Delimiters are specified in the second argument.
-   * Tokens are determined by a call to <code>StringTokenizer</code>.
-   * If the first argument is an empty string or contains only delimiters, the result
-   * will be an empty NodeSet.
-   * Contributed to XalanJ1 by <a href="mailto:benoit.cerrina@writeme.com">Benoit Cerrina</a>.
-   * @param myContext an <code>ExpressionContext</code> passed in by the
-   *                  extension mechanism.  This must be an XPathContext.
-   * @param toTokenize The string to be split into text tokens.
-   * @param delims The delimiters to use.
-   * @return a NodeSet as described above.
-   *
-   */
-  public static NodeSet tokenize(ExpressionContext myContext,
-                                 String toTokenize, String delims)
-  {
-
-    Document lDoc;
-
-    // Document lDoc = myContext.getContextNode().getOwnerDocument();
-    try
-    {
-      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-      DocumentBuilder db = dbf.newDocumentBuilder();
-      lDoc = db.newDocument();
-    }
-    catch(ParserConfigurationException pce)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(pce);
-    }
-
-    StringTokenizer lTokenizer = new StringTokenizer(toTokenize, delims);
-    NodeSet resultSet = new NodeSet();
-
-    while (lTokenizer.hasMoreTokens())
-    {
-      resultSet.addNode(lDoc.createTextNode(lTokenizer.nextToken()));
-    }
-
-    return resultSet;
-  }
-
-  /**
-   * Returns a NodeSet containing one text node for each token in the first argument.
-   * Delimiters are whitespace.  That is, the delimiters that are used are tab (&#x09),
-   * linefeed (&#x0A), return (&#x0D), and space (&#x20).
-   * Tokens are determined by a call to <code>StringTokenizer</code>.
-   * If the first argument is an empty string or contains only delimiters, the result
-   * will be an empty NodeSet.
-   * Contributed to XalanJ1 by <a href="mailto:benoit.cerrina@writeme.com">Benoit Cerrina</a>.
-   * @param myContext an <code>ExpressionContext</code> passed in by the
-   *                  extension mechanism.  This must be an XPathContext.
-   * @param toTokenize The string to be split into text tokens.
-   * @return a NodeSet as described above.
-   *
-   */
-  public static NodeSet tokenize(ExpressionContext myContext,
-                                 String toTokenize)
-  {
-    return tokenize(myContext, toTokenize, " \t\n\r");
-  }
-
-  /**
-   * Return a Node of basic debugging information from the 
-   * EnvironmentCheck utility about the Java environment.
-   *
-   * <p>Simply calls the {@link org.apache.xalan.xslt.EnvironmentCheck}
-   * utility to grab info about the Java environment and CLASSPATH, 
-   * etc., and then returns the resulting Node.  Stylesheets can 
-   * then maniuplate this data or simply xsl:copy-of the Node.</p>
-   *
-   * <p>We throw a WrappedRuntimeException in the unlikely case 
-   * that reading information from the environment throws us an 
-   * exception. (Is this really the best thing to do?)</p>
-   *
-   * @param myContext an <code>ExpressionContext</code> passed in by the
-   *                  extension mechanism.  This must be an XPathContext.
-   * @return a Node as described above.
-   */
-  public static Node checkEnvironment(ExpressionContext myContext)
-  {
-
-    Document factoryDocument;
-    try
-    {
-      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-      DocumentBuilder db = dbf.newDocumentBuilder();
-      factoryDocument = db.newDocument();
-    }
-    catch(ParserConfigurationException pce)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(pce);
-    }
-
-    Node resultNode = null;
-    try
-    {
-      resultNode = factoryDocument.createElement("checkEnvironmentExtension");
-      EnvironmentCheck envChecker = new EnvironmentCheck();
-      Hashtable h = envChecker.getEnvironmentHash();
-      envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
-      envChecker = null;
-    }
-    catch(Exception e)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(e);
-    }
-
-    return resultNode;
-  }
-
-}
diff --git a/src/org/apache/xalan/lib/NodeInfo.java b/src/org/apache/xalan/lib/NodeInfo.java
deleted file mode 100644
index d9cdb77..0000000
--- a/src/org/apache/xalan/lib/NodeInfo.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by Ovidiu
- * Predescu <ovidiu@cup.hp.com> on behalf of the Apache Software
- * Foundation and was originally developed at Hewlett Packard Company.
- * For more information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.lib;
-
-import org.apache.xml.dtm.ref.DTMNodeProxy;
-import org.apache.xalan.extensions.ExpressionContext;
-
-import javax.xml.transform.SourceLocator;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * <code>NodeInfo</code> defines the XSLT extension functions to be
- * used from stylesheets.
- *
- * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
- * @since May 24, 2001
- */
-public class NodeInfo
-{
-  /**
-   * <code>systemId</code> returns the system id of the current
-   * context node.
-   *
-   * @param context an <code>ExpressionContext</code> value
-   * @return a <code>String</code> value
-   */
-  public static String systemId(ExpressionContext context)
-  {
-    Node contextNode = context.getContextNode();
-    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getSystemId();
-    else
-      return null;
-  }
-
-  /**
-   * <code>systemId</code> returns the system id of the node passed as
-   * argument. If a node set is passed as argument, the system id of
-   * the first node in the set is returned.
-   *
-   * @param context an <code>ExpressionContext</code> value
-   * @param nodeList a <code>NodeList</code> value
-   * @return a <code>String</code> value
-   */
-  public static String systemId(NodeList nodeList)
-  {
-    if (nodeList == null || nodeList.getLength() == 0)
-      return null;
-    
-    Node node = nodeList.item(0);
-    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getSystemId();
-    else
-      return null;
-  }
-
-  /**
-   * <code>publicId</code> returns the system id of the current
-   * context node.
-   *
-   * @param context an <code>ExpressionContext</code> value
-   * @return a <code>String</code> value
-   */
-  public static String publicId(ExpressionContext context)
-  {
-    Node contextNode = context.getContextNode();
-    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getPublicId();
-    else
-      return null;
-  }
-
-  /**
-   * <code>publicId</code> returns the system id of the node passed as
-   * argument. If a node set is passed as argument, the system id of
-   * the first node in the set is returned.
-   *
-   * @param context an <code>ExpressionContext</code> value
-   * @param nodeList a <code>NodeList</code> value
-   * @return a <code>String</code> value
-   */
-  public static String publicId(NodeList nodeList)
-  {
-    if (nodeList == null || nodeList.getLength() == 0)
-      return null;
-    
-    Node node = nodeList.item(0);
-    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getPublicId();
-    else
-      return null;
-  }
-
-  /**
-   * <code>lineNumber</code> returns the line number of the current
-   * context node.
-   *
-   * @param context an <code>ExpressionContext</code> value
-   * @return an <code>int</code> value
-   */
-  public static int lineNumber(ExpressionContext context)
-  {
-    Node contextNode = context.getContextNode();
-    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getLineNumber();
-    else
-      return -1;
-  }
-
-  /**
-   * <code>lineNumber</code> returns the line number of the node
-   * passed as argument. If a node set is passed as argument, the line
-   * number of the first node in the set is returned.
-   *
-   * @param nodeList a <code>NodeList</code> value
-   * @return an <code>int</code> value
-   */
-  public static int lineNumber(NodeList nodeList)
-  {
-    if (nodeList == null || nodeList.getLength() == 0)
-      return -1;
-    
-    Node node = nodeList.item(0);
-    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getLineNumber();
-    else
-      return -1;
-  }
-
-  /**
-   * <code>columnNumber</code> returns the column number of the
-   * current context node.
-   *
-   * @param context an <code>ExpressionContext</code> value
-   * @return an <code>int</code> value
-   */
-  public static int columnNumber(ExpressionContext context)
-  {
-    Node contextNode = context.getContextNode();
-    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getColumnNumber();
-    else
-      return -1;
-  }
-
-  /**
-   * <code>columnNumber</code> returns the column number of the node
-   * passed as argument. If a node set is passed as argument, the line
-   * number of the first node in the set is returned.
-   *
-   * @param nodeList a <code>NodeList</code> value
-   * @return an <code>int</code> value
-   */
-  public static int columnNumber(NodeList nodeList)
-  {
-    if (nodeList == null || nodeList.getLength() == 0)
-      return -1;
-    
-    Node node = nodeList.item(0);
-    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
-    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
-      .getSourceLocatorFor(nodeHandler);
-
-    if (locator != null)
-      return locator.getColumnNumber();
-    else
-      return -1;
-  }
-}
diff --git a/src/org/apache/xalan/lib/PipeDocument.java b/src/org/apache/xalan/lib/PipeDocument.java
deleted file mode 100644
index db600e2..0000000
--- a/src/org/apache/xalan/lib/PipeDocument.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.lib;
-// Imported classes for Extension elements
-import org.apache.xalan.extensions.XSLProcessorContext;
-import org.apache.xalan.templates.ElemExtensionCall;
-import org.apache.xalan.templates.ElemLiteralResult;
-import org.apache.xalan.templates.AVT;
-import org.apache.xalan.transformer.TransformerImpl;
-
-// Imported JAXP/TrAX classes
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Templates;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.sax.SAXResult;
-
-// Imported JAXP parsing classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException; 
-
-// Imported SAX classes
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.Parser;
-import org.xml.sax.helpers.ParserAdapter;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-// Imported DOM classes
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-// Imported Serializer classes
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.templates.OutputProperties;
-
-// Other org.apache imports
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.SystemIDResolver;
-
-// Imported java.io and java.util classes
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.util.Vector;
-import java.util.Properties;
-
-/**
- * Sets stylesheet params and pipes an XML document through a series of 1 or more stylesheets.
- * PipeDocument is invoked from a stylesheet as the {@link #pipeDocument pipeDocument extension element}.
- * 
- * @author Donald Leslie
- */
-public class PipeDocument
-{
-/**
- * Extension element for piping an XML document through a series of 1 or more transformations.
- * 
- * <pre>Common usage pattern: A stylesheet transforms a listing of documents to be
- * transformed into a TOC. For each document in the listing calls the pipeDocument
- * extension element to pipe that document through a series of 1 or more stylesheets 
- * to the desired output document.
- * 
- * Syntax:
- * &lt;xsl:stylesheet version="1.0"
- *                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- *                xmlns:pipe="xalan://PipeDocument"
- *                extension-element-prefixes="pipe"&gt;
- * ...
- * &lt;pipe:pipeDocument   source="source.xml" target="target.xml"&gt;
- *   &lt;stylesheet href="ss1.xsl"&gt;
- *     &lt;param name="param1" value="value1"/&gt;
- *   &lt;/stylesheet&gt;
- *   &lt;stylesheet href="ss2.xsl"&gt;
- *     &lt;param name="param1" value="value1"/&gt;
- *     &lt;param name="param2" value="value2"/&gt;
- *   &lt;/stylesheet&gt;
- *   &lt;stylesheet href="ss1.xsl"/&gt;     
- * &lt;/pipe:pipeDocument&gt;
- * 
- * Notes:</pre>
- * <ul>
- *   <li>The base URI for the source attribute is the XML "listing" document.<li/>
- *   <li>The target attribute is taken as is (base is the current user directory).<li/>
- *   <li>The stylsheet containg the extension element is the base URI for the
- *   stylesheet hrefs.<li/>
- * </ul>
- */
-  public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem)
-	  throws TransformerException, TransformerConfigurationException, 
-         SAXException, IOException, FileNotFoundException	   
-  {
-    try
-    {
-      SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance();
-      
-      // XML doc to transform.
-      String source =  elem.getAttribute("source", 
-                                         context.getContextNode(),
-                                         context.getTransformer());
-      TransformerImpl transImpl = context.getTransformer();
-
-      //Base URI for input doc, so base for relative URI to XML doc to transform.
-      String baseURLOfSource = transImpl.getBaseURLOfSource();
-      // Absolute URI for XML doc to transform.
-      String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource);      
-
-      // Transformation target
-      String target =  elem.getAttribute("target", 
-                                         context.getContextNode(),
-                                         context.getTransformer());
-      
-      XPathContext xctxt = context.getTransformer().getXPathContext();
-      int xt = xctxt.getDTMHandleFromNode(context.getContextNode());
- 
-      // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets.
-      String sysId = elem.getSystemId();
-      
-      NodeList ssNodes = null;
-      NodeList paramNodes = null;
-      Node ssNode = null;
-      Node paramNode = null;
-      if (elem.hasChildNodes())
-      {
-        ssNodes = elem.getChildNodes();        
-        // Vector to contain TransformerHandler for each stylesheet.
-        Vector vTHandler = new Vector(ssNodes.getLength());
-        
-        // The child nodes of an extension element node are instances of
-        // ElemLiteralResult, which requires does not fully support the standard
-        // Node interface. Accordingly, some special handling is required (see below)
-        // to get attribute values.
-        for (int i = 0; i < ssNodes.getLength(); i++)
-        {
-          ssNode = ssNodes.item(i);
-          if (ssNode.getNodeType() == ssNode.ELEMENT_NODE
-              && ((Element)ssNode).getTagName().equals("stylesheet")
-              && ssNode instanceof ElemLiteralResult)
-          {
-            AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href");
-            String href = avt.evaluate(xctxt,xt, elem);
-            String absURI = SystemIDResolver.getAbsoluteURI(href, sysId);
-            Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI));
-            TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl);
-            Transformer trans = tHandler.getTransformer();
-            
-            // AddTransformerHandler to vector
-            vTHandler.addElement(tHandler);
-
-            paramNodes = ssNode.getChildNodes();
-            for (int j = 0; j < paramNodes.getLength(); j++)
-            {
-              paramNode = paramNodes.item(j);
-              if (paramNode.getNodeType() == paramNode.ELEMENT_NODE 
-                  && ((Element)paramNode).getTagName().equals("param")
-                  && paramNode instanceof ElemLiteralResult)
-              {
-                 avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name");
-                 String pName = avt.evaluate(xctxt,xt, elem);
-                 avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value");
-                 String pValue = avt.evaluate(xctxt,xt, elem);
-                 trans.setParameter(pName, pValue);
-               } 
-             }
-           }
-         }
-         usePipe(vTHandler, absSourceURL, target);
-       }
-     }
-     catch (Exception e)
-     {
-       e.printStackTrace();
-     }
-  }
-  /**
-   * Uses a Vector of TransformerHandlers to pipe XML input document through
-   * a series of 1 or more transformations. Called by {@link #pipeDocument} and {@link #main}.
-   * 
-   * @param vTHandler Vector of Transformation Handlers (1 per stylesheet).
-   * @param source absolute URI to XML input
-   * @param target absolute path to transformation output.
-   */
-  public void usePipe(Vector vTHandler, String source, String target)
-          throws TransformerException, TransformerConfigurationException, 
-                 FileNotFoundException, IOException, SAXException, SAXNotRecognizedException
-  {
-    XMLReader reader = XMLReaderFactory.createXMLReader();
-    TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement();
-    reader.setContentHandler(tHFirst);
-    reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst);
-    for (int i = 1; i < vTHandler.size(); i++)
-    {
-      TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1);
-      TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i);
-      tHFrom.setResult(new SAXResult(tHTo));      
-    }
-    TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement();
-    Transformer trans = tHLast.getTransformer();
-    Properties outputProps = trans.getOutputProperties();
-    Serializer serializer = SerializerFactory.getSerializer(outputProps);
-    serializer.setOutputStream(new FileOutputStream(target));
-    tHLast.setResult(new SAXResult(serializer.asContentHandler()));
-    
-    reader.parse(source);
-  }
- 
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/lib/Redirect.java b/src/org/apache/xalan/lib/Redirect.java
deleted file mode 100644
index 2135360..0000000
--- a/src/org/apache/xalan/lib/Redirect.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.lib;
-
-import java.util.*;
-import java.io.*;
-import java.net.URL;
-
-import org.xml.sax.ContentHandler;
-
-import org.apache.xalan.extensions.XSLProcessorContext;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.ElemExtensionCall;
-import org.apache.xalan.templates.OutputProperties;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPath;
-
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Result;
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.*;
-
-/**
- * Implements three extension elements to allow an XSLT transformation to
- * redirect its output to multiple output files.
- * You must declare the Xalan namespace (xmlns:lxslt="http://xml.apache.org/xslt"),
- * a namespace for the extension prefix (such as xmlns:redirect="org.apache.xalan.lib.Redirect"),
- * and declare the extension namespace as an extension (extension-element-prefixes="redirect").
- * You can either just use redirect:write, in which case the file will be
- * opened and immediately closed after the write, or you can bracket the
- * write calls by redirect:open and redirect:close, in which case the
- * file will be kept open for multiple writes until the close call is
- * encountered.  Calls can be nested.  Calls can take a 'file' attribute
- * and/or a 'select' attribute in order to get the filename.  If a select
- * attribute is encountered, it will evaluate that expression for a string
- * that indicates the filename.  If the string evaluates to empty, it will
- * attempt to use the 'file' attribute as a default.  Filenames can be relative
- * or absolute.  If they are relative, the base directory will be the same as
- * the base directory for the output document.  This is obtained by calling
- * getOutputTarget() on the TransformerImpl.  You can set this base directory
- * by calling TransformerImpl.setOutputTarget() or it is automatically set
- * when using the two argument form of transform() or transformNode().
- *
- * <p>Example:</p>
- * <PRE>
- * &lt;?xml version="1.0"?>
- * &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
- *                 xmlns:lxslt="http://xml.apache.org/xslt"
- *                 xmlns:redirect="org.apache.xalan.lib.Redirect"
- *                 extension-element-prefixes="redirect">
- *
- *   &lt;xsl:template match="/">
- *     &lt;out>
- *       default output.
- *     &lt;/out>
- *     &lt;redirect:open file="doc3.out"/>
- *     &lt;redirect:write file="doc3.out">
- *       &lt;out>
- *         &lt;redirect:write file="doc1.out">
- *           &lt;out>
- *             doc1 output.
- *             &lt;redirect:write file="doc3.out">
- *               Some text to doc3
- *             &lt;/redirect:write>
- *           &lt;/out>
- *         &lt;/redirect:write>
- *         &lt;redirect:write file="doc2.out">
- *           &lt;out>
- *             doc2 output.
- *             &lt;redirect:write file="doc3.out">
- *               Some more text to doc3
- *               &lt;redirect:write select="doc/foo">
- *                 text for doc4
- *               &lt;/redirect:write>
- *             &lt;/redirect:write>
- *           &lt;/out>
- *         &lt;/redirect:write>
- *       &lt;/out>
- *     &lt;/redirect:write>
- *     &lt;redirect:close file="doc3.out"/>
- *   &lt;/xsl:template>
- *
- * &lt;/xsl:stylesheet>
- * </PRE>
- *
- * @author Scott Boag
- * @version 1.0
- * @see <a href="../../../../../../extensions.html#ex-redirect" target="_top">Example with Redirect extension</a>
- */
-public class Redirect
-{
-  /**
-   * List of formatter listeners indexed by filename.
-   */
-  protected Hashtable m_formatterListeners = new Hashtable ();
-
-  /**
-   * List of output streams indexed by filename.
-   */
-  protected Hashtable m_outputStreams = new Hashtable ();
-
-  /**
-   * Open the given file and put it in the XML, HTML, or Text formatter listener's table.
-   */
-  public void open(XSLProcessorContext context, ElemExtensionCall elem)
-    throws java.net.MalformedURLException,
-           java.io.FileNotFoundException,
-           java.io.IOException,
-           javax.xml.transform.TransformerException
-  {
-    String fileName = getFilename(context, elem);
-    Object flistener = m_formatterListeners.get(fileName);
-    if(null == flistener)
-    {
-      String mkdirsExpr 
-        = elem.getAttribute ("mkdirs", context.getContextNode(), 
-                                                  context.getTransformer());
-      boolean mkdirs = (mkdirsExpr != null)
-                       ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true;
-          // ContentHandler fl = 
-          makeFormatterListener(context, elem, fileName, true, mkdirs);
-          // fl.startDocument();
-    }
-  }
-  
-  /**
-   * Write the evalutation of the element children to the given file. Then close the file
-   * unless it was opened with the open extension element and is in the formatter listener's table.
-   */
-  public void write(XSLProcessorContext context, ElemExtensionCall elem)
-    throws java.net.MalformedURLException,
-           java.io.FileNotFoundException,
-           java.io.IOException,
-           javax.xml.transform.TransformerException
-  {
-    String fileName = getFilename(context, elem);
-    Object flObject = m_formatterListeners.get(fileName);
-    ContentHandler formatter;
-    boolean inTable = false;
-    if(null == flObject)
-    {
-      String mkdirsExpr 
-        = ((ElemExtensionCall)elem).getAttribute ("mkdirs", 
-                                                  context.getContextNode(), 
-                                                  context.getTransformer());
-      boolean mkdirs = (mkdirsExpr != null)
-                       ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true;
-      formatter = makeFormatterListener(context, elem, fileName, true, mkdirs);
-    }
-    else
-    {
-      inTable = true;
-      formatter = (ContentHandler)flObject;
-    }
-    
-    TransformerImpl transf = context.getTransformer();
-    
-    transf.executeChildTemplates(elem,
-                                 context.getContextNode(),
-                                 context.getMode(), formatter);
-    
-    if(!inTable)
-    {
-      OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
-      if(null != ostream)
-      {
-        try
-        {
-          formatter.endDocument();
-        }
-        catch(org.xml.sax.SAXException se)
-        {
-          throw new TransformerException(se);
-        }
-        ostream.close();
-        m_outputStreams.remove(fileName);
-        m_formatterListeners.remove(fileName);
-      }
-    }
-  }
-
-
-  /**
-   * Close the given file and remove it from the formatter listener's table.
-   */
-  public void close(XSLProcessorContext context, ElemExtensionCall elem)
-    throws java.net.MalformedURLException,
-    java.io.FileNotFoundException,
-    java.io.IOException,
-    javax.xml.transform.TransformerException
-  {
-    String fileName = getFilename(context, elem);
-    Object formatterObj = m_formatterListeners.get(fileName);
-    if(null != formatterObj)
-    {
-      ContentHandler fl = (ContentHandler)formatterObj;
-      try
-      {
-        fl.endDocument();
-      }
-      catch(org.xml.sax.SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
-      if(null != ostream)
-      {
-        ostream.close();
-        m_outputStreams.remove(fileName);
-      }
-      m_formatterListeners.remove(fileName);
-    }
-  }
-
-  /**
-   * Get the filename from the 'select' or the 'file' attribute.
-   */
-  private String getFilename(XSLProcessorContext context, ElemExtensionCall elem)
-    throws java.net.MalformedURLException,
-    java.io.FileNotFoundException,
-    java.io.IOException,
-    javax.xml.transform.TransformerException
-  {
-    String fileName;
-    String fileNameExpr 
-      = ((ElemExtensionCall)elem).getAttribute ("select", 
-                                                context.getContextNode(), 
-                                                context.getTransformer());
-    if(null != fileNameExpr)
-    {
-      org.apache.xpath.XPathContext xctxt 
-        = context.getTransformer().getXPathContext();
-      XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT);
-      XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem);
-      fileName = xobj.str();
-      if((null == fileName) || (fileName.length() == 0))
-      {
-        fileName = elem.getAttribute ("file", 
-                                      context.getContextNode(), 
-                                      context.getTransformer());
-      }
-    }
-    else
-    {
-      fileName = elem.getAttribute ("file", context.getContextNode(), 
-                                                               context.getTransformer());
-    }
-    if(null == fileName)
-    {
-      context.getTransformer().getMsgMgr().error(elem, elem, 
-                                     context.getContextNode(), 
-                                     XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME);
-                              //"Redirect extension: Could not get filename - file or select attribute must return vald string.");
-    }
-    return fileName;
-  }
-  
-  // yuck.
-  private String urlToFileName(String base)
-  {
-    if(null != base)
-    {
-      if(base.startsWith("file:////"))
-      {
-        base = base.substring(7);
-      }
-      else if(base.startsWith("file:///"))
-      {
-        base = base.substring(6);
-      }
-      else if(base.startsWith("file://"))
-      {
-        base = base.substring(5); // absolute?
-      }
-      else if(base.startsWith("file:/"))
-      {
-        base = base.substring(5);
-      }
-      else if(base.startsWith("file:"))
-      {
-        base = base.substring(4);
-      }
-    }
-    return base;
-  }
-
-  /**
-   * Create a new ContentHandler, based on attributes of the current ContentHandler.
-   */
-  private ContentHandler makeFormatterListener(XSLProcessorContext context,
-                                               ElemExtensionCall elem,
-                                               String fileName,
-                                               boolean shouldPutInTable,
-                                               boolean mkdirs)
-    throws java.net.MalformedURLException,
-    java.io.FileNotFoundException,
-    java.io.IOException,
-    javax.xml.transform.TransformerException
-  {
-    File file = new File(fileName);
-    TransformerImpl transformer = context.getTransformer();
-    String base;          // Base URI to use for relative paths
-
-    if(!file.isAbsolute())
-    {
-      // This code is attributed to Jon Grov <jon@linpro.no>.  A relative file name
-      // is relative to the Result used to kick off the transform.  If no such
-      // Result was supplied, the filename is relative to the source document.
-      // When transforming with a SAXResult or DOMResult, call
-      // TransformerImpl.setOutputTarget() to set the desired Result base.
-  //      String base = urlToFileName(elem.getStylesheet().getSystemId());
-
-      Result outputTarget = transformer.getOutputTarget();
-      if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) {
-        base = urlToFileName(base);
-      }
-      else
-      {
-        base = urlToFileName(transformer.getBaseURLOfSource());
-      }
-
-      if(null != base)
-      {
-        File baseFile = new File(base);
-        file = new File(baseFile.getParent(), fileName);
-      }
-      // System.out.println("file is: "+file.toString());
-    }
-
-    if(mkdirs)
-    {
-      String dirStr = file.getParent();
-      if((null != dirStr) && (dirStr.length() > 0))
-      {
-        File dir = new File(dirStr);
-        dir.mkdirs();
-      }
-    }
-
-    // This should be worked on so that the output format can be 
-    // defined by a first child of the redirect element.
-    OutputProperties format = transformer.getOutputFormat();
-
-    FileOutputStream ostream = new FileOutputStream(file);
-    
-    try
-    {
-      ContentHandler flistener 
-        = transformer.createResultContentHandler(new StreamResult(ostream), format);
-      try
-      {
-        flistener.startDocument();
-      }
-      catch(org.xml.sax.SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      if(shouldPutInTable)
-      {
-        m_outputStreams.put(fileName, ostream);
-        m_formatterListeners.put(fileName, flistener);
-      }
-      return flistener;
-    }
-    catch(TransformerException te)
-    {
-      throw new javax.xml.transform.TransformerException(te);
-    }
-    
-  }
-}
diff --git a/src/org/apache/xalan/lib/package.html b/src/org/apache/xalan/lib/package.html
deleted file mode 100644
index 1cb4b18..0000000
--- a/src/org/apache/xalan/lib/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <title>Xalan Extensions.</title>
-  <body>
-   <p>Extension elements and functions shipped with Xalan-Java</p>
-   <p>We are adding extensions to this package.<p>
-  </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/lib/sql/ConnectionPool.java b/src/org/apache/xalan/lib/sql/ConnectionPool.java
deleted file mode 100644
index dc69a78..0000000
--- a/src/org/apache/xalan/lib/sql/ConnectionPool.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.lib.sql;
-
-import java.util.Properties;
-import java.lang.String;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.*;
-
-/**
- * An interface used to build wrapper classes around existing
- * Connection Pool libraries.
- * Title:     ConnectionPool<p>
- * @author John Gentilin
- * @version 1.0
- */
-public interface ConnectionPool
-{
-
-  /**
-   * Determine if a Connection Pool has been disabled. If a Connection pool
-   * is disabled, then it will only manage connections that are in use.
-   * @return
-   */
-  public boolean isEnabled( );
-
-  /**
-   * The Driver and URL are the only required parmeters.
-   * @param d
-   * @return
-   */
-  public void setDriver( String d );
-
-  /**
-   * @param url
-   * @return
-   */
-  public void setURL( String url );
-
-  /**
-   * Start downsizeing the pool, this usally happens right after the
-   * pool has been marked as Inactive and we are removing connections
-   * that are not currently inuse.
-   * @return
-   */
-  public void freeUnused( );
-
-
-  /**
-   * Provide an indicator to the PoolManager when the Pool can be removed
-   * from the Pool Table.
-   * @return
-   */
-  public boolean hasActiveConnections( );
-
-  /**
-   * The rest of the protocol parameters can eiter be passed in as
-   * just Username and Password or as a property collection. If the
-   * property collection is used, then the sperate username and password
-   * may be ignored, it is up to the wrapper implementation to handle
-   * the situation. If the connection information changes while after the
-   * pool has been established, the wrapper implementation should ignore
-   * the change and throw an error.
-   * @param p
-   * @return
-   */
-  public void setPassword( String p );
-
-  /**
-   * @param u
-   * @return
-   */
-  public void setUser( String u );
-
-
-  /**
-   * Set tne minimum number of connections that are to be maintained in the
-   * pool.
-   * @param n
-   * @return
-   */
-  public void setMinConnections( int n );
-
-  /**
-   * Test to see if the connection info is valid to make a real connection
-   * to the database. This method may cause the pool to be crated and filled
-   * with min connections.
-   * @return
-   */
-  public boolean testConnection( );
-
-  /**
-   * Retrive a database connection from the pool
-   * @return
-   * @throws SQLException
-   */
-  public Connection getConnection( )throws SQLException;
-
-   /**
-   * Return a connection to the pool, the connection may be closed if the
-   * pool is inactive or has exceeded the max number of free connections
-   * @param con
-   * @return
-   * @throws SQLException
-   */
-  public void releaseConnection( Connection con )throws SQLException;
-
-   /**
-   * Provide a mechinism to return a connection to the pool on Error.
-   * A good default behaviour is to close this connection and build
-   * a new one to replace it. Some JDBC impl's won't allow you to
-   * reuse a connection after an error occurs.
-   * @param con
-   * @return
-   * @throws SQLException
-   */
-  public void releaseConnectionOnError( Connection con )throws SQLException;
-
-
-  /**
-   * The Pool can be Enabled and Disabled. Disabling the pool
-   * closes all the outstanding Unused connections and any new
-   * connections will be closed upon release.
-   * @param flag Control the Connection Pool. If it is enabled
-   * then Connections will actuall be held around. If disabled
-   * then all unused connections will be instantly closed and as
-   * connections are released they are closed and removed from the pool.
-   * @return
-   */
-  public void setPoolEnabled( final boolean flag );
-
-  /**
-   * Used to pass in extra configuration options during the
-   * database connect phase.
-   */
-  public void setProtocol(Properties p);
-
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/lib/sql/ConnectionPoolManager.java b/src/org/apache/xalan/lib/sql/ConnectionPoolManager.java
deleted file mode 100644
index b1234be..0000000
--- a/src/org/apache/xalan/lib/sql/ConnectionPoolManager.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-
- package org.apache.xalan.lib.sql;
-
-import java.util.Hashtable;
-import java.lang.IllegalArgumentException;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- */
-public class ConnectionPoolManager
-{
-  /**
-   */
-  static Hashtable m_poolTable = null;
-  /**
-   */
-  static boolean m_isInit = false;
-
-  /**
-   */
-  public ConnectionPoolManager( )
-  {
-    init();
-  }
-
-  /**
-   * Initialize the internal structures of the Pool Manager
-   * @return
-   */
-  public synchronized void init( )
-  {
-    // Only do this process once
-    if (m_isInit == true) return;
-
-
-    //
-    // Initialize the pool table
-    //
-    m_poolTable = new Hashtable();
-
-    m_isInit = true;
-  }
-
-  /**
-   * Register a nuew connection pool to the global pool table.
-   * If a pool by that name currently exists, then throw an
-   * IllegalArgumentException stating that the pool already
-   * exist.
-   * @param name
-   * @param pool
-   * @return
-   * @link org.apache.xalan.lib.sql.ConnectionPool}
-   * @return
-   * @throws <code>IllegalArgumentException</code>, throw this exception
-   * if a pool with the same name currently exists.
-   */
-  public synchronized void registerPool( String name, ConnectionPool pool )
-  {
-    if ( m_poolTable.containsKey(name) )
-    {
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOL_EXISTS, null)); //"Pool already exists");
-    }
-
-    m_poolTable.put(name, pool);
-  }
-
-  /**
-   * Remove a pool from the global table. If the pool still has
-   * active connections, then only mark this pool as inactive and
-   * leave it around until all the existing connections are closed.
-   * @param name
-   * @return
-   */
-  public synchronized void removePool( String name )
-  {
-    ConnectionPool pool = getPool(name);
-
-    if (null != pool)
-    {
-      //
-      // Disable future use of this pool under the Xalan
-      // extension only. This flag should only exist in the
-      // wrapper and not in the actual pool implementation.
-      pool.setPoolEnabled(false);
-
-
-      //
-      // Remove the pool from the Hashtable if we don'd have
-      // any active connections.
-      //
-      if ( ! pool.hasActiveConnections() ) m_poolTable.remove(name);
-    }
-
-  }
-
-
-  /**
-   * Return the connection pool referenced by the name
-   * @param name
-   * @return
-   * @returns <code>ConnectionPool</code> a reference to the ConnectionPool
-   * object stored in the Pool Table. If the named pool does not exist, return
-   * null
-   */
-  public synchronized ConnectionPool getPool( String name )
-  {
-    return (ConnectionPool) m_poolTable.get(name);
-  }
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/lib/sql/DTMDocument.java b/src/org/apache/xalan/lib/sql/DTMDocument.java
deleted file mode 100644
index 12446ce..0000000
--- a/src/org/apache/xalan/lib/sql/DTMDocument.java
+++ /dev/null
@@ -1,1626 +0,0 @@
-/**
- * @(#) SQLDocument.java
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.xalan.lib.sql;
-
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.DTMWSFilter;
-import org.apache.xml.dtm.ref.DTMDefaultBaseIterators;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.DTMAxisIterator;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.apache.xml.utils.SuballocatedIntVector;
-import org.w3c.dom.Node;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import java.io.IOException;
-import java.io.File;
-import java.io.PrintStream;
-import java.io.FileOutputStream;
-import org.xml.sax.*;
-import javax.xml.transform.SourceLocator;
-import org.apache.xml.utils.*;
-import org.apache.xml.dtm.*;
-import org.xml.sax.ext.*;
-
-/**
- * The SQL Document is the main controlling class the executesa SQL Query
- */
-public class DTMDocument extends DTMDefaultBaseIterators
-{
-    // Bitmask for the portion of a DTM Node handle which refers only
-    // to the node, without the portion that specifies which DTM it
-    // resides in.
-    static final int NODEIDENTITYBITS=DTMManager.IDENT_NODE_DEFAULT;
-
-  /**
-   */
-  public interface CharacterNodeHandler
-  {
-    /**
-     * @param node
-     * @return
-     * @throws org.xml.sax.SAXException
-     */
-    public void characters( Node node )throws org.xml.sax.SAXException ;
-  }
-
-  /**
-   */
-  private boolean DEBUG = false;
-
-  /**
-   */
-  protected static final String S_NAMESPACE = "http://xml.apache.org/xalan/SQLExtension";
-
-  /**
-   */
-  protected static final String S_ATTRIB_NOT_SUPPORTED = "Not Supported";
-  /**
-   */
-  protected static final String S_ISTRUE = "true";
-  /**
-   */
-  protected static final String S_ISFALSE = "false";
-
-  /**
-   */
-  protected static final String S_DOCUMENT = "#root";
-  /**
-   */
-  protected static final String S_TEXT_NODE = "#text";
-  /**
-   */
-  protected static final String S_ELEMENT_NODE = "#element";
-
-  /**
-   */
-  protected int m_Document_TypeID = 0;
-  /**
-   */
-  protected int m_TextNode_TypeID = 0;
-
-
-  /**
-   * Store the SQL Data in this growable array
-   */
-  protected ObjectArray m_ObjectArray = new ObjectArray();
-
-  /**
-   * For each element node, there can be zero or more attributes. If Attributes
-   * are assigned, the first attribute for that element will be use here.
-   * Subsequent elements will use the m_nextsib, m_prevsib array. The sibling
-   * arrays are not meeant to hold indexes to attribute information but as
-   * long as there is not direct connection back into the main DTM tree
-   * we should be OK.
-   */
-  protected SuballocatedIntVector m_attribute;
-
-  /**
-   * The Document Index will most likely be 0, but we will reference it
-   * by variable in case that paradigm falls through.
-   */
-  protected int m_DocumentIdx;
-
-
-  /**
-   * @param mgr
-   * @param ident
-   */
-  public DTMDocument( DTMManager mgr, int ident )
-  {
-    super(mgr, null, ident,
-      null, mgr.getXMLStringFactory(), true);
-
-    m_attribute = new SuballocatedIntVector(m_initialblocksize);
-  }
-
-  /**
-   * A common routine that allocates an Object from the Object Array.
-   * One of the common bugs in this code was to allocate an Object and
-   * not incerment m_size, using this method will assure that function.
-   * @param o
-   * @return
-   */
-  private int allocateNodeObject( Object o )
-  {
-    // Need to keep this counter going even if we don't use it.
-    m_size++;
-    return m_ObjectArray.append(o);
-  }
-
-  /**
-   * @param o
-   * @param level
-   * @param extendedType
-   * @param parent
-   * @param prevsib
-   * @return
-   */
-  protected int addElementWithData( Object o, int level, int extendedType, int parent, int prevsib )
-  {
-    int elementIdx = addElement(level,extendedType,parent,prevsib);
-
-    int data = allocateNodeObject(o);
-    m_firstch.setElementAt(data,elementIdx);
-
-    m_exptype.setElementAt(m_TextNode_TypeID, data);
-    // m_level.setElementAt((byte)(level), data);
-    m_parent.setElementAt(elementIdx, data);
-
-    m_prevsib.setElementAt(DTM.NULL, data);
-    m_nextsib.setElementAt(DTM.NULL, data);
-    m_attribute.setElementAt(DTM.NULL, data);
-    m_firstch.setElementAt(DTM.NULL, data);
-
-    return elementIdx;
-  }
-
-  /**
-   * @param level
-   * @param extendedType
-   * @param parent
-   * @param prevsib
-   * @return
-   */
-  protected int addElement( int level, int extendedType, int parent, int prevsib )
-  {
-    int node = DTM.NULL;
-
-    try
-    {
-      // Add the Node and adjust its Extended Type
-      node = allocateNodeObject(S_ELEMENT_NODE);
-
-      m_exptype.setElementAt(extendedType, node);
-      m_nextsib.setElementAt(DTM.NULL, node);
-      m_prevsib.setElementAt(prevsib, node);
-
-      m_parent.setElementAt(parent, node);
-      m_firstch.setElementAt(DTM.NULL, node);
-      // m_level.setElementAt((byte)level, node);
-      m_attribute.setElementAt(DTM.NULL, node);
-
-      if (prevsib != DTM.NULL)
-      {
-        // If the previous sibling is already assigned, then we are
-        // inserting a value into the chain.
-        if (m_nextsib.elementAt(prevsib) != DTM.NULL)
-          m_nextsib.setElementAt(m_nextsib.elementAt(prevsib), node);
-
-        // Tell the proevious sibling that they have a new bother/sister.
-        m_nextsib.setElementAt(node, prevsib);
-      }
-
-       // So if we have a valid parent and the new node ended up being first
-      // in the list, i.e. no prevsib, then set the new node up as the
-      // first child of the parent. Since we chained the node in the list,
-      // there should be no reason to worry about the current first child
-      // of the parent node.
-      if ((parent != DTM.NULL) && (m_prevsib.elementAt(node) == DTM.NULL))
-      {
-        m_firstch.setElementAt(node, parent);
-      }
-    }
-    catch(Exception e)
-    {
-      error("Error in addElement: "+e.getMessage());
-    }
-
-    return node;
-  }
-
-  /**
-   * Link an attribute to a node, if the node already has one or more
-   * attributes assigned, then just link this one to the attribute list.
-   * The first attribute is attached to the Parent Node (pnode) through the
-   * m_attribute array, subsequent attributes are linked through the
-   * m_prevsib, m_nextsib arrays.
-   * @param o
-   * @param extendedType
-   * @param pnode
-   * @return
-   */
-  protected int addAttributeToNode( Object o, int extendedType, int pnode )
-  {
-    int attrib = DTM.NULL;
-    int prevsib = DTM.NULL;
-    int lastattrib = DTM.NULL;
-    int value = DTM.NULL;
-
-    try
-    {
-      // Add the Node and adjust its Extended Type
-      attrib = allocateNodeObject(o);
-
-      m_attribute.setElementAt(DTM.NULL, attrib);
-      m_exptype.setElementAt(extendedType, attrib);
-      // m_level.setElementAt((byte)0, attrib);
-
-      // Clear the sibling references
-      m_nextsib.setElementAt(DTM.NULL, attrib);
-      m_prevsib.setElementAt(DTM.NULL,attrib);
-      // Set the parent, although the was we are using attributes
-      // in the SQL extension this reference will more than likly
-      // be wrong
-      m_parent.setElementAt(pnode, attrib);
-      m_firstch.setElementAt(DTM.NULL, attrib);
-
-      if (m_attribute.elementAt(pnode) != DTM.NULL)
-      {
-        // OK, we already have an attribute assigned to this
-        // Node, Insert us into the head of the list.
-        lastattrib = m_attribute.elementAt(pnode);
-        m_nextsib.setElementAt(lastattrib, attrib);
-        m_prevsib.setElementAt(attrib, lastattrib);
-      }
-      // Okay set the new attribute up as the first attribute
-      // for the node.
-      m_attribute.setElementAt(attrib, pnode);
-    }
-    catch(Exception e)
-    {
-      error("Error in addAttributeToNode: "+e.getMessage());
-    }
-
-    return attrib;
-  }
-
-  /**
-   * Allow two nodes to share the same set of attributes. There may be some
-   * problems because the parent of any attribute will be the original node
-   * they were assigned to. Need to see how the attribute walker works, then
-   * we should be able to fake it out.
-   * @param toNode
-   * @param fromNode
-   * @return
-   */
-  protected void cloneAttributeFromNode( int toNode, int fromNode )
-  {
-   try
-    {
-      if (m_attribute.elementAt(toNode) != DTM.NULL)
-      {
-        error("Cloneing Attributes, where from Node already had addtibures assigned");
-      }
-
-      m_attribute.setElementAt(m_attribute.elementAt(fromNode), toNode);
-    }
-    catch(Exception e)
-    {
-      error("Cloning attributes");
-    }
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getFirstAttribute( int parm1 )
-  {
-    if (DEBUG) System.out.println("getFirstAttribute("+ (parm1&NODEIDENTITYBITS)+")");
-    int nodeIdx = parm1 & NODEIDENTITYBITS;
-    if (nodeIdx != DTM.NULL) return m_attribute.elementAt(nodeIdx) | m_dtmIdent;
-    else return DTM.NULL;
-  }
-
- /**
-   * @param parm1
-   * @return
-   */
-  public String getNodeValue( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNodeValue(" + parm1 + ")");
-    try
-    {
-      Object o = m_ObjectArray.getAt(parm1 & NODEIDENTITYBITS);
-      if (o != null)
-      {
-        return o.toString();
-      }
-      else
-      {
-        return "";
-      }
-    }
-    catch(Exception e)
-    {
-      error("Getting String Value");
-      return null;
-    }
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public XMLString getStringValue( int parm1 )
-  {
-    if (DEBUG) System.out.println("getStringValue(" + parm1 + ")");
-    try
-    {
-      Object o = m_ObjectArray.getAt(parm1 & NODEIDENTITYBITS);
-      if (o != null)
-      {
-        return m_xstrf.newstr(o.toString());
-      }
-      else
-      {
-        return m_xstrf.emptystr();
-      }
-    }
-    catch(Exception e)
-    {
-      error("Getting String Value");
-      return null;
-    }
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getNextAttribute( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNextAttribute(" + parm1 + ")");
-    int nodeIdx = parm1 & NODEIDENTITYBITS;
-    if (nodeIdx != DTM.NULL) return m_nextsib.elementAt(nodeIdx) | m_dtmIdent;
-    else return DTM.NULL;
-  }
-
-
-  /**
-   * @return
-   */
-  protected int getNumberOfNodes( )
-  {
-    if (DEBUG) System.out.println("getNumberOfNodes()");
-    return m_size;
-  }
-
-  /**
-   * @return
-   */
-  protected boolean nextNode( )
-  {
-    if (DEBUG) System.out.println("nextNode()");
-    return false;
-  }
-
-
-  /**
-   * The Expanded Name table holds all of our Node names. The Base class
-   * will add the common element types, need to call this function from
-   * the derived class.
-   * @return
-   */
-  protected void createExpandedNameTable( )
-  {
-    m_Document_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_DOCUMENT, DTM.DOCUMENT_NODE);
-
-    m_TextNode_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_TEXT_NODE, DTM.TEXT_NODE);
-  }
-
-
-  /**
-   * @return
-   */
-  public void dumpDTM( )
-  {
-    try
-    {
-//      File f = new File("DTMDump"+((Object)this).hashCode()+".txt");
-      File f = new File("DTMDump.txt");
-      System.err.println("Dumping... "+f.getAbsolutePath());
-      PrintStream ps = new PrintStream(new FileOutputStream(f));
-
-      while (nextNode()){}
-
-      int nRecords = m_size;
-
-      ps.println("Total nodes: " + nRecords);
-
-      for (int i = 0; i < nRecords; i++)
-      {
-        ps.println("=========== " + i + " ===========");
-        ps.println("NodeName: " + getNodeName(i));
-        ps.println("NodeNameX: " + getNodeNameX(i));
-        ps.println("LocalName: " + getLocalName(i));
-        ps.println("NamespaceURI: " + getNamespaceURI(i));
-        ps.println("Prefix: " + getPrefix(i));
-
-        int exTypeID = getExpandedTypeID(i);
-
-        ps.println("Expanded Type ID: "
-                           + Integer.toHexString(exTypeID));
-
-        int type = getNodeType(i);
-        String typestring;
-
-        switch (type)
-        {
-        case DTM.ATTRIBUTE_NODE :
-          typestring = "ATTRIBUTE_NODE";
-          break;
-        case DTM.CDATA_SECTION_NODE :
-          typestring = "CDATA_SECTION_NODE";
-          break;
-        case DTM.COMMENT_NODE :
-          typestring = "COMMENT_NODE";
-          break;
-        case DTM.DOCUMENT_FRAGMENT_NODE :
-          typestring = "DOCUMENT_FRAGMENT_NODE";
-          break;
-        case DTM.DOCUMENT_NODE :
-          typestring = "DOCUMENT_NODE";
-          break;
-        case DTM.DOCUMENT_TYPE_NODE :
-          typestring = "DOCUMENT_NODE";
-          break;
-        case DTM.ELEMENT_NODE :
-          typestring = "ELEMENT_NODE";
-          break;
-        case DTM.ENTITY_NODE :
-          typestring = "ENTITY_NODE";
-          break;
-        case DTM.ENTITY_REFERENCE_NODE :
-          typestring = "ENTITY_REFERENCE_NODE";
-          break;
-        case DTM.NAMESPACE_NODE :
-          typestring = "NAMESPACE_NODE";
-          break;
-        case DTM.NOTATION_NODE :
-          typestring = "NOTATION_NODE";
-          break;
-        case DTM.NULL :
-          typestring = "NULL";
-          break;
-        case DTM.PROCESSING_INSTRUCTION_NODE :
-          typestring = "PROCESSING_INSTRUCTION_NODE";
-          break;
-        case DTM.TEXT_NODE :
-          typestring = "TEXT_NODE";
-          break;
-        default :
-          typestring = "Unknown!";
-          break;
-        }
-
-        ps.println("Type: " + typestring);
-
-        int firstChild = _firstch(i);
-
-        if (DTM.NULL == firstChild)
-          ps.println("First child: DTM.NULL");
-        else if (NOTPROCESSED == firstChild)
-          ps.println("First child: NOTPROCESSED");
-        else
-          ps.println("First child: " + firstChild);
-
-        int prevSibling = _prevsib(i);
-
-        if (DTM.NULL == prevSibling)
-          ps.println("Prev sibling: DTM.NULL");
-        else if (NOTPROCESSED == prevSibling)
-          ps.println("Prev sibling: NOTPROCESSED");
-        else
-          ps.println("Prev sibling: " + prevSibling);
-
-        int nextSibling = _nextsib(i);
-
-        if (DTM.NULL == nextSibling)
-          ps.println("Next sibling: DTM.NULL");
-        else if (NOTPROCESSED == nextSibling)
-          ps.println("Next sibling: NOTPROCESSED");
-        else
-          ps.println("Next sibling: " + nextSibling);
-
-        int parent = _parent(i);
-
-        if (DTM.NULL == parent)
-          ps.println("Parent: DTM.NULL");
-        else if (NOTPROCESSED == parent)
-          ps.println("Parent: NOTPROCESSED");
-        else
-          ps.println("Parent: " + parent);
-
-        int level = _level(i);
-
-        ps.println("Level: " + level);
-        ps.println("Node Value: " + getNodeValue(i));
-        ps.println("String Value: " + getStringValue(i));
-
-        ps.println("First Attribute Node: " + m_attribute.elementAt(i));
-      }
-
-    }
-    catch(IOException ioe)
-    {
-      ioe.printStackTrace(System.err);
-      System.exit(-1);
-    }
-  }
-
-
-  /**
-   * Retrieve the text content of a DOM subtree, appending it into a
-   * user-supplied FastStringBuffer object. Note that attributes are
-   * not considered part of the content of an element.
-   * <p>
-   * There are open questions regarding whitespace stripping.
-   * Currently we make no special effort in that regard, since the standard
-   * DOM doesn't yet provide DTD-based information to distinguish
-   * whitespace-in-element-context from genuine #PCDATA. Note that we
-   * should probably also consider xml:space if/when we address this.
-   * DOM Level 3 may solve the problem for us.
-   * <p>
-   * %REVIEW% Note that as a DOM-level operation, it can be argued that this
-   * routine _shouldn't_ perform any processing beyond what the DOM already
-   * does, and that whitespace stripping and so on belong at the DTM level.
-   * If you want a stripped DOM view, wrap DTM2DOM around DOM2DTM.
-   * @param node Node whose subtree is to be walked, gathering the
-   * contents of all Text or CDATASection nodes.
-   * @param ch
-   * @param depth
-   * @return
-   * @throws org.xml.sax.SAXException
-   */
-  protected static void dispatchNodeData( Node node, ContentHandler ch, int depth )throws org.xml.sax.SAXException 
-  {
-
-    switch (node.getNodeType())
-    {
-    case Node.DOCUMENT_FRAGMENT_NODE :
-    case Node.DOCUMENT_NODE :
-    case Node.ELEMENT_NODE :
-    {
-      for (Node child = node.getFirstChild(); null != child;
-              child = child.getNextSibling())
-      {
-        dispatchNodeData(child, ch, depth+1);
-      }
-    }
-    break;
-    case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW%
-    case Node.COMMENT_NODE :
-      if(0 != depth)
-        break;
-        // NOTE: Because this operation works in the DOM space, it does _not_ attempt
-        // to perform Text Coalition. That should only be done in DTM space.
-    case Node.TEXT_NODE :
-    case Node.CDATA_SECTION_NODE :
-    case Node.ATTRIBUTE_NODE :
-      String str = node.getNodeValue();
-      if(ch instanceof CharacterNodeHandler)
-      {
-        ((CharacterNodeHandler)ch).characters(node);
-      }
-      else
-      {
-        ch.characters(str.toCharArray(), 0, str.length());
-      }
-      break;
-//    /* case Node.PROCESSING_INSTRUCTION_NODE :
-//      // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);
-//      break; */
-    default :
-      // ignore
-      break;
-    }
-  }
-
-  /*********************************************************************/
-  /*********************************************************************/
-  /******************* End of Functions we Wrote ***********************/
-  /*********************************************************************/
-  /*********************************************************************/
-
-
-  /**
-   * For the moment all the run time properties are ignored by this
-   * class.
-   * @param property a <code>String</code> value
-   * @param value an <code>Object</code> value
-   * @return
-   */
-  public void setProperty( String property, Object value )
-  {
-  }
-
-  /**
-   * No source information is available for DOM2DTM, so return
-   * <code>null</code> here.
-   * @param node an <code>int</code> value
-   * @return null
-   */
-  public SourceLocator getSourceLocatorFor( int node )
-  {
-    return null;
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int getNextNodeIdentity( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNextNodeIdenty(" + parm1 + ")");
-    return DTM.NULL;
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @param parm3
-   * @return
-   */
-  public int getAttributeNode( int parm1, String parm2, String parm3 )
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-        "getAttributeNode(" +
-        parm1 + "," +
-        parm2 + "," +
-        parm3 + ")");
-    }
-    return DTM.NULL;
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getLocalName( int parm1 )
-  {
-    int exID = this.getExpandedTypeID( parm1 & NODEIDENTITYBITS );
-
-    if (DEBUG)
-    {
-      DEBUG = false;
-      System.out.print("getLocalName(" + parm1 + ") -> ");
-      System.out.println("..." + getLocalNameFromExpandedNameID(exID) );
-      DEBUG = true;
-    }
-
-    return getLocalNameFromExpandedNameID(exID);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getNodeName( int parm1 )
-  {
-    int exID = this.getExpandedTypeID( parm1 & NODEIDENTITYBITS );
-    if (DEBUG)
-    {
-      DEBUG = false;
-      System.out.print("getLocalName(" + parm1 + ") -> ");
-      System.out.println("..." + getLocalNameFromExpandedNameID(exID) );
-      DEBUG = true;
-    }
-    return getLocalNameFromExpandedNameID(exID);
-  }
-
-   /**
-   * @param parm1
-   * @return
-   */
-  public boolean isAttributeSpecified( int parm1 )
-  {
-    if (DEBUG) System.out.println("isAttributeSpecified(" + parm1 + ")");
-    return false;
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getUnparsedEntityURI( String parm1 )
-  {
-    if (DEBUG) System.out.println("getUnparsedEntityURI(" + parm1 + ")");
-    return "";
-  }
-
-  /**
-   * @return
-   */
-  public DTDHandler getDTDHandler( )
-  {
-    if (DEBUG) System.out.println("getDTDHandler()");
-    return null;
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getPrefix( int parm1 )
-  {
-    if (DEBUG) System.out.println("getPrefix(" + parm1  + ")");
-    return "";
-  }
-
-  /**
-   * @return
-   */
-  public EntityResolver getEntityResolver( )
-  {
-    if (DEBUG) System.out.println("getEntityResolver()");
-    return null;
-  }
-
-  /**
-   * @return
-   */
-  public String getDocumentTypeDeclarationPublicIdentifier( )
-  {
-    if (DEBUG) System.out.println("get_DTD_PubId()");
-    return "";
-  }
-
-  /**
-   * @return
-   */
-  public LexicalHandler getLexicalHandler( )
-  {
-    if (DEBUG) System.out.println("getLexicalHandler()");
-    return null;
-  }
-  /**
-   * @return
-   */
-  public boolean needsTwoThreads( )
-  {
-    if (DEBUG) System.out.println("needsTwoThreads()");
-    return false;
-  }
-
-  /**
-   * @return
-   */
-  public ContentHandler getContentHandler( )
-  {
-    if (DEBUG) System.out.println("getContentHandler()");
-    return null;
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   * @throws org.xml.sax.SAXException
-   * @return
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchToEvents( int parm1, ContentHandler parm2 )throws org.xml.sax.SAXException 
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-      "dispathcToEvents(" +
-      parm1 + "," +
-      parm2 + ")");
-    }
-    return;
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getNamespaceURI( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNamespaceURI(" +parm1+")");
-    return "";
-  }
-
-  /**
-   * @param nodeHandle
-   * @param ch
-   * @param normalize
-   * @return
-   * @throws org.xml.sax.SAXException
-   * @return
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents( int nodeHandle, ContentHandler ch, boolean normalize )throws org.xml.sax.SAXException 
-  {
-    if (DEBUG)
-    {
-      System.out.println("dispatchCharacterEvents(" +
-      nodeHandle + "," +
-      ch + "," +
-      normalize + ")");
-    }
-
-    if(normalize)
-    {
-      XMLString str = getStringValue(nodeHandle);
-      str = str.fixWhiteSpace(true, true, false);
-      str.dispatchCharactersEvents(ch);
-    }
-    else
-    {
-      int type = getNodeType(nodeHandle);
-      Node node = getNode(nodeHandle);
-      dispatchNodeData(node, ch, 0);
-    }
-  }
-
-  /**
-   * Event overriding for Debug
-   * @return
-   */
-  public boolean supportsPreStripping( )
-  {
-    if (DEBUG) System.out.println("supportsPreStripping()");
-    return super.supportsPreStripping();
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int _exptype( int parm1 )
-  {
-    if (DEBUG) System.out.println("_exptype(" + parm1 + ")");
-    return super._exptype( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected SuballocatedIntVector findNamespaceContext( int parm1 )
-  {
-    if (DEBUG) System.out.println("SuballocatedIntVector(" + parm1 + ")");
-    return super.findNamespaceContext( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int _prevsib( int parm1 )
-  {
-    if (DEBUG) System.out.println("_prevsib(" + parm1+ ")");
-    return super._prevsib( parm1);
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected short _type( int parm1 )
-  {
-    if (DEBUG) System.out.println("_type(" + parm1 + ")");
-    return super._type( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public Node getNode( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNode(" + parm1 + ")");
-    return super.getNode( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getPreviousSibling( int parm1 )
-  {
-    if (DEBUG) System.out.println("getPrevSib(" + parm1 + ")");
-    return super.getPreviousSibling( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getDocumentStandalone( int parm1 )
-  {
-    if (DEBUG) System.out.println("getDOcStandAlone(" + parm1 + ")");
-    return super.getDocumentStandalone( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getNodeNameX( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNodeNameX(" + parm1 + ")");
-    //return super.getNodeNameX( parm1);
-    return getNodeName(parm1);
-
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  public void setFeature( String parm1, boolean parm2 )
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-        "setFeature(" +
-        parm1 + "," +
-        parm2 + ")");
-    }
-    super.setFeature( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int _parent( int parm1 )
-  {
-    if (DEBUG) System.out.println("_parent(" + parm1 + ")");
-    return super._parent( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  protected void indexNode( int parm1, int parm2 )
-  {
-    if (DEBUG) System.out.println("indexNode("+parm1+","+parm2+")");
-    super.indexNode( parm1,  parm2);
-  }
-
-  /**
-   * @return
-   */
-  protected boolean getShouldStripWhitespace( )
-  {
-    if (DEBUG) System.out.println("getShouldStripWS()");
-    return super.getShouldStripWhitespace();
-  }
-
-  /**
-   * @return
-   */
-  protected void popShouldStripWhitespace( )
-  {
-    if (DEBUG) System.out.println("popShouldStripWS()");
-    super.popShouldStripWhitespace();
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  public boolean isNodeAfter( int parm1, int parm2 )
-  {
-    if (DEBUG) System.out.println("isNodeAfter(" + parm1 + "," + parm2 + ")");
-    return super.isNodeAfter( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getNamespaceType( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNamespaceType(" + parm1 + ")");
-    return super.getNamespaceType( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int _level( int parm1 )
-  {
-    if (DEBUG) System.out.println("_level(" + parm1 + ")");
-    return super._level( parm1);
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected void pushShouldStripWhitespace( boolean parm1 )
-  {
-    if (DEBUG) System.out.println("push_ShouldStripWS(" + parm1 + ")");
-    super.pushShouldStripWhitespace( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getDocumentVersion( int parm1 )
-  {
-    if (DEBUG) System.out.println("getDocVer("+parm1+")");
-    return super.getDocumentVersion( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  public boolean isSupported( String parm1, String parm2 )
-  {
-    if (DEBUG) System.out.println("isSupported("+parm1+","+parm2+")");
-    return super.isSupported( parm1,  parm2);
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected void setShouldStripWhitespace( boolean parm1 )
-  {
-    if (DEBUG) System.out.println("set_ShouldStripWS("+parm1+")");
-    super.setShouldStripWhitespace( parm1);
-  }
-
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  protected void ensureSizeOfIndex( int parm1, int parm2 )
-  {
-    if (DEBUG) System.out.println("ensureSizeOfIndex("+parm1+","+parm2+")");
-    super.ensureSizeOfIndex( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected void ensureSize( int parm1 )
-  {
-    if (DEBUG) System.out.println("ensureSize("+parm1+")");
-
-    // IntVectors in DTMDefaultBase are now self-sizing, and ensureSize()
-    // is being dropped.
-    //super.ensureSize( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getDocumentEncoding( int parm1 )
-  {
-    if (DEBUG) System.out.println("getDocumentEncoding("+parm1+")");
-    return super.getDocumentEncoding( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @param parm3
-   * @return
-   */
-  public void appendChild( int parm1, boolean parm2, boolean parm3 )
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-        "appendChild(" +
-        parm1 + "," +
-        parm2 + "," +
-        parm3 + ")");
-    }
-    super.appendChild( parm1,  parm2,  parm3);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public short getLevel( int parm1 )
-  {
-    if (DEBUG) System.out.println("getLevel("+parm1+")");
-    return super.getLevel( parm1);
-  }
-
-  /**
-   * @return
-   */
-  public String getDocumentBaseURI( )
-  {
-    if (DEBUG) System.out.println("getDocBaseURI()");
-    return super.getDocumentBaseURI();
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @param parm3
-   * @return
-   */
-  public int getNextNamespaceNode( int parm1, int parm2, boolean parm3 )
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-      "getNextNamesapceNode(" +
-      parm1 + "," +
-      parm2 + "," +
-      parm3 + ")");
-    }
-    return super.getNextNamespaceNode( parm1,  parm2,  parm3);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public void appendTextChild( String parm1 )
-  {
-    if (DEBUG) System.out.println("appendTextChild(" + parm1 + ")");
-    super.appendTextChild( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @param parm3
-   * @param parm4
-   * @return
-   */
-  protected int findGTE( int[] parm1, int parm2, int parm3, int parm4 )
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-      "findGTE("+
-      parm1 + "," +
-      parm2 + "," +
-      parm3 + ")");
-    }
-    return super.findGTE( parm1,  parm2,  parm3,  parm4);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  public int getFirstNamespaceNode( int parm1, boolean parm2 )
-  {
-    if (DEBUG) System.out.println("getFirstNamespaceNode()");
-    return super.getFirstNamespaceNode( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getStringValueChunkCount( int parm1 )
-  {
-    if (DEBUG) System.out.println("getStringChunkCount(" + parm1 + ")");
-    return super.getStringValueChunkCount( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getLastChild( int parm1 )
-  {
-    if (DEBUG) System.out.println("getLastChild(" + parm1 + ")");
-    return super.getLastChild( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public boolean hasChildNodes( int parm1 )
-  {
-    if (DEBUG) System.out.println("hasChildNodes(" + parm1 + ")");
-    return super.hasChildNodes( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public short getNodeType( int parm1 )
-  {
-    if (DEBUG)
-    {
-      DEBUG=false;
-      System.out.print("getNodeType(" + (parm1 & NODEIDENTITYBITS) + ") ");
-      int exID = this.getExpandedTypeID( parm1 & NODEIDENTITYBITS );
-      String name = getLocalNameFromExpandedNameID(exID);
-      System.out.println(
-        ".. Node name [" + name + "]" +
-        "[" + getNodeType( parm1) + "]");
-
-      DEBUG=true;
-    }
-
-    return super.getNodeType( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public boolean isCharacterElementContentWhitespace( int parm1 )
-  {
-    if (DEBUG) System.out.println("isCharacterElementContentWhitespace(" + parm1 +")");
-    return super.isCharacterElementContentWhitespace( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getFirstChild( int parm1 )
-  {
-    if (DEBUG) System.out.println("getFirstChild(" + parm1 + ")");
-    return super.getFirstChild( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getDocumentSystemIdentifier( int parm1 )
-  {
-    if (DEBUG) System.out.println("getDocSysID(" + parm1 + ")");
-    return super.getDocumentSystemIdentifier( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  protected void declareNamespaceInContext( int parm1, int parm2 )
-  {
-    if (DEBUG) System.out.println("declareNamespaceContext("+parm1+","+parm2+")");
-    super.declareNamespaceInContext( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getNamespaceFromExpandedNameID( int parm1 )
-  {
-    if (DEBUG)
-    {
-      DEBUG = false;
-      System.out.print("getNamespaceFromExpandedNameID("+parm1+")");
-      System.out.println("..." + super.getNamespaceFromExpandedNameID( parm1) );
-      DEBUG = true;
-    }
-    return super.getNamespaceFromExpandedNameID( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public String getLocalNameFromExpandedNameID( int parm1 )
-  {
-    if (DEBUG)
-    {
-      DEBUG = false;
-      System.out.print("getLocalNameFromExpandedNameID("+parm1+")");
-      System.out.println("..." + super.getLocalNameFromExpandedNameID( parm1));
-      DEBUG = true;
-    }
-    return super.getLocalNameFromExpandedNameID( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getExpandedTypeID( int parm1 )
-  {
-    if (DEBUG) System.out.println("getExpandedTypeID("+parm1+")");
-    return super.getExpandedTypeID( parm1);
-  }
-
-  /**
-   * @return
-   */
-  public int getDocument( )
-  {
-    if (DEBUG) System.out.println("getDocument()");
-    return super.getDocument();
-  }
-
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  protected int findInSortedSuballocatedIntVector( SuballocatedIntVector parm1, int parm2 )
-  {
-    if (DEBUG)
-    {
-      System.out.println(
-      "findInSortedSubAlloctedVector(" +
-      parm1 + "," +
-      parm2 + ")");
-    }
-    return super.findInSortedSuballocatedIntVector( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public boolean isDocumentAllDeclarationsProcessed( int parm1 )
-  {
-    if (DEBUG) System.out.println("isDocumentAllDeclProc("+parm1+")");
-    return super.isDocumentAllDeclarationsProcessed( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected void error( String parm1 )
-  {
-    if (DEBUG) System.out.println("error("+parm1+")");
-    super.error( parm1);
-  }
-
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int _firstch( int parm1 )
-  {
-    if (DEBUG) System.out.println("_firstch("+parm1+")");
-    return super._firstch( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getOwnerDocument( int parm1 )
-  {
-    if (DEBUG) System.out.println("getOwnerDoc("+parm1+")");
-    return super.getOwnerDocument( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  protected int _nextsib( int parm1 )
-  {
-    if (DEBUG) System.out.println("_nextSib("+parm1+")");
-    return super._nextsib( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getNextSibling( int parm1 )
-  {
-    if (DEBUG) System.out.println("getNextSibling("+parm1+")");
-    return super.getNextSibling( parm1);
-  }
-
-
-  /**
-   * @return
-   */
-  public boolean getDocumentAllDeclarationsProcessed( )
-  {
-    if (DEBUG) System.out.println("getDocAllDeclProc()");
-    return super.getDocumentAllDeclarationsProcessed();
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getParent( int parm1 )
-  {
-    if (DEBUG) System.out.println("getParent("+parm1+")");
-    return super.getParent( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @param parm3
-   * @return
-   */
-  public int getExpandedTypeID( String parm1, String parm2, int parm3 )
-  {
-    if (DEBUG) System.out.println("getExpandedTypeID()");
-    return super.getExpandedTypeID( parm1,  parm2,  parm3);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public void setDocumentBaseURI( String parm1 )
-  {
-    if (DEBUG) System.out.println("setDocBaseURI()");
-    super.setDocumentBaseURI( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @param parm3
-   * @return
-   */
-  public char[] getStringValueChunk( int parm1, int parm2, int[] parm3 )
-  {
-    if (DEBUG)
-    {
-      System.out.println("getStringChunkValue(" +
-      parm1 + "," +
-      parm2 + ")");
-    }
-    return super.getStringValueChunk( parm1,  parm2,  parm3);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public DTMAxisTraverser getAxisTraverser( int parm1 )
-  {
-    if (DEBUG) System.out.println("getAxixTraverser("+parm1+")");
-    return super.getAxisTraverser( parm1);
-  }
-
-  /**
-   * @param parm1
-   * @param parm2
-   * @return
-   */
-  public DTMAxisIterator getTypedAxisIterator( int parm1, int parm2 )
-  {
-    if (DEBUG) System.out.println("getTypedAxisIterator("+parm1+","+parm2+")");
-    return super.getTypedAxisIterator( parm1,  parm2);
-  }
-
-  /**
-   * @param parm1
-   * @return
-   */
-  public DTMAxisIterator getAxisIterator( int parm1 )
-  {
-    if (DEBUG) System.out.println("getAxisIterator("+parm1+")");
-    return super.getAxisIterator( parm1);
-  }
-  /**
-   * @param parm1
-   * @return
-   */
-  public int getElementById( String parm1 )
-  {
-    if (DEBUG) System.out.println("getElementByID("+parm1+")");
-    return DTM.NULL;
-  }
-
-  /**
-   * @return
-   */
-  public DeclHandler getDeclHandler( )
-  {
-    if (DEBUG) System.out.println("getDeclHandler()");
-    return null;
-  }
-
-  /**
-   * @return
-   */
-  public ErrorHandler getErrorHandler( )
-  {
-    if (DEBUG) System.out.println("getErrorHandler()");
-    return null;
-  }
-
-  /**
-   * @return
-   */
-  public String getDocumentTypeDeclarationSystemIdentifier( )
-  {
-    if (DEBUG) System.out.println("get_DTD-SID()");
-    return null;
-  }
-
-
-}
diff --git a/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java b/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
deleted file mode 100644
index 8f921ec..0000000
--- a/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.lib.sql;
-
-import java.util.Properties;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.lang.String;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.util.*;
-import java.sql.*;
-
-/**
- * For internal connectiones, i.e. Connection information supplies in the
- * Stylesheet. The Default Connection Pool will be used.
- */
-public class DefaultConnectionPool implements ConnectionPool
-{
-  /**
-   */
-  private static final boolean DEBUG = false;
-
-  /**
-   * The basic information to make a JDBC Connection
-   */
-  private String m_driver = new String("");
-  /**
-   */
-  private String m_url = new String("");
-
-
-  /**
-   * The mimimum size of the connection pool, if the
-   * number of available connections falls below this
-   * mark, min connections will be allocated. The Connection
-   * Pool will always be somewhere between MinSize and MinSize*2
-   */
-  private int m_PoolMinSize = 1;
-
-
-  /**
-   * Always implement the properties mechinism, if the Password
-   * or Username is set seperatly then we will add them to the
-   * property manually.
-   */
-  private Properties m_ConnectionProtocol = new Properties();
-
-  /**
-   * Storage for the PooledConnections
-   */
-  private Vector m_pool = new Vector();
-
-  /**
-   * Are we active ??
-   */
-  private boolean m_IsActive = false;
-
-  /**
-   */
-  public DefaultConnectionPool( ) {}
-
-
-  /**
-   * Return our current Active state
-   * @return
-   */
-  public boolean isEnabled( )
-  {
-    return m_IsActive;
-  }
-
-  /**
-   * Set the driver call to be used to create connections
-   * @param d
-   * @return
-   */
-  public void setDriver( String d )
-  {
-    m_driver = d;
-  }
-
-  /**
-   * Set the url used to connect to the database
-   * @param url
-   * @return
-   */
-  public void setURL( String url )
-  {
-    m_url = url;
-  }
-
-  /**
-   * Go through the connection pool and release any connections
-   * that are not InUse;
-   * @return
-   */
-  public void freeUnused( )
-  {
-    // Iterate over the entire pool closing the
-    // JDBC Connections.
-    for ( int x = 0; x < m_pool.size(); x++ )
-    {
-
-
-      PooledConnection pcon =
-        (PooledConnection) m_pool.elementAt(x);
-
-      // If the PooledConnection is not in use, close it
-      if ( pcon.inUse() == false )
-      {
-        if (DEBUG)
-        {
-          System.err.println("Closing JDBC Connection " + x);
-        }
-
-        pcon.close();
-      }
-    }
-
-  }
-
-  /**
-   * Is our ConnectionPool have any connections that are still in Use ??
-   * @return
-   */
-  public boolean hasActiveConnections( )
-  {
-    return (m_pool.size() > 0);
-  }
-
-
-  /**
-   * Set the password in the property set.
-   * @param p
-   * @return
-   */
-  public void setPassword( String p )
-  {
-    m_ConnectionProtocol.put("password", p);
-  }
-
-  /**
-   * Set the user name in the property set
-   * @param u
-   * @return
-   */
-  public void setUser( String u )
-  {
-    m_ConnectionProtocol.put("user", u);
-  }
-
-  /**
-   * The Protocol string is used to pass in other connection
-   * properties. A properties file is a general purpose container
-   *
-   * @param p
-   * @return
-   */
-  public void setProtocol( Properties p )
-  {
-    Enumeration e = p.keys();
-    while (e.hasMoreElements())
-    {
-      String key = (String) e.nextElement();
-      m_ConnectionProtocol.put(key, p.getProperty(key));
-    }
-  }
-
-
-  /**
-   * Override the current number of connections to keep in the pool. This
-   * setting will only have effect on a new pool or when a new connection
-   * is requested and there is less connections that this setting.
-   * @param n
-   * @return
-   */
-  public void setMinConnections( int n )
-  {
-    m_PoolMinSize = n;
-  }
-
-  /**
-   * Try to aquire a new connection, if it succeeds then return
-   * true, else return false.
-   * Note: This method will cause the connection pool to be built.
-   * @return
-   */
-  public boolean testConnection( )
-  {
-    try
-    {
-      if (DEBUG)
-      {
-        System.out.println("Testing Connection");
-      }
-
-      Connection conn = getConnection();
-
-      if (DEBUG)
-      {
-        DatabaseMetaData dma = conn.getMetaData();
-
-        System.out.println("\nConnected to " + dma.getURL());
-        System.out.println("Driver   " + dma.getDriverName());
-        System.out.println("Version  " + dma.getDriverVersion());
-        System.out.println("");
-      }
-
-      if (conn == null) return false;
-
-      releaseConnection(conn);
-
-      if (DEBUG)
-      {
-        System.out.println("Testing Connection, SUCCESS");
-      }
-
-      return true;
-    }
-    catch(Exception e)
-    {
-      if (DEBUG)
-      {
-        System.out.println("Testing Connection, FAILED");
-        e.printStackTrace();
-      }
-
-      return false;
-    }
-
-  }
-
-
-  // Find an available connection
-  /**
-   * @return Connection
-   * @throws SQLException
-   * @throws IllegalArgumentException
-   */
-  public synchronized Connection getConnection( )throws IllegalArgumentException, SQLException
-  {
-
-    PooledConnection pcon = null;
-
-    // We will fill up the pool any time it is less than the
-    // Minimum. THis could be cause by the enableing and disabling
-    // or the pool.
-    //
-    if ( m_pool.size() < m_PoolMinSize ) { initializePool(); }
-
-    // find a connection not in use
-    for ( int x = 0; x < m_pool.size(); x++ )
-    {
-
-      pcon = (PooledConnection) m_pool.elementAt(x);
-
-      // Check to see if the Connection is in use
-      if ( pcon.inUse() == false )
-      {
-        // Mark it as in use
-        pcon.setInUse(true);
-        // return the JDBC Connection stored in the
-        // PooledConnection object
-        return pcon.getConnection();
-      }
-    }
-
-    // Could not find a free connection,
-    // create and add a new one
-
-    // Create a new JDBC Connection
-    Connection con = createConnection();
-
-    // Create a new PooledConnection, passing it the JDBC
-    // Connection
-    pcon = new PooledConnection(con);
-
-    // Mark the connection as in use
-    pcon.setInUse(true);
-
-    // Add the new PooledConnection object to the pool
-    m_pool.addElement(pcon);
-
-    // return the new Connection
-    return pcon.getConnection();
-  }
-
-  /**
-   * @param con
-   * @return
-   * @throws SQLException
-   */
-  public synchronized void releaseConnection( Connection con )throws SQLException
-  {
-
-    // find the PooledConnection Object
-    for ( int x = 0; x < m_pool.size(); x++ )
-    {
-
-      PooledConnection pcon =
-        (PooledConnection) m_pool.elementAt(x);
-
-      // Check for correct Connection
-      if ( pcon.getConnection() == con )
-      {
-        if (DEBUG)
-        {
-          System.out.println("Releasing Connection " + x);
-        }
-
-        if (! isEnabled())
-        {
-          con.close();
-          m_pool.removeElementAt(x);
-          if (DEBUG)
-          {
-            System.out.println("-->Inactive Pool, Closing connection");
-          }
-
-        }
-        else
-        {
-          // Set it's inuse attribute to false, which
-          // releases it for use
-          pcon.setInUse(false);
-        }
-
-        break;
-      }
-    }
-  }
-
-
-  /**
-   * @param con
-   * @return
-   * @throws SQLException
-   */
-  public synchronized void releaseConnectionOnError( Connection con )throws SQLException
-  {
-
-    // find the PooledConnection Object
-    for ( int x = 0; x < m_pool.size(); x++ )
-    {
-
-      PooledConnection pcon =
-        (PooledConnection) m_pool.elementAt(x);
-
-      // Check for correct Connection
-      if ( pcon.getConnection() == con )
-      {
-        if (DEBUG)
-        {
-          System.out.println("Releasing Connection On Error" + x);
-        }
-
-        con.close();
-        m_pool.removeElementAt(x);
-        if (DEBUG)
-        {
-          System.out.println("-->Inactive Pool, Closing connection");
-        }
-        break;
-      }
-    }
-  }
-
-
-  /**
-   * @return
-   * @throws SQLException
-   */
-  private Connection createConnection( )throws SQLException
-  {
-    Connection con = null;
-
-    // Create a Connection
-    con = DriverManager.getConnection( m_url, m_ConnectionProtocol );
-
-    return con;
-  }
-
-  // Initialize the pool
-  /**
-   * @return
-   * @throws IllegalArgumentException
-   * @throws SQLException
-   */
-  public synchronized void initializePool( )throws IllegalArgumentException, SQLException
-  {
-
-     // Check our initial values
-     if ( m_driver == null )
-     {
-       throw new IllegalArgumentException("No Driver Name Specified!");
-     }
-
-     if ( m_url == null )
-     {
-       throw new IllegalArgumentException("No URL Specified!");
-     }
-
-     if ( m_PoolMinSize < 1 )
-     {
-       throw new IllegalArgumentException("Pool size is less than 1!");
-     }
-
-     // Create the Connections
-     // Load the Driver class file
-
-     try
-     {
-       Class.forName( m_driver );
-     }
-     catch(ClassNotFoundException e)
-     {
-       throw new IllegalArgumentException("Invalid Driver Name Specified!");
-     }
-
-     // IF we are not active, don't actuall build a pool yet
-     // Just set up the driver and periphal items.
-     if ( !m_IsActive) return;
-
-    // Create Connections based on the size member
-    do
-    {
-
-      Connection con = createConnection();
-
-      if ( con != null )
-      {
-
-        // Create a PooledConnection to encapsulate the
-        // real JDBC Connection
-        PooledConnection pcon = new PooledConnection(con);
-
-        // Add the Connection the pool.
-        addConnection(pcon);
-
-        if (DEBUG) System.out.println("Adding DB Connection to the Pool");
-      }
-    }
-    while (m_pool.size() < m_PoolMinSize);
-  }
-
-  // Adds the PooledConnection to the pool
-  /**
-   * @param value
-   * @return
-   */
-  private void addConnection( PooledConnection value )
-  {
-    // Add the PooledConnection Object to the vector
-    m_pool.addElement(value);
-  }
-
-
-  /**
-   * @return
-   * @throws Throwable
-   */
-  protected void finalize( )throws Throwable
-  {
-    if (DEBUG)
-    {
-      System.out.println("In Default Connection Pool, Finalize");
-    }
-
-    // Iterate over the entire pool closing the
-    // JDBC Connections.
-    for ( int x = 0; x < m_pool.size(); x++ )
-    {
-
-      if (DEBUG)
-      {
-        System.out.println("Closing JDBC Connection " + x);
-      }
-
-      PooledConnection pcon =
-        (PooledConnection) m_pool.elementAt(x);
-
-      // If the PooledConnection is not in use, close it
-      if ( pcon.inUse() == false ) { pcon.close();  }
-      else
-      {
-        if (DEBUG)
-        {
-          System.out.println("--> Force close");
-        }
-
-        // If it still in use, sleep for 30 seconds and
-        // force close.
-        try
-        {
-          java.lang.Thread.sleep(30000);
-          pcon.close();
-        }
-        catch (InterruptedException ie)
-        {
-          if (DEBUG) System.err.println(ie.getMessage());
-        }
-      }
-    }
-
-    if (DEBUG)
-    {
-      System.out.println("Exit Default Connection Pool, Finalize");
-    }
-
-    super.finalize();
-  }
-
-  /**
-   * The Pool can be Enabled and Disabled. Disabling the pool
-   * closes all the outstanding Unused connections and any new
-   * connections will be closed upon release.
-   * @param flag Control the Connection Pool. If it is enabled then Connections will actuall be held
-   * around. If disabled then all unused connections will be instantly closed and as
-   * connections are released they are closed and removed from the pool.
-   * @return
-   */
-  public void setPoolEnabled( final boolean flag )
-  {
-
-  }
-
-
-}
diff --git a/src/org/apache/xalan/lib/sql/ObjectArray.java b/src/org/apache/xalan/lib/sql/ObjectArray.java
deleted file mode 100644
index 75689ce..0000000
--- a/src/org/apache/xalan/lib/sql/ObjectArray.java
+++ /dev/null
@@ -1,207 +0,0 @@
-package org.apache.xalan.lib.sql;
-
-import java.util.Vector;
-
-/**
- * Provide a simple Array storage mechinsim where  native Arrays will be use as
- * the basic storage mechinism but the Arrays will be stored as blocks.
- * The size of the Array blocks is determine during object construction.
- * This is intended to be a simple storage mechinsim where the storage only
- * can grow. Array elements can not be removed, only added to.
- */
-public class ObjectArray
-{
-  /**
-   */
-  private int m_minArraySize = 10;
-  /**
-   * The container of all the sub arrays
-   */
-  private Vector m_Arrays = new Vector(200);
-
-  /**
-   * An index that porvides the Vector entry for the current Array that is
-   * being appended to.
-   */
-  private _ObjectArray m_currentArray;
-
-
-  /**
-   * The next offset in the current Array to append a new object
-   */
-  private int m_nextSlot;
-
-
-  /**
-   */
-  public ObjectArray( )
-  {
-    //
-    // Default constructor will work with a minimal fixed size
-    //
-    init(10);
-  }
-
-  /**
-   * @param minArraySize The size of the Arrays stored in the Vector
-   */
-  public ObjectArray( final int minArraySize )
-  {
-    init(minArraySize);
-  }
-
-  /**
-   * @param size
-   * @return
-   */
-  private void init( int size )
-  {
-    m_minArraySize = size;
-    m_currentArray = new _ObjectArray(m_minArraySize);
-  }
-
-  /**
-   * @param idx Index of the Object in the Array
-   * @return
-   */
-  public Object getAt( final int idx )
-  {
-    int arrayIndx = idx / m_minArraySize;
-    int arrayOffset = idx - (arrayIndx * m_minArraySize);
-
-    //
-    // If the array has been off loaded to the Vector Storage them
-    // grab it from there.
-    if (arrayIndx < m_Arrays.size())
-    {
-      _ObjectArray a = (_ObjectArray)m_Arrays.elementAt(arrayIndx);
-      return a.objects[arrayOffset];
-    }
-    else
-    {
-      // We must be in the current array, so pull it from there
-
-      // %REVIEW% We may want to check to see if arrayIndx is only
-      // one freater that the m_Arrays.size(); This code is safe but
-      // will repete if the index is greater than the array size.
-      return m_currentArray.objects[arrayOffset];
-    }
-  }
-
-  /**
-   * @param idx Index of the Object in the Array
-   * @param obj , The value to set in the Array
-   * @return
-   */
-  public void setAt( final int idx, final Object obj )
-  {
-    int arrayIndx = idx / m_minArraySize;
-    int arrayOffset = idx - (arrayIndx * m_minArraySize);
-
-    //
-    // If the array has been off loaded to the Vector Storage them
-    // grab it from there.
-    if (arrayIndx < m_Arrays.size())
-    {
-      _ObjectArray a = (_ObjectArray)m_Arrays.elementAt(arrayIndx);
-      a.objects[arrayOffset] = obj;
-    }
-    else
-    {
-      // We must be in the current array, so pull it from there
-
-      // %REVIEW% We may want to check to see if arrayIndx is only
-      // one freater that the m_Arrays.size(); This code is safe but
-      // will repete if the index is greater than the array size.
-      m_currentArray.objects[arrayOffset] = obj;
-    }
-  }
-
-
-
-  /**
-   * @param o Object to be appended to the Array
-   * @return
-   */
-  public int append( Object o )
-  {
-    if (m_nextSlot >= m_minArraySize)
-    {
-      m_Arrays.addElement(m_currentArray);
-      m_nextSlot = 0;
-      m_currentArray = new _ObjectArray(m_minArraySize);
-    }
-
-    m_currentArray.objects[m_nextSlot] = o;
-
-    int pos = (m_Arrays.size() * m_minArraySize) + m_nextSlot;
-
-    m_nextSlot++;
-
-    return pos;
-  }
-
-
-  /**
-   */
-  class _ObjectArray
-  {
-    /**
-     */
-    public Object[] objects;
-    /**
-     * @param size
-     */
-    public _ObjectArray( int size )
-    {
-      objects = new Object[size];
-    }
-  }
-
-  /**
-   * @param args
-   * @return
-   */
-  public static void main( String[] args )
-  {
-    String[] word={
-      "Zero","One","Two","Three","Four","Five",
-      "Six","Seven","Eight","Nine","Ten",
-      "Eleven","Twelve","Thirteen","Fourteen","Fifteen",
-      "Sixteen","Seventeen","Eighteen","Nineteen","Twenty",
-      "Twenty-One","Twenty-Two","Twenty-Three","Twenty-Four",
-      "Twenty-Five","Twenty-Six","Twenty-Seven","Twenty-Eight",
-      "Twenty-Nine","Thirty","Thirty-One","Thirty-Two",
-      "Thirty-Three","Thirty-Four","Thirty-Five","Thirty-Six",
-      "Thirty-Seven","Thirty-Eight","Thirty-Nine"};
-
-    ObjectArray m_ObjectArray = new ObjectArray();
-    // Add them in, using the default block size
-    for (int x =0; x< word.length; x++)
-    {
-      System.out.print(" - " + m_ObjectArray.append(word[x]));
-    }
-
-    System.out.println("\n");
-    // Now let's read them out sequentally
-    for (int x =0; x< word.length; x++)
-    {
-      String s = (String) m_ObjectArray.getAt(x);
-      System.out.println(s);
-    }
-
-    // Some Random Access
-    System.out.println((String) m_ObjectArray.getAt(5));
-    System.out.println((String) m_ObjectArray.getAt(10));
-    System.out.println((String) m_ObjectArray.getAt(20));
-    System.out.println((String) m_ObjectArray.getAt(2));
-    System.out.println((String) m_ObjectArray.getAt(15));
-    System.out.println((String) m_ObjectArray.getAt(30));
-    System.out.println((String) m_ObjectArray.getAt(6));
-    System.out.println((String) m_ObjectArray.getAt(8));
-
-    // Out of bounds
-    System.out.println((String) m_ObjectArray.getAt(40));
-
-  }
-}
diff --git a/src/org/apache/xalan/lib/sql/PooledConnection.java b/src/org/apache/xalan/lib/sql/PooledConnection.java
deleted file mode 100644
index 0160e01..0000000
--- a/src/org/apache/xalan/lib/sql/PooledConnection.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.lib.sql;
-
-import java.sql.*;
-import java.sql.Connection;
-
-/**
- */
-public class PooledConnection
-{
-
-  // Real JDBC Connection
-  /**
-   */
-  private Connection connection = null;
-  // boolean flag used to determine if connection is in use
-  /**
-   */
-  private boolean inuse = false;
-
-  // Constructor that takes the passed in JDBC Connection
-  // and stores it in the connection attribute.
-  /**
-   * @param value
-   */
-  public PooledConnection( Connection value )
-  {
-    if ( value != null ) { connection = value; }
-  }
-
-  /**
-   * Returns a reference to the JDBC Connection
-   * @return Connection
-   */
-  public Connection getConnection( )
-  {
-    // get the JDBC Connection
-    return connection;
-  }
-
-  /**
-   * Set the status of the PooledConnection.
-   *
-   * @param value
-   * @return
-   */
-  public void setInUse( boolean value )
-  {
-    inuse = value;
-  }
-
-  /**
-   * Returns the current status of the PooledConnection.
-   * @return
-   */
-  public boolean inUse( ) { return inuse; }
-
-  /**
-   *  Close the real JDBC Connection
-   * @return
-   */
-  public void close( )
-  {
-    try
-    {
-      connection.close();
-    }
-    catch (SQLException sqle)
-    {
-      System.err.println(sqle.getMessage());
-    }
-  }
-}
diff --git a/src/org/apache/xalan/lib/sql/QueryParameter.java b/src/org/apache/xalan/lib/sql/QueryParameter.java
deleted file mode 100644
index 8046fc6..0000000
--- a/src/org/apache/xalan/lib/sql/QueryParameter.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.lib.sql;
-
-/**
- * Title:        <p>
- * Description:  <p>
- * Copyright:    Copyright (c) <p>
- * Company:      <p>
- * @author
- * @version 1.0
- */
-public class QueryParameter         
-{
-
-  /**
-   */
-  private String value;
-  /**
-   */
-  private String type;
-
-  /**
-   * @param v
-   * @param t
-   */
-  public QueryParameter( String v, String t )
-  {
-    value = v;
-    type = t;
-  }
-
-  /**
-   * @return
-   */
-  public String getValue( ) {
-    return value;
-  }
-
-  /**
-   * @param newValue
-   * @return
-   */
-  public void setValue( String newValue ) {
-    value = newValue;
-  }
-
-  /**
-   * @param newType
-   * @return
-   */
-  public void setType( String newType ) {
-    type = newType;
-  }
-
-  /**
-   * @return
-   */
-  public String getType( ) {
-    return type;
-  }
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/lib/sql/SQLDocument.java b/src/org/apache/xalan/lib/sql/SQLDocument.java
deleted file mode 100644
index fc070d3..0000000
--- a/src/org/apache/xalan/lib/sql/SQLDocument.java
+++ /dev/null
@@ -1,868 +0,0 @@
-/**
- * @(#) SQLDocument.java
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.xalan.lib.sql;
-
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.DTM;
-import java.sql.Connection;
-import java.sql.Statement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.*;
-import org.apache.xml.dtm.ref.*;
-
-/**
- * The SQL Document is the main controlling class the executesa SQL Query
- */
-public class SQLDocument extends DTMDocument
-{
-
-  /**
-   */
-  private boolean DEBUG = false;
-
-  /**
-   */
-  private static final String S_NAMESPACE = "http://xml.apache.org/xalan/SQLExtension";
-
-
-  /**
-   */
-  private static final String S_SQL = "sql";
-
-  /**
-   */
-  private static final String S_ROW_SET = "row-set";
-
-  /**
-   */
-  private static final String S_METADATA = "metadata";
-
-  /**
-   */
-  private static final String S_COLUMN_HEADER = "column-header";
-
-  /**
-   */
-  private static final String S_ROW = "row";
-
-  /**
-   */
-  private static final String S_COL = "col";
-
-  /**
-   */
-  private static final String S_CATALOGUE_NAME = "catalogue-name";
-  /**
-   */
-  private static final String S_DISPLAY_SIZE = "column-display-size";
-  /**
-   */
-  private static final String S_COLUMN_LABEL = "column-label";
-  /**
-   */
-  private static final String S_COLUMN_NAME = "column-name";
-  /**
-   */
-  private static final String S_COLUMN_TYPE = "column-type";
-  /**
-   */
-  private static final String S_COLUMN_TYPENAME = "column-typename";
-  /**
-   */
-  private static final String S_PRECISION = "precision";
-  /**
-   */
-  private static final String S_SCALE = "scale";
-  /**
-   */
-  private static final String S_SCHEMA_NAME = "schema-name";
-  /**
-   */
-  private static final String S_TABLE_NAME = "table-name";
-  /**
-   */
-  private static final String S_CASESENSITIVE = "case-sensitive";
-  /**
-   */
-  private static final String S_DEFINITLEYWRITABLE = "definitley-writable";
-  /**
-   */
-  private static final String S_ISNULLABLE = "nullable";
-  /**
-   */
-  private static final String S_ISSIGNED = "signed";
-  /**
-   */
-  private static final String S_ISWRITEABLE = "writable";
-  /**
-   */
-  private static final String S_ISSEARCHABLE = "searchable";
-
-  /**
-   */
-  private int m_SQL_TypeID = 0;
-  /**
-   */
-  private int m_MetaData_TypeID = 0;
-  /**
-   */
-  private int m_ColumnHeader_TypeID = 0;
-  /**
-   */
-  private int m_RowSet_TypeID = 0;
-  /**
-   */
-  private int m_Row_TypeID = 0;
-  /**
-   */
-  private int m_Col_TypeID = 0;
-
-  /**
-   */
-  private int m_ColAttrib_CATALOGUE_NAME_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_DISPLAY_SIZE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_COLUMN_LABEL_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_COLUMN_NAME_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_COLUMN_TYPE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_COLUMN_TYPENAME_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_PRECISION_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_SCALE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_SCHEMA_NAME_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_TABLE_NAME_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_CASESENSITIVE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_DEFINITLEYWRITEABLE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_ISNULLABLE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_ISSIGNED_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_ISWRITEABLE_TypeID = 0;
-  /**
-   */
-  private int m_ColAttrib_ISSEARCHABLE_TypeID = 0;
-
-  /**
-   * The DBMS Connection used to produce this SQL Document.
-   * Will be used to clear free up the database resources on
-   * close.
-   */
-  private Connection m_Connection = null;
-
-  /**
-   * The Statement used to extract the data from the Database connection.
-   * We really don't need the connection, but it is NOT defined from
-   * JDBC Driver to driver what happens to the ResultSet if the statment
-   * is closed prior to reading all the data needed. So as long as we are
-   * using the ResultSet, we will track the Statement used to produce it.
-   */
-  private Statement m_Statement = null;
-
-  /**
-   * The conduit to our data that will be used to fill the document.
-   */
-  private ResultSet m_ResultSet = null;
-
-  /**
-   * The Connection Pool that originally produced the connection.
-   */
-  private ConnectionPool m_ConnectionPool = null;
-
-
-  /**
-   * As the column header array is built, keep the node index
-   * for each Column.
-   * The primary use of this is to locate the first attribute for
-   * each column in each row as we add records.
-   */
-  private int[] m_ColHeadersIdx;
-
-  /**
-   * An indicator on how many columns are in this query
-   */
-  private int m_ColCount;
-
-  /**
-   * The Index of the MetaData Node. Currently the MetaData Node contains the
-   *
-   */
-  private int m_MetaDataIdx = DTM.NULL;
-
-  /**
-   * The index of the Row Set node. This is the sibling directly after
-   * the last Column Header.
-   */
-  private int m_RowSetIdx = DTM.NULL;
-
-  /**
-   */
-  private int m_SQLIdx = DTM.NULL;
-
-  /**
-   * Demark the first row element where we started adding rows into the
-   * Document.
-   */
-  private int m_FirstRowIdx = DTM.NULL;
-
-  /**
-   * Keep track of the Last row inserted into the DTM from the ResultSet.
-   * This will be used as the index of the parent Row Element when adding
-   * a row.
-   */
-  private int m_LastRowIdx = DTM.NULL;
-
-  /**
-   * Streaming Mode Control, In Streaming mode we reduce the memory
-   * footprint since we only use a single row instance.
-   */
-  private boolean m_StreamingMode = true;
-
-  /**
-   * @param mgr
-   * @param ident
-   * @param pool
-   * @param con
-   * @param stmt
-   * @param data
-   * @param streamingMode
-   * @throws SQLException
-   */
-  public SQLDocument( DTMManager mgr, int ident, ConnectionPool pool, Connection con, Statement stmt, ResultSet data, boolean streamingMode )throws SQLException
-  {
-    super(mgr, ident);
-
-    m_Connection = con;
-    m_Statement  = stmt;
-    m_ResultSet  = data;
-    m_ConnectionPool = pool;
-    m_StreamingMode = streamingMode;
-
-    createExpandedNameTable();
-    extractSQLMetaData(m_ResultSet.getMetaData());
-
-    // Only grab the first row, subsequent rows will be
-    // fetched on demand.
-    // We need to do this here so at least on row is set up
-    // to measure when we are actually reading rows.
-    addRowToDTMFromResultSet();
-
-    // this.dumpDTM();
-  }
-
-
-  /**
-   * Extract the Meta Data and build the Column Attribute List.
-   * @param meta
-   * @return
-   */
-  private void extractSQLMetaData( ResultSetMetaData meta )
-  {
-    // Build the Node Tree, just add the Column Header
-    // branch now, the Row & col elements will be added
-    // on request.
-
-    // Start the document here
-    m_DocumentIdx = addElement(0, m_Document_TypeID, DTM.NULL, DTM.NULL);
-
-    // Add in the row-set Element
-    m_SQLIdx = addElement(1, m_SQL_TypeID,  m_DocumentIdx, DTM.NULL);
-
-    // Add in the MetaData Element
-    m_MetaDataIdx = addElement(1, m_MetaData_TypeID,  m_SQLIdx, DTM.NULL);
-
-    try
-    {
-      m_ColCount = meta.getColumnCount();
-      m_ColHeadersIdx = new int[m_ColCount];
-    }
-    catch(Exception e)
-    {
-      error("ERROR Extracting Metadata");
-    }
-
-    // The ColHeaderIdx will be used to keep track of the
-    // Element entries for the individual Column Header.
-    int lastColHeaderIdx = DTM.NULL;
-
-    // JDBC Columms Start at 1
-    int i = 1;
-    for (i=1; i<= m_ColCount; i++)
-    {
-      m_ColHeadersIdx[i-1] =
-        addElement(2,m_ColumnHeader_TypeID, m_MetaDataIdx, lastColHeaderIdx);
-
-      lastColHeaderIdx = m_ColHeadersIdx[i-1];
-      // A bit brute force, but not sure how to clean it up
-
-      try
-      {
-        addAttributeToNode(
-          meta.getColumnName(i),
-          m_ColAttrib_COLUMN_NAME_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_COLUMN_NAME_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.getColumnLabel(i),
-          m_ColAttrib_COLUMN_LABEL_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_COLUMN_LABEL_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.getCatalogName(i),
-          m_ColAttrib_CATALOGUE_NAME_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_CATALOGUE_NAME_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          new Integer(meta.getColumnDisplaySize(i)),
-          m_ColAttrib_DISPLAY_SIZE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_DISPLAY_SIZE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          new Integer(meta.getColumnType(i)),
-          m_ColAttrib_COLUMN_TYPE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_COLUMN_TYPE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.getColumnTypeName(i),
-          m_ColAttrib_COLUMN_TYPENAME_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_COLUMN_TYPENAME_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          new Integer(meta.getPrecision(i)),
-          m_ColAttrib_PRECISION_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_PRECISION_TypeID, lastColHeaderIdx);
-      }
-      try
-      {
-        addAttributeToNode(
-          new Integer(meta.getScale(i)),
-          m_ColAttrib_SCALE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_SCALE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.getSchemaName(i),
-          m_ColAttrib_SCHEMA_NAME_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_SCHEMA_NAME_TypeID, lastColHeaderIdx);
-      }
-      try
-      {
-        addAttributeToNode(
-          meta.getTableName(i),
-          m_ColAttrib_TABLE_NAME_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_TABLE_NAME_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.isCaseSensitive(i) ? S_ISTRUE : S_ISFALSE,
-          m_ColAttrib_CASESENSITIVE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_CASESENSITIVE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.isDefinitelyWritable(i) ? S_ISTRUE : S_ISFALSE,
-          m_ColAttrib_DEFINITLEYWRITEABLE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_DEFINITLEYWRITEABLE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.isNullable(i) != 0 ? S_ISTRUE : S_ISFALSE,
-          m_ColAttrib_ISNULLABLE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_ISNULLABLE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.isSigned(i) ? S_ISTRUE : S_ISFALSE,
-          m_ColAttrib_ISSIGNED_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_ISSIGNED_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.isWritable(i) == true ? S_ISTRUE : S_ISFALSE,
-          m_ColAttrib_ISWRITEABLE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_ISWRITEABLE_TypeID, lastColHeaderIdx);
-      }
-
-      try
-      {
-        addAttributeToNode(
-          meta.isSearchable(i) == true ? S_ISTRUE : S_ISFALSE,
-          m_ColAttrib_ISSEARCHABLE_TypeID, lastColHeaderIdx);
-      }
-      catch(Exception e)
-      {
-        addAttributeToNode(
-          S_ATTRIB_NOT_SUPPORTED,
-          m_ColAttrib_ISSEARCHABLE_TypeID, lastColHeaderIdx);
-      }
-
-    }
-
-  }
-
-  /**
-   * Populate the Expanded Name Table with the Node that we will use.
-   * Keep a reference of each of the types for access speed.
-   * @return
-   */
-  protected void createExpandedNameTable( )
-  {
-    super.createExpandedNameTable();
-
-    m_SQL_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_SQL, DTM.ELEMENT_NODE);
-
-    m_MetaData_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_METADATA, DTM.ELEMENT_NODE);
-
-    m_ColumnHeader_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_COLUMN_HEADER, DTM.ELEMENT_NODE);
-    m_RowSet_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ROW_SET, DTM.ELEMENT_NODE);
-    m_Row_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ROW, DTM.ELEMENT_NODE);
-    m_Col_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_COL, DTM.ELEMENT_NODE);
-
-
-    m_ColAttrib_CATALOGUE_NAME_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_CATALOGUE_NAME, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_DISPLAY_SIZE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_DISPLAY_SIZE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_COLUMN_LABEL_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_COLUMN_LABEL, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_COLUMN_NAME_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_COLUMN_NAME, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_COLUMN_TYPE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_COLUMN_TYPE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_COLUMN_TYPENAME_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_COLUMN_TYPENAME, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_PRECISION_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_PRECISION, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_SCALE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_SCALE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_SCHEMA_NAME_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_SCHEMA_NAME, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_TABLE_NAME_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_TABLE_NAME, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_CASESENSITIVE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_CASESENSITIVE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_DEFINITLEYWRITEABLE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_DEFINITLEYWRITABLE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_ISNULLABLE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ISNULLABLE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_ISSIGNED_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ISSIGNED, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_ISWRITEABLE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ISWRITEABLE, DTM.ATTRIBUTE_NODE);
-    m_ColAttrib_ISSEARCHABLE_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ISSEARCHABLE, DTM.ATTRIBUTE_NODE);
-  }
-
-
-  /**
-   * Pull a record from the result set and map it to a DTM based ROW
-   * If we are in Streaming mode, then only create a single row and
-   * keep copying the data into the same row. This will keep the memory
-   * footprint constint independant of the RecordSet Size. If we are not
-   * in Streaming mode then create ROWS for the whole tree.
-   * @return
-   */
-  private boolean addRowToDTMFromResultSet( )
-  {
-    try
-    {
-
-
-      // If we have not started the RowSet yet, then add it to the
-      // tree.
-      if (m_RowSetIdx == DTM.NULL)
-      {
-        m_RowSetIdx = addElement(1, m_RowSet_TypeID,  m_SQLIdx, m_MetaDataIdx);
-      }
-
-      // Check to see if all the data has been read from the Query.
-      // If we are at the end the signal that event
-      if ( ! m_ResultSet.next())
-      {
-        // In Streaming mode, the current ROW will always point back
-        // to itself until all the data was read. Once the Query is
-        // empty then point the next row to DTM.NULL so that the stream
-        // ends.
-
-        if (m_StreamingMode)
-        {
-          // We are at the end, so let's untie the mark
-          m_nextsib.setElementAt(DTM.NULL, m_LastRowIdx);
-        }
-
-        return false;
-      }
-
-      // If this is the first time here, start the new level
-      if (m_FirstRowIdx == DTM.NULL)
-      {
-        m_FirstRowIdx =
-          addElement(2, m_Row_TypeID, m_RowSetIdx, DTM.NULL);
-        m_LastRowIdx = m_FirstRowIdx;
-
-        if (m_StreamingMode)
-        {
-          // Let's tie the rows together until the end.
-          m_nextsib.setElementAt(m_LastRowIdx, m_LastRowIdx);
-        }
-
-      }
-      else
-      {
-        //
-        // If we are in Streaming mode, then only use a single row instance
-        if (! m_StreamingMode)
-        {
-          m_LastRowIdx = addElement(3, m_Row_TypeID, m_RowSetIdx, m_LastRowIdx);
-        }
-      }
-
-      // If we are not in streaming mode, this will always be DTM.NULL
-      // If we are in streaming mode, it will only be DTM.NULL the first time
-      int colID = _firstch(m_LastRowIdx);
-
-      // Keep Track of who our parent was when adding new col objects.
-      int pcolID = DTM.NULL;
-
-      // Columns in JDBC Start at 1 and go to the Extent
-      for (int i=1; i<= m_ColCount; i++)
-      {
-        // Just grab the Column Object Type, we will convert it to a string
-        // later.
-        Object o = m_ResultSet.getObject(i);
-
-        // Create a new column object if one does not exist.
-        // In Streaming mode, this mechinism will reuse the column
-        // data the second and subsequent row accesses.
-        if (colID == DTM.NULL)
-        {
-          pcolID = addElementWithData(o,3,m_Col_TypeID, m_LastRowIdx, pcolID);
-          cloneAttributeFromNode(pcolID, m_ColHeadersIdx[i-1]);
-        }
-        else
-        {
-          // We must be in streaming mode, so let's just replace the data
-          // If the firstch was not set then we have a major error
-          int dataIdent = _firstch(colID);
-          if (dataIdent == DTM.NULL)
-          {
-            error("Streaming Mode, Data Error");
-          }
-          else
-          {
-            m_ObjectArray.setAt(dataIdent, o);
-          }
-        } // If
-
-        // In streaming mode, this will be !DTM.NULL
-        // So if the elements were already established then we
-        // should be able to walk them in order.
-        if (colID != DTM.NULL)
-        {
-          colID = _nextsib(colID);
-        }
-
-      } // For Col Loop
-    }
-    catch(Exception e)
-    {
-      if (DEBUG)
-      {
-        System.out.println(
-          "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]");
-      }
-
-      error("SQL Error Fetching next row [" + e.getLocalizedMessage() + "]");
-    }
-
-    // Only do a single row...
-    return true;
-  }
-
-
-  /**
-   * Clean up our ties to the database but this does not necessarly
-   * clean up the document.
-   * @return
-   */
-  public void close( )
-  {
-    if (DEBUG) System.out.println("close()");
-
-    try { if (null != m_ResultSet) m_ResultSet.close(); }
-    catch(Exception e) { }
-    try { if (null != m_Statement) m_Statement.close(); }
-    catch(Exception e) { }
-    try {
-      if (null != m_Connection)
-        m_ConnectionPool.releaseConnection(m_Connection);
-    } catch(Exception e) { }
-  }
-
-  /**
-   * When an error occurs, the XConnection will call this method
-   * do that we can deal with the Connection properly
-   * @return
-   */
-  public void closeOnError( )
-  {
-    if (DEBUG) System.out.println("close()");
-
-    try  { if (null != m_ResultSet) m_ResultSet.close();   }
-    catch(Exception e) { }
-    try  { if (null != m_Statement) m_Statement.close();
-    } catch(Exception e) { }
-    try {
-      if (null != m_Connection)
-        m_ConnectionPool.releaseConnectionOnError(m_Connection);
-    } catch(Exception e) { }
-  }
-
-
-
-  /**
-   * @return
-   */
-  protected boolean nextNode( )
-  {
-    if (DEBUG) System.out.println("nextNode()");
-    try
-    {
-      return false;
-//      return m_ResultSet.isAfterLast();
-    }
-    catch(Exception e)
-    {
-      return false;
-    }
-  }
-
-  /**
-   * @param identity
-   * @return
-   */
-  protected int _nextsib( int identity )
-  {
-    // If we are asking for the next row and we have not
-    // been there yet then let's see if we can get another
-    // row from the ResultSet.
-    //
-
-    int id = _exptype(identity);
-    if (
-      ( id == m_Row_TypeID) &&
-      (identity >= m_LastRowIdx))
-    {
-      if (DEBUG) System.out.println("reading from the ResultSet");
-      addRowToDTMFromResultSet();
-    }
-
-    return super._nextsib(identity);
-  }
-
-  public void documentRegistration()
-  {
-    if (DEBUG) System.out.println("Document Registration");
-  }
-
-  public void documentRelease()
-  {
-    if (DEBUG) System.out.println("Document Release");
-  }
-
-
-}
diff --git a/src/org/apache/xalan/lib/sql/SQLErrorDocument.java b/src/org/apache/xalan/lib/sql/SQLErrorDocument.java
deleted file mode 100644
index 2a8172a..0000000
--- a/src/org/apache/xalan/lib/sql/SQLErrorDocument.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * @(#) SQLErrorDocument.java
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.xalan.lib.sql;
-
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.DTM;
-import java.sql.SQLException;
-
-/**
- *
- * A base class that will convert an exception into an XML stream
- * that can be returned in place of the standard result. The XML
- * format returned is a follows.
- *
- * <ext-error>
- *  <message> The Message for a generic error </message>
- *  <sql-error>
- *    <message> SQL Message from the Exception thrown </message>
- *    <code> SQL Error Code </stack>
- *  </sql-error>
- * <ext-error>
- *
- */
-
-/**
- * The SQL Document is the main controlling class the executesa SQL Query
- */
-public class SQLErrorDocument extends DTMDocument
-{
-  /**
-   */
-  private static final String S_EXT_ERROR = "ext-error";
-  /**
-   */
-  private static final String S_SQL_ERROR = "sql-error";
-  /**
-   */
-  private static final String S_MESSAGE = "message";
-  /**
-   */
-  private static final String S_CODE = "code";
-
-  /**
-   */
-  private int m_ErrorExt_TypeID = DTM.NULL;
-  /**
-   */
-  private int m_Message_TypeID = DTM.NULL;
-  /**
-   */
-  private int m_Code_TypeID = DTM.NULL;
-
-  /**
-   */
-  private int m_SQLError_TypeID = DTM.NULL;
-
-  /**
-   */
-  private int m_rootID = DTM.NULL;
-  /**
-   */
-  private int m_extErrorID = DTM.NULL;
-  /**
-   */
-  private int m_MainMessageID = DTM.NULL;
-
-  /**
-   * Build up an SQLErrorDocument that includes the basic error information
-   * along with the Extended SQL Error information.
-   * @param mgr
-   * @param ident
-   * @param error
-   */
-  public SQLErrorDocument( DTMManager mgr, int ident, SQLException error )
-  {
-    super(mgr, ident);
-
-    createExpandedNameTable();
-    buildBasicStructure(error);
-
-    int sqlError = addElement(2, m_SQLError_TypeID, m_extErrorID, m_MainMessageID);
-    int element = DTM.NULL;
-
-    element = addElementWithData(
-      new Integer(error.getErrorCode()), 3,
-      m_Code_TypeID, sqlError, element);
-
-    element = addElementWithData(
-      error.getLocalizedMessage(), 3,
-      m_Message_TypeID, sqlError, element);
-
-//    this.dumpDTM();
-  }
-
-
-  /**
-   * Build up an Error Exception with just the Standard Error Information
-   * @param mgr
-   * @param ident
-   * @param error
-   */
-  public SQLErrorDocument( DTMManager mgr, int ident, Exception error )
-  {
-    super(mgr, ident);
-    createExpandedNameTable();
-    buildBasicStructure(error);
-  }
-
-  /**
-   * Build up the basic structure that is common for each error.
-   * @param e
-   * @return
-   */
-  private void buildBasicStructure( Exception e )
-  {
-    m_rootID = addElement(0, m_Document_TypeID, DTM.NULL, DTM.NULL);
-    m_extErrorID = addElement(1, m_ErrorExt_TypeID, m_rootID, DTM.NULL);
-    m_MainMessageID = addElementWithData
-      (e.getLocalizedMessage(), 2, m_Message_TypeID, m_extErrorID, DTM.NULL);
-  }
-
-  /**
-   * Populate the Expanded Name Table with the Node that we will use.
-   * Keep a reference of each of the types for access speed.
-   * @return
-   */
-  protected void createExpandedNameTable( )
-  {
-
-    super.createExpandedNameTable();
-
-    m_ErrorExt_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_EXT_ERROR, DTM.ELEMENT_NODE);
-
-    m_SQLError_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_SQL_ERROR, DTM.ELEMENT_NODE);
-
-    m_Message_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_MESSAGE, DTM.ELEMENT_NODE);
-
-    m_Code_TypeID =
-      m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_CODE, DTM.ELEMENT_NODE);
-  }
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/lib/sql/XConnection.java b/src/org/apache/xalan/lib/sql/XConnection.java
deleted file mode 100644
index b37d144..0000000
--- a/src/org/apache/xalan/lib/sql/XConnection.java
+++ /dev/null
@@ -1,1389 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.lib.sql;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.Date;
-import java.sql.Timestamp;
-import java.sql.Time;
-import java.util.Properties;
-import java.util.Vector;
-import java.util.StringTokenizer;
-import java.lang.IllegalArgumentException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Node;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.math.BigDecimal;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.ref.DTMManagerDefault;
-import org.apache.xpath.XPathContext;
-import org.apache.xalan.extensions.ExpressionContext;
-import org.apache.xpath.objects.XBooleanStatic;
-
-import org.w3c.dom.*;
-import java.sql.*;
-import java.util.*;
-
-/**
- * An XSLT extension that allows a stylesheet to
- * access JDBC data. From the stylesheet perspective,
- * XConnection provides 3 extension functions: new(),
- * query(), and close().
- * Use new() to call one of XConnection constructors, which
- * establishes a JDBC driver connection to a data source and
- * returns an XConnection object.
- * Then use the XConnection object query() method to return a
- * result set in the form of a row-set element.
- * When you have finished working with the row-set, call the
- * XConnection object close() method to terminate the connection.
- */
-public class XConnection
-{
-
-  /**
-   * Flag for DEBUG mode
-   */
-  private static final boolean DEBUG = false;
-
-  /**
-   * The Current Connection Pool in Use. An XConnection can only
-   * represent one query at a time, prior to doing some type of query.
-   */
-  private ConnectionPool m_ConnectionPool = null;
-
-  /**
-   * If a default Connection Pool is used. i.e. A connection Pool
-   * that is created internally, then do we actually allow pools
-   * to be created. Due to the archititure of the Xalan Extensions,
-   * there is no notification of when the Extension is being unloaded and
-   * as such, there is a good chance that JDBC COnnections are not closed.
-   * A finalized is provided to try and catch this situation but since
-   * support of finalizers is inconsistant across JVM's this may cause
-   * a problem. The robustness of the JDBC Driver is also at issue here.
-   * if a controlled shutdown is provided by the driver then default
-   * conntectiom pools are OK.
-   */
-  private boolean m_DefaultPoolingEnabled = false;
-
-
-  /**
-   * As we do queries, we will produce SQL Documents. Any ony may produce
-   * one or more SQL Documents so that the current connection information
-   * may be easilly reused. This collection will hold a collection of all
-   * the documents created. As Documents are closed, they will be removed
-   * from the collection and told to free all the used resources.
-   */
-  private Vector m_OpenSQLDocuments = new Vector();
-
-
-  /**
-   * Let's keep a copy of the ConnectionPoolMgr in
-   * alive here so we are keeping the static pool alive
-   * We will also use this Pool Manager to register our default pools.
-   */
-  private ConnectionPoolManager m_PoolMgr = new ConnectionPoolManager();
-
-  /**
-   * For PreparedStatements, we need a place to
-   * to store the parameters in a vector.
-   */
-  private Vector m_ParameterList = new Vector();
-
-  /**
-   * Allow the SQL Extensions to return null on error. The Error information will
-   * be stored in a seperate Error Document that can easily be retrived using the
-   * getError() method.
-   * %REVIEW% This functionality will probably be buried inside the SQLDocument.
-   */
-  private SQLErrorDocument m_Error = null;
-
-  /**
-   */
-  private boolean m_IsDefaultPool = false;
-
-  /**
-   * This flag will be used to indicate to the SQLDocument to use
-   * Streaming mode. Streeaming Mode will reduce the memory footprint
-   * to a fixed amount but will not let you traverse the tree more than
-   * once since the Row data will be reused for every Row in the Query.
-   */
-  private boolean m_IsStreamingEnabled = true;
-
-  /**
-   */
-  public XConnection( )
-  {
-  }
-
-  // The original constructors will be kept around for backwards
-  // compatibility. Future Stylesheets should use the approaite
-  // connect method to receive full error information.
-  //
-  /**
-   * @param exprContext
-   * @param ConnPoolName
-   */
-  public XConnection( ExpressionContext exprContext, String ConnPoolName )
-  {
-    connect(exprContext, ConnPoolName);
-  }
-
-  /**
-   * @param exprContext
-   * @param driver
-   * @param dbURL
-   */
-  public XConnection( ExpressionContext exprContext, String driver, String dbURL )
-  {
-    connect(exprContext, driver, dbURL);
-  }
-
-  /**
-   * @param exprContext
-   * @param list
-   */
-  public XConnection( ExpressionContext exprContext, NodeList list )
-  {
-    connect(exprContext, list);
-  }
-
-  /**
-   * @param exprContext
-   * @param driver
-   * @param dbURL
-   * @param user
-   * @param password
-   */
-  public XConnection( ExpressionContext exprContext, String driver, String dbURL, String user, String password )
-  {
-    connect(exprContext, driver, dbURL, user, password);
-  }
-
-  /**
-   * @param exprContext
-   * @param driver
-   * @param dbURL
-   * @param protocolElem
-   */
-  public XConnection( ExpressionContext exprContext, String driver, String dbURL, Element protocolElem )
-  {
-    connect(exprContext, driver, dbURL, protocolElem);
-  }
-
-
-  /**
-   * Create an XConnection using the name of an existing Connection Pool
-   * @param exprContext
-   * @param ConnPoolName
-   * @return
-   */
-  public XBooleanStatic connect( ExpressionContext exprContext, String ConnPoolName )
-  {
-    try
-    {
-      m_ConnectionPool = m_PoolMgr.getPool(ConnPoolName);
-
-      if (m_ConnectionPool == null)
-        throw new java.lang.IllegalArgumentException("Invalid Pool Name");
-
-      m_IsDefaultPool = false;
-      return new XBooleanStatic(true);
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-
-  }
-
-  /**
-   * Create an XConnection object with just a driver and database URL.
-   * @param exprContext
-   * @param driver JDBC driver of the form foo.bar.Driver.
-   * @param dbURL database URL of the form jdbc:subprotocol:subname.
-   * @return
-   */
-  public XBooleanStatic connect( ExpressionContext exprContext, String driver, String dbURL )
-  {
-    try
-    {
-      init(driver, dbURL, new Properties());
-      return new XBooleanStatic(true);
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-  }
-
-  /**
-   * @param exprContext
-   * @param protocolElem
-   * @return
-   */
-  public XBooleanStatic connect( ExpressionContext exprContext, Element protocolElem )
-  {
-    try
-    {
-      initFromElement(protocolElem);
-      return new XBooleanStatic(true);
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-  }
-
-  /**
-   * @param exprContext
-   * @param list
-   * @return
-   */
-  public XBooleanStatic connect( ExpressionContext exprContext, NodeList list )
-  {
-    try
-    {
-      initFromElement( (Element) list.item(0) );
-      return new XBooleanStatic(true);
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-  }
-
-  /**
-   * Create an XConnection object with user ID and password.
-   * @param exprContext
-   * @param driver JDBC driver of the form foo.bar.Driver.
-   * @param dbURL database URL of the form jdbc:subprotocol:subname.
-   * @param user user ID.
-   * @param password connection password.
-   * @return
-   */
-  public XBooleanStatic connect( ExpressionContext exprContext, String driver, String dbURL, String user, String password )
-  {
-    try
-    {
-      Properties prop = new Properties();
-      prop.put("user", user);
-      prop.put("password", password);
-
-      init(driver, dbURL, prop);
-
-      return new XBooleanStatic(true);
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-  }
-
-
-  /**
-   * Create an XConnection object with a connection protocol
-   * @param exprContext
-   * @param driver JDBC driver of the form foo.bar.Driver.
-   * @param dbURL database URL of the form jdbc:subprotocol:subname.
-   * @param protocolElem list of string tag/value connection arguments,
-   * normally including at least "user" and "password".
-   * @return
-   */
-  public XBooleanStatic connect( ExpressionContext exprContext, String driver, String dbURL, Element protocolElem )
-  {
-    try
-    {
-      Properties prop = new Properties();
-
-      NamedNodeMap atts = protocolElem.getAttributes();
-
-      for (int i = 0; i < atts.getLength(); i++)
-      {
-        prop.put(atts.item(i).getNodeName(), atts.item(i).getNodeValue());
-      }
-
-      init(driver, dbURL, prop);
-
-      return new XBooleanStatic(true);
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return new XBooleanStatic(false);
-    }
-  }
-
-
-  /**
-   * Allow the database connection information to be sepcified in
-   * the XML tree. The connection information could also be
-   * externally originated and passed in as an XSL Parameter.
-   * The required XML Format is as follows.
-   * A document fragment is needed to specify the connection information
-   * the top tag name is not specific for this code, we are only interested
-   * in the tags inside.
-   * <DBINFO-TAG>
-   * Specify the driver name for this connection pool
-   * <dbdriver>drivername</dbdriver>
-   * Specify the URL for the driver in this connection pool
-   * <dburl>url</dburl>
-   * Specify the password for this connection pool
-   * <password>password</password>
-   * Specify the username for this connection pool
-   * <user>username</user>
-   * You can add extra protocol items including the User Name & Password
-   * with the protocol tag. For each extra protocol item, add a new element
-   * where the name of the item is specified as the name attribute and
-   * and its value as the elements value.
-   * <protocol name="name of value">value</protocol>
-   * </DBINFO-TAG>
-   * @param e
-   * @return
-   * @throws SQLException
-   */
-  private void initFromElement( Element e )throws SQLException
-  {
-
-    Properties prop = new Properties();
-    String driver = "";
-    String dbURL = "";
-    Node n = e.getFirstChild();
-
-    if (null == n) return; // really need to throw an error
-
-    do
-    {
-      String nName = n.getNodeName();
-
-      if (nName.equalsIgnoreCase("dbdriver"))
-      {
-        driver = "";
-        Node n1 = n.getFirstChild();
-        if (null != n1)
-        {
-          driver = n1.getNodeValue();
-        }
-      }
-
-      if (nName.equalsIgnoreCase("dburl"))
-      {
-        dbURL = "";
-        Node n1 = n.getFirstChild();
-        if (null != n1)
-        {
-          dbURL = n1.getNodeValue();
-        }
-      }
-
-      if (nName.equalsIgnoreCase("password"))
-      {
-        String s = "";
-        Node n1 = n.getFirstChild();
-        if (null != n1)
-        {
-          s = n1.getNodeValue();
-        }
-        prop.put("password", s);
-      }
-
-      if (nName.equalsIgnoreCase("user"))
-      {
-        String s = "";
-        Node n1 = n.getFirstChild();
-        if (null != n1)
-        {
-          s = n1.getNodeValue();
-        }
-        prop.put("user", s);
-      }
-
-      if (nName.equalsIgnoreCase("protocol"))
-      {
-        String Name = "";
-
-        NamedNodeMap attrs = n.getAttributes();
-        Node n1 = attrs.getNamedItem("name");
-        if (null != n1)
-        {
-          String s = "";
-          Name = n1.getNodeValue();
-
-          Node n2 = n.getFirstChild();
-          if (null != n2) s = n2.getNodeValue();
-
-          prop.put(Name, s);
-        }
-      }
-
-    } while ( (n = n.getNextSibling()) != null);
-
-    init(driver, dbURL, prop);
-  }
-
-
-
-  /**
-   * Initilize is being called because we did not have an
-   * existing Connection Pool, so let's see if we created one
-   * already or lets create one ourselves.
-   * @param driver
-   * @param dbURL
-   * @param prop
-   * @return
-   * @throws SQLException
-   */
-  private void init( String driver, String dbURL, Properties prop )throws SQLException
-  {
-    Connection con = null;
-
-    if (DEBUG)
-      System.out.println("XConnection, Connection Init");
-
-    String user = prop.getProperty("user");
-    if (user == null) user = "";
-
-    String passwd = prop.getProperty("password");
-    if (passwd == null) passwd = "";
-
-
-    String poolName = driver + dbURL + user + passwd;
-    ConnectionPool cpool = m_PoolMgr.getPool(poolName);
-
-    if (cpool == null)
-    {
-
-      if (DEBUG)
-      {
-        System.out.println("XConnection, Creating Connection");
-        System.out.println(" Driver  :" + driver);
-        System.out.println(" URL     :" + dbURL);
-        System.out.println(" user    :" + user);
-        System.out.println(" passwd  :" + passwd);
-      }
-
-
-      DefaultConnectionPool defpool = new DefaultConnectionPool();
-
-      if ((DEBUG) && (defpool == null))
-        System.out.println("Failed to Create a Default Connection Pool");
-
-      defpool.setDriver(driver);
-      defpool.setURL(dbURL);
-      defpool.setProtocol(prop);
-
-      // Only enable pooling in the default pool if we are explicatly
-      // told too.
-      if (m_DefaultPoolingEnabled) defpool.setPoolEnabled(true);
-
-      m_PoolMgr.registerPool(poolName, defpool);
-      m_ConnectionPool = defpool;
-
-
-    }
-
-    m_IsDefaultPool = true;
-
-    //
-    // Let's test to see if we really can connect
-    // Just remember to give it back after the test.
-    //
-    try
-    {
-      con = m_ConnectionPool.getConnection();
-    }
-    catch(SQLException e)
-    {
-      if (con != null)
-      {
-        m_ConnectionPool.releaseConnectionOnError(con);
-        con = null;
-      }
-      throw e;
-    }
-    finally
-    {
-      m_ConnectionPool.releaseConnection(con);
-    }
-  }
-
-
-  /**
-   * Execute a query statement by instantiating an
-   * @param exprContext
-   * @param queryString the SQL query.
-   * @return XStatement implements NodeIterator.
-   * @throws SQLException
-   * @link org.apache.xalan.lib.sql.XStatement XStatement}
-   * object. The XStatement executes the query, and uses the result set
-   * to create a
-   * @link org.apache.xalan.lib.sql.RowSet RowSet},
-   * a row-set element.
-   */
-  public DTM query( ExpressionContext exprContext, String queryString )
-  {
-    Connection con = null;
-    Statement stmt = null;
-    ResultSet rs = null;
-
-    DTMManagerDefault mgrDefault = null;
-    SQLDocument doc = null;
-
-    try
-    {
-      if (DEBUG) System.out.println("query()");
-      if (null == m_ConnectionPool)
-      {
-        // Build an Error Document, NOT Connected
-        return null;
-      }
-
-      try
-      {
-        con = m_ConnectionPool.getConnection();
-        stmt = con.createStatement();
-        rs = stmt.executeQuery(queryString);
-      }
-      catch(SQLException e)
-      {
-        // We have not created a document yet, so lets close the
-        // connection ourselves then let the process deal with the
-        // error.
-        //
-        try  { if (null != rs) rs.close(); }
-        catch(Exception e1) {}
-        try  { if (null != stmt) stmt.close(); }
-        catch(Exception e1) { }
-        try  {
-          if (null != con) m_ConnectionPool.releaseConnectionOnError(con);
-        } catch(Exception e1) { }
-
-        // Re throw the error so the process can handle the error
-        // normally
-        throw e;
-      }
-
-      if (DEBUG) System.out.println("..creatingSQLDocument");
-
-      DTMManager mgr =
-        ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
-      mgrDefault = (DTMManagerDefault) mgr;
-      int dtmIdent = mgrDefault.getFirstFreeDTMID();
-
-      doc =
-        new SQLDocument(
-          mgr, dtmIdent << DTMManager.IDENT_DTM_NODE_BITS ,
-          m_ConnectionPool, con, stmt, rs, m_IsStreamingEnabled);
-
-      if (null != doc)
-      {
-        if (DEBUG) System.out.println("..returning Document");
-
-        // Register our document
-        mgrDefault.addDTM(doc, dtmIdent);
-
-        // also keep a local reference
-        m_OpenSQLDocuments.addElement(doc);
-        return doc;
-      }
-      else
-      {
-        return null;
-      }
-    }
-    catch(SQLException e)
-    {
-      if ((doc != null) && (mgrDefault != null))
-      {
-        doc.closeOnError();
-        mgrDefault.release(doc, true);
-      }
-      buildErrorDocument(exprContext, e);
-      return null;
-    }
-    catch (Exception e)
-    {
-      if ((doc != null) && (mgrDefault != null))
-      {
-        doc.closeOnError();
-        mgrDefault.release(doc, true);
-      }
-
-      if (DEBUG) System.out.println("exception in query()");
-      buildErrorDocument(exprContext, e);
-      return null;
-    }
-    finally
-    {
-      if (DEBUG) System.out.println("leaving query()");
-    }
-  }
-
-  /**
-   * Execute a parameterized query statement by instantiating an
-   * @param exprContext
-   * @param queryString the SQL query.
-   * @return XStatement implements NodeIterator.
-   * @throws SQLException
-   * @link org.apache.xalan.lib.sql.XStatement XStatement}
-   * object. The XStatement executes the query, and uses the result set
-   * to create a
-   * @link org.apache.xalan.lib.sql.RowSet RowSet},
-   * a row-set element.
-   */
-  public DTM pquery( ExpressionContext exprContext, String queryString )
-  {
-    Connection con = null;
-    PreparedStatement stmt = null;
-    ResultSet rs = null;
-
-    try
-    {
-      int indx;
-
-      try
-      {
-        con = m_ConnectionPool.getConnection();
-        stmt = con.prepareStatement(queryString);
-      }
-      catch(SQLException e)
-      {
-        // We have not created a document yet, so lets close the
-        // connection ourselves then let the process deal with the
-        // error.
-        //
-        try { if (null != stmt) stmt.close(); }
-        catch(Exception e1) { }
-        try {
-          if (null != con) m_ConnectionPool.releaseConnectionOnError(con);
-        }  catch(Exception e1) {}
-
-        // Re throw the error so the process can handle the error
-        // normally
-        throw e;
-      }
-
-      if (DEBUG) System.out.println("..building Prepared Statement");
-
-      try
-      {
-        Enumeration enum = m_ParameterList.elements();
-        indx = 1;
-        while (enum.hasMoreElements())
-        {
-          QueryParameter qp = (QueryParameter) enum.nextElement();
-          setParameter(indx, stmt, qp);
-          indx++;
-        }
-
-        rs = stmt.executeQuery();
-      }
-      catch(SQLException e)
-      {
-        // We have not created a document yet, so lets close the
-        // connection ourselves then let the process deal with the
-        // error.
-        //
-        try { if (null != rs) rs.close();  }
-        catch(Exception e1) {  }
-        try { if (null != stmt) stmt.close(); }
-        catch(Exception e1) {  }
-        try  {
-          if (null != con) m_ConnectionPool.releaseConnectionOnError(con);
-        } catch(Exception e1) { }
-
-        // Re throw the error so the process can handle the error
-        // normally
-        throw e;
-      }
-
-      if (DEBUG) System.out.println("..creatingSQLDocument");
-
-      DTMManager mgr =
-        ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
-      DTMManagerDefault mgrDefault = (DTMManagerDefault) mgr;
-      int dtmIdent = mgrDefault.getFirstFreeDTMID();
-
-      SQLDocument doc =
-        new SQLDocument(mgr, dtmIdent << DTMManager.IDENT_DTM_NODE_BITS,
-        m_ConnectionPool, con, stmt, rs, m_IsStreamingEnabled);
-
-      if (null != doc)
-      {
-        if (DEBUG) System.out.println("..returning Document");
-
-        // Register our document
-        mgrDefault.addDTM(doc, dtmIdent);
-
-        // also keep a local reference
-        m_OpenSQLDocuments.addElement(doc);
-        return doc;
-      }
-      else
-      {
-        // Build Error Doc, BAD Result Set
-        return null;
-      }
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return null;
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return null;
-    }
-  }
-
-
-  /**
-   * Execute a parameterized query statement by instantiating an
-   * @param exprContext
-   * @param queryString the SQL query.
-   * @param typeInfo
-   * @return XStatement implements NodeIterator.
-   * @throws SQLException
-   * @link org.apache.xalan.lib.sql.XStatement XStatement}
-   * object. The XStatement executes the query, and uses the result set
-   * to create a
-   * @link org.apache.xalan.lib.sql.RowSet RowSet},
-   * a row-set element.
-   * This method allows for the user to pass in a comma seperated
-   * String that represents a list of parameter types. If supplied
-   * the parameter types will be used to overload the current types
-   * in the current parameter list.
-   */
-  public DTM pquery( ExpressionContext exprContext, String queryString, String typeInfo )
-  {
-    Connection con = null;
-    PreparedStatement stmt = null;
-    ResultSet rs = null;
-
-    try
-    {
-      int indx;
-
-      // Parse up the parameter types that were defined
-      // with the query
-      StringTokenizer plist = new StringTokenizer(typeInfo);
-
-      // Override the existing type that is stored in the
-      // parameter list. If there are more types than parameters
-      // ignore for now, a more meaningfull error should occur
-      // when the actual query is executed.
-      indx = 0;
-      while (plist.hasMoreTokens())
-      {
-        String value = plist.nextToken();
-        QueryParameter qp = (QueryParameter) m_ParameterList.elementAt(indx);
-        if ( null != qp )
-        {
-          qp.setType(value);
-        }
-
-        indx++;
-      }
-
-      try
-      {
-        con = m_ConnectionPool.getConnection();
-        stmt = con.prepareStatement(queryString);
-      }
-      catch(SQLException e)
-      {
-        // We have not created a document yet, so lets close the
-        // connection ourselves then let the process deal with the
-        // error.
-        //
-        try { if (null != stmt) stmt.close(); }
-        catch(Exception e1) { }
-        try {
-          if (null != con) m_ConnectionPool.releaseConnectionOnError(con);
-        } catch(Exception e1) { }
-
-        // Re throw the error so the process can handle the error
-        // normally
-        throw e;
-      }
-
-
-
-      if (DEBUG) System.out.println("..building Prepared Statement");
-
-      try
-      {
-        Enumeration enum = m_ParameterList.elements();
-        indx = 1;
-        while (enum.hasMoreElements())
-        {
-          QueryParameter qp = (QueryParameter) enum.nextElement();
-          setParameter(indx, stmt, qp);
-          indx++;
-        }
-
-        rs = stmt.executeQuery();
-      }
-      catch(SQLException e)
-      {
-        // We have not created a document yet, so lets close the
-        // connection ourselves then let the process deal with the
-        // error.
-        //
-        try { if (null != rs) rs.close(); }
-        catch(Exception e1) { /* Empty */ }
-        try { if (null != stmt) stmt.close(); }
-        catch(Exception e1) { /* Empty */  }
-        try {
-          if (null != con) m_ConnectionPool.releaseConnectionOnError(con);
-        } catch(Exception e1) { /* Empty */ }
-
-        // Re throw the error so the process can handle the error
-        // normally
-        throw e;
-      }
-
-
-      if (DEBUG) System.out.println("..creatingSQLDocument");
-
-      DTMManager mgr =
-        ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
-      DTMManagerDefault mgrDefault = (DTMManagerDefault) mgr;
-      int dtmIdent = mgrDefault.getFirstFreeDTMID();
-
-      SQLDocument doc =
-        new SQLDocument(mgr, dtmIdent << DTMManager.IDENT_DTM_NODE_BITS ,
-        m_ConnectionPool, con, stmt, rs, m_IsStreamingEnabled);
-
-      if (null != doc)
-      {
-        if (DEBUG) System.out.println("..returning Document");
-
-        // Register our document
-        mgrDefault.addDTM(doc, dtmIdent);
-
-        // also keep a local reference
-        m_OpenSQLDocuments.addElement(doc);
-        return doc;
-      }
-      else
-      {
-        // Build Error Doc, BAD Result Set
-        return null;
-      }
-    }
-    catch(SQLException e)
-    {
-      buildErrorDocument(exprContext, e);
-      return null;
-    }
-    catch (Exception e)
-    {
-      buildErrorDocument(exprContext, e);
-      return null;
-    }
-  }
-
-  /**
-   * Add an untyped value to the parameter list.
-   * @param value
-   * @return
-   */
-  public void addParameter( String value )
-  {
-    addParameterWithType(value, null);
-  }
-
-  /**
-   * Add a typed parameter to the parameter list.
-   * @param value
-   * @param Type
-   * @return
-   */
-  public void addParameterWithType( String value, String Type )
-  {
-    m_ParameterList.addElement( new QueryParameter(value, Type) );
-  }
-
-
-  /**
-   * Add a single parameter to the parameter list
-   * formatted as an Element
-   * @param e
-   * @return
-   */
-  public void addParameterFromElement( Element e )
-  {
-    NamedNodeMap attrs = e.getAttributes();
-    Node Type = attrs.getNamedItem("type");
-    Node n1  = e.getFirstChild();
-    if (null != n1)
-    {
-      String value = n1.getNodeValue();
-      if (value == null) value = "";
-      m_ParameterList.addElement( new QueryParameter(value, Type.getNodeValue()) );
-    }
-  }
-
-
-  /**
-   * Add a section of parameters to the Parameter List
-   * Do each element from the list
-   * @param nl
-   * @return
-   */
-  public void addParameterFromElement( NodeList nl )
-  {
-    //
-    // Each child of the NodeList represents a node
-    // match from the select= statment. Process each
-    // of them as a seperate list.
-    // The XML Format is as follows
-    //
-    // <START-TAG>
-    //   <TAG1 type="int">value</TAG1>
-    //   <TAGA type="int">value</TAGA>
-    //   <TAG2 type="string">value</TAG2>
-    // </START-TAG>
-    //
-    // The XSL to process this is formatted as follows
-    // <xsl:param name="plist" select="//START-TAG" />
-    // <sql:addParameter( $plist );
-    //
-    int count = nl.getLength();
-    for (int x=0; x<count; x++)
-    {
-      addParameters( (Element) nl.item(x));
-    }
-  }
-
-  /**
-   * @param elem
-   * @return
-   */
-  private void addParameters( Element elem )
-  {
-    //
-    // Process all of the Child Elements
-    // The format is as follows
-    //
-    //<TAG type ="typeid">value</TAG>
-    //<TAG1 type ="typeid">value</TAG1>
-    //<TAGA type ="typeid">value</TAGA>
-    //
-    // The name of the Node is not important just is value
-    // and if it contains a type attribute
-
-    Node n = elem.getFirstChild();
-
-    if (null == n) return;
-
-    do
-    {
-      if (n.getNodeType() == Node.ELEMENT_NODE)
-      {
-        NamedNodeMap attrs = n.getAttributes();
-        Node Type = attrs.getNamedItem("type");
-        String TypeStr;
-
-        if (Type == null) TypeStr = "string";
-        else TypeStr = Type.getNodeValue();
-
-        Node n1  = n.getFirstChild();
-        if (null != n1)
-        {
-          String value = n1.getNodeValue();
-          if (value == null) value = "";
-
-
-          m_ParameterList.addElement(
-            new QueryParameter(value, TypeStr) );
-        }
-      }
-    } while ( (n = n.getNextSibling()) != null);
-  }
-
-  /**
-   * @return
-   */
-  public void clearParameters( )
-  {
-    m_ParameterList.removeAllElements();
-  }
-
-  /**
-   * There is a problem with some JDBC drivers when a Connection
-   * is open and the JVM shutsdown. If there is a problem, there
-   * is no way to control the currently open connections in the
-   * pool. So for the default connection pool, the actuall pooling
-   * mechinsm is disabled by default. The Stylesheet designer can
-   * re-enabled pooling to take advantage of connection pools.
-   * The connection pool can even be disabled which will close all
-   * outstanding connections.
-   * @return
-   */
-  public void enableDefaultConnectionPool( )
-  {
-
-    if (DEBUG)
-      System.out.println("Enabling Default Connection Pool");
-
-    m_DefaultPoolingEnabled = true;
-
-    if (m_ConnectionPool == null) return;
-    if (m_IsDefaultPool) return;
-
-    m_ConnectionPool.setPoolEnabled(true);
-
-  }
-
-  /**
-   * See enableDefaultConnectionPool
-   * @return
-   */
-  public void disableDefaultConnectionPool( )
-  {
-    if (DEBUG)
-      System.out.println("Disabling Default Connection Pool");
-
-    m_DefaultPoolingEnabled = false;
-
-    if (m_ConnectionPool == null) return;
-    if (!m_IsDefaultPool) return;
-
-    m_ConnectionPool.setPoolEnabled(false);
-  }
-
-
-  /**
-   * Control how the SQL Document uses memory. In Streaming Mode,
-   * memory consumption is greatly reduces so you can have queries
-   * of unlimited size but it will not let you traverse the data
-   * more than once.
-   * @return
-   */
-  public void enableStreamingMode( )
-  {
-
-    if (DEBUG)
-      System.out.println("Enabling Streaming Mode");
-
-    m_IsStreamingEnabled = true;
-  }
-
-  /**
-   * Control how the SQL Document uses memory. In Streaming Mode,
-   * memory consumption is greatly reduces so you can have queries
-   * of unlimited size but it will not let you traverse the data
-   * more than once.
-   * @return
-   */
-  public void disableStreamingMode( )
-  {
-
-    if (DEBUG)
-      System.out.println("Disable Streaming Mode");
-
-    m_IsStreamingEnabled = false;
-  }
-
-  /**
-   * Provide access to the last error that occued. This error
-   * may be over written when the next operation occurs.
-   * @return
-   */
-  public DTM getError( )
-  {
-    return m_Error;
-  }
-
-  /**
-   * Close the connection to the data source.
-   * @return
-   * @throws SQLException
-   */
-  public void close( )throws SQLException
-  {
-
-    if (DEBUG)
-      System.out.println("Entering XConnection.close");
-
-    //
-    // This function is included just for Legacy support
-    // If it is really called then we must me using a single
-    // document interface, so close all open documents.
-    while(m_OpenSQLDocuments.size() != 0)
-    {
-      SQLDocument d = (SQLDocument) m_OpenSQLDocuments.elementAt(0);
-      d.close();
-      m_OpenSQLDocuments.removeElementAt(0);
-    }
-
-    if (DEBUG)
-      System.out.println("Exiting XConnection.close");
-
-  }
-
-  /**
-   * Close the connection to the data source. Only close the connections
-   * for a single document.
-   * @param sqldoc
-   * @return
-   * @throws SQLException
-   */
-  public void close( SQLDocument sqldoc )throws SQLException
-  {
-    if (DEBUG)
-      System.out.println("Entering XConnection.close");
-
-    int size = m_OpenSQLDocuments.size();
-
-    for(int x=0; x<size; x++)
-    {
-      SQLDocument d = (SQLDocument) m_OpenSQLDocuments.elementAt(x);
-      if (d == sqldoc)
-      {
-        d.close();
-        m_OpenSQLDocuments.removeElementAt(x);
-      }
-    }
-  }
-
-  /**
-   * Set the parameter for a Prepared Statement
-   * @param pos
-   * @param stmt
-   * @param p
-   * @return
-   * @throws SQLException
-   */
-  public void setParameter( int pos, PreparedStatement stmt, QueryParameter p )throws SQLException
-  {
-    String type = p.getType();
-    if (type.equalsIgnoreCase("string"))
-    {
-      stmt.setString(pos, p.getValue());
-    }
-
-    if (type.equalsIgnoreCase("bigdecimal"))
-    {
-      stmt.setBigDecimal(pos, new BigDecimal(p.getValue()));
-    }
-
-    if (type.equalsIgnoreCase("boolean"))
-    {
-      Integer i = new Integer( p.getValue() );
-      boolean b = ((i.intValue() != 0) ? false : true);
-      stmt.setBoolean(pos, b);
-    }
-
-    if (type.equalsIgnoreCase("bytes"))
-    {
-      stmt.setBytes(pos, p.getValue().getBytes());
-    }
-
-    if (type.equalsIgnoreCase("date"))
-    {
-      stmt.setDate(pos, Date.valueOf(p.getValue()));
-    }
-
-    if (type.equalsIgnoreCase("double"))
-    {
-      Double d = new Double(p.getValue());
-      stmt.setDouble(pos, d.doubleValue() );
-    }
-
-    if (type.equalsIgnoreCase("float"))
-    {
-      Float f = new Float(p.getValue());
-      stmt.setFloat(pos, f.floatValue());
-    }
-
-    if (type.equalsIgnoreCase("long"))
-    {
-      Long l = new Long(p.getValue());
-      stmt.setLong(pos, l.longValue());
-    }
-
-    if (type.equalsIgnoreCase("short"))
-    {
-      Short s = new Short(p.getValue());
-      stmt.setShort(pos, s.shortValue());
-    }
-
-    if (type.equalsIgnoreCase("time"))
-    {
-      stmt.setTime(pos, Time.valueOf(p.getValue()) );
-    }
-
-    if (type.equalsIgnoreCase("timestamp"))
-    {
-
-      stmt.setTimestamp(pos, Timestamp.valueOf(p.getValue()) );
-    }
-
-  }
-
-  /**
-   * @param exprContext
-   * @param excp
-   * @return
-   */
-  private void buildErrorDocument( ExpressionContext exprContext, SQLException excp )
-  {
-    try
-    {
-      DTMManager mgr =
-        ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
-      DTMManagerDefault mgrDefault = (DTMManagerDefault) mgr;
-      int dtmIdent = mgrDefault.getFirstFreeDTMID();
-
-      m_Error = new SQLErrorDocument(mgr, dtmIdent << DTMManager.IDENT_DTM_NODE_BITS, excp);
-
-      // Register our document
-      mgrDefault.addDTM(m_Error, dtmIdent);
-
-    }
-    catch(Exception e)
-    {
-      m_Error = null;
-    }
-  }
-
-  /**
-   * @param exprContext
-   * @param excp
-   * @return
-   */
-  private void buildErrorDocument( ExpressionContext exprContext, Exception excp )
-  {
-    try
-    {
-      DTMManager mgr =
-        ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
-      DTMManagerDefault mgrDefault = (DTMManagerDefault) mgr;
-      int dtmIdent = mgrDefault.getFirstFreeDTMID();
-
-      m_Error = new SQLErrorDocument(mgr, dtmIdent<<DTMManager.IDENT_DTM_NODE_BITS, excp);
-
-      // Register our document
-      mgrDefault.addDTM(m_Error, dtmIdent);
-
-    }
-    catch(Exception e)
-    {
-      m_Error = null;
-    }
-  }
-
-  /**
-   * @return
-   */
-  protected void finalize( )
-  {
-    if (DEBUG) System.out.println("In XConnection, finalize");
-    try
-    {
-      close();
-    }
-    catch(Exception e)
-    {
-      // Empty We are final Anyway
-    }
-  }
-
-}
diff --git a/src/org/apache/xalan/lib/sql/package.html b/src/org/apache/xalan/lib/sql/package.html
deleted file mode 100644
index 7d6c3de..0000000
--- a/src/org/apache/xalan/lib/sql/package.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<html>
-  <title>Xalan SQL Extension</title>
-  <body>
-    <p><em>**Experimental**</em> Provides extension functions for connecting to a JDBC data source, executing a query,
-    and working incrementally through "streamable" result set.<p>
-   <p><em>The SQL extension use of a single row-set node to incrementally return a query result set is experimental. Keep in mind that you
-   can only access row elements one at a time moving forward through the result set. The use of XPath expressions in your stylesheet, for
-   example, that attempt to return nodes from the result set in any other manner may produce unpredictable results.</em></p>    
-    <p>XConnection provides three extension functions that you can use in your stylesheet.</p>
-    <ol>
-      <li><p>new() -- Use one of the XConnection constructors to connect to a data source, and return an XConnection
-       object.</p></li>
-      <li><p>query() -- Use the XConnection object query() method to return a "streamable" result set in the form of a row-set
-       node. Work your way through the row-set one row at a time. The same row element is used over and over again, so you can
-       begin "transforming" the row-set before the entire result set has been returned.</p></li>
-      <li>close() -- Use the XConnection object close() method to terminate the connection.</li>      
-    </ol>
-    <p>The query() extension function returns a Document node that contains (as needed) an array of column-header elements, 
-    a single row element that is used repeatedly, and an array of col elements. Each column-header element (one per column in the
-    row-set) contains an attribute (ColumnAttribute) for each of the column descriptors in the ResultSetMetaData object. 
-    Each col element contains a text node with a textual representation of the value for that column in the current row.</p>
-    <h2>Example</h2>
-    <p>This example displays the result set from a table in a sample InstantDB database.</p>
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql"&gt;
-  &lt;xsl:output method="html" indent="yes"/&gt;
-  &lt;xsl:param name="query" select="'SELECT * FROM import1'"/&gt;
- 
-  &lt;xsl:template match="/"&gt;
-    &lt;!-- 1. Make the connection --&gt;
-    &lt;xsl:variable name="products"
-                  select="sql:new('org.enhydra.instantdb.jdbc.idbDriver',
-                                'jdbc:idb:D:\instantdb\Examples\sample.prp')"/&gt;
-    &lt;HTML&gt;
-      &lt;HEAD&gt;
-      &lt;/HEAD&gt;
-      &lt;BODY&gt;
-        &lt;TABLE border="1"&gt;
-        &lt;!--2. Execute the query --&gt;
-        &lt;xsl:variable name="table" select='sql:query($products, $query)'/&gt;
-          &lt;TR&gt;
-          &lt;!-- Get column-label attribute from each column-header--&gt;
-          &lt;xsl:for-each select="$table/row-set/column-header"&gt;
-            &lt;TH&gt;&lt;xsl:value-of select="@column-label"/&gt;&lt;/TH&gt;
-          &lt;/xsl:for-each&gt;
-          &lt;/TR&gt;
-          &lt;xsl:apply-templates select="$table/row-set/row"/&gt;
-          &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
-        &lt;/TABLE&gt;
-      &lt;/BODY&gt;
-    &lt;/HTML&gt; 
-    &lt;!-- 3. Close the connection --&gt;
-    &lt;xsl:value-of select="sql:close($products)"/&gt;
-  &lt;/xsl:template&gt;
-
-  &lt;xsl:template match="row"&gt;
-        &lt;TR&gt;
-          &lt;xsl:apply-templates select="col"/&gt;
-        &lt;/TR&gt;
-  &lt;/xsl:template&gt;
-
-  &lt;xsl:template match="col"&gt;
-    &lt;TD&gt;
-      &lt;!-- Here is the column data -->
-      &lt;xsl:value-of select="text()"/>
-    &lt;/TD>
-  &lt;/xsl:template>
-
-&lt;/xsl:stylesheet&gt;
-</pre>    
- </body>
-</html>
\ No newline at end of file
diff --git a/src/org/apache/xalan/processor/ProcessorAttributeSet.java b/src/org/apache/xalan/processor/ProcessorAttributeSet.java
deleted file mode 100644
index ead3a9f..0000000
--- a/src/org/apache/xalan/processor/ProcessorAttributeSet.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemAttributeSet;
-import org.apache.xalan.templates.ElemTemplateElement;
-
-import org.xml.sax.Attributes;
-import javax.xml.transform.TransformerException;
-
-/**
- * This class processes parse events for an xsl:attribute-set.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
- */
-class ProcessorAttributeSet extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of an xsl:attribute-set element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   * 
-   * @see org.apache.xalan.processor.StylesheetHandler#startElement
-   * @see org.xml.sax.ContentHandler#startElement
-   * @see org.xml.sax.ContentHandler#endElement
-   * @see org.xml.sax.Attributes
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    ElemAttributeSet eat = new ElemAttributeSet();
-
-    eat.setLocaterInfo(handler.getLocator());
-    try
-    {
-      eat.setPrefixes(handler.getNamespaceSupport());
-    }
-    catch(TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-
-    eat.setDOMBackPointer(handler.getOriginatingNode());
-    setPropertiesFromAttributes(handler, rawName, attributes, eat);
-    handler.getStylesheet().setAttributeSet(eat);
-
-    // handler.pushElemTemplateElement(eat);
-    ElemTemplateElement parent = handler.getElemTemplateElement();
-
-    parent.appendChild(eat);
-    handler.pushElemTemplateElement(eat);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-    handler.popElemTemplateElement();
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorCharacters.java b/src/org/apache/xalan/processor/ProcessorCharacters.java
deleted file mode 100644
index 551fdec..0000000
--- a/src/org/apache/xalan/processor/ProcessorCharacters.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import java.lang.StringBuffer;
-import org.w3c.dom.Node;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xalan.templates.ElemText;
-import org.apache.xalan.templates.ElemTextLiteral;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.Constants;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-
-/**
- * This class processes character events for a XSLT template element.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-the-Result-Tree">section-Creating-the-Result-Tree in XSLT Specification</a>
- */
-public class ProcessorCharacters extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of the non-text event.  This
-   * is sent to the current processor when any non-text event occurs.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   */
-  public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException
-  {
-    if (this == handler.getCurrentProcessor())
-    {
-      handler.popProcessor();
-    }
-
-    int nChars = m_accumulator.length();
-
-    if ((nChars > 0)
-            && ((null != m_xslTextElement)
-                ||!XMLCharacterRecognizer.isWhiteSpace(m_accumulator)) 
-                || handler.isSpacePreserve())
-    {
-      ElemTextLiteral elem = new ElemTextLiteral();
-
-      elem.setDOMBackPointer(m_firstBackPointer);
-      elem.setLocaterInfo(handler.getLocator());
-      try
-      {
-        elem.setPrefixes(handler.getNamespaceSupport());
-      }
-      catch(TransformerException te)
-      {
-        throw new org.xml.sax.SAXException(te);
-      }
-
-      boolean doe = (null != m_xslTextElement)
-                    ? m_xslTextElement.getDisableOutputEscaping() : false;
-
-      elem.setDisableOutputEscaping(doe);
-      elem.setPreserveSpace(true);
-
-      char[] chars = new char[nChars];
-
-      m_accumulator.getChars(0, nChars, chars, 0);
-      elem.setChars(chars);
-
-      ElemTemplateElement parent = handler.getElemTemplateElement();
-
-      parent.appendChild(elem);
-    }
-
-    m_accumulator.setLength(0);
-    m_firstBackPointer = null;
-  }
-  
-  protected Node m_firstBackPointer = null;
-
-  /**
-   * Receive notification of character data inside an element.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param ch The characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#characters
-   */
-  public void characters(
-          StylesheetHandler handler, char ch[], int start, int length)
-            throws org.xml.sax.SAXException
-  {
-
-    m_accumulator.append(ch, start, length);
-    
-    if(null == m_firstBackPointer)
-      m_firstBackPointer = handler.getOriginatingNode();
-
-    // Catch all events until a non-character event.
-    if (this != handler.getCurrentProcessor())
-      handler.pushProcessor(this);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param atts The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   * @see org.apache.xalan.processor.StylesheetHandler#startElement
-   * @see org.apache.xalan.processor.StylesheetHandler#endElement
-   * @see org.xml.sax.ContentHandler#startElement
-   * @see org.xml.sax.ContentHandler#endElement
-   * @see org.xml.sax.Attributes
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-
-    // Since this has been installed as the current processor, we 
-    // may get and end element event, in which case, we pop and clear 
-    // and then call the real element processor.
-    startNonText(handler);
-    handler.getCurrentProcessor().endElement(handler, uri, localName,
-                                             rawName);
-    handler.popProcessor();
-  }
-
-  /**
-   * Accumulate characters, until a non-whitespace event has
-   * occured.
-   */
-  private StringBuffer m_accumulator = new StringBuffer();
-
-  /**
-   * The xsl:text processor will call this to set a
-   * preserve space state.
-   */
-  private ElemText m_xslTextElement;
-
-  /**
-   * Set the current setXslTextElement. The xsl:text 
-   * processor will call this to set a preserve space state.
-   *
-   * @param xslTextElement The current xslTextElement that 
-   *                       is preserving state, or null.
-   */
-  void setXslTextElement(ElemText xslTextElement)
-  {
-    m_xslTextElement = xslTextElement;
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorDecimalFormat.java b/src/org/apache/xalan/processor/ProcessorDecimalFormat.java
deleted file mode 100644
index 88236fe..0000000
--- a/src/org/apache/xalan/processor/ProcessorDecimalFormat.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.DecimalFormatProperties;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-/**
- * <meta name="usage" content="internal"/>
- * Process xsl:decimal-format by creating a DecimalFormatProperties 
- * object and passing it to the stylesheet.
- * 
- * @see org.apache.xalan.templates.Stylesheet#setDecimalFormat
- * @see org.apache.xalan.templates.DecimalFormatProperties
- * @see <a href="http://www.w3.org/TR/xslt#format-number">format-number in XSLT Specification</a>
- */
-class ProcessorDecimalFormat extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   * @see org.apache.xalan.processor.StylesheetHandler#startElement
-   * @see org.apache.xalan.processor.StylesheetHandler#endElement
-   * @see org.xml.sax.ContentHandler#startElement
-   * @see org.xml.sax.ContentHandler#endElement
-   * @see org.xml.sax.Attributes
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    DecimalFormatProperties dfp = new DecimalFormatProperties(handler.nextUid());
-
-    setPropertiesFromAttributes(handler, rawName, attributes, dfp);
-    handler.getStylesheet().setDecimalFormat(dfp);
-    
-    handler.getStylesheet().appendChild(dfp);
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java b/src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java
deleted file mode 100644
index 9189e29..0000000
--- a/src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemParam;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-/**
- * This class processes parse events for an xsl:param element.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
- */
-class ProcessorGlobalParamDecl extends ProcessorTemplateElem
-{
-
-  /**
-   * Append the current template element to the current
-   * template element, and then push it onto the current template
-   * element stack.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param elem The non-null reference to the ElemParam element.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  protected void appendAndPush(
-          StylesheetHandler handler, ElemTemplateElement elem)
-            throws org.xml.sax.SAXException
-  {
-
-    // Just push, but don't append.
-    handler.pushElemTemplateElement(elem);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-
-    ElemParam v = (ElemParam) handler.getElemTemplateElement();
-
-    handler.getStylesheet().appendChild(v);
-    handler.getStylesheet().setParam(v);
-    super.endElement(handler, uri, localName, rawName);
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java b/src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java
deleted file mode 100644
index fd11536..0000000
--- a/src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemVariable;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-/**
- * This class processes parse events for an xsl:variable element.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
- */
-class ProcessorGlobalVariableDecl extends ProcessorTemplateElem
-{
-
-  /**
-   * Append the current template element to the current
-   * template element, and then push it onto the current template
-   * element stack.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param elem The non-null reference to the ElemVariable element.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  protected void appendAndPush(
-          StylesheetHandler handler, ElemTemplateElement elem)
-            throws org.xml.sax.SAXException
-  {
-
-    // Just push, but don't append.
-    handler.pushElemTemplateElement(elem);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-
-    ElemVariable v = (ElemVariable) handler.getElemTemplateElement();
-
-    handler.getStylesheet().appendChild(v);
-    handler.getStylesheet().setVariable(v);
-    super.endElement(handler, uri, localName, rawName);
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorImport.java b/src/org/apache/xalan/processor/ProcessorImport.java
deleted file mode 100644
index d5fb1b7..0000000
--- a/src/org/apache/xalan/processor/ProcessorImport.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.StylesheetComposed;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-
-import java.net.URL;
-
-import java.io.IOException;
-
-import javax.xml.transform.URIResolver;
-
-import org.w3c.dom.Node;
-
-/**
- * This class processes parse events for an xsl:import element.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
- */
-class ProcessorImport extends ProcessorInclude
-{
-
-  /**
-   * Get the stylesheet type associated with an imported stylesheet
-   *
-   * @return the type of the stylesheet
-   */
-  protected int getStylesheetType()
-  {
-    return StylesheetHandler.STYPE_IMPORT;
-  }
-
-  /**
-   * Get the error number associated with this type of stylesheet importing itself
-   *
-   * @return the appropriate error number
-   */
-  protected int getStylesheetInclErr()
-  {
-    return XSLTErrorResources.ER_IMPORTING_ITSELF;
-  }
-
-}
diff --git a/src/org/apache/xalan/processor/ProcessorInclude.java b/src/org/apache/xalan/processor/ProcessorInclude.java
deleted file mode 100644
index 8d41035..0000000
--- a/src/org/apache/xalan/processor/ProcessorInclude.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-import org.xml.sax.XMLReader;
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-
-import java.net.URL;
-
-import java.io.IOException;
-
-import org.xml.sax.helpers.XMLReaderFactory;
-
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Node;
-
-import org.apache.xml.utils.SystemIDResolver;
-
-/**
- * TransformerFactory class for xsl:include markup.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#include">include in XSLT Specification</a>
- */
-class ProcessorInclude extends XSLTElementProcessor
-{
-
-  /**
-   * The base URL of the XSL document.
-   * @serial
-   */
-  private String m_href = null;
-
-  /**
-   * Get the base identifier with which this stylesheet is associated.
-   *
-   * @return non-null reference to the href attribute string, or 
-   *         null if setHref has not been called.
-   */
-  public String getHref()
-  {
-    return m_href;
-  }
-
-  /**
-   * Get the base identifier with which this stylesheet is associated.
-   *
-   * @param baseIdent Should be a non-null reference to a valid URL string.
-   */
-  public void setHref(String baseIdent)
-  {
-    // Validate?
-    m_href = baseIdent;
-  }
-
-  /**
-   * Get the stylesheet type associated with an included stylesheet
-   *
-   * @return the type of the stylesheet
-   */
-  protected int getStylesheetType()
-  {
-    return StylesheetHandler.STYPE_INCLUDE;
-  }
-
-  /**
-   * Get the error number associated with this type of stylesheet including itself
-   *
-   * @return the appropriate error number
-   */
-  protected int getStylesheetInclErr()
-  {
-    return XSLTErrorResources.ER_STYLESHEET_INCLUDES_ITSELF;
-  }
-
-  /**
-   * Receive notification of the start of an xsl:include element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-
-    setPropertiesFromAttributes(handler, rawName, attributes, this);
-
-    String hrefUrl = getHref();
-
-    if (handler.importStackContains(hrefUrl))
-    {
-      throw new org.xml.sax.SAXException(
-        XSLMessages.createMessage(
-          getStylesheetInclErr(), new Object[]{ hrefUrl }));  //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!");
-    }
-
-    handler.pushImportURL(hrefUrl);
-
-    int savedStylesheetType = handler.getStylesheetType();
-
-    handler.setStylesheetType(this.getStylesheetType());
-    handler.pushNewNamespaceSupport();
-
-    try
-    {
-      parse(handler, uri, localName, rawName, attributes);
-    }
-    finally
-    {
-      handler.setStylesheetType(savedStylesheetType);
-      handler.popImportURL();
-      handler.popNamespaceSupport();
-    }
-  }
-
-  /**
-   * Set off a new parse for an included or imported stylesheet.  This will 
-   * set the {@link StylesheetHandler} to a new state, and recurse in with 
-   * a new set of parse events.  Once this function returns, the state of 
-   * the StylesheetHandler should be restored.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, which should be the XSLT namespace.
-   * @param localName The local name (without prefix), which should be "include" or "import".
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The list of attributes on the xsl:include or xsl:import element.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  protected void parse(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-    TransformerFactoryImpl processor = handler.getStylesheetProcessor();
-    URIResolver uriresolver = processor.getURIResolver();
-
-    try
-    {
-      Source source = null;
-
-      if (null != uriresolver)
-      {
-        source = uriresolver.resolve(getHref(),
-                                     handler.getBaseIdentifier());
-
-        if (null != source && source instanceof DOMSource)
-        {
-          Node node = ((DOMSource)source).getNode();
-          TreeWalker walker = new TreeWalker(handler, new org.apache.xpath.DOM2Helper(), source.getSystemId());
-
-          try
-          {
-            walker.traverse(node);
-          }
-          catch(org.xml.sax.SAXException se)
-          {
-            throw new TransformerException(se);
-          }
-          return;
-        }
-      }
-      
-      if(null == source)
-      {
-        String absURL = SystemIDResolver.getAbsoluteURI(getHref(),
-                          handler.getBaseIdentifier());
-
-        source = new StreamSource(absURL);
-      }
-      
-      XMLReader reader = null;
-      
-      if(source instanceof SAXSource)
-      {
-        SAXSource saxSource = (SAXSource)source;
-        reader = saxSource.getXMLReader(); // may be null
-      }
-      
-      boolean isUserReader = (reader != null);
-      
-      InputSource inputSource = SAXSource.sourceToInputSource(source);
-
-      if (null == reader)
-      {  
-        // Use JAXP1.1 ( if possible )
-        try {
-          javax.xml.parsers.SAXParserFactory factory=
-                                                     javax.xml.parsers.SAXParserFactory.newInstance();
-          factory.setNamespaceAware( true );
-          javax.xml.parsers.SAXParser jaxpParser=
-                                                 factory.newSAXParser();
-          reader=jaxpParser.getXMLReader();
-          
-        } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-          throw new org.xml.sax.SAXException( ex );
-        } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-            throw new org.xml.sax.SAXException( ex1.toString() );
-        } 
-        catch( NoSuchMethodError ex2 ) 
-        {
-        }
-        catch (AbstractMethodError ame){}
-      }
-      if (null == reader)
-        reader = XMLReaderFactory.createXMLReader();
-
-      if (null != reader)
-      {
-        reader.setContentHandler(handler);
-        try
-        {
-          if(!isUserReader)
-            reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-                              true);
-        }
-        catch(org.xml.sax.SAXException se) {}
-        
-        handler.pushBaseIndentifier(inputSource.getSystemId());
-
-        try
-        {
-          reader.parse(inputSource);
-        }
-        finally
-        {
-          handler.popBaseIndentifier();
-        }
-      }
-    }
-    catch (IOException ioe)
-    {
-      handler.error(XSLTErrorResources.ER_IOEXCEPTION,
-                    new Object[]{ getHref() }, ioe);
-    }
-    catch(TransformerException te)
-    {
-      handler.error(te.getMessage(), te);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorKey.java b/src/org/apache/xalan/processor/ProcessorKey.java
deleted file mode 100644
index ea9158e..0000000
--- a/src/org/apache/xalan/processor/ProcessorKey.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.KeyDeclaration;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import java.util.Vector;
-
-/**
- * TransformerFactory for xsl:key markup.
- * <pre>
- * <!ELEMENT xsl:key EMPTY>
- * <!ATTLIST xsl:key
- *   name %qname; #REQUIRED
- *   match %pattern; #REQUIRED
- *   use %expr; #REQUIRED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#key">key in XSLT Specification</a>
- */
-class ProcessorKey extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of an xsl:key element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    KeyDeclaration kd = new KeyDeclaration(handler.getStylesheet(), handler.nextUid());
-
-    kd.setDOMBackPointer(handler.getOriginatingNode());
-    kd.setLocaterInfo(handler.getLocator());
-    setPropertiesFromAttributes(handler, rawName, attributes, kd);
-    handler.getStylesheet().setKey(kd);
-  }
-
-  /**
-   * Set the properties of an object from the given attribute list.
-   * @param handler The stylesheet's Content handler, needed for
-   *                error reporting.
-   * @param rawName The raw name of the owner element, needed for
-   *                error reporting.
-   * @param attributes The list of attributes.
-   * @param target The target element where the properties will be set.
-   */
-  void setPropertiesFromAttributes(
-          StylesheetHandler handler, String rawName, Attributes attributes, Object target)
-            throws org.xml.sax.SAXException
-  {
-
-    XSLTElementDef def = getElemDef();
-
-    // Keep track of which XSLTAttributeDefs have been processed, so 
-    // I can see which default values need to be set.
-    Vector processedDefs = new Vector();
-    int nAttrs = attributes.getLength();
-
-    for (int i = 0; i < nAttrs; i++)
-    {
-      String attrUri = attributes.getURI(i);
-      String attrLocalName = attributes.getLocalName(i);
-      XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName);
-
-      if (null == attrDef)
-      {
-
-        // Then barf, because this element does not allow this attribute.
-        handler.error(attributes.getQName(i)
-                      + "attribute is not allowed on the " + rawName
-                      + " element!", null);
-      }
-      else
-      {
-        String valueString = attributes.getValue(i);
-
-        if (valueString.indexOf(org.apache.xpath.compiler.Keywords.FUNC_KEY_STRING
-                                + "(") >= 0)
-          handler.error(
-            XSLMessages.createMessage(
-            XSLTErrorResources.ER_INVALID_KEY_CALL, null), null);
-
-        processedDefs.addElement(attrDef);
-        attrDef.setAttrValue(handler, attrUri, attrLocalName,
-                             attributes.getQName(i), attributes.getValue(i),
-                             target);
-      }
-    }
-
-    XSLTAttributeDef[] attrDefs = def.getAttributes();
-    int nAttrDefs = attrDefs.length;
-
-    for (int i = 0; i < nAttrDefs; i++)
-    {
-      XSLTAttributeDef attrDef = attrDefs[i];
-      String defVal = attrDef.getDefault();
-
-      if (null != defVal)
-      {
-        if (!processedDefs.contains(attrDef))
-        {
-          attrDef.setDefAttrValue(handler, target);
-        }
-      }
-
-      if (attrDef.getRequired())
-      {
-        if (!processedDefs.contains(attrDef))
-          handler.error(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName,
-                                                                   attrDef.getName() }), null);
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorLRE.java b/src/org/apache/xalan/processor/ProcessorLRE.java
deleted file mode 100644
index 8ada56b..0000000
--- a/src/org/apache/xalan/processor/ProcessorLRE.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemLiteralResult;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemExtensionCall;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.XMLNSDecl;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.XPath;
-import org.apache.xalan.templates.StylesheetRoot;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.AttributesImpl;
-
-import javax.xml.transform.TransformerConfigurationException;
-import org.apache.xml.utils.SAXSourceLocator;
-
-import java.util.Vector;
-
-/**
- * <meta name="usage" content="internal"/>
- * Processes an XSLT literal-result-element, or something that looks 
- * like one.  The actual {@link org.apache.xalan.templates.ElemTemplateElement}
- * produced may be a {@link org.apache.xalan.templates.ElemLiteralResult}, 
- * a {@link org.apache.xalan.templates.StylesheetRoot}, or a 
- * {@link org.apache.xalan.templates.ElemExtensionCall}.
- * 
- * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
- * @see org.apache.xalan.templates.ElemLiteralResult
- */
-public class ProcessorLRE extends ProcessorTemplateElem
-{
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The specified or defaulted attributes.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      ElemTemplateElement p = handler.getElemTemplateElement();
-      boolean excludeXSLDecl = false;
-      boolean isLREAsStyleSheet = false;
-
-      if (null == p)
-      {
-
-        // Literal Result Template as stylesheet.
-        XSLTElementProcessor lreProcessor = handler.popProcessor();
-        XSLTElementProcessor stylesheetProcessor =
-                                                  handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet",
-                                                                          "xsl:stylesheet");
-
-        handler.pushProcessor(lreProcessor);
-
-        Stylesheet stylesheet;
-        try
-        {
-          stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener());
-        }
-        catch(TransformerConfigurationException tfe)
-        {
-          throw new TransformerException(tfe);
-        }
-
-        // stylesheet.setDOMBackPointer(handler.getOriginatingNode());
-        // ***** Note that we're assigning an empty locator. Is this necessary?
-        SAXSourceLocator slocator = new SAXSourceLocator();
-        Locator locator = handler.getLocator();
-        if(null != locator)
-        {
-          slocator.setLineNumber(locator.getLineNumber());
-          slocator.setColumnNumber(locator.getColumnNumber());
-          slocator.setPublicId(locator.getPublicId());
-          slocator.setSystemId(locator.getSystemId());
-        }
-        stylesheet.setLocaterInfo(slocator);
-        stylesheet.setPrefixes(handler.getNamespaceSupport());
-        handler.pushStylesheet(stylesheet);
-
-        isLREAsStyleSheet = true;
-
-        AttributesImpl stylesheetAttrs = new AttributesImpl();
-        AttributesImpl lreAttrs = new AttributesImpl();
-        int n = attributes.getLength();
-
-        for (int i = 0; i < n; i++)
-        {
-          String attrLocalName = attributes.getLocalName(i);
-          String attrUri = attributes.getURI(i);
-          String value = attributes.getValue(i);
-
-          if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL))
-          {
-            stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName,
-                                         attributes.getType(i),
-                                         attributes.getValue(i));
-          }
-          else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals(
-                                                                               "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL))
-          {
-
-            // ignore
-          }
-          else
-          {
-            lreAttrs.addAttribute(attrUri, attrLocalName,
-                                  attributes.getQName(i),
-                                  attributes.getType(i),
-                                  attributes.getValue(i));
-          }
-        }
-
-        attributes = lreAttrs;
-
-        // Set properties from the attributes, but don't throw 
-        // an error if there is an attribute defined that is not 
-        // allowed on a stylesheet.
-				try{
-        stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet",
-                                                        stylesheetAttrs, stylesheet);
-				}
-				catch (Exception e)
-				{
-					// This is pretty ugly, but it will have to do for now. 
-					// This is just trying to append some text specifying that
-					// this error came from a missing or invalid XSLT namespace
-					// declaration.
-					// If someone comes up with a better solution, please feel 
-					// free to contribute it. -mm
-					String msg = e.getMessage();
-					if (stylesheet.getDeclaredPrefixes() == null || 
-						!declaredXSLNS(stylesheet))
-					{
-						msg = msg +"; " + XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null);
-						
-					}
-					//else
-						throw new org.xml.sax.SAXException(msg, e);
-				}
-        handler.pushElemTemplateElement(stylesheet);
-
-        ElemTemplate template = new ElemTemplate();
-
-        appendAndPush(handler, template);
-
-        XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, 
-             handler.getStylesheetProcessor().getErrorListener());
-
-        template.setMatch(rootMatch);
-
-        // template.setDOMBackPointer(handler.getOriginatingNode());
-        stylesheet.setTemplate(template);
-
-        p = handler.getElemTemplateElement();
-        excludeXSLDecl = true;
-      }
-
-      XSLTElementDef def = getElemDef();
-      Class classObject = def.getClassObject();
-      boolean isExtension = false;
-      boolean isComponentDecl = false;
-      boolean isUnknownTopLevel = false;
-
-      while (null != p)
-      {
-
-        // System.out.println("Checking: "+p);
-        if (p instanceof ElemLiteralResult)
-        {
-          ElemLiteralResult parentElem = (ElemLiteralResult) p;
-
-          isExtension = parentElem.containsExtensionElementURI(uri);
-        }
-        else if (p instanceof Stylesheet)
-        {
-          Stylesheet parentElem = (Stylesheet) p;
-
-          isExtension = parentElem.containsExtensionElementURI(uri);
-
-          if ((false == isExtension) && (null != uri)
-              && uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL))
-          {
-            isComponentDecl = true;
-          }
-          else
-          {
-            isUnknownTopLevel = true;
-          }
-        }
-
-        if (isExtension)
-          break;
-
-        p = p.getParentElem();
-      }
-
-      ElemTemplateElement elem = null;
-
-      try
-      {
-        if (isExtension)
-        {
-
-          // System.out.println("Creating extension(1): "+uri);
-          elem = new ElemExtensionCall();
-        }
-        else if (isComponentDecl)
-        {
-          elem = (ElemTemplateElement) classObject.newInstance();
-        }
-        else if (isUnknownTopLevel)
-        {
-
-          // TBD: Investigate, not sure about this.  -sb
-          elem = (ElemTemplateElement) classObject.newInstance();
-        }
-        else
-        {
-          elem = (ElemTemplateElement) classObject.newInstance();
-        }
-
-        elem.setDOMBackPointer(handler.getOriginatingNode());
-        elem.setLocaterInfo(handler.getLocator());
-        elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl);
-
-        if (elem instanceof ElemLiteralResult)
-        {
-          ((ElemLiteralResult) elem).setNamespace(uri);
-          ((ElemLiteralResult) elem).setLocalName(localName);
-          ((ElemLiteralResult) elem).setRawName(rawName);
-          ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet(
-                                                                    isLREAsStyleSheet);
-        }
-      }
-      catch (InstantiationException ie)
-      {
-        handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie);
-      }
-      catch (IllegalAccessException iae)
-      {
-        handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae);
-      }
-
-      setPropertiesFromAttributes(handler, rawName, attributes, elem);
-
-      // bit of a hack here...
-      if (!isExtension && (elem instanceof ElemLiteralResult))
-      {
-        isExtension =
-                     ((ElemLiteralResult) elem).containsExtensionElementURI(uri);
-
-        if (isExtension)
-        {
-
-          // System.out.println("Creating extension(2): "+uri);
-          elem = new ElemExtensionCall();
-
-          elem.setLocaterInfo(handler.getLocator());
-          elem.setPrefixes(handler.getNamespaceSupport());
-          ((ElemLiteralResult) elem).setNamespace(uri);
-          ((ElemLiteralResult) elem).setLocalName(localName);
-          ((ElemLiteralResult) elem).setRawName(rawName);
-          setPropertiesFromAttributes(handler, rawName, attributes, elem);
-        }
-      }
-
-      appendAndPush(handler, elem);
-    }
-    catch(TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-
-    ElemTemplateElement elem = handler.getElemTemplateElement();
-
-    if (elem instanceof ElemLiteralResult)
-    {
-      if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet())
-      {
-        handler.popStylesheet();
-      }
-    }
-
-    super.endElement(handler, uri, localName, rawName);
-  }
-	
-	private boolean declaredXSLNS(Stylesheet stylesheet)
-	{
-		Vector declaredPrefixes = stylesheet.getDeclaredPrefixes();
-		int n = declaredPrefixes.size();
-
-		for (int i = 0; i < n; i++)
-		{
-			XMLNSDecl decl = (XMLNSDecl) declaredPrefixes.elementAt(i);
-			if(decl.getURI().equals(Constants.S_XSLNAMESPACEURL))
-				return true;
-		}
-		return false;
-	}
-}
diff --git a/src/org/apache/xalan/processor/ProcessorNamespaceAlias.java b/src/org/apache/xalan/processor/ProcessorNamespaceAlias.java
deleted file mode 100644
index 371978e..0000000
--- a/src/org/apache/xalan/processor/ProcessorNamespaceAlias.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.NamespaceAlias;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-/**
- * TransformerFactory for xsl:namespace-alias markup.
- * A stylesheet can use the xsl:namespace-alias element to
- * declare that one namespace URI is an alias for another namespace URI.
- * <pre>
- * <!ELEMENT xsl:namespace-alias EMPTY>
- * <!ATTLIST xsl:namespace-alias
- *   stylesheet-prefix CDATA #REQUIRED
- *   result-prefix CDATA #REQUIRED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
- */
-class ProcessorNamespaceAlias extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of an xsl:namespace-alias element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    NamespaceAlias na = new NamespaceAlias(handler.nextUid());
-
-    setPropertiesFromAttributes(handler, rawName, attributes, na);
-    String prefix = na.getStylesheetPrefix();
-    if(prefix.equals("#default"))
-    {
-      prefix = "";
-      na.setStylesheetPrefix(prefix);
-    }
-    String stylesheetNS = handler.getNamespaceForPrefix(prefix);
-    na.setStylesheetNamespace(stylesheetNS);
-    prefix = na.getResultPrefix();
-    if(prefix.equals("#default"))
-    {
-      prefix = "";
-      na.setResultPrefix(prefix);
-    }
-    String resultNS = handler.getNamespaceForPrefix(prefix);
-    na.setResultNamespace(resultNS);
-    handler.getStylesheet().setNamespaceAlias(na);
-    handler.getStylesheet().appendChild(na);
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorOutputElem.java b/src/org/apache/xalan/processor/ProcessorOutputElem.java
deleted file mode 100644
index 66599bb..0000000
--- a/src/org/apache/xalan/processor/ProcessorOutputElem.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import javax.xml.transform.OutputKeys;
-
-import java.util.Hashtable;
-
-import org.apache.xalan.templates.OutputProperties;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemTemplateElement;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.SystemIDResolver;
-
-import javax.xml.transform.TransformerException;
-
-import org.xml.sax.Attributes;
-
-/**
- * TransformerFactory for xsl:output markup.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#output">output in XSLT Specification</a>
- */
-class ProcessorOutputElem extends XSLTElementProcessor
-{
-
-  /** The output properties, set temporarily while the properties are 
-   *  being set from the attributes, and then nulled after that operation 
-   *  is completed.  */
-  private OutputProperties m_outputProperties;
-
-  /**
-   * Set the cdata-section-elements property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#CDATA_SECTION_ELEMENTS
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setCdataSectionElements(java.util.Vector newValue)
-  {
-    m_outputProperties.setQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS, newValue);
-  }
-
-  /**
-   * Set the doctype-public property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#DOCTYPE_PUBLIC
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setDoctypePublic(String newValue)
-  {
-    m_outputProperties.setProperty(OutputKeys.DOCTYPE_PUBLIC, newValue);
-  }
-
-  /**
-   * Set the doctype-system property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#DOCTYPE_SYSTEM
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setDoctypeSystem(String newValue)
-  {
-    m_outputProperties.setProperty(OutputKeys.DOCTYPE_SYSTEM, newValue);
-  }
-
-  /**
-   * Set the encoding property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#ENCODING
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setEncoding(String newValue)
-  {
-    m_outputProperties.setProperty(OutputKeys.ENCODING, newValue);
-  }
-
-  /**
-   * Set the indent property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#INDENT
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setIndent(boolean newValue)
-  {
-    m_outputProperties.setBooleanProperty(OutputKeys.INDENT, newValue);
-  }
-
-  /**
-   * Set the media type property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#MEDIA_TYPE
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setMediaType(String newValue)
-  {
-    m_outputProperties.setProperty(OutputKeys.MEDIA_TYPE, newValue);
-  }
-
-  /**
-   * Set the method property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#METHOD
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setMethod(org.apache.xml.utils.QName newValue)
-  {
-    m_outputProperties.setQNameProperty(OutputKeys.METHOD, newValue);
-  }
-
-  /**
-   * Set the omit-xml-declaration property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#OMIT_XML_DECLARATION
-   * @param newValue processed attribute value.
-   */
-  public void setOmitXmlDeclaration(boolean newValue)
-  {
-    m_outputProperties.setBooleanProperty(OutputKeys.OMIT_XML_DECLARATION, newValue);
-  }
-
-  /**
-   * Set the standalone property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#STANDALONE
-   * @param newValue processed attribute value.
-   */
-  public void setStandalone(boolean newValue)
-  {
-    m_outputProperties.setBooleanProperty(OutputKeys.STANDALONE, newValue);
-  }
-
-  /**
-   * Set the version property from the attribute value.
-   * @see javax.xml.transform.OutputKeys#VERSION
-   * @param newValue non-null reference to processed attribute value.
-   */
-  public void setVersion(String newValue)
-  {
-    m_outputProperties.setProperty(OutputKeys.VERSION, newValue);
-  }
-  
-  /**
-   * Set a foreign property from the attribute value.
-   * @param newValue non-null reference to attribute value.
-   */
-  public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue)
-  {
-    QName key = new QName(attrUri, attrLocalName);
-    m_outputProperties.setProperty(key, attrValue);
-  }
-  
-  /**
-   * Set a foreign property from the attribute value.
-   * @param newValue non-null reference to attribute value.
-   */
-  public void addLiteralResultAttribute(String attrUri, String attrLocalName, String attrRawName, String attrValue)
-  {
-    QName key = new QName(attrUri, attrLocalName);
-    m_outputProperties.setProperty(key, attrValue);
-  }
-
-  /**
-   * Receive notification of the start of an xsl:output element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-    // Hmmm... for the moment I don't think I'll have default properties set for this. -sb
-    m_outputProperties = new OutputProperties();
-
-    m_outputProperties.setDOMBackPointer(handler.getOriginatingNode());
-    m_outputProperties.setLocaterInfo(handler.getLocator());
-    m_outputProperties.setUid(handler.nextUid());
-    setPropertiesFromAttributes(handler, rawName, attributes, this);
-    
-    // Access this only from the Hashtable level... we don't want to 
-    // get default properties.
-    String entitiesFileName =
-      (String) m_outputProperties.getProperties().get(OutputProperties.S_KEY_ENTITIES);
-
-    if (null != entitiesFileName)
-    {
-      try
-      {
-        String absURL = SystemIDResolver.getAbsoluteURI(entitiesFileName,
-                    handler.getBaseIdentifier());
-        m_outputProperties.getProperties().put(OutputProperties.S_KEY_ENTITIES, absURL);
-      }
-      catch(TransformerException te)
-      {
-        handler.error(te.getMessage(), te);
-      }
-    }
-    
-    handler.getStylesheet().setOutput(m_outputProperties);
-    
-    ElemTemplateElement parent = handler.getElemTemplateElement();
-    parent.appendChild(m_outputProperties);
-    
-    m_outputProperties = null;
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorPreserveSpace.java b/src/org/apache/xalan/processor/ProcessorPreserveSpace.java
deleted file mode 100644
index 6d2cd32..0000000
--- a/src/org/apache/xalan/processor/ProcessorPreserveSpace.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.WhiteSpaceInfo;
-import org.apache.xpath.XPath;
-
-import java.util.Vector;
-
-/**
- * TransformerFactory for xsl:preserve-space markup.
- * <pre>
- * <!ELEMENT xsl:preserve-space EMPTY>
- * <!ATTLIST xsl:preserve-space elements CDATA #REQUIRED>
- * </pre>
- */
-class ProcessorPreserveSpace extends XSLTElementProcessor
-{
-
-  /**
-   * Bean property to allow setPropertiesFromAttributes to
-   * get the elements attribute.
-   */
-  private Vector m_elements;
-
-  /**
-   * Set from the elements attribute.  This is a list of 
-   * whitespace delimited element qualified names that specify
-   * preservation of whitespace.
-   *
-   * @param elems Should be a non-null reference to a list 
-   *              of {@link org.apache.xpath.XPath} objects.
-   */
-  public void setElements(Vector elems)
-  {
-    m_elements = elems;
-  }
-
-  /**
-   * Get the property set by setElements().  This is a list of 
-   * whitespace delimited element qualified names that specify
-   * preservation of whitespace.
-   *
-   * @return A reference to a list of {@link org.apache.xpath.XPath} objects, 
-   *         or null.
-   */
-  Vector getElements()
-  {
-    return m_elements;
-  }
-
-  /**
-   * Receive notification of the start of an preserve-space element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    setPropertiesFromAttributes(handler, rawName, attributes, this);
-
-    Stylesheet thisSheet = handler.getStylesheet();
-    Vector xpaths = getElements();
-
-    for (int i = 0; i < xpaths.size(); i++)
-    {
-      WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), false, thisSheet);
-      wsi.setUid(handler.nextUid());
-
-      thisSheet.setPreserveSpaces(wsi);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorStripSpace.java b/src/org/apache/xalan/processor/ProcessorStripSpace.java
deleted file mode 100644
index a1f8119..0000000
--- a/src/org/apache/xalan/processor/ProcessorStripSpace.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.WhiteSpaceInfo;
-import org.apache.xpath.XPath;
-
-import java.util.Vector;
-
-/**
- * TransformerFactory for xsl:strip-space markup.
- * <pre>
- * <!ELEMENT xsl:strip-space EMPTY>
- * <!ATTLIST xsl:strip-space elements CDATA #REQUIRED>
- * </pre>
- */
-class ProcessorStripSpace extends ProcessorPreserveSpace
-{
-
-  /**
-   * Receive notification of the start of an strip-space element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-    setPropertiesFromAttributes(handler, rawName, attributes, this);
-
-    Stylesheet thisSheet = handler.getStylesheet();
-    Vector xpaths = getElements();
-
-    for (int i = 0; i < xpaths.size(); i++)
-    {
-      WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), true, thisSheet);
-      wsi.setUid(handler.nextUid());
-
-      thisSheet.setStripSpaces(wsi);
-    }
-
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorStylesheetDoc.java b/src/org/apache/xalan/processor/ProcessorStylesheetDoc.java
deleted file mode 100644
index 97cf036..0000000
--- a/src/org/apache/xalan/processor/ProcessorStylesheetDoc.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class processes the xsl:stylesheet element.  At the 
- * moment, it defers all methods to it's superclass.
- */
-public class ProcessorStylesheetDoc extends XSLTElementProcessor
-{
-}
diff --git a/src/org/apache/xalan/processor/ProcessorStylesheetElement.java b/src/org/apache/xalan/processor/ProcessorStylesheetElement.java
deleted file mode 100644
index 75822a0..0000000
--- a/src/org/apache/xalan/processor/ProcessorStylesheetElement.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.StylesheetComposed;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-import javax.xml.transform.TransformerConfigurationException;
-
-/**
- * TransformerFactory for xsl:stylesheet or xsl:transform markup.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#stylesheet-element">stylesheet-element in XSLT Specification</a>
- */
-class ProcessorStylesheetElement extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of an strip-space element.
-   *
-   * @param handler The calling StylesheetHandler/TemplatesBuilder.
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param rawName The raw XML 1.0 name (with prefix), or the
-   *        empty string if raw names are not available.
-   * @param attributes The attributes attached to the element.  If
-   *        there are no attributes, it shall be an empty
-   *        Attributes object.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-		super.startElement(handler, uri, localName, rawName, attributes);
-    try
-    {
-      int stylesheetType = handler.getStylesheetType();
-      Stylesheet stylesheet;
-
-      if (stylesheetType == StylesheetHandler.STYPE_ROOT)
-      {
-        try
-        {
-          stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener());
-        }
-        catch(TransformerConfigurationException tfe)
-        {
-          throw new TransformerException(tfe);
-        }
-      }
-      else
-      {
-        Stylesheet parent = handler.getStylesheet();
-
-        if (stylesheetType == StylesheetHandler.STYPE_IMPORT)
-        {
-          StylesheetComposed sc = new StylesheetComposed(parent);
-
-          parent.setImport(sc);
-
-          stylesheet = sc;
-        }
-        else
-        {
-          stylesheet = new Stylesheet(parent);
-
-          parent.setInclude(stylesheet);
-        }
-      }
-
-      stylesheet.setDOMBackPointer(handler.getOriginatingNode());
-      stylesheet.setLocaterInfo(handler.getLocator());
-      stylesheet.setPrefixes(handler.getNamespaceSupport());
-      handler.pushStylesheet(stylesheet);
-      setPropertiesFromAttributes(handler, rawName, attributes,
-                                  handler.getStylesheet());
-      handler.pushElemTemplateElement(handler.getStylesheet());
-    }
-    catch(TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-		super.endElement(handler, uri, localName, rawName);
-    handler.popElemTemplateElement();
-    handler.popStylesheet();
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorTemplate.java b/src/org/apache/xalan/processor/ProcessorTemplate.java
deleted file mode 100644
index c18a806..0000000
--- a/src/org/apache/xalan/processor/ProcessorTemplate.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTemplateElement;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-/**
- * TransformerFactory for xsl:template markup.
- */
-class ProcessorTemplate extends ProcessorTemplateElem
-{
-  
-  /**
-   * Append the current template element to the current
-   * template element, and then push it onto the current template
-   * element stack.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param elem Must be a non-null reference to a {@link org.apache.xalan.templates.ElemTemplate} object.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  protected void appendAndPush(
-          StylesheetHandler handler, ElemTemplateElement elem)
-            throws org.xml.sax.SAXException
-  {
-
-    super.appendAndPush(handler, elem);
-    elem.setDOMBackPointer(handler.getOriginatingNode());
-    handler.getStylesheet().setTemplate((ElemTemplate) elem);
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorTemplateElem.java b/src/org/apache/xalan/processor/ProcessorTemplateElem.java
deleted file mode 100644
index 90f0729..0000000
--- a/src/org/apache/xalan/processor/ProcessorTemplateElem.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.NoSuchMethodException;
-import java.lang.InstantiationException;
-import java.lang.IllegalAccessException;
-
-import java.util.Vector;
-
-/**
- * This class processes parse events for an XSLT template element.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-the-Result-Tree">section-Creating-the-Result-Tree in XSLT Specification</a>
- */
-public class ProcessorTemplateElem extends XSLTElementProcessor
-{
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * @param name The element type name.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The specified or defaulted attributes.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    super.startElement(handler, uri, localName, rawName, attributes);
-    try
-    {
-      // ElemTemplateElement parent = handler.getElemTemplateElement();
-      XSLTElementDef def = getElemDef();
-      Class classObject = def.getClassObject();
-      ElemTemplateElement elem = null;
-
-      try
-      {
-        elem = (ElemTemplateElement) classObject.newInstance();
-
-        elem.setDOMBackPointer(handler.getOriginatingNode());
-        elem.setLocaterInfo(handler.getLocator());
-        elem.setPrefixes(handler.getNamespaceSupport());
-      }
-      catch (InstantiationException ie)
-      {
-        handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie);
-      }
-      catch (IllegalAccessException iae)
-      {
-        handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae);
-      }
-
-      setPropertiesFromAttributes(handler, rawName, attributes, elem);
-      appendAndPush(handler, elem);
-    }
-    catch(TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Append the current template element to the current
-   * template element, and then push it onto the current template
-   * element stack.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param elem non-null reference to a the current template element.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  protected void appendAndPush(
-          StylesheetHandler handler, ElemTemplateElement elem)
-            throws org.xml.sax.SAXException
-  {
-
-    ElemTemplateElement parent = handler.getElemTemplateElement();
-
-    parent.appendChild(elem);
-    handler.pushElemTemplateElement(elem);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-    super.endElement(handler, uri, localName, rawName);
-    handler.popElemTemplateElement();
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorText.java b/src/org/apache/xalan/processor/ProcessorText.java
deleted file mode 100644
index 7bdeeac..0000000
--- a/src/org/apache/xalan/processor/ProcessorText.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemText;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * Process xsl:text.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#element-text">element-text in XSLT Specification</a>
- */
-public class ProcessorText extends ProcessorTemplateElem
-{
-
-  /**
-   * Append the current template element to the current
-   * template element, and then push it onto the current template
-   * element stack.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param elem non-null reference to a {@link org.apache.xalan.templates.ElemText}.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  protected void appendAndPush(
-          StylesheetHandler handler, ElemTemplateElement elem)
-            throws org.xml.sax.SAXException
-  {
-
-    // Don't push this element onto the element stack.
-    ProcessorCharacters charProcessor =
-      (ProcessorCharacters) handler.getProcessorFor(null, "text()", "text");
-
-    charProcessor.setXslTextElement((ElemText) elem);
-
-    ElemTemplateElement parent = handler.getElemTemplateElement();
-
-    parent.appendChild(elem);
-    elem.setDOMBackPointer(handler.getOriginatingNode());
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-
-    ProcessorCharacters charProcessor 
-      = (ProcessorCharacters) handler.getProcessorFor(null, "text()", "text");
-
-    charProcessor.setXslTextElement(null);
-
-  }
-}
diff --git a/src/org/apache/xalan/processor/ProcessorUnknown.java b/src/org/apache/xalan/processor/ProcessorUnknown.java
deleted file mode 100644
index c9ffd49..0000000
--- a/src/org/apache/xalan/processor/ProcessorUnknown.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xalan.templates.ElemLiteralResult;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemExtensionCall;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.Constants;
-import org.apache.xpath.XPath;
-import org.apache.xalan.templates.StylesheetRoot;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class processes an unknown template element, and ignores 
- * the startElement and endElement events.  It is used both 
- * for unknown top-level elements, and for elements in the 
- * xslt namespace when the version is higher than the version 
- * of XSLT that we are set up to process.
- */
-public class ProcessorUnknown extends ProcessorTemplateElem
-{
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * @param name The element type name.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The specified or defaulted attributes.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException{}
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException{}
-}
diff --git a/src/org/apache/xalan/processor/StopParseException.java b/src/org/apache/xalan/processor/StopParseException.java
deleted file mode 100644
index d73e0e1..0000000
--- a/src/org/apache/xalan/processor/StopParseException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-/**
- * <meta name="usage" content="internal"/>
- * This is a special exception that is used to stop parsing when 
- * search for an element.  For instance, when searching for xml:stylesheet 
- * PIs, it is used to stop the parse once the document element is found.
- * @see StylesheetPIHandler
- */
-public class StopParseException extends org.xml.sax.SAXException
-{
-
-  /**
-   * Constructor StopParseException.
-   */
-  StopParseException()
-  {
-    super("Stylesheet PIs found, stop the parse");
-  }
-}
diff --git a/src/org/apache/xalan/processor/StylesheetHandler.java b/src/org/apache/xalan/processor/StylesheetHandler.java
deleted file mode 100644
index 652206f..0000000
--- a/src/org/apache/xalan/processor/StylesheetHandler.java
+++ /dev/null
@@ -1,1619 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import java.net.URL;
-
-import java.io.IOException;
-
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-
-import java.util.Stack;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemUnknown;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xml.utils.NodeConsumer;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-import org.apache.xml.utils.BoolStack;
-import org.apache.xpath.compiler.FunctionTable;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xpath.functions.Function;
-import org.apache.xpath.XPathFactory;
-import org.apache.xpath.XPath;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-
-import org.xml.sax.helpers.NamespaceSupport;
-import org.apache.xml.utils.NamespaceSupport2;
-import org.xml.sax.helpers.DefaultHandler;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.SAXSourceLocator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Initializes and processes a stylesheet via SAX events.
- * This class acts as essentially a state machine, maintaining
- * a ContentHandler stack, and pushing appropriate content
- * handlers as parse events occur.
- */
-public class StylesheetHandler extends DefaultHandler
-        implements TemplatesHandler, PrefixResolver, NodeConsumer
-{
-
-  /**
-   * Create a StylesheetHandler object, creating a root stylesheet
-   * as the target.
-   *
-   * @param processor non-null reference to the transformer factory that owns this handler.
-   *
-   * @throws TransformerConfigurationException if a StylesheetRoot
-   * can not be constructed for some reason.
-   */
-  public StylesheetHandler(TransformerFactoryImpl processor)
-          throws TransformerConfigurationException
-  {
-
-    // m_schema = new XSLTSchema();
-    init(processor);
-  }
-
-  /**
-   * Static flag to let us know if the XPath functions table
-   * has been initialized.
-   */
-  private static boolean m_xpathFunctionsInited = false;
-
-  /**
-   * Do common initialization.
-   *
-   * @param processor non-null reference to the transformer factory that owns this handler.
-   */
-  void init(TransformerFactoryImpl processor)
-  {
-
-    // Not sure about double-check of this flag, but
-    // it seems safe...
-    if (false == m_xpathFunctionsInited)
-    {
-      synchronized (this)
-      {
-        if (false == m_xpathFunctionsInited)
-        {
-          m_xpathFunctionsInited = true;
-
-          Function func = new org.apache.xalan.templates.FuncDocument();
-
-          FunctionTable.installFunction("document", func);
-
-          // func = new org.apache.xalan.templates.FuncKey();
-          // FunctionTable.installFunction("key", func);
-          func = new org.apache.xalan.templates.FuncFormatNumb();
-
-          FunctionTable.installFunction("format-number", func);
-        }
-      }
-    }
-
-    m_stylesheetProcessor = processor;
-
-    // Set the initial content handler.
-    m_processors.push(m_schema.getElementProcessor());
-    this.pushNewNamespaceSupport();
-
-    // m_includeStack.push(SystemIDResolver.getAbsoluteURI(this.getBaseIdentifier(), null));
-    // initXPath(processor, null);
-  }
-
-  /**
-   * Process an expression string into an XPath.
-   * Must be public for access by the AVT class.
-   *
-   * @param str A non-null reference to a valid or invalid XPath expression string.
-   *
-   * @return A non-null reference to an XPath object that represents the string argument.
-   *
-   * @throws javax.xml.transform.TransformerException if the expression can not be processed.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Expressions">Section 4 Expressions in XSLT Specification</a>
-   */
-  public XPath createXPath(String str)
-          throws javax.xml.transform.TransformerException
-  {
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-    return new XPath(str, getLocator(), this, XPath.SELECT, handler);
-  }
-
-  /**
-   * Process an expression string into an XPath.
-   *
-   * @param str A non-null reference to a valid or invalid match pattern string.
-   *
-   * @return A non-null reference to an XPath object that represents the string argument.
-   *
-   * @throws javax.xml.transform.TransformerException if the pattern can not be processed.
-   * @see <a href="http://www.w3.org/TR/xslt#patterns">Section 5.2 Patterns in XSLT Specification</a>
-   */
-  XPath createMatchPatternXPath(String str)
-          throws javax.xml.transform.TransformerException
-  {
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-    return new XPath(str, getLocator(), this, XPath.MATCH, handler);
-  }
-
-  /**
-   * Given a namespace, get the corrisponding prefix from the current
-   * namespace support context.
-   *
-   * @param prefix The prefix to look up, which may be an empty string ("") for the default Namespace.
-   *
-   * @return The associated Namespace URI, or null if the prefix
-   *         is undeclared in this context.
-   */
-  public String getNamespaceForPrefix(String prefix)
-  {
-    return this.getNamespaceSupport().getURI(prefix);
-  }
-
-  /**
-   * Given a namespace, get the corrisponding prefix.  This is here only
-   * to support the {@link org.apache.xml.utils.PrefixResolver} interface,
-   * and will throw an error if invoked on this object.
-   *
-   * @param prefix The prefix to look up, which may be an empty string ("") for the default Namespace.
-   * @param context The node context from which to look up the URI.
-   *
-   * @return The associated Namespace URI, or null if the prefix
-   *         is undeclared in this context.
-   */
-  public String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context)
-  {
-
-    // Don't need to support this here.  Return the current URI for the prefix,
-    // ignoring the context.
-    assertion(true, "can't process a context node in StylesheetHandler!");
-
-    return null;
-  }
-
-  /**
-   * Utility function to see if the stack contains the given URL.
-   *
-   * @param stack non-null reference to a Stack.
-   * @param url URL string on which an equality test will be performed.
-   *
-   * @return true if the stack contains the url argument.
-   */
-  private boolean stackContains(Stack stack, String url)
-  {
-
-    int n = stack.size();
-    boolean contains = false;
-
-    for (int i = 0; i < n; i++)
-    {
-      String url2 = (String) stack.elementAt(i);
-
-      if (url2.equals(url))
-      {
-        contains = true;
-
-        break;
-      }
-    }
-
-    return contains;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of the TRAX TemplatesBuilder interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * When this object is used as a ContentHandler or ContentHandler, it will
-   * create a Templates object, which the caller can get once
-   * the SAX events have been completed.
-   * @return The stylesheet object that was created during
-   * the SAX event process, or null if no stylesheet has
-   * been created.
-   *
-   * @version Alpha
-   * @author <a href="mailto:scott_boag@lotus.com">Scott Boag</a>
-   */
-  public Templates getTemplates()
-  {
-    return getStylesheetRoot();
-  }
-
-  /**
-   * Set the base ID (URL or system ID) for the stylesheet
-   * created by this builder.  This must be set in order to
-   * resolve relative URLs in the stylesheet.
-   *
-   * @param baseID Base URL for this stylesheet.
-   */
-  public void setSystemId(String baseID)
-  {
-    pushBaseIndentifier(baseID);
-  }
-
-  /**
-   * Get the base ID (URI or system ID) from where relative
-   * URLs will be resolved.
-   *
-   * @return The systemID that was set with {@link #setSystemId}.
-   */
-  public String getSystemId()
-  {
-    return this.getBaseIdentifier();
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of the EntityResolver interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Resolve an external entity.
-   *
-   * @param publicId The public identifer, or null if none is
-   *                 available.
-   * @param systemId The system identifier provided in the XML
-   *                 document.
-   * @return The new input source, or null to require the
-   *         default behaviour.
-   *
-   * @throws org.xml.sax.SAXException if the entity can not be resolved.
-   */
-  public InputSource resolveEntity(String publicId, String systemId)
-          throws org.xml.sax.SAXException
-  {
-    return getCurrentProcessor().resolveEntity(this, publicId, systemId);
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of DTDHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive notification of a notation declaration.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass if they wish to keep track of the notations
-   * declared in a document.</p>
-   *
-   * @param name The notation name.
-   * @param publicId The notation public identifier, or null if not
-   *                 available.
-   * @param systemId The notation system identifier.
-   * @see org.xml.sax.DTDHandler#notationDecl
-   */
-  public void notationDecl(String name, String publicId, String systemId)
-  {
-    getCurrentProcessor().notationDecl(this, name, publicId, systemId);
-  }
-
-  /**
-   * Receive notification of an unparsed entity declaration.
-   *
-   * @param name The entity name.
-   * @param publicId The entity public identifier, or null if not
-   *                 available.
-   * @param systemId The entity system identifier.
-   * @param notationName The name of the associated notation.
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void unparsedEntityDecl(String name, String publicId,
-                                 String systemId, String notationName)
-  {
-    getCurrentProcessor().unparsedEntityDecl(this, name, publicId, systemId,
-                                             notationName);
-  }
-
-  /**
-   * Given a namespace URI, and a local name or a node type, get the processor
-   * for the element, or return null if not allowed.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   *
-   * @return A non-null reference to a element processor.
-   *
-   * @throws org.xml.sax.SAXException if the element is not allowed in the
-   * found position in the stylesheet.
-   */
-  XSLTElementProcessor getProcessorFor(
-          String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-
-    XSLTElementProcessor currentProcessor = getCurrentProcessor();
-    XSLTElementDef def = currentProcessor.getElemDef();
-    XSLTElementProcessor elemProcessor = def.getProcessorFor(uri, localName);
-
-    if (null == elemProcessor
-            && ((null == getStylesheet()
-                || Double.valueOf(getStylesheet().getVersion()).doubleValue()
-                   > Constants.XSLTVERSUPPORTED) ||
-                                                                (!uri.equals(Constants.S_XSLNAMESPACEURL) &&
-                currentProcessor instanceof ProcessorStylesheetElement)))
-    {
-      elemProcessor = def.getProcessorForUnknown(uri, localName);
-    }
-
-    if (null == elemProcessor)
-      error(rawName + " is not allowed in this position in the stylesheet!",
-            null);
-                
-    return elemProcessor;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of ContentHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive a Locator object for document events.
-   * This is called by the parser to push a locator for the
-   * stylesheet being parsed. The stack needs to be popped
-   * after the stylesheet has been parsed. We pop in
-   * popStylesheet.
-   *
-   * @param locator A locator for all SAX document events.
-   * @see org.xml.sax.ContentHandler#setDocumentLocator
-   * @see org.xml.sax.Locator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-
-    // System.out.println("pushing locator for: "+locator.getSystemId());
-    m_stylesheetLocatorStack.push(new SAXSourceLocator(locator));
-  }
-
-  /**
-   * The level of the stylesheet we are at.
-   */
-  private int m_stylesheetLevel = -1;
-
-  /**
-   * Receive notification of the beginning of the document.
-   *
-   * @see org.xml.sax.ContentHandler#startDocument
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void startDocument() throws org.xml.sax.SAXException
-  {
-    m_stylesheetLevel++;
-    pushSpaceHandling(false);
-  }
-
-  /** m_parsingComplete becomes true when the top-level stylesheet and all
-   * its included/imported stylesheets have been been fully parsed, as an
-   * indication that composition/optimization/compilation can begin.
-   * @see isStylesheetParsingComplete  */
-  private boolean m_parsingComplete = false;
-
-  /**
-   * Test whether the _last_ endDocument() has been processed.
-   * This is needed as guidance for stylesheet optimization
-   * and compilation engines, which generally don't want to start
-   * until all included and imported stylesheets have been fully
-   * parsed.
-   *
-   * @return true iff the complete stylesheet tree has been built.
-   */
-  public boolean isStylesheetParsingComplete()
-  {
-    return m_parsingComplete;
-  }
-
-  /**
-   * Receive notification of the end of the document.
-   *
-   * @see org.xml.sax.ContentHandler#endDocument
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void endDocument() throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      if (null != getStylesheetRoot())
-      {
-        if (0 == m_stylesheetLevel)
-          getStylesheetRoot().recompose();        
-      }
-      else
-        throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!");
-
-      XSLTElementProcessor elemProcessor = getCurrentProcessor();
-
-      if (null != elemProcessor)
-        elemProcessor.startNonText(this);
-
-      m_stylesheetLevel--;			
-      
-      popSpaceHandling();
-
-      // WARNING: This test works only as long as stylesheets are parsed
-      // more or less recursively. If we switch to an iterative "work-list"
-      // model, this will become true prematurely. In that case,
-      // isStylesheetParsingComplete() will have to be adjusted to be aware
-      // of the worklist.
-      m_parsingComplete = (m_stylesheetLevel < 0);
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-  
-  private java.util.Vector m_prefixMappings = new java.util.Vector();
-
-  /**
-   * Receive notification of the start of a Namespace mapping.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the start of
-   * each element (such as allocating a new tree node or writing
-   * output to a file).</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI mapped to the prefix.
-   * @see org.xml.sax.ContentHandler#startPrefixMapping
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws org.xml.sax.SAXException
-  {
-
-    // m_nsSupport.pushContext();
-    // this.getNamespaceSupport().declarePrefix(prefix, uri);
-    //m_prefixMappings.add(prefix); // JDK 1.2+ only -sc
-    //m_prefixMappings.add(uri); // JDK 1.2+ only -sc
-    m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc
-    m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc
-  }
-
-  /**
-   * Receive notification of the end of a Namespace mapping.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the start of
-   * each element (such as allocating a new tree node or writing
-   * output to a file).</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @see org.xml.sax.ContentHandler#endPrefixMapping
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException
-  {
-
-    // m_nsSupport.popContext();
-  }
-
-  /**
-   * Flush the characters buffer.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  private void flushCharacters() throws org.xml.sax.SAXException
-  {
-
-    XSLTElementProcessor elemProcessor = getCurrentProcessor();
-
-    if (null != elemProcessor)
-      elemProcessor.startNonText(this);
-  }
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * @param name The element type name.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startElement(
-          String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-      NamespaceSupport nssupport = this.getNamespaceSupport();
-    nssupport.pushContext();
-    
-    int n = m_prefixMappings.size();
-    for (int i = 0; i < n; i++) 
-    {
-      String prefix = (String)m_prefixMappings.elementAt(i++);
-      String nsURI = (String)m_prefixMappings.elementAt(i);
-      nssupport.declarePrefix(prefix, nsURI);
-    }
-    //m_prefixMappings.clear(); // JDK 1.2+ only -sc
-    m_prefixMappings.removeAllElements(); // JDK 1.1.x compat -sc
-
-    m_elementID++;
-
-    // This check is currently done for all elements.  We should possibly consider
-    // limiting this check to xsl:stylesheet elements only since that is all it really
-    // applies to.  Also, it could be bypassed if m_shouldProcess is already true.
-    // In other words, the next two statements could instead look something like this:
-    // if (!m_shouldProcess)
-    // {
-    //   if (localName.equals(Constants.ELEMNAME_STYLESHEET_STRING) &&
-    //       url.equals(Constants.S_XSLNAMESPACEURL))
-    //   {
-    //     checkForFragmentID(attributes);
-    //     if (!m_shouldProcess)
-    //       return;
-    //   }
-    //   else
-    //     return;
-    // } 
-    // I didn't include this code statement at this time because in practice 
-    // it is a small performance hit and I was waiting to see if its absence
-    // caused a problem. - GLP
-
-    checkForFragmentID(attributes);
-
-    if (!m_shouldProcess)
-      return;
-
-    flushCharacters();
-    
-    pushSpaceHandling(attributes);
-
-    XSLTElementProcessor elemProcessor = getProcessorFor(uri, localName,
-                                           rawName);
-
-    this.pushProcessor(elemProcessor);
-    elemProcessor.startElement(this, uri, localName, rawName, attributes);
-                
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @see org.xml.sax.ContentHandler#endElement
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void endElement(String uri, String localName, String rawName)
-          throws org.xml.sax.SAXException
-  {
-
-    m_elementID--;
-
-    if (!m_shouldProcess)
-      return;
-
-    if ((m_elementID + 1) == m_fragmentID)
-      m_shouldProcess = false;
-
-    flushCharacters();
-    
-    popSpaceHandling();
-
-    XSLTElementProcessor p = getCurrentProcessor();
-
-    p.endElement(this, uri, localName, rawName);
-    this.popProcessor();
-    this.getNamespaceSupport().popContext();
-  }
-
-  /**
-   * Receive notification of character data inside an element.
-   *
-   * @param ch The characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @see org.xml.sax.ContentHandler#characters
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void characters(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if (!m_shouldProcess)
-      return;
-
-    XSLTElementProcessor elemProcessor = getCurrentProcessor();
-    XSLTElementDef def = elemProcessor.getElemDef();
-
-    if (def.getType() != XSLTElementDef.T_PCDATA)
-      elemProcessor = def.getProcessorFor(null, "text()");
-
-    if (null == elemProcessor)
-    {
-
-      // If it's whitespace, just ignore it, otherwise flag an error.
-      if (!XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
-        error(
-          "Non-whitespace text is not allowed in this position in the stylesheet!",
-          null);
-    }
-    else
-      elemProcessor.characters(this, ch, start, length);
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   * @param ch The whitespace characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @see org.xml.sax.ContentHandler#ignorableWhitespace
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if (!m_shouldProcess)
-      return;
-
-    getCurrentProcessor().ignorableWhitespace(this, ch, start, length);
-  }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions for each
-   * processing instruction, such as setting status variables or
-   * invoking other methods.</p>
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *             none is supplied.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-
-    if (!m_shouldProcess)
-      return;
-
-    flushCharacters();
-    getCurrentProcessor().processingInstruction(this, target, data);
-  }
-
-  /**
-   * Receive notification of a skipped entity.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions for each
-   * processing instruction, such as setting status variables or
-   * invoking other methods.</p>
-   *
-   * @param name The name of the skipped entity.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void skippedEntity(String name) throws org.xml.sax.SAXException
-  {
-
-    if (!m_shouldProcess)
-      return;
-
-    getCurrentProcessor().skippedEntity(this, name);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of an problem.
-   *
-   * @param msg An index into the {@link org.apache.xalan.res.XSLTErrorResources}
-   * table, that is one of the WG_ prefixed definitions.
-   * @param args An array of arguments for the given warning.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the current
-   * {@link javax.xml.transform.ErrorListener#warning}
-   * method chooses to flag this condition as an error.
-   */
-  public void warn(int msg, Object args[]) throws org.xml.sax.SAXException
-  {
-
-    String formattedMsg = m_XSLMessages.createWarning(msg, args);
-    SAXSourceLocator locator = getLocator();
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-
-    try
-    {
-      if (null != handler)
-        handler.warning(new TransformerException(formattedMsg, locator));
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Assert that a condition is true.  If it is not true, throw an error.
-   *
-   * @param condition false if an error should not be thrown, otherwise true.
-   * @param msg Error message to be passed to the RuntimeException as an
-   * argument.
-   * @throws RuntimeException if the condition is not true.
-   */
-  private void assertion(boolean condition, String msg) throws RuntimeException
-  {
-    if (!condition)
-      throw new RuntimeException(msg);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg An error message.
-   * @param e An error which the SAXException should wrap.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the current
-   * {@link javax.xml.transform.ErrorListener#error}
-   * method chooses to flag this condition as an error.
-   */
-  protected void error(String msg, Exception e)
-          throws org.xml.sax.SAXException
-  {
-
-    SAXSourceLocator locator = getLocator();
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-    TransformerException pe;
-
-    if (!(e instanceof TransformerException))
-    {
-      pe = (null == e)
-           ? new TransformerException(msg, locator)
-           : new TransformerException(msg, locator, e);
-    }
-    else
-      pe = (TransformerException) e;
-
-    if (null != handler)
-    {
-      try
-      {
-        handler.error(pe);
-      }
-      catch (TransformerException te)
-      {
-        throw new org.xml.sax.SAXException(te);
-      }
-    }
-    else
-      throw new org.xml.sax.SAXException(pe);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg An index into the {@link org.apache.xalan.res.XSLTErrorResources}
-   * table, that is one of the WG_ prefixed definitions.
-   * @param args An array of arguments for the given warning.
-   * @param e An error which the SAXException should wrap.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the current
-   * {@link javax.xml.transform.ErrorListener#error}
-   * method chooses to flag this condition as an error.
-   */
-  protected void error(int msg, Object args[], Exception e)
-          throws org.xml.sax.SAXException
-  {
-
-    String formattedMsg = m_XSLMessages.createMessage(msg, args);
-
-    error(formattedMsg, e);
-  }
-
-  /**
-   * Receive notification of a XSLT processing warning.
-   *
-   * @param e The warning information encoded as an exception.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the current
-   * {@link javax.xml.transform.ErrorListener#warning}
-   * method chooses to flag this condition as an error.
-   */
-  public void warning(org.xml.sax.SAXParseException e)
-          throws org.xml.sax.SAXException
-  {
-
-    String formattedMsg = e.getMessage();
-    SAXSourceLocator locator = getLocator();
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-
-    try
-    {
-      handler.warning(new TransformerException(formattedMsg, locator));
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Receive notification of a recoverable XSLT processing error.
-   *
-   * @param e The error information encoded as an exception.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the current
-   * {@link javax.xml.transform.ErrorListener#error}
-   * method chooses to flag this condition as an error.
-   */
-  public void error(org.xml.sax.SAXParseException e)
-          throws org.xml.sax.SAXException
-  {
-
-    String formattedMsg = e.getMessage();
-    SAXSourceLocator locator = getLocator();
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-
-    try
-    {
-      handler.error(new TransformerException(formattedMsg, locator));
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Report a fatal XSLT processing error.
-   *
-   * @param e The error information encoded as an exception.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the current
-   * {@link javax.xml.transform.ErrorListener#fatalError}
-   * method chooses to flag this condition as an error.
-   */
-  public void fatalError(org.xml.sax.SAXParseException e)
-          throws org.xml.sax.SAXException
-  {
-
-    String formattedMsg = e.getMessage();
-    SAXSourceLocator locator = getLocator();
-    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-
-    try
-    {
-      handler.fatalError(new TransformerException(formattedMsg, locator));
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * If we have a URL to a XML fragment, this is set
-   * to false until the ID is found.
-   * (warning: I worry that this should be in a stack).
-   */
-  private boolean m_shouldProcess = true;
-
-  /**
-   * If we have a URL to a XML fragment, the value is stored
-   * in this string, and the m_shouldProcess flag is set to
-   * false until we match an ID with this string.
-   * (warning: I worry that this should be in a stack).
-   */
-  private String m_fragmentIDString;
-
-  /**
-   * Keep track of the elementID, so we can tell when
-   * is has completed.  This isn't a real ID, but rather
-   * a nesting level.  However, it's good enough for
-   * our purposes.
-   * (warning: I worry that this should be in a stack).
-   */
-  private int m_elementID = 0;
-
-  /**
-   * The ID of the fragment that has been found
-   * (warning: I worry that this should be in a stack).
-   */
-  private int m_fragmentID = 0;
-
-  /**
-   * Check to see if an ID attribute matched the #id, called
-   * from startElement.
-   *
-   * @param attributes The specified or defaulted attributes.
-   */
-  private void checkForFragmentID(Attributes attributes)
-  {
-
-    if (!m_shouldProcess)
-    {
-      if ((null != attributes) && (null != m_fragmentIDString))
-      {
-        int n = attributes.getLength();
-
-        for (int i = 0; i < n; i++)
-        {
-          String name = attributes.getQName(i);
-
-          if (name.equals(Constants.ATTRNAME_ID))
-          {
-            String val = attributes.getValue(i);
-
-            if (val.equalsIgnoreCase(m_fragmentIDString))
-            {
-              m_shouldProcess = true;
-              m_fragmentID = m_elementID;
-            }
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   *  The XSLT TransformerFactory for needed services.
-   */
-  private TransformerFactoryImpl m_stylesheetProcessor;
-
-  /**
-   * Get the XSLT TransformerFactoryImpl for needed services.
-   * TODO: This method should be renamed.
-   *
-   * @return The TransformerFactoryImpl that owns this handler.
-   */
-  TransformerFactoryImpl getStylesheetProcessor()
-  {
-    return m_stylesheetProcessor;
-  }
-
-  /**
-   * If {@link #getStylesheetType} returns this value, the current stylesheet
-   *  is a root stylesheet.
-   */
-  static final int STYPE_ROOT = 1;
-
-  /**
-   * If {@link #getStylesheetType} returns this value, the current stylesheet
-   *  is an included stylesheet.
-   */
-  static final int STYPE_INCLUDE = 2;
-
-  /**
-   * If {@link #getStylesheetType} returns this value, the current stylesheet
-   *  is an imported stylesheet.
-   */
-  static final int STYPE_IMPORT = 3;
-
-  /** The current stylesheet type. */
-  private int m_stylesheetType = STYPE_ROOT;
-
-  /**
-   * Get the type of stylesheet that should be built
-   * or is being processed.
-   *
-   * @return one of STYPE_ROOT, STYPE_INCLUDE, or STYPE_IMPORT.
-   */
-  int getStylesheetType()
-  {
-    return m_stylesheetType;
-  }
-
-  /**
-   * Set the type of stylesheet that should be built
-   * or is being processed.
-   *
-   * @param type Must be one of STYPE_ROOT, STYPE_INCLUDE, or STYPE_IMPORT.
-   */
-  void setStylesheetType(int type)
-  {
-    m_stylesheetType = type;
-  }
-
-  /**
-   * The stack of stylesheets being processed.
-   */
-  private Stack m_stylesheets = new Stack();
-
-  /**
-   * Return the stylesheet that this handler is constructing.
-   *
-   * @return The current stylesheet that is on top of the stylesheets stack,
-   *  or null if no stylesheet is on the stylesheets stack.
-   */
-  Stylesheet getStylesheet()
-  {
-    return (m_stylesheets.size() == 0)
-           ? null : (Stylesheet) m_stylesheets.peek();
-  }
-
-  /**
-   * Return the last stylesheet that was popped off the stylesheets stack.
-   *
-   * @return The last popped stylesheet, or null.
-   */
-  Stylesheet getLastPoppedStylesheet()
-  {
-    return m_lastPoppedStylesheet;
-  }
-
-  /**
-   * Return the stylesheet root that this handler is constructing.
-   *
-   * @return The root stylesheet of the stylesheets tree.
-   */
-  public StylesheetRoot getStylesheetRoot()
-  {
-    return m_stylesheetRoot;
-  }
-
-  /** The root stylesheet of the stylesheets tree. */
-  StylesheetRoot m_stylesheetRoot;
-        
-        /** The last stylesheet that was popped off the stylesheets stack. */
-  Stylesheet m_lastPoppedStylesheet;
-
-  /**
-   * Push the current stylesheet being constructed. If no other stylesheets
-   * have been pushed onto the stack, assume the argument is a stylesheet
-   * root, and also set the stylesheet root member.
-   *
-   * @param s non-null reference to a stylesheet.
-   */
-  public void pushStylesheet(Stylesheet s)
-  {
-
-    if (m_stylesheets.size() == 0)
-      m_stylesheetRoot = (StylesheetRoot) s;
-
-    m_stylesheets.push(s);
-  }
-
-  /**
-   * Pop the last stylesheet pushed, and return the stylesheet that this
-   * handler is constructing, and set the last popped stylesheet member.
-   * Also pop the stylesheet locator stack.
-   *
-   * @return The stylesheet popped off the stack, or the last popped stylesheet.
-   */
-  Stylesheet popStylesheet()
-  {
-
-    // The stylesheetLocatorStack needs to be popped because
-    // a locator was pushed in for this stylesheet by the SAXparser by calling
-    // setDocumentLocator().
-    if (!m_stylesheetLocatorStack.isEmpty())
-      m_stylesheetLocatorStack.pop();
-
-    if (!m_stylesheets.isEmpty())
-      m_lastPoppedStylesheet = (Stylesheet) m_stylesheets.pop();
-
-    // Shouldn't this be null if stylesheets is empty?  -sb
-    return m_lastPoppedStylesheet;
-  }
-
-  /**
-   * The stack of current processors.
-   */
-  private Stack m_processors = new Stack();
-
-  /**
-   * Get the current XSLTElementProcessor at the top of the stack.
-   *
-   * @return Valid XSLTElementProcessor, which should never be null.
-   */
-  XSLTElementProcessor getCurrentProcessor()
-  {
-    return (XSLTElementProcessor) m_processors.peek();
-  }
-
-  /**
-   * Push the current XSLTElementProcessor onto the top of the stack.
-   *
-   * @param processor non-null reference to the current element processor.
-   */
-  void pushProcessor(XSLTElementProcessor processor)
-  {
-    m_processors.push(processor);
-  }
-
-  /**
-   * Pop the current XSLTElementProcessor from the top of the stack.
-   * @return the XSLTElementProcessor which was popped.
-   */
-  XSLTElementProcessor popProcessor()
-  {
-    return (XSLTElementProcessor) m_processors.pop();
-  }
-
-  /**
-   * The root of the XSLT Schema, which tells us how to
-   * transition content handlers, create elements, etc.
-   * For the moment at least, this can't be static, since
-   * the processors store state.
-   */
-  private XSLTSchema m_schema = new XSLTSchema();
-
-  /**
-   * Get the root of the XSLT Schema, which tells us how to
-   * transition content handlers, create elements, etc.
-   *
-   * @return The root XSLT Schema, which should never be null.
-   */
-  XSLTSchema getSchema()
-  {
-    return m_schema;
-  }
-
-  /**
-   * The stack of elements, pushed and popped as events occur.
-   */
-  private Stack m_elems = new Stack();
-
-  /**
-   * Get the current ElemTemplateElement at the top of the stack.
-   * @return Valid ElemTemplateElement, which may be null.
-   */
-  ElemTemplateElement getElemTemplateElement()
-  {
-
-    try
-    {
-      return (ElemTemplateElement) m_elems.peek();
-    }
-    catch (java.util.EmptyStackException ese)
-    {
-      return null;
-    }
-  }  
-
-  /** An increasing number that is used to indicate the order in which this element
-   *  was encountered during the parse of the XSLT tree.
-   */
-  private int m_docOrderCount = 0;
-
-  /**
-   * Returns the next m_docOrderCount number and increments the number for future use.
-   */
-  int nextUid()
-  {
-    return m_docOrderCount++;
-  }
-
-  /**
-   * Push the current XSLTElementProcessor to the top of the stack.  As a
-   * side-effect, set the document order index (simply because this is a
-   * convenient place to set it).
-   *
-   * @param elem Should be a non-null reference to the intended current
-   * template element.
-   */
-  void pushElemTemplateElement(ElemTemplateElement elem)
-  {
-
-    if (elem.getUid() == -1)
-      elem.setUid(nextUid());
-
-    m_elems.push(elem);
-  }
-
-  /**
-   * Get the current XSLTElementProcessor from the top of the stack.
-   * @return the ElemTemplateElement which was popped.
-   */
-  ElemTemplateElement popElemTemplateElement()
-  {
-    return (ElemTemplateElement) m_elems.pop();
-  }
-
-  
-  /**
-   * A XSLMessages instance capable of producing user messages.
-   */
-  private static XSLMessages m_XSLMessages = new XSLMessages();
-
-  /**
-   * Get an XSLMessages instance capable of producing user messages.
-   *
-   * @return non-null reference to the error and warnings table.
-   */
-  XSLMessages getXSLMessages()
-  {
-    return m_XSLMessages;
-  }
-
-  /**
-   * This will act as a stack to keep track of the
-   * current include base.
-   */
-  Stack m_baseIdentifiers = new Stack();
-
-  /**
-   * Push a base identifier onto the base URI stack.
-   *
-   * @param baseID The current base identifier for this position in the
-   * stylesheet, which may be a fragment identifier, or which may be null.
-   * @see <a href="http://www.w3.org/TR/xslt#base-uri">
-   * Section 3.2 Base URI of XSLT specification.</a>
-   */
-  void pushBaseIndentifier(String baseID)
-  {
-
-    if (null != baseID)
-    {
-      int posOfHash = baseID.indexOf('#');
-
-      if (posOfHash > -1)
-      {
-        m_fragmentIDString = baseID.substring(posOfHash + 1);
-        m_shouldProcess = false;
-      }
-      else
-        m_shouldProcess = true;
-    }
-    else
-      m_shouldProcess = true;
-
-    m_baseIdentifiers.push(baseID);
-  }
-
-  /**
-   * Pop a base URI from the stack.
-   * @return baseIdentifier.
-   */
-  String popBaseIndentifier()
-  {
-    return (String) m_baseIdentifiers.pop();
-  }
-
-  /**
-   * Return the base identifier.
-   *
-   * @return The base identifier of the current stylesheet.
-   */
-  public String getBaseIdentifier()
-  {
-
-    // Try to get the baseIdentifier from the baseIdentifier's stack,
-    // which may not be the same thing as the value found in the
-    // SourceLocators stack.
-    String base = (String) (m_baseIdentifiers.isEmpty()
-                            ? null : m_baseIdentifiers.peek());
-
-    // Otherwise try the stylesheet.
-    if (null == base)
-    {
-      SourceLocator locator = getLocator();
-
-      base = (null == locator) ? "" : locator.getSystemId();
-    }
-
-    return base;
-  }
-
-  /**
-   * The top of this stack should contain the currently processed
-   * stylesheet SAX locator object.
-   */
-  private Stack m_stylesheetLocatorStack = new Stack();
-
-  /**
-   * Get the current stylesheet Locator object.
-   *
-   * @return non-null reference to the current locator object.
-   */
-  public SAXSourceLocator getLocator()
-  {
-
-    if (m_stylesheetLocatorStack.isEmpty())
-    {
-      SAXSourceLocator locator = new SAXSourceLocator();
-
-      locator.setSystemId(this.getStylesheetProcessor().getDOMsystemID());
-
-      return locator;
-
-      // m_stylesheetLocatorStack.push(locator);
-    }
-
-    return ((SAXSourceLocator) m_stylesheetLocatorStack.peek());
-  }
-
-  /**
-   * A stack of URL hrefs for imported stylesheets.  This is
-   * used to diagnose circular imports.
-   */
-  private Stack m_importStack = new Stack();
-
-  /**
-   * Push an import href onto the stylesheet stack.
-   *
-   * @param hrefUrl non-null reference to the URL for the current imported
-   * stylesheet.
-   */
-  void pushImportURL(String hrefUrl)
-  {
-    m_importStack.push(hrefUrl);
-  }
-
-  /**
-   * See if the imported stylesheet stack already contains
-   * the given URL.  Used to test for recursive imports.
-   *
-   * @param hrefUrl non-null reference to a URL string.
-   *
-   * @return true if the URL is on the import stack.
-   */
-  boolean importStackContains(String hrefUrl)
-  {
-    return stackContains(m_importStack, hrefUrl);
-  }
-
-  /**
-   * Pop an import href from the stylesheet stack.
-   *
-   * @return non-null reference to the import URL that was popped.
-   */
-  String popImportURL()
-  {
-    return (String) m_importStack.pop();
-  }
-
-  /**
-   * If this is set to true, we've already warned about using the
-   * older XSLT namespace URL.
-   */
-  private boolean warnedAboutOldXSLTNamespace = false;
-
-  /** Stack of NamespaceSupport objects. */
-  Stack m_nsSupportStack = new Stack();
-
-  /**
-   * Push a new NamespaceSupport instance.
-   */
-  void pushNewNamespaceSupport()
-  {
-    m_nsSupportStack.push(new NamespaceSupport2());
-  }
-
-  /**
-   * Pop the current NamespaceSupport object.
-   *
-   */
-  void popNamespaceSupport()
-  {
-    m_nsSupportStack.pop();
-  }
-
-  /**
-   * Get the current NamespaceSupport object.
-   *
-   * @return a non-null reference to the current NamespaceSupport object,
-   * which is the top of the namespace support stack.
-   */
-  NamespaceSupport getNamespaceSupport()
-  {
-    return (NamespaceSupport) m_nsSupportStack.peek();
-  }
-
-  /**
-   * The originating node if the current stylesheet is being created
-   *  from a DOM.
-   *  @see org.apache.xml.utils.NodeConsumer
-   */
-  private Node m_originatingNode;
-
-  /**
-   * Set the node that is originating the SAX event.
-   *
-   * @param n Reference to node that originated the current event.
-   * @see org.apache.xml.utils.NodeConsumer
-   */
-  public void setOriginatingNode(Node n)
-  {
-    m_originatingNode = n;
-  }
-
-  /**
-   * Set the node that is originating the SAX event.
-   *
-   * @return Reference to node that originated the current event.
-   * @see org.apache.xml.utils.NodeConsumer
-   */
-  public Node getOriginatingNode()
-  {
-    return m_originatingNode;
-  }
-  
-  /**
-   * Stack of booleans that are pushed and popped in start/endElement depending 
-   * on the value of xml:space=default/preserve.
-   */
-  private BoolStack m_spacePreserveStack = new BoolStack();
-  
-  /**
-   * Return boolean value from the spacePreserve stack depending on the value 
-   * of xml:space=default/preserve.
-   * 
-   * @return true if space should be preserved, false otherwise.
-   */
-  boolean isSpacePreserve()
-  {
-    return m_spacePreserveStack.peek();
-  }
-  
-  /**
-   * Pop boolean value from the spacePreserve stack.
-   */
-  void popSpaceHandling()
-  {
-    m_spacePreserveStack.pop();
-  }
-  
-  /**
-   * Push boolean value on to the spacePreserve stack.
-   * 
-   * @param b true if space should be preserved, false otherwise.
-   */
-  void pushSpaceHandling(boolean b)
-    throws org.xml.sax.SAXParseException
-  {
-    m_spacePreserveStack.push(b);
-  }
-  
-  /**
-   * Push boolean value on to the spacePreserve stack depending on the value 
-   * of xml:space=default/preserve.
-   * 
-   * @param attrs list of attributes that were passed to startElement.
-   */
-  void pushSpaceHandling(Attributes attrs)
-    throws org.xml.sax.SAXParseException
-  {    
-    String value = attrs.getValue("xml:space");
-    if(null == value)
-    {
-      m_spacePreserveStack.push(m_spacePreserveStack.peek());
-    }
-    else if(value.equals("preserve"))
-    {
-      m_spacePreserveStack.push(true);
-    }
-    else if(value.equals("default"))
-    {
-      m_spacePreserveStack.push(false);
-    }
-    else
-    {
-      SAXSourceLocator locator = getLocator();
-      ErrorListener handler = m_stylesheetProcessor.getErrorListener();
-  
-      try
-      {
-        handler.error(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_XMLSPACE_VALUE, null), locator)); //"Illegal value for xml:space", locator));
-      }
-      catch (TransformerException te)
-      {
-        throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te);
-      }
-      m_spacePreserveStack.push(m_spacePreserveStack.peek());
-    }
-  }
-}
-
-
-
diff --git a/src/org/apache/xalan/processor/StylesheetPIHandler.java b/src/org/apache/xalan/processor/StylesheetPIHandler.java
deleted file mode 100644
index 4d2ac74..0000000
--- a/src/org/apache/xalan/processor/StylesheetPIHandler.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.xml.sax.helpers.DefaultHandler;
-import javax.xml.transform.TransformerException;
-import org.xml.sax.InputSource;
-import org.xml.sax.Attributes;
-
-import java.util.Vector;
-import java.util.StringTokenizer;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.URIResolver;
-
-import org.apache.xml.utils.SystemIDResolver;
-
-/**
- * Search for the xml-stylesheet processing instructions in an XML document.
- * @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
- */
-public class StylesheetPIHandler extends DefaultHandler
-{
-  /** The baseID of the document being processed.  */
-  String m_baseID;
-
-  /** The desired media criteria. */
-  String m_media;
-
-  /** The desired title criteria.  */
-  String m_title;
-
-  /** The desired character set criteria.   */
-  String m_charset;
-
-  /** A list of SAXSource objects that match the criteria.  */
-  Vector m_stylesheets = new Vector();
-  
-  // Add code to use a URIResolver. Patch from Dmitri Ilyin. 
-  
-  /**
-   * The object that implements the URIResolver interface,
-   * or null.
-   */
-  URIResolver m_uriResolver;
-
-  /**
-   * Get the object that will be used to resolve URIs in href 
-   * in xml-stylesheet processing instruction.
-   *
-   * @param resolver An object that implements the URIResolver interface,
-   * or null.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-    m_uriResolver = resolver;
-  }
-
-  /**
-   * Get the object that will be used to resolve URIs in href 
-   * in xml-stylesheet processing instruction.
-   *
-   * @return The URIResolver that was set with setURIResolver.
-   */
-  public URIResolver getURIResolver()
-  {
-    return m_uriResolver;
-  }
-
-  /**
-   * Construct a StylesheetPIHandler instance that will search 
-   * for xml-stylesheet PIs based on the given criteria.
-   *
-   * @param baseID The base ID of the XML document, needed to resolve 
-   *               relative IDs.
-   * @param media The desired media criteria.
-   * @param title The desired title criteria.
-   * @param charset The desired character set criteria.
-   */
-  public StylesheetPIHandler(String baseID, String media, String title,
-                             String charset)
-  {
-
-    m_baseID = baseID;
-    m_media = media;
-    m_title = title;
-    m_charset = charset;
-  }
-
-  /**
-   * Return the last stylesheet found that match the constraints.
-   *
-   * @return Source object that references the last stylesheet reference 
-   *         that matches the constraints.
-   */
-  public Source getAssociatedStylesheet()
-  {
-
-    int sz = m_stylesheets.size();
-
-    if (sz > 0)
-    {
-      Source source = (Source) m_stylesheets.elementAt(sz-1);
-      return source;      
-    }
-    else
-      return null;
-  }
-
-  /**
-   * Handle the xml-stylesheet processing instruction.
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *             none is supplied.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   * @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-
-    if (target.equals("xml-stylesheet"))
-    {
-      String href = null;  // CDATA #REQUIRED
-      String type = null;  // CDATA #REQUIRED
-      String title = null;  // CDATA #IMPLIED
-      String media = null;  // CDATA #IMPLIED
-      String charset = null;  // CDATA #IMPLIED
-      boolean alternate = false;  // (yes|no) "no"
-      StringTokenizer tokenizer = new StringTokenizer(data, " \t=", true);
-      boolean lookedAhead = false; 
-      Source source = null;
-
-      String token = "";
-      while (tokenizer.hasMoreTokens())
-      {        
-        if (!lookedAhead)
-          token = tokenizer.nextToken();
-        else
-          lookedAhead = false;
-        if (tokenizer.hasMoreTokens() && 
-               (token.equals(" ") || token.equals("\t") || token.equals("=")))
-          continue;
-          
-        String name = token;  
-        if (name.equals("type"))
-        { 
-          token = tokenizer.nextToken();
-          while (tokenizer.hasMoreTokens() && 
-               (token.equals(" " ) || token.equals("\t") || token.equals("=")))
-            token = tokenizer.nextToken();
-          type = token.substring(1, token.length() - 1);
-          
-        }
-        else if (name.equals("href"))
-        {
-          token = tokenizer.nextToken();
-          while (tokenizer.hasMoreTokens() && 
-               (token.equals(" " ) || token.equals("\t") || token.equals("=")))
-            token = tokenizer.nextToken();
-          href = token;
-          if (tokenizer.hasMoreTokens())
-          {
-            token = tokenizer.nextToken();
-            // If the href value has parameters to be passed to a 
-            // servlet(something like "foobar?id=12..."), 
-            // we want to make sure we get them added to
-            // the href value. Without this check, we would move on 
-            // to try to process another attribute and that would be
-            // wrong.
-            // We need to set lookedAhead here to flag that we
-            // already have the next token. 
-            while ( token.equals("=") && tokenizer.hasMoreTokens())
-            {  
-              href = href + token + tokenizer.nextToken();
-              if (tokenizer.hasMoreTokens())
-              {  
-                token = tokenizer.nextToken();
-                lookedAhead = true;
-              }
-              else
-              {
-                break;
-              }
-            }
-          }
-          href = href.substring(1, href.length() - 1);
-          try
-          { 
-            // Add code to use a URIResolver. Patch from Dmitri Ilyin. 
-            if (m_uriResolver != null) 
-            {
-              source = m_uriResolver.resolve(href, m_baseID);
-            } 
-           else 
-            {
-              href = SystemIDResolver.getAbsoluteURI(href, m_baseID);
-              source = new SAXSource(new InputSource(href));
-            }            
-          }
-          catch(TransformerException te)
-          {
-            throw new org.xml.sax.SAXException(te);
-          }
-        }
-        else if (name.equals("title"))
-        {
-          token = tokenizer.nextToken();
-          while (tokenizer.hasMoreTokens() && 
-               (token.equals(" " ) || token.equals("\t") || token.equals("=")))
-            token = tokenizer.nextToken();
-          title = token.substring(1, token.length() - 1);
-        }
-        else if (name.equals("media"))
-        {
-          token = tokenizer.nextToken();
-          while (tokenizer.hasMoreTokens() && 
-               (token.equals(" " ) || token.equals("\t") || token.equals("=")))
-            token = tokenizer.nextToken();
-          media = token.substring(1, token.length() - 1);
-        }
-        else if (name.equals("charset"))
-        {
-          token = tokenizer.nextToken();
-          while (tokenizer.hasMoreTokens() && 
-              (token.equals(" " ) || token.equals("\t") || token.equals("=")))
-            token = tokenizer.nextToken();
-          charset = token.substring(1, token.length() - 1);
-        }
-        else if (name.equals("alternate"))
-        {
-          token = tokenizer.nextToken();
-          while (tokenizer.hasMoreTokens() && 
-               (token.equals(" " ) || token.equals("\t") || token.equals("=")))
-            token = tokenizer.nextToken();
-          alternate = token.substring(1, token.length()
-                                             - 1).equals("yes");
-        }
-        
-      }
-
-      if ((null != type) 
-          && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt"))  
-          && (null != href))
-      {
-        if (null != m_media)
-        {
-          if (null != media)
-          {
-            if (!media.equals(m_media))
-              return;
-          }
-          else
-            return;
-        }
-
-        if (null != m_charset)
-        {
-          if (null != charset)
-          {
-            if (!charset.equals(m_charset))
-              return;
-          }
-          else
-            return;
-        }
-
-        if (null != m_title)
-        {
-          if (null != title)
-          {
-            if (!title.equals(m_title))
-              return;
-          }
-          else
-            return;
-        }
-
-        m_stylesheets.addElement(source);
-      }
-    }
-  }
-  
-  
-  /**
-   * The spec notes that "The xml-stylesheet processing instruction is allowed only in the prolog of an XML document.",
-   * so, at least for right now, I'm going to go ahead an throw a TransformerException
-   * in order to stop the parse.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @throws StopParseException since there can be no valid xml-stylesheet processing 
-   *                            instructions past the first element.
-   */
-  public void startElement(
-          String namespaceURI, String localName, String qName, Attributes atts)
-            throws org.xml.sax.SAXException
-  {
-    throw new StopParseException();
-  }
-}
diff --git a/src/org/apache/xalan/processor/TransformerFactoryImpl.java b/src/org/apache/xalan/processor/TransformerFactoryImpl.java
deleted file mode 100644
index 87d348f..0000000
--- a/src/org/apache/xalan/processor/TransformerFactoryImpl.java
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.XMLReader;
-
-import javax.xml.transform.TransformerException;
-
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLFilter;
-
-import org.w3c.dom.Node;
-
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xml.utils.DefaultErrorHandler;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.TransformerIdentityImpl;
-import org.apache.xalan.transformer.TrAXFilter;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.Source;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.Templates;
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.ErrorListener;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.BufferedInputStream;
-import java.io.StringWriter;
-import java.io.PrintWriter;
-import java.io.StringReader;
-
-import java.util.Properties;
-import java.util.Enumeration;
-
-/**
- * The TransformerFactoryImpl, which implements the TRaX TransformerFactory
- * interface, processes XSLT stylesheets into a Templates object
- * (a StylesheetRoot).
- */
-public class TransformerFactoryImpl extends SAXTransformerFactory
-{
-
-  /** 
-   * The path/filename of the property file: XSLTInfo.properties  
-   * Maintenance note: see also org.apache.xpath.functions.FuncSystemProperty.XSLT_PROPERTIES
-   */
-  public static String XSLT_PROPERTIES =
-    "org/apache/xalan/res/XSLTInfo.properties";
-
-  /** Flag tells if the properties file has been loaded to the system */
-  private static boolean isInited = false;
-
-  /**
-   * Constructor TransformerFactoryImpl
-   *
-   */
-  public TransformerFactoryImpl()
-  {
-    loadPropertyFileToSystem(XSLT_PROPERTIES);
-  }
-
-  /** a zero length Class array used in loadPropertyFileToSystem() */
-  private static final Class[] NO_CLASSES = new Class[0];
-
-  /** a zero length Object array used in loadPropertyFileToSystem() */
-  private static final Object[] NO_OBJS = new Object[0];
-  
-  /** Static string to be used for incremental feature */
-  public static final String FEATURE_INCREMENTAL = "http://xml.apache.org/xalan/features/incremental";
-
-  /** Static string to be used for optimize feature */
-  public static final String FEATURE_OPTIMIZE = "http://xml.apache.org/xalan/features/optimize";
-
-
-  /**
-   * Retrieve a propery bundle from a specified file and load it
-   * int the System properties.
-   *
-   * @param file The properties file to be processed.
-   */
-  private static void loadPropertyFileToSystem(String file)
-  {
-
-    if (false == isInited)
-    {
-      try
-      {
-        InputStream is = null;
-
-        try
-        {
-          Properties props = new Properties();
-
-          try {
-            java.lang.reflect.Method getCCL = Thread.class.getMethod("getContextClassLoader", NO_CLASSES);
-            if (getCCL != null) {
-              ClassLoader contextClassLoader = (ClassLoader) getCCL.invoke(Thread.currentThread(), NO_OBJS);
-              is = contextClassLoader.getResourceAsStream(file); // file should be already fully specified
-            }
-          }
-          catch (Exception e) {}
-
-          if (is == null) {
-            // NOTE! For the below getResourceAsStream in Sun JDK 1.1.8M
-            //  we apparently must add the leading slash character - I 
-            //  don't know why, but if it's not there, we throw an NPE from the below loading
-            is = TransformerFactoryImpl.class.getResourceAsStream("/" + file); // file should be already fully specified
-          }
-
-          // get a buffered version
-          BufferedInputStream bis = new BufferedInputStream(is);
-
-          props.load(bis);  // and load up the property bag from this
-          bis.close();  // close out after reading
-
-          // OK, now we only want to set system properties that 
-          // are not already set.
-          Properties systemProps = System.getProperties();
-          Enumeration propEnum = props.propertyNames();
-
-          while (propEnum.hasMoreElements())
-          {
-            String prop = (String) propEnum.nextElement();
-
-            if (!systemProps.containsKey(prop))
-              systemProps.put(prop, props.getProperty(prop));
-          }
-
-          System.setProperties(systemProps);
-
-          isInited = true;
-        }
-        catch (Exception ex){}
-      }
-      catch (SecurityException se)
-      {
-
-        // In this case the caller is required to have 
-        // the needed attributes already defined.
-      }
-    }
-  }
-
-public javax.xml.transform.Templates processFromNode(Node node)
-          throws TransformerConfigurationException
-  {
-
-    try
-    {
-      TemplatesHandler builder = newTemplatesHandler();
-      TreeWalker walker = new TreeWalker(builder, new org.apache.xpath.DOM2Helper(), builder.getSystemId());
-
-      walker.traverse(node);
-
-      return builder.getTemplates();
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      if (m_errorListener != null)
-      {
-        try
-        {
-          m_errorListener.fatalError(new TransformerException(se));
-        }
-        catch (TransformerException ex)
-        {
-          throw new TransformerConfigurationException(ex);
-        }
-
-        return null;
-      }
-      else
-
-        // Should remove this later... but right now diagnostics from 
-        // TransformerConfigurationException are not good.
-        // se.printStackTrace();
-        throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed",
-                                                    //se);
-    }
-    catch (TransformerConfigurationException tce)
-    {
-      // Assume it's already been reported to the error listener.
-      throw tce;
-    }
-   /* catch (TransformerException tce)
-    {
-      // Assume it's already been reported to the error listener.
-      throw new TransformerConfigurationException(tce.getMessage(), tce);
-    }*/
-    catch (Exception e)
-    {
-      if (m_errorListener != null)
-      {
-        try
-        {
-          m_errorListener.fatalError(new TransformerException(e));
-        }
-        catch (TransformerException ex)
-        {
-          throw new TransformerConfigurationException(ex);
-        }
-
-        return null;
-      }
-      else
-
-        // Should remove this later... but right now diagnostics from 
-        // TransformerConfigurationException are not good.
-        // se.printStackTrace();
-        throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed",
-                                                    //e);
-    }
-  }
-
-  /**
-   * The systemID that was specified in
-   * processFromNode(Node node, String systemID).
-   */
-  private String m_DOMsystemID = null;
-
-  /**
-   * The systemID that was specified in
-   * processFromNode(Node node, String systemID).
-   *
-   * @return The systemID, or null.
-   */
-  String getDOMsystemID()
-  {
-    return m_DOMsystemID;
-  }
-
-  /**
-   * Process the stylesheet from a DOM tree, if the
-   * processor supports the "http://xml.org/trax/features/dom/input"
-   * feature.
-   *
-   * @param node A DOM tree which must contain
-   * valid transform instructions that this processor understands.
-   * @param systemID The systemID from where xsl:includes and xsl:imports
-   * should be resolved from.
-   *
-   * @return A Templates object capable of being used for transformation purposes.
-   *
-   * @throws TransformerConfigurationException
-   */
-  javax.xml.transform.Templates processFromNode(Node node, String systemID)
-          throws TransformerConfigurationException
-  {
-
-    m_DOMsystemID = systemID;
-
-    return processFromNode(node);
-  }
-
-  /**
-   * Get InputSource specification(s) that are associated with the
-   * given document specified in the source param,
-   * via the xml-stylesheet processing instruction
-   * (see http://www.w3.org/TR/xml-stylesheet/), and that matches
-   * the given criteria.  Note that it is possible to return several stylesheets
-   * that match the criteria, in which case they are applied as if they were
-   * a list of imports or cascades.
-   *
-   * <p>Note that DOM2 has it's own mechanism for discovering stylesheets.
-   * Therefore, there isn't a DOM version of this method.</p>
-   *
-   *
-   * @param source The XML source that is to be searched.
-   * @param media The media attribute to be matched.  May be null, in which
-   *              case the prefered templates will be used (i.e. alternate = no).
-   * @param title The value of the title attribute to match.  May be null.
-   * @param charset The value of the charset attribute to match.  May be null.
-   *
-   * @return A Source object capable of being used to create a Templates object.
-   *
-   * @throws TransformerConfigurationException
-   */
-  public Source getAssociatedStylesheet(
-          Source source, String media, String title, String charset)
-            throws TransformerConfigurationException
-  {
-
-    String baseID;
-    InputSource isource = null;
-    Node node = null;
-    XMLReader reader = null;
-
-    if (source instanceof DOMSource)
-    {
-      DOMSource dsource = (DOMSource) source;
-
-      node = dsource.getNode();
-      baseID = dsource.getSystemId();
-    }
-    else
-    {
-      isource = SAXSource.sourceToInputSource(source);
-      baseID = isource.getSystemId();
-    }
-
-    // What I try to do here is parse until the first startElement
-    // is found, then throw a special exception in order to terminate 
-    // the parse.
-    StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media,
-                                    title, charset);
-    
-    // Use URIResolver. Patch from Dmitri Ilyin 
-    if (m_uriResolver != null) 
-    {
-      handler.setURIResolver(m_uriResolver); 
-    }
-
-    try
-    {
-      if (null != node)
-      {
-        TreeWalker walker = new TreeWalker(handler, new org.apache.xpath.DOM2Helper(), baseID);
-
-        walker.traverse(node);
-      }
-      else
-      {
-
-        // Use JAXP1.1 ( if possible )
-        try
-        {
-          javax.xml.parsers.SAXParserFactory factory =
-            javax.xml.parsers.SAXParserFactory.newInstance();
-
-          factory.setNamespaceAware(true);
-
-          javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser();
-
-          reader = jaxpParser.getXMLReader();
-        }
-        catch (javax.xml.parsers.ParserConfigurationException ex)
-        {
-          throw new org.xml.sax.SAXException(ex);
-        }
-        catch (javax.xml.parsers.FactoryConfigurationError ex1)
-        {
-          throw new org.xml.sax.SAXException(ex1.toString());
-        }
-        catch (NoSuchMethodError ex2){}
-        catch (AbstractMethodError ame){}
-
-        if (null == reader)
-        {
-          reader = XMLReaderFactory.createXMLReader();
-        }
-
-        // Need to set options!
-        reader.setContentHandler(handler);
-        reader.parse(isource);
-      }
-    }
-    catch (StopParseException spe)
-    {
-
-      // OK, good.
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerConfigurationException(
-        "getAssociatedStylesheets failed", se);
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerConfigurationException(
-        "getAssociatedStylesheets failed", ioe);
-    }
-
-    return handler.getAssociatedStylesheet();
-  }
-
-  /**
-   * Create a new Transformer object that performs a copy
-   * of the source to the result.
-   *
-   * @param source An object that holds a URI, input stream, etc.
-   *
-   * @return A Transformer object that may be used to perform a transformation
-   * in a single thread, never null.
-   *
-   * @throws TransformerConfigurationException May throw this during
-   *            the parse when it is constructing the
-   *            Templates object and fails.
-   */
-  public TemplatesHandler newTemplatesHandler()
-          throws TransformerConfigurationException
-  {
-    return new StylesheetHandler(this);
-  }
-
-  /**
-   * Look up the value of a feature.
-   *
-   * <p>The feature name is any fully-qualified URI.  It is
-   * possible for an TransformerFactory to recognize a feature name but
-   * to be unable to return its value; this is especially true
-   * in the case of an adapter for a SAX1 Parser, which has
-   * no way of knowing whether the underlying parser is
-   * validating, for example.</p>
-   *
-   * @param name The feature name, which is a fully-qualified URI.
-   * @return The current state of the feature (true or false).
-   */
-  public boolean getFeature(String name)
-  {
-
-    // Try first with identity comparison, which 
-    // will be faster.
-    if ((DOMResult.FEATURE == name) || (DOMSource.FEATURE == name)
-            || (SAXResult.FEATURE == name) || (SAXSource.FEATURE == name)
-            || (StreamResult.FEATURE == name)
-            || (StreamSource.FEATURE == name)
-            || (SAXTransformerFactory.FEATURE == name)
-            || (SAXTransformerFactory.FEATURE_XMLFILTER == name))
-      return true;
-    else if ((DOMResult.FEATURE.equals(name))
-             || (DOMSource.FEATURE.equals(name))
-             || (SAXResult.FEATURE.equals(name))
-             || (SAXSource.FEATURE.equals(name))
-             || (StreamResult.FEATURE.equals(name))
-             || (StreamSource.FEATURE.equals(name))
-             || (SAXTransformerFactory.FEATURE.equals(name))
-             || (SAXTransformerFactory.FEATURE_XMLFILTER.equals(name)))
-      return true;
-    else
-      return false;
-  }
-  
-  public static boolean m_optimize = true;
-  
-  /**
-   * Allows the user to set specific attributes on the underlying
-   * implementation.
-   *
-   * @param name The name of the attribute.
-   * @param value The value of the attribute; Boolean or String="true"|"false"
-   *
-   * @throws IllegalArgumentException thrown if the underlying
-   * implementation doesn't recognize the attribute.
-   */
-  public void setAttribute(String name, Object value)
-          throws IllegalArgumentException
-  {
-    if (name.equals(FEATURE_INCREMENTAL))
-    {
-      if(value instanceof Boolean)
-      {
-        // Accept a Boolean object..
-        org.apache.xml.dtm.DTMManager.setIncremental(((Boolean)value).booleanValue());
-      }
-      else if(value instanceof String)
-      {
-        // .. or a String object
-        org.apache.xml.dtm.DTMManager.setIncremental((new Boolean((String)value)).booleanValue());
-      }
-      else
-      {
-        // Give a more meaningful error message
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value);
-      }
-	}
-    else if (name.equals(FEATURE_OPTIMIZE))
-    {
-      if(value instanceof Boolean)
-      {
-        // Accept a Boolean object..
-        m_optimize = ((Boolean)value).booleanValue();
-      }
-      else if(value instanceof String)
-      {
-        // .. or a String object
-        m_optimize = (new Boolean((String)value)).booleanValue();
-      }
-      else
-      {
-        // Give a more meaningful error message
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value);
-      }
-    }
-    else
-    {
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported");
-    }
-  }
-
-  /**
-   * Allows the user to retrieve specific attributes on the underlying
-   * implementation.
-   *
-   * @param name The name of the attribute.
-   * @return value The value of the attribute.
-   *
-   * @throws IllegalArgumentException thrown if the underlying
-   * implementation doesn't recognize the attribute.
-   */
-  public Object getAttribute(String name) throws IllegalArgumentException
-  {
-    // Please implement this method for testing purposes 25-Jun-01 -sc
-    if (name.equals(FEATURE_INCREMENTAL))
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_FOUND, new Object[]{name})); //name + " attribute value not found");
-    else if (name.equals(FEATURE_OPTIMIZE))
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_FOUND, new Object[]{name})); //name + " attribute value not found");
-    else
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized");
-  }
-
-  /**
-   * Create an XMLFilter that uses the given source as the
-   * transformation instructions.
-   *
-   * @param src The source of the transformation instructions.
-   *
-   * @return An XMLFilter object, or null if this feature is not supported.
-   *
-   * @throws TransformerConfigurationException
-   */
-  public XMLFilter newXMLFilter(Source src)
-          throws TransformerConfigurationException
-  {
-
-    Templates templates = newTemplates(src);
-    if( templates==null ) return null;
-    
-    return newXMLFilter(templates);
-  }
-
-  /**
-   * Create an XMLFilter that uses the given source as the
-   * transformation instructions.
-   *
-   * @param src The source of the transformation instructions.
-   *
-   * @param templates non-null reference to Templates object.
-   *
-   * @return An XMLFilter object, or null if this feature is not supported.
-   *
-   * @throws TransformerConfigurationException
-   */
-  public XMLFilter newXMLFilter(Templates templates)
-          throws TransformerConfigurationException
-  {
-    try {
-      return new TrAXFilter(templates);
-    } catch( TransformerConfigurationException ex ) {
-      if( m_errorListener != null) {
-        try {
-          m_errorListener.fatalError( ex );
-          return null;
-        } catch( TransformerException ex1 ) {
-          new TransformerConfigurationException(ex1);
-        }
-      }
-      throw ex;
-    }
-  }
-
-  /**
-   * Get a TransformerHandler object that can process SAX
-   * ContentHandler events into a Result, based on the transformation
-   * instructions specified by the argument.
-   *
-   * @param src The source of the transformation instructions.
-   *
-   * @return TransformerHandler ready to transform SAX events.
-   *
-   * @throws TransformerConfigurationException
-   */
-  public TransformerHandler newTransformerHandler(Source src)
-          throws TransformerConfigurationException
-  {
-
-    Templates templates = newTemplates(src);
-    if( templates==null ) return null;
-    
-    return newTransformerHandler(templates);
-  }
-
-  /**
-   * Get a TransformerHandler object that can process SAX
-   * ContentHandler events into a Result, based on the Templates argument.
-   *
-   * @param templates The source of the transformation instructions.
-   *
-   * @return TransformerHandler ready to transform SAX events.
-   * @throws TransformerConfigurationException
-   */
-  public TransformerHandler newTransformerHandler(Templates templates)
-          throws TransformerConfigurationException
-  {
-    try {
-      TransformerImpl transformer =
-        (TransformerImpl) templates.newTransformer();
-      transformer.setURIResolver(m_uriResolver);
-      TransformerHandler th =
-        (TransformerHandler) transformer.getInputContentHandler(true);
-
-      return th;
-    } catch( TransformerConfigurationException ex ) {
-      if( m_errorListener != null ) {
-        try {
-          m_errorListener.fatalError( ex );
-          return null;
-        } catch (TransformerException ex1 ) {
-          ex=new TransformerConfigurationException(ex1);
-        }
-      }
-      throw ex;
-    }
-    
-  }
-
-//  /** The identity transform string, for support of newTransformerHandler()
-//   *  and newTransformer().  */
-//  private static final String identityTransform =
-//    "<xsl:stylesheet " + "xmlns:xsl='http://www.w3.org/1999/XSL/Transform' "
-//    + "version='1.0'>" + "<xsl:template match='/|node()'>"
-//    + "<xsl:copy-of select='.'/>" + "</xsl:template>" + "</xsl:stylesheet>";
-//
-//  /** The identity transform Templates, built from identityTransform, 
-//   *  for support of newTransformerHandler() and newTransformer().  */
-//  private static Templates m_identityTemplate = null;
-
-  /**
-   * Get a TransformerHandler object that can process SAX
-   * ContentHandler events into a Result.
-   *
-   * @param src The source of the transformation instructions.
-   *
-   * @return TransformerHandler ready to transform SAX events.
-   *
-   * @throws TransformerConfigurationException
-   */
-  public TransformerHandler newTransformerHandler()
-          throws TransformerConfigurationException
-  {
-
-//    if (null == m_identityTemplate)
-//    {
-//      synchronized (identityTransform)
-//      {
-//        if (null == m_identityTemplate)
-//        {
-//          StringReader reader = new StringReader(identityTransform);
-//
-//          m_identityTemplate = newTemplates(new StreamSource(reader));
-//        }
-//      }
-//    }
-//
-//    return newTransformerHandler(m_identityTemplate);
-    return new TransformerIdentityImpl();
-  }
-
-  /**
-   * Process the source into a Transformer object.  Care must
-   * be given to know that this object can not be used concurrently
-   * in multiple threads.
-   *
-   * @param source An object that holds a URL, input stream, etc.
-   *
-   * @return A Transformer object capable of
-   * being used for transformation purposes in a single thread.
-   *
-   * @throws TransformerConfigurationException May throw this during the parse when it
-   *            is constructing the Templates object and fails.
-   */
-  public Transformer newTransformer(Source source)
-          throws TransformerConfigurationException
-  {
-    try {
-      Templates tmpl=newTemplates( source );
-      /* this can happen if an ErrorListener is present and it doesn't
-         throw any exception in fatalError. 
-         The spec says: "a Transformer must use this interface
-         instead of throwing an exception" - the newTemplates() does
-         that, and returns null.
-      */
-      if( tmpl==null ) return null;
-      Transformer transformer = tmpl.newTransformer();
-      transformer.setURIResolver(m_uriResolver);
-      return transformer;
-    } catch( TransformerConfigurationException ex ) {
-      if( m_errorListener != null ) {
-        try {
-          m_errorListener.fatalError( ex );
-          return null;
-        } catch( TransformerException ex1 ) {
-          ex=new TransformerConfigurationException( ex1 );
-        }
-      }
-      throw ex;
-    }
-  }
-
-  /**
-   * Create a new Transformer object that performs a copy
-   * of the source to the result.
-   *
-   * @param source An object that holds a URL, input stream, etc.
-   *
-   * @return A Transformer object capable of
-   * being used for transformation purposes in a single thread.
-   *
-   * @throws TransformerConfigurationException May throw this during
-   *            the parse when it is constructing the
-   *            Templates object and it fails.
-   */
-  public Transformer newTransformer() throws TransformerConfigurationException
-  {
-
-//    if (null == m_identityTemplate)
-//    {
-//      synchronized (identityTransform)
-//      {
-//        if (null == m_identityTemplate)
-//        {
-//          StringReader reader = new StringReader(identityTransform);
-//
-//          m_identityTemplate = newTemplates(new StreamSource(reader));
-//        }
-//      }
-//    }
-//
-//    return m_identityTemplate.newTransformer();
-      return new TransformerIdentityImpl();
-  }
-
-  /**
-   * Process the source into a Templates object, which is likely
-   * a compiled representation of the source. This Templates object
-   * may then be used concurrently across multiple threads.  Creating
-   * a Templates object allows the TransformerFactory to do detailed
-   * performance optimization of transformation instructions, without
-   * penalizing runtime transformation.
-   *
-   * @param source An object that holds a URL, input stream, etc.
-   * @return A Templates object capable of being used for transformation purposes.
-   *
-   * @throws TransformerConfigurationException May throw this during the parse when it
-   *            is constructing the Templates object and fails.
-   */
-  public Templates newTemplates(Source source)
-          throws TransformerConfigurationException
-  {
-
-    TemplatesHandler builder = newTemplatesHandler();
-    String baseID = source.getSystemId();
-
-    if (null == baseID)
-    {
-      try
-      {
-        String currentDir = System.getProperty("user.dir");
-        
-        if (currentDir.startsWith(java.io.File.separator))
-          baseID = "file://" + currentDir + java.io.File.separatorChar
-                   + source.getClass().getName();
-        else
-          baseID = "file:///" + currentDir + java.io.File.separatorChar
-                   + source.getClass().getName();
-      }
-      catch (SecurityException se)
-      {
-
-        // For untrusted applet case, user.dir is outside the sandbox 
-        //  and not accessible: just leave baseID as null (-sb & -sc)
-      }
-    }
-    else
-    {
-      try
-      {
-        baseID = SystemIDResolver.getAbsoluteURI(baseID);
-      }
-      catch (TransformerException te)
-      {
-        throw new TransformerConfigurationException(te);
-      }
-    }
-
-    builder.setSystemId(baseID);
-
-    if (source instanceof DOMSource)
-    {
-      DOMSource dsource = (DOMSource) source;
-      Node node = dsource.getNode();
-
-      if (null != node)
-        return processFromNode(node, baseID);
-      else
-      {
-        String messageStr = XSLMessages.createMessage(
-          XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null);
-
-        throw new IllegalArgumentException(messageStr);
-      }
-    }
-
-    try
-    {
-      InputSource isource = SAXSource.sourceToInputSource(source);
-      XMLReader reader = null;
-
-      if (source instanceof SAXSource)
-        reader = ((SAXSource) source).getXMLReader();
-        
-      boolean isUserReader = (reader != null);
-
-      if (null == reader)
-      {
-
-        // Use JAXP1.1 ( if possible )
-        try
-        {
-          javax.xml.parsers.SAXParserFactory factory =
-            javax.xml.parsers.SAXParserFactory.newInstance();
-
-          factory.setNamespaceAware(true);
-
-          javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser();
-
-          reader = jaxpParser.getXMLReader();
-        }
-        catch (javax.xml.parsers.ParserConfigurationException ex)
-        {
-          throw new org.xml.sax.SAXException(ex);
-        }
-        catch (javax.xml.parsers.FactoryConfigurationError ex1)
-        {
-          throw new org.xml.sax.SAXException(ex1.toString());
-        }
-        catch (NoSuchMethodError ex2){}
-        catch (AbstractMethodError ame){}
-      }
-
-      if (null == reader)
-        reader = XMLReaderFactory.createXMLReader();
-
-      // If you set the namespaces to true, we'll end up getting double 
-      // xmlns attributes.  Needs to be fixed.  -sb
-      // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
-      try
-      {
-        if(!isUserReader)
-          reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-                            true);
-      }
-      catch (org.xml.sax.SAXException ex)
-      {
-
-        // feature not recognized
-      }
-
-      reader.setContentHandler(builder);
-      reader.parse(isource);
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      if (m_errorListener != null)
-      {
-        try
-        {
-          m_errorListener.fatalError(new TransformerException(se));
-        }
-        catch (TransformerException ex1)
-        {
-          throw new TransformerConfigurationException(ex1);
-        }
-      }
-      else
-        throw new TransformerConfigurationException(se.getMessage(), se);
-    }
-    catch (Exception e)
-    {
-      if (m_errorListener != null)
-      {
-        try
-        {
-          m_errorListener.fatalError(new TransformerException(e));
-
-          return null;
-        }
-        catch (TransformerException ex1)
-        {
-          throw new TransformerConfigurationException(ex1);
-        }
-      }
-      else
-        throw new TransformerConfigurationException(e.getMessage(), e);
-    }
-
-    return builder.getTemplates();
-  }
-
-  /**
-   * The object that implements the URIResolver interface,
-   * or null.
-   */
-  URIResolver m_uriResolver;
-
-  /**
-   * Set an object that will be used to resolve URIs used in
-   * xsl:import, etc.  This will be used as the default for the
-   * transformation.
-   * @param resolver An object that implements the URIResolver interface,
-   * or null.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-    m_uriResolver = resolver;
-  }
-
-  /**
-   * Get the object that will be used to resolve URIs used in
-   * xsl:import, etc.  This will be used as the default for the
-   * transformation.
-   *
-   * @return The URIResolver that was set with setURIResolver.
-   */
-  public URIResolver getURIResolver()
-  {
-    return m_uriResolver;
-  }
-
-  /** The error listener.   */
-  private ErrorListener m_errorListener = new DefaultErrorHandler();
-
-  /**
-   * Get the error listener in effect for the TransformerFactory.
-   *
-   * @return A non-null reference to an error listener.
-   */
-  public ErrorListener getErrorListener()
-  {
-    return m_errorListener;
-  }
-
-  /**
-   * Set an error listener for the TransformerFactory.
-   *
-   * @param listener Must be a non-null reference to an ErrorListener.
-   *
-   * @throws IllegalArgumentException if the listener argument is null.
-   */
-  public void setErrorListener(ErrorListener listener)
-          throws IllegalArgumentException
-  {
-
-    if (null == listener)
-      throw new IllegalArgumentException("ErrorListener");
-
-    m_errorListener = listener;
-  }
-}
diff --git a/src/org/apache/xalan/processor/XSLProcessorVersion.java b/src/org/apache/xalan/processor/XSLProcessorVersion.java
deleted file mode 100644
index c61b83f..0000000
--- a/src/org/apache/xalan/processor/XSLProcessorVersion.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-/**
- * <meta name="usage" content="general"/>
- * Administrative class to keep track of the version number of
- * the Xalan release.
- * <P>See also: org/apache/xalan/res/XSLTInfo.properties</P>
- */
-public class XSLProcessorVersion
-{
-
-  /**
-   * Print the processor version to the command line.
-   *
-   * @param argv command line arguments, unused.
-   */
-  public static void main(String argv[])
-  {
-    System.out.println(S_VERSION);
-  }
-
-  /**
-   * Constant name of product.
-   */
-  public static final String PRODUCT = "Xalan";
-
-  /**
-   * Implementation Language.
-   */
-  public static String LANGUAGE = "Java";
-
-  /**
-   * Major version number.
-   * Version number. This changes only when there is a
-   *          significant, externally apparent enhancement from
-   *          the previous release. 'n' represents the n'th
-   *          version.
-   *
-   *          Clients should carefully consider the implications
-   *          of new versions as external interfaces and behaviour
-   *          may have changed.
-   */
-  public static int VERSION = 2;
-
-  /**
-   * Release Number.
-   * Release number. This changes when:
-   *            -  a new set of functionality is to be added, eg,
-   *               implementation of a new W3C specification.
-   *            -  API or behaviour change.
-   *            -  its designated as a reference release.
-   */
-  public static int RELEASE = 2;
-
-  /**
-   * Maintenance Drop Number.
-   * Optional identifier used to designate maintenance
-   *          drop applied to a specific release and contains
-   *          fixes for defects reported. It maintains compatibility
-   *          with the release and contains no API changes.
-   *          When missing, it designates the final and complete
-   *          development drop for a release.
-   */
-  public static int MAINTENANCE = 0;
-
-  /**
-   * Development Drop Number.
-   * Optional identifier designates development drop of
-   *          a specific release. D01 is the first development drop
-   *          of a new release.
-   *
-   *          Development drops are works in progress towards a
-   *          compeleted, final release. A specific development drop
-   *          may not completely implement all aspects of a new
-   *          feature, which may take several development drops to
-   *          complete. At the point of the final drop for the
-   *          release, the D suffix will be omitted.
-   *
-   *          Each 'D' drops can contain functional enhancements as
-   *          well as defect fixes. 'D' drops may not be as stable as
-   *          the final releases.
-   */
-  public static int DEVELOPMENT = 10;
-  
-  /**
-   * Version String like <CODE>"<B>Xalan</B> <B>Language</B> 
-   * v.r[.dd| <B>D</B>nn]"</CODE>.
-   * <P>Semantics of the version string are identical to the Xerces project.</P>
-   */
-  public static String S_VERSION = PRODUCT+" "+LANGUAGE+" "
-                                   +VERSION+"."+RELEASE+"."
-                                   +(DEVELOPMENT > 0 ? ("D"+DEVELOPMENT) 
-                                     : (""+MAINTENANCE));
-
-}
diff --git a/src/org/apache/xalan/processor/XSLTAttributeDef.java b/src/org/apache/xalan/processor/XSLTAttributeDef.java
deleted file mode 100644
index c21d831..0000000
--- a/src/org/apache/xalan/processor/XSLTAttributeDef.java
+++ /dev/null
@@ -1,1117 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.apache.xml.utils.StringToIntTable;
-
-import java.lang.IllegalAccessException;
-import java.lang.IndexOutOfBoundsException;
-import java.lang.InstantiationException;
-import java.lang.NoSuchMethodException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.StringBuffer;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.apache.xalan.templates.AVT;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xml.utils.StringVector;
-import org.apache.xpath.XPath;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * This class defines an attribute for an element in a XSLT stylesheet,
- * is meant to reflect the structure defined in http://www.w3.org/TR/xslt#dtd, and the
- * mapping between Xalan classes and the markup attributes in the element.
- */
-public class XSLTAttributeDef
-{
-
-  /**
-   * Construct an instance of XSLTAttributeDef.
-   *
-   * @param namespace The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param type One of T_CDATA, T_URL, T_AVT, T_PATTERN, T_EXPR, T_CHAR,
-   * T_PRIORITY, T_YESNO, T_QNAME, T_QNAMES, T_ENUM, T_SIMPLEPATTERNLIST,
-   * T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST.
-   * @param required true if this is attribute is required by the XSLT specification.
-   */
-  XSLTAttributeDef(String namespace, String name, int type, boolean required)
-  {
-
-    this.m_namespace = namespace;
-    this.m_name = name;
-    this.m_type = type;
-    this.m_required = required;
-  }
-
-  /**
-   * Construct an instance of XSLTAttributeDef.
-   *
-   * @param namespace The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param type One of T_CDATA, T_URL, T_AVT, T_PATTERN, T_EXPR,
-   * T_CHAR, T_PRIORITY, T_YESNO, T_QNAME, T_QNAMES, T_ENUM,
-   * T_SIMPLEPATTERNLIST, T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST.
-   * @param defaultVal The default value for this attribute.
-   */
-  XSLTAttributeDef(String namespace, String name, int type, String defaultVal)
-  {
-
-    this.m_namespace = namespace;
-    this.m_name = name;
-    this.m_type = type;
-    this.m_required = false;
-    this.m_default = defaultVal;
-  }
-
-  /**
-   * Construct an instance of XSLTAttributeDef that uses two
-   * enumerated values.
-   *
-   * @param namespace The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param required true if this attribute is required by the XSLT specification.
-   * @param k1 The XSLT name of the enumerated value.
-   * @param v1 An integer representation of k1.
-   * @param k2 The XSLT name of the enumerated value.
-   * @param v2 An integer representation of k2.
-   */
-  XSLTAttributeDef(String namespace, String name, boolean required,
-                   String k1, int v1, String k2, int v2)
-  {
-
-    this.m_namespace = namespace;
-    this.m_name = name;
-    this.m_type = this.T_ENUM;
-    this.m_required = required;
-    m_enums = new StringToIntTable(2);
-
-    m_enums.put(k1, v1);
-    m_enums.put(k2, v2);
-  }
-
-  /**
-   * Construct an instance of XSLTAttributeDef that uses three
-   * enumerated values.
-   *
-   * @param namespace The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param required true if this attribute is required by the XSLT specification.
-   * @param k1 The XSLT name of the enumerated value.
-   * @param v1 An integer representation of k1.
-   * @param k2 The XSLT name of the enumerated value.
-   * @param v2 An integer representation of k2.
-   * @param k3 The XSLT name of the enumerated value.
-   * @param v3 An integer representation of k3.
-   */
-  XSLTAttributeDef(String namespace, String name, boolean required,
-                   String k1, int v1, String k2, int v2, String k3, int v3)
-  {
-
-    this.m_namespace = namespace;
-    this.m_name = name;
-    this.m_type = this.T_ENUM;
-    this.m_required = required;
-    m_enums = new StringToIntTable(3);
-
-    m_enums.put(k1, v1);
-    m_enums.put(k2, v2);
-    m_enums.put(k3, v3);
-  }
-
-  /**
-   * Construct an instance of XSLTAttributeDef that uses three
-   * enumerated values.
-   *
-   * @param namespace The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param required true if this attribute is required by the XSLT specification.
-   * @param k1 The XSLT name of the enumerated value.
-   * @param v1 An integer representation of k1.
-   * @param k2 The XSLT name of the enumerated value.
-   * @param v2 An integer representation of k2.
-   * @param k3 The XSLT name of the enumerated value.
-   * @param v3 An integer representation of k3.
-   * @param k4 The XSLT name of the enumerated value.
-   * @param v4 An integer representation of k4.
-   */
-  XSLTAttributeDef(String namespace, String name, boolean required,
-                   String k1, int v1, String k2, int v2, String k3, int v3,
-                   String k4, int v4)
-  {
-
-    this.m_namespace = namespace;
-    this.m_name = name;
-    this.m_type = this.T_ENUM;
-    this.m_required = required;
-    m_enums = new StringToIntTable(4);
-
-    m_enums.put(k1, v1);
-    m_enums.put(k2, v2);
-    m_enums.put(k3, v3);
-    m_enums.put(k4, v4);
-  }
-
-  /** Type values that represent XSLT attribute types. */
-  static final int T_CDATA = 1,
-
-  // <!-- Used for the type of an attribute value that is a URI reference.-->
-  T_URL = 2,
-
-  // <!-- Used for the type of an attribute value that is an
-  // attribute value template.-->
-  T_AVT = 3,  // Attribute Value Template
-
-  // <!-- Used for the type of an attribute value that is a pattern.-->
-  T_PATTERN = 4,
-
-  // <!-- Used for the type of an attribute value that is an expression.-->
-  T_EXPR = 5,
-
-  // <!-- Used for the type of an attribute value that consists
-  // of a single character.-->
-  T_CHAR = 6,
-
-  // <!-- Used for the type of an attribute value that is a priority. -->
-  T_PRIORITY = 7,
-
-  // Used for boolean values
-  T_YESNO = 8,
-
-  // <!-- Used for the type of an attribute value that is a QName; the prefix
-  // gets expanded by the XSLT processor. -->
-  T_QNAME = 9,
-
-  // <!-- Like qname but a whitespace-separated list of QNames. -->
-  T_QNAMES = 10,
-
-  // <!-- Used for enumerated values -->
-  T_ENUM = 11,
-
-  // Used for simple match patterns, i.e. xsl:strip-space spec.
-  T_SIMPLEPATTERNLIST = 12,
-
-  // Used for a known token.
-  T_NMTOKEN = 13,
-
-  // Used for a list of white-space delimited strings.
-  T_STRINGLIST = 14,
-
-  // Used for a list of white-space delimited strings.
-  T_PREFIX_URLLIST = 15;
-
-  /** Representation for an attribute in a foreign namespace. */
-  static XSLTAttributeDef m_foreignAttr = new XSLTAttributeDef("*", "*",
-                                            XSLTAttributeDef.T_CDATA, false);
-
-  /** Method name that objects may implement if they wish to have forein attributes set. */
-  static String S_FOREIGNATTR_SETTER = "setForeignAttr";
-
-  /**
-   * The allowed namespace for this element.
-   */
-  private String m_namespace;
-
-  /**
-   * Get the allowed namespace for this attribute.
-   *
-   * @return The allowed namespace for this attribute, which may be null, or may be "*".
-   */
-  String getNamespace()
-  {
-    return m_namespace;
-  }
-
-  /**
-   * The name of this element.
-   */
-  private String m_name;
-
-  /**
-   * Get the name of this attribute.
-   *
-   * @return non-null reference to the name of this attribute, which may be "*".
-   */
-  String getName()
-  {
-    return m_name;
-  }
-
-  /**
-   * The type of this attribute value.
-   */
-  private int m_type;
-
-  /**
-   * Get the type of this attribute value.
-   *
-   * @return One of T_CDATA, T_URL, T_AVT, T_PATTERN, T_EXPR, T_CHAR,
-   * T_PRIORITY, T_YESNO, T_QNAME, T_QNAMES, T_ENUM, T_SIMPLEPATTERNLIST,
-   * T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST.
-   */
-  int getType()
-  {
-    return m_type;
-  }
-
-  /**
-   * If this element is of type T_ENUM, this will contain
-   * a map from the attribute string to the Xalan integer
-   * value.
-   */
-  private StringToIntTable m_enums;
-
-  /**
-   * If this element is of type T_ENUM, this will return
-   * a map from the attribute string to the Xalan integer
-   * value.
-   * @param key The XSLT attribute value.
-   *
-   * @return The integer representation of the enumerated value for this attribute.
-   * @throws Throws NullPointerException if m_enums is null.
-   */
-  private int getEnum(String key)
-  {
-    return m_enums.get(key);
-  }
-
-  /**
-   * The default value for this attribute.
-   */
-  private String m_default;
-
-  /**
-   * Get the default value for this attribute.
-   *
-   * @return The default value for this attribute, or null.
-   */
-  String getDefault()
-  {
-    return m_default;
-  }
-
-  /**
-   * Set the default value for this attribute.
-   *
-   * @param def String representation of the default value for this attribute.
-   */
-  void setDefault(String def)
-  {
-    m_default = def;
-  }
-
-  /**
-   * If true, this is a required attribute.
-   */
-  private boolean m_required;
-
-  /**
-   * Get whether or not this is a required attribute.
-   *
-   * @return true if this is a required attribute.
-   */
-  boolean getRequired()
-  {
-    return m_required;
-  }
-
-  /**
-   * String that should represent the setter method which which
-   * may be used on objects to set a value that represents this attribute  
-   */
-  String m_setterString = null;
-
-  /**
-   * Return a string that should represent the setter method.
-   * The setter method name will be created algorithmically the
-   * first time this method is accessed, and then cached for return
-   * by subsequent invocations of this method.
-   *
-   * @return String that should represent the setter method which which
-   * may be used on objects to set a value that represents this attribute,
-   * of null if no setter method should be called.
-   */
-  public String getSetterMethodName()
-  {
-
-    if (null == m_setterString)
-    {
-      if (m_foreignAttr == this)
-      {
-        return S_FOREIGNATTR_SETTER;
-      }
-      else if (m_name.equals("*"))
-      {
-        m_setterString = "addLiteralResultAttribute";
-
-        return m_setterString;
-      }
-
-      StringBuffer outBuf = new StringBuffer();
-
-      outBuf.append("set");
-
-      if ((m_namespace != null)
-              && m_namespace.equals(Constants.S_XMLNAMESPACEURI))
-      {
-        outBuf.append("Xml");
-      }
-
-      int n = m_name.length();
-
-      for (int i = 0; i < n; i++)
-      {
-        char c = m_name.charAt(i);
-
-        if ('-' == c)
-        {
-          i++;
-
-          c = m_name.charAt(i);
-          c = Character.toUpperCase(c);
-        }
-        else if (0 == i)
-        {
-          c = Character.toUpperCase(c);
-        }
-
-        outBuf.append(c);
-      }
-
-      m_setterString = outBuf.toString();
-    }
-
-    return m_setterString;
-  }
-
-  /**
-   * Process an attribute string of type T_AVT into
-   * a AVT value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value Should be an Attribute Value Template string.
-   *
-   * @return An AVT object that may be used to evaluate the Attribute Value Template.
-   *
-   * @throws org.xml.sax.SAXException which will wrap a
-   * {@link javax.xml.transform.TransformerException}, if there is a syntax error
-   * in the attribute value template string.
-   */
-  AVT processAVT(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      AVT avt = new AVT(handler, uri, name, rawName, value);
-
-      return avt;
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Process an attribute string of type T_CDATA into
-   * a String value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value non-null string reference.
-   *
-   * @return The value argument.
-   */
-  Object processCDATA(StylesheetHandler handler, String uri, String name,
-                      String rawName, String value)
-  {
-    return value;
-  }
-
-  /**
-   * Process an attribute string of type T_CHAR into
-   * a Character value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value Should be a string with a length of 1.
-   *
-   * @return Character object.
-   *
-   * @throws org.xml.sax.SAXException if the string is not a length of 1.
-   */
-  Object processCHAR(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    if (value.length() != 1)
-    {
-      handler.error(
-        "An XSLT attribute of type T_CHAR must be only 1 character!", null);
-    }
-
-    return new Character(value.charAt(0));
-  }
-
-  /**
-   * Process an attribute string of type T_ENUM into
-   * a int value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value non-null string that represents an enumerated value that is
-   * valid for this element.
-   *
-   * @return An Integer representation of the enumerated value.
-   */
-  Object processENUM(StylesheetHandler handler, String uri, String name,
-                     String rawName, String value)
-  {
-
-    int enum = this.getEnum(value);
-
-    return new Integer(enum);
-  }
-
-  /**
-   * Process an attribute string of type T_EXPR into
-   * an XPath value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value An XSLT expression string.
-   *
-   * @return an XPath object that may be used for evaluation.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the expression
-   * string contains a syntax error.
-   */
-  Object processEXPR(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      XPath expr = handler.createXPath(value);
-
-      return expr;
-    }
-    catch (TransformerException te)
-    {
-      org.xml.sax.SAXException se = new org.xml.sax.SAXException(te);
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Process an attribute string of type T_NMTOKEN into
-   * a String value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A NMTOKEN string.
-   *
-   * @return the value argument.
-   */
-  Object processNMTOKEN(StylesheetHandler handler, String uri, String name,
-                        String rawName, String value)
-  {
-    return value;
-  }
-
-  /**
-   * Process an attribute string of type T_PATTERN into
-   * an XPath match pattern value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A match pattern string.
-   *
-   * @return An XPath pattern that may be used to evaluate the XPath.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if the match pattern
-   * string contains a syntax error.
-   */
-  Object processPATTERN(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      XPath pattern = handler.createMatchPatternXPath(value);
-
-      return pattern;
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Process an attribute string of type T_PRIORITY into
-   * a double value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A string that can be parsed into a double value.
-   *
-   * @return A Double object.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException}
-   * if the string does not contain a parsable number.
-   */
-  Object processPRIORITY(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      return Double.valueOf(value);
-    }
-    catch (NumberFormatException nfe)
-    {
-      handler.error(XSLTErrorResources.ER_PRIORITY_NOT_PARSABLE, null, nfe);//"Priority value does not contain a parsable number.",
-                    //nfe);
-
-      return new Double(0.0);
-    }
-  }
-
-  /**
-   * Process an attribute string of type T_QNAME into
-   * a QName value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A string that represents a potentially prefix qualified name.
-   *
-   * @return A QName object.
-   *
-   * @throws org.xml.sax.SAXException if the string contains a prefix that can not be
-   * resolved, or the string contains syntax that is invalid for a qualified name.
-   */
-  Object processQNAME(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-    return new QName(value, handler);
-  }
-
-  /**
-   * Process an attribute string of type T_QNAMES into
-   * a vector of QNames.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A whitespace delimited list of qualified names.
-   *
-   * @return a Vector of QName objects.
-   *
-   * @throws org.xml.sax.SAXException if the one of the qualified name strings
-   * contains a prefix that can not be
-   * resolved, or a qualified name contains syntax that is invalid for a qualified name.
-   */
-  Vector processQNAMES(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f");
-    int nQNames = tokenizer.countTokens();
-    Vector qnames = new Vector(nQNames);
-
-    for (int i = 0; i < nQNames; i++)
-    {
-      // Fix from Alexander Rudnev
-      qnames.addElement(new QName(tokenizer.nextToken(), handler));
-    }
-
-    return qnames;
-  }
-
-  /**
-   * Process an attribute string of type T_SIMPLEPATTERNLIST into
-   * a vector of XPath match patterns.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A whitespace delimited list of simple match patterns.
-   *
-   * @return A Vector of XPath objects.
-   *
-   * @throws org.xml.sax.SAXException that wraps a
-   * {@link javax.xml.transform.TransformerException} if one of the match pattern
-   * strings contains a syntax error.
-   */
-  Vector processSIMPLEPATTERNLIST(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f");
-      int nPatterns = tokenizer.countTokens();
-      Vector patterns = new Vector(nPatterns);
-
-      for (int i = 0; i < nPatterns; i++)
-      {
-        XPath pattern =
-          handler.createMatchPatternXPath(tokenizer.nextToken());
-
-        patterns.addElement(pattern);
-      }
-
-      return patterns;
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Process an attribute string of type T_STRINGLIST into
-   * a vector of XPath match patterns.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value a whitespace delimited list of string values.
-   *
-   * @return A StringVector of the tokenized strings.
-   */
-  StringVector processSTRINGLIST(StylesheetHandler handler, String uri,
-                                 String name, String rawName, String value)
-  {
-
-    StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f");
-    int nStrings = tokenizer.countTokens();
-    StringVector strings = new StringVector(nStrings);
-
-    for (int i = 0; i < nStrings; i++)
-    {
-      strings.addElement(tokenizer.nextToken());
-    }
-
-    return strings;
-  }
-
-  /**
-   * Process an attribute string of type T_URLLIST into
-   * a vector of prefixes that may be resolved to URLs.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A list of whitespace delimited prefixes.
-   *
-   * @return A vector of strings that may be resolved to URLs.
-   *
-   * @throws org.xml.sax.SAXException if one of the prefixes can not be resolved.
-   */
-  StringVector processPREFIX_URLLIST(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f");
-    int nStrings = tokenizer.countTokens();
-    StringVector strings = new StringVector(nStrings);
-
-    for (int i = 0; i < nStrings; i++)
-    {
-      String prefix = tokenizer.nextToken();
-      String url = handler.getNamespaceForPrefix(prefix);
-
-      strings.addElement(url);
-    }
-
-    return strings;
-  }
-
-  /**
-   * Process an attribute string of type T_URL into
-   * a URL value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value non-null string that conforms to the URL syntax.
-   *
-   * @return The non-absolutized URL argument, in other words, the value argument.
-   *
-   * @throws org.xml.sax.SAXException if the URL does not conform to the URL syntax.
-   */
-  String processURL(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    // TODO: syntax check URL value.
-    // return SystemIDResolver.getAbsoluteURI(value, 
-    //                                         handler.getBaseIdentifier());
-    return value;
-  }
-
-  /**
-   * Process an attribute string of type T_YESNO into
-   * a Boolean value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value A string that should be "yes" or "no".
-   *
-   * @return Boolean object representation of the value.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  private Boolean processYESNO(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    // Is this already checked somewhere else?  -sb
-    if (!(value.equals("yes") || value.equals("no")))
-      handler.error(XSLTErrorResources.ER_VALUE_SHOULD_EQUAL, new Object[]{name}, null);//"Value for " + name + " should equal 'yes' or 'no'",
-                    //null);
-
-    return new Boolean(value.equals("yes") ? true : false);
-  }
-
-  /**
-   * Process an attribute value.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param name The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param value The unprocessed string value of the attribute.
-   *
-   * @return The processed Object representation of the attribute.
-   *
-   * @throws org.xml.sax.SAXException if the attribute value can not be processed.
-   */
-  Object processValue(
-          StylesheetHandler handler, String uri, String name, String rawName, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    int type = getType();
-    Object processedValue = null;
-
-    switch (type)
-    {
-    case T_AVT :
-      processedValue = processAVT(handler, uri, name, rawName, value);
-      break;
-    case T_CDATA :
-      processedValue = processCDATA(handler, uri, name, rawName, value);
-      break;
-    case T_CHAR :
-      processedValue = processCHAR(handler, uri, name, rawName, value);
-      break;
-    case T_ENUM :
-      processedValue = processENUM(handler, uri, name, rawName, value);
-      break;
-    case T_EXPR :
-      processedValue = processEXPR(handler, uri, name, rawName, value);
-      break;
-    case T_NMTOKEN :
-      processedValue = processNMTOKEN(handler, uri, name, rawName, value);
-      break;
-    case T_PATTERN :
-      processedValue = processPATTERN(handler, uri, name, rawName, value);
-      break;
-    case T_PRIORITY :
-      processedValue = processPRIORITY(handler, uri, name, rawName, value);
-      break;
-    case T_QNAME :
-      processedValue = processQNAME(handler, uri, name, rawName, value);
-      break;
-    case T_QNAMES :
-      processedValue = processQNAMES(handler, uri, name, rawName, value);
-      break;
-    case T_SIMPLEPATTERNLIST :
-      processedValue = processSIMPLEPATTERNLIST(handler, uri, name, rawName,
-                                                value);
-      break;
-    case T_URL :
-      processedValue = processURL(handler, uri, name, rawName, value);
-      break;
-    case T_YESNO :
-      processedValue = processYESNO(handler, uri, name, rawName, value);
-      break;
-    case T_STRINGLIST :
-      processedValue = processSTRINGLIST(handler, uri, name, rawName, value);
-      break;
-    case T_PREFIX_URLLIST :
-      processedValue = processPREFIX_URLLIST(handler, uri, name, rawName,
-                                             value);
-      break;
-    default :
-    }
-
-    return processedValue;
-  }
-
-  /**
-   * Set the default value of an attribute.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param elem The object on which the property will be set.
-   *
-   * @throws org.xml.sax.SAXException wraps an invocation exception if the
-   * setter method can not be invoked on the object.
-   */
-  void setDefAttrValue(StylesheetHandler handler, Object elem)
-          throws org.xml.sax.SAXException
-  {
-    setAttrValue(handler, this.getNamespace(), this.getName(),
-                 this.getName(), this.getDefault(), elem);
-  }
-
-  /**
-   * Get the primative type for the class, if there
-   * is one.  If the class is a Double, for instance,
-   * this will return double.class.  If the class is not one
-   * of the 9 primative types, it will return the same
-   * class that was passed in.
-   *
-   * @param obj The object which will be resolved to a primative class object if possible.
-   *
-   * @return The most primative class representation possible for the object, never null.
-   */
-  private Class getPrimativeClass(Object obj)
-  {
-
-    if (obj instanceof XPath)
-      return XPath.class;
-
-    Class cl = obj.getClass();
-
-    if (cl == Double.class)
-    {
-      cl = double.class;
-    }
-
-    if (cl == Float.class)
-    {
-      cl = float.class;
-    }
-    else if (cl == Boolean.class)
-    {
-      cl = boolean.class;
-    }
-    else if (cl == Byte.class)
-    {
-      cl = byte.class;
-    }
-    else if (cl == Character.class)
-    {
-      cl = char.class;
-    }
-    else if (cl == Short.class)
-    {
-      cl = short.class;
-    }
-    else if (cl == Integer.class)
-    {
-      cl = int.class;
-    }
-    else if (cl == Long.class)
-    {
-      cl = long.class;
-    }
-
-    return cl;
-  }
-
-  /**
-   * Set a value on an attribute.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param attrUri The Namespace URI of the attribute, or an empty string.
-   * @param attrLocalName The local name (without prefix), or empty string if not namespace processing.
-   * @param attrRawName The raw name of the attribute, including possible prefix.
-   * @param attrValue The attribute's value.
-   * @param elem The object that should contain a property that represents the attribute.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  void setAttrValue(
-          StylesheetHandler handler, String attrUri, String attrLocalName, String attrRawName, String attrValue, Object elem)
-            throws org.xml.sax.SAXException
-  {
-    if(attrRawName.equals("xmlns") || attrRawName.startsWith("xmlns:"))
-      return;
-      
-    String setterString = getSetterMethodName();
-
-    // If this is null, then it is a foreign namespace and we 
-    // do not process it.
-    if (null != setterString)
-    {
-      try
-      {
-        Method meth;
-        Object[] args;
-
-        if(setterString.equals(S_FOREIGNATTR_SETTER))
-        {
-          // workaround for possible crimson bug
-          if( attrUri==null) attrUri="";
-          // First try to match with the primative value.
-          Class sclass = attrUri.getClass();
-          Class[] argTypes = new Class[]{ sclass, sclass,
-                                      sclass, sclass };
-  
-          meth = elem.getClass().getMethod(setterString, argTypes);
-  
-          args = new Object[]{ attrUri, attrLocalName,
-                                      attrRawName, attrValue };
-        }
-        else
-        {
-          Object value = processValue(handler, attrUri, attrLocalName,
-                                      attrRawName, attrValue);
-                                      
-          // First try to match with the primative value.
-          Class[] argTypes = new Class[]{ getPrimativeClass(value) };
-  
-          try
-          {
-            meth = elem.getClass().getMethod(setterString, argTypes);
-          }
-          catch (NoSuchMethodException nsme)
-          {
-            Class cl = ((Object) value).getClass();
-  
-            // If this doesn't work, try it with the non-primative value;
-            argTypes[0] = cl;
-            meth = elem.getClass().getMethod(setterString, argTypes);
-          }
-  
-          args = new Object[]{ value };
-        }
-
-        meth.invoke(elem, args);
-      }
-      catch (NoSuchMethodException nsme)
-      {
-        if (!setterString.equals(S_FOREIGNATTR_SETTER))
-          handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme);
-      }
-      catch (IllegalAccessException iae)
-      {
-        handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae);
-      }
-      catch (InvocationTargetException nsme)
-      {
-        handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme);
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xalan/processor/XSLTElementDef.java b/src/org/apache/xalan/processor/XSLTElementDef.java
deleted file mode 100644
index eabf400..0000000
--- a/src/org/apache/xalan/processor/XSLTElementDef.java
+++ /dev/null
@@ -1,866 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.xml.sax.ContentHandler;
-
-import org.apache.xalan.templates.Constants;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-/**
- * This class defines the allowed structure for an element in a XSLT stylesheet,
- * is meant to reflect the structure defined in http://www.w3.org/TR/xslt#dtd, and the
- * mapping between Xalan classes and the markup elements in the XSLT instance.
- * This actually represents both text nodes and elements.
- */
-public class XSLTElementDef
-{
-
-  /**
-   * Construct an instance of XSLTElementDef.  This must be followed by a
-   * call to build().
-   */
-  XSLTElementDef(){}
-
-  /**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject)
-  {
-    build(namespace, name, nameAlias, elements, attributes, contentHandler,
-          classObject);
-    if ( (null != namespace)
-    &&  (namespace.equals(Constants.S_XSLNAMESPACEURL)
-        || namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL)) )
-    {
-      schema.addAvailableElement(new QName(namespace, name));
-      if(null != nameAlias)
-        schema.addAvailableElement(new QName(namespace, nameAlias));
-    } 
-  }
-	
-	/**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   * @param has_required true if this element has required elements by the XSLT specification.
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject, boolean has_required)
-  {
-		this.m_has_required = has_required;
-    build(namespace, name, nameAlias, elements, attributes, contentHandler,
-          classObject);
-    if ( (null != namespace)
-    &&  (namespace.equals(Constants.S_XSLNAMESPACEURL)
-        || namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL)) )
-    {
-      schema.addAvailableElement(new QName(namespace, name));
-      if(null != nameAlias)
-        schema.addAvailableElement(new QName(namespace, nameAlias));
-    } 
-		
-  }
-	
-	/**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   * @param has_required true if this element has required elements by the XSLT specification.
-   * @param required true if this element is required by the XSLT specification.
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject, 
-								 boolean has_required, boolean required)
-  {
-    this(schema, namespace, name,  nameAlias,
-                 elements, attributes,
-                 contentHandler, classObject, has_required);
-		this.m_required = required;
-  }
-	
-	/**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   * @param has_required true if this element has required elements by the XSLT specification.
-   * @param required true if this element is required by the XSLT specification.
-   * @param order the order this element should appear according to the XSLT specification.   
-   * @param multiAllowed whether this element is allowed more than once
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject, 
-								 boolean has_required, boolean required, int order, 
-								 boolean multiAllowed)
-  {
-		this(schema, namespace, name,  nameAlias,
-                 elements, attributes,
-                 contentHandler, classObject, has_required, required);    
-		this.m_order = order;
-		this.m_multiAllowed = multiAllowed;
-  }
-	
-	/**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   * @param has_required true if this element has required elements by the XSLT specification.
-   * @param required true if this element is required by the XSLT specification.
-   * @param has_order whether this element has ordered child elements
-   * @param order the order this element should appear according to the XSLT specification.   
-   * @param multiAllowed whether this element is allowed more than once
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject, 
-								 boolean has_required, boolean required, boolean has_order, int order, 
-								 boolean multiAllowed)
-  {
-		this(schema, namespace, name,  nameAlias,
-                 elements, attributes,
-                 contentHandler, classObject, has_required, required);    
-		this.m_order = order;
-		this.m_multiAllowed = multiAllowed;
-    this.m_isOrdered = has_order;		
-  }
-	
-	/**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   * @param has_order whether this element has ordered child elements
-   * @param order the order this element should appear according to the XSLT specification.   
-   * @param multiAllowed whether this element is allowed more than once
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject, 
-								 boolean has_order, int order, boolean multiAllowed)
-  {
-    this(schema, namespace, name,  nameAlias,
-                 elements, attributes,
-                 contentHandler, classObject, 
-								 order, multiAllowed);
-		this.m_isOrdered = has_order;		
-  }
-	
-	/**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   * @param order the order this element should appear according to the XSLT specification.   
-   * @param multiAllowed whether this element is allowed more than once
-   */
-  XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias,
-                 XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-                 XSLTElementProcessor contentHandler, Class classObject, 
-								 int order, boolean multiAllowed)
-  {
-    this(schema, namespace, name, nameAlias, elements, attributes, contentHandler,
-          classObject);
-    this.m_order = order;
-		this.m_multiAllowed = multiAllowed;
-  }
-
-  /**
-   * Construct an instance of XSLTElementDef that represents text.
-   *
-   * @param classObject The class of the object that this element def should produce.
-   * @param contentHandler The element processor for this element.
-   * @param type Content type, one of T_ELEMENT, T_PCDATA, or T_ANY.
-   */
-  XSLTElementDef(Class classObject, XSLTElementProcessor contentHandler,
-                 int type)
-  {
-
-    this.m_classObject = classObject;
-    this.m_type = type;
-
-    setElementProcessor(contentHandler);
-  }
-
-  /**
-   * Construct an instance of XSLTElementDef.
-   *
-   * @param namespace  The Namespace URI, "*", or null.
-   * @param name The local name (without prefix), "*", or null.
-   * @param nameAlias A potential alias for the name, or null.
-   * @param elements An array of allowed child element defs, or null.
-   * @param attributes An array of allowed attribute defs, or null.
-   * @param contentHandler The element processor for this element.
-   * @param classObject The class of the object that this element def should produce.
-   */
-  void build(String namespace, String name, String nameAlias,
-             XSLTElementDef[] elements, XSLTAttributeDef[] attributes,
-             XSLTElementProcessor contentHandler, Class classObject)
-  {
-
-    this.m_namespace = namespace;
-    this.m_name = name;
-    this.m_nameAlias = nameAlias;
-    this.m_elements = elements;
-    this.m_attributes = attributes;
-
-    setElementProcessor(contentHandler);
-
-    this.m_classObject = classObject;
-		
-		if (hasRequired() && m_elements != null)
-		{
-			int n = m_elements.length;
-			for (int i = 0; i < n; i++)
-			{
-				XSLTElementDef def = m_elements[i];
-				
-				if (def != null && def.getRequired())
-				{
-					if (m_requiredFound == null)			
-						m_requiredFound = new Hashtable();
-					m_requiredFound.put(def.getName(), "xsl:" +def.getName()); 
-				}
-			}
-		}
-  }
-
-  /**
-   * Tell if two objects are equal, when either one may be null.
-   * If both are null, they are considered equal.
-   *
-   * @param obj1 A reference to the first object, or null.
-   * @param obj2 A reference to the second object, or null.
-   *
-   * @return true if the to objects are equal by both being null or 
-   * because obj2.equals(obj1) returns true.
-   */
-  private static boolean equalsMayBeNull(Object obj1, Object obj2)
-  {
-    return (obj2 == obj1)
-           || ((null != obj1) && (null != obj2) && obj2.equals(obj1));
-  }
-
-  /**
-   * Tell if the two string refs are equal,
-   * equality being defined as:
-   * 1) Both strings are null.
-   * 2) One string is null and the other is empty.
-   * 3) Both strings are non-null, and equal.
-   *
-   * @param s1 A reference to the first string, or null.
-   * @param s2 A reference to the second string, or null.
-   *
-   * @return true if Both strings are null, or if 
-   * one string is null and the other is empty, or if 
-   * both strings are non-null, and equal because 
-   * s1.equals(s2) returns true.
-   */
-  private static boolean equalsMayBeNullOrZeroLen(String s1, String s2)
-  {
-
-    int len1 = (s1 == null) ? 0 : s1.length();
-    int len2 = (s2 == null) ? 0 : s2.length();
-
-    return (len1 != len2) ? false : (len1 == 0) ? true : s1.equals(s2);
-  }
-
-  /** Content type enumerations    */
-  static final int T_ELEMENT = 1, T_PCDATA = 2, T_ANY = 3;
-
-  /**
-   * The type of this element.
-   */
-  private int m_type = T_ELEMENT;
-
-  /**
-   * Get the type of this element.
-   *
-   * @return Content type, one of T_ELEMENT, T_PCDATA, or T_ANY.
-   */
-  int getType()
-  {
-    return m_type;
-  }
-
-  /**
-   * Set the type of this element.
-   *
-   * @param t Content type, one of T_ELEMENT, T_PCDATA, or T_ANY.
-   */
-  void setType(int t)
-  {
-    m_type = t;
-  }
-
-  /**
-   * The allowed namespace for this element.
-   */
-  private String m_namespace;
-
-  /**
-   * Get the allowed namespace for this element.
-   *
-   * @return The Namespace URI, "*", or null.
-   */
-  String getNamespace()
-  {
-    return m_namespace;
-  }
-
-  /**
-   * The name of this element.
-   */
-  private String m_name;
-
-  /**
-   * Get the local name of this element.
-   *
-   * @return The local name of this element, "*", or null.
-   */
-  String getName()
-  {
-    return m_name;
-  }
-
-  /**
-   * The name of this element.
-   */
-  private String m_nameAlias;
-
-  /**
-   * Get the name of this element.
-   *
-   * @return A potential alias for the name, or null.
-   */
-  String getNameAlias()
-  {
-    return m_nameAlias;
-  }
-
-  /**
-   * The allowed elements for this type.
-   */
-  private XSLTElementDef[] m_elements;
-
-  /**
-   * Get the allowed elements for this type.
-   *
-   * @return An array of allowed child element defs, or null.
-   */
-  XSLTElementDef[] getElements()
-  {
-    return m_elements;
-  }
-
-  /**
-   * Set the allowed elements for this type.
-   *
-   * @param defs An array of allowed child element defs, or null.
-   */
-  void setElements(XSLTElementDef[] defs)
-  {
-    m_elements = defs;
-  }
-
-  /**
-   * Tell if the namespace URI and local name match this
-   * element.
-   * @param uri The namespace uri, which may be null.
-   * @param localName The local name of an element, which may be null.
-   *
-   * @return true if the uri and local name arguments are considered 
-   * to match the uri and local name of this element def.
-   */
-  private boolean QNameEquals(String uri, String localName)
-  {
-
-    return (equalsMayBeNullOrZeroLen(m_namespace, uri)
-            && (equalsMayBeNullOrZeroLen(m_name, localName)
-                || equalsMayBeNullOrZeroLen(m_nameAlias, localName)));
-  }
-
-  /**
-   * Given a namespace URI, and a local name, get the processor
-   * for the element, or return null if not allowed.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   *
-   * @return The element processor that matches the arguments, or null.
-   */
-  XSLTElementProcessor getProcessorFor(String uri, String localName) 
-	{
-
-    XSLTElementProcessor elemDef = null;  // return value
-
-    if (null == m_elements)
-      return null;
-
-    int n = m_elements.length;
-    int order = -1;
-		boolean multiAllowed = true;
-    for (int i = 0; i < n; i++)
-    {
-      XSLTElementDef def = m_elements[i];
-
-      // A "*" signals that the element allows literal result
-      // elements, so just assign the def, and continue to  
-      // see if anything else matches.
-      if (def.m_name.equals("*"))
-      {
-				
-        // Don't allow xsl elements
-        if (!equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL))
-				{
-          elemDef = def.m_elementProcessor;
-				  order = def.getOrder();
-					multiAllowed = def.getMultiAllowed();
-				}
-      }
-			else if (def.QNameEquals(uri, localName))
-			{	
-				if (def.getRequired())
-					this.setRequiredFound(def.getName(), true);
-				order = def.getOrder();
-				multiAllowed = def.getMultiAllowed();
-				elemDef = def.m_elementProcessor;
-				break;
-			}
-		}		
-		
-		if (elemDef != null && this.isOrdered())
-		{			
-			int lastOrder = getLastOrder();
-			if (order > lastOrder)
-				setLastOrder(order);
-			else if (order == lastOrder && !multiAllowed)
-			{
-				return null;
-			}
-			else if (order < lastOrder && order > 0)
-			{
-				return null;
-			}
-		}
-
-    return elemDef;
-  }
-
-  /**
-   * Given an unknown element, get the processor
-   * for the element.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   *
-   * @return normally a {@link ProcessorUnknown} reference.
-   * @see ProcessorUnknown
-   */
-  XSLTElementProcessor getProcessorForUnknown(String uri, String localName)
-  {
-
-    // XSLTElementProcessor lreDef = null; // return value
-    if (null == m_elements)
-      return null;
-
-    int n = m_elements.length;
-
-    for (int i = 0; i < n; i++)
-    {
-      XSLTElementDef def = m_elements[i];
-
-      if (def.m_name.equals("unknown") && uri.length() > 0)
-      {
-        return def.m_elementProcessor;
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * The allowed attributes for this type.
-   */
-  private XSLTAttributeDef[] m_attributes;
-
-  /**
-   * Get the allowed attributes for this type.
-   *
-   * @return An array of allowed attribute defs, or null.
-   */
-  XSLTAttributeDef[] getAttributes()
-  {
-    return m_attributes;
-  }
-
-  /**
-   * Given a namespace URI, and a local name, return the element's
-   * attribute definition, if it has one.
-   *
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   *
-   * @return The attribute def that matches the arguments, or null.
-   */
-  XSLTAttributeDef getAttributeDef(String uri, String localName)
-  {
-
-    XSLTAttributeDef defaultDef = null;
-    XSLTAttributeDef[] attrDefs = getAttributes();
-    int nAttrDefs = attrDefs.length;
-
-    for (int k = 0; k < nAttrDefs; k++)
-    {
-      XSLTAttributeDef attrDef = attrDefs[k];
-      String uriDef = attrDef.getNamespace();
-      String nameDef = attrDef.getName();
-      
-      if (nameDef.equals("*") && (equalsMayBeNullOrZeroLen(uri, uriDef) || 
-          (uriDef != null && uri.length() > 0 && uriDef.equals("*"))))
-      {
-        return attrDef;
-      }
-      else if (nameDef.equals("*") && (uriDef == null))
-      {
-
-        // In this case, all attributes are legal, so return 
-        // this as the last resort.
-        defaultDef = attrDef;
-      }
-      else if (equalsMayBeNullOrZeroLen(uri, uriDef)
-               && localName.equals(nameDef))
-      {
-        return attrDef;
-      }
-    }
-
-    if (null == defaultDef)
-    {
-      if (uri.length() > 0 && !equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL))
-      {
-        return XSLTAttributeDef.m_foreignAttr;
-      }
-    }
-
-    return defaultDef;
-  }
-
-  /**
-   * If non-null, the ContentHandler/TransformerFactory for this element.
-   */
-  private XSLTElementProcessor m_elementProcessor;
-
-  /**
-   * Return the XSLTElementProcessor for this element.
-   *
-   * @return The element processor for this element.
-   */
-  XSLTElementProcessor getElementProcessor()
-  {
-    return m_elementProcessor;
-  }
-
-  /**
-   * Set the XSLTElementProcessor for this element.
-   *
-   * @param handler The element processor for this element.
-   */
-  void setElementProcessor(XSLTElementProcessor handler)
-  {
-
-    if (handler != null)
-    {
-      m_elementProcessor = handler;
-
-      m_elementProcessor.setElemDef(this);
-    }
-  }
-
-  /**
-   * If non-null, the class object that should in instantiated for
-   * a Xalan instance of this element.
-   */
-  private Class m_classObject;
-
-  /**
-   * Return the class object that should in instantiated for
-   * a Xalan instance of this element.
-   *
-   * @return The class of the object that this element def should produce, or null.
-   */
-  Class getClassObject()
-  {
-    return m_classObject;
-  }
-	
-	/**
-   * If true, this has a required element.
-   */
-  private boolean m_has_required = false;
-
-  /**
-   * Get whether or not this has a required element.
-   *
-   * @return true if this this has a required element.
-   */
-  boolean hasRequired()
-  {
-    return m_has_required;
-  }
-	
-	/**
-   * If true, this is a required element.
-   */
-  private boolean m_required = false;
-
-  /**
-   * Get whether or not this is a required element.
-   *
-   * @return true if this is a required element.
-   */
-  boolean getRequired()
-  {
-    return m_required;
-  }
-	
-	Hashtable m_requiredFound;
-	
-	/**
-   * Set this required element found.
-   *
-   */
-  void setRequiredFound(String elem, boolean found)
-  {
-   if (m_requiredFound.get(elem) != null) 
-		 m_requiredFound.remove(elem);
-  }
-	
-	/**
-   * Get whether all required elements were found.
-   *
-   * @return true if all required elements were found.
-   */
-  boolean getRequiredFound()
-  {
-		if (m_requiredFound == null)
-			return true;
-    return m_requiredFound.isEmpty();
-  }
-	
-	/**
-   * Get required elements that were not found.
-   *
-   * @return required elements that were not found.
-   */
-  String getRequiredElem()
-  {
-		if (m_requiredFound == null)
-			return null;
-		Enumeration elems = m_requiredFound.elements();
-		String s = "";
-		boolean first = true;
-		while (elems.hasMoreElements())
-		{
-			if (first)
-				first = false;
-			else
-			 s = s + ", ";
-			s = s + (String)elems.nextElement();
-		}
-    return s;
-  }
-	
-	boolean m_isOrdered = false;	
-	
-	/**
-   * Get whether this element requires ordered children.
-   *
-   * @return true if this element requires ordered children.
-   */
-  boolean isOrdered()
-  {
-		/*if (!m_CheckedOrdered)
-		{
-			m_CheckedOrdered = true;
-			m_isOrdered = false;
-			if (null == m_elements)
-				return false;
-
-			int n = m_elements.length;
-
-			for (int i = 0; i < n; i++)
-			{
-				if (m_elements[i].getOrder() > 0)
-				{
-					m_isOrdered = true;
-					return true;
-				}
-			}
-			return false;
-		}
-		else*/
-			return m_isOrdered;
-  }
-	
-	/**
-   * the order that this element should appear, or -1 if not ordered
-   */
-  private int m_order = -1;
-	
-	/**
-   * Get the order that this element should appear .
-   *
-   * @return the order that this element should appear.
-   */
-  int getOrder()
-  {
-    return m_order;
-  }
-	
-	/**
-   * the highest order of child elements have appeared so far, 
-   * or -1 if not ordered
-   */
-  private int m_lastOrder = -1;
-	
-	/**
-   * Get the highest order of child elements have appeared so far .
-   *
-   * @return the highest order of child elements have appeared so far.
-   */
-  int getLastOrder()
-  {
-    return m_lastOrder;
-  }
-	
-	/**
-   * Set the highest order of child elements have appeared so far .
-   *
-   * @param order the highest order of child elements have appeared so far.
-   */
-  void setLastOrder(int order)
-  {
-    m_lastOrder = order ;
-  }
-	
-	/**
-   * True if this element can appear multiple times
-   */
-  private boolean m_multiAllowed = true;
-	
-	/**
-   * Get whether this element can appear multiple times
-   *
-   * @return true if this element can appear multiple times
-   */
-  boolean getMultiAllowed()
-  {
-    return m_multiAllowed;
-  }
-}
diff --git a/src/org/apache/xalan/processor/XSLTElementProcessor.java b/src/org/apache/xalan/processor/XSLTElementProcessor.java
deleted file mode 100644
index 5a2fee8..0000000
--- a/src/org/apache/xalan/processor/XSLTElementProcessor.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.Attributes;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.Constants;
-import org.apache.xml.utils.IntStack;
-
-import org.xml.sax.helpers.AttributesImpl;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-
-import java.util.Vector;
-
-/**
- * This class acts as the superclass for all stylesheet element
- * processors, and deals with things that are common to all elements.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- */
-public class XSLTElementProcessor
-{
-
-  /**
-   * Construct a processor for top-level elements.
-   * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
-   */
-  XSLTElementProcessor(){}
-	
-	private IntStack m_savedLastOrder;
-
-  /**
-   * The element definition that this processor conforms to.
-   */
-  private XSLTElementDef m_elemDef;
-
-  /**
-   * Get the element definition that belongs to this element.
-   *
-   * @return The element definition object that produced and constrains this element.
-   */
-  XSLTElementDef getElemDef()
-  {
-    return m_elemDef;
-  }
-
-  /**
-   * Set the element definition that belongs to this element.
-   *
-   * @param def The element definition object that produced and constrains this element.
-   */
-  void setElemDef(XSLTElementDef def)
-  {
-    m_elemDef = def;
-  }
-
-  /**
-   * Resolve an external entity.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param publicId The public identifer, or null if none is
-   *                 available.
-   * @param systemId The system identifier provided in the XML
-   *                 document.
-   * @return The new input source, or null to require the
-   *         default behaviour.
-   */
-  public InputSource resolveEntity(
-          StylesheetHandler handler, String publicId, String systemId)
-            throws org.xml.sax.SAXException
-  {
-    return null;
-  }
-
-  /**
-   * Receive notification of a notation declaration.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param name The notation name.
-   * @param publicId The notation public identifier, or null if not
-   *                 available.
-   * @param systemId The notation system identifier.
-   * @see org.xml.sax.DTDHandler#notationDecl
-   */
-  public void notationDecl(StylesheetHandler handler, String name,
-                           String publicId, String systemId)
-  {
-
-    // no op
-  }
-
-  /**
-   * Receive notification of an unparsed entity declaration.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param name The entity name.
-   * @param publicId The entity public identifier, or null if not
-   *                 available.
-   * @param systemId The entity system identifier.
-   * @param notationName The name of the associated notation.
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void unparsedEntityDecl(StylesheetHandler handler, String name,
-                                 String publicId, String systemId,
-                                 String notationName)
-  {
-
-    // no op
-  }
-
-  /**
-   * Receive notification of the start of the non-text event.  This
-   * is sent to the current processor when any non-text event occurs.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   */
-  public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * @param name The element type name.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   * @param attributes The specified or defaulted attributes.
-   */
-  public void startElement(
-          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
-            throws org.xml.sax.SAXException
-  {
-
-    if (m_savedLastOrder == null)
-				m_savedLastOrder = new IntStack();
-			m_savedLastOrder.push(getElemDef().getLastOrder());
-			getElemDef().setLastOrder(-1);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param uri The Namespace URI, or an empty string.
-   * @param localName The local name (without prefix), or empty string if not namespace processing.
-   * @param rawName The qualified name (with prefix).
-   */
-  public void endElement(
-          StylesheetHandler handler, String uri, String localName, String rawName)
-            throws org.xml.sax.SAXException
-  {
-		if (m_savedLastOrder != null && !m_savedLastOrder.empty())
-			getElemDef().setLastOrder(m_savedLastOrder.pop());
-		
-		if (!getElemDef().getRequiredFound())
-			handler.error(XSLTErrorResources.ER_REQUIRED_ELEM_NOT_FOUND, new Object[]{getElemDef().getRequiredElem()}, null);
-  }
-
-  /**
-   * Receive notification of character data inside an element.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param ch The characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   */
-  public void characters(
-          StylesheetHandler handler, char ch[], int start, int length)
-            throws org.xml.sax.SAXException
-  {
-    handler.error(XSLTErrorResources.ER_CHARS_NOT_ALLOWED, null, null);//"Characters are not allowed at this point in the document!",
-                  //null);
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param ch The whitespace characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   */
-  public void ignorableWhitespace(
-          StylesheetHandler handler, char ch[], int start, int length)
-            throws org.xml.sax.SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *             none is supplied.
-   */
-  public void processingInstruction(
-          StylesheetHandler handler, String target, String data)
-            throws org.xml.sax.SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Receive notification of a skipped entity.
-   *
-   *
-   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
-   * @param name The name of the skipped entity.
-   */
-  public void skippedEntity(StylesheetHandler handler, String name)
-          throws org.xml.sax.SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Set the properties of an object from the given attribute list.
-   * @param handler The stylesheet's Content handler, needed for
-   *                error reporting.
-   * @param rawName The raw name of the owner element, needed for
-   *                error reporting.
-   * @param attributes The list of attributes.
-   * @param target The target element where the properties will be set.
-   */
-  void setPropertiesFromAttributes(
-          StylesheetHandler handler, String rawName, Attributes attributes, Object target)
-            throws org.xml.sax.SAXException
-  {
-    setPropertiesFromAttributes(handler, rawName, attributes, target, true);
-  }
-
-  /**
-   * Set the properties of an object from the given attribute list.
-   * @param handler The stylesheet's Content handler, needed for
-   *                error reporting.
-   * @param rawName The raw name of the owner element, needed for
-   *                error reporting.
-   * @param attributes The list of attributes.
-   * @param target The target element where the properties will be set.
-   * @param throwError True if it should throw an error if an
-   * attribute is not defined.
-   * @return the attributes not allowed on this element.
-   *
-   * @throws TransformerException
-   */
-  Attributes setPropertiesFromAttributes(
-          StylesheetHandler handler, String rawName, Attributes attributes, Object target, boolean throwError)
-            throws org.xml.sax.SAXException
-  {
-
-    XSLTElementDef def = getElemDef();
-    AttributesImpl undefines = throwError ? null : new AttributesImpl();
-
-    // Keep track of which XSLTAttributeDefs have been processed, so 
-    // I can see which default values need to be set.
-    Vector processedDefs = new Vector();
-    int nAttrs = attributes.getLength();
-
-    for (int i = 0; i < nAttrs; i++)
-    {
-      String attrUri = attributes.getURI(i);
-      // Hack for Crimson.  -sb
-      if((null != attrUri) && (attrUri.length() == 0)
-                           && (attributes.getQName(i).startsWith("xmlns:") || 
-                               attributes.getQName(i).equals("xmlns")))
-      {
-        attrUri = org.apache.xalan.templates.Constants.S_XMLNAMESPACEURI;
-      }
-      String attrLocalName = attributes.getLocalName(i);
-      XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName);
-
-      if (null == attrDef)
-      {
-        if (throwError)
-        {
-
-          // Then barf, because this element does not allow this attribute.
-          handler.error(XSLTErrorResources.ER_ATTR_NOT_ALLOWED, new Object[]{attributes.getQName(i), rawName}, null);//"\""+attributes.getQName(i)+"\""
-                        //+ " attribute is not allowed on the " + rawName
-                       // + " element!", null);
-        }
-        else
-        {
-          undefines.addAttribute(attrUri, attrLocalName,
-                                 attributes.getQName(i),
-                                 attributes.getType(i),
-                                 attributes.getValue(i));
-        }
-      }
-      else
-      {
-        processedDefs.addElement(attrDef);
-        attrDef.setAttrValue(handler, attrUri, attrLocalName,
-                             attributes.getQName(i), attributes.getValue(i),
-                             target);
-      }
-    }
-
-    XSLTAttributeDef[] attrDefs = def.getAttributes();
-    int nAttrDefs = attrDefs.length;
-
-    for (int i = 0; i < nAttrDefs; i++)
-    {
-      XSLTAttributeDef attrDef = attrDefs[i];
-      String defVal = attrDef.getDefault();
-
-      if (null != defVal)
-      {
-        if (!processedDefs.contains(attrDef))
-        {
-          attrDef.setDefAttrValue(handler, target);
-        }
-      }
-
-      if (attrDef.getRequired())
-      {
-        if (!processedDefs.contains(attrDef))
-          handler.error(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName,
-                                                                   attrDef.getName() }), null);
-      }
-    }
-
-    return undefines;
-  }
-}
diff --git a/src/org/apache/xalan/processor/XSLTSchema.java b/src/org/apache/xalan/processor/XSLTSchema.java
deleted file mode 100644
index 8ed7f71..0000000
--- a/src/org/apache/xalan/processor/XSLTSchema.java
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.processor;
-
-import java.util.Hashtable;
-
-import org.apache.xalan.templates.*;
-import org.apache.xml.utils.QName;
-
-/**
- * This class defines the allowed structure for a stylesheet, and the
- * mapping between Xalan classes and the markup elements in the stylesheet.
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- */
-public class XSLTSchema extends XSLTElementDef
-{
-
-  /**
-   * Construct a XSLTSchema which represents the XSLT "schema".
-   */
-  XSLTSchema()
-  {
-    build();
-  }
-
-  /**
-   * This method builds an XSLT "schema" according to http://www.w3.org/TR/xslt#dtd.  This
-   * schema provides instructions for building the Xalan Stylesheet (Templates) structure.
-   */
-  void build()
-  {
-
-    XSLTAttributeDef hrefAttr = new XSLTAttributeDef(null, "href",
-                                  XSLTAttributeDef.T_URL, true);
-    XSLTAttributeDef elementsAttr = new XSLTAttributeDef(null, "elements",
-                                      XSLTAttributeDef.T_SIMPLEPATTERNLIST,
-                                      true);
-    // XSLTAttributeDef anyNamespacedAttr = new XSLTAttributeDef("*", "*",
-    //                                XSLTAttributeDef.T_CDATA, false);
-    XSLTAttributeDef methodAttr = new XSLTAttributeDef(null, "method",
-                                    XSLTAttributeDef.T_QNAME, false);
-    XSLTAttributeDef versionAttr = new XSLTAttributeDef(null, "version",
-                                     XSLTAttributeDef.T_NMTOKEN, false);
-    XSLTAttributeDef encodingAttr = new XSLTAttributeDef(null, "encoding",
-                                      XSLTAttributeDef.T_CDATA, false);
-    XSLTAttributeDef omitXmlDeclarationAttr = new XSLTAttributeDef(null,
-                                                "omit-xml-declaration",
-                                                XSLTAttributeDef.T_YESNO,
-                                                false);
-    XSLTAttributeDef standaloneAttr = new XSLTAttributeDef(null,
-                                        "standalone",
-                                        XSLTAttributeDef.T_YESNO, false);
-    XSLTAttributeDef doctypePublicAttr = new XSLTAttributeDef(null,
-                                           "doctype-public",
-                                           XSLTAttributeDef.T_CDATA, false);
-    XSLTAttributeDef doctypeSystemAttr = new XSLTAttributeDef(null,
-                                           "doctype-system",
-                                           XSLTAttributeDef.T_CDATA, false);
-    XSLTAttributeDef cdataSectionElementsAttr = new XSLTAttributeDef(null,
-                                                  "cdata-section-elements",
-                                                  XSLTAttributeDef.T_QNAMES,
-                                                  false);
-    XSLTAttributeDef indentAttr = new XSLTAttributeDef(null, "indent",
-                                    XSLTAttributeDef.T_YESNO, false);
-    XSLTAttributeDef mediaTypeAttr = new XSLTAttributeDef(null, "media-type",
-                                       XSLTAttributeDef.T_CDATA, false);
-    XSLTAttributeDef nameAttrRequired = new XSLTAttributeDef(null, "name",
-                                          XSLTAttributeDef.T_QNAME, true);
-    XSLTAttributeDef nameAttrOpt = new XSLTAttributeDef(null, "name",
-                                     XSLTAttributeDef.T_QNAME, false);
-    XSLTAttributeDef useAttr = new XSLTAttributeDef(null, "use",
-                                 XSLTAttributeDef.T_EXPR, true);
-    XSLTAttributeDef nameAVTRequired = new XSLTAttributeDef(null, "name",
-                                         XSLTAttributeDef.T_AVT, true);
-    XSLTAttributeDef namespaceAVTOpt = new XSLTAttributeDef(null,
-                                         "namespace", XSLTAttributeDef.T_AVT,
-                                         false);
-    XSLTAttributeDef decimalSeparatorAttr = new XSLTAttributeDef(null,
-                                              "decimal-separator",
-                                              XSLTAttributeDef.T_CHAR, ".");
-    XSLTAttributeDef groupingSeparatorAttr = new XSLTAttributeDef(null,
-                                               "grouping-separator",
-                                               XSLTAttributeDef.T_CHAR, ",");
-    XSLTAttributeDef infinityAttr = new XSLTAttributeDef(null, "infinity",
-                                      XSLTAttributeDef.T_CDATA, "Infinity");
-    XSLTAttributeDef minusSignAttr = new XSLTAttributeDef(null, "minus-sign",
-                                       XSLTAttributeDef.T_CHAR, "-");
-    XSLTAttributeDef NaNAttr = new XSLTAttributeDef(null, "NaN",
-                                 XSLTAttributeDef.T_CDATA, "NaN");
-    XSLTAttributeDef percentAttr = new XSLTAttributeDef(null, "percent",
-                                     XSLTAttributeDef.T_CHAR, "%");
-    XSLTAttributeDef perMilleAttr = new XSLTAttributeDef(null, "per-mille",
-                                      XSLTAttributeDef.T_CHAR,
-                                      false /* ,"&#x2030;" */);
-    XSLTAttributeDef zeroDigitAttr = new XSLTAttributeDef(null, "zero-digit",
-                                       XSLTAttributeDef.T_CHAR, "0");
-    XSLTAttributeDef digitAttr = new XSLTAttributeDef(null, "digit",
-                                   XSLTAttributeDef.T_CHAR, "#");
-    XSLTAttributeDef patternSeparatorAttr = new XSLTAttributeDef(null,
-                                              "pattern-separator",
-                                              XSLTAttributeDef.T_CHAR, ";");
-    XSLTAttributeDef useAttributeSetsAttr = new XSLTAttributeDef(null,
-                                              "use-attribute-sets",
-                                              XSLTAttributeDef.T_QNAMES,
-                                              false);
-    XSLTAttributeDef selectAttrRequired = new XSLTAttributeDef(null,
-                                            "select",
-                                            XSLTAttributeDef.T_EXPR, true);
-    XSLTAttributeDef testAttrRequired = new XSLTAttributeDef(null, "test",
-                                          XSLTAttributeDef.T_EXPR, true);
-    XSLTAttributeDef selectAttrOpt = new XSLTAttributeDef(null, "select",
-                                       XSLTAttributeDef.T_EXPR, false);
-    XSLTAttributeDef selectAttrDefNode = new XSLTAttributeDef(null, "select",
-                                           XSLTAttributeDef.T_EXPR, "node()");
-    XSLTAttributeDef selectAttrDefDot = new XSLTAttributeDef(null, "select",
-                                          XSLTAttributeDef.T_EXPR, ".");
-    XSLTAttributeDef matchAttrRequired = new XSLTAttributeDef(null, "match",
-                                           XSLTAttributeDef.T_PATTERN, true);
-    XSLTAttributeDef matchAttrOpt = new XSLTAttributeDef(null, "match",
-                                      XSLTAttributeDef.T_PATTERN, false);
-    XSLTAttributeDef priorityAttr = new XSLTAttributeDef(null, "priority",
-                                      XSLTAttributeDef.T_PRIORITY, false);
-    XSLTAttributeDef modeAttr = new XSLTAttributeDef(null, "mode",
-                                  XSLTAttributeDef.T_QNAME, false);
-    XSLTAttributeDef spaceAttr =
-      new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space", false,
-                           "default", Constants.ATTRVAL_STRIP, "preserve",
-                           Constants.ATTRVAL_PRESERVE);
-    XSLTAttributeDef spaceAttrLiteral =
-      new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space", 
-                                          XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef stylesheetPrefixAttr = new XSLTAttributeDef(null,
-                                              "stylesheet-prefix",
-                                              XSLTAttributeDef.T_CDATA, true);
-    XSLTAttributeDef resultPrefixAttr = new XSLTAttributeDef(null,
-                                          "result-prefix",
-                                          XSLTAttributeDef.T_CDATA, true);
-    XSLTAttributeDef disableOutputEscapingAttr = new XSLTAttributeDef(null,
-                                                   "disable-output-escaping",
-                                                   XSLTAttributeDef.T_YESNO,
-                                                   false);
-    XSLTAttributeDef levelAttr = new XSLTAttributeDef(null, "level", false,
-                                   "single", Constants.NUMBERLEVEL_SINGLE,
-                                   "multiple", Constants.NUMBERLEVEL_MULTI,
-                                   "any", Constants.NUMBERLEVEL_ANY);
-
-    levelAttr.setDefault("single");
-
-    XSLTAttributeDef countAttr = new XSLTAttributeDef(null, "count",
-                                   XSLTAttributeDef.T_PATTERN, false);
-    XSLTAttributeDef fromAttr = new XSLTAttributeDef(null, "from",
-                                  XSLTAttributeDef.T_PATTERN, false);
-    XSLTAttributeDef valueAttr = new XSLTAttributeDef(null, "value",
-                                   XSLTAttributeDef.T_EXPR, false);
-    XSLTAttributeDef formatAttr = new XSLTAttributeDef(null, "format",
-                                    XSLTAttributeDef.T_AVT, false);
-
-    formatAttr.setDefault("1");
-
-    XSLTAttributeDef langAttr = new XSLTAttributeDef(null, "lang",
-                                  XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef letterValueAttr = new XSLTAttributeDef(null,
-                                         "letter-value",
-                                         XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef groupingSeparatorAVT = new XSLTAttributeDef(null,
-                                              "grouping-separator",
-                                              XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef groupingSizeAttr = new XSLTAttributeDef(null,
-                                          "grouping-size",
-                                          XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef dataTypeAttr = new XSLTAttributeDef(null, "data-type",
-                                      XSLTAttributeDef.T_AVT, "text");
-    XSLTAttributeDef orderAttr = new XSLTAttributeDef(null, "order",
-                                   XSLTAttributeDef.T_AVT, "ascending");
-    XSLTAttributeDef caseOrderAttr = new XSLTAttributeDef(null, "case-order",
-                                       XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef terminateAttr = new XSLTAttributeDef(null, "terminate",
-                                       XSLTAttributeDef.T_YESNO, false);
-
-    terminateAttr.setDefault("no");
-
-    XSLTAttributeDef xslExcludeResultPrefixesAttr =
-      new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL,
-                           "exclude-result-prefixes",
-                           XSLTAttributeDef.T_STRINGLIST, false);
-    XSLTAttributeDef xslExtensionElementPrefixesAttr =
-      new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL,
-                           "extension-element-prefixes",
-                           XSLTAttributeDef.T_PREFIX_URLLIST, false);
-    XSLTAttributeDef xslUseAttributeSetsAttr =
-      new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "use-attribute-sets",
-                           XSLTAttributeDef.T_QNAMES, false);
-    XSLTAttributeDef xslVersionAttr =
-      new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "version",
-                           XSLTAttributeDef.T_NMTOKEN, false);
-    XSLTElementDef charData = new XSLTElementDef(this, null, "text()",
-                                null /*alias */, null /* elements */, null,  /* attributes */
-                                new ProcessorCharacters(),
-                                ElemTextLiteral.class /* class object */);
-
-    charData.setType(XSLTElementDef.T_PCDATA);
-
-    XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()",
-                                      null /*alias */, null /* elements */,
-                                      null,  /* attributes */
-                                      null,
-                                      ElemTextLiteral.class /* should be null? -sb */);
-
-    charData.setType(XSLTElementDef.T_PCDATA);
-
-    XSLTAttributeDef resultAttr = new XSLTAttributeDef(null, "*",
-                                    XSLTAttributeDef.T_AVT, false);
-    XSLTAttributeDef xslResultAttr =
-      new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "*",
-                           XSLTAttributeDef.T_CDATA, false);
-    XSLTElementDef[] templateElements = new XSLTElementDef[21];
-    XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[22];
-    XSLTElementDef[] templateElementsAndSort = new XSLTElementDef[22];
-    XSLTElementDef[] charTemplateElements = new XSLTElementDef[15];
-    XSLTElementDef resultElement = new XSLTElementDef(this, null, "*",
-                                     null /*alias */,
-                                     templateElements /* elements */,
-                                     new XSLTAttributeDef[]{
-                                       spaceAttrLiteral, // special
-                                       xslExcludeResultPrefixesAttr,
-                                       xslExtensionElementPrefixesAttr,
-                                       xslUseAttributeSetsAttr,
-                                       xslVersionAttr,
-                                       xslResultAttr,
-                                       resultAttr }, 
-                                        new ProcessorLRE(),
-                                     ElemLiteralResult.class /* class object */, 20, true);
-    XSLTElementDef unknownElement =
-      new XSLTElementDef(this, "*", "unknown", null /*alias */,
-                         templateElementsAndParams /* elements */,
-                         new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr,
-                                                 xslExtensionElementPrefixesAttr,
-                                                 xslUseAttributeSetsAttr,
-                                                 xslVersionAttr,
-                                                 xslResultAttr,
-                                                 resultAttr }, 
-                                                                                                 new ProcessorUnknown(),
-                         ElemUnknown.class /* class object */, 20, true);
-    XSLTElementDef xslValueOf = new XSLTElementDef(this,
-                                  Constants.S_XSLNAMESPACEURL, "value-of",
-                                  null /*alias */, null /* elements */,
-                                  new XSLTAttributeDef[]{ selectAttrRequired,
-                                                          disableOutputEscapingAttr }, 
-                                               new ProcessorTemplateElem(),
-                                  ElemValueOf.class /* class object */, 20, true);
-    XSLTElementDef xslCopyOf = new XSLTElementDef(this,
-                                 Constants.S_XSLNAMESPACEURL, "copy-of",
-                                 null /*alias */, null /* elements */,
-                                 new XSLTAttributeDef[]{ selectAttrRequired },
-                                 new ProcessorTemplateElem(),
-                                 ElemCopyOf.class /* class object */, 20, true);
-    XSLTElementDef xslNumber = new XSLTElementDef(this,
-                                 Constants.S_XSLNAMESPACEURL, "number",
-                                 null /*alias */, null /* elements */,
-                                 new XSLTAttributeDef[]{ levelAttr,
-                                                         countAttr,
-                                                         fromAttr,
-                                                         valueAttr,
-                                                         formatAttr,
-                                                         langAttr,
-                                                         letterValueAttr,
-                                                         groupingSeparatorAVT,
-                                                         groupingSizeAttr }, 
-                                        new ProcessorTemplateElem(),
-                                 ElemNumber.class /* class object */, 20, true);
-
-    // <!-- xsl:sort cannot occur after any other elements or
-    // any non-whitespace character -->
-    XSLTElementDef xslSort = new XSLTElementDef(this,
-                                                Constants.S_XSLNAMESPACEURL,
-                                                "sort", null /*alias */,
-                                                null /* elements */,
-                                                new XSLTAttributeDef[]{
-                                                  selectAttrDefDot,
-                                                  langAttr,
-                                                  dataTypeAttr,
-                                                  orderAttr,
-                                                  caseOrderAttr }, 
-                                       new ProcessorTemplateElem(),
-                                                ElemSort.class/* class object */, 19, true );
-    XSLTElementDef xslWithParam = new XSLTElementDef(this,
-                                    Constants.S_XSLNAMESPACEURL,
-                                    "with-param", null /*alias */,
-                                    templateElements /* elements */,  // %template;>
-                                    new XSLTAttributeDef[]{ nameAttrRequired,
-                                                            selectAttrOpt }, new ProcessorTemplateElem(),
-                                                                             ElemWithParam.class /* class object */, 19, true);
-    XSLTElementDef xslApplyTemplates = new XSLTElementDef(this,
-                                         Constants.S_XSLNAMESPACEURL,
-                                         "apply-templates", null /*alias */,
-                                         new XSLTElementDef[]{ xslSort,
-                                                               xslWithParam } /* elements */, new XSLTAttributeDef[]{
-                                                                 selectAttrDefNode,
-                                                                 modeAttr }, 
-                                                                        new ProcessorTemplateElem(),
-                                         ElemApplyTemplates.class /* class object */, 20, true);
-    XSLTElementDef xslApplyImports =
-      new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "apply-imports",
-                         null /*alias */, null /* elements */,
-                         new XSLTAttributeDef[]{},
-                         new ProcessorTemplateElem(),
-                         ElemApplyImport.class /* class object */);
-    XSLTElementDef xslForEach = new XSLTElementDef(this,
-                                  Constants.S_XSLNAMESPACEURL, "for-each",
-                                  null /*alias */, templateElementsAndSort,  // (#PCDATA %instructions; %result-elements; | xsl:sort)*
-                                  new XSLTAttributeDef[]{ selectAttrRequired,
-                                                          spaceAttr }, 
-                                               new ProcessorTemplateElem(),
-                                  ElemForEach.class /* class object */, true, false, true, 20, true);
-    XSLTElementDef xslIf = new XSLTElementDef(this,
-                                              Constants.S_XSLNAMESPACEURL,
-                                              "if", null /*alias */,
-                                              templateElements /* elements */,  // %template;
-                                              new XSLTAttributeDef[]{
-                                                testAttrRequired,
-                                                spaceAttr }, new ProcessorTemplateElem(),
-                                                             ElemIf.class /* class object */, 20, true);
-    XSLTElementDef xslWhen =
-      new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "when",
-                         null /*alias */, templateElements /* elements */,  // %template;>
-                                                new XSLTAttributeDef[]{
-                                                  testAttrRequired,
-                                                  spaceAttr }, new ProcessorTemplateElem(),
-                                                               ElemWhen.class /* class object */,
-                                                                                                false, true, 1, true);
-    XSLTElementDef xslOtherwise = new XSLTElementDef(this,
-                                    Constants.S_XSLNAMESPACEURL, "otherwise",
-                                    null /*alias */,
-                                    templateElements /* elements */,  // %template;>
-                                    new XSLTAttributeDef[]{ spaceAttr },
-                                    new ProcessorTemplateElem(),
-                                    ElemOtherwise.class /* class object */,
-                                                       false, false, 2, false);
-    XSLTElementDef xslChoose = new XSLTElementDef(this,
-                                 Constants.S_XSLNAMESPACEURL, "choose",
-                                 null /*alias */,
-                                 new XSLTElementDef[]{ xslWhen,
-                                                       xslOtherwise } /* elements */, 
-                                        new XSLTAttributeDef[]{ spaceAttr },
-                                 new ProcessorTemplateElem(),
-                                 ElemChoose.class /* class object */, true, false, true, 20, true);                                
-    XSLTElementDef xslAttribute = new XSLTElementDef(this,
-                                    Constants.S_XSLNAMESPACEURL, "attribute",
-                                    null /*alias */,
-                                    charTemplateElements /* elements */,  // %char-template;>
-                                    new XSLTAttributeDef[]{ nameAVTRequired,
-                                                            namespaceAVTOpt,
-                                                            spaceAttr }, 
-                                    new ProcessorTemplateElem(),
-                                    ElemAttribute.class /* class object */, 20, true);
-    XSLTElementDef xslCallTemplate =
-      new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "call-template",
-                         null /*alias */,
-                         new XSLTElementDef[]{ xslWithParam } /* elements */,
-                         new XSLTAttributeDef[]{ nameAttrRequired },
-                         new ProcessorTemplateElem(),
-                         ElemCallTemplate.class /* class object */, 20, true);
-    XSLTElementDef xslVariable = new XSLTElementDef(this,
-                                   Constants.S_XSLNAMESPACEURL, "variable",
-                                   null /*alias */,
-                                   templateElements /* elements */,  // %template;>
-                                   new XSLTAttributeDef[]{ nameAttrRequired,
-                                                           selectAttrOpt }, 
-                                  new ProcessorTemplateElem(),
-                                   ElemVariable.class /* class object */, 20, true);
-    XSLTElementDef xslParam = new XSLTElementDef(this,
-                                Constants.S_XSLNAMESPACEURL, "param",
-                                null /*alias */,
-                                templateElements /* elements */,  // %template;>
-                                new XSLTAttributeDef[]{ nameAttrRequired,
-                                                        selectAttrOpt }, 
-                                       new ProcessorTemplateElem(),
-                                ElemParam.class /* class object */, 19, true);
-    XSLTElementDef xslText =
-      new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "text",
-                         null /*alias */,
-                         new XSLTElementDef[]{ charData } /* elements */,
-                         new XSLTAttributeDef[]{ disableOutputEscapingAttr },
-                         new ProcessorText(),
-                         ElemText.class /* class object */, 20, true);
-    XSLTElementDef xslProcessingInstruction =
-      new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL,
-                         "processing-instruction", null /*alias */,
-                         charTemplateElements /* elements */,  // %char-template;>
-                         new XSLTAttributeDef[]{
-                                                  nameAVTRequired,
-                                                  spaceAttr }, 
-                                        new ProcessorTemplateElem(),
-                          ElemPI.class /* class object */, 20, true);
-    XSLTElementDef xslElement = new XSLTElementDef(this,
-                                  Constants.S_XSLNAMESPACEURL, "element",
-                                  null /*alias */,
-                                  templateElements /* elements */,  // %template;
-                                  new XSLTAttributeDef[]{ nameAVTRequired,
-                                                          namespaceAVTOpt,
-                                                          useAttributeSetsAttr,
-                                                          spaceAttr }, 
-                                               new ProcessorTemplateElem(),
-                                  ElemElement.class /* class object */, 20, true);
-    XSLTElementDef xslComment = new XSLTElementDef(this,
-                                  Constants.S_XSLNAMESPACEURL, "comment",
-                                  null /*alias */,
-                                  charTemplateElements /* elements */,  // %char-template;>
-                                  new XSLTAttributeDef[]{ spaceAttr },
-                                  new ProcessorTemplateElem(),
-                                  ElemComment.class /* class object */, 20, true);
-    XSLTElementDef xslCopy =
-      new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "copy",
-                         null /*alias */, templateElements /* elements */,  // %template;>
-                          new XSLTAttributeDef[]{
-                                                  spaceAttr,
-                                                  useAttributeSetsAttr }, 
-                                        new ProcessorTemplateElem(),
-                          ElemCopy.class /* class object */, 20, true);
-    XSLTElementDef xslMessage = new XSLTElementDef(this,
-                                  Constants.S_XSLNAMESPACEURL, "message",
-                                  null /*alias */,
-                                  templateElements /* elements */,  // %template;>
-                                  new XSLTAttributeDef[]{ terminateAttr },
-                                  new ProcessorTemplateElem(),
-                                  ElemMessage.class /* class object */, 20, true);
-    XSLTElementDef xslFallback = new XSLTElementDef(this,
-                                   Constants.S_XSLNAMESPACEURL, "fallback",
-                                   null /*alias */,
-                                   templateElements /* elements */,  // %template;>
-                                   new XSLTAttributeDef[]{ spaceAttr },
-                                   new ProcessorTemplateElem(),
-                                   ElemFallback.class /* class object */, 20, true);
-    int i = 0;
-
-    templateElements[i++] = charData;  // #PCDATA
-
-    // char-instructions
-    templateElements[i++] = xslApplyTemplates;
-    templateElements[i++] = xslCallTemplate;
-    templateElements[i++] = xslApplyImports;
-    templateElements[i++] = xslForEach;
-    templateElements[i++] = xslValueOf;
-    templateElements[i++] = xslCopyOf;
-    templateElements[i++] = xslNumber;
-    templateElements[i++] = xslChoose;
-    templateElements[i++] = xslIf;
-    templateElements[i++] = xslText;
-    templateElements[i++] = xslCopy;
-    templateElements[i++] = xslVariable;
-    templateElements[i++] = xslMessage;
-    templateElements[i++] = xslFallback;
-
-    // instructions
-    templateElements[i++] = xslProcessingInstruction;
-    templateElements[i++] = xslComment;
-    templateElements[i++] = xslElement;
-    templateElements[i++] = xslAttribute;
-    templateElements[i++] = resultElement;
-    templateElements[i++] = unknownElement;
-
-    int k;
-
-    for (k = 0; k < i; k++)
-    {
-      templateElementsAndParams[k] = templateElements[k];
-    }
-
-    templateElementsAndParams[k] = xslParam;
-
-    for (k = 0; k < i; k++)
-    {
-      templateElementsAndSort[k] = templateElements[k];
-    }
-
-    templateElementsAndSort[k] = xslSort;
-    i = 0;
-    charTemplateElements[i++] = charData;  // #PCDATA
-
-    // char-instructions
-    charTemplateElements[i++] = xslApplyTemplates;
-    charTemplateElements[i++] = xslCallTemplate;
-    charTemplateElements[i++] = xslApplyImports;
-    charTemplateElements[i++] = xslForEach;
-    charTemplateElements[i++] = xslValueOf;
-    charTemplateElements[i++] = xslCopyOf;
-    charTemplateElements[i++] = xslNumber;
-    charTemplateElements[i++] = xslChoose;
-    charTemplateElements[i++] = xslIf;
-    charTemplateElements[i++] = xslText;
-    charTemplateElements[i++] = xslCopy;
-    charTemplateElements[i++] = xslVariable;
-    charTemplateElements[i++] = xslMessage;
-    charTemplateElements[i++] = xslFallback;
-
-    XSLTElementDef importDef = new XSLTElementDef(this,
-                                 Constants.S_XSLNAMESPACEURL, "import",
-                                 null /*alias */, null /* elements */,
-                                 new XSLTAttributeDef[]{ hrefAttr },  // EMPTY
-                                 new ProcessorImport(),
-                                 null /* class object */,
-                                        1, true);
-    XSLTElementDef includeDef = new XSLTElementDef(this,
-                                  Constants.S_XSLNAMESPACEURL, "include",
-                                  null /*alias */, null /* elements */,  // EMPTY
-                                  new XSLTAttributeDef[]{ hrefAttr },
-                                  new ProcessorInclude(),
-                                  null /* class object */,
-                                               20, true);
-    XSLTElementDef[] topLevelElements = new XSLTElementDef[]{ includeDef,
-                                                              importDef,
-                                                              // resultElement,
-                                                              whiteSpaceOnly,
-                                                              unknownElement,
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "strip-space",
-                                                                null /*alias */,
-                                                                null /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                elementsAttr },
-                                                                new ProcessorStripSpace(),
-                                                                null /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "preserve-space",
-                                                                null /*alias */,
-                                                                null /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                elementsAttr },
-                                                                new ProcessorPreserveSpace(),
-                                                                null /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "output",
-                                                                null /*alias */,
-                                                                null /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                  methodAttr,
-                                                                  versionAttr,
-                                                                  encodingAttr,
-                                                                  omitXmlDeclarationAttr,
-                                                                  standaloneAttr,
-                                                                  doctypePublicAttr,
-                                                                  doctypeSystemAttr,
-                                                                  cdataSectionElementsAttr,
-                                                                  indentAttr,
-                                                                  mediaTypeAttr,
-                                                                  XSLTAttributeDef.m_foreignAttr }, 
-                                                                new ProcessorOutputElem(), null /* class object */, 20, true), 
-                                                                                             new XSLTElementDef(
-                                                                    this,
-                                                                    Constants.S_XSLNAMESPACEURL,
-                                                                    "key",
-                                                                    null /*alias */,
-                                                                    null /* elements */,  // EMPTY
-                                                                    new XSLTAttributeDef[]{ nameAttrRequired,
-                                                                                            matchAttrRequired,
-                                                                                            useAttr }, 
-                                                                                               new ProcessorKey(), null /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "decimal-format",
-                                                                null /*alias */,
-                                                                null /* elements */,  // EMPTY
-                                                                                 new XSLTAttributeDef[]{
-                                                                                   nameAttrOpt,
-                                                                                   decimalSeparatorAttr,
-                                                                                   groupingSeparatorAttr,
-                                                                                   infinityAttr,
-                                                                                   minusSignAttr,
-                                                                                   NaNAttr,
-                                                                                   percentAttr,
-                                                                                   perMilleAttr,
-                                                                                   zeroDigitAttr,
-                                                                                   digitAttr,
-                                                                                   patternSeparatorAttr }, 
-                                                                                               new ProcessorDecimalFormat(),
-                                                                null /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "attribute-set",
-                                                                null /*alias */,
-                                                                new XSLTElementDef[]{
-                                                                xslAttribute } /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                  nameAttrRequired,
-                                                                  useAttributeSetsAttr }, new ProcessorAttributeSet(),
-                                                                                          null /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "variable",
-                                                                null /*alias */,
-                                                                templateElements /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                  nameAttrRequired,
-                                                                  selectAttrOpt }, new ProcessorGlobalVariableDecl(),
-                                                                                   ElemVariable.class /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "param",
-                                                                null /*alias */,
-                                                                templateElements /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                  nameAttrRequired,
-                                                                  selectAttrOpt }, new ProcessorGlobalParamDecl(),
-                                                                                   ElemParam.class /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_XSLNAMESPACEURL,
-                                                                "template",
-                                                                null /*alias */,
-                                                                templateElementsAndParams /* elements */,
-                                                                new XSLTAttributeDef[]{
-                                                                  matchAttrOpt,
-                                                                  nameAttrOpt,
-                                                                  priorityAttr,
-                                                                  modeAttr,
-                                                                  spaceAttr }, new ProcessorTemplate(), ElemTemplate.class /* class object */, 20, true), 
-                                                                                             new XSLTElementDef(
-                                                                    this,
-                                                                    Constants.S_XSLNAMESPACEURL,
-                                                                    "namespace-alias",
-                                                                    null /*alias */,
-                                                                    null /* elements */,  // EMPTY
-                                                                    new XSLTAttributeDef[]{ stylesheetPrefixAttr,
-                                                                                            resultPrefixAttr }, 
-                                                                                                   new ProcessorNamespaceAlias(), null /* class object */, 20, true),
-                                                              new XSLTElementDef(
-                                                                this,
-                                                                Constants.S_BUILTIN_EXTENSIONS_URL,
-                                                                "component",
-                                                                null /*alias */,
-                                                                new XSLTElementDef[]{
-                                                                  new XSLTElementDef(
-                                                                    this,
-                                                                    Constants.S_BUILTIN_EXTENSIONS_URL,
-                                                                    "script",
-                                                                    null /*alias */,
-                                                                    new XSLTElementDef[]{ charData } /* elements */,
-                                                                    new XSLTAttributeDef[]{
-                                                                      new XSLTAttributeDef(
-                                                                        null,
-                                                                        "lang",
-                                                                        XSLTAttributeDef.T_NMTOKEN,
-                                                                        true),
-                                                                      new XSLTAttributeDef(null, "src", XSLTAttributeDef.T_URL, false) }, 
-                                                                                                  new ProcessorLRE(),
-                                                                   ElemExtensionScript.class /* class object */, 20, true) },  // EMPTY
-                                                                                              new XSLTAttributeDef[]{ new XSLTAttributeDef(null, "prefix", XSLTAttributeDef.T_NMTOKEN, true),
-                                                                                                                      new XSLTAttributeDef(null, "elements", XSLTAttributeDef.T_STRINGLIST, false),
-                                                                                                                      new XSLTAttributeDef(null, "functions", XSLTAttributeDef.T_STRINGLIST, false) }, new ProcessorLRE(), ElemExtensionDecl.class /* class object */) };
-    XSLTAttributeDef excludeResultPrefixesAttr =
-      new XSLTAttributeDef(null, "exclude-result-prefixes",
-                           XSLTAttributeDef.T_STRINGLIST, false);
-    XSLTAttributeDef extensionElementPrefixesAttr =
-      new XSLTAttributeDef(null, "extension-element-prefixes",
-                           XSLTAttributeDef.T_PREFIX_URLLIST, false);
-    XSLTAttributeDef idAttr = new XSLTAttributeDef(null, "id",
-                                XSLTAttributeDef.T_CDATA, false);
-    XSLTAttributeDef versionAttrRequired = new XSLTAttributeDef(null,
-                                             "version",
-                                             XSLTAttributeDef.T_NMTOKEN,
-                                             true);
-    XSLTElementDef stylesheetElemDef = new XSLTElementDef(this,
-                                         Constants.S_XSLNAMESPACEURL,
-                                         "stylesheet", "transform",
-                                         topLevelElements,
-                                         new XSLTAttributeDef[]{
-                                           extensionElementPrefixesAttr,
-                                           excludeResultPrefixesAttr,
-                                           idAttr,
-                                           versionAttrRequired,
-                                           spaceAttr }, new ProcessorStylesheetElement(),  /* ContentHandler */
-                                         null  /* class object */,
-                                         true, -1, false);
-
-    importDef.setElements(new XSLTElementDef[]{ stylesheetElemDef,
-                                                resultElement,
-                                                unknownElement });
-    includeDef.setElements(new XSLTElementDef[]{ stylesheetElemDef,
-                                                 resultElement,
-                                                 unknownElement });
-    build(null, null, null, new XSLTElementDef[]{ stylesheetElemDef,
-                                                  whiteSpaceOnly,
-                                                  resultElement,
-                                                  unknownElement }, null,
-                                                                    new ProcessorStylesheetDoc(),  /* ContentHandler */
-                                                                    null  /* class object */
-                                                                      );
-  }
-
-  /**
-   * A hashtable of all available built-in elements for use by the element-available
-   * function.
-   * TODO:  When we convert to Java2, this should be a Set.
-   */
-  private Hashtable m_availElems = new Hashtable();
-  
-  /**
-   * Get the table of available elements.
-   * 
-   * @return table of available elements, keyed by qualified names, and with 
-   * values of the same qualified names.
-   */
-  public Hashtable getElemsAvailable() 
-  {
-    return m_availElems;
-  }
-
-  /**
-   * Adds a new element name to the Hashtable of available elements.
-   * @param elemName The name of the element to add to the Hashtable of available elements.
-   */
-  void addAvailableElement(QName elemName)
-  {
-    m_availElems.put(elemName, elemName);
-  }
-
-  /**
-   * Determines whether the passed element name is present in the list of available elements.
-   * @param elemName The name of the element to look up.
-   *
-   * @return true if an element corresponding to elemName is available.
-   */
-  public boolean elementAvailable(QName elemName)
-  {
-    return m_availElems.containsKey(elemName);
-  }
-}
diff --git a/src/org/apache/xalan/processor/package.html b/src/org/apache/xalan/processor/package.html
deleted file mode 100644
index 41696d6..0000000
--- a/src/org/apache/xalan/processor/package.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<html>
-  <title>Xalan Processor Package.</title>
-  <body>
-    <p>Parses an XSLT stylesheet document (which may include and import other stylesheet documents) and produces a StylesheetRoot
-    (a TRaX Templates object).</p>
-    
-    <p>StylesheetProcessor implements the TRaX {@link javax.xml.transform.TransformerFactory} interface,
-    as well as the {@link javax.xml.transform.sax.SAXTransformerFactory} interface. 
-    It registers the {@link org.apache.xalan.processor.StylesheetHandler} object 
-    (a TrAX {@link javax.xml.transform.sax.TemplatesHandler} implementation) 
-    as the SAX ContentHandler for an XMLReader, and uses the XMLReader to parse 
-    the stylesheet document.</p>
-    <p>Before parsing the XSLT input, StylesheetHandler assembles an {@link org.apache.xalan.processor.XSLTSchema}, 
-    which uses {@link org.apache.xalan.processor.XSLTElementDef}
-    and {@link org.apache.xalan.processor.XSLTAttributeDef} objects to 
-    recursively define the elements and attributes that an XSLT stylesheet may 
-    contain. The StylesheetHandler then passes on each parse event to the 
-    {@link org.apache.xalan.processor.XSLTElementProcessor} which the 
-    XSLTElementDef assigned to the element associated with that event.</p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/res/XSLMessages.java b/src/org/apache/xalan/res/XSLMessages.java
deleted file mode 100644
index 87b61d9..0000000
--- a/src/org/apache/xalan/res/XSLMessages.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.res;
-
-import org.apache.xml.utils.res.XResourceBundleBase;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.ListResourceBundle;
-import java.util.MissingResourceException;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-/**
- * <meta name="usage" content="internal"/>
- * Sets things up for issuing error messages.  This class is misnamed, and
- * should be called XalanMessages, or some such.
- */
-public class XSLMessages
-{
-
-  /** The local object to use.  */
-  private Locale fLocale = Locale.getDefault();
-
-  /** The language specific resource object for Xalan messages.  */
-  private static XResourceBundleBase XSLTBundle = null;
-
-  /** The language specific resource object for XPath messages.  */
-  private static XResourceBundleBase XPATHBundle = null;
-
-  /** The class name of the Xalan error message string table.    */
-  private static final String XSLT_ERROR_RESOURCES =
-    "org.apache.xalan.res.XSLTErrorResources";
-
-  /** The class name of the XPath error message string table.     */
-  private static final String XPATH_ERROR_RESOURCES =
-    "org.apache.xpath.res.XPATHErrorResources";
-
-  /** String to use if a bad message code is used. */
-  private static String BAD_CODE = "BAD_CODE";
-
-  /** String to use if the message format operation failed.  */
-  private static String FORMAT_FAILED = "FORMAT_FAILED";
-
-  /**
-   * Set the Locale object to use.
-   * 
-   * @param locale non-null reference to Locale object.
-   */
-   public void setLocale(Locale locale)
-  {
-    fLocale = locale;
-  }
-
-  /**
-   * Get the Locale object that is being used.
-   * 
-   * @return non-null reference to Locale object.
-   */
-  public Locale getLocale()
-  {
-    return fLocale;
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param errorCode The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted warning string.
-   */
-  public static final String createXPATHWarning(int errorCode, Object args[])  //throws Exception 
-  {
-
-    if (XPATHBundle == null)
-      XPATHBundle =
-        (XResourceBundleBase) loadResourceBundle(XPATH_ERROR_RESOURCES);
-
-    XResourceBundleBase fResourceBundle = XPATHBundle;
-
-    if (fResourceBundle != null)
-    {
-      String msgKey = fResourceBundle.getWarningKey(errorCode);
-
-      return createXPATHMsg(fResourceBundle, msgKey, args);
-    }
-    else
-      return "Could not load any resource bundles.";
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param errorCode The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted message string.
-   */
-  public static final String createXPATHMessage(int errorCode, Object args[])  //throws Exception 
-  {
-
-    if (XPATHBundle == null)
-      XPATHBundle =
-        (XResourceBundleBase) loadResourceBundle(XPATH_ERROR_RESOURCES);
-
-    XResourceBundleBase fResourceBundle = XPATHBundle;
-
-    if (fResourceBundle != null)
-    {
-      String msgKey = fResourceBundle.getMessageKey(errorCode);
-
-      return createXPATHMsg(fResourceBundle, msgKey, args);
-    }
-    else
-      return "Could not load any resource bundles.";
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param errorCode The key for the message text.
-   *
-   * @param fResourceBundle The resource bundle to use.
-   * @param msgKey  The message key to use.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted message string.
-   */
-  public static final String createXPATHMsg(XResourceBundleBase fResourceBundle,
-                                            String msgKey, Object args[])  //throws Exception 
-  {
-
-    String fmsg = null;
-    boolean throwex = false;
-    String msg = null;
-
-    if (msgKey != null)
-      msg = fResourceBundle.getString(msgKey);
-
-    if (msg == null)
-    {
-      msg = fResourceBundle.getString(XPATHErrorResources.BAD_CODE);
-      throwex = true;
-    }
-
-    if (args != null)
-    {
-      try
-      {
-
-        // Do this to keep format from crying.
-        // This is better than making a bunch of conditional
-        // code all over the place.
-        int n = args.length;
-
-        for (int i = 0; i < n; i++)
-        {
-          if (null == args[i])
-            args[i] = "";
-        }
-
-        fmsg = java.text.MessageFormat.format(msg, args);
-      }
-      catch (Exception e)
-      {
-        fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED);
-        fmsg += " " + msg;
-      }
-    }
-    else
-      fmsg = msg;
-
-    if (throwex)
-    {
-      throw new RuntimeException(fmsg);
-    }
-
-    return fmsg;
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param errorCode The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted warning string.
-   */
-  public static final String createWarning(int errorCode, Object args[])  //throws Exception 
-  {
-
-    if (XSLTBundle == null)
-      XSLTBundle =
-        (XResourceBundleBase) loadResourceBundle(XSLT_ERROR_RESOURCES);
-
-    XResourceBundleBase fResourceBundle = XSLTBundle;
-
-    if (fResourceBundle != null)
-    {
-      String msgKey = fResourceBundle.getWarningKey(errorCode);
-
-      return createMsg(fResourceBundle, msgKey, args);
-    }
-    else
-      return "Could not load any resource bundles.";
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param errorCode The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted message string.
-   */
-  public static final String createMessage(int errorCode, Object args[])  //throws Exception 
-  {
-
-    if (XSLTBundle == null)
-      XSLTBundle =
-        (XResourceBundleBase) loadResourceBundle(XSLT_ERROR_RESOURCES);
-
-    XResourceBundleBase fResourceBundle = XSLTBundle;
-
-    if (fResourceBundle != null)
-    {
-      String msgKey = fResourceBundle.getMessageKey(errorCode);
-
-      return createMsg(fResourceBundle, msgKey, args);
-    }
-    else
-      return "Could not load any resource bundles.";
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param errorCode The key for the message text.
-   *
-   * @param fResourceBundle The resource bundle to use.
-   * @param msgKey  The message key to use.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted message string.
-   */
-  public static final String createMsg(XResourceBundleBase fResourceBundle,
-                                       String msgKey, Object args[])  //throws Exception 
-  {
-
-    String fmsg = null;
-    boolean throwex = false;
-    String msg = null;
-
-    if (msgKey != null)
-      msg = fResourceBundle.getString(msgKey);
-
-    if (msg == null)
-    {
-      msg = fResourceBundle.getString(BAD_CODE);
-      throwex = true;
-    }
-
-    if (args != null)
-    {
-      try
-      {
-
-        // Do this to keep format from crying.
-        // This is better than making a bunch of conditional
-        // code all over the place.
-        int n = args.length;
-
-        for (int i = 0; i < n; i++)
-        {
-          if (null == args[i])
-            args[i] = "";
-        }
-
-        fmsg = java.text.MessageFormat.format(msg, args);
-      }
-      catch (Exception e)
-      {
-        fmsg = fResourceBundle.getString(FORMAT_FAILED);
-        fmsg += " " + msg;
-      }
-    }
-    else
-      fmsg = msg;
-
-    if (throwex)
-    {
-      throw new RuntimeException(fmsg);
-    }
-
-    return fmsg;
-  }
-
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param bundleName The name of the resource bundle to be
-   *                  used.
-   * @param errorCode The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted message string.
-   *
-   * @throws Exception if the message can not be loaded.
-   */
-  public String createMessage(String bundleName, int errorCode, Object args[])
-          throws Exception
-  {
-
-    boolean throwex = false;
-    int majorCode;
-    int minorCode;
-    String fmsg = null;
-    XResourceBundleBase aResourceBundle = null;
-
-    aResourceBundle = (XResourceBundleBase) loadResourceBundle(bundleName);
-
-    String msgKey = aResourceBundle.getMessageKey(errorCode);
-    String msg = null;
-
-    if (msgKey != null)
-      msg = aResourceBundle.getString(msgKey);
-
-    if (msg == null)
-    {
-      msg = aResourceBundle.getString(BAD_CODE);
-      throwex = true;
-    }
-
-    if (args != null)
-    {
-      try
-      {
-
-        // Do this to keep format from crying.
-        // This is better than making a bunch of conditional
-        // code all over the place.
-        int n = args.length;
-
-        for (int i = 0; i < n; i++)
-        {
-          if (null == args[i])
-            args[i] = "";
-        }
-
-        fmsg = java.text.MessageFormat.format(msg, args);
-      }
-      catch (Exception e)
-      {
-        fmsg = aResourceBundle.getString(FORMAT_FAILED);
-        fmsg += " " + msg;
-      }
-    }
-    else
-      fmsg = msg;
-
-    if (throwex)
-    {
-      throw new RuntimeException(fmsg);
-    }
-
-    return fmsg;
-  }
-
-  /**
-   * Return a named ResourceBundle for a particular locale.  This method mimics the behavior
-   * of ResourceBundle.getBundle().
-   *
-   * @param res the name of the resource to load.
-   * @param locale the locale to prefer when searching for the bundle
-   *
-   * @param className The class name of the resource bundle.
-   * @return the ResourceBundle
-   * @throws MissingResourceException
-   */
-  public static final ListResourceBundle loadResourceBundle(String className)
-          throws MissingResourceException
-  {
-
-    Locale locale = Locale.getDefault();
-
-    // String suffix = getResourceSuffix(locale);  
-    try
-    {
-
-      //System.out.println("resource " +className+suffix);
-      // first try with the given locale
-      return (ListResourceBundle) ResourceBundle.getBundle(className, locale);
-    }
-    catch (MissingResourceException e)
-    {
-      try  // try to fall back to en_US if we can't load
-      {
-
-        // Since we can't find the localized property file,
-        // fall back to en_US.
-        return (ListResourceBundle) ResourceBundle.getBundle(
-          XSLT_ERROR_RESOURCES, new Locale("en", "US"));
-      }
-      catch (MissingResourceException e2)
-      {
-
-        // Now we are really in trouble.
-        // very bad, definitely very bad...not going to get very far
-        throw new MissingResourceException(
-          "Could not load any resource bundles." + className, className, "");
-      }
-    }
-  }
-
-  /**
-   * Return the resource file suffic for the indicated locale
-   * For most locales, this will be based the language code.  However
-   * for Chinese, we do distinguish between Taiwan and PRC
-   *
-   * @param locale the locale
-   * @return an String suffix which can be appended to a resource name
-   */
-  private static final String getResourceSuffix(Locale locale)
-  {
-
-    String suffix = "_" + locale.getLanguage();
-    String country = locale.getCountry();
-
-    if (country.equals("TW"))
-      suffix += "_" + country;
-
-    return suffix;
-  }
-}
diff --git a/src/org/apache/xalan/res/XSLTErrorResources.java b/src/org/apache/xalan/res/XSLTErrorResources.java
deleted file mode 100644
index 53cadf7..0000000
--- a/src/org/apache/xalan/res/XSLTErrorResources.java
+++ /dev/null
@@ -1,2694 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.res;
-
-import org.apache.xml.utils.res.XResourceBundleBase;
-
-import java.util.MissingResourceException;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import java.text.DecimalFormat;
-
-import org.apache.xalan.templates.Constants;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING). The array will be
- * automatically filled in with the keys, but you need to
- * fill in the actual message string. Follow the instructions
- * below.
- */
-public class XSLTErrorResources extends XResourceBundleBase
-{
-
-  /** The error suffix for construction error property keys.   */
-  public static final String ERROR_SUFFIX = "ER";
-
-  /** The warning suffix for construction error property keys.   */
-  public static final String WARNING_SUFFIX = "WR";
-
-  /** Maximum error messages, this is needed to keep track of the number of messages.    */
-  public static final int MAX_CODE = 216;          
-
-  /** Maximum warnings, this is needed to keep track of the number of warnings.          */
-  public static final int MAX_WARNING = 26;
-
-  /** Maximum misc strings.   */
-  public static final int MAX_OTHERS = 45;
-
-  /** Maximum total warnings and error messages.          */
-  public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-  /** The lookup table for error messages.   */
-  static final Object[][] contents =
-    new Object[MAX_MESSAGES + MAX_OTHERS + 1][2];
-
-  /*
-   * Now fill in the message keys.
-   * This does not need to be updated. If MAX_CODE and MAX_WARNING
-   * are correct, the keys will get filled in automatically with
-   * the value ERxxxx (WRxxxx for warnings) where xxxx is a
-   * formatted number corresponding to the error code (i.e. ER0001).
-   */
-  static
-  {
-    for (int i = 0; i < MAX_CODE + 1; i++)
-    {
-      contents[i][0] = getMKey(i);
-    }
-
-    for (int i = 1; i < MAX_WARNING + 1; i++)
-    {
-      contents[i + MAX_CODE][0] = getWKey(i);
-    }
-  }
-
-  /*
-   * Now fill in the message text.
-   * First create an int for the message code. Make sure you
-   * update MAX_CODE for error messages and MAX_WARNING for warnings
-   * Then fill in the message text for that message code in the
-   * array. Use the new error code as the index into the array.
-   */
-
-  // Error messages...
-
-  /** Error message ID that has a null message, but takes in a single object.    */
-  public static final int ERROR0000 = 0;
-
-  static
-  {
-    contents[ERROR0000][1] = "{0}";
-  }
-
-  /** ER_NO_CURLYBRACE          */
-  public static final int ER_NO_CURLYBRACE = 1;
-
-  static
-  {
-    contents[ER_NO_CURLYBRACE][1] =
-      "Error: Can not have '{' within expression";
-  }
-
-  /** ER_ILLEGAL_ATTRIBUTE          */
-  public static final int ER_ILLEGAL_ATTRIBUTE = 2;
-
-  static
-  {
-    contents[ER_ILLEGAL_ATTRIBUTE][1] = "{0} has an illegal attribute: {1}";
-  }
-
-  /** ER_NULL_SOURCENODE_APPLYIMPORTS          */
-  public static final int ER_NULL_SOURCENODE_APPLYIMPORTS = 3;
-
-  static
-  {
-    contents[ER_NULL_SOURCENODE_APPLYIMPORTS][1] =
-      "sourceNode is null in xsl:apply-imports!";
-  }
-
-  /** ER_CANNOT_ADD          */
-  public static final int ER_CANNOT_ADD = 4;
-
-  static
-  {
-    contents[ER_CANNOT_ADD][1] = "Can not add {0} to {1}";
-  }
-
-  /** ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES          */
-  public static final int ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES = 5;
-
-  static
-  {
-    contents[ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES][1] =
-      "sourceNode is null in handleApplyTemplatesInstruction!";
-  }
-
-  /** ER_NO_NAME_ATTRIB          */
-  public static final int ER_NO_NAME_ATTRIB = 6;
-
-  static
-  {
-    contents[ER_NO_NAME_ATTRIB][1] = "{0} must have a name attribute.";
-  }
-
-  /** ER_TEMPLATE_NOT_FOUND          */
-  public static final int ER_TEMPLATE_NOT_FOUND = 7;
-
-  static
-  {
-    contents[ER_TEMPLATE_NOT_FOUND][1] = "Could not find template named: {0}";
-  }
-
-  /** ER_CANT_RESOLVE_NAME_AVT          */
-  public static final int ER_CANT_RESOLVE_NAME_AVT = 8;
-
-  static
-  {
-    contents[ER_CANT_RESOLVE_NAME_AVT][1] =
-      "Could not resolve name AVT in xsl:call-template.";
-  }
-
-  /** ER_REQUIRES_ATTRIB          */
-  public static final int ER_REQUIRES_ATTRIB = 9;
-
-  static
-  {
-    contents[ER_REQUIRES_ATTRIB][1] = "{0} requires attribute: {1}";
-  }
-
-  /** ER_MUST_HAVE_TEST_ATTRIB          */
-  public static final int ER_MUST_HAVE_TEST_ATTRIB = 10;
-
-  static
-  {
-    contents[ER_MUST_HAVE_TEST_ATTRIB][1] =
-      "{0} must have a 'test' attribute.";
-  }
-
-  /** ER_BAD_VAL_ON_LEVEL_ATTRIB          */
-  public static final int ER_BAD_VAL_ON_LEVEL_ATTRIB = 11;
-
-  static
-  {
-    contents[ER_BAD_VAL_ON_LEVEL_ATTRIB][1] =
-      "Bad value on level attribute: {0}";
-  }
-
-  /** ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML          */
-  public static final int ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML = 12;
-
-  static
-  {
-    contents[ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML][1] =
-      "processing-instruction name can not be 'xml'";
-  }
-
-  /** ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME          */
-  public static final int ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME = 13;
-
-  static
-  {
-    contents[ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME][1] =
-      "processing-instruction name must be a valid NCName: {0}";
-  }
-
-  /** ER_NEED_MATCH_ATTRIB          */
-  public static final int ER_NEED_MATCH_ATTRIB = 14;
-
-  static
-  {
-    contents[ER_NEED_MATCH_ATTRIB][1] =
-      "{0} must have a match attribute if it has a mode.";
-  }
-
-  /** ER_NEED_NAME_OR_MATCH_ATTRIB          */
-  public static final int ER_NEED_NAME_OR_MATCH_ATTRIB = 15;
-
-  static
-  {
-    contents[ER_NEED_NAME_OR_MATCH_ATTRIB][1] =
-      "{0} requires either a name or a match attribute.";
-  }
-
-  /** ER_CANT_RESOLVE_NSPREFIX          */
-  public static final int ER_CANT_RESOLVE_NSPREFIX = 16;
-
-  static
-  {
-    contents[ER_CANT_RESOLVE_NSPREFIX][1] =
-      "Can not resolve namespace prefix: {0}";
-  }
-
-  /** ER_ILLEGAL_VALUE          */
-  public static final int ER_ILLEGAL_VALUE = 17;
-
-  static
-  {
-    contents[ER_ILLEGAL_VALUE][1] = "xml:space has an illegal value: {0}";
-  }
-
-  /** ER_NO_OWNERDOC          */
-  public static final int ER_NO_OWNERDOC = 18;
-
-  static
-  {
-    contents[ER_NO_OWNERDOC][1] =
-      "Child node does not have an owner document!";
-  }
-
-  /** ER_ELEMTEMPLATEELEM_ERR          */
-  public static final int ER_ELEMTEMPLATEELEM_ERR = 19;
-
-  static
-  {
-    contents[ER_ELEMTEMPLATEELEM_ERR][1] = "ElemTemplateElement error: {0}";
-  }
-
-  /** ER_NULL_CHILD          */
-  public static final int ER_NULL_CHILD = 20;
-
-  static
-  {
-    contents[ER_NULL_CHILD][1] = "Trying to add a null child!";
-  }
-
-  /** ER_NEED_SELECT_ATTRIB          */
-  public static final int ER_NEED_SELECT_ATTRIB = 21;
-
-  static
-  {
-    contents[ER_NEED_SELECT_ATTRIB][1] = "{0} requires a select attribute.";
-  }
-
-  /** ER_NEED_TEST_ATTRIB          */
-  public static final int ER_NEED_TEST_ATTRIB = 22;
-
-  static
-  {
-    contents[ER_NEED_TEST_ATTRIB][1] =
-      "xsl:when must have a 'test' attribute.";
-  }
-
-  /** ER_NEED_NAME_ATTRIB          */
-  public static final int ER_NEED_NAME_ATTRIB = 23;
-
-  static
-  {
-    contents[ER_NEED_NAME_ATTRIB][1] =
-      "xsl:with-param must have a 'name' attribute.";
-  }
-
-  /** ER_NO_CONTEXT_OWNERDOC          */
-  public static final int ER_NO_CONTEXT_OWNERDOC = 24;
-
-  static
-  {
-    contents[ER_NO_CONTEXT_OWNERDOC][1] =
-      "context does not have an owner document!";
-  }
-
-  /** ER_COULD_NOT_CREATE_XML_PROC_LIAISON          */
-  public static final int ER_COULD_NOT_CREATE_XML_PROC_LIAISON = 25;
-
-  static
-  {
-    contents[ER_COULD_NOT_CREATE_XML_PROC_LIAISON][1] =
-      "Could not create XML TransformerFactory Liaison: {0}";
-  }
-
-  /** ER_PROCESS_NOT_SUCCESSFUL          */
-  public static final int ER_PROCESS_NOT_SUCCESSFUL = 26;
-
-  static
-  {
-    contents[ER_PROCESS_NOT_SUCCESSFUL][1] =
-      "Xalan: Process was not successful.";
-  }
-
-  /** ER_NOT_SUCCESSFUL          */
-  public static final int ER_NOT_SUCCESSFUL = 27;
-
-  static
-  {
-    contents[ER_NOT_SUCCESSFUL][1] = "Xalan: was not successful.";
-  }
-
-  /** ER_ENCODING_NOT_SUPPORTED          */
-  public static final int ER_ENCODING_NOT_SUPPORTED = 28;
-
-  static
-  {
-    contents[ER_ENCODING_NOT_SUPPORTED][1] = "Encoding not supported: {0}";
-  }
-
-  /** ER_COULD_NOT_CREATE_TRACELISTENER          */
-  public static final int ER_COULD_NOT_CREATE_TRACELISTENER = 29;
-
-  static
-  {
-    contents[ER_COULD_NOT_CREATE_TRACELISTENER][1] =
-      "Could not create TraceListener: {0}";
-  }
-
-  /** ER_KEY_REQUIRES_NAME_ATTRIB          */
-  public static final int ER_KEY_REQUIRES_NAME_ATTRIB = 30;
-
-  static
-  {
-    contents[ER_KEY_REQUIRES_NAME_ATTRIB][1] =
-      "xsl:key requires a 'name' attribute!";
-  }
-
-  /** ER_KEY_REQUIRES_MATCH_ATTRIB          */
-  public static final int ER_KEY_REQUIRES_MATCH_ATTRIB = 31;
-
-  static
-  {
-    contents[ER_KEY_REQUIRES_MATCH_ATTRIB][1] =
-      "xsl:key requires a 'match' attribute!";
-  }
-
-  /** ER_KEY_REQUIRES_USE_ATTRIB          */
-  public static final int ER_KEY_REQUIRES_USE_ATTRIB = 32;
-
-  static
-  {
-    contents[ER_KEY_REQUIRES_USE_ATTRIB][1] =
-      "xsl:key requires a 'use' attribute!";
-  }
-
-  /** ER_REQUIRES_ELEMENTS_ATTRIB          */
-  public static final int ER_REQUIRES_ELEMENTS_ATTRIB = 33;
-
-  static
-  {
-    contents[ER_REQUIRES_ELEMENTS_ATTRIB][1] =
-      "(StylesheetHandler) {0} requires an 'elements' attribute!";
-  }
-
-  /** ER_MISSING_PREFIX_ATTRIB          */
-  public static final int ER_MISSING_PREFIX_ATTRIB = 34;
-
-  static
-  {
-    contents[ER_MISSING_PREFIX_ATTRIB][1] =
-      "(StylesheetHandler) {0} attribute 'prefix' is missing";
-  }
-
-  /** ER_BAD_STYLESHEET_URL          */
-  public static final int ER_BAD_STYLESHEET_URL = 35;
-
-  static
-  {
-    contents[ER_BAD_STYLESHEET_URL][1] = "Stylesheet URL is bad: {0}";
-  }
-
-  /** ER_FILE_NOT_FOUND          */
-  public static final int ER_FILE_NOT_FOUND = 36;
-
-  static
-  {
-    contents[ER_FILE_NOT_FOUND][1] = "Stylesheet file was not found: {0}";
-  }
-
-  /** ER_IOEXCEPTION          */
-  public static final int ER_IOEXCEPTION = 37;
-
-  static
-  {
-    contents[ER_IOEXCEPTION][1] =
-      "Had IO Exception with stylesheet file: {0}";
-  }
-
-  /** ER_NO_HREF_ATTRIB          */
-  public static final int ER_NO_HREF_ATTRIB = 38;
-
-  static
-  {
-    contents[ER_NO_HREF_ATTRIB][1] =
-      "(StylesheetHandler) Could not find href attribute for {0}";
-  }
-
-  /** ER_STYLESHEET_INCLUDES_ITSELF          */
-  public static final int ER_STYLESHEET_INCLUDES_ITSELF = 39;
-
-  static
-  {
-    contents[ER_STYLESHEET_INCLUDES_ITSELF][1] =
-      "(StylesheetHandler) {0} is directly or indirectly including itself!";
-  }
-
-  /** ER_PROCESSINCLUDE_ERROR          */
-  public static final int ER_PROCESSINCLUDE_ERROR = 40;
-
-  static
-  {
-    contents[ER_PROCESSINCLUDE_ERROR][1] =
-      "StylesheetHandler.processInclude error, {0}";
-  }
-
-  /** ER_MISSING_LANG_ATTRIB          */
-  public static final int ER_MISSING_LANG_ATTRIB = 41;
-
-  static
-  {
-    contents[ER_MISSING_LANG_ATTRIB][1] =
-      "(StylesheetHandler) {0} attribute 'lang' is missing";
-  }
-
-  /** ER_MISSING_CONTAINER_ELEMENT_COMPONENT          */
-  public static final int ER_MISSING_CONTAINER_ELEMENT_COMPONENT = 42;
-
-  static
-  {
-    contents[ER_MISSING_CONTAINER_ELEMENT_COMPONENT][1] =
-      "(StylesheetHandler) misplaced {0} element?? Missing container element 'component'";
-  }
-
-  /** ER_CAN_ONLY_OUTPUT_TO_ELEMENT          */
-  public static final int ER_CAN_ONLY_OUTPUT_TO_ELEMENT = 43;
-
-  static
-  {
-    contents[ER_CAN_ONLY_OUTPUT_TO_ELEMENT][1] =
-      "Can only output to an Element, DocumentFragment, Document, or PrintWriter.";
-  }
-
-  /** ER_PROCESS_ERROR          */
-  public static final int ER_PROCESS_ERROR = 44;
-
-  static
-  {
-    contents[ER_PROCESS_ERROR][1] = "StylesheetRoot.process error";
-  }
-
-  /** ER_UNIMPLNODE_ERROR          */
-  public static final int ER_UNIMPLNODE_ERROR = 45;
-
-  static
-  {
-    contents[ER_UNIMPLNODE_ERROR][1] = "UnImplNode error: {0}";
-  }
-
-  /** ER_NO_SELECT_EXPRESSION          */
-  public static final int ER_NO_SELECT_EXPRESSION = 46;
-
-  static
-  {
-    contents[ER_NO_SELECT_EXPRESSION][1] =
-      "Error! Did not find xpath select expression (-select).";
-  }
-
-  /** ER_CANNOT_SERIALIZE_XSLPROCESSOR          */
-  public static final int ER_CANNOT_SERIALIZE_XSLPROCESSOR = 47;
-
-  static
-  {
-    contents[ER_CANNOT_SERIALIZE_XSLPROCESSOR][1] =
-      "Can not serialize an XSLProcessor!";
-  }
-
-  /** ER_NO_INPUT_STYLESHEET          */
-  public static final int ER_NO_INPUT_STYLESHEET = 48;
-
-  static
-  {
-    contents[ER_NO_INPUT_STYLESHEET][1] =
-      "Stylesheet input was not specified!";
-  }
-
-  /** ER_FAILED_PROCESS_STYLESHEET          */
-  public static final int ER_FAILED_PROCESS_STYLESHEET = 49;
-
-  static
-  {
-    contents[ER_FAILED_PROCESS_STYLESHEET][1] =
-      "Failed to process stylesheet!";
-  }
-
-  /** ER_COULDNT_PARSE_DOC          */
-  public static final int ER_COULDNT_PARSE_DOC = 50;
-
-  static
-  {
-    contents[ER_COULDNT_PARSE_DOC][1] = "Could not parse {0} document!";
-  }
-
-  /** ER_COULDNT_FIND_FRAGMENT          */
-  public static final int ER_COULDNT_FIND_FRAGMENT = 51;
-
-  static
-  {
-    contents[ER_COULDNT_FIND_FRAGMENT][1] = "Could not find fragment: {0}";
-  }
-
-  /** ER_NODE_NOT_ELEMENT          */
-  public static final int ER_NODE_NOT_ELEMENT = 52;
-
-  static
-  {
-    contents[ER_NODE_NOT_ELEMENT][1] =
-      "Node pointed to by fragment identifier was not an element: {0}";
-  }
-
-  /** ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB          */
-  public static final int ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB = 53;
-
-  static
-  {
-    contents[ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB][1] =
-      "for-each must have either a match or name attribute";
-  }
-
-  /** ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB          */
-  public static final int ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB = 54;
-
-  static
-  {
-    contents[ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB][1] =
-      "templates must have either a match or name attribute";
-  }
-
-  /** ER_NO_CLONE_OF_DOCUMENT_FRAG          */
-  public static final int ER_NO_CLONE_OF_DOCUMENT_FRAG = 55;
-
-  static
-  {
-    contents[ER_NO_CLONE_OF_DOCUMENT_FRAG][1] =
-      "No clone of a document fragment!";
-  }
-
-  /** ER_CANT_CREATE_ITEM          */
-  public static final int ER_CANT_CREATE_ITEM = 56;
-
-  static
-  {
-    contents[ER_CANT_CREATE_ITEM][1] =
-      "Can not create item in result tree: {0}";
-  }
-
-  /** ER_XMLSPACE_ILLEGAL_VALUE          */
-  public static final int ER_XMLSPACE_ILLEGAL_VALUE = 57;
-
-  static
-  {
-    contents[ER_XMLSPACE_ILLEGAL_VALUE][1] =
-      "xml:space in the source XML has an illegal value: {0}";
-  }
-
-  /** ER_NO_XSLKEY_DECLARATION          */
-  public static final int ER_NO_XSLKEY_DECLARATION = 58;
-
-  static
-  {
-    contents[ER_NO_XSLKEY_DECLARATION][1] =
-      "There is no xsl:key declaration for {0}!";
-  }
-
-  /** ER_CANT_CREATE_URL          */
-  public static final int ER_CANT_CREATE_URL = 59;
-
-  static
-  {
-    contents[ER_CANT_CREATE_URL][1] = "Error! Cannot create url for: {0}";
-  }
-
-  /** ER_XSLFUNCTIONS_UNSUPPORTED          */
-  public static final int ER_XSLFUNCTIONS_UNSUPPORTED = 60;
-
-  static
-  {
-    contents[ER_XSLFUNCTIONS_UNSUPPORTED][1] = "xsl:functions is unsupported";
-  }
-
-  /** ER_PROCESSOR_ERROR          */
-  public static final int ER_PROCESSOR_ERROR = 61;
-
-  static
-  {
-    contents[ER_PROCESSOR_ERROR][1] = "XSLT TransformerFactory Error";
-  }
-
-  /** ER_NOT_ALLOWED_INSIDE_STYLESHEET          */
-  public static final int ER_NOT_ALLOWED_INSIDE_STYLESHEET = 62;
-
-  static
-  {
-    contents[ER_NOT_ALLOWED_INSIDE_STYLESHEET][1] =
-      "(StylesheetHandler) {0} not allowed inside a stylesheet!";
-  }
-
-  /** ER_RESULTNS_NOT_SUPPORTED          */
-  public static final int ER_RESULTNS_NOT_SUPPORTED = 63;
-
-  static
-  {
-    contents[ER_RESULTNS_NOT_SUPPORTED][1] =
-      "result-ns no longer supported!  Use xsl:output instead.";
-  }
-
-  /** ER_DEFAULTSPACE_NOT_SUPPORTED          */
-  public static final int ER_DEFAULTSPACE_NOT_SUPPORTED = 64;
-
-  static
-  {
-    contents[ER_DEFAULTSPACE_NOT_SUPPORTED][1] =
-      "default-space no longer supported!  Use xsl:strip-space or xsl:preserve-space instead.";
-  }
-
-  /** ER_INDENTRESULT_NOT_SUPPORTED          */
-  public static final int ER_INDENTRESULT_NOT_SUPPORTED = 65;
-
-  static
-  {
-    contents[ER_INDENTRESULT_NOT_SUPPORTED][1] =
-      "indent-result no longer supported!  Use xsl:output instead.";
-  }
-
-  /** ER_ILLEGAL_ATTRIB          */
-  public static final int ER_ILLEGAL_ATTRIB = 66;
-
-  static
-  {
-    contents[ER_ILLEGAL_ATTRIB][1] =
-      "(StylesheetHandler) {0} has an illegal attribute: {1}";
-  }
-
-  /** ER_UNKNOWN_XSL_ELEM          */
-  public static final int ER_UNKNOWN_XSL_ELEM = 67;
-
-  static
-  {
-    contents[ER_UNKNOWN_XSL_ELEM][1] = "Unknown XSL element: {0}";
-  }
-
-  /** ER_BAD_XSLSORT_USE          */
-  public static final int ER_BAD_XSLSORT_USE = 68;
-
-  static
-  {
-    contents[ER_BAD_XSLSORT_USE][1] =
-      "(StylesheetHandler) xsl:sort can only be used with xsl:apply-templates or xsl:for-each.";
-  }
-
-  /** ER_MISPLACED_XSLWHEN          */
-  public static final int ER_MISPLACED_XSLWHEN = 69;
-
-  static
-  {
-    contents[ER_MISPLACED_XSLWHEN][1] =
-      "(StylesheetHandler) misplaced xsl:when!";
-  }
-
-  /** ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE          */
-  public static final int ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE = 70;
-
-  static
-  {
-    contents[ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE][1] =
-      "(StylesheetHandler) xsl:when not parented by xsl:choose!";
-  }
-
-  /** ER_MISPLACED_XSLOTHERWISE          */
-  public static final int ER_MISPLACED_XSLOTHERWISE = 71;
-
-  static
-  {
-    contents[ER_MISPLACED_XSLOTHERWISE][1] =
-      "(StylesheetHandler) misplaced xsl:otherwise!";
-  }
-
-  /** ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE          */
-  public static final int ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE = 72;
-
-  static
-  {
-    contents[ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE][1] =
-      "(StylesheetHandler) xsl:otherwise not parented by xsl:choose!";
-  }
-
-  /** ER_NOT_ALLOWED_INSIDE_TEMPLATE          */
-  public static final int ER_NOT_ALLOWED_INSIDE_TEMPLATE = 73;
-
-  static
-  {
-    contents[ER_NOT_ALLOWED_INSIDE_TEMPLATE][1] =
-      "(StylesheetHandler) {0} is not allowed inside a template!";
-  }
-
-  /** ER_UNKNOWN_EXT_NS_PREFIX          */
-  public static final int ER_UNKNOWN_EXT_NS_PREFIX = 74;
-
-  static
-  {
-    contents[ER_UNKNOWN_EXT_NS_PREFIX][1] =
-      "(StylesheetHandler) {0} extension namespace prefix {1} unknown";
-  }
-
-  /** ER_IMPORTS_AS_FIRST_ELEM          */
-  public static final int ER_IMPORTS_AS_FIRST_ELEM = 75;
-
-  static
-  {
-    contents[ER_IMPORTS_AS_FIRST_ELEM][1] =
-      "(StylesheetHandler) Imports can only occur as the first elements in the stylesheet!";
-  }
-
-  /** ER_IMPORTING_ITSELF          */
-  public static final int ER_IMPORTING_ITSELF = 76;
-
-  static
-  {
-    contents[ER_IMPORTING_ITSELF][1] =
-      "(StylesheetHandler) {0} is directly or indirectly importing itself!";
-  }
-
-  /** ER_XMLSPACE_ILLEGAL_VAL          */
-  public static final int ER_XMLSPACE_ILLEGAL_VAL = 77;
-
-  static
-  {
-    contents[ER_XMLSPACE_ILLEGAL_VAL][1] =
-      "(StylesheetHandler) " + "xml:space has an illegal value: {0}";
-  }
-
-  /** ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL          */
-  public static final int ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL = 78;
-
-  static
-  {
-    contents[ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL][1] =
-      "processStylesheet not succesfull!";
-  }
-
-  /** ER_SAX_EXCEPTION          */
-  public static final int ER_SAX_EXCEPTION = 79;
-
-  static
-  {
-    contents[ER_SAX_EXCEPTION][1] = "SAX Exception";
-  }
-
-  /** ER_FUNCTION_NOT_SUPPORTED          */
-  public static final int ER_FUNCTION_NOT_SUPPORTED = 80;
-
-  static
-  {
-    contents[ER_FUNCTION_NOT_SUPPORTED][1] = "Function not supported!";
-  }
-
-  /** ER_XSLT_ERROR          */
-  public static final int ER_XSLT_ERROR = 81;
-
-  static
-  {
-    contents[ER_XSLT_ERROR][1] = "XSLT Error";
-  }
-
-  /** ER_CURRENCY_SIGN_ILLEGAL          */
-  public static final int ER_CURRENCY_SIGN_ILLEGAL = 82;
-
-  static
-  {
-    contents[ER_CURRENCY_SIGN_ILLEGAL][1] =
-      "currency sign is not allowed in format pattern string";
-  }
-
-  /** ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM          */
-  public static final int ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM = 83;
-
-  static
-  {
-    contents[ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM][1] =
-      "Document function not supported in Stylesheet DOM!";
-  }
-
-  /** ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER          */
-  public static final int ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER = 84;
-
-  static
-  {
-    contents[ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER][1] =
-      "Can't resolve prefix of non-Prefix resolver!";
-  }
-
-  /** ER_REDIRECT_COULDNT_GET_FILENAME          */
-  public static final int ER_REDIRECT_COULDNT_GET_FILENAME = 85;
-
-  static
-  {
-    contents[ER_REDIRECT_COULDNT_GET_FILENAME][1] =
-      "Redirect extension: Could not get filename - file or select attribute must return vald string.";
-  }
-
-  /** ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT          */
-  public static final int ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT = 86;
-
-  static
-  {
-    contents[ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT][1] =
-      "Can not build FormatterListener in Redirect extension!";
-  }
-
-  /** ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX          */
-  public static final int ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX = 87;
-
-  static
-  {
-    contents[ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX][1] =
-      "Prefix in exclude-result-prefixes is not valid: {0}";
-  }
-
-  /** ER_MISSING_NS_URI          */
-  public static final int ER_MISSING_NS_URI = 88;
-
-  static
-  {
-    contents[ER_MISSING_NS_URI][1] =
-      "Missing namespace URI for specified prefix";
-  }
-
-  /** ER_MISSING_ARG_FOR_OPTION          */
-  public static final int ER_MISSING_ARG_FOR_OPTION = 89;
-
-  static
-  {
-    contents[ER_MISSING_ARG_FOR_OPTION][1] =
-      "Missing argument for option: {0}";
-  }
-
-  /** ER_INVALID_OPTION          */
-  public static final int ER_INVALID_OPTION = 90;
-
-  static
-  {
-    contents[ER_INVALID_OPTION][1] = "Invalid option: {0}";
-  }
-
-  /** ER_MALFORMED_FORMAT_STRING          */
-  public static final int ER_MALFORMED_FORMAT_STRING = 91;
-
-  static
-  {
-    contents[ER_MALFORMED_FORMAT_STRING][1] = "Malformed format string: {0}";
-  }
-
-  /** ER_STYLESHEET_REQUIRES_VERSION_ATTRIB          */
-  public static final int ER_STYLESHEET_REQUIRES_VERSION_ATTRIB = 92;
-
-  static
-  {
-    contents[ER_STYLESHEET_REQUIRES_VERSION_ATTRIB][1] =
-      "xsl:stylesheet requires a 'version' attribute!";
-  }
-
-  /** ER_ILLEGAL_ATTRIBUTE_VALUE          */
-  public static final int ER_ILLEGAL_ATTRIBUTE_VALUE = 93;
-
-  static
-  {
-    contents[ER_ILLEGAL_ATTRIBUTE_VALUE][1] =
-      "Attribute: {0} has an illegal value: {1}";
-  }
-
-  /** ER_CHOOSE_REQUIRES_WHEN          */
-  public static final int ER_CHOOSE_REQUIRES_WHEN = 94;
-
-  static
-  {
-    contents[ER_CHOOSE_REQUIRES_WHEN][1] = "xsl:choose requires an xsl:when";
-  }
-
-  /** ER_NO_APPLY_IMPORT_IN_FOR_EACH          */
-  public static final int ER_NO_APPLY_IMPORT_IN_FOR_EACH = 95;
-
-  static
-  {
-    contents[ER_NO_APPLY_IMPORT_IN_FOR_EACH][1] =
-      "xsl:apply-imports not allowed in a xsl:for-each";
-  }
-
-  /** ER_CANT_USE_DTM_FOR_OUTPUT          */
-  public static final int ER_CANT_USE_DTM_FOR_OUTPUT = 96;
-
-  static
-  {
-    contents[ER_CANT_USE_DTM_FOR_OUTPUT][1] =
-      "Cannot use a DTMLiaison for an output DOM node... pass a org.apache.xpath.DOM2Helper instead!";
-  }
-
-  /** ER_CANT_USE_DTM_FOR_INPUT          */
-  public static final int ER_CANT_USE_DTM_FOR_INPUT = 97;
-
-  static
-  {
-    contents[ER_CANT_USE_DTM_FOR_INPUT][1] =
-      "Cannot use a DTMLiaison for a input DOM node... pass a org.apache.xpath.DOM2Helper instead!";
-  }
-
-  /** ER_CALL_TO_EXT_FAILED          */
-  public static final int ER_CALL_TO_EXT_FAILED = 98;
-
-  static
-  {
-    contents[ER_CALL_TO_EXT_FAILED][1] =
-      "Call to extension element failed: {0}";
-  }
-
-  /** ER_PREFIX_MUST_RESOLVE          */
-  public static final int ER_PREFIX_MUST_RESOLVE = 99;
-
-  static
-  {
-    contents[ER_PREFIX_MUST_RESOLVE][1] =
-      "Prefix must resolve to a namespace: {0}";
-  }
-
-  /** ER_INVALID_UTF16_SURROGATE          */
-  public static final int ER_INVALID_UTF16_SURROGATE = 100;
-
-  static
-  {
-    contents[ER_INVALID_UTF16_SURROGATE][1] =
-      "Invalid UTF-16 surrogate detected: {0} ?";
-  }
-
-  /** ER_XSLATTRSET_USED_ITSELF          */
-  public static final int ER_XSLATTRSET_USED_ITSELF = 101;
-
-  static
-  {
-    contents[ER_XSLATTRSET_USED_ITSELF][1] =
-      "xsl:attribute-set {0} used itself, which will cause an infinite loop.";
-  }
-
-  /** ER_CANNOT_MIX_XERCESDOM          */
-  public static final int ER_CANNOT_MIX_XERCESDOM = 102;
-
-  static
-  {
-    contents[ER_CANNOT_MIX_XERCESDOM][1] =
-      "Can not mix non Xerces-DOM input with Xerces-DOM output!";
-  }
-
-  /** ER_TOO_MANY_LISTENERS          */
-  public static final int ER_TOO_MANY_LISTENERS = 103;
-
-  static
-  {
-    contents[ER_TOO_MANY_LISTENERS][1] =
-      "addTraceListenersToStylesheet - TooManyListenersException";
-  }
-
-  /** ER_IN_ELEMTEMPLATEELEM_READOBJECT          */
-  public static final int ER_IN_ELEMTEMPLATEELEM_READOBJECT = 104;
-
-  static
-  {
-    contents[ER_IN_ELEMTEMPLATEELEM_READOBJECT][1] =
-      "In ElemTemplateElement.readObject: {0}";
-  }
-
-  /** ER_DUPLICATE_NAMED_TEMPLATE          */
-  public static final int ER_DUPLICATE_NAMED_TEMPLATE = 105;
-
-  static
-  {
-    contents[ER_DUPLICATE_NAMED_TEMPLATE][1] =
-      "Found more than one template named: {0}";
-  }
-
-  /** ER_INVALID_KEY_CALL          */
-  public static final int ER_INVALID_KEY_CALL = 106;
-
-  static
-  {
-    contents[ER_INVALID_KEY_CALL][1] =
-      "Invalid function call: recursive key() calls are not allowed";
-  }
-  
-  /** Variable is referencing itself          */
-  public static final int ER_REFERENCING_ITSELF = 107;
-
-  static
-  {
-    contents[ER_REFERENCING_ITSELF][1] =
-      "Variable {0} is directly or indirectly referencing itself!";
-  }
-  
-  /** Illegal DOMSource input          */
-  public static final int ER_ILLEGAL_DOMSOURCE_INPUT = 108;
-
-  static
-  {
-    contents[ER_ILLEGAL_DOMSOURCE_INPUT][1] =
-      "The input node can not be null for a DOMSource for newTemplates!";
-  }
-	
-	/** Class not found for option         */
-  public static final int ER_CLASS_NOT_FOUND_FOR_OPTION = 109;
-
-  static
-  {
-    contents[ER_CLASS_NOT_FOUND_FOR_OPTION][1] =
-			"Class file not found for option {0}";
-  }
-	
-	/** Required Element not found         */
-  public static final int ER_REQUIRED_ELEM_NOT_FOUND = 110;
-
-  static
-  {
-    contents[ER_REQUIRED_ELEM_NOT_FOUND][1] =
-			"Required Element not found: {0}";
-  }
-  
-  /** InputStream cannot be null         */
-  public static final int ER_INPUT_CANNOT_BE_NULL = 111;
-
-  static
-  {
-    contents[ER_INPUT_CANNOT_BE_NULL][1] =
-			"InputStream cannot be null";
-  }
-  
-  /** URI cannot be null         */
-  public static final int ER_URI_CANNOT_BE_NULL = 112;
-
-  static
-  {
-    contents[ER_URI_CANNOT_BE_NULL][1] =
-			"URI cannot be null";
-  }
-  
-  /** File cannot be null         */
-  public static final int ER_FILE_CANNOT_BE_NULL = 113;
-
-  static
-  {
-    contents[ER_FILE_CANNOT_BE_NULL][1] =
-			"File cannot be null";
-  }
-  
-   /** InputSource cannot be null         */
-  public static final int ER_SOURCE_CANNOT_BE_NULL = 114;
-
-  static
-  {
-    contents[ER_SOURCE_CANNOT_BE_NULL][1] =
-			"InputSource cannot be null";
-  }
-  
-  /** Can't overwrite cause         */
-  public static final int ER_CANNOT_OVERWRITE_CAUSE = 115;
-
-  static
-  {
-    contents[ER_CANNOT_OVERWRITE_CAUSE][1] =
-			"Cannot overwrite cause";
-  }
-  
-  /** Could not initialize BSF Manager        */
-  public static final int ER_CANNOT_INIT_BSFMGR = 116;
-
-  static
-  {
-    contents[ER_CANNOT_INIT_BSFMGR][1] =
-			"Could not initialize BSF Manager";
-  }
-  
-  /** Could not compile extension       */
-  public static final int ER_CANNOT_CMPL_EXTENSN = 117;
-
-  static
-  {
-    contents[ER_CANNOT_CMPL_EXTENSN][1] =
-			"Could not compile extension";
-  }
-  
-  /** Could not create extension       */
-  public static final int ER_CANNOT_CREATE_EXTENSN = 118;
-
-  static
-  {
-    contents[ER_CANNOT_CREATE_EXTENSN][1] =
-      "Could not create extension: {0} because of: {1}";
-  }
-  
-  /** Instance method call to method {0} requires an Object instance as first argument       */
-  public static final int ER_INSTANCE_MTHD_CALL_REQUIRES = 119;
-
-  static
-  {
-    contents[ER_INSTANCE_MTHD_CALL_REQUIRES][1] =
-      "Instance method call to method {0} requires an Object instance as first argument";
-  }
-  
-  /** Invalid element name specified       */
-  public static final int ER_INVALID_ELEMENT_NAME = 120;
-
-  static
-  {
-    contents[ER_INVALID_ELEMENT_NAME][1] =
-      "Invalid element name specified {0}";
-  }
-  
-   /** Element name method must be static      */
-  public static final int ER_ELEMENT_NAME_METHOD_STATIC = 121;
-
-  static
-  {
-    contents[ER_ELEMENT_NAME_METHOD_STATIC][1] =
-      "Element name method must be static {0}";
-  }
-  
-   /** Extension function {0} : {1} is unknown      */
-  public static final int ER_EXTENSION_FUNC_UNKNOWN = 122;
-
-  static
-  {
-    contents[ER_EXTENSION_FUNC_UNKNOWN][1] =
-             "Extension function {0} : {1} is unknown";
-  }
-  
-   /** More than one best match for constructor for       */
-  public static final int ER_MORE_MATCH_CONSTRUCTOR = 123;
-
-  static
-  {
-    contents[ER_MORE_MATCH_CONSTRUCTOR][1] =
-             "More than one best match for constructor for {0}";
-  }
-  
-   /** More than one best match for method      */
-  public static final int ER_MORE_MATCH_METHOD = 124;
-
-  static
-  {
-    contents[ER_MORE_MATCH_METHOD][1] =
-             "More than one best match for method {0}";
-  }
-  
-   /** More than one best match for element method      */
-  public static final int ER_MORE_MATCH_ELEMENT = 125;
-
-  static
-  {
-    contents[ER_MORE_MATCH_ELEMENT][1] =
-             "More than one best match for element method {0}";
-  }
-  
-   /** Invalid context passed to evaluate       */
-  public static final int ER_INVALID_CONTEXT_PASSED = 126;
-
-  static
-  {
-    contents[ER_INVALID_CONTEXT_PASSED][1] =
-             "Invalid context passed to evaluate {0}";
-  }
-  
-   /** Pool already exists       */
-  public static final int ER_POOL_EXISTS = 127;
-
-  static
-  {
-    contents[ER_POOL_EXISTS][1] =
-             "Pool already exists";
-  }
-  
-   /** No driver Name specified      */
-  public static final int ER_NO_DRIVER_NAME = 128;
-
-  static
-  {
-    contents[ER_NO_DRIVER_NAME][1] =
-             "No driver Name specified";
-  }
-  
-   /** No URL specified     */
-  public static final int ER_NO_URL = 129;
-
-  static
-  {
-    contents[ER_NO_URL][1] =
-             "No URL specified";
-  }
-  
-   /** Pool size is less than one    */
-  public static final int ER_POOL_SIZE_LESSTHAN_ONE = 130;
-
-  static
-  {
-    contents[ER_POOL_SIZE_LESSTHAN_ONE][1] =
-             "Pool size is less than one!";
-  }
-  
-   /** Invalid driver name specified    */
-  public static final int ER_INVALID_DRIVER = 131;
-
-  static
-  {
-    contents[ER_INVALID_DRIVER][1] =
-             "Invalid driver name specified!";
-  }
-  
-   /** Did not find the stylesheet root    */
-  public static final int ER_NO_STYLESHEETROOT = 132;
-
-  static
-  {
-    contents[ER_NO_STYLESHEETROOT][1] =
-             "Did not find the stylesheet root!";
-  }
-  
-   /** Illegal value for xml:space     */
-  public static final int ER_ILLEGAL_XMLSPACE_VALUE = 133;
-
-  static
-  {
-    contents[ER_ILLEGAL_XMLSPACE_VALUE][1] =
-         "Illegal value for xml:space";
-  }
-  
-   /** processFromNode failed     */
-  public static final int ER_PROCESSFROMNODE_FAILED = 134;
-
-  static
-  {
-    contents[ER_PROCESSFROMNODE_FAILED][1] =
-         "processFromNode failed";
-  }
-  
-   /** The resource [] could not load:     */
-  public static final int ER_RESOURCE_COULD_NOT_LOAD = 135;
-
-  static
-  {
-    contents[ER_RESOURCE_COULD_NOT_LOAD][1] =
-        "The resource [ {0} ] could not load: {1} \n {2} \t {3}";
-  }
-   
-  
-   /** Buffer size <=0     */
-  public static final int ER_BUFFER_SIZE_LESSTHAN_ZERO = 136;
-
-  static
-  {
-    contents[ER_BUFFER_SIZE_LESSTHAN_ZERO][1] =
-        "Buffer size <=0";
-  }
-  
-   /** Unknown error when calling extension    */
-  public static final int ER_UNKNOWN_ERROR_CALLING_EXTENSION = 137;
-
-  static
-  {
-    contents[ER_UNKNOWN_ERROR_CALLING_EXTENSION][1] =
-        "Unknown error when calling extension";
-  }
-  
-   /** Prefix {0} does not have a corresponding namespace declaration    */
-  public static final int ER_NO_NAMESPACE_DECL = 138;
-
-  static
-  {
-    contents[ER_NO_NAMESPACE_DECL][1] =
-        "Prefix {0} does not have a corresponding namespace declaration";
-  }
-  
-   /** Element content not allowed for lang=javaclass   */
-  public static final int ER_ELEM_CONTENT_NOT_ALLOWED = 139;
-
-  static
-  {
-    contents[ER_ELEM_CONTENT_NOT_ALLOWED][1] =
-        "Element content not allowed for lang=javaclass {0}";
-  }   
-  
-   /** Stylesheet directed termination   */
-  public static final int ER_STYLESHEET_DIRECTED_TERMINATION = 140;
-
-  static
-  {
-    contents[ER_STYLESHEET_DIRECTED_TERMINATION][1] =
-        "Stylesheet directed termination";
-  }
-  
-   /** 1 or 2   */
-  public static final int ER_ONE_OR_TWO = 141;
-
-  static
-  {
-    contents[ER_ONE_OR_TWO][1] =
-        "1 or 2";
-  }
-  
-   /** 2 or 3   */
-  public static final int ER_TWO_OR_THREE = 142;
-
-  static
-  {
-    contents[ER_TWO_OR_THREE][1] =
-        "2 or 3";
-  }
-  
-   /** Could not load {0} (check CLASSPATH), now using just the defaults   */
-  public static final int ER_COULD_NOT_LOAD_RESOURCE = 143;
-
-  static
-  {
-    contents[ER_COULD_NOT_LOAD_RESOURCE][1] =
-        "Could not load {0} (check CLASSPATH), now using just the defaults";
-  }
-  
-   /** Cannot initialize default templates   */
-  public static final int ER_CANNOT_INIT_DEFAULT_TEMPLATES = 144;
-
-  static
-  {
-    contents[ER_CANNOT_INIT_DEFAULT_TEMPLATES][1] =
-        "Cannot initialize default templates";
-  }
-  
-   /** Result should not be null   */
-  public static final int ER_RESULT_NULL = 145;
-
-  static
-  {
-    contents[ER_RESULT_NULL][1] =
-        "Result should not be null";
-  }
-    
-   /** Result could not be set   */
-  public static final int ER_RESULT_COULD_NOT_BE_SET = 146;
-
-  static
-  {
-    contents[ER_RESULT_COULD_NOT_BE_SET][1] =
-        "Result could not be set";
-  }
-  
-   /** No output specified   */
-  public static final int ER_NO_OUTPUT_SPECIFIED = 147;
-
-  static
-  {
-    contents[ER_NO_OUTPUT_SPECIFIED][1] =
-        "No output specified";
-  }
-  
-   /** Can't transform to a Result of type   */
-  public static final int ER_CANNOT_TRANSFORM_TO_RESULT_TYPE = 148;
-
-  static
-  {
-    contents[ER_CANNOT_TRANSFORM_TO_RESULT_TYPE][1] =
-        "Can't transform to a Result of type {0}";
-  }
-  
-   /** Can't transform to a Source of type   */
-  public static final int ER_CANNOT_TRANSFORM_SOURCE_TYPE = 149;
-
-  static
-  {
-    contents[ER_CANNOT_TRANSFORM_SOURCE_TYPE][1] =
-        "Can't transform a Source of type {0}";
-  }
-  
-   /** Null content handler  */
-  public static final int ER_NULL_CONTENT_HANDLER = 150;
-
-  static
-  {
-    contents[ER_NULL_CONTENT_HANDLER][1] =
-        "Null content handler";
-  }
-  
-   /** Null error handler  */
-  public static final int ER_NULL_ERROR_HANDLER = 151;
-
-  static
-  {
-    contents[ER_NULL_ERROR_HANDLER][1] =
-        "Null error handler";
-  }
-  
-   /** parse can not be called if the ContentHandler has not been set */
-  public static final int ER_CANNOT_CALL_PARSE = 152;
-
-  static
-  {
-    contents[ER_CANNOT_CALL_PARSE][1] =
-        "parse can not be called if the ContentHandler has not been set";
-  }
-  
-   /**  No parent for filter */
-  public static final int ER_NO_PARENT_FOR_FILTER = 153;
-
-  static
-  {
-    contents[ER_NO_PARENT_FOR_FILTER][1] =
-        "No parent for filter";
-  }
-  
-  
-   /**  No stylesheet found in: {0}, media */
-  public static final int ER_NO_STYLESHEET_IN_MEDIA = 154;
-
-  static
-  {
-    contents[ER_NO_STYLESHEET_IN_MEDIA][1] =
-         "No stylesheet found in: {0}, media= {1}";
-  }
-  
-   /**  No xml-stylesheet PI found in */
-  public static final int ER_NO_STYLESHEET_PI = 155;
-
-  static
-  {
-    contents[ER_NO_STYLESHEET_PI][1] =
-         "No xml-stylesheet PI found in: {0}";
-  }
-  
-   /**  No default implementation found */
-  public static final int ER_NO_DEFAULT_IMPL = 156;
-
-  static
-  {
-    contents[ER_NO_DEFAULT_IMPL][1] =
-         "No default implementation found ";
-  }
-  
-   /**  ChunkedIntArray({0}) not currently supported */
-  public static final int ER_CHUNKEDINTARRAY_NOT_SUPPORTED = 157;
-
-  static
-  {
-    contents[ER_CHUNKEDINTARRAY_NOT_SUPPORTED][1] =
-       "ChunkedIntArray({0}) not currently supported";
-  }
-  
-   /**  Offset bigger than slot */
-  public static final int ER_OFFSET_BIGGER_THAN_SLOT = 158;
-
-  static
-  {
-    contents[ER_OFFSET_BIGGER_THAN_SLOT][1] =
-       "Offset bigger than slot";
-  }
-  
-   /**  Coroutine not available, id= */
-  public static final int ER_COROUTINE_NOT_AVAIL = 159;
-
-  static
-  {
-    contents[ER_COROUTINE_NOT_AVAIL][1] =
-       "Coroutine not available, id={0}";
-  }
-  
-   /**  CoroutineManager recieved co_exit() request */
-  public static final int ER_COROUTINE_CO_EXIT = 160;
-
-  static
-  {
-    contents[ER_COROUTINE_CO_EXIT][1] =
-       "CoroutineManager received co_exit() request";
-  }
-  
-   /**  co_joinCoroutineSet() failed */
-  public static final int ER_COJOINROUTINESET_FAILED = 161;
-
-  static
-  {
-    contents[ER_COJOINROUTINESET_FAILED][1] =
-       "co_joinCoroutineSet() failed";
-  }
-  
-   /**  Coroutine parameter error () */
-  public static final int ER_COROUTINE_PARAM = 162;
-
-  static
-  {
-    contents[ER_COROUTINE_PARAM][1] =
-       "Coroutine parameter error ({0})";
-  }
-  
-   /**  UNEXPECTED: Parser doTerminate answers  */
-  public static final int ER_PARSER_DOTERMINATE_ANSWERS = 163;
-
-  static
-  {
-    contents[ER_PARSER_DOTERMINATE_ANSWERS][1] =
-       "\nUNEXPECTED: Parser doTerminate answers {0}";
-  }
-  
-   /**  parse may not be called while parsing */
-  public static final int ER_NO_PARSE_CALL_WHILE_PARSING = 164;
-
-  static
-  {
-    contents[ER_NO_PARSE_CALL_WHILE_PARSING][1] =
-       "parse may not be called while parsing";
-  }
-  
-   /**  Error: typed iterator for axis  {0} not implemented  */
-  public static final int ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = 165;
-
-  static
-  {
-    contents[ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED][1] =
-       "Error: typed iterator for axis  {0} not implemented";
-  }
-  
-   /**  Error: iterator for axis {0} not implemented  */
-  public static final int ER_ITERATOR_AXIS_NOT_IMPLEMENTED = 166;
-
-  static
-  {
-    contents[ER_ITERATOR_AXIS_NOT_IMPLEMENTED][1] =
-       "Error: iterator for axis {0} not implemented ";
-  }
-  
-   /**  Iterator clone not supported  */
-  public static final int ER_ITERATOR_CLONE_NOT_SUPPORTED = 167;
-
-  static
-  {
-    contents[ER_ITERATOR_CLONE_NOT_SUPPORTED][1] =
-       "Iterator clone not supported";
-  }
-  
-   /**  Unknown axis traversal type  */
-  public static final int ER_UNKNOWN_AXIS_TYPE = 168;
-
-  static
-  {
-    contents[ER_UNKNOWN_AXIS_TYPE][1] =
-       "Unknown axis traversal type: {0}";
-  }
-  
-   /**  Axis traverser not supported  */
-  public static final int ER_AXIS_NOT_SUPPORTED = 169;
-
-  static
-  {
-    contents[ER_AXIS_NOT_SUPPORTED][1] =
-       "Axis traverser not supported: {0}";
-  }
-  
-   /**  No more DTM IDs are available  */
-  public static final int ER_NO_DTMIDS_AVAIL = 170;
-
-  static
-  {
-    contents[ER_NO_DTMIDS_AVAIL][1] =
-       "No more DTM IDs are available";
-  }
-  
-   /**  Not supported  */
-  public static final int ER_NOT_SUPPORTED = 171;
-
-  static
-  {
-    contents[ER_NOT_SUPPORTED][1] =
-       "Not supported: {0}";
-  }
-  
-   /**  node must be non-null for getDTMHandleFromNode  */
-  public static final int ER_NODE_NON_NULL = 172;
-
-  static
-  {
-    contents[ER_NODE_NON_NULL][1] =
-       "Node must be non-null for getDTMHandleFromNode";
-  }
-  
-   /**  Could not resolve the node to a handle  */
-  public static final int ER_COULD_NOT_RESOLVE_NODE = 173;
-
-  static
-  {
-    contents[ER_COULD_NOT_RESOLVE_NODE][1] =
-       "Could not resolve the node to a handle";
-  }
-  
-   /**  startParse may not be called while parsing */
-  public static final int ER_STARTPARSE_WHILE_PARSING = 174;
-
-  static
-  {
-    contents[ER_STARTPARSE_WHILE_PARSING][1] =
-       "startParse may not be called while parsing";
-  }
-  
-   /**  startParse needs a non-null SAXParser  */
-  public static final int ER_STARTPARSE_NEEDS_SAXPARSER = 175;
-
-  static
-  {
-    contents[ER_STARTPARSE_NEEDS_SAXPARSER][1] =
-       "startParse needs a non-null SAXParser";
-  }
-  
-   /**  could not initialize parser with */
-  public static final int ER_COULD_NOT_INIT_PARSER = 176;
-
-  static
-  {
-    contents[ER_COULD_NOT_INIT_PARSER][1] =
-       "could not initialize parser with";
-  }
-  
-   /**  Value for property {0} should be a Boolean instance  */
-  public static final int ER_PROPERTY_VALUE_BOOLEAN = 177;
-
-  static
-  {
-    contents[ER_PROPERTY_VALUE_BOOLEAN][1] =
-       "Value for property {0} should be a Boolean instance";
-  }
-  
-   /**  exception creating new instance for pool  */
-  public static final int ER_EXCEPTION_CREATING_POOL = 178;
-
-  static
-  {
-    contents[ER_EXCEPTION_CREATING_POOL][1] =
-       "exception creating new instance for pool";
-  }
-  
-   /**  Path contains invalid escape sequence  */
-  public static final int ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = 179;
-
-  static
-  {
-    contents[ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE][1] =
-       "Path contains invalid escape sequence";
-  }
-  
-   /**  Scheme is required!  */
-  public static final int ER_SCHEME_REQUIRED = 180;
-
-  static
-  {
-    contents[ER_SCHEME_REQUIRED][1] =
-       "Scheme is required!";
-  }
-  
-   /**  No scheme found in URI  */
-  public static final int ER_NO_SCHEME_IN_URI = 181;
-
-  static
-  {
-    contents[ER_NO_SCHEME_IN_URI][1] =
-       "No scheme found in URI: {0}";
-  }
-  
-   /**  No scheme found in URI  */
-  public static final int ER_NO_SCHEME_INURI = 182;
-
-  static
-  {
-    contents[ER_NO_SCHEME_INURI][1] =
-       "No scheme found in URI";
-  }
-  
-   /**  Path contains invalid character:   */
-  public static final int ER_PATH_INVALID_CHAR = 183;
-
-  static
-  {
-    contents[ER_PATH_INVALID_CHAR][1] =
-       "Path contains invalid character: {0}";
-  }
-  
-   /**  Cannot set scheme from null string  */
-  public static final int ER_SCHEME_FROM_NULL_STRING = 184;
-
-  static
-  {
-    contents[ER_SCHEME_FROM_NULL_STRING][1] =
-       "Cannot set scheme from null string";
-  }
-  
-   /**  The scheme is not conformant. */
-  public static final int ER_SCHEME_NOT_CONFORMANT = 185;
-
-  static
-  {
-    contents[ER_SCHEME_NOT_CONFORMANT][1] =
-       "The scheme is not conformant.";
-  }
-  
-   /**  Host is not a well formed address  */
-  public static final int ER_HOST_ADDRESS_NOT_WELLFORMED = 186;
-
-  static
-  {
-    contents[ER_HOST_ADDRESS_NOT_WELLFORMED][1] =
-       "Host is not a well formed address";
-  }
-  
-   /**  Port cannot be set when host is null  */
-  public static final int ER_PORT_WHEN_HOST_NULL = 187;
-
-  static
-  {
-    contents[ER_PORT_WHEN_HOST_NULL][1] =
-       "Port cannot be set when host is null";
-  }
-  
-   /**  Invalid port number  */
-  public static final int ER_INVALID_PORT = 188;
-
-  static
-  {
-    contents[ER_INVALID_PORT][1] =
-       "Invalid port number";
-  }
-  
-   /**  Fragment can only be set for a generic URI  */
-  public static final int ER_FRAG_FOR_GENERIC_URI = 189;
-
-  static
-  {
-    contents[ER_FRAG_FOR_GENERIC_URI][1] =
-       "Fragment can only be set for a generic URI";
-  }
-  
-   /**  Fragment cannot be set when path is null  */
-  public static final int ER_FRAG_WHEN_PATH_NULL = 190;
-
-  static
-  {
-    contents[ER_FRAG_WHEN_PATH_NULL][1] =
-       "Fragment cannot be set when path is null";
-  }
-  
-   /**  Fragment contains invalid character  */
-  public static final int ER_FRAG_INVALID_CHAR = 191;
-
-  static
-  {
-    contents[ER_FRAG_INVALID_CHAR][1] =
-       "Fragment contains invalid character";
-  }
-  
- 
-  
-   /** Parser is already in use  */
-  public static final int ER_PARSER_IN_USE = 192;
-
-  static
-  {
-    contents[ER_PARSER_IN_USE][1] =
-        "Parser is already in use";
-  }
-  
-   /** Parser is already in use  */
-  public static final int ER_CANNOT_CHANGE_WHILE_PARSING = 193;
-
-  static
-  {
-    contents[ER_CANNOT_CHANGE_WHILE_PARSING][1] =
-        "Cannot change {0} {1} while parsing";
-  }
-  
-   /** Self-causation not permitted  */
-  public static final int ER_SELF_CAUSATION_NOT_PERMITTED = 194;
-
-  static
-  {
-    contents[ER_SELF_CAUSATION_NOT_PERMITTED][1] =
-        "Self-causation not permitted";
-  }
-  
-   /** src attribute not yet supported for  */
-  public static final int ER_COULD_NOT_FIND_EXTERN_SCRIPT = 195;
-
-  static
-  {
-    contents[ER_COULD_NOT_FIND_EXTERN_SCRIPT][1] =
-         "Could not get to external script at {0}";
-  }
-  
-  /** The resource [] could not be found     */
-  public static final int ER_RESOURCE_COULD_NOT_FIND = 196;
-
-  static
-  {
-    contents[ER_RESOURCE_COULD_NOT_FIND][1] =
-        "The resource [ {0} ] could not be found.\n {1}";
-  }
-  
-   /** output property not recognized:  */
-  public static final int ER_OUTPUT_PROPERTY_NOT_RECOGNIZED = 197;
-
-  static
-  {
-    contents[ER_OUTPUT_PROPERTY_NOT_RECOGNIZED][1] =
-        "Output property not recognized: {0}";
-  }
-  
-   /** Userinfo may not be specified if host is not specified   */
-  public static final int ER_NO_USERINFO_IF_NO_HOST = 198;
-
-  static
-  {
-    contents[ER_NO_USERINFO_IF_NO_HOST][1] =
-        "Userinfo may not be specified if host is not specified";
-  }
-  
-   /** Port may not be specified if host is not specified   */
-  public static final int ER_NO_PORT_IF_NO_HOST = 199;
-
-  static
-  {
-    contents[ER_NO_PORT_IF_NO_HOST][1] =
-        "Port may not be specified if host is not specified";
-  }
-  
-   /** Query string cannot be specified in path and query string   */
-  public static final int ER_NO_QUERY_STRING_IN_PATH = 200;
-
-  static
-  {
-    contents[ER_NO_QUERY_STRING_IN_PATH][1] =
-        "Query string cannot be specified in path and query string";
-  }
-  
-   /** Fragment cannot be specified in both the path and fragment   */
-  public static final int ER_NO_FRAGMENT_STRING_IN_PATH = 201;
-
-  static
-  {
-    contents[ER_NO_FRAGMENT_STRING_IN_PATH][1] =
-        "Fragment cannot be specified in both the path and fragment";
-  }
-  
-   /** Cannot initialize URI with empty parameters   */
-  public static final int ER_CANNOT_INIT_URI_EMPTY_PARMS = 202;
-
-  static
-  {
-    contents[ER_CANNOT_INIT_URI_EMPTY_PARMS][1] =
-        "Cannot initialize URI with empty parameters";
-  }
-  
-   /** Failed creating ElemLiteralResult instance   */
-  public static final int ER_FAILED_CREATING_ELEMLITRSLT = 203;
-
-  static
-  {
-    contents[ER_FAILED_CREATING_ELEMLITRSLT][1] =
-        "Failed creating ElemLiteralResult instance";
-  }  
-  
-   /** Priority value does not contain a parsable number   */
-  public static final int ER_PRIORITY_NOT_PARSABLE = 204;
-
-  static
-  {
-    contents[ER_PRIORITY_NOT_PARSABLE][1] =
-        "Priority value does not contain a parsable number";
-  }
-  
-   /**  Value for {0} should equal 'yes' or 'no'   */
-  public static final int ER_VALUE_SHOULD_EQUAL = 205;
-
-  static
-  {
-    contents[ER_VALUE_SHOULD_EQUAL][1] =
-        " Value for {0} should equal yes or no";
-  }
- 
-   /**  Failed calling {0} method   */
-  public static final int ER_FAILED_CALLING_METHOD = 206;
-
-  static
-  {
-    contents[ER_FAILED_CALLING_METHOD][1] =
-        " Failed calling {0} method";
-  }
-  
-   /** Failed creating ElemLiteralResult instance   */
-  public static final int ER_FAILED_CREATING_ELEMTMPL = 207;
-
-  static
-  {
-    contents[ER_FAILED_CREATING_ELEMTMPL][1] =
-        "Failed creating ElemTemplateElement instance";
-  }
-  
-   /**  Characters are not allowed at this point in the document   */
-  public static final int ER_CHARS_NOT_ALLOWED = 208;
-
-  static
-  {
-    contents[ER_CHARS_NOT_ALLOWED][1] =
-        "Characters are not allowed at this point in the document";
-  }
-  
-  /**  attribute is not allowed on the element   */
-  public static final int ER_ATTR_NOT_ALLOWED = 209;
-
-  static
-  {
-    contents[ER_ATTR_NOT_ALLOWED][1] =
-        "\"{0}\" attribute is not allowed on the {1} element!";
-  }
-  
-  /**  Method not yet supported    */
-  public static final int ER_METHOD_NOT_SUPPORTED = 210;
-
-  static
-  {
-    contents[ER_METHOD_NOT_SUPPORTED][1] =
-        "Method not yet supported ";
-  }
- 
-  /**  Bad value    */
-  public static final int ER_BAD_VALUE = 211;
-
-  static
-  {
-    contents[ER_BAD_VALUE][1] =
-     "{0} bad value {1} ";
-  }
-  
-  /**  attribute value not found   */
-  public static final int ER_ATTRIB_VALUE_NOT_FOUND = 212;
-
-  static
-  {
-    contents[ER_ATTRIB_VALUE_NOT_FOUND][1] =
-     "{0} attribute value not found ";
-  }
-  
-  /**  attribute value not recognized    */
-  public static final int ER_ATTRIB_VALUE_NOT_RECOGNIZED = 213;
-
-  static
-  {
-    contents[ER_ATTRIB_VALUE_NOT_RECOGNIZED][1] =
-     "{0} attribute value not recognized ";
-  }
-
-  /** IncrementalSAXSource_Filter not currently restartable   */
-  public static final int ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = 214;
-
-  static
-  {
-    contents[ER_INCRSAXSRCFILTER_NOT_RESTARTABLE][1] =
-     "IncrementalSAXSource_Filter not currently restartable";
-  }
-  
-  /** IncrementalSAXSource_Filter not currently restartable   */
-  public static final int ER_XMLRDR_NOT_BEFORE_STARTPARSE = 215;
-
-  static
-  {
-    contents[ER_XMLRDR_NOT_BEFORE_STARTPARSE][1] =
-     "XMLReader not before startParse request";
-  }
-  
-  /** Attempting to generate a namespace prefix with a null URI   */
-  public static final int ER_NULL_URI_NAMESPACE = 216;
-
-  static
-  {
-    contents[ER_NULL_URI_NAMESPACE][1] =
-     "Attempting to generate a namespace prefix with a null URI";
-  }    
-  
-  
-  /*
-    /**  Cannot find SAX1 driver class    *
-  public static final int ER_CANNOT_FIND_SAX1_DRIVER = 190;
-
-  static
-  {
-    contents[ER_CANNOT_FIND_SAX1_DRIVER][1] =
-      "Cannot find SAX1 driver class {0}";
-  }
-  
-   /**  SAX1 driver class {0} found but cannot be loaded    *
-  public static final int ER_SAX1_DRIVER_NOT_LOADED = 191;
-
-  static
-  {
-    contents[ER_SAX1_DRIVER_NOT_LOADED][1] =
-      "SAX1 driver class {0} found but cannot be loaded";
-  }
-  
-   /**  SAX1 driver class {0} found but cannot be instantiated    *
-  public static final int ER_SAX1_DRIVER_NOT_INSTANTIATED = 192;
-
-  static
-  {
-    contents[ER_SAX1_DRIVER_NOT_INSTANTIATED][1] =
-      "SAX1 driver class {0} loaded but cannot be instantiated";
-  }
-  
-   /**  SAX1 driver class {0} does not implement org.xml.sax.Parser    *
-  public static final int ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER = 193;
-
-  static
-  {
-    contents[ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER][1] =
-      "SAX1 driver class {0} does not implement org.xml.sax.Parser";
-  }
-  
-   /**  System property org.xml.sax.parser not specified    *
-  public static final int ER_PARSER_PROPERTY_NOT_SPECIFIED = 194;
-
-  static
-  {
-    contents[ER_PARSER_PROPERTY_NOT_SPECIFIED][1] =
-      "System property org.xml.sax.parser not specified";
-  }
-  
-   /**  Parser argument must not be null    *
-  public static final int ER_PARSER_ARG_CANNOT_BE_NULL = 195;
-
-  static
-  {
-    contents[ER_PARSER_ARG_CANNOT_BE_NULL][1] =
-      "Parser argument must not be null";
-  }
-  
-   /**  Feature:    *
-  public static final int ER_FEATURE = 196;
-
-  static
-  {
-    contents[ER_FEATURE][1] =
-        "Feature: {0}";
-  }
-  
-   /**  Property:    *
-  public static final int ER_PROPERTY = 197;
-
-  static
-  {
-    contents[ER_PROPERTY][1] =
-        "Property: {0}";
-  }
-  
-   /** Null Entity Resolver  *
-  public static final int ER_NULL_ENTITY_RESOLVER = 198;
-
-  static
-  {
-    contents[ER_NULL_ENTITY_RESOLVER][1] =
-        "Null entity resolver";
-  }
-  
-   /** Null DTD handler  *
-  public static final int ER_NULL_DTD_HANDLER = 199;
-
-  static
-  {
-    contents[ER_NULL_DTD_HANDLER][1] =
-        "Null DTD handler";
-  }
-  
- */ 
-  
-
-  // Warnings...
-
-  /** WG_FOUND_CURLYBRACE          */
-  public static final int WG_FOUND_CURLYBRACE = 1;
-
-  static
-  {
-    contents[WG_FOUND_CURLYBRACE + MAX_CODE][1] =
-      "Found '}' but no attribute template open!";
-  }
-
-  /** WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR          */
-  public static final int WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR = 2;
-
-  static
-  {
-    contents[WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR + MAX_CODE][1] =
-      "Warning: count attribute does not match an ancestor in xsl:number! Target = {0}";
-  }
-
-  /** WG_EXPR_ATTRIB_CHANGED_TO_SELECT          */
-  public static final int WG_EXPR_ATTRIB_CHANGED_TO_SELECT = 3;
-
-  static
-  {
-    contents[WG_EXPR_ATTRIB_CHANGED_TO_SELECT + MAX_CODE][1] =
-      "Old syntax: The name of the 'expr' attribute has been changed to 'select'.";
-  }
-
-  /** WG_NO_LOCALE_IN_FORMATNUMBER          */
-  public static final int WG_NO_LOCALE_IN_FORMATNUMBER = 4;
-
-  static
-  {
-    contents[WG_NO_LOCALE_IN_FORMATNUMBER + MAX_CODE][1] =
-      "Xalan doesn't yet handle the locale name in the format-number function.";
-  }
-
-  /** WG_LOCALE_NOT_FOUND          */
-  public static final int WG_LOCALE_NOT_FOUND = 5;
-
-  static
-  {
-    contents[WG_LOCALE_NOT_FOUND + MAX_CODE][1] =
-      "Warning: Could not find locale for xml:lang={0}";
-  }
-
-  /** WG_CANNOT_MAKE_URL_FROM          */
-  public static final int WG_CANNOT_MAKE_URL_FROM = 6;
-
-  static
-  {
-    contents[WG_CANNOT_MAKE_URL_FROM + MAX_CODE][1] =
-      "Can not make URL from: {0}";
-  }
-
-  /** WG_CANNOT_LOAD_REQUESTED_DOC          */
-  public static final int WG_CANNOT_LOAD_REQUESTED_DOC = 7;
-
-  static
-  {
-    contents[WG_CANNOT_LOAD_REQUESTED_DOC + MAX_CODE][1] =
-      "Can not load requested doc: {0}";
-  }
-
-  /** WG_CANNOT_FIND_COLLATOR          */
-  public static final int WG_CANNOT_FIND_COLLATOR = 8;
-
-  static
-  {
-    contents[WG_CANNOT_FIND_COLLATOR + MAX_CODE][1] =
-      "Could not find Collator for <sort xml:lang={0}";
-  }
-
-  /** WG_FUNCTIONS_SHOULD_USE_URL          */
-  public static final int WG_FUNCTIONS_SHOULD_USE_URL = 9;
-
-  static
-  {
-    contents[WG_FUNCTIONS_SHOULD_USE_URL + MAX_CODE][1] =
-      "Old syntax: the functions instruction should use a url of {0}";
-  }
-
-  /** WG_ENCODING_NOT_SUPPORTED_USING_UTF8          */
-  public static final int WG_ENCODING_NOT_SUPPORTED_USING_UTF8 = 10;
-
-  static
-  {
-    contents[WG_ENCODING_NOT_SUPPORTED_USING_UTF8 + MAX_CODE][1] =
-      "encoding not supported: {0}, using UTF-8";
-  }
-
-  /** WG_ENCODING_NOT_SUPPORTED_USING_JAVA          */
-  public static final int WG_ENCODING_NOT_SUPPORTED_USING_JAVA = 11;
-
-  static
-  {
-    contents[WG_ENCODING_NOT_SUPPORTED_USING_JAVA + MAX_CODE][1] =
-      "encoding not supported: {0}, using Java {1}";
-  }
-
-  /** WG_SPECIFICITY_CONFLICTS          */
-  public static final int WG_SPECIFICITY_CONFLICTS = 12;
-
-  static
-  {
-    contents[WG_SPECIFICITY_CONFLICTS + MAX_CODE][1] =
-      "Specificity conflicts found: {0} Last found in stylesheet will be used.";
-  }
-
-  /** WG_PARSING_AND_PREPARING          */
-  public static final int WG_PARSING_AND_PREPARING = 13;
-
-  static
-  {
-    contents[WG_PARSING_AND_PREPARING + MAX_CODE][1] =
-      "========= Parsing and preparing {0} ==========";
-  }
-
-  /** WG_ATTR_TEMPLATE          */
-  public static final int WG_ATTR_TEMPLATE = 14;
-
-  static
-  {
-    contents[WG_ATTR_TEMPLATE + MAX_CODE][1] = "Attr Template, {0}";
-  }
-
-  /** WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE          */
-  public static final int WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE =
-    15;
-
-  static
-  {
-    contents[WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE + MAX_CODE][1] =
-      "Match conflict between xsl:strip-space and xsl:preserve-space";
-  }
-
-  /** WG_ATTRIB_NOT_HANDLED          */
-  public static final int WG_ATTRIB_NOT_HANDLED = 16;
-
-  static
-  {
-    contents[WG_ATTRIB_NOT_HANDLED + MAX_CODE][1] =
-      "Xalan does not yet handle the {0} attribute!";
-  }
-
-  /** WG_NO_DECIMALFORMAT_DECLARATION          */
-  public static final int WG_NO_DECIMALFORMAT_DECLARATION = 17;
-
-  static
-  {
-    contents[WG_NO_DECIMALFORMAT_DECLARATION + MAX_CODE][1] =
-      "No declaration found for decimal format: {0}";
-  }
-
-  /** WG_OLD_XSLT_NS          */
-  public static final int WG_OLD_XSLT_NS = 18;
-
-  static
-  {
-    contents[WG_OLD_XSLT_NS + MAX_CODE][1] = "Missing or incorrect XSLT Namespace. ";
-  }
-
-  /** WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED          */
-  public static final int WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED = 19;
-
-  static
-  {
-    contents[WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED + MAX_CODE][1] =
-      "Only one default xsl:decimal-format declaration is allowed.";
-  }
-
-  /** WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE          */
-  public static final int WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE = 20;
-
-  static
-  {
-    contents[WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE + MAX_CODE][1] =
-      "xsl:decimal-format names must be unique. Name \"{0}\" has been duplicated.";
-  }
-
-  /** WG_ILLEGAL_ATTRIBUTE          */
-  public static final int WG_ILLEGAL_ATTRIBUTE = 21;
-
-  static
-  {
-    contents[WG_ILLEGAL_ATTRIBUTE + MAX_CODE][1] =
-      "{0} has an illegal attribute: {1}";
-  }
-
-  /** WG_COULD_NOT_RESOLVE_PREFIX          */
-  public static final int WG_COULD_NOT_RESOLVE_PREFIX = 22;
-
-  static
-  {
-    contents[WG_COULD_NOT_RESOLVE_PREFIX + MAX_CODE][1] =
-      "Could not resolve namespace prefix: {0}. The node will be ignored.";
-  }
-
-  /** WG_STYLESHEET_REQUIRES_VERSION_ATTRIB          */
-  public static final int WG_STYLESHEET_REQUIRES_VERSION_ATTRIB = 23;
-
-  static
-  {
-    contents[WG_STYLESHEET_REQUIRES_VERSION_ATTRIB + MAX_CODE][1] =
-      "xsl:stylesheet requires a 'version' attribute!";
-  }
-
-  /** WG_ILLEGAL_ATTRIBUTE_NAME          */
-  public static final int WG_ILLEGAL_ATTRIBUTE_NAME = 24;
-
-  static
-  {
-    contents[WG_ILLEGAL_ATTRIBUTE_NAME + MAX_CODE][1] =
-      "Illegal attribute name: {0}";
-  }
-
-  /** WG_ILLEGAL_ATTRIBUTE_VALUE          */
-  public static final int WG_ILLEGAL_ATTRIBUTE_VALUE = 25;
-
-  static
-  {
-    contents[WG_ILLEGAL_ATTRIBUTE_VALUE + MAX_CODE][1] =
-      "Illegal value used for attribute {0}: {1}";
-  }
-
-  /** WG_EMPTY_SECOND_ARG          */
-  public static final int WG_EMPTY_SECOND_ARG = 26;
-
-  static
-  {
-    contents[WG_EMPTY_SECOND_ARG + MAX_CODE][1] =
-      "Resulting nodeset from second argument of document function is empty. The first agument will be used.";
-  }
-
-  // Other miscellaneous text used inside the code...
-  static
-  {
-    contents[MAX_MESSAGES][0] = "ui_language";
-    contents[MAX_MESSAGES][1] = "en";
-    contents[MAX_MESSAGES + 1][0] = "help_language";
-    contents[MAX_MESSAGES + 1][1] = "en";
-    contents[MAX_MESSAGES + 2][0] = "language";
-    contents[MAX_MESSAGES + 2][1] = "en";
-    contents[MAX_MESSAGES + 3][0] = "BAD_CODE";
-    contents[MAX_MESSAGES + 3][1] =
-      "Parameter to createMessage was out of bounds";
-    contents[MAX_MESSAGES + 4][0] = "FORMAT_FAILED";
-    contents[MAX_MESSAGES + 4][1] =
-      "Exception thrown during messageFormat call";
-    contents[MAX_MESSAGES + 5][0] = "version";
-    contents[MAX_MESSAGES + 5][1] = ">>>>>>> Xalan Version ";
-    contents[MAX_MESSAGES + 6][0] = "version2";
-    contents[MAX_MESSAGES + 6][1] = "<<<<<<<";
-    contents[MAX_MESSAGES + 7][0] = "yes";
-    contents[MAX_MESSAGES + 7][1] = "yes";
-    contents[MAX_MESSAGES + 8][0] = "line";
-    contents[MAX_MESSAGES + 8][1] = "Line #";
-    contents[MAX_MESSAGES + 9][0] = "column";
-    contents[MAX_MESSAGES + 9][1] = "Column #";
-    contents[MAX_MESSAGES + 10][0] = "xsldone";
-    contents[MAX_MESSAGES + 10][1] = "XSLProcessor: done";
-    contents[MAX_MESSAGES + 11][0] = "xslProc_option";
-    contents[MAX_MESSAGES + 11][1] = "Xalan-J command line Process class options:";
-    contents[MAX_MESSAGES + 12][0] = "optionIN";
-    contents[MAX_MESSAGES + 12][1] = "    -IN inputXMLURL";
-    contents[MAX_MESSAGES + 13][0] = "optionXSL";
-    contents[MAX_MESSAGES + 13][1] = "   [-XSL XSLTransformationURL]";
-    contents[MAX_MESSAGES + 14][0] = "optionOUT";
-    contents[MAX_MESSAGES + 14][1] = "   [-OUT outputFileName]";
-    contents[MAX_MESSAGES + 15][0] = "optionLXCIN";
-    contents[MAX_MESSAGES + 15][1] =
-      "   [-LXCIN compiledStylesheetFileNameIn]";
-    contents[MAX_MESSAGES + 16][0] = "optionLXCOUT";
-    contents[MAX_MESSAGES + 16][1] =
-      "   [-LXCOUT compiledStylesheetFileNameOutOut]";
-    contents[MAX_MESSAGES + 17][0] = "optionPARSER";
-    contents[MAX_MESSAGES + 17][1] =
-      "   [-PARSER fully qualified class name of parser liaison]";
-    contents[MAX_MESSAGES + 18][0] = "optionE";
-    contents[MAX_MESSAGES + 18][1] = "   [-E (Do not expand entity refs)]";
-    contents[MAX_MESSAGES + 19][0] = "optionV";
-    contents[MAX_MESSAGES + 19][1] = "   [-E (Do not expand entity refs)]";
-    contents[MAX_MESSAGES + 20][0] = "optionQC";
-    contents[MAX_MESSAGES + 20][1] =
-      "   [-QC (Quiet Pattern Conflicts Warnings)]";
-    contents[MAX_MESSAGES + 21][0] = "optionQ";
-    contents[MAX_MESSAGES + 21][1] = "   [-Q  (Quiet Mode)]";
-    contents[MAX_MESSAGES + 22][0] = "optionLF";
-    contents[MAX_MESSAGES + 22][1] =
-      "   [-LF (Use linefeeds only on output {default is CR/LF})]";
-    contents[MAX_MESSAGES + 23][0] = "optionCR";
-    contents[MAX_MESSAGES + 23][1] =
-      "   [-CR (Use carriage returns only on output {default is CR/LF})]";
-    contents[MAX_MESSAGES + 24][0] = "optionESCAPE";
-    contents[MAX_MESSAGES + 24][1] =
-      "   [-ESCAPE (Which characters to escape {default is <>&\"\'\\r\\n}]";
-    contents[MAX_MESSAGES + 25][0] = "optionINDENT";
-    contents[MAX_MESSAGES + 25][1] =
-      "   [-INDENT (Control how many spaces to indent {default is 0})]";
-    contents[MAX_MESSAGES + 26][0] = "optionTT";
-    contents[MAX_MESSAGES + 26][1] =
-      "   [-TT (Trace the templates as they are being called.)]";
-    contents[MAX_MESSAGES + 27][0] = "optionTG";
-    contents[MAX_MESSAGES + 27][1] =
-      "   [-TG (Trace each generation event.)]";
-    contents[MAX_MESSAGES + 28][0] = "optionTS";
-    contents[MAX_MESSAGES + 28][1] = "   [-TS (Trace each selection event.)]";
-    contents[MAX_MESSAGES + 29][0] = "optionTTC";
-    contents[MAX_MESSAGES + 29][1] =
-      "   [-TTC (Trace the template children as they are being processed.)]";
-    contents[MAX_MESSAGES + 30][0] = "optionTCLASS";
-    contents[MAX_MESSAGES + 30][1] =
-      "   [-TCLASS (TraceListener class for trace extensions.)]";
-    contents[MAX_MESSAGES + 31][0] = "optionVALIDATE";
-    contents[MAX_MESSAGES + 31][1] =
-      "   [-VALIDATE (Set whether validation occurs.  Validation is off by default.)]";
-    contents[MAX_MESSAGES + 32][0] = "optionEDUMP";
-    contents[MAX_MESSAGES + 32][1] =
-      "   [-EDUMP {optional filename} (Do stackdump on error.)]";
-    contents[MAX_MESSAGES + 33][0] = "optionXML";
-    contents[MAX_MESSAGES + 33][1] =
-      "   [-XML (Use XML formatter and add XML header.)]";
-    contents[MAX_MESSAGES + 34][0] = "optionTEXT";
-    contents[MAX_MESSAGES + 34][1] =
-      "   [-TEXT (Use simple Text formatter.)]";
-    contents[MAX_MESSAGES + 35][0] = "optionHTML";
-    contents[MAX_MESSAGES + 35][1] = "   [-HTML (Use HTML formatter.)]";
-    contents[MAX_MESSAGES + 36][0] = "optionPARAM";
-    contents[MAX_MESSAGES + 36][1] =
-      "   [-PARAM name expression (Set a stylesheet parameter)]";
-    contents[MAX_MESSAGES + 37][0] = "noParsermsg1";
-    contents[MAX_MESSAGES + 37][1] = "XSL Process was not successful.";
-    contents[MAX_MESSAGES + 38][0] = "noParsermsg2";
-    contents[MAX_MESSAGES + 38][1] = "** Could not find parser **";
-    contents[MAX_MESSAGES + 39][0] = "noParsermsg3";
-    contents[MAX_MESSAGES + 39][1] = "Please check your classpath.";
-    contents[MAX_MESSAGES + 40][0] = "noParsermsg4";
-    contents[MAX_MESSAGES + 40][1] =
-      "If you don't have IBM's XML Parser for Java, you can download it from";
-    contents[MAX_MESSAGES + 41][0] = "noParsermsg5";
-    contents[MAX_MESSAGES + 41][1] =
-      "IBM's AlphaWorks: http://www.alphaworks.ibm.com/formula/xml";
-		contents[MAX_MESSAGES + 42][0] = "optionURIRESOLVER";
-    contents[MAX_MESSAGES + 42][1] = "   [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]";
-		contents[MAX_MESSAGES + 43][0] = "optionENTITYRESOLVER";
-    contents[MAX_MESSAGES + 43][1] = "   [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]";
-		contents[MAX_MESSAGES + 44][0] = "optionCONTENTHANDLER";
-    contents[MAX_MESSAGES + 44][1] = "   [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]";
-    contents[MAX_MESSAGES + 45][0] = "optionLINENUMBERS";
-    contents[MAX_MESSAGES + 45][1] = "   [-L use line numbers for source document]";
-		
-  }
-
-  // ================= INFRASTRUCTURE ======================
-
-  /** String for use when a bad error code was encountered.    */
-  public static final String BAD_CODE = "BAD_CODE";
-
-  /** String for use when formatting of the error string failed.   */
-  public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
-  /** General error string.   */
-  public static final String ERROR_STRING = "#error";
-
-  /** String to prepend to error messages.  */
-  public static final String ERROR_HEADER = "Error: ";
-
-  /** String to prepend to warning messages.    */
-  public static final String WARNING_HEADER = "Warning: ";
-
-  /** String to specify the XSLT module.  */
-  public static final String XSL_HEADER = "XSLT ";
-
-  /** String to specify the XML parser module.  */
-  public static final String XML_HEADER = "XML ";
-
-  /** I don't think this is used any more.
-   * @deprecated  */
-  public static final String QUERY_HEADER = "PATTERN ";
-
-  /**
-   * Get the lookup table. 
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /**
-   *   Return a named ResourceBundle for a particular locale.  This method mimics the behavior
-   *   of ResourceBundle.getBundle().
-   *  
-   *   @param className the name of the class that implements the resource bundle.
-   *   @return the ResourceBundle
-   *   @throws MissingResourceException
-   */
-  public static final XSLTErrorResources loadResourceBundle(String className)
-          throws MissingResourceException
-  {
-
-    Locale locale = Locale.getDefault();
-    String suffix = getResourceSuffix(locale);
-
-    try
-    {
-
-      // first try with the given locale
-      return (XSLTErrorResources) ResourceBundle.getBundle(className
-              + suffix, locale);
-    }
-    catch (MissingResourceException e)
-    {
-      try  // try to fall back to en_US if we can't load
-      {
-
-        // Since we can't find the localized property file,
-        // fall back to en_US.
-        return (XSLTErrorResources) ResourceBundle.getBundle(className,
-                new Locale("en", "US"));
-      }
-      catch (MissingResourceException e2)
-      {
-
-        // Now we are really in trouble.
-        // very bad, definitely very bad...not going to get very far
-        throw new MissingResourceException(
-          "Could not load any resource bundles.", className, "");
-      }
-    }
-  }
-
-  /**
-   * Return the resource file suffic for the indicated locale
-   * For most locales, this will be based the language code.  However
-   * for Chinese, we do distinguish between Taiwan and PRC
-   *
-   * @param locale the locale
-   * @return an String suffix which canbe appended to a resource name
-   */
-  private static final String getResourceSuffix(Locale locale)
-  {
-
-    String suffix = "_" + locale.getLanguage();
-    String country = locale.getCountry();
-
-    if (country.equals("TW"))
-      suffix += "_" + country;
-
-    return suffix;
-  }
-
-  /**
-   * Get a string representation of the error code.
-   *
-   * @param errorCode Should be a valid error code less than {@link #MAX_CODE}.
-   *
-   * @return A string representation of the error code, or null if code is 
-   * greater than MAX_CODE.
-   */
-  public String getMessageKey(int errorCode)
-  {
-
-    if (errorCode > MAX_CODE)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return ERROR_SUFFIX + df.format(errorCode);
-    }
-  }
-
-  /**
-   * Get a string representation of the warning code.
-   *
-   * @param errorCode Should be a valid warning code less than {@link #MAX_WARNING}.
-   *
-   * @return A string representation of the warning code, or null if code is 
-   * greater than MAX_WARNING.
-   */
-  public String getWarningKey(int errorCode)
-  {
-
-    if (errorCode > MAX_WARNING)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return WARNING_SUFFIX + df.format(errorCode);
-    }
-  }
-
-  /**
-   * Get a string representation of the message code. (same as getMessageKey).
-   *
-   * @param errorCode Should be a valid error code less than {@link #MAX_CODE}.
-   *
-   * @return A string representation of the error code, or null if code is 
-   * greater than MAX_CODE.
-   */
-  public static String getMKey(int errorCode)
-  {
-    if (errorCode > MAX_CODE)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return ERROR_SUFFIX + df.format(errorCode);
-    }
-  }
-
-  /**
-   * Get a string representation of the warning code.
-   *
-   * @param errorCode Should be a valid warning code less than {@link #MAX_WARNING}.
-   *
-   * @return A string representation of the warning code, or null if code is 
-   * greater than MAX_WARNING.
-   */
-  public static String getWKey(int errorCode)
-  {
-
-    if (errorCode > MAX_WARNING)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return WARNING_SUFFIX + df.format(errorCode);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/res/XSLTInfo.properties b/src/org/apache/xalan/res/XSLTInfo.properties
deleted file mode 100644
index 1aa1dc6..0000000
--- a/src/org/apache/xalan/res/XSLTInfo.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-#  XSLT Resource File
-#
-
-version=2.2.D10
-vendor=Apache Software Foundation
-vendor-url=http://xml.apache.org/xalan-j
-
-# The XML Parser for SAX2
-# Since XMLReaderFactory doesn't have it's own properties file, 
-# but simply reads the system properties, Xalan tries to load 
-# this value into the system properties.
-org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
-# org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
\ No newline at end of file
diff --git a/src/org/apache/xalan/res/package.html b/src/org/apache/xalan/res/package.html
deleted file mode 100644
index 4b85d7f..0000000
--- a/src/org/apache/xalan/res/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>Xalan resource Package.</title>
-  <body>
-    <p>Contains strings that require internationalization.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/serialize/CharInfo.java b/src/org/apache/xalan/serialize/CharInfo.java
deleted file mode 100644
index 63ae2b9..0000000
--- a/src/org/apache/xalan/serialize/CharInfo.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.util.BitSet;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
-
-import java.net.*;
-
-import java.util.Hashtable;
-
-import org.apache.xml.utils.CharKey;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * This class provides services that tell if a character should have
- * special treatement, such as entity reference substitution or normalization
- * of a newline character.  It also provides character to entity reference
- * lookup.
- */
-public class CharInfo
-{
-
-  /** Bit map that tells if a given character should have special treatment. */
-  BitSet m_specialsMap = new BitSet(65535);
-
-  /** Lookup table for characters to entity references. */
-  private Hashtable m_charToEntityRef = new Hashtable();
-
-  /**
-   * The name of the HTML entities file.
-   * If specified, the file will be resource loaded with the default class loader.
-   */
-  public static String HTML_ENTITIES_RESOURCE = "HTMLEntities.res";
-
-  /**
-   * The name of the XML entities file.
-   * If specified, the file will be resource loaded with the default class loader.
-   */
-  public static String XML_ENTITIES_RESOURCE = "XMLEntities.res";
-
-  /** The linefeed character, which the parser should always normalize. */
-  public static char S_LINEFEED = 0x0A;
-
-  /** The carriage return character, which the parser should always normalize. */
-  public static char S_CARRIAGERETURN = 0x0D;
-
-  /** a zero length Class array used in the constructor */
-  private static final Class[] NO_CLASSES = new Class[0];
-
-  /** a zero length Object array used in the constructor */
-  private static final Object[] NO_OBJS = new Object[0];
-
-
-  /**
-   * Constructor that reads in a resource file that describes the mapping of
-   * characters to entity references.
-   *
-   * @param entitiesResource Name of entities resource file that should
-   * be loaded, which describes that mapping of characters to entity references.
-   */
-  public CharInfo(String entitiesResource)
-  {
-
-    InputStream is = null;
-    BufferedReader reader = null;
-    int index;
-    String name;
-    String value;
-    int code;
-    String line;
-
-    try
-    {
-
-      try {
-        java.lang.reflect.Method getCCL = Thread.class.getMethod("getContextClassLoader", NO_CLASSES);
-        if (getCCL != null) {
-          ClassLoader contextClassLoader = (ClassLoader) getCCL.invoke(Thread.currentThread(), NO_OBJS);
-          is = contextClassLoader.getResourceAsStream("org/apache/xalan/serialize/" + entitiesResource);
-        }
-      }
-      catch (Exception e) {}
-
-      if (is == null)
-        is = CharInfo.class.getResourceAsStream(entitiesResource);
-
-      if (is == null)
-      {
-        URL url = new URL(entitiesResource);
-
-        is = url.openStream();
-      }
-
-      if (is == null)
-        throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_RESOURCE_COULD_NOT_FIND, new Object[]{entitiesResource, entitiesResource })); //"The resource [" + entitiesResource
-                                  // + "] could not be found.\n"
-                                  // + entitiesResource);
-
-      reader = new BufferedReader(new InputStreamReader(is));
-      line = reader.readLine();
-
-      while (line != null)
-      {
-        if (line.length() == 0 || line.charAt(0) == '#')
-        {
-          line = reader.readLine();
-
-          continue;
-        }
-
-        index = line.indexOf(' ');
-
-        if (index > 1)
-        {
-          name = line.substring(0, index);
-
-          ++index;
-
-          if (index < line.length())
-          {
-            value = line.substring(index);
-            index = value.indexOf(' ');
-
-            if (index > 0)
-              value = value.substring(0, index);
-
-            code = Integer.parseInt(value);
-
-            defineEntity(name, (char) code);
-          }
-        }
-
-        line = reader.readLine();
-      }
-
-      is.close();
-      m_specialsMap.set(S_LINEFEED);
-      m_specialsMap.set(S_CARRIAGERETURN);
-    }
-    catch (Exception except)
-    {
-      throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_RESOURCE_COULD_NOT_LOAD, new Object[]{entitiesResource,  except.toString(), entitiesResource, except.toString() })); //"The resource [" + entitiesResource
-                                 //+ "] could not load: " + except.toString()
-                                 //+ "\n" + entitiesResource + "\t"
-                                 //+ except.toString());
-    }
-    finally
-    {
-      if (is != null)
-      {
-        try
-        {
-          is.close();
-        }
-        catch (Exception except){}
-      }
-    }
-  }
-
-  /**
-   * Defines a new character reference. The reference's name and value are
-   * supplied. Nothing happens if the character reference is already defined.
-   * <p>Unlike internal entities, character references are a string to single
-   * character mapping. They are used to map non-ASCII characters both on
-   * parsing and printing, primarily for HTML documents. '&lt;amp;' is an
-   * example of a character reference.</p>
-   *
-   * @param name The entity's name
-   * @param value The entity's value
-   */
-  protected void defineEntity(String name, char value)
-  {
-
-    CharKey character = new CharKey(value);
-
-    m_charToEntityRef.put(character, name);
-    m_specialsMap.set(value);
-  }
-  
-  private CharKey m_charKey = new CharKey();
-
-  /**
-   * Resolve a character to an entity reference name.
-   *
-   * @param value character value that should be resolved to a name.
-   *
-   * @return name of character entity, or null if not found.
-   */
-  public String getEntityNameForChar(char value)
-  {
-    m_charKey.setChar(value);
-    return (String) m_charToEntityRef.get(m_charKey);
-  }
-
-  /**
-   * Tell if the character argument should have special treatment.
-   *
-   * @param value character value.
-   *
-   * @return true if the character should have any special treatment.
-   */
-  public boolean isSpecial(char value)
-  {
-    return m_specialsMap.get(value);
-  }
-}
diff --git a/src/org/apache/xalan/serialize/DOMSerializer.java b/src/org/apache/xalan/serialize/DOMSerializer.java
deleted file mode 100644
index a0d9bc7..0000000
--- a/src/org/apache/xalan/serialize/DOMSerializer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.IOException;
-
-import org.w3c.dom.Node;
-
-/**
- * Interface for a DOM serializer implementation.
- * <p>
- * The DOM serializer is a facet of a serializer. A serializer may or may
- * not support a DOM serializer.
- * <p>
- * Example:
- * <pre>
- * Document     doc;
- * Serializer   ser;
- * OutputStream os;
- *
- * ser.setOutputStream( os );
- * ser.asDOMSerializer( doc );
- * </pre>
- *
- *
- * @version Alpha
- * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
- * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
- */
-public interface DOMSerializer
-{
-  /**
-   * Serializes the DOM node. Throws an exception only if an I/O
-   * exception occured while serializing.
-   *
-   * @param elem The element to serialize
-   * @throws IOException An I/O exception occured while serializing
-   */
-  public void serialize(Node node) throws IOException;
-}
diff --git a/src/org/apache/xalan/serialize/ElemDesc.java b/src/org/apache/xalan/serialize/ElemDesc.java
deleted file mode 100644
index fec37f7..0000000
--- a/src/org/apache/xalan/serialize/ElemDesc.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import org.apache.xml.utils.StringToIntTable;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class is in support of SerializerToHTML, and acts as a sort
- * of element representative for HTML elements.
- */
-class ElemDesc
-{
-
-  /** Bit flags to tell about this element type. */
-  int m_flags;
-
-  /**
-   * Table of attribute names to integers, which contain bit flags telling about
-   *  the attributes.
-   */
-  StringToIntTable m_attrs = null;
-
-  /** Bit position if this element type is empty. */
-  static final int EMPTY = (1 << 1);
-
-  /** Bit position if this element type is a flow. */
-  static final int FLOW = (1 << 2);
-
-  /** Bit position if this element type is a block. */
-  static final int BLOCK = (1 << 3);
-
-  /** Bit position if this element type is a block form. */
-  static final int BLOCKFORM = (1 << 4);
-
-  /** Bit position if this element type is a block form field set (?? -sb). */
-  static final int BLOCKFORMFIELDSET = (1 << 5);
-
-  /** Bit position if this element type is CDATA. */
-  static final int CDATA = (1 << 6);
-
-  /** Bit position if this element type is PCDATA. */
-  static final int PCDATA = (1 << 7);
-
-  /** Bit position if this element type is should be raw characters. */
-  static final int RAW = (1 << 8);
-
-  /** Bit position if this element type should be inlined. */
-  static final int INLINE = (1 << 9);
-
-  /** Bit position if this element type is INLINEA (?? -sb). */
-  static final int INLINEA = (1 << 10);
-
-  /** Bit position if this element type is an inline label. */
-  static final int INLINELABEL = (1 << 11);
-
-  /** Bit position if this element type is a font style. */
-  static final int FONTSTYLE = (1 << 12);
-
-  /** Bit position if this element type is a phrase. */
-  static final int PHRASE = (1 << 13);
-
-  /** Bit position if this element type is a form control. */
-  static final int FORMCTRL = (1 << 14);
-
-  /** Bit position if this element type is ???. */
-  static final int SPECIAL = (1 << 15);
-
-  /** Bit position if this element type is ???. */
-  static final int ASPECIAL = (1 << 16);
-
-  /** Bit position if this element type is an odd header element. */
-  static final int HEADMISC = (1 << 17);
-
-  /** Bit position if this element type is a head element (i.e. H1, H2, etc.) */
-  static final int HEAD = (1 << 18);
-
-  /** Bit position if this element type is a list. */
-  static final int LIST = (1 << 19);
-
-  /** Bit position if this element type is a preformatted type. */
-  static final int PREFORMATTED = (1 << 20);
-
-  /** Bit position if this element type is whitespace sensitive. */
-  static final int WHITESPACESENSITIVE = (1 << 21);
-
-  /** Bit position if this element type is a header element (i.e. HEAD). */
-  static final int HEADELEM = (1 << 22);
-
-  /** Bit position if this attribute type is a URL. */
-  static final int ATTRURL = (1 << 1);
-
-  /** Bit position if this attribute type is an empty type. */
-  static final int ATTREMPTY = (1 << 2);
-
-  /**
-   * Construct an ElemDesc from a set of bit flags.
-   *
-   *
-   * @param flags Bit flags that describe the basic properties of this element type.
-   */
-  ElemDesc(int flags)
-  {
-    m_flags = flags;
-  }
-
-  /**
-   * Tell if this element type has the basic bit properties that are passed
-   * as an argument.
-   *
-   * @param flags Bit flags that describe the basic properties of interest.
-   *
-   * @return true if any of the flag bits are true.
-   */
-  boolean is(int flags)
-  {
-
-    // int which = (m_flags & flags);
-    return (m_flags & flags) != 0;
-  }
-
-  /**
-   * Set an attribute name and it's bit properties.
-   *
-   *
-   * @param name non-null name of attribute, in upper case.
-   * @param flags flag bits.
-   */
-  void setAttr(String name, int flags)
-  {
-
-    if (null == m_attrs)
-      m_attrs = new StringToIntTable();
-
-    m_attrs.put(name, flags);
-  }
-
-  /**
-   * Tell if any of the bits of interest are set for a named attribute type.
-   *
-   * @param name non-null reference to attribute name, in any case.
-   * @param flags flag mask.
-   *
-   * @return true if any of the flags are set for the named attribute.
-   */
-  boolean isAttrFlagSet(String name, int flags)
-  {
-    return (null != m_attrs) ? ((m_attrs.getIgnoreCase(name) & flags) != 0) : false;
-  }
-}
diff --git a/src/org/apache/xalan/serialize/EncodingInfo.java b/src/org/apache/xalan/serialize/EncodingInfo.java
deleted file mode 100644
index a2e12dc..0000000
--- a/src/org/apache/xalan/serialize/EncodingInfo.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-/**
- * Holds information about a given encoding.
- */
-public class EncodingInfo extends Object
-{
-
-  /**
-   * The encoding name.
-   */
-  final String name;
-
-  /**
-   * The name used by the Java convertor.
-   */
-  final String javaName;
-
-  /**
-   * The last printable character.
-   */
-  final int lastPrintable;
-
-  /**
-   * Create an EncodingInfo object based on the name, java name, and the 
-   * max character size.
-   *
-   * @param name non-null reference to the ISO name.
-   * @param javaName non-null reference to the Java encoding name.
-   * @param lastPrintable The maximum character that can be written.
-   */
-  public EncodingInfo(String name, String javaName, int lastPrintable)
-  {
-
-    this.name = name;
-    this.javaName = javaName;
-    this.lastPrintable = lastPrintable;
-  }
-}
diff --git a/src/org/apache/xalan/serialize/Encodings.java b/src/org/apache/xalan/serialize/Encodings.java
deleted file mode 100644
index 964a2b6..0000000
--- a/src/org/apache/xalan/serialize/Encodings.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.Writer;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-
-/**
- * Provides information about encodings. Depends on the Java runtime
- * to provides writers for the different encodings, but can be used
- * to override encoding names and provide the last printable character
- * for each encoding.
- *
- * @version $Revision$ $Date$
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-public class Encodings extends Object
-{
-
-  /**
-   * The last printable character for unknown encodings.
-   */
-  static final int m_defaultLastPrintable = 0x7F;
-
-  /**
-   * Returns a writer for the specified encoding based on
-   * an output stream.
-   *
-   * @param output The output stream
-   * @param encoding The encoding
-   * @return A suitable writer
-   * @throws UnsupportedEncodingException There is no convertor
-   *  to support this encoding
-   */
-  public static Writer getWriter(OutputStream output, String encoding)
-          throws UnsupportedEncodingException
-  {
-
-    for (int i = 0; i < _encodings.length; ++i)
-    {
-      if (_encodings[i].name.equalsIgnoreCase(encoding))
-      {
-        try
-        {
-          return new OutputStreamWriter(output, _encodings[i].javaName);
-        }
-        catch( java.lang.IllegalArgumentException iae) // java 1.1.8
-        {
-          // keep trying
-        }
-        catch (UnsupportedEncodingException usee)
-        {
-
-          // keep trying
-        }
-      }
-    }
-
-    try
-    {
-      return new OutputStreamWriter(output, encoding);
-    }
-    catch( java.lang.IllegalArgumentException iae) // java 1.1.8
-    {
-      throw new UnsupportedEncodingException(encoding);
-    }
-  }
-
-  /**
-   * Returns the last printable character for the specified
-   * encoding.
-   *
-   * @param encoding The encoding
-   * @return The last printable character
-   */
-  public static int getLastPrintable(String encoding)
-  {
-
-    for (int i = 0; i < _encodings.length; ++i)
-    {
-      if (_encodings[i].name.equalsIgnoreCase(encoding)
-              || _encodings[i].javaName.equalsIgnoreCase(encoding))
-        return _encodings[i].lastPrintable;
-    }
-
-    return m_defaultLastPrintable;
-  }
-
-  /**
-   * Returns the last printable character for an unspecified
-   * encoding.
-   *
-   * @return the default size
-   */
-  public static int getLastPrintable()
-  {
-    return m_defaultLastPrintable;
-  }
-
-  /** The default encoding, ISO style, ISO style.   */
-  public static final String DEFAULT_MIME_ENCODING = "UTF-8";
-
-  /**
-   * Get the proper mime encoding.  From the XSLT recommendation: "The encoding
-   * attribute specifies the preferred encoding to use for outputting the result
-   * tree. XSLT processors are required to respect values of UTF-8 and UTF-16.
-   * For other values, if the XSLT processor does not support the specified
-   * encoding it may signal an error; if it does not signal an error it should
-   * use UTF-8 or UTF-16 instead. The XSLT processor must not use an encoding
-   * whose name does not match the EncName production of the XML Recommendation
-   * [XML]. If no encoding attribute is specified, then the XSLT processor should
-   * use either UTF-8 or UTF-16."
-   *
-   * @param encoding Reference to java-style encoding string, which may be null, 
-   * in which case a default will be found.
-   *
-   * @return The ISO-style encoding string, or null if failure.
-   */
-  public static String getMimeEncoding(String encoding)
-  {
-
-    if (null == encoding)
-    {
-      try
-      {
-
-        // Get the default system character encoding.  This may be 
-        // incorrect if they passed in a writer, but right now there 
-        // seems to be no way to get the encoding from a writer.
-        encoding = System.getProperty("file.encoding", "UTF8");
-
-        if (null != encoding)
-        {
-
-          /*
-          * See if the mime type is equal to UTF8.  If you don't
-          * do that, then  convertJava2MimeEncoding will convert
-          * 8859_1 to "ISO-8859-1", which is not what we want,
-          * I think, and I don't think I want to alter the tables
-          * to convert everything to UTF-8.
-          */
-          String jencoding =
-            (encoding.equalsIgnoreCase("Cp1252") || encoding.equalsIgnoreCase(
-            "ISO8859_1") || encoding.equalsIgnoreCase("8859_1") || encoding.equalsIgnoreCase("UTF8")) ? DEFAULT_MIME_ENCODING
-                                                                                                      : convertJava2MimeEncoding(
-                                                                                                        encoding);
-
-          encoding = (null != jencoding) ? jencoding : DEFAULT_MIME_ENCODING;
-        }
-        else
-        {
-          encoding = DEFAULT_MIME_ENCODING;
-        }
-      }
-      catch (SecurityException se)
-      {
-        encoding = DEFAULT_MIME_ENCODING;
-      }
-    }
-    else
-    {
-      encoding = convertJava2MimeEncoding(encoding);
-    }
-
-    return encoding;
-  }
-
-  /**
-   * Try the best we can to convert a Java encoding to a XML-style encoding.
-   *
-   * @param encoding non-null reference to encoding string, java style.
-   *
-   * @return ISO-style encoding string.
-   */
-  public static String convertJava2MimeEncoding(String encoding)
-  {
-
-    for (int i = 0; i < _encodings.length; ++i)
-    {
-      if (_encodings[i].javaName.equalsIgnoreCase(encoding))
-      {
-        return _encodings[i].name;
-      }
-    }
-
-    return encoding;
-  }
-  
-  /**
-   * Try the best we can to convert a Java encoding to a XML-style encoding.
-   *
-   * @param encoding non-null reference to encoding string, java style.
-   *
-   * @return ISO-style encoding string.
-   */
-  public static String convertMime2JavaEncoding(String encoding)
-  {
-
-    for (int i = 0; i < _encodings.length; ++i)
-    {
-      if (_encodings[i].name.equalsIgnoreCase(encoding))
-      {
-        return _encodings[i].javaName;
-      }
-    }
-
-    return encoding;
-  }
-
-
-  /**
-   * Constructs a list of all the supported encodings.
-   */
-  private static final EncodingInfo[] _encodings = new EncodingInfo[]
-  {
-
-    //    <preferred MIME name>, <Java encoding name>
-    // new EncodingInfo( "ISO 8859-1", "CP1252"); // Close enough, I guess
-    new EncodingInfo("WINDOWS-1250", "Cp1250", 0x00FF),  // Peter Smolik
-    // Patch attributed to havardw@underdusken.no (Håvard Wigtil)
-    new EncodingInfo("WINDOWS-1252", "Cp1252", 0x00FF),
-    new EncodingInfo("UTF-8", "UTF8", 0xFFFF),
-    new EncodingInfo("US-ASCII", "ISO8859_1", 0x7F),
-    new EncodingInfo("ISO-8859-1", "ISO8859_1", 0x00FF),
-    // Patch attributed to havardw@underdusken.no (Håvard Wigtil)
-    new EncodingInfo("ISO-8859-1", "ISO8859-1", 0x00FF),
-    new EncodingInfo("ISO-8859-2", "ISO8859_2", 0x00FF),
-    // I'm going to apply "ISO8859-X" variant to all these, to be safe.
-    new EncodingInfo("ISO-8859-2", "ISO8859-2", 0x00FF),
-    new EncodingInfo("ISO-8859-3", "ISO8859_3", 0x00FF),
-    new EncodingInfo("ISO-8859-3", "ISO8859-3", 0x00FF),
-    new EncodingInfo("ISO-8859-4", "ISO8859_4", 0x00FF),
-    new EncodingInfo("ISO-8859-4", "ISO8859-4", 0x00FF),
-    new EncodingInfo("ISO-8859-5", "ISO8859_5", 0x00FF),
-    new EncodingInfo("ISO-8859-5", "ISO8859-5", 0x00FF),
-    new EncodingInfo("ISO-8859-6", "ISO8859_6", 0x00FF),
-    new EncodingInfo("ISO-8859-6", "ISO8859-6", 0x00FF),
-    new EncodingInfo("ISO-8859-7", "ISO8859_7", 0x00FF),
-    new EncodingInfo("ISO-8859-7", "ISO8859-7", 0x00FF),
-    new EncodingInfo("ISO-8859-8", "ISO8859_8", 0x00FF),
-    new EncodingInfo("ISO-8859-8", "ISO8859-8", 0x00FF),
-    new EncodingInfo("ISO-8859-9", "ISO8859_9", 0x00FF),
-    new EncodingInfo("ISO-8859-9", "ISO8859-9", 0x00FF),
-    new EncodingInfo("US-ASCII", "8859_1", 0x00FF),  // ?
-    new EncodingInfo("ISO-8859-1", "8859_1", 0x00FF),
-    new EncodingInfo("ISO-8859-2", "8859_2", 0x00FF),
-    new EncodingInfo("ISO-8859-3", "8859_3", 0x00FF),
-    new EncodingInfo("ISO-8859-4", "8859_4", 0x00FF),
-    new EncodingInfo("ISO-8859-5", "8859_5", 0x00FF),
-    new EncodingInfo("ISO-8859-6", "8859_6", 0x00FF),
-    new EncodingInfo("ISO-8859-7", "8859_7", 0x00FF),
-    new EncodingInfo("ISO-8859-8", "8859_8", 0x00FF),
-    new EncodingInfo("ISO-8859-9", "8859_9", 0x00FF),
-    new EncodingInfo("ISO-8859-1", "8859-1", 0x00FF),
-    new EncodingInfo("ISO-8859-2", "8859-2", 0x00FF),
-    new EncodingInfo("ISO-8859-3", "8859-3", 0x00FF),
-    new EncodingInfo("ISO-8859-4", "8859-4", 0x00FF),
-    new EncodingInfo("ISO-8859-5", "8859-5", 0x00FF),
-    new EncodingInfo("ISO-8859-6", "8859-6", 0x00FF),
-    new EncodingInfo("ISO-8859-7", "8859-7", 0x00FF),
-    new EncodingInfo("ISO-8859-8", "8859-8", 0x00FF),
-    new EncodingInfo("ISO-8859-9", "8859-9", 0x00FF),
-    new EncodingInfo("ISO-2022-JP", "JIS", 0xFFFF),
-    new EncodingInfo("SHIFT_JIS", "SJIS", 0xFFFF),
-    new EncodingInfo("EUC-JP", "EUC_JP", 0xFFFF),
-    new EncodingInfo("EUC-KR", "EUC_KR", 0xFFFF),
-    new EncodingInfo("EUC-CN", "EUC_CN", 0xFFFF),
-    new EncodingInfo("EUC-TW", "EUC_TW", 0xFFFF),
-    new EncodingInfo("GB2312", "EUC_CN", 0xFFFF),
-    new EncodingInfo("EUC-JP", "EUC-JP", 0xFFFF),
-    new EncodingInfo("EUC-KR", "EUC-KR", 0xFFFF),
-    new EncodingInfo("EUC-CN", "EUC-CN", 0xFFFF),
-    new EncodingInfo("EUC-TW", "EUC-TW", 0xFFFF),
-    new EncodingInfo("GB2312", "EUC-CN", 0xFFFF),
-    new EncodingInfo("GB2312", "GB2312", 0xFFFF),
-    new EncodingInfo("BIG5", "Big5", 0xFFFF),
-    new EncodingInfo("EUC-JP", "EUCJIS", 0xFFFF),
-    new EncodingInfo("EUC-KR", "KSC5601", 0xFFFF),
-    new EncodingInfo("ISO-2022-KR", "ISO2022KR", 0xFFFF),
-    new EncodingInfo("KOI8-R", "KOI8_R", 0xFFFF),
-    new EncodingInfo("EBCDIC-CP-US", "Cp037", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-CA", "Cp037", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-NL", "Cp037", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-DK", "Cp277", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-NO", "Cp277", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-FI", "Cp278", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-SE", "Cp278", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-IT", "Cp280", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-ES", "Cp284", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-GB", "Cp285", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-FR", "Cp297", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-AR1", "Cp420", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-HE", "Cp424", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-CH", "Cp500", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-ROECE", "Cp870", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-YU", "Cp870", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-IS", "Cp871", 0x00FF),
-    new EncodingInfo("EBCDIC-CP-AR2", "Cp918", 0x00FF),
-    new EncodingInfo("MacRoman", "MacTEC", 0xFF),
-    new EncodingInfo("ASCII", "ASCII", 0x7F),
-    new EncodingInfo("ISO-Latin-1", "ASCII", 0xFF),
-    new EncodingInfo("UTF-8", "UTF8", 0xFFFF),
-    new EncodingInfo("UNICODE", "Unicode", 0xFFFF),
-    new EncodingInfo("UTF-16", "Unicode", 0xFFFF)
-  };
-}
diff --git a/src/org/apache/xalan/serialize/HTMLEntities.res b/src/org/apache/xalan/serialize/HTMLEntities.res
deleted file mode 100644
index 2c06ab8..0000000
--- a/src/org/apache/xalan/serialize/HTMLEntities.res
+++ /dev/null
@@ -1,292 +0,0 @@
-# $Id$
-#
-# @version $Revision$ $Date$
-# @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
-#
-# Character entity references for markup-significant
-#
-quot 34
-amp 38
-lt 60
-gt 62
-nbsp 160
-#
-# Character entity references for ISO 8859-1 characters
-#
-iexcl 161
-cent 162
-pound 163
-curren 164
-yen 165
-brvbar 166
-sect 167
-uml 168
-copy 169
-ordf 170
-laquo 171
-not 172
-shy 173
-reg 174
-macr 175
-deg 176
-plusmn 177
-sup2 178
-sup3 179
-acute 180
-micro 181
-para 182
-middot 183
-cedil 184
-sup1 185
-ordm 186
-raquo 187
-frac14 188
-frac12 189
-frac34 190
-iquest 191
-Agrave 192
-Aacute 193
-Acirc 194
-Atilde 195
-Auml 196
-Aring 197
-AElig 198
-Ccedil 199
-Egrave 200
-Eacute 201
-Ecirc 202
-Euml 203
-Igrave 204
-Iacute 205
-Icirc 206
-Iuml 207
-ETH 208
-Ntilde 209
-Ograve 210
-Oacute 211
-Ocirc 212
-Otilde 213
-Ouml 214
-times 215
-Oslash 216
-Ugrave 217
-Uacute 218
-Ucirc 219
-Uuml 220
-Yacute 221
-THORN 222
-szlig 223
-agrave 224
-aacute 225
-acirc 226
-atilde 227
-auml 228
-aring 229
-aelig 230
-ccedil 231
-egrave 232
-eacute 233
-ecirc 234
-euml 235
-igrave 236
-iacute 237
-icirc 238
-iuml 239
-eth 240
-ntilde 241
-ograve 242
-oacute 243
-ocirc 244
-otilde 245
-ouml 246
-divide 247
-oslash 248
-ugrave 249
-uacute 250
-ucirc 251
-uuml 252
-yacute 253
-thorn 254
-yuml 255
-#
-# Character entity references for symbols, mathematical symbols, and Greek letters
-#
-# Latin Extended
-fnof 402
-#
-# Greek
-Alpha 913
-Beta 914
-Gamma 915
-Delta 916
-Epsilon 917
-Zeta 918
-Eta 919
-Theta 920
-Iota 921
-Kappa 922
-Lambda 923
-Mu 924
-Nu 925
-Xi 926
-Omicron 927
-Pi 928
-Rho 929
-Sigma 931
-Tau 932
-Upsilon 933
-Phi 934
-Chi 935
-Psi 936
-Omega 937
-alpha 945
-beta 946
-gamma 947
-delta 948
-epsilon 949
-zeta 950
-eta 951
-theta 952
-iota 953
-kappa 954
-lambda 955
-mu 956
-nu 957
-xi 958
-omicron 959
-pi 960
-rho 961
-sigmaf 962
-sigma 963
-tau 964
-upsilon 965
-phi 966
-chi 967
-psi 968
-omega 969
-thetasym 977
-upsih 978
-piv 982
-#
-# General Punctuation
-bull 8226
-hellip 8230
-prime 8242
-Prime 8243
-oline 8254
-frasl 8260
-#
-# Letterlike Symbols
-weierp 8472
-image 8465
-real 8476
-trade 8482
-alefsym 8501
-#
-# Arrows
-larr 8592
-uarr 8593
-rarr 8594
-darr 8595
-harr 8596
-crarr 8629
-lArr 8656
-uArr 8657
-rArr 8658
-dArr 8659
-hArr 8660
-#
-# Mathematical Operators
-forall 8704
-part 8706
-exist 8707
-empty 8709
-nabla 8711
-isin 8712
-notin 8713
-ni 8715
-prod 8719
-sum 8721
-minus 8722
-lowast 8727
-radic 8730
-prop 8733
-infin 8734
-ang 8736
-and 8743
-or 8744
-cap 8745
-cup 8746
-int 8747
-there4 8756
-sim 8764
-cong 8773
-asymp 8776
-ne 8800
-equiv 8801
-le 8804
-ge 8805
-sub 8834
-sup 8835
-nsub 8836
-sube 8838
-supe 8839
-oplus 8853
-otimes 8855
-perp 8869
-sdot 8901
-#
-# Miscellaneous Technical
-lceil 8968
-rceil 8969
-lfloor 8970
-rfloor 8971
-lang 9001
-rang 9002
-#
-# Geometric Shapes
-loz 9674
-#
-# Miscellaneous Symbols
-spades 9824
-clubs 9827
-hearts 9829
-diams 9830
-#
-# Character entity references for internationalization characters
-#
-# Latin Extended-A
-OElig 338
-oelig 339
-
-#-- NN 4.7 does not seem to support these, so they might ought to be commented.
-Scaron 352
-scaron 353
-Yuml 376
-#
-# Spacing Modifier Letters
-circ 710
-tilde 732
-#
-# General Punctuation
-ensp 8194
-emsp 8195
-thinsp 8201
-zwnj 8204
-zwj 8205
-lrm 8206
-rlm 8207
-ndash 8211
-mdash 8212
-lsquo 8216
-rsquo 8217
-sbquo 8218
-ldquo 8220
-rdquo 8221
-bdquo 8222
-dagger 8224
-Dagger 8225
-permil 8240
-lsaquo 8249
-rsaquo 8250
-euro 8364
diff --git a/src/org/apache/xalan/serialize/Method.java b/src/org/apache/xalan/serialize/Method.java
deleted file mode 100644
index 6c0ff7a..0000000
--- a/src/org/apache/xalan/serialize/Method.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-/**
- * Names of the four default output methods.
- * <p>
- * Four default output methods are defined: XML, HTML, XHTML and TEXT.
- * Serializers may support additional output methods. The names of
- * these output methods should be encoded as <tt>namespace:local</tt>.
- *
- * @version Alpha
- * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
- */
-public final class Method
-{
-
-  /**
-   * The output method for XML documents: <tt>xml</tt>.
-   */
-  public static final String XML = "xml";
-
-  /**
-   * The output method for HTML documents: <tt>html</tt>.
-   */
-  public static final String HTML = "html";
-
-  /**
-   * The output method for XHTML documents: <tt>xhtml</tt>.
-   */
-  public static final String XHTML = "xhtml";
-
-  /**
-   * The output method for text documents: <tt>text</tt>.
-   */
-  public static final String Text = "text";
-}
diff --git a/src/org/apache/xalan/serialize/Serializer.java b/src/org/apache/xalan/serialize/Serializer.java
deleted file mode 100644
index 9a083d9..0000000
--- a/src/org/apache/xalan/serialize/Serializer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.Writer;
-import java.io.OutputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.xml.sax.ContentHandler;
-
-/**
- * The Serializer interface is implemented by Serializers to publish methods 
- * to get and set streams and writers, to set the output properties, and 
- * get the Serializer as a ContentHandler or DOMSerializer.
- */
-public interface Serializer
-{
-
-  /**
-   * Specifies an output stream to which the document should be
-   * serialized. This method should not be called while the
-   * serializer is in the process of serializing a document.
-   * <p>
-   * The encoding specified in the output {@link Properties} is used, or
-   * if no encoding was specified, the default for the selected
-   * output method.
-   *
-   * @param output The output stream
-   */
-  public void setOutputStream(OutputStream output);
-
-  /**
-   * Get the output stream where the events will be serialized to.
-   *
-   * @return reference to the result stream, or null of only a writer was
-   * set.
-   */
-  public OutputStream getOutputStream();
-
-  /**
-   * Specifies a writer to which the document should be serialized.
-   * This method should not be called while the serializer is in
-   * the process of serializing a document.
-   * <p>
-   * The encoding specified for the output {@link Properties} must be
-   * identical to the output format used with the writer.
-   *
-   * @param writer The output writer stream
-   */
-  public void setWriter(Writer writer);
-
-  /**
-   * Get the character stream where the events will be serialized to.
-   *
-   * @return Reference to the result Writer, or null.
-   */
-  public Writer getWriter();
-
-  /**
-   * Specifies an output format for this serializer. It the
-   * serializer has already been associated with an output format,
-   * it will switch to the new format. This method should not be
-   * called while the serializer is in the process of serializing
-   * a document.
-   *
-   * @param format The output format to use
-   */
-  public void setOutputFormat(Properties format);
-
-  /**
-   * Returns the output format for this serializer.
-   *
-   * @return The output format in use
-   */
-  public Properties getOutputFormat();
-
-  /**
-   * Return a {@link ContentHandler} interface into this serializer.
-   * If the serializer does not support the {@link ContentHandler}
-   * interface, it should return null.
-   *
-   * @return A {@link ContentHandler} interface into this serializer,
-   *  or null if the serializer is not SAX 2 capable
-   * @throws IOException An I/O exception occured
-   */
-  public ContentHandler asContentHandler() throws IOException;
-
-  /**
-   * Return a {@link DOMSerializer} interface into this serializer.
-   * If the serializer does not support the {@link DOMSerializer}
-   * interface, it should return null.
-   *
-   * @return A {@link DOMSerializer} interface into this serializer,
-   *  or null if the serializer is not DOM capable
-   * @throws IOException An I/O exception occured
-   */
-  public DOMSerializer asDOMSerializer() throws IOException;
-
-  /**
-   * Resets the serializer. If this method returns true, the
-   * serializer may be used for subsequent serialization of new
-   * documents. It is possible to change the output format and
-   * output stream prior to serializing, or to use the existing
-   * output format and output stream.
-   *
-   * @return True if serializer has been reset and can be reused
-   */
-  public boolean reset();
-}
diff --git a/src/org/apache/xalan/serialize/SerializerFactory.java b/src/org/apache/xalan/serialize/SerializerFactory.java
deleted file mode 100644
index ca1e51f..0000000
--- a/src/org/apache/xalan/serialize/SerializerFactory.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import javax.xml.transform.OutputKeys;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.xalan.templates.OutputProperties;
-import org.apache.xml.utils.WrappedRuntimeException;
-
-/**
- * Factory for creating serializers.
- */
-public abstract class SerializerFactory
-{
-
-  /*
-   * Associates output methods to serializer classes.
-   * (Don't use this right now.  -sb
-   */
-
-  // private static Hashtable _serializers = new Hashtable();
-
-  /**
-   * Associates output methods to default output formats.
-   */
-  private static Hashtable _formats = new Hashtable();
-
-  /**
-   * Returns a serializer for the specified output method. Returns
-   * null if no implementation exists that supports the specified
-   * output method. For a list of the default output methods see
-   * {@link Method}.
-   *
-   * @param format The output format
-   * @return A suitable serializer, or null
-   * @throws IllegalArgumentException (apparently -sc) if method is 
-   * null or an appropriate serializer can't be found
-   * @throws WrappedRuntimeException (apparently -sc) if an 
-   * exception is thrown while trying to find serializer
-   */
-  public static Serializer getSerializer(Properties format)
-  {
-
-    Serializer ser = null;
-
-    try
-    {
-      Class cls;
-      String method = format.getProperty(OutputKeys.METHOD);
-
-      if (method == null)
-        throw new IllegalArgumentException(
-          "The output format has a null method name");
-
-      cls = null;  // (Class)_serializers.get(method);
-
-      if (cls == null)
-      {
-        String className =
-          format.getProperty(OutputProperties.S_KEY_CONTENT_HANDLER);
-
-        if (null == className)
-        {
-          throw new IllegalArgumentException(
-            "The output format must have a '"
-            + OutputProperties.S_KEY_CONTENT_HANDLER + "' property!");
-        }
-
-        cls = Class.forName(className);
-
-        // _serializers.put(method, cls);
-      }
-
-      ser = (Serializer) cls.newInstance();
-
-      ser.setOutputFormat(format);
-    }
-    catch (Exception e)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(e);
-    }
-
-    return ser;
-  }
-}
diff --git a/src/org/apache/xalan/serialize/SerializerToHTML.java b/src/org/apache/xalan/serialize/SerializerToHTML.java
deleted file mode 100644
index 2374ef8..0000000
--- a/src/org/apache/xalan/serialize/SerializerToHTML.java
+++ /dev/null
@@ -1,1372 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.util.Stack;
-
-import java.io.Writer;
-import java.io.IOException;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Properties;
-import java.util.BitSet;
-
-import org.xml.sax.*;
-
-import org.apache.xml.utils.BoolStack;
-import org.apache.xml.utils.Trie;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xml.utils.StringToIntTable;
-import org.apache.xalan.templates.OutputProperties;
-
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-
-/**
- * <meta name="usage" content="general"/>
- * SerializerToHTML formats SAX-style events into XML.
- */
-public class SerializerToHTML extends SerializerToXML
-{
-
-  /** State stack to keep track of if the current element has output 
-   *  escaping disabled. */
-  protected BoolStack m_isRawStack = new BoolStack();
-
-  /** True if the current element is a block element.  (seems like 
-   *  this needs to be a stack. -sb). */
-  private boolean m_inBlockElem = false;
-
-  /**
-   * Map that tells which XML characters should have special treatment, and it
-   *  provides character to entity name lookup.
-   */
-  protected static CharInfo m_htmlcharInfo =
-    new CharInfo(CharInfo.HTML_ENTITIES_RESOURCE);
-
-  /** A digital search trie for fast, case insensitive lookup of ElemDesc objects. */
-  static Trie m_elementFlags = new Trie();
-
-  static
-  {
-
-    // HTML 4.0 loose DTD
-    m_elementFlags.put("BASEFONT", new ElemDesc(0 | ElemDesc.EMPTY));
-    m_elementFlags.put("FRAME",
-                       new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
-    m_elementFlags.put("FRAMESET", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("NOFRAMES", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("ISINDEX",
-                       new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
-    m_elementFlags.put("APPLET",
-                       new ElemDesc(0 | ElemDesc.WHITESPACESENSITIVE));
-    m_elementFlags.put("CENTER", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("DIR", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("MENU", new ElemDesc(0 | ElemDesc.BLOCK));
-
-    // HTML 4.0 strict DTD
-    m_elementFlags.put("TT", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    m_elementFlags.put("I", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    m_elementFlags.put("B", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    m_elementFlags.put("BIG", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    m_elementFlags.put("SMALL", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    m_elementFlags.put("EM", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("STRONG", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("DFN", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("CODE", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("SAMP", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("KBD", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("VAR", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("CITE", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("ABBR", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("ACRONYM", new ElemDesc(0 | ElemDesc.PHRASE));
-    m_elementFlags.put("SUP",
-                       new ElemDesc(0 | ElemDesc.SPECIAL
-                                    | ElemDesc.ASPECIAL));
-    m_elementFlags.put("SUB",
-                       new ElemDesc(0 | ElemDesc.SPECIAL
-                                    | ElemDesc.ASPECIAL));
-    m_elementFlags.put("SPAN",
-                       new ElemDesc(0 | ElemDesc.SPECIAL
-                                    | ElemDesc.ASPECIAL));
-    m_elementFlags.put("BDO",
-                       new ElemDesc(0 | ElemDesc.SPECIAL
-                                    | ElemDesc.ASPECIAL));
-    m_elementFlags.put("BR",
-                       new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL
-                                    | ElemDesc.EMPTY | ElemDesc.BLOCK));
-    m_elementFlags.put("BODY", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("ADDRESS",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("DIV",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("A", new ElemDesc(0 | ElemDesc.SPECIAL));
-    m_elementFlags.put("MAP",
-                       new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL
-                                    | ElemDesc.BLOCK));
-    m_elementFlags.put("AREA",
-                       new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
-    m_elementFlags.put("LINK",
-                       new ElemDesc(0 | ElemDesc.HEADMISC | ElemDesc.EMPTY
-                                    | ElemDesc.BLOCK));
-    m_elementFlags.put("IMG",
-                       new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL
-                                    | ElemDesc.EMPTY
-                                    | ElemDesc.WHITESPACESENSITIVE));
-    m_elementFlags.put("OBJECT",
-                       new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL
-                                    | ElemDesc.HEADMISC
-                                    | ElemDesc.WHITESPACESENSITIVE));
-    m_elementFlags.put("PARAM", new ElemDesc(0 | ElemDesc.EMPTY));
-    m_elementFlags.put("HR",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET
-                                    | ElemDesc.EMPTY));
-    m_elementFlags.put("P",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("H1",
-                       new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
-    m_elementFlags.put("H2",
-                       new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
-    m_elementFlags.put("H3",
-                       new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
-    m_elementFlags.put("H4",
-                       new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
-    m_elementFlags.put("H5",
-                       new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
-    m_elementFlags.put("H6",
-                       new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
-    m_elementFlags.put("PRE",
-                       new ElemDesc(0 | ElemDesc.PREFORMATTED
-                                    | ElemDesc.BLOCK));
-    m_elementFlags.put("Q",
-                       new ElemDesc(0 | ElemDesc.SPECIAL
-                                    | ElemDesc.ASPECIAL));
-    m_elementFlags.put("BLOCKQUOTE",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("INS", new ElemDesc(0));
-    m_elementFlags.put("DEL", new ElemDesc(0));
-    m_elementFlags.put("DL",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("DT", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("DD", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("OL",
-                       new ElemDesc(0 | ElemDesc.LIST | ElemDesc.BLOCK));
-    m_elementFlags.put("UL",
-                       new ElemDesc(0 | ElemDesc.LIST | ElemDesc.BLOCK));
-    m_elementFlags.put("LI", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("FORM", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("LABEL", new ElemDesc(0 | ElemDesc.FORMCTRL));
-    m_elementFlags.put("INPUT",
-                       new ElemDesc(0 | ElemDesc.FORMCTRL
-                                    | ElemDesc.INLINELABEL | ElemDesc.EMPTY));
-    m_elementFlags.put("SELECT",
-                       new ElemDesc(0 | ElemDesc.FORMCTRL
-                                    | ElemDesc.INLINELABEL));
-    m_elementFlags.put("OPTGROUP", new ElemDesc(0));
-    m_elementFlags.put("OPTION", new ElemDesc(0));
-    m_elementFlags.put("TEXTAREA",
-                       new ElemDesc(0 | ElemDesc.FORMCTRL
-                                    | ElemDesc.INLINELABEL));
-    m_elementFlags.put("FIELDSET",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM));
-    m_elementFlags.put("LEGEND", new ElemDesc(0));
-    m_elementFlags.put("BUTTON",
-                       new ElemDesc(0 | ElemDesc.FORMCTRL
-                                    | ElemDesc.INLINELABEL));
-    m_elementFlags.put("TABLE",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("CAPTION", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("THEAD", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("TFOOT", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("TBODY", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("COLGROUP", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("COL",
-                       new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
-    m_elementFlags.put("TR", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("TH", new ElemDesc(0));
-    m_elementFlags.put("TD", new ElemDesc(0));
-    m_elementFlags.put("HEAD",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.HEADELEM));
-    m_elementFlags.put("TITLE", new ElemDesc(0 | ElemDesc.BLOCK));
-    m_elementFlags.put("BASE",
-                       new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
-    m_elementFlags.put("META",
-                       new ElemDesc(0 | ElemDesc.HEADMISC | ElemDesc.EMPTY
-                                    | ElemDesc.BLOCK));
-    m_elementFlags.put("STYLE",
-                       new ElemDesc(0 | ElemDesc.HEADMISC | ElemDesc.RAW
-                                    | ElemDesc.BLOCK));
-    m_elementFlags.put("SCRIPT",
-                       new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL
-                                    | ElemDesc.HEADMISC | ElemDesc.RAW));
-    m_elementFlags.put("NOSCRIPT",
-                       new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                    | ElemDesc.BLOCKFORMFIELDSET));
-    m_elementFlags.put("HTML", new ElemDesc(0 | ElemDesc.BLOCK));
-
-    // From "John Ky" <hand@syd.speednet.com.au
-    // Transitional Document Type Definition ()
-    // file:///C:/Documents%20and%20Settings/sboag.BOAG600E/My%20Documents/html/sgml/loosedtd.html#basefont
-    m_elementFlags.put("FONT", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
-    // file:///C:/Documents%20and%20Settings/sboag.BOAG600E/My%20Documents/html/present/graphics.html#edef-STRIKE
-    m_elementFlags.put("S", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    m_elementFlags.put("STRIKE", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
-    // file:///C:/Documents%20and%20Settings/sboag.BOAG600E/My%20Documents/html/present/graphics.html#edef-U
-    m_elementFlags.put("U", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
-    // From "John Ky" <hand@syd.speednet.com.au
-    m_elementFlags.put("NOBR", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-    
-     // HTML 4.0, section 16.5
-     m_elementFlags.put("IFRAME",
-                                        new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                                                     | ElemDesc.BLOCKFORMFIELDSET));
-     // NS4 extensions
-     m_elementFlags.put("LAYER",
-                                        new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                                                     | ElemDesc.BLOCKFORMFIELDSET));
-     m_elementFlags.put("ILAYER",
-                                        new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM
-                                                                     | ElemDesc.BLOCKFORMFIELDSET));
-  
-    ElemDesc elemDesc;
-
-    elemDesc = (ElemDesc) m_elementFlags.get("AREA");
-
-    elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
-    elemDesc.setAttr("NOHREF", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("BASE");
-
-    elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("BLOCKQUOTE");
-
-    elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("Q");
-
-    elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("INS");
-
-    elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("DEL");
-
-    elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("A");
-
-    elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
-    elemDesc.setAttr("NAME", ElemDesc.ATTRURL);
-    
-    elemDesc = (ElemDesc) m_elementFlags.get("LINK");
-    elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("INPUT");
-
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-    elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
-    elemDesc.setAttr("CHECKED", ElemDesc.ATTREMPTY);
-    elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-    elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
-    elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("SELECT");
-
-    elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-    elemDesc.setAttr("MULTIPLE", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("OPTGROUP");
-
-    elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("OPTION");
-
-    elemDesc.setAttr("SELECTED", ElemDesc.ATTREMPTY);
-    elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("TEXTAREA");
-
-    elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-    elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("BUTTON");
-
-    elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("SCRIPT");
-
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-    elemDesc.setAttr("FOR", ElemDesc.ATTRURL);
-    elemDesc.setAttr("DEFER", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("IMG");
-
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-    elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
-    elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
-    elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("OBJECT");
-
-    elemDesc.setAttr("CLASSID", ElemDesc.ATTRURL);
-    elemDesc.setAttr("CODEBASE", ElemDesc.ATTRURL);
-    elemDesc.setAttr("DATA", ElemDesc.ATTRURL);
-    elemDesc.setAttr("ARCHIVE", ElemDesc.ATTRURL);
-    elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
-    elemDesc.setAttr("DECLARE", ElemDesc.ATTREMPTY);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("FORM");
-
-    elemDesc.setAttr("ACTION", ElemDesc.ATTRURL);
-
-    elemDesc = (ElemDesc) m_elementFlags.get("HEAD");
-
-    elemDesc.setAttr("PROFILE", ElemDesc.ATTRURL);
-
-    // Attribution to: "Voytenko, Dimitry" <DVoytenko@SECTORBASE.COM>
-    elemDesc = (ElemDesc) m_elementFlags.get("FRAME");
-
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-    elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
- 
-    // HTML 4.0, section 16.5
-    elemDesc = (ElemDesc) m_elementFlags.get("IFRAME");
- 
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-    elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
- 
-    // NS4 extensions
-    elemDesc = (ElemDesc) m_elementFlags.get("LAYER");
- 
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- 
-    elemDesc = (ElemDesc) m_elementFlags.get("ILAYER");
- 
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- 
-    elemDesc = (ElemDesc) m_elementFlags.get("DIV");
-
-    elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-  }
-
-  /**
-   * Dummy element for elements not found.
-   */
-  static private ElemDesc m_dummy = new ElemDesc(0 | ElemDesc.BLOCK);
-
-  /** True if URLs should be specially escaped with the %xx form. */
-  private boolean m_specialEscapeURLs = true;
-
-  /** True if the META tag should be omitted. */
-  private boolean m_omitMetaTag = false;
-
-  /**
-   * Tells if the formatter should use special URL escaping.
-   *
-   * @param bool True if URLs should be specially escaped with the %xx form.
-   */
-  public void setSpecialEscapeURLs(boolean bool)
-  {
-    m_specialEscapeURLs = bool;
-  }
-
-  /**
-   * Tells if the formatter should omit the META tag.
-   *
-   * @param bool True if the META tag should be omitted.
-   */
-  public void setOmitMetaTag(boolean bool)
-  {
-    m_omitMetaTag = bool;
-  }
-
-  /**
-   * Specifies an output format for this serializer. It the
-   * serializer has already been associated with an output format,
-   * it will switch to the new format. This method should not be
-   * called while the serializer is in the process of serializing
-   * a document.
-   *
-   * @param format The output format to use
-   */
-  public void setOutputFormat(Properties format)
-  {
-
-    m_specialEscapeURLs =
-      OutputProperties.getBooleanProperty(OutputProperties.S_USE_URL_ESCAPING,
-                                          format);
-
-    m_omitMetaTag =
-      OutputProperties.getBooleanProperty(OutputProperties.S_OMIT_META_TAG,
-                                          format);
-                            
-    super.setOutputFormat(format);
-  }
-
-  /**
-   * Tells if the formatter should use special URL escaping.
-   *
-   * @return True if URLs should be specially escaped with the %xx form.
-   */
-  public boolean getSpecialEscapeURLs()
-  {
-    return m_specialEscapeURLs;
-  }
-
-  /**
-   * Tells if the formatter should omit the META tag.
-   *
-   * @return True if the META tag should be omitted.
-   */
-  public boolean getOmitMetaTag()
-  {
-    return m_omitMetaTag;
-  }
-
-  /**
-   * Get a description of the given element.
-   *
-   * @param name non-null name of element, case insensitive.
-   *
-   * @return non-null reference to ElemDesc, which may be m_dummy if no 
-   *         element description matches the given name.
-   */
-  ElemDesc getElemDesc(String name)
-  {
-
-    if (null != name)
-    {
-      Object obj = m_elementFlags.get(name);
-
-      if (null != obj)
-        return (ElemDesc) obj;
-    }
-
-    return m_dummy;
-  }
-
-  /**
-   * Default constructor.
-   */
-  public SerializerToHTML()
-  {
-
-    super();
-    m_charInfo = m_htmlcharInfo;
-  }
-
-  /** The name of the current element. */
-  private String m_currentElementName = null;
-
-  /**
-   * Receive notification of the beginning of a document.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startDocument() throws org.xml.sax.SAXException
-  {
-
-    m_needToOutputDocTypeDecl = true;
-    m_startNewLine = false;
-    m_shouldNotWriteXMLHeader = true;
-
-    if (true == m_needToOutputDocTypeDecl)
-    {
-      if ((null != m_doctypeSystem) || (null != m_doctypePublic))
-      {
-        accum("<!DOCTYPE HTML");
-
-        if (null != m_doctypePublic)
-        {
-          accum(" PUBLIC \"");
-          accum(m_doctypePublic);
-          accum("\"");
-        }
-
-        if (null != m_doctypeSystem)
-        {
-          if (null == m_doctypePublic)
-            accum(" SYSTEM \"");
-          else
-            accum(" \"");
-
-          accum(m_doctypeSystem);
-          accum("\"");
-        }
-
-        accum(">");
-        outputLineSep();
-      }
-    }
-
-    m_needToOutputDocTypeDecl = false;
-  }
-
-  /**
-   *  Receive notification of the beginning of an element.
-   *
-   *
-   *  @param namespaceURI
-   *  @param localName
-   *  @param name The element type name.
-   *  @param atts The attributes attached to the element, if any.
-   *  @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *             wrapping another exception.
-   *  @see #endElement
-   *  @see org.xml.sax.AttributeList
-   */
-  public void startElement(
-          String namespaceURI, String localName, String name, Attributes atts)
-            throws org.xml.sax.SAXException
-  {
-    // System.out.println("SerializerToHTML#startElement("+namespaceURI+", "+localName+", "+name+", ...);");
-
-    if (null != namespaceURI && namespaceURI.length() > 0)
-    {
-      super.startElement(namespaceURI, localName, name, atts);
-
-      return;
-    }
-
-    boolean savedDoIndent = m_doIndent;
-    boolean noLineBreak;
-
-    writeParentTagEnd();
-    pushState(
-      namespaceURI, localName,
-      m_cdataSectionNames, m_cdataSectionStates);
-
-    // pushState(namespaceURI, localName, m_format.getNonEscapingElements(),
-    //          m_disableOutputEscapingStates);
-    ElemDesc elemDesc = getElemDesc(name);
-
-    // ElemDesc parentElemDesc = getElemDesc(m_currentElementName);
-    boolean isBlockElement = elemDesc.is(ElemDesc.BLOCK);
-    boolean isHeadElement = elemDesc.is(ElemDesc.HEADELEM);
-
-    // boolean isWhiteSpaceSensitive = elemDesc.is(ElemDesc.WHITESPACESENSITIVE);
-    if (m_ispreserve)
-      m_ispreserve = false;
-    else if (m_doIndent && (null != m_currentElementName)
-             && (!m_inBlockElem || isBlockElement)
-
-    /* && !isWhiteSpaceSensitive */
-    )
-    {
-      m_startNewLine = true;
-
-      indent(m_currentIndent);
-    }
-
-    m_inBlockElem = !isBlockElement;
-
-    m_isRawStack.push(elemDesc.is(ElemDesc.RAW));
-
-    m_currentElementName = name;
-
-    // m_parents.push(m_currentElementName);
-    this.accum('<');
-    this.accum(name);
-
-    int nAttrs = atts.getLength();
-
-    for (int i = 0; i < nAttrs; i++)
-    {
-      processAttribute(atts.getQName(i), elemDesc, atts.getValue(i));
-    }
-
-    // Flag the current element as not yet having any children.
-    openElementForChildren();
-
-    m_currentIndent += this.m_indentAmount;
-    m_isprevtext = false;
-    m_doIndent = savedDoIndent;
-
-    if (isHeadElement)
-    {
-      writeParentTagEnd();
-
-      if (!m_omitMetaTag)
-      {
-        if (m_doIndent)
-          indent(m_currentIndent);
-
-        accum(
-          "<META http-equiv=\"Content-Type\" content=\"text/html; charset=");
-
-        // String encoding = Encodings.getMimeEncoding(m_encoding).toLowerCase();
-        String encoding = Encodings.getMimeEncoding(m_encoding);
-
-        accum(encoding);
-        accum('"');
-        accum('>');
-      }
-    }
-  }
-
-  /**
-   *  Receive notification of the end of an element.
-   *
-   *
-   *  @param namespaceURI
-   *  @param localName
-   *  @param name The element type name
-   *  @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *             wrapping another exception.
-   */
-  public void endElement(String namespaceURI, String localName, String name)
-          throws org.xml.sax.SAXException
-  {
-    // System.out.println("SerializerToHTML#endElement("+namespaceURI+", "+localName+", "+name+");");
-    if (null != namespaceURI && namespaceURI.length() > 0)
-    {
-      super.endElement(namespaceURI, localName, name);
-
-      return;
-    }
-
-    m_currentIndent -= this.m_indentAmount;
-
-    boolean hasChildNodes = childNodesWereAdded();
-
-    // System.out.println(m_currentElementName);
-    // m_parents.pop();
-    m_isRawStack.pop();
-
-    ElemDesc elemDesc = getElemDesc(name);
-
-    // ElemDesc parentElemDesc = getElemDesc(m_currentElementName);
-    boolean isBlockElement = elemDesc.is(ElemDesc.BLOCK);
-    boolean shouldIndent = false;
-
-    if (m_ispreserve)
-    {
-      m_ispreserve = false;
-    }
-    else if (m_doIndent && (!m_inBlockElem || isBlockElement))
-    {
-      m_startNewLine = true;
-      shouldIndent = true;
-
-      // indent(m_currentIndent);
-    }
-
-    m_inBlockElem = !isBlockElement;
-
-    if (hasChildNodes)
-    {
-      if (shouldIndent)
-        indent(m_currentIndent);
-
-      this.accum("</");
-      this.accum(name);
-      this.accum('>');
-
-      m_currentElementName = name;
-    }
-    else
-    {
-      if (!elemDesc.is(ElemDesc.EMPTY))
-      {
-        this.accum('>');
-
-        // As per Dave/Paul recommendation 12/06/2000
-        // if (shouldIndent)
-        //  indent(m_currentIndent);
-
-        this.accum('<');
-        this.accum('/');
-        this.accum(name);
-        this.accum('>');
-      }
-      else
-      {
-        this.accum('>');
-      }
-    }
-
-    if (elemDesc.is(ElemDesc.WHITESPACESENSITIVE))
-      m_ispreserve = true;
-
-    if (hasChildNodes)
-    {
-      if (!m_preserves.isEmpty())
-        m_preserves.pop();
-    }
-
-    m_isprevtext = false;
-
-    // m_disableOutputEscapingStates.pop();
-    m_cdataSectionStates.pop();
-  }
-
-  /**
-   * Process an attribute.
-   * @param   name   The name of the attribute.
-   * @param elemDesc non-null reference to the owning element description.
-   * @param   value   The value of the attribute.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void processAttribute(
-          String name, ElemDesc elemDesc, String value)
-            throws org.xml.sax.SAXException
-  {
-
-    this.accum(' ');
-
-    if (((value.length() == 0) || value.equalsIgnoreCase(name))
-            && elemDesc.isAttrFlagSet(name, ElemDesc.ATTREMPTY))
-    {
-      this.accum(name);
-    }
-    else
-    {
-      this.accum(name);
-      this.accum('=');
-
-      this.accum('\"');
-      if (elemDesc.isAttrFlagSet(name, ElemDesc.ATTRURL))
-        writeAttrURI(value, m_specialEscapeURLs);
-      else
-        writeAttrString(value, this.m_encoding);
-      this.accum('\"');
-
-    }
-  }
-  
-  /**
-   * Tell if a character is an ASCII digit.
-   */
-   private boolean isASCIIDigit(char c)
-   {
-      return (c >= '0' && c <= '9');
-   }
-   
- /**
-  * Make an integer into an HH hex value.
-  * Does no checking on the size of the input, since this 
-  * is only meant to be used locally by writeAttrURI.
-  * 
-  * @param i must be a value less than 255.
-  * 
-  * @return should be a two character string.
-  */
-  private String makeHHString(int i)
-  {
-    String s = Integer.toHexString(i).toUpperCase();
-    if(s.length() == 1)
-    {
-      s = "0"+s;
-    }
-    return s;
-  }
-    
-  /**
-  * Dmitri Ilyin: Makes sure if the String is HH encoded sign.
-  * @param str must be 2 characters long
-  *
-  * @return true or false
-  */
-  private boolean isHHSign(String str) 
-  {
-    boolean sign = true;  
-    try {
-      char r = (char)Integer.parseInt(str,16);
-    } catch (NumberFormatException e) {
-      sign = false;  
-    }
-    return sign;
-  }
-  
-  /**
-   * Write the specified <var>string</var> after substituting non ASCII characters,
-   * with <CODE>%HH</CODE>, where HH is the hex of the byte value.
-   *
-   * @param   string      String to convert to XML format.
-   * @param doURLEscaping True if we should try to encode as 
-   *                      per http://www.ietf.org/rfc/rfc2396.txt.
-   *
-   * @throws org.xml.sax.SAXException if a bad surrogate pair is detected.
-   */
-  public void writeAttrURI(String string, boolean doURLEscaping)
-          throws org.xml.sax.SAXException
-  {
-    // http://www.ietf.org/rfc/rfc2396.txt says:
-    // A URI is always in an "escaped" form, since escaping or unescaping a
-    // completed URI might change its semantics.  Normally, the only time
-    // escape encodings can safely be made is when the URI is being created
-    // from its component parts; each component may have its own set of
-    // characters that are reserved, so only the mechanism responsible for
-    // generating or interpreting that component can determine whether or
-    // not escaping a character will change its semantics. Likewise, a URI
-    // must be separated into its components before the escaped characters
-    // within those components can be safely decoded.
-    //
-    // ...So we do our best to do limited escaping of the URL, without 
-    // causing damage.  If the URL is already properly escaped, in theory, this 
-    // function should not change the string value.
-
-    char[] stringArray = string.toCharArray();
-    int len = stringArray.length;
-        
-    for (int i = 0; i < len; i++)
-    {
-      char ch = stringArray[i];
-
-      if ((ch < 33) || (ch > 126))
-      {
-        if (doURLEscaping)
-        {
-          // Encode UTF16 to UTF8.
-          // Reference is Unicode, A Primer, by Tony Graham.
-          // Page 92.
-          
-          // Note that Kay doesn't escape 0x20...
-          //  if(ch == 0x20) // Not sure about this... -sb
-          //  {
-          //    accum(ch);
-          //  }
-          //  else 
-          if(ch <= 0x7F)
-          {
-            accum('%');
-            accum(makeHHString(ch));          
-          }
-          else if(ch <= 0x7FF)
-          {
-            // Clear low 6 bits before rotate, put high 4 bits in low byte, 
-            // and set two high bits.
-            int high = (ch >> 6) | 0xC0;  
-            int low = (ch & 0x3F) | 0x80; // First 6 bits, + high bit
-            accum('%');
-            accum(makeHHString(high));
-            accum('%');
-            accum(makeHHString(low));
-          }
-          else if( isUTF16Surrogate(ch) ) // high surrogate
-          {
-            // I'm sure this can be done in 3 instructions, but I choose 
-            // to try and do it exactly like it is done in the book, at least 
-            // until we are sure this is totally clean.  I don't think performance 
-            // is a big issue with this particular function, though I could be 
-            // wrong.  Also, the stuff below clearly does more masking than 
-            // it needs to do.
-            
-            // Clear high 6 bits.
-            int highSurrogate = ((int) ch) & 0x03FF;
-            
-            // Middle 4 bits (wwww) + 1
-            // "Note that the value of wwww from the high surrogate bit pattern
-            // is incremented to make the uuuuu bit pattern in the scalar value 
-            // so the surrogate pair don't address the BMP."
-            int wwww = ((highSurrogate & 0x03C0) >> 6);
-            int uuuuu = wwww+1;  
-            
-            // next 4 bits
-            int zzzz = (highSurrogate & 0x003C) >> 2;
-            
-            // low 2 bits
-            int yyyyyy = ((highSurrogate & 0x0003) << 4) & 0x30;
-            
-            // Get low surrogate character.
-            ch = stringArray[++i];
-            
-            // Clear high 6 bits.
-            int lowSurrogate = ((int) ch) & 0x03FF;
-            
-            // put the middle 4 bits into the bottom of yyyyyy (byte 3)
-            yyyyyy = yyyyyy | ((lowSurrogate & 0x03C0) >> 6);
-            
-            // bottom 6 bits.
-            int xxxxxx = (lowSurrogate & 0x003F);
-            
-            int byte1 = 0xF0 | (uuuuu >> 2); // top 3 bits of uuuuu
-            int byte2 = 0x80 | (((uuuuu & 0x03) << 4) & 0x30) | zzzz;
-            int byte3 = 0x80 | yyyyyy;
-            int byte4 = 0x80 | xxxxxx;
-            
-            accum('%');
-            accum(makeHHString(byte1));
-            accum('%');
-            accum(makeHHString(byte2));
-            accum('%');
-            accum(makeHHString(byte3));
-            accum('%');
-            accum(makeHHString(byte4));
-          }
-          else 
-          {
-            int high = (ch >> 12) | 0xE0; // top 4 bits
-            int middle = ((ch & 0x0FC0) >> 6) | 0x80; // middle 6 bits
-            int low = (ch & 0x3F) | 0x80; // First 6 bits, + high bit
-            accum('%');
-            accum(makeHHString(high));
-            accum('%');
-            accum(makeHHString(middle));
-            accum('%');
-            accum(makeHHString(low));
-          }
-
-        }
-        else if (ch < m_maxCharacter)
-        {
-          accum(ch);
-        }
-        else
-        {
-          accum("&#");
-          accum(Integer.toString(ch));
-          accum(';');
-        }
-      }
-      else if('%' == ch)
-      {
-        // If the character is a '%' number number, try to avoid double-escaping.
-        // There is a question if this is legal behavior.
-          
-// Dmitri Ilyin: to check if '%' number number is invalid. It must be checked if %xx is a sign, that would be encoded
-// The encoded signes are in Hex form. So %xx my be in form %3C that is "<" sign. I will try to change here a little.
-          
-//        if( ((i+2) < len) && isASCIIDigit(stringArray[i+1]) && isASCIIDigit(stringArray[i+2]) )
-        if ( ((i+2) < len) && isHHSign(new String(stringArray,i+1,2)) )
-        {
-          accum(ch);
-        }
-        else
-        {
-          if (doURLEscaping)
-          {
-           accum('%');
-           accum(makeHHString(ch));
-          }
-          else
-            accum(ch);
-        }   
-               
-      } 
-      // Since http://www.ietf.org/rfc/rfc2396.txt refers to the URI grammar as
-      // not allowing quotes in the URI proper syntax, nor in the fragment 
-      // identifier, we believe that it's OK to double escape quotes.
-      else if (ch == '"')
-      {
-        // Mike Kay encodes this as &#34;, so he may know something I don't?
-        if (doURLEscaping)
-          accum("%22");
-        else
-          accum("&quot;"); // we have to escape this, I guess.
-      }
-      else
-      {
-        accum(ch);
-      }
-    }
-              
-  }
-
-  /**
-   * Writes the specified <var>string</var> after substituting <VAR>specials</VAR>,
-   * and UTF-16 surrogates for character references <CODE>&amp;#xnn</CODE>.
-   *
-   * @param   string      String to convert to XML format.
-   * @param   encoding    CURRENTLY NOT IMPLEMENTED.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void writeAttrString(String string, String encoding)
-          throws org.xml.sax.SAXException
-  {
-
-    final char chars[] = string.toCharArray();
-    final int strLen = chars.length;
-
-    for (int i = 0; i < strLen; i++)
-    {
-      char ch = chars[i];
-
-      // System.out.println("SPECIALSSIZE: "+SPECIALSSIZE);
-      // System.out.println("ch: "+(int)ch);
-      // System.out.println("m_maxCharacter: "+(int)m_maxCharacter);
-      // System.out.println("m_attrCharsMap[ch]: "+(int)m_attrCharsMap[ch]);
-      if ((ch < m_maxCharacter) && (!m_charInfo.isSpecial(ch)))
-      {
-        accum(ch);
-      }
-      else if ('<' == ch || '>' == ch)
-      {
-        accum(ch);  // no escaping in this case, as specified in 15.2
-      }
-      else if (('&' == ch) && ((i + 1) < strLen) && ('{' == chars[i + 1]))
-      {
-        accum(ch);  // no escaping in this case, as specified in 15.2
-      }
-      else
-      {
-        int pos = accumDefaultEntity(ch, i, chars, strLen, false);
-
-        if (i != pos)
-        {
-          i = pos - 1;
-        }
-        else
-        {
-          if (isUTF16Surrogate(ch))
-          {
-            try
-            {
-              i = writeUTF16Surrogate(ch, chars, i, strLen);
-            }
-            catch(IOException ioe)
-            {
-              throw new SAXException(ioe);
-            }
-          }
-
-          // The next is kind of a hack to keep from escaping in the case 
-          // of Shift_JIS and the like.
-
-          /*
-          else if ((ch < m_maxCharacter) && (m_maxCharacter == 0xFFFF)
-          && (ch != 160))
-          {
-          accum(ch);  // no escaping in this case
-          }
-          else
-          */
-          String entityName = m_charInfo.getEntityNameForChar(ch);
-
-          if (null != entityName)
-          {
-            accum('&');
-            accum(entityName);
-            accum(';');
-          }
-          else if (ch < m_maxCharacter)
-          {
-            accum(ch);  // no escaping in this case
-          }
-          else
-          {
-            if (ch < m_maxCharacter)
-            {
-              accum(ch);  // no escaping in this case
-            }
-            else
-            {
-              accum("&#");
-              accum(Integer.toString(ch));
-              accum(';');
-            }
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   * Copy an entity into the accumulation buffer.
-   *
-   * @param s The name of the entity.
-   * @param pos unused.
-   *
-   * @return The pos argument.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  private int copyEntityIntoBuf(String s, int pos)
-          throws org.xml.sax.SAXException
-  {
-
-    int l = s.length();
-
-    accum('&');
-
-    for (int i = 0; i < l; i++)
-    {
-      accum(s.charAt(i));
-    }
-
-    accum(';');
-
-    return pos;
-  }
-
-  /**
-   * Receive notification of character data.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param chars The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void characters(char chars[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if (m_isRawStack.peekOrFalse())
-    {
-      try
-      {
-        writeParentTagEnd();
-
-        m_ispreserve = true;
-
-        if (shouldIndent())
-          indent(m_currentIndent);
-
-        // this.accum("<![CDATA[");
-        // this.accum(chars, start, length);
-        writeNormalizedChars(chars, start, length, false);
-
-        // this.accum("]]>");
-        return;
-      }
-      catch (IOException ioe)
-      {
-        throw new org.xml.sax.SAXException(
-          XSLMessages.createXPATHMessage(
-          XPATHErrorResources.ER_OIERROR, null), ioe);  //"IO error", ioe);
-      }
-    }
-    else
-    {
-      super.characters(chars, start, length);
-    }
-  }
-
-  /**
-   *  Receive notification of cdata.
-   *
-   *  <p>The Parser will call this method to report each chunk of
-   *  character data.  SAX parsers may return all contiguous character
-   *  data in a single chunk, or they may split it into several
-   *  chunks; however, all of the characters in any single event
-   *  must come from the same external entity, so that the Locator
-   *  provides useful information.</p>
-   *
-   *  <p>The application must not attempt to read from the array
-   *  outside of the specified range.</p>
-   *
-   *  <p>Note that some parsers will report whitespace using the
-   *  ignorableWhitespace() method rather than this one (validating
-   *  parsers must do so).</p>
-   *
-   *  @param ch The characters from the XML document.
-   *  @param start The start position in the array.
-   *  @param length The number of characters to read from the array.
-   *  @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *             wrapping another exception.
-   *  @see #ignorableWhitespace
-   *  @see org.xml.sax.Locator
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void cdata(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if ((null != m_currentElementName)
-            && (m_currentElementName.equalsIgnoreCase("SCRIPT")
-                || m_currentElementName.equalsIgnoreCase("STYLE")))
-    {
-      try
-      {
-        writeParentTagEnd();
-
-        m_ispreserve = true;
-
-        if (shouldIndent())
-          indent(m_currentIndent);
-
-        // this.accum(ch, start, length);
-        writeNormalizedChars(ch, start, length, true);
-      }
-      catch (IOException ioe)
-      {
-        throw new org.xml.sax.SAXException(
-          XSLMessages.createXPATHMessage(
-          XPATHErrorResources.ER_OIERROR, null), ioe);  //"IO error", ioe);
-      }
-    }
-
-    /*
-    else if(m_stripCData) // should normally always be false
-    {
-      try
-      {
-        writeParentTagEnd();
-        m_ispreserve = true;
-        if (shouldIndent())
-          indent(m_currentIndent);
-        // this.accum("<![CDATA[");
-        this.accum(ch, start, length);
-        // this.accum("]]>");
-      }
-      catch(IOException ioe)
-      {
-        throw new org.xml.sax.SAXException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_OIERROR, null),ioe); //"IO error", ioe);
-      }
-    }
-    */
-    else
-    {
-      super.cdata(ch, start, length);
-    }
-  }
-
-  /**
-   *  Receive notification of a processing instruction.
-   *
-   *  @param target The processing instruction target.
-   *  @param data The processing instruction data, or null if
-   *         none was supplied.
-   *  @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *             wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-
-    // Use a fairly nasty hack to tell if the next node is supposed to be 
-    // unescaped text.
-    if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))
-    {
-      startNonEscaping();
-    }
-    else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING))
-    {
-      endNonEscaping();
-    }
-    else
-    {
-      writeParentTagEnd();
-
-      if (shouldIndent())
-        indent(m_currentIndent);
-
-      this.accum("<?" + target);
-
-      if (data.length() > 0 &&!Character.isSpaceChar(data.charAt(0)))
-        this.accum(" ");
-
-      this.accum(data + ">");  // different from XML
-      
-      // Always output a newline char if not inside of an 
-      // element. The whitespace is not significant in that
-      // case.
-      if (m_elemStack.isEmpty())
-         outputLineSep();
-
-      m_startNewLine = true;
-    }
-  }
-
-  /**
-   * Receive notivication of a entityReference.
-   *
-   * @param name non-null reference to entity name string.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void entityReference(String name) throws org.xml.sax.SAXException
-  {
-
-    this.accum("&");
-    this.accum(name);
-    this.accum(";");
-  }
-}
-
diff --git a/src/org/apache/xalan/serialize/SerializerToText.java b/src/org/apache/xalan/serialize/SerializerToText.java
deleted file mode 100644
index 0d6beef..0000000
--- a/src/org/apache/xalan/serialize/SerializerToText.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import org.xml.sax.*;
-
-import java.util.*;
-
-import java.io.*;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.templates.OutputProperties;
-
-import javax.xml.transform.OutputKeys;
-
-/**
- * <meta name="usage" content="general"/>
- * This class takes SAX events (in addition to some extra events
- * that SAX doesn't handle yet) and produces simple text only.
- */
-public class SerializerToText extends SerializerToXML
-{
-
-  /**
-   * Default constructor.
-   */
-  public SerializerToText()
-  {
-    super();
-  }
-
-   /**
-   * Receive an object for locating the origin of SAX document events.
-   *
-   * <p>SAX parsers are strongly encouraged (though not absolutely
-   * required) to supply a locator: if it does so, it must supply
-   * the locator to the application by invoking this method before
-   * invoking any of the other methods in the DocumentHandler
-   * interface.</p>
-   *
-   * <p>The locator allows the application to determine the end
-   * position of any document-related event, even if the parser is
-   * not reporting an error.  Typically, the application will
-   * use this information for reporting its own errors (such as
-   * character content that does not match an application's
-   * business rules).  The information returned by the locator
-   * is probably not sufficient for use with a search engine.</p>
-   *
-   * <p>Note that the locator will return correct information only
-   * during the invocation of the events in this interface.  The
-   * application should not attempt to use it at any other time.</p>
-   *
-   * @param locator An object that can return the location of
-   *                any SAX document event.
-   * @see org.xml.sax.Locator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of the beginning of a document.
-   *
-   * <p>The SAX parser will invoke this method only once, before any
-   * other methods in this interface or in DTDHandler (except for
-   * setDocumentLocator).</p>
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startDocument() throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of the end of a document.
-   *
-   * <p>The SAX parser will invoke this method only once, and it will
-   * be the last method invoked during the parse.  The parser shall
-   * not invoke this method until it has either abandoned parsing
-   * (because of an unrecoverable error) or reached the end of
-   * input.</p>
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endDocument() throws org.xml.sax.SAXException
-  {
-    flushWriter();
-  }
-
-  /**
-   * Receive notification of the beginning of an element.
-   *
-   * <p>The Parser will invoke this method at the beginning of every
-   * element in the XML document; there will be a corresponding
-   * endElement() event for every startElement() event (even when the
-   * element is empty). All of the element's content will be
-   * reported, in order, before the corresponding endElement()
-   * event.</p>
-   *
-   * <p>If the element name has a namespace prefix, the prefix will
-   * still be attached.  Note that the attribute list provided will
-   * contain only attributes with explicit values (specified or
-   * defaulted): #IMPLIED attributes will be omitted.</p>
-   *
-   *
-   * @param namespaceURI The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param name The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   * @param atts The attributes attached to the element, if any.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #endElement
-   * @see org.xml.sax.AttributeList
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startElement(
-          String namespaceURI, String localName, String name, Attributes atts)
-            throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * <p>The SAX parser will invoke this method at the end of every
-   * element in the XML document; there will be a corresponding
-   * startElement() event for every endElement() event (even when the
-   * element is empty).</p>
-   *
-   * <p>If the element name has a namespace prefix, the prefix will
-   * still be attached to the name.</p>
-   *
-   *
-   * @param namespaceURI The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param name The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   * @param name The element type name
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endElement(String namespaceURI, String localName, String name)
-          throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of character data.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   */
-  public void characters(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    // this.accum(ch, start, length);
-    try
-    {
-      writeNormalizedChars(ch, start, length, false);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-    this.flushWriter();
-
-    // flushWriter();
-  }
-
-  /**
-   * If available, when the disable-output-escaping attribute is used,
-   * output raw text without escaping.
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void charactersRaw(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    // accum(ch, start, length);
-    try
-    {
-      writeNormalizedChars(ch, start, length, false);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-    flushWriter();
-
-    // flushWriter();
-  }
-  
-  /**
-   * Once a surrogate has been detected, write the pair as a single
-   * character reference.
-   *
-   * @param c the first part of the surrogate.
-   * @param ch Character array.
-   * @param i position Where the surrogate was detected.
-   * @param end The end index of the significant characters.
-   * @return i+1.
-   * @throws IOException
-   * @throws org.xml.sax.SAXException if invalid UTF-16 surrogate detected.
-   */
-  protected int writeUTF16Surrogate(char c, char ch[], int i, int end)
-          throws IOException, org.xml.sax.SAXException
-  {
-
-    // UTF-16 surrogate
-    int surrogateValue = getURF16SurrogateValue(c, ch, i, end);
-
-    i++;
-
-    // m_writer.write('x');
-    m_writer.write(surrogateValue);
-
-    return i;
-  }
-
-  
-  /**
-   * Normalize the characters, but don't escape.  Different from 
-   * SerializerToXML#writeNormalizedChars because it does not attempt to do 
-   * XML escaping at all.
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @param isCData true if a CDATA block should be built around the characters.
-   *
-   * @throws IOException
-   * @throws org.xml.sax.SAXException
-   */
-  void writeNormalizedChars(char ch[], int start, int length, boolean isCData)
-          throws IOException, org.xml.sax.SAXException
-  {
-
-    int end = start + length;
-
-    for (int i = start; i < end; i++)
-    {
-      char c = ch[i];
-
-      if (CharInfo.S_LINEFEED == c)
-      {
-        m_writer.write(m_lineSep, 0, m_lineSepLen);
-      }
-      else if (isCData && (c > m_maxCharacter))
-      {
-        if (i != 0)
-          m_writer.write("]]>");
-
-        // This needs to go into a function... 
-        if (isUTF16Surrogate(c))
-        {
-          i = writeUTF16Surrogate(c, ch, i, end);
-        }
-        else
-        {
-          m_writer.write(c);
-        }
-
-        if ((i != 0) && (i < (end - 1)))
-          m_writer.write("<![CDATA[");
-      }
-      else if (isCData
-               && ((i < (end - 2)) && (']' == c) && (']' == ch[i + 1])
-                   && ('>' == ch[i + 2])))
-      {
-        m_writer.write("]]]]><![CDATA[>");
-
-        i += 2;
-      }
-      else
-      {
-        if (c <= m_maxCharacter)
-        {
-          m_writer.write(c);
-        }
-
-        // This needs to go into a function... 
-        else if (isUTF16Surrogate(c))
-        {
-          i = writeUTF16Surrogate(c, ch, i, end);
-        }
-        else
-        {
-          m_writer.write(c);
-        }
-      }
-    }
-  }
-
-  /**
-   * Receive notification of cdata.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   */
-  public void cdata(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    // accum(ch, start, length);
-    try
-    {
-      writeNormalizedChars(ch, start, length, false);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-    flushWriter();
-
-    // flushWriter();
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   * <p>Validating Parsers must use this method to report each chunk
-   * of ignorable whitespace (see the W3C XML 1.0 recommendation,
-   * section 2.10): non-validating parsers may also use this method
-   * if they are capable of parsing and using content models.</p>
-   *
-   * <p>SAX parsers may return all contiguous whitespace in a single
-   * chunk, or they may split it into several chunks; however, all of
-   * the characters in any single event must come from the same
-   * external entity, so that the Locator provides useful
-   * information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #characters
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      writeNormalizedChars(ch, start, length, false);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-    flushWriter();
-  }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * <p>The Parser will invoke this method once for each processing
-   * instruction found: note that processing instructions may occur
-   * before or after the main document element.</p>
-   *
-   * <p>A SAX parser should never report an XML declaration (XML 1.0,
-   * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
-   * using this method.</p>
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *        none was supplied.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Called when a Comment is to be constructed.
-   * @param   data  The comment data.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void comment(String data) throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notivication of a entityReference.
-   *
-   * @param name non-null reference to the name of the entity.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void entityReference(String name) throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-}
diff --git a/src/org/apache/xalan/serialize/SerializerToXML.java b/src/org/apache/xalan/serialize/SerializerToXML.java
deleted file mode 100644
index 99f96c8..0000000
--- a/src/org/apache/xalan/serialize/SerializerToXML.java
+++ /dev/null
@@ -1,2478 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.Writer;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.IOException;
-
-import java.util.Enumeration;
-import java.util.Stack;
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.BitSet;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ext.DeclHandler;
-
-import org.w3c.dom.Node;
-
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.DOMSerializer;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.templates.OutputProperties;
-import org.apache.xml.utils.BoolStack;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.WrappedRuntimeException;
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.OutputKeys;
-
-/**
- * <meta name="usage" content="general"/>
- * SerializerToXML formats SAX-style events into XML.
- */
-public class SerializerToXML
-        implements ContentHandler, LexicalHandler, DeclHandler, Serializer,
-                   DOMSerializer
-{
-
-  /**
-   * The writer where the XML will be written.
-   */
-  protected Writer m_writer = null;
-
-  /** True if we control the buffer, and we should flush the output on endDocument. */
-  boolean m_shouldFlush = true;
-
-  //  /** The output stream where the result stream is written. */
-  //  protected OutputStream m_outputStream = System.out;
-
-  /**
-   * The character encoding.  Must match the encoding used for the printWriter.
-   */
-  protected String m_encoding = null;
-
-  /**
-   * Assume java encoding names are the same as the ISO encoding names if this is true.
-   */
-  static boolean javaEncodingIsISO = false;
-
-  /**
-   * Tells if we should write the XML declaration.
-   */
-  public boolean m_shouldNotWriteXMLHeader = false;
-
-  /**
-   * Tells the XML version, for writing out to the XML decl.
-   */
-  public String m_version = null;
-
-  /**
-   * A stack of Boolean objects that tell if the given element
-   * has children.
-   */
-  protected BoolStack m_elemStack = new BoolStack();
-
-  /** Stack to keep track of disabling output escaping. */
-  protected BoolStack m_disableOutputEscapingStates = new BoolStack();
-
-  /** True will be pushed, if characters should be in CDATA section blocks. */
-  protected BoolStack m_cdataSectionStates = new BoolStack();
-
-  /** List of QNames obtained from the xsl:output properties. */
-  protected Vector m_cdataSectionNames = null;
-
-  /** True if the current characters should be in CDATA blocks. */
-  protected boolean m_inCData = false;
-
-  /**
-   * Tell if the character escaping should be disabled for the current state.
-   *
-   * @return true if the character escaping should be disabled.
-   */
-  protected boolean isEscapingDisabled()
-  {
-    return m_disableOutputEscapingStates.peekOrFalse();
-  }
-
-  /**
-   * Tell if the characters in the current state should be put in
-   * cdata section blocks.
-   *
-   * @return true if the characters in the current state should be put in
-   * cdata section blocks.
-   */
-  protected boolean isCDataSection()
-  {
-    return m_inCData || m_cdataSectionStates.peekOrFalse();
-  }
-
-  /**
-   * Use the system line seperator to write line breaks.
-   */
-  protected final char[] m_lineSep =
-    System.getProperty("line.separator").toCharArray();
-
-  /**
-   * The length of the line seperator, since the write is done
-   * one character at a time.
-   */
-  protected final int m_lineSepLen = m_lineSep.length;
-
-  /**
-   * Output a system-dependent line break.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected final void outputLineSep() throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      m_writer.write(m_lineSep, 0, m_lineSepLen);
-    }
-    catch (IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * State flag to tell if preservation of whitespace
-   * is important.
-   */
-  protected boolean m_ispreserve = false;
-
-  /**
-   * Stack to keep track of whether or not we need to
-   * preserve whitespace.
-   */
-  protected BoolStack m_preserves = new BoolStack();
-
-  /**
-   * State flag that tells if the previous node processed
-   * was text, so we can tell if we should preserve whitespace.
-   */
-  protected boolean m_isprevtext = false;
-
-  /**
-   * Flag to tell if indenting (pretty-printing) is on.
-   */
-  protected boolean m_doIndent = false;
-
-  /**
-   * Flag to keep track of the indent amount.
-   */
-  protected int m_currentIndent = 0;
-
-  /**
-   * Amount to indent.
-   */
-  public int m_indentAmount = 0;
-
-  /**
-   * Current level of indent.
-   */
-  protected int level = 0;
-
-  /**
-   * Flag to signal that a newline should be added.
-   */
-  boolean m_startNewLine;
-
-  /**
-   * Flag to tell that we need to add the doctype decl,
-   * which we can't do until the first element is
-   * encountered.
-   */
-  boolean m_needToOutputDocTypeDecl = true;
-
-  /**
-   * The System ID for the doc type.
-   */
-  String m_doctypeSystem;
-
-  /**
-   * The public ID for the doc type.
-   */
-  String m_doctypePublic;
-
-  /**
-   * The standalone value for the doctype.
-   */
-  boolean m_standalone = false;
-
-  /**
-   * True if standalone was specified.
-   */
-  boolean m_standaloneWasSpecified = false;
-
-  /**
-   * The mediatype.  Not used right now.
-   */
-  String m_mediatype;
-
-  /**
-   * Tells if we're in an EntityRef event.
-   */
-  protected boolean m_inEntityRef = false;
-
-  /**
-   * Tells if we're in an internal document type subset.
-   */
-  private boolean m_inDoctype = false;
-
-  /**
-   * Map that tells which XML characters should have special treatment, and it
-   *  provides character to entity name lookup.
-   */
-  protected static CharInfo m_xmlcharInfo =
-    new CharInfo(CharInfo.XML_ENTITIES_RESOURCE);
-
-  /**
-   * Map that tells which characters should have special treatment, and it
-   *  provides character to entity name lookup.
-   */
-  protected CharInfo m_charInfo;
-
-  /** Table of user-specified char infos. */
-  private static Hashtable m_charInfos = null;
-
-  /**
-   * Flag to quickly tell if the encoding is UTF8.
-   */
-  boolean m_isUTF8;
-
-  /**
-   * The maximum character size before we have to resort
-   * to escaping.
-   */
-  protected int m_maxCharacter = Encodings.getLastPrintable();
-
-  /**
-   * Add space before '/>' for XHTML.
-   */
-  public boolean m_spaceBeforeClose = false;
-
-  /** The xsl:output properties. */
-  protected Properties m_format;
-
-  /** Indicate whether running in Debug mode */
-  private static final boolean DEBUG = false;
-
-  /**
-   * Default constructor.
-   */
-  public SerializerToXML()
-  {
-    m_charInfo = m_xmlcharInfo;
-  }
-
-  /**
-   * Copy properties from another SerializerToXML.
-   *
-   * @param xmlListener non-null reference to a SerializerToXML object.
-   */
-  public void CopyFrom(SerializerToXML xmlListener)
-  {
-
-    m_writer = xmlListener.m_writer;
-
-    // m_outputStream = xmlListener.m_outputStream;
-    m_encoding = xmlListener.m_encoding;
-    javaEncodingIsISO = xmlListener.javaEncodingIsISO;
-    m_shouldNotWriteXMLHeader = xmlListener.m_shouldNotWriteXMLHeader;
-
-    // m_shouldNotWriteXMLHeader = xmlListener.m_shouldNotWriteXMLHeader;
-    m_elemStack = xmlListener.m_elemStack;
-
-    // m_lineSep = xmlListener.m_lineSep;
-    // m_lineSepLen = xmlListener.m_lineSepLen;
-    m_ispreserve = xmlListener.m_ispreserve;
-    m_preserves = xmlListener.m_preserves;
-    m_isprevtext = xmlListener.m_isprevtext;
-    m_doIndent = xmlListener.m_doIndent;
-    m_currentIndent = xmlListener.m_currentIndent;
-    m_indentAmount = xmlListener.m_indentAmount;
-    level = xmlListener.level;
-    m_startNewLine = xmlListener.m_startNewLine;
-    m_needToOutputDocTypeDecl = xmlListener.m_needToOutputDocTypeDecl;
-    m_doctypeSystem = xmlListener.m_doctypeSystem;
-    m_doctypePublic = xmlListener.m_doctypePublic;
-    m_standalone = xmlListener.m_standalone;
-    m_mediatype = xmlListener.m_mediatype;
-    m_maxCharacter = xmlListener.m_maxCharacter;
-    m_spaceBeforeClose = xmlListener.m_spaceBeforeClose;
-    m_inCData = xmlListener.m_inCData;
-
-    // m_pos = xmlListener.m_pos;
-    m_pos = 0;
-  }
-
-  /**
-   * Initialize the serializer with the specified writer and output format.
-   * Must be called before calling any of the serialize methods.
-   *
-   * @param writer The writer to use
-   * @param format The output format
-   */
-  public synchronized void init(Writer writer, Properties format)
-  {
-    init(writer, format, false);
-  }
-
-  /**
-   * Initialize the serializer with the specified writer and output format.
-   * Must be called before calling any of the serialize methods.
-   *
-   * @param writer The writer to use
-   * @param format The output format
-   * @param shouldFlush True if the writer should be flushed at EndDocument.
-   */
-  private synchronized void init(Writer writer, Properties format,
-                                 boolean shouldFlush)
-  {
-
-    m_shouldFlush = shouldFlush;
-    m_writer = writer;
-    m_format = format;
-    m_cdataSectionNames =
-      OutputProperties.getQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS,
-                                          format);
-    m_indentAmount =
-      OutputProperties.getIntProperty(OutputProperties.S_KEY_INDENT_AMOUNT,
-                                      format);
-    m_doIndent = OutputProperties.getBooleanProperty(OutputKeys.INDENT,
-            format);
-    m_shouldNotWriteXMLHeader =
-      OutputProperties.getBooleanProperty(OutputKeys.OMIT_XML_DECLARATION,
-                                          format);
-    m_doctypeSystem = format.getProperty(OutputKeys.DOCTYPE_SYSTEM);
-    m_doctypePublic = format.getProperty(OutputKeys.DOCTYPE_PUBLIC);
-    m_standaloneWasSpecified = (null != format.get(OutputKeys.STANDALONE));
-    m_standalone = OutputProperties.getBooleanProperty(OutputKeys.STANDALONE,
-            format);
-    m_mediatype = format.getProperty(OutputKeys.MEDIA_TYPE);
-
-    if (null != m_doctypePublic)
-    {
-      if (m_doctypePublic.startsWith("-//W3C//DTD XHTML"))
-        m_spaceBeforeClose = true;
-    }
-
-    // initCharsMap();
-    if (null == m_encoding)
-      m_encoding =
-        Encodings.getMimeEncoding(format.getProperty(OutputKeys.ENCODING));
-
-    m_isUTF8 = m_encoding.equals(Encodings.DEFAULT_MIME_ENCODING);
-    m_maxCharacter = Encodings.getLastPrintable(m_encoding);
-
-    // Access this only from the Hashtable level... we don't want to 
-    // get default properties.
-    String entitiesFileName =
-      (String) format.get(OutputProperties.S_KEY_ENTITIES);
-
-    if (null != entitiesFileName)
-    {
-      try
-      {
-        m_charInfo = null;
-
-        if (null == m_charInfos)
-        {
-          synchronized (m_xmlcharInfo)
-          {
-            if (null == m_charInfos)  // secondary check
-              m_charInfos = new Hashtable();
-          }
-        }
-        else
-        {
-          m_charInfo = (CharInfo) m_charInfos.get(entitiesFileName);
-        }
-
-        if (null == m_charInfo)
-        {
-          String absoluteEntitiesFileName;
-
-          if (entitiesFileName.indexOf(':') < 0)
-          {
-            absoluteEntitiesFileName =
-              SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
-          }
-          else
-          {
-            absoluteEntitiesFileName =
-              SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
-          }
-
-          m_charInfo = new CharInfo(absoluteEntitiesFileName);
-
-          m_charInfos.put(entitiesFileName, m_charInfo);
-        }
-      }
-      catch (javax.xml.transform.TransformerException te)
-      {
-        throw new org.apache.xml.utils.WrappedRuntimeException(te);
-      }
-    }
-  }
-
-  /**
-   * Initialize the serializer with the specified output stream and output format.
-   * Must be called before calling any of the serialize methods.
-   *
-   * @param output The output stream to use
-   * @param format The output format
-   * @throws UnsupportedEncodingException The encoding specified
-   *   in the output format is not supported
-   */
-  public synchronized void init(OutputStream output, Properties format)
-          throws UnsupportedEncodingException
-  {
-
-    if (null == format)
-    {
-      OutputProperties op = new OutputProperties(Method.XML);
-
-      format = op.getProperties();
-    }
-
-    m_encoding =
-      Encodings.getMimeEncoding(format.getProperty(OutputKeys.ENCODING));
-
-    if (m_encoding.equalsIgnoreCase("UTF-8"))
-    {
-      if(output instanceof java.io.BufferedOutputStream)
-      {
-        init(new WriterToUTF8(output), format, true);
-      }
-      else if(output instanceof java.io.FileOutputStream)
-      {
-        init(new WriterToUTF8Buffered(output), format, true);
-      }
-      else
-      {
-        // Not sure what to do in this case.  I'm going to be conservative 
-        // and not buffer.
-        init(new WriterToUTF8(output), format, true);
-      }
-      
-    }
-    else if (m_encoding.equals("WINDOWS-1250")
-             || m_encoding.equals("US-ASCII") || m_encoding.equals("ASCII"))
-    {
-      init(new WriterToASCI(output), format, true);
-    }
-    else
-    {
-      Writer osw;
-
-      try
-      {
-        osw = Encodings.getWriter(output, m_encoding);
-      }
-      catch (UnsupportedEncodingException uee)
-      {
-        System.out.println("Warning: encoding \"" + m_encoding
-                           + "\" not supported" + ", using "
-                           + Encodings.DEFAULT_MIME_ENCODING);
-
-        m_encoding = Encodings.DEFAULT_MIME_ENCODING;
-        osw = Encodings.getWriter(output, m_encoding);
-      }
-
-      m_maxCharacter = Encodings.getLastPrintable(m_encoding);
-
-      init(osw, format, true);
-    }
-    
-  }
-
-  /**
-   * Receive an object for locating the origin of SAX document events.
-   *
-   * @param locator An object that can return the location of
-   *                any SAX document event.
-   * @see org.xml.sax.Locator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-
-    // I don't do anything with this yet.
-  }
-
-  /**
-   * Output the doc type declaration.
-   *
-   * @param name non-null reference to document type name.
-   * NEEDSDOC @param closeDecl
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  void outputDocTypeDecl(String name, boolean closeDecl)
-          throws org.xml.sax.SAXException
-  {
-    try
-    {
-      final Writer writer = m_writer;
-  
-      writer.write("<!DOCTYPE ");
-      writer.write(name);
-  
-      if (null != m_doctypePublic)
-      {
-        writer.write(" PUBLIC \"");
-        writer.write(m_doctypePublic);
-        writer.write('\"');
-      }
-  
-      if (null != m_doctypeSystem)
-      {
-        if (null == m_doctypePublic)
-          writer.write(" SYSTEM \"");
-        else
-          writer.write(" \"");
-  
-        writer.write(m_doctypeSystem);
-  
-        if (closeDecl)
-        {
-          writer.write("\">");
-          writer.write(m_lineSep, 0, m_lineSepLen);;
-        }
-        else
-          writer.write('\"');
-      }
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Output the doc type declaration.
-   *
-   * @param name non-null reference to document type name.
-   * NEEDSDOC @param value
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  void outputEntityDecl(String name, String value)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      final Writer writer = m_writer;
-      writer.write("<!ENTITY ");
-      writer.write(name);
-      writer.write(" \"");
-      writer.write(value);
-      writer.write("\">");
-      writer.write(m_lineSep, 0, m_lineSepLen);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Receive notification of the beginning of a document.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startDocument() throws org.xml.sax.SAXException
-  {
-
-    if (m_inEntityRef)
-      return;
-
-    m_needToOutputDocTypeDecl = true;
-    m_startNewLine = false;
-
-    if (m_shouldNotWriteXMLHeader == false)
-    {
-      String encoding = Encodings.getMimeEncoding(m_encoding);
-      String version = (null == m_version) ? "1.0" : m_version;
-      String standalone;
-
-      if (m_standaloneWasSpecified)
-      {
-        standalone = " standalone=\"" + (m_standalone ? "yes" : "no") + "\"";
-      }
-      else
-      {
-        standalone = "";
-      }
-
-      try
-      {
-        final Writer writer = m_writer;
-        writer.write("<?xml version=\"");
-        writer.write(version);
-        writer.write("\" encoding=\"");
-        writer.write(encoding);
-        writer.write('\"');
-        writer.write(standalone);
-        writer.write("?>");
-        writer.write(m_lineSep, 0, m_lineSepLen);
-      }
-      catch(IOException ioe)
-      {
-        throw new SAXException(ioe);
-      }
-    }
-  }
-
-  /**
-   * Receive notification of the end of a document.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endDocument() throws org.xml.sax.SAXException
-  {
-
-    if (m_doIndent &&!m_isprevtext)
-    {
-      outputLineSep();
-    }
-
-    flushWriter();
-  }
-
-  /**
-   * Report the start of DTD declarations, if any.
-   *
-   * Any declarations are assumed to be in the internal subset
-   * unless otherwise indicated.
-   *
-   * @param name The document type name.
-   * @param publicId The declared public identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @param systemId The declared system identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @throws org.xml.sax.SAXException The application may raise an
-   *            exception.
-   * @see #endDTD
-   * @see #startEntity
-   */
-  public void startDTD(String name, String publicId, String systemId)
-          throws org.xml.sax.SAXException
-  {
-
-    m_doctypeSystem = systemId;
-    m_doctypePublic = publicId;
-
-    if ((true == m_needToOutputDocTypeDecl))  // && (null != m_doctypeSystem))
-    {
-      outputDocTypeDecl(name, false);
-    }
-
-    m_needToOutputDocTypeDecl = false;
-    m_inDoctype = true;
-  }
-
-  /**
-   * Report the end of DTD declarations.
-   *
-   * @throws org.xml.sax.SAXException The application may raise an exception.
-   * @see #startDTD
-   */
-  public void endDTD() throws org.xml.sax.SAXException
-  {
-    try
-    {
-      if (!m_inDoctype)
-        m_writer.write("]>");
-      else
-      {
-        m_writer.write('>');
-      }
-  
-      m_writer.write(m_lineSep, 0, m_lineSepLen);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-
-    // Do nothing for now.
-  }
-
-  /**
-   * Begin the scope of a prefix-URI Namespace mapping.
-   * @see org.xml.sax.ContentHandler#startPrefixMapping
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI the prefix is mapped to.
-   * @throws org.xml.sax.SAXException The client may throw
-   *            an exception during processing.
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws org.xml.sax.SAXException{}
-
-  /**
-   * End the scope of a prefix-URI Namespace mapping.
-   * @see org.xml.sax.ContentHandler#endPrefixMapping
-   *
-   * @param prefix The prefix that was being mapping.
-   * @throws org.xml.sax.SAXException The client may throw
-   *            an exception during processing.
-   */
-  public void endPrefixMapping(String prefix)
-          throws org.xml.sax.SAXException{}
-
-  /**
-   * Tell if two strings are equal, without worry if the first string is null.
-   *
-   * @param p String reference, which may be null.
-   * @param t String reference, which may be null.
-   *
-   * @return true if strings are equal.
-   */
-  protected static final boolean subPartMatch(String p, String t)
-  {
-    return (p == t) || ((null != p) && (p.equals(t)));
-  }
-
-  /**
-   * Push a boolean state based on if the name of the element
-   * is found in the list of qnames.  A state is always pushed,
-   * one way or the other.
-   *
-   * @param namespaceURI Should be a non-null reference to the namespace URL
-   *        of the element that owns the state, or empty string.
-   * @param localName Should be a non-null reference to the local name
-   *        of the element that owns the state.
-   * @param qnames Vector of qualified names of elements, or null.
-   * @param state The stack where the state should be pushed.
-   */
-  protected void pushState(String namespaceURI, String localName,
-                           Vector qnames, BoolStack state)
-  {
-
-    boolean b;
-
-    if (null != qnames)
-    {
-      b = false;
-
-      if ((null != namespaceURI) && namespaceURI.length() == 0)
-        namespaceURI = null;
-
-      int nElems = qnames.size();
-
-      for (int i = 0; i < nElems; i++)
-      {
-        QName q = (QName) qnames.elementAt(i);
-
-        if (q.getLocalName().equals(localName)
-                && subPartMatch(namespaceURI, q.getNamespaceURI()))
-        {
-          b = true;
-
-          break;
-        }
-      }
-    }
-    else
-    {
-      b = state.peekOrFalse();
-    }
-
-    state.push(b);
-  }
-
-  /**
-   * Receive notification of the beginning of an element.
-   *
-   *
-   * @param namespaceURI The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param name The element type name.
-   * @param atts The attributes attached to the element, if any.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startElement
-   * @see org.xml.sax.ContentHandler#endElement
-   * @see org.xml.sax.AttributeList
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startElement(
-          String namespaceURI, String localName, String name, Attributes atts)
-            throws org.xml.sax.SAXException
-  {
-
-    if (DEBUG)
-    {
-      System.out.println("SerializerToXML - startElement: " + namespaceURI
-                         + ", " + localName);
-
-      int n = atts.getLength();
-
-      for (int i = 0; i < n; i++)
-      {
-        System.out.println("atts[" + i + "]: " + atts.getQName(i) + " = "
-                           + atts.getValue(i));
-      }
-
-      if (null == namespaceURI)
-      {
-        (new RuntimeException(localName
-                              + " has a null namespace!")).printStackTrace();
-      }
-    }
-
-    if (m_inEntityRef)
-      return;
-
-    if ((true == m_needToOutputDocTypeDecl) && (null != m_doctypeSystem))
-    {
-      outputDocTypeDecl(name, true);
-    }
-
-    m_needToOutputDocTypeDecl = false;
-
-    writeParentTagEnd();
-    pushState(namespaceURI, localName, m_cdataSectionNames,
-              m_cdataSectionStates);
-
-    // pushState(namespaceURI, localName, m_format.getNonEscapingElements(),
-    //          m_disableOutputEscapingStates);
-    m_ispreserve = false;
-
-    //  System.out.println(name+": m_doIndent = "+m_doIndent+", m_ispreserve = "+m_ispreserve+", m_isprevtext = "+m_isprevtext);
-    if (shouldIndent() && m_startNewLine)
-    {
-      indent(m_currentIndent);
-    }
-
-    m_startNewLine = true;
-
-    try
-    {
-      m_writer.write('<');
-      m_writer.write(name);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-
-    int nAttrs = atts.getLength();
-
-    for (int i = 0; i < nAttrs; i++)
-    {
-      processAttribute(atts.getQName(i), atts.getValue(i));
-    }
-
-    // Flag the current element as not yet having any children.
-    openElementForChildren();
-
-    m_currentIndent += m_indentAmount;
-    m_isprevtext = false;
-  }
-
-  /**
-   * Check to see if a parent's ">" has been written, and, if
-   * it has not, write it.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void writeParentTagEnd() throws org.xml.sax.SAXException
-  {
-
-    // See if the parent element has already been flagged as having children.
-    if (!m_elemStack.peekOrTrue())
-    {
-      try
-      {
-        m_writer.write('>');
-      }
-      catch(IOException ioe)
-      {
-        throw new SAXException(ioe);
-      }
-
-      m_isprevtext = false;
-
-      m_elemStack.setTop(true);
-      m_preserves.push(m_ispreserve);
-    }
-  }
-
-  /**
-   * Flag the current element as not yet having any
-   * children.
-   */
-  protected void openElementForChildren()
-  {
-
-    // Flag the current element as not yet having any children.
-    m_elemStack.push(false);
-  }
-
-  /**
-   * Tell if child nodes have been added to the current
-   * element.  Must be called in balance with openElementForChildren().
-   *
-   * @return true if child nodes were added.
-   */
-  protected boolean childNodesWereAdded()
-  {
-    return m_elemStack.isEmpty() ? false : m_elemStack.pop();
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   *
-   * @param namespaceURI The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param name The element type name
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endElement(String namespaceURI, String localName, String name)
-          throws org.xml.sax.SAXException
-  {
-
-    if (m_inEntityRef)
-      return;
-
-    m_currentIndent -= m_indentAmount;
-
-    boolean hasChildNodes = childNodesWereAdded();
-
-    try
-    {
-      final Writer writer = m_writer;
-      if (hasChildNodes)
-      {
-        if (shouldIndent())
-          indent(m_currentIndent);
-  
-        writer.write('<');
-        writer.write('/');
-        writer.write(name);
-        writer.write('>');
-      }
-      else
-      {
-        if (m_spaceBeforeClose)
-          writer.write(" />");
-        else
-          writer.write("/>");
-      }
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-
-    if (hasChildNodes)
-    {
-      m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop();
-    }
-
-    m_isprevtext = false;
-
-    // m_disableOutputEscapingStates.pop();
-    m_cdataSectionStates.pop();
-  }
-
-  /**
-   * Process an attribute.
-   * @param   name   The name of the attribute.
-   * @param   value   The value of the attribute.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void processAttribute(String name, String value)
-          throws org.xml.sax.SAXException
-  {
-    try
-    {
-      final Writer writer = m_writer;
-      writer.write(' ');
-      writer.write(name);
-      writer.write("=\"");
-      writeAttrString(value, m_encoding);
-      writer.write('\"');
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Starts an un-escaping section. All characters printed within an
-   * un-escaping section are printed as is, without escaping special
-   * characters into entity references. Only XML and HTML serializers
-   * need to support this method.
-   * <p>
-   * The contents of the un-escaping section will be delivered through
-   * the regular <tt>characters</tt> event.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startNonEscaping() throws org.xml.sax.SAXException
-  {
-    m_disableOutputEscapingStates.push(true);
-  }
-
-  /**
-   * Ends an un-escaping section.
-   *
-   * @see #startNonEscaping
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endNonEscaping() throws org.xml.sax.SAXException
-  {
-    m_disableOutputEscapingStates.pop();
-  }
-
-  /**
-   * Starts a whitespace preserving section. All characters printed
-   * within a preserving section are printed without indentation and
-   * without consolidating multiple spaces. This is equivalent to
-   * the <tt>xml:space=&quot;preserve&quot;</tt> attribute. Only XML
-   * and HTML serializers need to support this method.
-   * <p>
-   * The contents of the whitespace preserving section will be delivered
-   * through the regular <tt>characters</tt> event.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startPreserving() throws org.xml.sax.SAXException
-  {
-
-    // Not sure this is really what we want.  -sb
-    m_preserves.push(true);
-
-    m_ispreserve = true;
-  }
-
-  /**
-   * Ends a whitespace preserving section.
-   *
-   * @see #startPreserving
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endPreserving() throws org.xml.sax.SAXException
-  {
-
-    // Not sure this is really what we want.  -sb
-    m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop();
-  }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *        none was supplied.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-    if (m_inEntityRef)
-      return;
-
-    if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))
-    {
-      startNonEscaping();
-    }
-    else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING))
-    {
-      endNonEscaping();
-    }
-    else
-    {
-      try
-      {
-        final Writer writer = m_writer;
-        writeParentTagEnd();
-  
-        if (shouldIndent())
-          indent(m_currentIndent);
-  
-        writer.write('<');
-        writer.write('?');
-        writer.write(target);
-  
-        if (data.length() > 0 &&!Character.isSpaceChar(data.charAt(0)))
-          writer.write(' ');
-  
-        int indexOfQLT = data.indexOf("?>");
-  
-        if (indexOfQLT >= 0)
-        {
-  
-          // See XSLT spec on error recovery of "?>" in PIs.
-          if (indexOfQLT > 0)
-          {
-            writer.write(data.substring(0, indexOfQLT));
-          }
-  
-          writer.write("? >");  // add space between.
-  
-          if ((indexOfQLT + 2) < data.length())
-          {
-            writer.write(data.substring(indexOfQLT + 2));
-          }
-        }
-        else
-        {
-          writer.write(data);
-        }
-  
-        writer.write('?');
-        writer.write('>');
-  
-        // Always output a newline char if not inside of an 
-        // element. The whitespace is not significant in that
-        // case.
-        if (m_elemStack.isEmpty())
-          writer.write(m_lineSep, 0, m_lineSepLen);
-  
-        m_startNewLine = true;
-      }
-      catch(IOException ioe)
-      {
-        throw new SAXException(ioe);
-      }
-    }
-  }
-
-  /**
-   * Report an XML comment anywhere in the document.
-   *
-   * This callback will be used for comments inside or outside the
-   * document element, including comments in the external DTD
-   * subset (if read).
-   *
-   * @param ch An array holding the characters in the comment.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   * @throws org.xml.sax.SAXException The application may raise an exception.
-   */
-  public void comment(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if (m_inEntityRef)
-      return;
-
-    writeParentTagEnd();
-
-    if (shouldIndent())
-      indent(m_currentIndent);
-
-    try
-    {
-      final Writer writer = m_writer;
-      writer.write("<!--");
-      writer.write(ch, start, length);
-      writer.write("-->");
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-
-    m_startNewLine = true;
-  }
-
-  /**
-   * Report the start of a CDATA section.
-   *
-   * @throws org.xml.sax.SAXException The application may raise an exception.
-   * @see #endCDATA
-   */
-  public void startCDATA() throws org.xml.sax.SAXException
-  {
-    m_inCData = true;
-  }
-
-  /**
-   * Report the end of a CDATA section.
-   *
-   * @throws org.xml.sax.SAXException The application may raise an exception.
-   * @see #startCDATA
-   */
-  public void endCDATA() throws org.xml.sax.SAXException
-  {
-    m_inCData = false;
-  }
-
-  /**
-   * Receive notification of cdata.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void cdata(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      writeParentTagEnd();
-
-      m_ispreserve = true;
-
-      if (shouldIndent())
-        indent(m_currentIndent);
-
-      boolean writeCDataBrackets = (((length >= 1)
-                                     && (ch[start] <= m_maxCharacter)));
-
-      if (writeCDataBrackets)
-      {
-        m_writer.write("<![CDATA[");
-      }
-
-      // m_writer.write(ch, start, length);
-      if (isEscapingDisabled())
-      {
-        charactersRaw(ch, start, length);
-      }
-      else
-        writeNormalizedChars(ch, start, length, true);
-
-      if (writeCDataBrackets)
-      {
-        m_writer.write("]]>");
-      }
-    }
-    catch (IOException ioe)
-    {
-      throw new org.xml.sax.SAXException(
-        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_OIERROR, null),
-        ioe);  //"IO error", ioe);
-    }
-  }
-
-  /** The current position in the m_charBuf or m_byteBuf. */
-  protected int m_pos = 0;
-
-  /**
-   * Append a character to the buffer.
-   *
-   * @param b byte to be written to result stream.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected final void accum(char b) throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      m_writer.write(b);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-  
-  /**
-   * Append a character to the buffer.
-   *
-   * @param chars non-null reference to character array.
-   * @param start Start of characters to be written.
-   * @param length Number of characters to be written.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected final void accum(char chars[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      m_writer.write(chars, start, length);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-  /**
-   * Append a character to the buffer.
-   *
-   * @param s non-null reference to string to be written to the character buffer.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected final void accum(String s) throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      m_writer.write(s);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Flush the formatter's result stream.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public final void flushWriter() throws org.xml.sax.SAXException
-  {
-
-    if (null != m_writer)
-    {
-      try
-      {
-        if (m_writer instanceof WriterToUTF8Buffered)
-        {
-          if(m_shouldFlush)
-            ((WriterToUTF8Buffered) m_writer).flush();
-          else
-            ((WriterToUTF8Buffered) m_writer).flushBuffer();
-        }
-        if (m_writer instanceof WriterToUTF8)
-        {
-          if(m_shouldFlush)
-            m_writer.flush(); 
-        }
-        else if (m_writer instanceof WriterToASCI)
-        {
-          if(m_shouldFlush)
-            m_writer.flush();
-        }
-        else
-        {
-          // Flush always. 
-          // Not a great thing if the writer was created 
-          // by this class, but don't have a choice.
-          m_writer.flush(); 
-        }
-      }
-      catch (IOException ioe)
-      {
-        throw new org.xml.sax.SAXException(ioe);
-      }
-    }
-  }
-
-  /**
-   * Receive notification of character data.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param chars The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void characters(char chars[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-    if(0 == length)
-      return;
-
-    //    if (m_inEntityRef)
-    //      return;
-    //    else 
-    if (m_inCData || m_cdataSectionStates.peekOrFalse())
-    {
-      cdata(chars, start, length);
-
-      return;
-    }
-    
-    try
-    {
-      
-      if (m_disableOutputEscapingStates.peekOrFalse())
-      {
-        charactersRaw(chars, start, length);
-  
-        return;
-      }
-    
-      final Writer writer = m_writer;
-      if (!m_elemStack.peekOrTrue())
-      {
-        writer.write('>');
-  
-        m_isprevtext = false;
-  
-        m_elemStack.setTop(true);
-        m_preserves.push(m_ispreserve);
-      }
-  
-      int startClean = start;
-      int lengthClean = 0;
-  
-      // int pos = 0;
-      int end = start + length;
-      boolean checkWhite = true;
-      final int maxCharacter = m_maxCharacter;
-      final BitSet specialsMap = m_charInfo.m_specialsMap;
-  
-      for (int i = start; i < end; i++)
-      {
-        char ch = chars[i];
-  
-        if (checkWhite
-                && ((ch > 0x20)
-                    ||!((ch == 0x20) || (ch == 0x09) || (ch == 0xD)
-                        || (ch == 0xA))))
-        {
-          m_ispreserve = true;
-          checkWhite = false;
-        }
-  
-        if (((ch < maxCharacter) && (!specialsMap.get(ch))) || ('"' == ch))
-        {
-          lengthClean++;
-        }
-        else
-        {
-          if (lengthClean > 0)
-          {
-            writer.write(chars, startClean, lengthClean);
-  
-            lengthClean = 0;
-          }
-  
-          if (CharInfo.S_LINEFEED == ch)
-          {
-            writer.write(m_lineSep, 0, m_lineSepLen);
-  
-            startClean = i + 1;
-          }
-          else
-          {
-            startClean = accumDefaultEscape(ch, i, chars, end, false);
-            i = startClean - 1;
-          }
-        }
-      }
-  
-      if (lengthClean > 0)
-      {
-        writer.write(chars, startClean, lengthClean);
-      }
-    
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-
-
-    m_isprevtext = true;
-  }
-
-  /**
-   * If available, when the disable-output-escaping attribute is used,
-   * output raw text without escaping.
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void charactersRaw(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      if (m_inEntityRef)
-        return;
-  
-      writeParentTagEnd();
-  
-      m_ispreserve = true;
-  
-      m_writer.write(ch, start, length);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Return true if the character is the high member of a surrogate pair.
-   *
-   * NEEDSDOC @param c
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  static final boolean isUTF16Surrogate(char c)
-  {
-    return (c & 0xFC00) == 0xD800;
-  }
-
-  /**
-   * Once a surrogate has been detected, get the pair as a single
-   * integer value.
-   *
-   * @param c the first part of the surrogate.
-   * @param ch Character array.
-   * @param i position Where the surrogate was detected.
-   * @param end The end index of the significant characters.
-   * @return i+1.
-   * @throws org.xml.sax.SAXException if invalid UTF-16 surrogate detected.
-   */
-  int getURF16SurrogateValue(char c, char ch[], int i, int end)
-          throws org.xml.sax.SAXException
-  {
-
-    int next;
-
-    if (i + 1 >= end)
-    {
-      throw new org.xml.sax.SAXException(
-        XSLMessages.createXPATHMessage(
-          XPATHErrorResources.ER_INVALID_UTF16_SURROGATE,
-          new Object[]{ Integer.toHexString((int) c) }));  //"Invalid UTF-16 surrogate detected: "
-
-      //+Integer.toHexString((int)c)+ " ?");
-    }
-    else
-    {
-      next = ch[++i];
-
-      if (!(0xdc00 <= next && next < 0xe000))
-        throw new org.xml.sax.SAXException(
-          XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_INVALID_UTF16_SURROGATE,
-            new Object[]{
-              Integer.toHexString((int) c) + " "
-              + Integer.toHexString(next) }));  //"Invalid UTF-16 surrogate detected: "
-
-      //+Integer.toHexString((int)c)+" "+Integer.toHexString(next));
-      next = ((c - 0xd800) << 10) + next - 0xdc00 + 0x00010000;
-    }
-
-    return next;
-  }
-
-  /**
-   * Once a surrogate has been detected, write the pair as a single
-   * character reference.
-   *
-   * @param c the first part of the surrogate.
-   * @param ch Character array.
-   * @param i position Where the surrogate was detected.
-   * @param end The end index of the significant characters.
-   * @return i+1.
-   * @throws IOException
-   * @throws org.xml.sax.SAXException if invalid UTF-16 surrogate detected.
-   */
-  protected int writeUTF16Surrogate(char c, char ch[], int i, int end)
-          throws IOException, org.xml.sax.SAXException
-  {
-
-    // UTF-16 surrogate
-    int surrogateValue = getURF16SurrogateValue(c, ch, i, end);
-
-    i++;
-
-    m_writer.write('&');
-    m_writer.write('#');
-
-    // m_writer.write('x');
-    m_writer.write(Integer.toString(surrogateValue));
-    m_writer.write(';');
-
-    return i;
-  }
-
-  /**
-   * Normalize the characters, but don't escape.
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @param isCData true if a CDATA block should be built around the characters.
-   *
-   * @throws IOException
-   * @throws org.xml.sax.SAXException
-   */
-  void writeNormalizedChars(char ch[], int start, int length, boolean isCData)
-          throws IOException, org.xml.sax.SAXException
-  {
-
-    int end = start + length;
-
-    for (int i = start; i < end; i++)
-    {
-      char c = ch[i];
-
-      if (CharInfo.S_LINEFEED == c)
-      {
-        m_writer.write(m_lineSep, 0, m_lineSepLen);
-      }
-      else if (isCData && (c > m_maxCharacter))
-      {
-        if (i != 0)
-          m_writer.write("]]>");
-
-        // This needs to go into a function... 
-        if (isUTF16Surrogate(c))
-        {
-          i = writeUTF16Surrogate(c, ch, i, end);
-        }
-        else
-        {
-          m_writer.write("&#");
-
-          String intStr = Integer.toString((int) c);
-
-          m_writer.write(intStr);
-          m_writer.write(';');
-        }
-
-        if ((i != 0) && (i < (end - 1)))
-          m_writer.write("<![CDATA[");
-      }
-      else if (isCData
-               && ((i < (end - 2)) && (']' == c) && (']' == ch[i + 1])
-                   && ('>' == ch[i + 2])))
-      {
-        m_writer.write("]]]]><![CDATA[>");
-
-        i += 2;
-      }
-      else
-      {
-        if (c <= m_maxCharacter)
-        {
-          m_writer.write(c);
-        }
-
-        // This needs to go into a function... 
-        else if (isUTF16Surrogate(c))
-        {
-          i = writeUTF16Surrogate(c, ch, i, end);
-        }
-        else
-        {
-          m_writer.write("&#");
-
-          String intStr = Integer.toString((int) c);
-
-          m_writer.write(intStr);
-          m_writer.write(';');
-        }
-      }
-    }
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   * Not sure how to get this invoked quite yet.
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see #characters
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if (0 == length)
-      return;
-
-    characters(ch, start, length);
-  }
-
-  /**
-   * Receive notification of a skipped entity.
-   * @see org.xml.sax.ContentHandler#skippedEntity
-   *
-   * @param name The name of the skipped entity.  If it is a
-   *        parameter entity, the name will begin with '%', and if
-   *        it is the external DTD subset, it will be the string
-   *        "[dtd]".
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void skippedEntity(String name) throws org.xml.sax.SAXException
-  {
-
-    // TODO: Should handle
-  }
-
-  /**
-   * Report the beginning of an entity.
-   *
-   * The start and end of the document entity are not reported.
-   * The start and end of the external DTD subset are reported
-   * using the pseudo-name "[dtd]".  All other events must be
-   * properly nested within start/end entity events.
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @throws org.xml.sax.SAXException The application may raise an exception.
-   * @see #endEntity
-   * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
-   * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
-   */
-  public void startEntity(String name) throws org.xml.sax.SAXException
-  {
-    m_inEntityRef = true;
-  }
-
-  /**
-   * Report the end of an entity.
-   *
-   * @param name The name of the entity that is ending.
-   * @throws org.xml.sax.SAXException The application may raise an exception.
-   * @see #startEntity
-   */
-  public void endEntity(String name) throws org.xml.sax.SAXException
-  {
-    m_inEntityRef = false;
-  }
-
-  /**
-   * Receive notivication of a entityReference.
-   *
-   * @param name The name of the entity.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void entityReference(String name) throws org.xml.sax.SAXException
-  {
-
-    writeParentTagEnd();
-
-    if (shouldIndent())
-      indent(m_currentIndent);
-
-    try
-    {
-      final Writer writer = m_writer;
-      writer.write("&");
-      writer.write(name);
-      writer.write(";");
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-
-  }
-
-  // Implement DeclHandler
-
-  /**
-   *   Report an element type declaration.
-   *  
-   *   <p>The content model will consist of the string "EMPTY", the
-   *   string "ANY", or a parenthesised group, optionally followed
-   *   by an occurrence indicator.  The model will be normalized so
-   *   that all whitespace is removed,and will include the enclosing
-   *   parentheses.</p>
-   *  
-   *   @param name The element type name.
-   *   @param model The content model as a normalized string.
-   *   @exception SAXException The application may raise an exception.
-   */
-  public void elementDecl(String name, String model) throws SAXException
-  {
-    try
-    {
-      final Writer writer = m_writer;
-      if (m_inDoctype)
-      {
-        writer.write(" [");
-        writer.write(m_lineSep, 0, m_lineSepLen);
-  
-        m_inDoctype = false;
-      }
-  
-      writer.write("<!ELEMENT ");
-      writer.write(name);
-      writer.write(' ');
-      writer.write(model);
-      writer.write('>');
-      writer.write(m_lineSep, 0, m_lineSepLen);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /** NEEDSDOC Field m_elemName          */
-  private String m_elemName = "";
-
-  /**
-   * Report an attribute type declaration.
-   *
-   * <p>Only the effective (first) declaration for an attribute will
-   * be reported.  The type will be one of the strings "CDATA",
-   * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
-   * "ENTITIES", or "NOTATION", or a parenthesized token group with
-   * the separator "|" and all whitespace removed.</p>
-   *
-   * @param eName The name of the associated element.
-   * @param aName The name of the attribute.
-   * @param type A string representing the attribute type.
-   * @param valueDefault A string representing the attribute default
-   *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
-   *        none of these applies.
-   * @param value A string representing the attribute's default value,
-   *        or null if there is none.
-   * @exception SAXException The application may raise an exception.
-   */
-  public void attributeDecl(
-          String eName, String aName, String type, String valueDefault, String value)
-            throws SAXException
-  {
-
-    try
-    {
-      final Writer writer = m_writer;
-      if (m_inDoctype)
-      {
-        writer.write(" [");
-        writer.write(m_lineSep, 0, m_lineSepLen);
-  
-        m_inDoctype = false;
-      }
-  
-      if (!eName.equals(m_elemName))
-      {
-        writer.write("<!ATTLIST ");
-        writer.write(eName);
-        writer.write(" ");
-  
-        m_elemName = eName;
-      }
-      else
-      {
-        m_pos -= 3;
-  
-        writer.write(m_lineSep, 0, m_lineSepLen);
-      }
-  
-      writer.write(aName);
-      writer.write(" ");
-      writer.write(type);
-      writer.write(" ");
-      writer.write(valueDefault);
-  
-      //m_writer.write(" ");
-      //m_writer.write(value);
-      writer.write(">");
-      writer.write(m_lineSep, 0, m_lineSepLen);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Report an internal entity declaration.
-   *
-   * <p>Only the effective (first) declaration for each entity
-   * will be reported.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @param value The replacement text of the entity.
-   * @exception SAXException The application may raise an exception.
-   * @see #externalEntityDecl
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void internalEntityDecl(String name, String value)
-          throws SAXException
-  {
-
-    try
-    {
-      if (m_inDoctype)
-      {
-        m_writer.write(" [");
-        m_writer.write(m_lineSep, 0, m_lineSepLen);
-  
-        m_inDoctype = false;
-      }
-  
-      outputEntityDecl(name, value);
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Report a parsed external entity declaration.
-   *
-   * <p>Only the effective (first) declaration for each entity
-   * will be reported.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @param publicId The declared public identifier of the entity, or
-   *        null if none was declared.
-   * @param systemId The declared system identifier of the entity.
-   * @exception SAXException The application may raise an exception.
-   * @see #internalEntityDecl
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void externalEntityDecl(
-          String name, String publicId, String systemId) throws SAXException{}
-
-  /**
-   * Handle one of the default entities, return false if it
-   * is not a default entity.
-   *
-   * @param ch character to be escaped.
-   * @param i index into character array.
-   * @param chars non-null reference to character array.
-   * @param len length of chars.
-   * @param escLF true if the linefeed should be escaped.
-   *
-   * @return i+1 if the character was written, else i.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected int accumDefaultEntity(
-          char ch, int i, char[] chars, int len, boolean escLF)
-            throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      if (!escLF && CharInfo.S_LINEFEED == ch)
-      {
-        m_writer.write(m_lineSep, 0, m_lineSepLen);
-      }
-      else
-      {
-        if (m_charInfo.isSpecial(ch))
-        {
-          String entityRef = m_charInfo.getEntityNameForChar(ch);
-  
-          if (null != entityRef)
-          {
-            final Writer writer = m_writer;
-            writer.write('&');
-            writer.write(entityRef);
-            writer.write(';');
-          }
-          else
-            return i;
-        }
-        else
-          return i;
-      }
-  
-      return i + 1;
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Escape and m_writer.write a character.
-   *
-   * @param ch character to be escaped.
-   * @param i index into character array.
-   * @param chars non-null reference to character array.
-   * @param len length of chars.
-   * @param escLF true if the linefeed should be escaped.
-   *
-   * @return i+1 if the character was written, else i.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected int accumDefaultEscape(
-          char ch, int i, char[] chars, int len, boolean escLF)
-            throws org.xml.sax.SAXException
-  {
-
-    int pos = accumDefaultEntity(ch, i, chars, len, escLF);
-
-    if (i == pos)
-    {
-      pos++;
-
-      try
-      {
-        if (0xd800 <= ch && ch < 0xdc00)
-        {
-  
-          // UTF-16 surrogate
-          int next;
-  
-          if (i + 1 >= len)
-          {
-            throw new org.xml.sax.SAXException(
-              XSLMessages.createXPATHMessage(
-                XPATHErrorResources.ER_INVALID_UTF16_SURROGATE,
-                new Object[]{ Integer.toHexString(ch) }));  //"Invalid UTF-16 surrogate detected: "
-  
-            //+Integer.toHexString(ch)+ " ?");
-          }
-          else
-          {
-            next = chars[++i];
-  
-            if (!(0xdc00 <= next && next < 0xe000))
-              throw new org.xml.sax.SAXException(
-                XSLMessages.createXPATHMessage(
-                  XPATHErrorResources.ER_INVALID_UTF16_SURROGATE,
-                  new Object[]{
-                    Integer.toHexString(ch) + " "
-                    + Integer.toHexString(next) }));  //"Invalid UTF-16 surrogate detected: "
-  
-            //+Integer.toHexString(ch)+" "+Integer.toHexString(next));
-            next = ((ch - 0xd800) << 10) + next - 0xdc00 + 0x00010000;
-          }
-  
-          m_writer.write("&#");
-          m_writer.write(Integer.toString(next));
-          m_writer.write(";");
-  
-          /*} else if (null != ctbc && !ctbc.canConvert(ch)) {
-          sb.append("&#x");
-          sb.append(Integer.toString((int)ch, 16));
-          sb.append(";");*/
-        }
-        else
-        {
-          if (ch > m_maxCharacter || (m_charInfo.isSpecial(ch)))
-          {
-            m_writer.write("&#");
-            m_writer.write(Integer.toString(ch));
-            m_writer.write(";");
-          }
-          else
-          {
-            m_writer.write(ch);
-          }
-        }
-      }
-      catch(IOException ioe)
-      {
-        throw new SAXException(ioe);
-      }
-    }
-
-    return pos;
-  }
-
-  /**
-   * Returns the specified <var>string</var> after substituting <VAR>specials</VAR>,
-   * and UTF-16 surrogates for chracter references <CODE>&amp;#xnn</CODE>.
-   *
-   * @param   string      String to convert to XML format.
-   * @param   encoding    CURRENTLY NOT IMPLEMENTED.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void writeAttrString(String string, String encoding)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      final char[] stringChars = string.toCharArray();
-      final int len = stringChars.length;
-      final Writer writer = m_writer;
-  
-      for (int i = 0; i < len; i++)
-      {
-        char ch = stringChars[i];
-  
-        if ((ch < m_maxCharacter) && (!m_charInfo.isSpecial(ch)))
-        {
-          writer.write(ch);
-        }
-        else
-        {
-  
-          // I guess the parser doesn't normalize cr/lf in attributes. -sb
-          if ((CharInfo.S_CARRIAGERETURN == ch) && ((i + 1) < len)
-                  && (CharInfo.S_LINEFEED == stringChars[i + 1]))
-          {
-            i++;
-  
-            ch = CharInfo.S_LINEFEED;
-          }
-  
-          accumDefaultEscape(ch, i, stringChars, len, true);
-        }
-      }
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Tell if, based on space preservation constraints and the doIndent property,
-   * if an indent should occur.
-   *
-   * @return True if an indent should occur.
-   */
-  protected boolean shouldIndent()
-  {
-    return m_doIndent && (!m_ispreserve &&!m_isprevtext);
-  }
-
-  /**
-   * Prints <var>n</var> spaces.
-   * @param pw        The character output stream to use.
-   * @param n         Number of spaces to print.
-   *
-   * @throws org.xml.sax.SAXException if an error occurs when writing.
-   */
-  public void printSpace(int n) throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      for (int i = 0; i < n; i++)
-      {
-        m_writer.write(' ');
-      }
-    }
-    catch(IOException ioe)
-    {
-      throw new SAXException(ioe);
-    }
-  }
-
-  /**
-   * Prints a newline character and <var>n</var> spaces.
-   * @param pw        The character output stream to use.
-   * @param n         Number of spaces to print.
-   *
-   * @throws org.xml.sax.SAXException if an error occurs during writing.
-   */
-  public void indent(int n) throws org.xml.sax.SAXException
-  {
-
-    if (m_startNewLine)
-      outputLineSep();
-
-    if (m_doIndent)
-    {
-      printSpace(n);
-    }
-  }
-
-  /**
-   * Specifies an output stream to which the document should be
-   * serialized. This method should not be called while the
-   * serializer is in the process of serializing a document.
-   * <p>
-   * The encoding specified in the output properties is used, or
-   * if no encoding was specified, the default for the selected
-   * output method.
-   *
-   * @param output The output stream
-   */
-  public void setOutputStream(OutputStream output)
-  {
-
-    try
-    {
-      init(output, m_format);
-    }
-    catch (UnsupportedEncodingException uee)
-    {
-
-      // Should have been warned in init, I guess...
-    }
-  }
-
-  /**
-   * Get the output stream where the events will be serialized to.
-   *
-   * @return reference to the result stream, or null of only a writer was
-   * set.
-   */
-  public OutputStream getOutputStream()
-  {
-
-    if (m_writer instanceof WriterToUTF8Buffered)
-      return ((WriterToUTF8Buffered) m_writer).getOutputStream();
-    if (m_writer instanceof WriterToUTF8)
-      return ((WriterToUTF8) m_writer).getOutputStream();
-    else if (m_writer instanceof WriterToASCI)
-      return ((WriterToASCI) m_writer).getOutputStream();
-    else
-      return null;
-  }
-
-  /**
-   * Specifies a writer to which the document should be serialized.
-   * This method should not be called while the serializer is in
-   * the process of serializing a document.
-   *
-   * @param writer The output writer stream
-   */
-  public void setWriter(Writer writer)
-  {
-    m_writer = writer;
-  }
-
-  /**
-   * Get the character stream where the events will be serialized to.
-   *
-   * @return Reference to the result Writer, or null.
-   */
-  public Writer getWriter()
-  {
-    return m_writer;
-  }
-
-  /**
-   * Specifies an output format for this serializer. It the
-   * serializer has already been associated with an output format,
-   * it will switch to the new format. This method should not be
-   * called while the serializer is in the process of serializing
-   * a document.
-   *
-   * @param format The output format to use
-   */
-  public void setOutputFormat(Properties format)
-  {
-
-    boolean shouldFlush = m_shouldFlush;
-
-    init(m_writer, format, false);
-
-    m_shouldFlush = shouldFlush;
-  }
-
-  /**
-   * Returns the output format for this serializer.
-   *
-   * @return The output format in use
-   */
-  public Properties getOutputFormat()
-  {
-    return m_format;
-  }
-
-  /**
-   * Return a {@link ContentHandler} interface into this serializer.
-   * If the serializer does not support the {@link ContentHandler}
-   * interface, it should return null.
-   *
-   * @return A {@link ContentHandler} interface into this serializer,
-   *  or null if the serializer is not SAX 2 capable
-   * @throws IOException An I/O exception occured
-   */
-  public ContentHandler asContentHandler() throws IOException
-  {
-    return this;
-  }
-
-  /**
-   * Return a {@link DOMSerializer} interface into this serializer.
-   * If the serializer does not support the {@link DOMSerializer}
-   * interface, it should return null.
-   *
-   * @return A {@link DOMSerializer} interface into this serializer,
-   *  or null if the serializer is not DOM capable
-   * @throws IOException An I/O exception occured
-   */
-  public DOMSerializer asDOMSerializer() throws IOException
-  {
-    return this;  // for now
-  }
-
-  /**
-   * Resets the serializer. If this method returns true, the
-   * serializer may be used for subsequent serialization of new
-   * documents. It is possible to change the output format and
-   * output stream prior to serializing, or to use the existing
-   * output format and output stream.
-   *
-   * @return True if serializer has been reset and can be reused
-   */
-  public boolean reset()
-  {
-    return false;
-  }
-
-  /**
-   * Serializes the DOM node. Throws an exception only if an I/O
-   * exception occured while serializing.
-   *
-   * @param elem The element to serialize
-   *
-   * @param node Node to serialize.
-   * @throws IOException An I/O exception occured while serializing
-   */
-  public void serialize(Node node) throws IOException
-  {
-
-    try
-    {
-      TreeWalker walker = new TreeWalker(this,
-                                         new org.apache.xpath.DOM2Helper());
-
-      walker.traverse(node);
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new WrappedRuntimeException(se);
-    }
-  }
-}  //ToXMLStringVisitor
-
diff --git a/src/org/apache/xalan/serialize/WriterToASCI.java b/src/org/apache/xalan/serialize/WriterToASCI.java
deleted file mode 100644
index 56cf947..0000000
--- a/src/org/apache/xalan/serialize/WriterToASCI.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.*;
-
-/**
- * This class writes ASCII to a byte stream as quickly as possible.  For the 
- * moment it does not do buffering, though I reserve the right to do some 
- * buffering down the line if I can prove that it will be faster even if the 
- * output stream is buffered.
- */
-public class WriterToASCI extends Writer
-{
-
-  /** The byte stream to write to.  */
-  private final OutputStream m_os;
-
-  /**
-   * Create an unbuffered ASCII writer.
-   *
-   *
-   * @param os The byte stream to write to.
-   */
-  public WriterToASCI(OutputStream os)
-  {
-    m_os = os;
-  }
-
-  /**
-   * Write a portion of an array of characters.
-   *
-   * @param  chars  Array of characters
-   * @param  start   Offset from which to start writing characters
-   * @param  length   Number of characters to write
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void write(char chars[], int start, int length)
-          throws java.io.IOException
-  {
-
-    int n = length+start;
-
-    for (int i = start; i < n; i++)
-    {
-      m_os.write(chars[i]);
-    }
-  }
-
-  /**
-   * Write a single character.  The character to be written is contained in
-   * the 16 low-order bits of the given integer value; the 16 high-order bits
-   * are ignored.
-   *
-   * <p> Subclasses that intend to support efficient single-character output
-   * should override this method.
-   *
-   * @param c  int specifying a character to be written.
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void write(int c) throws IOException
-  {
-    m_os.write(c);
-  }
-
-  /**
-   * Write a string.
-   *
-   * @param  str  String to be written
-   *
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void write(String s) throws IOException
-  {
-    int n = s.length();
-    for (int i = 0; i < n; i++)
-    {
-      m_os.write(s.charAt(i));
-    }
-  }
-
-  /**
-   * Flush the stream.  If the stream has saved any characters from the
-   * various write() methods in a buffer, write them immediately to their
-   * intended destination.  Then, if that destination is another character or
-   * byte stream, flush it.  Thus one flush() invocation will flush all the
-   * buffers in a chain of Writers and OutputStreams.
-   *
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void flush() throws java.io.IOException
-  {
-    m_os.flush();
-  }
-
-  /**
-   * Close the stream, flushing it first.  Once a stream has been closed,
-   * further write() or flush() invocations will cause an IOException to be
-   * thrown.  Closing a previously-closed stream, however, has no effect.
-   *
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void close() throws java.io.IOException
-  {
-    m_os.close();
-  }
-  
-  /**
-   * Get the output stream where the events will be serialized to.
-   *
-   * @return reference to the result stream, or null of only a writer was
-   * set.
-   */
-  public OutputStream getOutputStream()
-  {
-    return m_os;
-  }
-
-}
diff --git a/src/org/apache/xalan/serialize/WriterToUTF8.java b/src/org/apache/xalan/serialize/WriterToUTF8.java
deleted file mode 100644
index 7dcdbc3..0000000
--- a/src/org/apache/xalan/serialize/WriterToUTF8.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.*;
-
-/**
- * This class writes ASCII to a byte stream as quickly as possible.  For the
- * moment it does not do buffering, though I reserve the right to do some
- * buffering down the line if I can prove that it will be faster even if the
- * output stream is buffered.
- */
-public class WriterToUTF8 extends Writer
-{
-
-  /** The byte stream to write to. */
-  private final OutputStream m_os;
-
-  /**
-   * Create an unbuffered UTF-8 writer.
-   *
-   *
-   * @param os The byte stream to write to.
-   *
-   * @throws UnsupportedEncodingException
-   */
-  public WriterToUTF8(OutputStream os) throws UnsupportedEncodingException
-  {
-    m_os = os;
-  }
-
-  /**
-   * Write a single character.  The character to be written is contained in
-   * the 16 low-order bits of the given integer value; the 16 high-order bits
-   * are ignored.
-   *
-   * <p> Subclasses that intend to support efficient single-character output
-   * should override this method.
-   *
-   * @param c  int specifying a character to be written.
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void write(final int c) throws IOException
-  {
-
-    if (c < 0x80)
-      m_os.write(c);
-    else if (c < 0x800)
-    {
-      m_os.write(0xc0 + (c >> 6));
-      m_os.write(0x80 + (c & 0x3f));
-    }
-    else
-    {
-      m_os.write(0xe0 + (c >> 12));
-      m_os.write(0x80 + ((c >> 6) & 0x3f));
-      m_os.write(0x80 + (c & 0x3f));
-    }
-  }
-
-  /**
-   * Write a portion of an array of characters.
-   *
-   * @param  chars  Array of characters
-   * @param  start   Offset from which to start writing characters
-   * @param  length   Number of characters to write
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void write(final char chars[], final int start, final int length)
-          throws java.io.IOException
-  {
-
-    final OutputStream os = m_os;
-
-    int n = length+start;
-    for (int i = start; i < n; i++)
-    {
-      final char c = chars[i];
-
-      if (c < 0x80)
-        os.write(c);
-      else if (c < 0x800)
-      {
-        os.write(0xc0 + (c >> 6));
-        os.write(0x80 + (c & 0x3f));
-      }
-      else
-      {
-        os.write(0xe0 + (c >> 12));
-        os.write(0x80 + ((c >> 6) & 0x3f));
-        os.write(0x80 + (c & 0x3f));
-      }
-    }
-  }
-
-  /**
-   * Write a string.
-   *
-   * @param  s  String to be written
-   *
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void write(final String s) throws IOException
-  {
-
-    final int n = s.length();
-    final OutputStream os = m_os;
-
-    for (int i = 0; i < n; i++)
-    {
-      final char c = s.charAt(i);
-
-      if (c < 0x80)
-        os.write(c);
-      else if (c < 0x800)
-      {
-        os.write(0xc0 + (c >> 6));
-        os.write(0x80 + (c & 0x3f));
-      }
-      else
-      {
-        os.write(0xe0 + (c >> 12));
-        os.write(0x80 + ((c >> 6) & 0x3f));
-        os.write(0x80 + (c & 0x3f));
-      }
-    }
-  }
-
-  /**
-   * Flush the stream.  If the stream has saved any characters from the
-   * various write() methods in a buffer, write them immediately to their
-   * intended destination.  Then, if that destination is another character or
-   * byte stream, flush it.  Thus one flush() invocation will flush all the
-   * buffers in a chain of Writers and OutputStreams.
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void flush() throws java.io.IOException
-  {
-    m_os.flush();
-  }
-
-  /**
-   * Close the stream, flushing it first.  Once a stream has been closed,
-   * further write() or flush() invocations will cause an IOException to be
-   * thrown.  Closing a previously-closed stream, however, has no effect.
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void close() throws java.io.IOException
-  {
-    m_os.close();
-  }
-
-  /**
-   * Get the output stream where the events will be serialized to.
-   *
-   * @return reference to the result stream, or null of only a writer was
-   * set.
-   */
-  public OutputStream getOutputStream()
-  {
-    return m_os;
-  }
-}
diff --git a/src/org/apache/xalan/serialize/WriterToUTF8Buffered.java b/src/org/apache/xalan/serialize/WriterToUTF8Buffered.java
deleted file mode 100644
index dec2c82..0000000
--- a/src/org/apache/xalan/serialize/WriterToUTF8Buffered.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.serialize;
-
-import java.io.*;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * This class writes ASCII to a byte stream as quickly as possible.  For the
- * moment it does not do buffering, though I reserve the right to do some
- * buffering down the line if I can prove that it will be faster even if the
- * output stream is buffered.
- */
-public final class WriterToUTF8Buffered extends Writer
-{
-
-  /** The byte stream to write to. (sc & sb remove final to compile in JDK 1.1.8) */
-  private OutputStream m_os;
-
-  /**
-   * The internal buffer where data is stored. 
-   * (sc & sb remove final to compile in JDK 1.1.8)
-   */
-  private byte buf[];
-
-  /**
-   * The number of valid bytes in the buffer. This value is always
-   * in the range <tt>0</tt> through <tt>buf.length</tt>; elements
-   * <tt>buf[0]</tt> through <tt>buf[count-1]</tt> contain valid
-   * byte data.
-   */
-  private int count;
-
-  /**
-   * Create an buffered UTF-8 writer.
-   *
-   *
-   * @param   out    the underlying output stream.
-   *
-   * @throws UnsupportedEncodingException
-   */
-  public WriterToUTF8Buffered(OutputStream out)
-          throws UnsupportedEncodingException
-  {
-    this(out, 8 * 1024);
-  }
-
-  /**
-   * Create an buffered UTF-8 writer to write data to the
-   * specified underlying output stream with the specified buffer
-   * size.
-   *
-   * @param   out    the underlying output stream.
-   * @param   size   the buffer size.
-   * @exception IllegalArgumentException if size <= 0.
-   */
-  public WriterToUTF8Buffered(final OutputStream out, final int size)
-  {
-
-    m_os = out;
-
-    if (size <= 0)
-    {
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BUFFER_SIZE_LESSTHAN_ZERO, null)); //"Buffer size <= 0");
-    }
-
-    buf = new byte[size];
-    count = 0;
-  }
-
-  /**
-   * Write a single character.  The character to be written is contained in
-   * the 16 low-order bits of the given integer value; the 16 high-order bits
-   * are ignored.
-   *
-   * <p> Subclasses that intend to support efficient single-character output
-   * should override this method.
-   *
-   * @param c  int specifying a character to be written.
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void write(final int c) throws IOException
-  {
-    
-    if (c < 0x80)
-    {
-      if (count >= buf.length)
-        flushBuffer();
-      buf[count++] = (byte) (c);
-    }
-    else if (c < 0x800)
-    {
-      if (count+1 >= buf.length)
-        flushBuffer();
-      buf[count++] = (byte) (0xc0 + (c >> 6));
-      buf[count++] = (byte) (0x80 + (c & 0x3f));
-    }
-    else
-    {
-      if (count+2 >= buf.length)
-        flushBuffer();
-      buf[count++] = (byte) (0xe0 + (c >> 12));
-      buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
-      buf[count++] = (byte) (0x80 + (c & 0x3f));
-    }
-  }
-
-  /**
-   * Write a portion of an array of characters.
-   *
-   * @param  chars  Array of characters
-   * @param  start   Offset from which to start writing characters
-   * @param  length   Number of characters to write
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  private final void writeDirect(
-          final char chars[], final int start, final int length)
-            throws java.io.IOException
-  {
-
-    final OutputStream os = m_os;
-
-    int n = length+start;
-    for (int i = start; i < n; i++)
-    {
-      final char c = chars[i];
-
-      if (c < 0x80)
-        os.write(c);
-      else if (c < 0x800)
-      {
-        os.write(0xc0 + (c >> 6));
-        os.write(0x80 + (c & 0x3f));
-      }
-      else
-      {
-        os.write(0xe0 + (c >> 12));
-        os.write(0x80 + ((c >> 6) & 0x3f));
-        os.write(0x80 + (c & 0x3f));
-      }
-    }
-  }
-
-  /**
-   * Write a string.
-   *
-   * @param  s  String to be written
-   *
-   * @exception  IOException  If an I/O error occurs
-   */
-  private final void writeDirect(final String s) throws IOException
-  {
-
-    final int n = s.length();
-    final OutputStream os = m_os;
-
-    for (int i = 0; i < n; i++)
-    {
-      final char c = s.charAt(i);
-
-      if (c < 0x80)
-        os.write(c);
-      else if (c < 0x800)
-      {
-        os.write(0xc0 + (c >> 6));
-        os.write(0x80 + (c & 0x3f));
-      }
-      else
-      {
-        os.write(0xe0 + (c >> 12));
-        os.write(0x80 + ((c >> 6) & 0x3f));
-        os.write(0x80 + (c & 0x3f));
-      }
-    }
-  }
-
-  /**
-   * Write a portion of an array of characters.
-   *
-   * @param  chars  Array of characters
-   * @param  start   Offset from which to start writing characters
-   * @param  length   Number of characters to write
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void write(final char chars[], final int start, final int length)
-          throws java.io.IOException
-  {
-
-    // We multiply the length by three since this is the maximum length
-    // of the characters that we can put into the buffer.  It is possible
-    // for each Unicode character to expand to three bytes.
-
-    int lengthx3 = (length << 1) + length;
-
-    if (lengthx3 >= buf.length)
-    {
-
-      /* If the request length exceeds the size of the output buffer,
-         flush the output buffer and then write the data directly.
-         In this way buffered streams will cascade harmlessly. */
-      flushBuffer();
-      writeDirect(chars, start, length);
-
-      return;
-    }
-
-    if (lengthx3 > buf.length - count)
-    {
-      flushBuffer();
-    }
-
-    final OutputStream os = m_os;
-    int n = length+start;
-    for (int i = start; i < n; i++)
-    {
-      final char c = chars[i];
-
-      if (c < 0x80)
-        buf[count++] = (byte) (c);
-      else if (c < 0x800)
-      {
-        buf[count++] = (byte) (0xc0 + (c >> 6));
-        buf[count++] = (byte) (0x80 + (c & 0x3f));
-      }
-      else
-      {
-        buf[count++] = (byte) (0xe0 + (c >> 12));
-        buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
-        buf[count++] = (byte) (0x80 + (c & 0x3f));
-      }
-    }
-
-  }
-
-  /**
-   * Write a string.
-   *
-   * @param  s  String to be written
-   *
-   * @exception  IOException  If an I/O error occurs
-   */
-  public void write(final String s) throws IOException
-  {
-
-    final int length = s.length();
-
-    // We multiply the length by three since this is the maximum length
-    // of the characters that we can put into the buffer.  It is possible
-    // for each Unicode character to expand to three bytes.
-
-    int lengthx3 = (length << 1) + length;
-
-    if (lengthx3 >= buf.length)
-    {
-
-      /* If the request length exceeds the size of the output buffer,
-         flush the output buffer and then write the data directly.
-         In this way buffered streams will cascade harmlessly. */
-      flushBuffer();
-      writeDirect(s);
-
-      return;
-    }
-
-    if (lengthx3 > buf.length - count)
-    {
-      flushBuffer();
-    }
-
-    final OutputStream os = m_os;
-
-    for (int i = 0; i < length; i++)
-    {
-      final char c = s.charAt(i);
-
-      if (c < 0x80)
-        buf[count++] = (byte) (c);
-      else if (c < 0x800)
-      {
-        buf[count++] = (byte) (0xc0 + (c >> 6));
-        buf[count++] = (byte) (0x80 + (c & 0x3f));
-      }
-      else
-      {
-        buf[count++] = (byte) (0xe0 + (c >> 12));
-        buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
-        buf[count++] = (byte) (0x80 + (c & 0x3f));
-      }
-    }
-
-  }
-
-  /**
-   * Flush the internal buffer
-   *
-   * @throws IOException
-   */
-  public void flushBuffer() throws IOException
-  {
-
-    if (count > 0)
-    {
-      m_os.write(buf, 0, count);
-
-      count = 0;
-    }
-  }
-
-  /**
-   * Flush the stream.  If the stream has saved any characters from the
-   * various write() methods in a buffer, write them immediately to their
-   * intended destination.  Then, if that destination is another character or
-   * byte stream, flush it.  Thus one flush() invocation will flush all the
-   * buffers in a chain of Writers and OutputStreams.
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void flush() throws java.io.IOException
-  {
-    flushBuffer();
-    m_os.flush();
-  }
-
-  /**
-   * Close the stream, flushing it first.  Once a stream has been closed,
-   * further write() or flush() invocations will cause an IOException to be
-   * thrown.  Closing a previously-closed stream, however, has no effect.
-   *
-   * @exception  IOException  If an I/O error occurs
-   *
-   * @throws java.io.IOException
-   */
-  public void close() throws java.io.IOException
-  {
-    flushBuffer();
-    m_os.close();
-  }
-
-  /**
-   * Get the output stream where the events will be serialized to.
-   *
-   * @return reference to the result stream, or null of only a writer was
-   * set.
-   */
-  public OutputStream getOutputStream()
-  {
-    return m_os;
-  }
-}
diff --git a/src/org/apache/xalan/serialize/XMLEntities.res b/src/org/apache/xalan/serialize/XMLEntities.res
deleted file mode 100644
index e8e3c5e..0000000
--- a/src/org/apache/xalan/serialize/XMLEntities.res
+++ /dev/null
@@ -1,12 +0,0 @@
-# $Id$
-#
-# @version $Revision$ $Date$
-# @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
-#
-# Character entity references for markup-significant
-#
-quot 34
-amp 38
-lt 60
-gt 62
-
diff --git a/src/org/apache/xalan/serialize/package.html b/src/org/apache/xalan/serialize/package.html
deleted file mode 100644
index 471b596..0000000
--- a/src/org/apache/xalan/serialize/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-  <title>Xalan Serialize Package.</title>
-  <body>
-    <p>Processes SAX events into streams.</p>
-    
-    <p>The {@link org.apache.xalan.serialize.SerializerFactory} is used to 
-    create a {@link org.apache.xalan.serialize.Serializer} from a set of 
-    output properties (see {@link javax.xml.transform.OutputKeys}).</p>
-    <p>{@link org.apache.xalan.serialize.SerializerToXML} acts as the main 
-    baseclass for the Xalan serializer implementations.  
-    {@link org.apache.xalan.serialize.SerializerToHTML} derives from this 
-    to implement HTML serialization.  {@link org.apache.xalan.serialize.SerializerToText}
-    implements plain text serialization.</p>
-    <p>XML mapping from characters to entity references is defined in 
-    XMLEntities.res.  HTML entity reference mapping is defined in HTMLEntities.res.
-    </p>
-    <p>Encoding information is defined in {@link org.apache.xalan.serialize.Encodings}.</p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/serialize/serializer.properties b/src/org/apache/xalan/serialize/serializer.properties
deleted file mode 100644
index 792d600..0000000
--- a/src/org/apache/xalan/serialize/serializer.properties
+++ /dev/null
@@ -1 +0,0 @@
-#
diff --git a/src/org/apache/xalan/templates/AVT.java b/src/org/apache/xalan/templates/AVT.java
deleted file mode 100644
index a876da0..0000000
--- a/src/org/apache/xalan/templates/AVT.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xml.dtm.DTM;
-
-import java.util.Vector;
-import java.util.StringTokenizer;
-
-import org.apache.xml.utils.StringBufferPool;
-import org.apache.xml.utils.FastStringBuffer;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.processor.StylesheetHandler;
-
-import javax.xml.transform.ErrorListener;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Class to hold an Attribute Value Template.
- */
-public class AVT implements java.io.Serializable
-{
-
-  /**
-   * If the AVT is not complex, just hold the simple string.
-   * @serial
-   */
-  private String m_simpleString = null;
-
-  /**
-   * If the AVT is complex, hold a Vector of AVTParts.
-   * @serial
-   */
-  private Vector m_parts = null;
-
-  /**
-   * The name of the attribute.
-   * @serial
-   */
-  private String m_rawName;
-
-  /**
-   * Get the raw name of the attribute, with the prefix unprocessed.
-   *
-   * @return non-null reference to prefixed name.
-   */
-  public String getRawName()
-  {
-    return m_rawName;
-  }
-
-  /**
-   * Get the raw name of the attribute, with the prefix unprocessed.
-   *
-   * @param rawName non-null reference to prefixed name.
-   */
-  public void setRawName(String rawName)
-  {
-    m_rawName = rawName;
-  }
-
-  /**
-   * The name of the attribute.
-   * @serial
-   */
-  private String m_name;
-
-  /**
-   * Get the local name of the attribute.
-   *
-   * @return non-null reference to name string.
-   */
-  public String getName()
-  {
-    return m_name;
-  }
-
-  /**
-   * Set the local name of the attribute.
-   *
-   * @param name non-null reference to name string.
-   */
-  public void setName(String name)
-  {
-    m_name = name;
-  }
-
-  /**
-   * The namespace URI of the owning attribute.
-   * @serial
-   */
-  private String m_uri;
-
-  /**
-   * Get the namespace URI of the attribute.
-   *
-   * @return non-null reference to URI, "" if null namespace.
-   */
-  public String getURI()
-  {
-    return m_uri;
-  }
-
-  /**
-   * Get the namespace URI of the attribute.
-   *
-   * @param uri non-null reference to URI, "" if null namespace.
-   */
-  public void setURI(String uri)
-  {
-    m_uri = uri;
-  }
-
-  /**
-   * Construct an AVT by parsing the string, and either
-   * constructing a vector of AVTParts, or simply hold
-   * on to the string if the AVT is simple.
-   *
-   * @param handler non-null reference to StylesheetHandler that is constructing.
-   * @param uri non-null reference to URI, "" if null namespace.
-   * @param name  non-null reference to name string.
-   * @param rawName prefixed name.
-   * @param stringedValue non-null raw string value.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public AVT(StylesheetHandler handler, String uri, String name, String rawName, String stringedValue)
-          throws javax.xml.transform.TransformerException
-  {
-
-    m_uri = uri;
-    m_name = name;
-    m_rawName = rawName;
-
-    StringTokenizer tokenizer = new StringTokenizer(stringedValue, "{}\"\'",
-                                  true);
-    int nTokens = tokenizer.countTokens();
-
-    if (nTokens < 2)
-    {
-      m_simpleString = stringedValue;  // then do the simple thing
-    }
-    else
-    {
-      FastStringBuffer buffer = StringBufferPool.get();
-      FastStringBuffer exprBuffer = StringBufferPool.get();
-
-      try
-      {
-        m_parts = new Vector(nTokens + 1);
-
-        String t = null;  // base token
-        String lookahead = null;  // next token
-        String error = null;  // if non-null, break from loop
-
-        while (tokenizer.hasMoreTokens())
-        {
-          if (lookahead != null)
-          {
-            t = lookahead;
-            lookahead = null;
-          }
-          else
-            t = tokenizer.nextToken();
-
-          if (t.length() == 1)
-          {
-            switch (t.charAt(0))
-            {
-            case ('\"') :
-            case ('\'') :
-            {
-
-              // just keep on going, since we're not in an attribute template
-              buffer.append(t);
-
-              break;
-            }
-            case ('{') :
-            {
-
-              // Attribute Value Template start
-              lookahead = tokenizer.nextToken();
-
-              if (lookahead.equals("{"))
-              {
-
-                // Double curlys mean escape to show curly
-                buffer.append(lookahead);
-
-                lookahead = null;
-
-                break;  // from switch
-              }
-
-              /*
-              else if(lookahead.equals("\"") || lookahead.equals("\'"))
-              {
-              // Error. Expressions can not begin with quotes.
-              error = "Expressions can not begin with quotes.";
-              break; // from switch
-              }
-              */
-              else
-              {
-                if (buffer.length() > 0)
-                {
-                  m_parts.addElement(new AVTPartSimple(buffer.toString()));
-                  buffer.setLength(0);
-                }
-
-                exprBuffer.setLength(0);
-
-                while (null != lookahead)
-                {
-                  if (lookahead.length() == 1)
-                  {
-                    switch (lookahead.charAt(0))
-                    {
-                    case '\'' :
-                    case '\"' :
-                    {
-
-                      // String start
-                      exprBuffer.append(lookahead);
-
-                      String quote = lookahead;
-
-                      // Consume stuff 'till next quote
-                      lookahead = tokenizer.nextToken();
-
-                      while (!lookahead.equals(quote))
-                      {
-                        exprBuffer.append(lookahead);
-
-                        lookahead = tokenizer.nextToken();
-                      }
-
-                      exprBuffer.append(lookahead);
-
-                      lookahead = tokenizer.nextToken();
-
-                      break;
-                    }
-                    case '{' :
-                    {
-
-                      // What's another curly doing here?
-                      error = XSLMessages.createMessage(
-                        XSLTErrorResources.ER_NO_CURLYBRACE, null);  //"Error: Can not have \"{\" within expression.";
-                      
-                      lookahead = null;  // breaks out of inner while loop
-
-                      break;
-                    }
-                    case '}' :
-                    {
-
-                      // Proper close of attribute template.
-                      // Evaluate the expression.
-                      buffer.setLength(0);
-
-                      XPath xpath =
-                        handler.createXPath(exprBuffer.toString());
-
-                      m_parts.addElement(new AVTPartXPath(xpath));
-
-                      lookahead = null;  // breaks out of inner while loop
-
-                      break;
-                    }
-                    default :
-                    {
-
-                      // part of the template stuff, just add it.
-                      exprBuffer.append(lookahead);
-
-                      lookahead = tokenizer.nextToken();
-                    }
-                    }  // end inner switch
-                  }  // end if lookahead length == 1
-                  else
-                  {
-
-                    // part of the template stuff, just add it.
-                    exprBuffer.append(lookahead);
-
-                    lookahead = tokenizer.nextToken();
-                  }
-                }  // end while(!lookahead.equals("}"))
-
-                if (error != null)
-                {
-                  break;  // from inner while loop
-                }
-              }
-
-              break;
-            }
-            case ('}') :
-            {
-              lookahead = tokenizer.nextToken();
-
-              if (lookahead.equals("}"))
-              {
-
-                // Double curlys mean escape to show curly
-                buffer.append(lookahead);
-
-                lookahead = null;  // swallow
-              }
-              else
-              {
-
-                // Illegal, I think...
-                try
-                {
-                  handler.warn(XSLTErrorResources.WG_FOUND_CURLYBRACE, null);  //"Found \"}\" but no attribute template open!");
-                }
-                catch (org.xml.sax.SAXException se)
-                {
-                  throw new TransformerException(se);
-                }
-
-                buffer.append("}");
-
-                // leave the lookahead to be processed by the next round.
-              }
-
-              break;
-            }
-            default :
-            {
-
-              // Anything else just add to string.
-              buffer.append(t);
-            }
-            }  // end switch t
-          }  // end if length == 1
-          else
-          {
-
-            // Anything else just add to string.
-            buffer.append(t);
-          }
-
-          if (null != error)
-          {
-            try
-            {
-              handler.warn(XSLTErrorResources.WG_ATTR_TEMPLATE,
-                           new Object[]{ error });  //"Attr Template, "+error);
-            }
-            catch (org.xml.sax.SAXException se)
-            {
-              throw new TransformerException(se);
-            }
-
-            break;
-          }
-        }  // end while(tokenizer.hasMoreTokens())
-
-        if (buffer.length() > 0)
-        {
-          m_parts.addElement(new AVTPartSimple(buffer.toString()));
-          buffer.setLength(0);
-        }
-      }
-      finally
-      {
-        StringBufferPool.free(buffer);
-        StringBufferPool.free(exprBuffer);
-      }
-    }  // end else nTokens > 1
-
-    if (null == m_parts && (null == m_simpleString))
-    {
-
-      // Error?
-      m_simpleString = "";
-    }
-  }
-
-  /**
-   * Get the AVT as the original string.
-   *
-   * @return The AVT as the original string
-   */
-  public String getSimpleString()
-  {
-
-    if (null != m_simpleString)
-    {
-      return m_simpleString;
-    }
-    else if (null != m_parts)
-    {
-      FastStringBuffer buf = StringBufferPool.get();
-      String s;
-
-      try
-      {
-        buf.setLength(0);
-
-        int n = m_parts.size();
-
-        for (int i = 0; i < n; i++)
-        {
-          AVTPart part = (AVTPart) m_parts.elementAt(i);
-
-          buf.append(part.getSimpleString());
-        }
-
-        s = buf.toString();
-      }
-      finally
-      {
-        StringBufferPool.free(buf);
-      }
-
-      return s;
-    }
-    else
-    {
-      return "";
-    }
-  }
-
-  /**
-   * Evaluate the AVT and return a String.
-   *
-   * @param xctxt Te XPathContext to use to evaluate this.
-   * @param context The current source tree context.
-   * @param nsNode The current namespace context (stylesheet tree context).
-   * @param NodeList The current Context Node List.
-   *
-   * @return The AVT evaluated as a string
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public String evaluate(
-          XPathContext xctxt, int context, org.apache.xml.utils.PrefixResolver nsNode)
-            throws javax.xml.transform.TransformerException
-  {
-
-    FastStringBuffer buf = StringBufferPool.get();
-
-    try
-    {
-      if (null != m_simpleString)
-      {
-        return m_simpleString;
-      }
-      else if (null != m_parts)
-      {
-        buf.setLength(0);
-
-        int n = m_parts.size();
-
-        for (int i = 0; i < n; i++)
-        {
-          AVTPart part = (AVTPart) m_parts.elementAt(i);
-
-          part.evaluate(xctxt, buf, context, nsNode);
-        }
-
-        return buf.toString();
-      }
-      else
-      {
-        return "";
-      }
-    }
-    finally
-    {
-      StringBufferPool.free(buf);
-    }
-  }
-
-  /**
-   * Test whether the AVT is insensitive to the context in which
-   *  it is being evaluated. This is intended to facilitate
-   *  compilation of templates, by allowing simple AVTs to be
-   *  converted back into strings.
-   *
-   *  Currently the only case we recognize is simple strings.
-   * ADDED 9/5/2000 to support compilation experiment
-   *
-   * @return True if the m_simpleString member of this AVT is not null
-   */
-  public boolean isContextInsensitive()
-  {
-    return null != m_simpleString;
-  }
-
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-
-    if (null != m_parts)
-    {
-      int n = m_parts.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        AVTPart part = (AVTPart) m_parts.elementAt(i);
-
-        if (part.canTraverseOutsideSubtree())
-          return true;
-      }
-    }
-
-    return false;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    if (null != m_parts)
-    {
-      int n = m_parts.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        AVTPart part = (AVTPart) m_parts.elementAt(i);
-
-        part.fixupVariables(vars, globalsSize);
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/AVTPart.java b/src/org/apache/xalan/templates/AVTPart.java
deleted file mode 100644
index 4c3fc25..0000000
--- a/src/org/apache/xalan/templates/AVTPart.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.FastStringBuffer;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class to hold a part, either a string or XPath,
- * of an Attribute Value Template.
- */
-public abstract class AVTPart implements java.io.Serializable
-{
-
-  /**
-   * Construct a part.
-   */
-  public AVTPart(){}
-
-  /**
-   * Get the AVT part as the original string.
-   *
-   * @return the AVT part as the original string.
-   */
-  public abstract String getSimpleString();
-
-  /**
-   * Write the evaluated value into the given
-   * string buffer.
-   *
-   * @param xctxt The XPath context to use to evaluate this AVT.
-   * @param buf Buffer to write into.
-   * @param context The current source tree context.
-   * @param nsNode The current namespace context (stylesheet tree context).
-   * @param NodeList The current Context Node List.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public abstract void evaluate(
-    XPathContext xctxt, FastStringBuffer buf, int context,
-      org.apache.xml.utils.PrefixResolver nsNode)
-        throws javax.xml.transform.TransformerException;
-
-  /**
-   * Set the XPath support.
-   *
-   * @param support XPathContext to set. 
-   */
-  public void setXPathSupport(XPathContext support){}
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-    return false;
-   }
-   
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public abstract void fixupVariables(java.util.Vector vars, int globalsSize);
-
-
-}
diff --git a/src/org/apache/xalan/templates/AVTPartSimple.java b/src/org/apache/xalan/templates/AVTPartSimple.java
deleted file mode 100644
index 2a1fc7d..0000000
--- a/src/org/apache/xalan/templates/AVTPartSimple.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.FastStringBuffer;
-
-/**
- * <meta name="usage" content="internal"/>
- * Simple string part of a complex AVT.
- */
-public class AVTPartSimple extends AVTPart
-{
-
-  /**
-   * Simple string value;
-   * @serial
-   */
-  private String m_val;
-
-  /**
-   * Construct a simple AVT part.
-   * @param val A pure string section of an AVT.
-   */
-  public AVTPartSimple(String val)
-  {
-    m_val = val;
-  }
-
-  /**
-   * Get the AVT part as the original string.
-   *
-   * @return the AVT part as the original string.
-   */
-  public String getSimpleString()
-  {
-    return m_val;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-
-  /**
-   * Write the value into the buffer.
-   *
-   * @param xctxt An XPathContext object, providing infomation specific
-   * to this invocation and this thread. Maintains SAX state, variables, 
-   * error handler and  so on, so the transformation/XPath object itself
-   * can be simultaneously invoked from multiple threads.
-   * @param buf Buffer to write into.
-   * @param context The current source tree context.
-   * @param nsNode The current namespace context (stylesheet tree context).
-   * @param NodeList The current Context Node List.
-   */
-  public void evaluate(XPathContext xctxt, FastStringBuffer buf,
-                       int context,
-                       org.apache.xml.utils.PrefixResolver nsNode)
-  {
-    buf.append(m_val);
-  }
-}
diff --git a/src/org/apache/xalan/templates/AVTPartXPath.java b/src/org/apache/xalan/templates/AVTPartXPath.java
deleted file mode 100644
index 0f6e38b..0000000
--- a/src/org/apache/xalan/templates/AVTPartXPath.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xml.utils.FastStringBuffer;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-/**
- * <meta name="usage" content="internal"/>
- * Simple string part of a complex AVT.
- */
-public class AVTPartXPath extends AVTPart
-{
-
-  /**
-   * The XPath object contained in this part.
-   * @serial
-   */
-  private XPath m_xpath;
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    m_xpath.fixupVariables(vars, globalsSize);
-  }
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-    return m_xpath.getExpression().canTraverseOutsideSubtree();
-   }
-
-  /**
-   * Construct a simple AVT part.
-   *
-   * @param xpath Xpath section of AVT 
-   */
-  public AVTPartXPath(XPath xpath)
-  {
-    m_xpath = xpath;
-  }
-
-  /**
-   * Construct a simple AVT part.
-   * 
-   * @param val A pure string section of an AVT.
-   * @param nsNode An object which can be used to determine the
-   * Namespace Name (URI) for any Namespace prefix used in the XPath. 
-   * Usually this is based on the context where the XPath was specified,
-   * such as a node within a Stylesheet.
-   * @param xpathProcessor XPath parser
-   * @param factory XPath factory
-   * @param liaison An XPathContext object, providing infomation specific
-   * to this invocation and this thread. Maintains SAX output state, 
-   * variables, error handler and so on, so the transformation/XPath 
-   * object itself can be simultaneously invoked from multiple threads.
-   *
-   * @throws javax.xml.transform.TransformerException
-   * TODO: Fix or remove this unused c'tor.
-   */
-  public AVTPartXPath(
-          String val, org.apache.xml.utils.PrefixResolver nsNode, 
-          XPathParser xpathProcessor, XPathFactory factory, 
-          XPathContext liaison)
-            throws javax.xml.transform.TransformerException
-  {
-    m_xpath = new XPath(val, null, nsNode, XPath.SELECT, liaison.getErrorListener());
-  }
-
-  /**
-   * Get the AVT part as the original string.
-   *
-   * @return the AVT part as the original string.
-   */
-  public String getSimpleString()
-  {
-    return "{" + m_xpath.getPatternString() + "}";
-  }
-
-  /**
-   * Write the value into the buffer.
-   *
-   * @param xctxt An XPathContext object, providing infomation specific
-   * to this invocation and this thread. Maintains SAX state, variables, 
-   * error handler and  so on, so the transformation/XPath object itself
-   * can be simultaneously invoked from multiple threads.
-   * @param buf Buffer to write into.
-   * @param context The current source tree context.
-   * @param nsNode The current namespace context (stylesheet tree context).
-   * @param NodeList The current Context Node List.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void evaluate(
-          XPathContext xctxt, FastStringBuffer buf, int context, org.apache.xml.utils.PrefixResolver nsNode)
-            throws javax.xml.transform.TransformerException
-  {
-
-    XObject xobj = m_xpath.execute(xctxt, context, nsNode);
-
-    if (null != xobj)
-    {
-      xobj.appendToFsb(buf);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/Constants.java b/src/org/apache/xalan/templates/Constants.java
deleted file mode 100644
index d144fa7..0000000
--- a/src/org/apache/xalan/templates/Constants.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Primary constants used in the TransformerImpl classes.
- */
-public class Constants
-{
-
-  /** 
-   * Mnemonics for standard XML Namespace URIs, as Java Strings:
-   * <ul>
-   * <li>S_XMLNAMESPACEURI (http://www.w3.org/XML/1998/namespace) is the
-   * URI permanantly assigned to the "xml:" prefix. This is used for some
-   * features built into the XML specification itself, such as xml:space 
-   * and xml:lang. It was defined by the W3C's XML Namespaces spec.</li>
-   * <li>S_XSLNAMESPACEURL (http://www.w3.org/1999/XSL/Transform) is the
-   * URI which indicates that a name may be an XSLT directive. In most
-   * XSLT stylesheets, this is bound to the "xsl:" prefix. It's defined
-   * by the W3C's XSLT Recommendation.</li>
-   * <li>S_OLDXSLNAMESPACEURL (http://www.w3.org/XSL/Transform/1.0) was
-   * used in early prototypes of XSLT processors for much the same purpose
-   * as S_XSLNAMESPACEURL. It is now considered obsolete, and the version
-   * of XSLT which it signified is not fully compatable with the final
-   * XSLT Recommendation, so what it really signifies is a badly obsolete
-   * stylesheet.</li>
-   * </ul> */
-  public static final String 
-	S_XMLNAMESPACEURI = "http://www.w3.org/XML/1998/namespace", 
-	S_XSLNAMESPACEURL = "http://www.w3.org/1999/XSL/Transform", 
-	S_OLDXSLNAMESPACEURL = "http://www.w3.org/XSL/Transform/1.0";
-
-  /** Authorship mnemonics, as Java Strings. Not standardized, 
-   * as far as I know.
-   * <ul>
-   * <li>S_VENDOR -- the name of the organization/individual who published
-   * this XSLT processor. </li>
-   * <li>S_VENDORURL -- URL where one can attempt to retrieve more
-   * information about this publisher and product.</li>
-   * </ul>
-   */
-  public static final String 
-	S_VENDOR = "Apache Software Foundation", 
-	S_VENDORURL = "http://xml.apache.org";
-
-  /** S_BUILTIN_EXTENSIONS_URL is a mnemonic for the XML Namespace 
-   *(http://xml.apache.org/xslt) predefined to signify Xalan's
-   * built-in XSLT Extensions. When used in stylesheets, this is often 
-   * bound to the "xalan:" prefix.
-   */
-  public static final String 
-    S_BUILTIN_EXTENSIONS_URL = "http://xml.apache.org/xslt"; 
-  
-  /**
-   * The minimum version of XSLT supported by this processor.
-   */
-  public static final double XSLTVERSUPPORTED = 1.0;
-
-  /**
-   * IDs for XSL element types. These are associated
-   * with the string literals in the TransformerImpl class.
-   * Don't change the numbers. NOTE THAT THESE ARE NOT IN
-   * ALPHABETICAL ORDER!
-   * (It's a pity Java doesn't have a real Enumerated Mnemonic
-   * datatype... or a C-like preprocessor in lieu thereof which
-   * could be used to generate and maintain synch between these lists.)
-   */
-  public static final int ELEMNAME_UNDEFINED = -1, ELEMNAME_WITHPARAM = 2,
-                          ELEMNAME_ADDATTRIBUTE = 4, ELEMNAME_ANCHOR = 22,
-
-  //  ELEMNAME_ANCHOR_PATTERN = 23,
-  ELEMNAME_APPLY_TEMPLATES = 50, ELEMNAME_USE = 34, ELEMNAME_CHILDREN = 6,
-                                 ELEMNAME_CHOOSE = 37, ELEMNAME_COMMENT = 59,  // my own
-                                 ELEMNAME_CONSTRUCT = 7,  // my own
-                                 ELEMNAME_CONTENTS = 8, ELEMNAME_COPY = 9,
-                                 ELEMNAME_COPY_OF = 74,
-                                 ELEMNAME_DECIMALFORMAT = 83,
-                                 ELEMNAME_DEFINEATTRIBUTESET = 40,
-
-  //  ELEMNAME_DEFINECONSTANT = 29,
-  //  ELEMNAME_DEFINEMACRO = 10,
-  ELEMNAME_DEFINESCRIPT = 11, ELEMNAME_DISPLAYIF = 12,  // my own
-                              ELEMNAME_EMPTY = 14, ELEMNAME_EVAL = 15,
-                              ELEMNAME_EXPECTEDCHILDREN = 16,
-                              ELEMNAME_EXTENSION = 54,
-                              ELEMNAME_EXTENSIONHANDLER = 63,
-                              ELEMNAME_FOREACH = 28, ELEMNAME_KEY = 31,
-                              ELEMNAME_IF = 36, ELEMNAME_IMPORT = 26,
-                              ELEMNAME_INCLUDE = 27,
-                              ELEMNAME_CALLTEMPLATE = 17,
-                              ELEMNAME_PARAMVARIABLE = 41,
-                              ELEMNAME_NUMBER = 35, ELEMNAME_NSALIAS = 84,
-                              ELEMNAME_OTHERWISE = 39, ELEMNAME_PI = 58,
-                              ELEMNAME_PRESERVESPACE = 33,
-                              ELEMNAME_REMOVEATTRIBUTE = 5,
-                              ELEMNAME_TEMPLATE = 19, ELEMNAME_SORT = 64,
-                              ELEMNAME_STRIPSPACE = 32,
-                              ELEMNAME_STYLESHEET = 25, ELEMNAME_TEXT = 42,
-                              ELEMNAME_VALUEOF = 30, ELEMNAME_WHEN = 38,
-
-  // Pattern by example support  
-  ELEMNAME_ROOT = 44, ELEMNAME_ANY = 45, ELEMNAME_ELEMENT = 46,
-                      ELEMNAME_TARGETELEMENT = 47, ELEMNAME_ATTRIBUTE = 48,
-                      ELEMNAME_TARGETATTRIBUTE = 49, ELEMNAME_URL = 52,  // my own
-                      ELEMNAME_CALL = 55,  // my own
-
-  //  ELEMNAME_WITHPARAM = 56,
-  ELEMNAME_FALLBACK = 57,  // my own
-  ELEMNAME_TARGETPI = 60,  // my own
-  ELEMNAME_TARGETCOMMENT = 61,  // my own
-  ELEMNAME_TARGETTEXT = 62,  // my own
-  ELEMNAME_CSSSTYLECONVERSION = 65,  // my own
-  ELEMNAME_COUNTER = 66, ELEMNAME_COUNTERS = 67,
-  ELEMNAME_COUNTERINCREMENT = 68, ELEMNAME_COUNTERRESET = 69,
-  ELEMNAME_COUNTERSCOPE = 71, ELEMNAME_APPLY_IMPORTS = 72,
-  ELEMNAME_VARIABLE = 73, ELEMNAME_MESSAGE = 75, ELEMNAME_LOCALE = 76,
-  ELEMNAME_LITERALRESULT = 77, ELEMNAME_TEXTLITERALRESULT = 78,
-  ELEMNAME_EXTENSIONCALL = 79, ELEMNAME_EXTENSIONDECL = 85,
-  ELEMNAME_EXTENSIONSCRIPT = 86, ELEMNAME_OUTPUT = 80,
-  ELEMNAME_COMPONENT = 81, ELEMNAME_SCRIPT = 82;
-
-  // Next free number: 87
-
-  /**
-   * Literals for XSL element names.  Note that there are more
-   * names than IDs, because some names map to the same ID.
-   */
-  public static final String       
-	  ELEMNAME_ANCHOR_STRING = "anchor",
-      ELEMNAME_ANY_STRING = "any",  // pattern-by-example support
-      ELEMNAME_APPLY_IMPORTS_STRING = "apply-imports",
-      ELEMNAME_APPLY_TEMPLATES_STRING = "apply-templates",
-      ELEMNAME_ARG_STRING = "arg",
-      ELEMNAME_ATTRIBUTESET_STRING = "attribute-set",
-      ELEMNAME_ATTRIBUTE_STRING = "attribute",  // pattern-by-example support
-      ELEMNAME_CALLTEMPLATEARG_STRING = "invoke-arg",
-      ELEMNAME_CALLTEMPLATE_STRING = "call-template",
-      ELEMNAME_CALL_STRING = "call",
-      ELEMNAME_CHILDREN_STRING = "children",
-      ELEMNAME_CHOOSE_STRING = "choose",
-      ELEMNAME_COMMENT_STRING = "comment",
-      ELEMNAME_COMPONENT_STRING = "component",
-      ELEMNAME_CONSTRUCT_STRING = "construct",  // my own
-      ELEMNAME_CONTENTS_STRING = "contents", 
-      ELEMNAME_COPY_OF_STRING ="copy-of",
-      ELEMNAME_COPY_STRING = "copy",
-      ELEMNAME_COUNTERINCREMENT_STRING = "counter-increment",
-      ELEMNAME_COUNTERRESET_STRING = "counter-reset",
-      ELEMNAME_COUNTERSCOPE_STRING = "counter-scope",
-      ELEMNAME_COUNTERS_STRING = "counters",
-      ELEMNAME_COUNTER_STRING = "counter",
-      ELEMNAME_CSSSTYLECONVERSION_STRING = "css-style-conversion",
-      ELEMNAME_DECIMALFORMAT_STRING = "decimal-format",
-      ELEMNAME_DISPLAYIF_STRING = "display-if",  // my own
-      ELEMNAME_ELEMENT_STRING = "element",  // pattern-by-example support
-      ELEMNAME_EMPTY_STRING = "empty",
-      ELEMNAME_EVAL_STRING = "eval",
-      ELEMNAME_EXPECTEDCHILDREN_STRING = "expectedchildren",
-      ELEMNAME_EXTENSIONHANDLER_STRING = "code-dispatcher",
-      ELEMNAME_EXTENSION_STRING = "functions",
-      ELEMNAME_FALLBACK_STRING = "fallback",
-      ELEMNAME_FOREACH_STRING = "for-each",
-      ELEMNAME_IF_STRING = "if",
-      ELEMNAME_IMPORT_STRING = "import",
-      ELEMNAME_INCLUDE_STRING = "include",
-      ELEMNAME_KEY_STRING = "key",
-      ELEMNAME_LOCALE_STRING = "locale",
-      ELEMNAME_MESSAGE_STRING = "message",
-      ELEMNAME_NSALIAS_STRING = "namespace-alias",
-      ELEMNAME_NUMBER_STRING = "number",
-      ELEMNAME_OTHERWISE_STRING = "otherwise",
-      ELEMNAME_OUTPUT_STRING = "output",
-      ELEMNAME_PARAMVARIABLE_STRING = "param",
-      ELEMNAME_PI_OLD_STRING = "pi",
-      ELEMNAME_PI_STRING = "processing-instruction",
-      ELEMNAME_PRESERVESPACE_STRING = "preserve-space",
-      ELEMNAME_ROOT_STRING = "root",  // pattern-by-example support
-      ELEMNAME_SCRIPT_STRING = "script",
-      ELEMNAME_SORT_STRING = "sort",
-      ELEMNAME_STRIPSPACE_STRING = "strip-space",
-      ELEMNAME_STYLESHEET_STRING = "stylesheet",
-      ELEMNAME_TARGETATTRIBUTE_STRING = "target-attribute",  // pattern-by-example support
-      ELEMNAME_TARGETCOMMENT_STRING = "target-comment",
-      ELEMNAME_TARGETELEMENT_STRING = "target-element",  // pattern-by-example support
-      ELEMNAME_TARGETPI_STRING = "target-pi",
-      ELEMNAME_TARGETTEXT_STRING = "target-text",
-      ELEMNAME_TEMPLATE_STRING = "template",
-      ELEMNAME_TEXT_STRING = "text",
-      ELEMNAME_TRANSFORM_STRING = "transform",
-      ELEMNAME_URL_STRING = "uri",  // pattern-by-example support
-      ELEMNAME_USE_STRING = "use",
-      ELEMNAME_VALUEOF_STRING = "value-of",
-      ELEMNAME_VARIABLE_STRING = "variable",
-      ELEMNAME_WHEN_STRING = "when",
-      ELEMNAME_WITHPARAM_STRING = "with-param";
-  
-  /**
-   * Literals for XSL attribute names.  Note that there may be more
-   * names than IDs, because some names may map to the same ID.
-   */
-  public static final String
-	  ATTRNAME_AMOUNT = "amount",
-      ATTRNAME_ANCESTOR = "ancestor",
-      ATTRNAME_ARCHIVE = "archive",
-      ATTRNAME_ATTRIBUTE = "attribute",
-      ATTRNAME_ATTRIBUTE_SET = "attribute-set",
-      ATTRNAME_CASEORDER = "case-order",
-      ATTRNAME_CLASS = "class",
-      ATTRNAME_CLASSID = "classid",
-      ATTRNAME_CODEBASE = "codebase",
-      ATTRNAME_CODETYPE = "type",
-      ATTRNAME_CONDITION = "condition",
-      ATTRNAME_COPYTYPE = "copy-type",
-      ATTRNAME_COUNT = "count",
-      ATTRNAME_DATATYPE = "data-type",
-      ATTRNAME_DECIMALSEPARATOR = "decimal-separator",
-      ATTRNAME_DEFAULT = "default",
-      ATTRNAME_DEFAULTSPACE = "default-space",
-      ATTRNAME_DEPTH = "with-children",
-      ATTRNAME_DIGIT = "digit",
-      ATTRNAME_DIGITGROUPSEP = "digit-group-sep",
-      ATTRNAME_DISABLE_OUTPUT_ESCAPING = "disable-output-escaping",
-      ATTRNAME_ELEMENT = "element",
-      ATTRNAME_ELEMENTS = "elements",
-      ATTRNAME_EXCLUDE_RESULT_PREFIXES ="exclude-result-prefixes",
-      ATTRNAME_EXPR = "expr",
-      ATTRNAME_EXTENSIONELEMENTPREFIXES = "extension-element-prefixes",
-      ATTRNAME_FORMAT = "format",
-      ATTRNAME_FROM = "from",
-      ATTRNAME_GROUPINGSEPARATOR = "grouping-separator",
-      ATTRNAME_GROUPINGSIZE = "grouping-size",
-      ATTRNAME_HREF = "href",
-      ATTRNAME_ID = "id",
-      ATTRNAME_IMPORTANCE = "importance",
-      ATTRNAME_INDENTRESULT = "indent-result",
-      ATTRNAME_INFINITY = "infinity",
-      ATTRNAME_LANG = "lang",
-      ATTRNAME_LETTERVALUE = "letter-value",
-      ATTRNAME_LEVEL = "level",
-      ATTRNAME_MATCH = "match",
-      ATTRNAME_METHOD = "calls",
-      ATTRNAME_MINUSSIGN = "minus-sign",
-      ATTRNAME_MODE = "mode",
-      ATTRNAME_NAME = "name",
-      ATTRNAME_NAMESPACE = "namespace",
-      ATTRNAME_NAN = "NaN",
-      ATTRNAME_NDIGITSPERGROUP = "n-digits-per-group",
-      ATTRNAME_NS = "ns",
-      ATTRNAME_ONLY = "only",
-      ATTRNAME_ORDER = "order",
-      ATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS = "cdata-section-elements",
-      ATTRNAME_OUTPUT_DOCTYPE_PUBLIC = "doctype-public",
-      ATTRNAME_OUTPUT_DOCTYPE_SYSTEM = "doctype-system",
-      ATTRNAME_OUTPUT_ENCODING = "encoding",
-      ATTRNAME_OUTPUT_INDENT = "indent",
-      ATTRNAME_OUTPUT_MEDIATYPE = "media-type",
-      ATTRNAME_OUTPUT_METHOD = "method",  // qname, 
-      ATTRNAME_OUTPUT_OMITXMLDECL = "omit-xml-declaration",
-      ATTRNAME_OUTPUT_STANDALONE = "standalone",
-      ATTRNAME_OUTPUT_VERSION = "version",
-      ATTRNAME_PATTERNSEPARATOR = "pattern-separator",
-      ATTRNAME_PERCENT = "percent",
-      ATTRNAME_PERMILLE = "per-mille",
-      ATTRNAME_PRIORITY = "priority",
-      ATTRNAME_REFID = "refID",
-      ATTRNAME_RESULTNS = "result-ns",
-      ATTRNAME_RESULT_PREFIX = "result-prefix",
-      ATTRNAME_SELECT = "select",
-      ATTRNAME_SEQUENCESRC = "sequence-src",
-      ATTRNAME_STYLE = "style",
-      ATTRNAME_STYLESHEET_PREFIX = "stylesheet-prefix",
-      ATTRNAME_TERMINATE = "terminate",
-      ATTRNAME_TEST = "test",
-      ATTRNAME_TOSTRING = "to-string",
-      ATTRNAME_TYPE = "type",
-      ATTRNAME_USE = "use",
-      ATTRNAME_USEATTRIBUTESETS = "use-attribute-sets",
-      ATTRNAME_VALUE = "value",
-      ATTRNAME_VERSION = "version",
-      ATTRNAME_XMLNS = "xmlns:", // namespace declaration prefix -- NOT an attribute by itself
-      ATTRNAME_XMLNSDEF = "xmlns", // default namespace
-      ATTRNAME_XMLSPACE = "xml:space", 
-      ATTRNAME_ZERODIGIT = "zero-digit";
-
-  /** IDs for XSL attribute types. These are associated
-   * with the string literals in the TransformerImpl class.
-   * Don't change the numbers. NOTE THAT THESE ARE NOT IN
-   * ALPHABETICAL ORDER!
-   */
-  public static final int TATTRNAME_OUTPUT_METHOD = 1, TATTRNAME_AMOUNT = 2,
-                          TATTRNAME_ANCESTOR = 3, TATTRNAME_ARCHIVE = 4,
-                          TATTRNAME_ATTRIBUTE = 5,
-                          TATTRNAME_ATTRIBUTE_SET = 6,
-                          TATTRNAME_CASEORDER = 7, TATTRNAME_CLASS = 8,
-                          TATTRNAME_CLASSID = 9, TATTRNAME_CODEBASE = 10,
-                          TATTRNAME_CODETYPE = 11, TATTRNAME_CONDITION = 12,
-                          TATTRNAME_COPYTYPE = 13, TATTRNAME_COUNT = 14,
-                          TATTRNAME_DATATYPE = 15, TATTRNAME_DEFAULT = 16,
-                          TATTRNAME_DEFAULTSPACE = 17, TATTRNAME_DEPTH = 18,
-                          TATTRNAME_DIGITGROUPSEP = 19,
-                          TATTRNAME_DISABLE_OUTPUT_ESCAPING = 20,
-                          TATTRNAME_ELEMENT = 21, TATTRNAME_ELEMENTS = 22,
-                          TATTRNAME_EXPR = 23,
-                          TATTRNAME_EXTENSIONELEMENTPREFIXES = 24,
-                          TATTRNAME_FORMAT = 25, TATTRNAME_FROM = 26,
-                          TATTRNAME_GROUPINGSEPARATOR = 27,
-                          TATTRNAME_GROUPINGSIZE = 28, TATTRNAME_HREF = 29,
-                          TATTRNAME_ID = 30, TATTRNAME_IMPORTANCE = 31,
-                          TATTRNAME_INDENTRESULT = 32, TATTRNAME_LANG = 33,
-                          TATTRNAME_LETTERVALUE = 34, TATTRNAME_LEVEL = 35,
-                          TATTRNAME_MATCH = 36, TATTRNAME_METHOD = 37,
-                          TATTRNAME_MODE = 38, TATTRNAME_NAME = 39,
-                          TATTRNAME_NAMESPACE = 40,
-                          TATTRNAME_NDIGITSPERGROUP = 41, TATTRNAME_NS = 42,
-                          TATTRNAME_ONLY = 43, TATTRNAME_ORDER = 44,
-                          TATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS = 45,
-                          TATTRNAME_OUTPUT_DOCTYPE_PUBLIC = 46,
-                          TATTRNAME_OUTPUT_DOCTYPE_SYSTEM = 47,
-                          TATTRNAME_OUTPUT_ENCODING = 48,
-                          TATTRNAME_OUTPUT_INDENT = 49,
-                          TATTRNAME_OUTPUT_MEDIATYPE = 50,
-                          TATTRNAME_OUTPUT_STANDALONE = 51,
-                          TATTRNAME_OUTPUT_VERSION = 52,
-                          TATTRNAME_OUTPUT_OMITXMLDECL = 53,
-                          TATTRNAME_PRIORITY = 54, TATTRNAME_REFID = 55,
-                          TATTRNAME_RESULTNS = 56, TATTRNAME_SELECT = 57,
-                          TATTRNAME_SEQUENCESRC = 58, TATTRNAME_STYLE = 59,
-                          TATTRNAME_TEST = 60, TATTRNAME_TOSTRING = 61,
-                          TATTRNAME_TYPE = 62, TATTRNAME_USE = 63,
-                          TATTRNAME_USEATTRIBUTESETS = 64,
-                          TATTRNAME_VALUE = 65, TATTRNAME_XMLNSDEF = 66,
-                          TATTRNAME_XMLNS = 67, TATTRNAME_XMLSPACE = 68,
-                          TATTRNAME_EXCLUDE_RESULT_PREFIXES = 69;
-
-  /** Mnemonics for the possible values of the xsl:output element's
-   * method= attribute:
-   * <ul>
-   * <li>ATTRVAL_OUTPUT_METHOD_XML = Use an XML formatter to
-   * produce the output document (basic XSLT operation).</li>
-   * <li>ATTRVAL_OUTPUT_METHOD_HTML: Use an HTML formatter to
-   * produce the output document. When generating HTML documents,
-   * this may yield better results; it does things like escaping
-   * characters in href attributes.</li>
-   * </li>ATTRVAL_OUTPUT_METHOD_TEXT:  Use a Text formatter to
-   * produce the output document. Generally the right choice if your
-   * stylesheet wants to take over _all_ the details of formatting,
-   * most often when producing something that isn't an XML or HTML
-   * document.</li>
-   * </ul> 
-   * */
-  public static final String ATTRVAL_OUTPUT_METHOD_HTML = "html",
-                             ATTRVAL_OUTPUT_METHOD_XML = "xml",
-                             ATTRVAL_OUTPUT_METHOD_TEXT = "text";
-
-  
-  /* For space-att*/
-  public static final int ATTRVAL_PRESERVE = 1, ATTRVAL_STRIP = 2;
-
-  
-  /** For indent-result          */
-  public static final boolean ATTRVAL_YES = true, ATTRVAL_NO = false;
-
-  
-  /** For letter-value attribute (part of conversion attributes).          */
-  public static final String ATTRVAL_ALPHABETIC = "alphabetic",
-                             ATTRVAL_OTHER = "other",
-                             ATTRVAL_TRADITIONAL = "traditional";
-
-  
-  /** For level attribute in xsl:number.          */
-  public static final String ATTRVAL_SINGLE = "single",
-                             ATTRVAL_MULTI = "multiple", ATTRVAL_ANY = "any";
-
-  
-  /** For Stylesheet-prefix and result-prefix in xsl:namespace-alias          */
-  public static final String ATTRVAL_DEFAULT_PREFIX = "#default";
-
-  
-  /** Integer equivelents for above        */
-  public static final int NUMBERLEVEL_SINGLE = 1, NUMBERLEVEL_MULTI = 2,
-                          NUMBERLEVEL_ANY = 3, MAX_MULTI_COUNTING_DEPTH = 32;
-
-  
-  /** some stuff for my patterns-by-example         */
-  public static final String ATTRVAL_THIS = ".", ATTRVAL_PARENT = "..",
-                             ATTRVAL_ANCESTOR = "ancestor", ATTRVAL_ID = "id";
-
-  
-  /** Stuff for sorting      */
-  public static final String ATTRVAL_DATATYPE_TEXT = "text",
-                             ATTRVAL_DATATYPE_NUMBER = "number",
-                             ATTRVAL_ORDER_ASCENDING = "ascending",
-                             ATTRVAL_ORDER_DESCENDING = "descending",
-                             ATTRVAL_CASEORDER_UPPER = "upper-first",
-                             ATTRVAL_CASEORDER_LOWER = "lower-first";
-
-  
-  /** some stuff for Decimal-format       */
-  public static final String ATTRVAL_INFINITY = "Infinity",
-                             ATTRVAL_NAN = "NaN",
-                             DEFAULT_DECIMAL_FORMAT = "#default";
-
-  
-  /** temp dummy         */
-  public static final String ATTRNAME_XXXX = "XXXX";
-}
diff --git a/src/org/apache/xalan/templates/DecimalFormatProperties.java b/src/org/apache/xalan/templates/DecimalFormatProperties.java
deleted file mode 100644
index 56e2d2e..0000000
--- a/src/org/apache/xalan/templates/DecimalFormatProperties.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-
-import java.util.*;
-
-import java.text.NumberFormat;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.*;
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:decimal-format.
- * <pre>
- * <!ELEMENT xsl:decimal-format EMPTY>
- * <!ATTLIST xsl:decimal-format
- *   name %qname; #IMPLIED
- *   decimal-separator %char; "."
- *   grouping-separator %char; ","
- *   infinity CDATA "Infinity"
- *   minus-sign %char; "-"
- *   NaN CDATA "NaN"
- *   percent %char; "%"
- *   per-mille %char; "&#x2030;"
- *   zero-digit %char; "0"
- *   digit %char; "#"
- *   pattern-separator %char; ";"
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#format-number">format-number in XSLT Specification</a>
- */
-public class DecimalFormatProperties extends ElemTemplateElement
-{
-
-  /** An instance of DecimalFormatSymbols for this element.
-   *  @serial       */
-  DecimalFormatSymbols m_dfs;
-
-  /**
-   * Constructor DecimalFormatProperties
-   *
-   */
-  public DecimalFormatProperties(int docOrderNumber)
-  {
-
-    m_dfs = new java.text.DecimalFormatSymbols();
-
-    // Set default values, they can be overiden if necessary.  
-    m_dfs.setInfinity(Constants.ATTRVAL_INFINITY);
-    m_dfs.setNaN(Constants.ATTRVAL_NAN);
-
-    m_docOrderNumber = docOrderNumber;
-  }
-
-  /**
-   * Return the decimal format Symbols for this element.
-   * <p>The xsl:decimal-format element declares a decimal-format,
-   * which controls the interpretation of a format pattern used by
-   * the format-number function. If there is a name attribute, then
-   * the element declares a named decimal-format; otherwise, it
-   * declares the default decimal-format. The value of the name
-   * attribute is a QName, which is expanded as described in [2.4 Qualified Names].
-   * It is an error to declare either the default decimal-format or a
-   * decimal-format with a given name more than once (even with different
-   * import precedence), unless it is declared every time with the same
-   * value for all attributes (taking into account any default values).</p>
-   * <p>The other attributes on xsl:decimal-format correspond to the
-   * methods on the JDK 1.1 DecimalFormatSymbols class. For each get/set
-   * method pair there is an attribute defined for the xsl:decimal-format
-   * element.</p>
-   *
-   * @return the decimal format Symbols for this element.
-   */
-  public DecimalFormatSymbols getDecimalFormatSymbols()
-  {
-    return m_dfs;
-  }
-
-  /**
-   * If there is a name attribute, then the element declares a named
-   * decimal-format; otherwise, it declares the default decimal-format.
-   * @serial
-   */
-  private QName m_qname = null;
-
-  /**
-   * Set the "name" attribute.
-   * If there is a name attribute, then the element declares a named
-   * decimal-format; otherwise, it declares the default decimal-format.
-   *
-   * @param qname The name to set as the "name" attribute.
-   */
-  public void setName(QName qname)
-  {
-    m_qname = qname;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * If there is a name attribute, then the element declares a named
-   * decimal-format; otherwise, it declares the default decimal-format.
-   *
-   * @return the value of the "name" attribute.
-   */
-  public QName getName()
-  {
-
-    if (m_qname == null)
-      return new QName("");
-    else
-      return m_qname;
-  }
-
-  /**
-   * Set the "decimal-separator" attribute.
-   * decimal-separator specifies the character used for the decimal sign;
-   * the default value is the period character (.).
-   *
-   * @param ds Character to set as decimal separator 
-   */
-  public void setDecimalSeparator(char ds)
-  {
-    m_dfs.setDecimalSeparator(ds);
-  }
-
-  /**
-   * Get the "decimal-separator" attribute.
-   * decimal-separator specifies the character used for the decimal sign;
-   * the default value is the period character (.).
-   *
-   * @return the character to use as decimal separator
-   */
-  public char getDecimalSeparator()
-  {
-    return m_dfs.getDecimalSeparator();
-  }
-
-  /**
-   * Set the "grouping-separator" attribute.
-   * grouping-separator specifies the character used as a grouping
-   * (e.g. thousands) separator; the default value is the comma character (,).
-   *
-   * @param gs Character to use a grouping separator 
-   */
-  public void setGroupingSeparator(char gs)
-  {
-    m_dfs.setGroupingSeparator(gs);
-  }
-
-  /**
-   * Get the "grouping-separator" attribute.
-   * grouping-separator specifies the character used as a grouping
-   * (e.g. thousands) separator; the default value is the comma character (,).
-   *
-   * @return Character to use a grouping separator 
-   */
-  public char getGroupingSeparator()
-  {
-    return m_dfs.getGroupingSeparator();
-  }
-
-  /**
-   * Set the "infinity" attribute.
-   * infinity specifies the string used to represent infinity;
-   * the default value is the string Infinity.
-   *
-   * @param inf String to use as the "infinity" attribute.
-   */
-  public void setInfinity(String inf)
-  {
-    m_dfs.setInfinity(inf);
-  }
-
-  /**
-   * Get the "infinity" attribute.
-   * infinity specifies the string used to represent infinity;
-   * the default value is the string Infinity.
-   *
-   * @return String to use as the "infinity" attribute.
-   */
-  public String getInfinity()
-  {
-    return m_dfs.getInfinity();
-  }
-
-  /**
-   * Set the "minus-sign" attribute.
-   * minus-sign specifies the character used as the default minus sign; the
-   * default value is the hyphen-minus character (-, #x2D).
-   *
-   * @param v Character to use as minus sign
-   */
-  public void setMinusSign(char v)
-  {
-    m_dfs.setMinusSign(v);
-  }
-
-  /**
-   * Get the "minus-sign" attribute.
-   * minus-sign specifies the character used as the default minus sign; the
-   * default value is the hyphen-minus character (-, #x2D).
-   *
-   * @return Character to use as minus sign
-   */
-  public char getMinusSign()
-  {
-    return m_dfs.getMinusSign();
-  }
-
-  /**
-   * Set the "NaN" attribute.
-   * NaN specifies the string used to represent the NaN value;
-   * the default value is the string NaN.
-   *
-   * @param v String to use as the "NaN" attribute.
-   */
-  public void setNaN(String v)
-  {
-    m_dfs.setNaN(v);
-  }
-
-  /**
-   * Get the "NaN" attribute.
-   * NaN specifies the string used to represent the NaN value;
-   * the default value is the string NaN.
-   *
-   * @return String to use as the "NaN" attribute.
-   */
-  public String getNaN()
-  {
-    return m_dfs.getNaN();
-  }
-
-  /**
-   * Set the "percent" attribute.
-   * percent specifies the character used as a percent sign; the default
-   * value is the percent character (%).
-   *
-   * @param v Character to use as percent 
-   */
-  public void setPercent(char v)
-  {
-    m_dfs.setPercent(v);
-  }
-
-  /**
-   * Get the "percent" attribute.
-   * percent specifies the character used as a percent sign; the default
-   * value is the percent character (%).
-   *
-   * @return Character to use as percent 
-   */
-  public char getPercent()
-  {
-    return m_dfs.getPercent();
-  }
-
-  /**
-   * Set the "per-mille" attribute.
-   * per-mille specifies the character used as a per mille sign; the default
-   * value is the Unicode per-mille character (#x2030).
-   *
-   * @param v Character to use as per-mille
-   */
-  public void setPerMille(char v)
-  {
-    m_dfs.setPerMill(v);
-  }
-
-  /**
-   * Get the "per-mille" attribute.
-   * per-mille specifies the character used as a per mille sign; the default
-   * value is the Unicode per-mille character (#x2030).
-   *
-   * @return Character to use as per-mille 
-   */
-  public char getPerMille()
-  {
-    return m_dfs.getPerMill();
-  }
-
-  /**
-   * Set the "zero-digit" attribute.
-   * zero-digit specifies the character used as the digit zero; the default
-   * value is the digit zero (0).
-   *
-   * @param v Character to use as the digit zero
-   */
-  public void setZeroDigit(char v)
-  {
-    m_dfs.setZeroDigit(v);
-  }
-
-  /**
-   * Get the "zero-digit" attribute.
-   * zero-digit specifies the character used as the digit zero; the default
-   * value is the digit zero (0).
-   *
-   * @return Character to use as the digit zero
-   */
-  public char getZeroDigit()
-  {
-    return m_dfs.getZeroDigit();
-  }
-
-  /**
-   * Set the "digit" attribute.
-   * digit specifies the character used for a digit in the format pattern;
-   * the default value is the number sign character (#).
-   *
-   * @param v Character to use for a digit in format pattern
-   */
-  public void setDigit(char v)
-  {
-    m_dfs.setDigit(v);
-  }
-
-  /**
-   * Get the "digit" attribute.
-   * digit specifies the character used for a digit in the format pattern;
-   * the default value is the number sign character (#).
-   *
-   * @return Character to use for a digit in format pattern
-   */
-  public char getDigit()
-  {
-    return m_dfs.getDigit();
-  }
-
-  /**
-   * Set the "pattern-separator" attribute.
-   * pattern-separator specifies the character used to separate positive
-   * and negative sub patterns in a pattern; the default value is the
-   * semi-colon character (;).
-   *
-   * @param v Character to use as a pattern separator
-   */
-  public void setPatternSeparator(char v)
-  {
-    m_dfs.setPatternSeparator(v);
-  }
-
-  /**
-   * Get the "pattern-separator" attribute.
-   * pattern-separator specifies the character used to separate positive
-   * and negative sub patterns in a pattern; the default value is the
-   * semi-colon character (;).
-   *
-   * @return Character to use as a pattern separator
-   */
-  public char getPatternSeparator()
-  {
-    return m_dfs.getPatternSeparator();
-  }
-
-  /**
-   * This function is called to recompose() all of the decimal format properties elements.
-   * 
-   * @param root Stylesheet root
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeDecimalFormats(this);
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/ElemApplyImport.java b/src/org/apache/xalan/templates/ElemApplyImport.java
deleted file mode 100644
index 453743e..0000000
--- a/src/org/apache/xalan/templates/ElemApplyImport.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.DOMException;
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xml.utils.QName;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:apply-imports.
- * <pre>
- * <!ELEMENT xsl:apply-imports EMPTY>
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#apply-imports">apply-imports in XSLT Specification</a>
- */
-public class ElemApplyImport extends ElemTemplateElement
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return Token ID for xsl:apply-imports element types
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_APPLY_IMPORTS;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return Element name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_APPLY_IMPORTS_STRING;
-  }
-
-  /**
-   * Execute the xsl:apply-imports transformation.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (transformer.currentTemplateRuleIsNull())
-    {
-      transformer.getMsgMgr().error(this,
-        XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH);  //"xsl:apply-imports not allowed in a xsl:for-each");
-    }
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    int sourceNode = transformer.getXPathContext().getCurrentNode();
-    if (DTM.NULL != sourceNode)
-    {
-
-      // This will have to change to current template, (which will have 
-      // to be the top of a current template stack).
-      transformer.applyTemplateToNode(this, null, sourceNode);
-    }
-    else  // if(null == sourceNode)
-    {
-      transformer.getMsgMgr().error(this,
-        XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS);  //"sourceNode is null in xsl:apply-imports!");
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   * <!ELEMENT xsl:apply-imports EMPTY>
-   *
-   * @param newChild New element to append to this element's children list
-   *
-   * @return null, xsl:apply-Imports cannot have children 
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    error(XSLTErrorResources.ER_CANNOT_ADD,
-          new Object[]{ newChild.getNodeName(),
-                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    return null;
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemApplyTemplates.java b/src/org/apache/xalan/templates/ElemApplyTemplates.java
deleted file mode 100644
index 817fdf5..0000000
--- a/src/org/apache/xalan/templates/ElemApplyTemplates.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-
-import java.util.Vector;
-
-import org.apache.xalan.trace.TracerEvent;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.VariableStack;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xalan.transformer.ClonerToResultTree;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.Axis;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.SourceLocator;
-
-import org.apache.xml.dtm.DTMManager;
-
-// Experemental
-import org.apache.xml.dtm.ref.ExpandedNameTable;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:apply-templates.
- * <pre>
- * &amp;!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*>
- * &amp;!ATTLIST xsl:apply-templates
- *   select %expr; "node()"
- *   mode %qname; #IMPLIED
- * &amp;
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Applying-Template-Rules">section-Applying-Template-Rules in XSLT Specification</a>
- */
-public class ElemApplyTemplates extends ElemCallTemplate
-{
-
-  /**
-   * mode %qname; #IMPLIED
-   * @serial
-   */
-  private QName m_mode = null;
-
-  /**
-   * Set the mode attribute for this element.
-   *
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   */
-  public void setMode(QName mode)
-  {
-    m_mode = mode;
-  }
-
-  /**
-   * Get the mode attribute for this element.
-   *
-   * @return The mode attribute for this element
-   */
-  public QName getMode()
-  {
-    return m_mode;
-  }
-
-  /**
-   * Tells if this belongs to a default template,
-   * in which case it will act different with
-   * regard to processing modes.
-   * @see <a href="http://www.w3.org/TR/xslt#built-in-rule">built-in-rule in XSLT Specification</a>
-   * @serial
-   */
-  private boolean m_isDefaultTemplate = false;
-  
-//  /**
-//   * List of namespace/localname IDs, for identification of xsl:with-param to 
-//   * xsl:params.  Initialized in the compose() method.
-//   */
-//  private int[] m_paramIDs;
-
-  /**
-   * Set if this belongs to a default template,
-   * in which case it will act different with
-   * regard to processing modes.
-   * @see <a href="http://www.w3.org/TR/xslt#built-in-rule">built-in-rule in XSLT Specification</a>
-   *
-   * @param b boolean value to set.
-   */
-  public void setIsDefaultTemplate(boolean b)
-  {
-    m_isDefaultTemplate = b;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return Token ID for this element types
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_APPLY_TEMPLATES;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return Element name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_APPLY_TEMPLATES_STRING;
-  }
-
-  /**
-   * Apply the context node to the matching templates.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Applying-Template-Rules">section-Applying-Template-Rules in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-
-    transformer.pushCurrentTemplateRuleIsNull(false);
-
-    boolean pushMode = false;
-
-    try
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      // %REVIEW% Do we need this check??
-      //      if (null != sourceNode)
-      //      {
-      // boolean needToTurnOffInfiniteLoopCheck = false;
-      QName mode = transformer.getMode();
-
-      if (!m_isDefaultTemplate)
-      {
-        if (((null == mode) && (null != m_mode))
-                || ((null != mode) &&!mode.equals(m_mode)))
-        {
-          pushMode = true;
-
-          transformer.pushMode(m_mode);
-        }
-      }
-      transformSelectedNodes(transformer);
-    }
-    finally
-    {
-      if (pushMode)
-        transformer.popMode();
-
-      transformer.popCurrentTemplateRuleIsNull();
-    }
-  }
-
-  
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Perform a query if needed, and call transformNode for each child.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param template The owning template context.
-   *
-   * @throws TransformerException Thrown in a variety of circumstances.
-   */
-  public void transformSelectedNodes(TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    final XPathContext xctxt = transformer.getXPathContext();
-    final int sourceNode = xctxt.getCurrentNode();
-    DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode);
-    VariableStack vars = xctxt.getVarStack();
-    int nParams = getParamElemCount();
-
-    try
-    {
-
-      final Vector keys = (m_sortElems == null)
-                          ? null
-                          : transformer.processSortKeys(this, sourceNode);
-
-      // Sort if we need to.
-      if (null != keys)
-        sourceNodes = sortNodes(xctxt, keys, sourceNodes);
-
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-                "select", new XPath(m_selectExpression),
-                new org.apache.xpath.objects.XNodeSet(sourceNodes));
-
-      final ResultTreeHandler rth = transformer.getResultTreeHandler();
-      ContentHandler chandler = rth.getContentHandler();
-      final StylesheetRoot sroot = transformer.getStylesheet();
-      final TemplateList tl = sroot.getTemplateListComposed();
-      final boolean quiet = transformer.getQuietConflictWarnings();
-      
-      xctxt.pushCurrentNode(DTM.NULL);
-      int[] currentNodes = xctxt.getCurrentNodeStack();
-      int currentNodePos = xctxt.getCurrentNodeFirstFree() - 1;
-      
-      xctxt.pushCurrentExpressionNode(DTM.NULL);
-      int[] currentExpressionNodes = xctxt.getCurrentExpressionNodeStack();
-      int currentExpressionNodePos = xctxt.getCurrentExpressionNodesFirstFree() - 1;
-
-      xctxt.pushSAXLocatorNull();
-      xctxt.pushContextNodeList(sourceNodes);
-      transformer.pushElemTemplateElement(null);
-      // pushParams(transformer, xctxt);
-
-      // Should be able to get this from the iterator but there must be a bug.
-      DTM dtm = xctxt.getDTM(sourceNode);
-      int docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
-      
-      int argsFrame = -1;
-      if(nParams > 0)
-      {
-        // This code will create a section on the stack that is all the 
-        // evaluated arguments.  These will be copied into the real params 
-        // section of each called template.
-        int thisframe = vars.getStackFrame();
-        argsFrame = vars.link(nParams);
-        vars.setStackFrame(thisframe);
-        
-        for (int i = 0; i < nParams; i++) 
-        {
-          ElemWithParam ewp = m_paramElems[i];
-          XObject obj = ewp.getValue(transformer, sourceNode);
-          
-          vars.setLocalVariable(i, obj, argsFrame);
-        }
-        vars.setStackFrame(argsFrame);
-      }
-      
-      
-      int child;
-      while (DTM.NULL != (child = sourceNodes.nextNode()))
-      {
-        currentNodes[currentNodePos] = child;
-        currentExpressionNodes[currentExpressionNodePos] = child;
-
-        if((child & DTMManager.IDENT_DTM_DEFAULT) != docID)
-        {
-          dtm = xctxt.getDTM(child);
-          docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
-        }
-        
-        final int exNodeType = dtm.getExpandedTypeID(child);
-        final int nodeType = (exNodeType >> ExpandedNameTable.ROTAMOUNT_TYPE);
-
-        final QName mode = transformer.getMode();
-
-        ElemTemplate template = tl.getTemplateFast(xctxt, child, exNodeType, mode, 
-                                      -1, quiet, dtm);
-
-        // If that didn't locate a node, fall back to a default template rule.
-        // See http://www.w3.org/TR/xslt#built-in-rule.
-        if (null == template)
-        {
-          switch (nodeType)
-          {
-          case DTM.DOCUMENT_FRAGMENT_NODE :
-          case DTM.ELEMENT_NODE :
-            template = sroot.getDefaultRule();
-            // %OPT% direct faster?
-            break;
-          case DTM.ATTRIBUTE_NODE :
-          case DTM.CDATA_SECTION_NODE :
-          case DTM.TEXT_NODE :
-            // if(rth.m_elemIsPending || rth.m_docPending)
-            //  rth.flushPending(true);
-            transformer.pushPairCurrentMatched(sroot.getDefaultTextRule(), child);
-            transformer.setCurrentElement(sroot.getDefaultTextRule());
-            // dtm.dispatchCharactersEvents(child, chandler, false);
-            dtm.dispatchCharactersEvents(child, rth, false);
-            transformer.popCurrentMatched();
-            continue;
-          case DTM.DOCUMENT_NODE :
-            template = sroot.getDefaultRootRule();
-            break;
-          default :
-
-            // No default rules for processing instructions and the like.
-            continue;
-          }
-        }
-        
-        transformer.pushPairCurrentMatched(template, child);
-
-        if(template.m_frameSize > 0)
-        {
-          vars.link(template.m_frameSize);
-          // You can't do the check for nParams here, otherwise the 
-          // xsl:params might not be nulled.
-          if(/* nParams > 0 && */ template.m_inArgsSize > 0)
-          {
-            int paramIndex = 0;
-            for (ElemTemplateElement elem = template.getFirstChildElem(); 
-                 null != elem; elem = elem.getNextSiblingElem()) 
-            {
-              if(Constants.ELEMNAME_PARAMVARIABLE == elem.getXSLToken())
-              {
-                ElemParam ep = (ElemParam)elem;
-                
-                int i;
-                for (i = 0; i < nParams; i++) 
-                {
-                  ElemWithParam ewp = m_paramElems[i];
-                  if(ewp.m_qnameID == ep.m_qnameID)
-                  {
-                    XObject obj = vars.getLocalVariable(i, argsFrame);
-                    vars.setLocalVariable(paramIndex, obj);
-                    break;
-                  }
-                }
-                if(i == nParams)
-                  vars.setLocalVariable(paramIndex, null);
-              }
-              else
-                break;
-              paramIndex++;
-            }
-            
-          }
-        }
-
-        // if (check)
-        //  guard.push(this, child);
-
-        // Fire a trace event for the template.
-        if (TransformerImpl.S_DEBUG)
-          transformer.getTraceManager().fireTraceEvent(template);
-
-        // And execute the child templates.
-        // Loop through the children of the template, calling execute on 
-        // each of them.
-        for (ElemTemplateElement t = template.m_firstChild; 
-             t != null; t = t.m_nextSibling)
-        {
-          xctxt.setSAXLocator(t);
-          transformer.setCurrentElement(t);
-          t.execute(transformer);
-        }
-        
-        if(template.m_frameSize > 0)
-          vars.unlink();
-          
-        transformer.popCurrentMatched();
-        
-      } // end while (DTM.NULL != (child = sourceNodes.nextNode()))
-    }
-    catch (SAXException se)
-    {
-      transformer.getErrorListener().fatalError(new TransformerException(se));
-    }
-    finally
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this,
-                "select", new XPath(m_selectExpression),
-                new org.apache.xpath.objects.XNodeSet(sourceNodes));
-
-      if(nParams > 0)
-        vars.unlink();
-      xctxt.popSAXLocator();
-      xctxt.popContextNodeList();
-      transformer.popElemTemplateElement();
-      xctxt.popCurrentExpressionNode();
-      xctxt.popCurrentNode();
-      sourceNodes.detach();
-    }
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/ElemAttribute.java b/src/org/apache/xalan/templates/ElemAttribute.java
deleted file mode 100644
index e36b888..0000000
--- a/src/org/apache/xalan/templates/ElemAttribute.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.DOMException;
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xpath.XPathContext;
-
-import org.xml.sax.SAXException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:attribute.
- * <pre>
- * &amp;!ELEMENT xsl:attribute %char-template;>
- * &amp;!ATTLIST xsl:attribute
- *   name %avt; #REQUIRED
- *   namespace %avt; #IMPLIED
- *   %space-att;
- * &amp;
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#creating-attributes">creating-attributes in XSLT Specification</a>
- */
-public class ElemAttribute extends ElemElement
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_ATTRIBUTE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element name 
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_ATTRIBUTE_STRING;
-  }
-
-  /**
-   * Create an attribute in the result tree.
-   * @see <a href="http://www.w3.org/TR/xslt#creating-attributes">creating-attributes in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-    ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-
-    // If they are trying to add an attribute when there isn't an 
-    // element pending, it is an error.
-    if (!rhandler.isElementPending())
-    {
-      // Make sure the trace event is sent.
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      XPathContext xctxt = transformer.getXPathContext();
-      int sourceNode = xctxt.getCurrentNode();
-      String attrName = m_name_avt.evaluate(xctxt, sourceNode, this);
-      transformer.getMsgMgr().warn(this,
-                                   XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE,
-                                   new Object[]{ attrName });
-
-      return;
-
-      // warn(templateChild, sourceNode, "Trying to add attribute after element child has been added, ignoring...");
-    }
-    
-    super.execute(transformer);
-    
-  }
-  
-  /**
-   * Resolve the namespace into a prefix.  At this level, if no prefix exists, 
-   * then return a manufactured prefix.
-   *
-   * @param rhandler The current result tree handler.
-   * @param prefix The probable prefix if already known.
-   * @param nodeNamespace  The namespace, which should not be null.
-   *
-   * @return The prefix to be used.
-   */
-  protected String resolvePrefix(ResultTreeHandler rhandler,
-                                 String prefix, String nodeNamespace)
-    throws TransformerException
-  {
-
-    if (null != prefix && (prefix.length() == 0 || prefix.equals("xmlns")))
-    {
-      // Since we can't use default namespace, in this case we try and 
-      // see if a prefix has already been defined or this namespace.
-      prefix = rhandler.getPrefix(nodeNamespace);
-
-      // System.out.println("nsPrefix: "+nsPrefix);           
-      if (null == prefix || prefix.length() == 0 || prefix.equals("xmlns"))
-      {
-        if(nodeNamespace.length() > 0)
-        {
-          prefix = rhandler.getNewUniqueNSPrefix();
-        }
-        else
-          prefix = "";
-      }
-    }
-    return prefix;
-  }
-  
-  /**
-   * Validate that the node name is good.
-   * 
-   * @param nodeName Name of the node being constructed, which may be null.
-   * 
-   * @return true if the node name is valid, false otherwise.
-   */
-   protected boolean validateNodeName(String nodeName)
-   {
-      if(null == nodeName)
-        return false;
-      if(nodeName.equals("xmlns"))
-        return false;
-      return super.validateNodeName(nodeName);
-   }
-  
-  /**
-   * Construct a node in the result tree.  This method is overloaded by 
-   * xsl:attribute. At this class level, this method creates an element.
-   *
-   * @param nodeName The name of the node, which may be null.
-   * @param prefix The prefix for the namespace, which may be null.
-   * @param nodeNamespace The namespace of the node, which may be null.
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  void constructNode(
-          String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if(null != nodeName && nodeName.length() > 0)
-    {
-      ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-      if(prefix != null && prefix.length() > 0)
-      {
-        try
-        {
-          rhandler.startPrefixMapping(prefix, nodeNamespace, false);
-        }
-        catch(SAXException se)
-        {
-          throw new TransformerException(se);
-        }
-      }
-      String val = transformer.transformToString(this);
-      String localName = QName.getLocalPart(nodeName);
-      rhandler.addAttribute(nodeNamespace, localName, nodeName, "CDATA", val);
-    }
-  }
-
-
-  /**
-   * Add a child to the child list.
-   * <!ELEMENT xsl:attribute %char-template;>
-   * <!ATTLIST xsl:attribute
-   *   name %avt; #REQUIRED
-   *   namespace %avt; #IMPLIED
-   *   %space-att;
-   * >
-   *
-   * @param newChild Child to append to the list of this node's children
-   *
-   * @return The node we just appended to the children list 
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    switch (type)
-    {
-
-    // char-instructions 
-    case Constants.ELEMNAME_TEXTLITERALRESULT :
-    case Constants.ELEMNAME_APPLY_TEMPLATES :
-    case Constants.ELEMNAME_APPLY_IMPORTS :
-    case Constants.ELEMNAME_CALLTEMPLATE :
-    case Constants.ELEMNAME_FOREACH :
-    case Constants.ELEMNAME_VALUEOF :
-    case Constants.ELEMNAME_COPY_OF :
-    case Constants.ELEMNAME_NUMBER :
-    case Constants.ELEMNAME_CHOOSE :
-    case Constants.ELEMNAME_IF :
-    case Constants.ELEMNAME_TEXT :
-    case Constants.ELEMNAME_COPY :
-    case Constants.ELEMNAME_VARIABLE :
-    case Constants.ELEMNAME_MESSAGE :
-
-      // instructions 
-      // case Constants.ELEMNAME_PI:
-      // case Constants.ELEMNAME_COMMENT:
-      // case Constants.ELEMNAME_ELEMENT:
-      // case Constants.ELEMNAME_ATTRIBUTE:
-      break;
-    default :
-      error(XSLTErrorResources.ER_CANNOT_ADD,
-            new Object[]{ newChild.getNodeName(),
-                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    }
-
-    return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemAttributeSet.java b/src/org/apache/xalan/templates/ElemAttributeSet.java
deleted file mode 100644
index d39fe35..0000000
--- a/src/org/apache/xalan/templates/ElemAttributeSet.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-import java.util.Stack;
-
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:attribute-set.
- * <pre>
- * &amp;!ELEMENT xsl:attribute-set (xsl:attribute)*>
- * &amp;!ATTLIST xsl:attribute-set
- *   name %qname; #REQUIRED
- *   use-attribute-sets %qnames; #IMPLIED
- * &amp;
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
- */
-public class ElemAttributeSet extends ElemUse
-{
-
-  /**
-   * The name attribute specifies the name of the attribute set.
-   * @serial
-   */
-  public QName m_qname = null;
-
-  /**
-   * Set the "name" attribute.
-   * The name attribute specifies the name of the attribute set.
-   *
-   * @param name Name attribute to set
-   */
-  public void setName(QName name)
-  {
-    m_qname = name;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * The name attribute specifies the name of the attribute set.
-   *
-   * @return The name attribute of the attribute set
-   */
-  public QName getName()
-  {
-    return m_qname;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return Token ID of the element 
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_DEFINEATTRIBUTESET;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The name of this element
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_ATTRIBUTESET_STRING;
-  }
-
-  /**
-   * Apply a set of attributes to the element.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (transformer.isRecursiveAttrSet(this))
-    {
-      throw new TransformerException(
-        XSLMessages.createMessage(
-          XSLTErrorResources.ER_XSLATTRSET_USED_ITSELF,
-          new Object[]{ m_qname.getLocalPart() }));  //"xsl:attribute-set '"+m_qname.m_localpart+
-    }
-
-    transformer.pushElemAttributeSet(this);
-    super.execute(transformer);
-
-    ElemAttribute attr = (ElemAttribute) getFirstChildElem();
-
-    while (null != attr)
-    {
-      attr.execute(transformer);
-
-      attr = (ElemAttribute) attr.getNextSiblingElem();
-    }
-
-    transformer.popElemAttributeSet();
-  }
-
-  /**
-   * Add a child to the child list.
-   * <!ELEMENT xsl:attribute-set (xsl:attribute)*>
-   * <!ATTLIST xsl:attribute-set
-   *   name %qname; #REQUIRED
-   *   use-attribute-sets %qnames; #IMPLIED
-   * >
-   *
-   * @param newChild Child to be added to this node's list of children
-   *
-   * @return The child that was just added to the list of children
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChildElem(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    switch (type)
-    {
-    case Constants.ELEMNAME_ATTRIBUTE :
-      break;
-    default :
-      error(XSLTErrorResources.ER_CANNOT_ADD,
-            new Object[]{ newChild.getNodeName(),
-                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    }
-
-    return super.appendChild(newChild);
-  }
-
-  /**
-   * This function is called during recomposition to
-   * control how this element is composed.
-   * @param root The root stylesheet for this transformation.
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeAttributeSets(this);
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/ElemCallTemplate.java b/src/org/apache/xalan/templates/ElemCallTemplate.java
deleted file mode 100644
index c074cb7..0000000
--- a/src/org/apache/xalan/templates/ElemCallTemplate.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.VariableStack;
-import org.apache.xalan.transformer.TransformerImpl;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-import org.apache.xpath.objects.XObject;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:call-template.
- * <pre>
- * &amp;!ELEMENT xsl:call-template (xsl:with-param)*>
- * &amp;!ATTLIST xsl:call-template
- *   name %qname; #REQUIRED
- * &amp;
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#named-templates">named-templates in XSLT Specification</a>
- */
-public class ElemCallTemplate extends ElemForEach
-{
-
-  /**
-   * An xsl:call-template element invokes a template by name;
-   * it has a required name attribute that identifies the template to be invoked.
-   * @serial
-   */
-  public QName m_templateName = null;
-
-  /**
-   * Set the "name" attribute.
-   * An xsl:call-template element invokes a template by name;
-   * it has a required name attribute that identifies the template to be invoked.
-   *
-   * @param name Name attribute to set
-   */
-  public void setName(QName name)
-  {
-    m_templateName = name;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * An xsl:call-template element invokes a template by name;
-   * it has a required name attribute that identifies the template to be invoked.
-   *
-   * @return Name attribute of this element
-   */
-  public QName getName()
-  {
-    return m_templateName;
-  }
-
-  /**
-   * The template which is named by QName.
-   * @serial
-   */
-  private ElemTemplate m_template = null;
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element 
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_CALLTEMPLATE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The name of this element
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_CALLTEMPLATE_STRING;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    
-    // Call compose on each param no matter if this is apply-templates 
-    // or call templates.
-    int length = getParamElemCount();
-    for (int i = 0; i < length; i++) 
-    {
-      ElemWithParam ewp = getParamElem(i);
-      ewp.compose(sroot);
-    }
-    
-    if ((null != m_templateName) && (null == m_template))
-    {
-      m_template =
-        this.getStylesheetRoot().getTemplateComposed(m_templateName);
-        
-      if(null == m_template)
-        return; // %REVIEW% error?
-    
-      length = getParamElemCount();
-      for (int i = 0; i < length; i++) 
-      {
-        ElemWithParam ewp = getParamElem(i);
-        ewp.m_index = -1;
-        // Find the position of the param in the template being called, 
-        // and set the index of the param slot.
-        int etePos = 0;
-        for (ElemTemplateElement ete = m_template.getFirstChildElem(); 
-             null != ete; ete = ete.getNextSiblingElem()) 
-        {
-          if(ete.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE)
-          {
-            ElemParam ep = (ElemParam)ete;
-            if(ep.getName().equals(ewp.getName()))
-            {
-              ewp.m_index = etePos;
-            }
-          }
-          else
-            break;
-          etePos++;
-        }
-        
-      }
-    }
-  }
-  
-  /**
-   * This after the template's children have been composed.
-   */
-  public void endCompose(StylesheetRoot sroot) throws TransformerException
-  {
-    int length = getParamElemCount();
-    for (int i = 0; i < length; i++) 
-    {
-      ElemWithParam ewp = getParamElem(i);
-      ewp.endCompose(sroot);
-    }    
-    
-    super.endCompose(sroot);
-  }
-
-  /**
-   * Invoke a named template.
-   * @see <a href="http://www.w3.org/TR/xslt#named-templates">named-templates in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    if (null != m_template)
-    {
-      XPathContext xctxt = transformer.getXPathContext();
-      VariableStack vars = xctxt.getVarStack();
-
-      int thisframe = vars.getStackFrame();
-      int nextFrame = vars.link(m_template.m_frameSize);
-      
-      // We have to clear the section of the stack frame that has params 
-      // so that the default param evaluation will work correctly.
-      if(m_template.m_inArgsSize > 0)
-      {
-        vars.clearLocalSlots(0, m_template.m_inArgsSize);
-      
-        if(null != m_paramElems)
-        {
-          int currentNode = xctxt.getCurrentNode();
-          vars.setStackFrame(thisframe);
-          int size = m_paramElems.length;
-          
-          for (int i = 0; i < size; i++) 
-          {
-            ElemWithParam ewp = m_paramElems[i];
-            if(ewp.m_index >= 0)
-            {
-              XObject obj = ewp.getValue(transformer, currentNode);
-              
-              // Note here that the index for ElemWithParam must have been 
-              // statically made relative to the xsl:template being called, 
-              // NOT this xsl:template.
-              vars.setLocalVariable(ewp.m_index, obj, nextFrame);
-            }
-          }
-          vars.setStackFrame(nextFrame);
-        }
-      }
-      
-      SourceLocator savedLocator = xctxt.getSAXLocator();
-
-      try
-      {
-        xctxt.setSAXLocator(m_template);
-
-        // template.executeChildTemplates(transformer, sourceNode, mode, true);
-        transformer.pushElemTemplateElement(m_template);
-        m_template.execute(transformer);
-      }
-      finally
-      {
-        transformer.popElemTemplateElement();
-        xctxt.setSAXLocator(savedLocator);
-        vars.unlink();
-      }
-    }
-    else
-    {
-      transformer.getMsgMgr().error(this, XSLTErrorResources.ER_TEMPLATE_NOT_FOUND,
-                                    new Object[]{ m_templateName });  //"Could not find template named: '"+templateName+"'");
-    }
-  }
-  
-  /** Vector of xsl:param elements associated with this element. 
-   *  @serial */
-  protected ElemWithParam[] m_paramElems = null;
-
-  /**
-   * Get the count xsl:param elements associated with this element.
-   * @return The number of xsl:param elements.
-   */
-  public int getParamElemCount()
-  {
-    return (m_paramElems == null) ? 0 : m_paramElems.length;
-  }
-
-  /**
-   * Get a xsl:param element associated with this element.
-   *
-   * @param i Index of element to find
-   *
-   * @return xsl:param element at given index
-   */
-  public ElemWithParam getParamElem(int i)
-  {
-    return m_paramElems[i];
-  }
-
-  /**
-   * Set a xsl:param element associated with this element.
-   *
-   * @param ParamElem xsl:param element to set. 
-   */
-  public void setParamElem(ElemWithParam ParamElem)
-  {
-    if (null == m_paramElems)
-    {
-      m_paramElems = new ElemWithParam[1];
-      m_paramElems[0] = ParamElem;
-    }
-    else
-    {
-      // Expensive 1 at a time growth, but this is done at build time, so 
-      // I think it's OK.
-      int length = m_paramElems.length;
-      ElemWithParam[] ewp = new ElemWithParam[length + 1];
-      System.arraycopy(m_paramElems, 0, ewp, 0, length);
-      m_paramElems = ewp;
-      ewp[length] = ParamElem;
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   * <!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*>
-   * <!ATTLIST xsl:apply-templates
-   *   select %expr; "node()"
-   *   mode %qname; #IMPLIED
-   * >
-   *
-   * @param newChild Child to add to this node's children list
-   *
-   * @return The child that was just added the children list 
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    if (Constants.ELEMNAME_WITHPARAM == type)
-    {
-      setParamElem((ElemWithParam) newChild);
-    }
-
-    // You still have to append, because this element can
-    // contain a for-each, and other elements.
-    return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemChoose.java b/src/org/apache/xalan/templates/ElemChoose.java
deleted file mode 100644
index 385d9ff..0000000
--- a/src/org/apache/xalan/templates/ElemChoose.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:choose.
- * <pre>
- * <!ELEMENT xsl:choose (xsl:when+, xsl:otherwise?)>
- * <!ATTLIST xsl:choose %space-att;>
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose">XXX in XSLT Specification</a>
- */
-public class ElemChoose extends ElemTemplateElement
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_CHOOSE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_CHOOSE_STRING;
-  }
-
-  /**
-   * Constructor ElemChoose
-   *
-   */
-  public ElemChoose(){}
-
-  /**
-   * Execute the xsl:choose transformation.
-   *
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    boolean found = false;
-
-    for (ElemTemplateElement childElem = getFirstChildElem();
-            childElem != null; childElem = childElem.getNextSiblingElem())
-    {
-      int type = childElem.getXSLToken();
-
-      if (Constants.ELEMNAME_WHEN == type)
-      {
-        found = true;
-
-        ElemWhen when = (ElemWhen) childElem;
-
-        // must be xsl:when
-        XPathContext xctxt = transformer.getXPathContext();
-        int sourceNode = xctxt.getCurrentNode();
-
-        if (TransformerImpl.S_DEBUG)
-        {
-          XObject test = when.getTest().execute(xctxt, sourceNode, when);
-
-          if (TransformerImpl.S_DEBUG)
-            transformer.getTraceManager().fireSelectedEvent(sourceNode, when,
-                    "test", when.getTest(), test);
-
-          if (test.bool())
-          {
-            transformer.getTraceManager().fireTraceEvent(when);
-            transformer.executeChildTemplates(when, true);
-
-            return;
-          }
-
-        }
-        else if (when.getTest().bool(xctxt, sourceNode, when))
-        {
-          transformer.executeChildTemplates(when, true);
-
-          return;
-        }
-      }
-      else if (Constants.ELEMNAME_OTHERWISE == type)
-      {
-        found = true;
-
-        if (TransformerImpl.S_DEBUG)
-          transformer.getTraceManager().fireTraceEvent(childElem);
-
-        // xsl:otherwise                
-        transformer.executeChildTemplates(childElem, true);
-
-        return;
-      }
-    }
-
-    if (!found)
-      transformer.getMsgMgr().error(
-        this, XSLTErrorResources.ER_CHOOSE_REQUIRES_WHEN);
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to this node's child list
-   *
-   * @return The child that was just added to the child list
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    switch (type)
-    {
-    case Constants.ELEMNAME_WHEN :
-    case Constants.ELEMNAME_OTHERWISE :
-
-      // TODO: Positional checking
-      break;
-    default :
-      error(XSLTErrorResources.ER_CANNOT_ADD,
-            new Object[]{ newChild.getNodeName(),
-                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    }
-
-    return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemComment.java b/src/org/apache/xalan/templates/ElemComment.java
deleted file mode 100644
index 196f8ab..0000000
--- a/src/org/apache/xalan/templates/ElemComment.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:comment.
- * <pre>
- * <!ELEMENT xsl:comment %char-template;>
- * <!ATTLIST xsl:comment %space-att;>
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Comments">section-Creating-Comments in XSLT Specification</a>
- */
-public class ElemComment extends ElemTemplateElement
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_COMMENT;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return This element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_COMMENT_STRING;
-  }
-
-  /**
-   * Execute the xsl:comment transformation 
-   *
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-    try
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      // Note the content model is:
-      // <!ENTITY % instructions "
-      // %char-instructions;
-      // | xsl:processing-instruction
-      // | xsl:comment
-      // | xsl:element
-      // | xsl:attribute
-      // ">
-      String data = transformer.transformToString(this);
-
-      transformer.getResultTreeHandler().comment(data);
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to this node's child list
-   *
-   * @return Child that was just added to child list
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    switch (type)
-    {
-
-    // char-instructions 
-    case Constants.ELEMNAME_TEXTLITERALRESULT :
-    case Constants.ELEMNAME_APPLY_TEMPLATES :
-    case Constants.ELEMNAME_APPLY_IMPORTS :
-    case Constants.ELEMNAME_CALLTEMPLATE :
-    case Constants.ELEMNAME_FOREACH :
-    case Constants.ELEMNAME_VALUEOF :
-    case Constants.ELEMNAME_COPY_OF :
-    case Constants.ELEMNAME_NUMBER :
-    case Constants.ELEMNAME_CHOOSE :
-    case Constants.ELEMNAME_IF :
-    case Constants.ELEMNAME_TEXT :
-    case Constants.ELEMNAME_COPY :
-    case Constants.ELEMNAME_VARIABLE :
-    case Constants.ELEMNAME_MESSAGE :
-
-      // instructions 
-      // case Constants.ELEMNAME_PI:
-      // case Constants.ELEMNAME_COMMENT:
-      // case Constants.ELEMNAME_ELEMENT:
-      // case Constants.ELEMNAME_ATTRIBUTE:
-      break;
-    default :
-      error(XSLTErrorResources.ER_CANNOT_ADD,
-            new Object[]{ newChild.getNodeName(),
-                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    }
-
-    return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemCopy.java b/src/org/apache/xalan/templates/ElemCopy.java
deleted file mode 100644
index bda0d5a..0000000
--- a/src/org/apache/xalan/templates/ElemCopy.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-
-import java.util.*;
-
-import org.apache.xml.utils.QName;
-import org.apache.xalan.trace.*;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xalan.transformer.ClonerToResultTree;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:copy.
- * <pre>
- * <!ELEMENT xsl:copy %template;>
- * <!ATTLIST xsl:copy
- *   %space-att;
- *   use-attribute-sets %qnames; #IMPLIED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#copying">copying in XSLT Specification</a>
- */
-public class ElemCopy extends ElemUse
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element 
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_COPY;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return This element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_COPY_STRING;
-  }
-
-  /**
-   * The xsl:copy element provides an easy way of copying the current node.
-   * Executing this function creates a copy of the current node into the
-   * result tree.
-   * <p>The namespace nodes of the current node are automatically
-   * copied as well, but the attributes and children of the node are not
-   * automatically copied. The content of the xsl:copy element is a
-   * template for the attributes and children of the created node;
-   * the content is instantiated only for nodes of types that can have
-   * attributes or children (i.e. root nodes and element nodes).</p>
-   * <p>The root node is treated specially because the root node of the
-   * result tree is created implicitly. When the current node is the
-   * root node, xsl:copy will not create a root node, but will just use
-   * the content template.</p>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-                XPathContext xctxt = transformer.getXPathContext();
-      
-    try
-    {
-      int sourceNode = xctxt.getCurrentNode();
-      xctxt.pushCurrentNode(sourceNode);
-      DTM dtm = xctxt.getDTM(sourceNode);
-      short nodeType = dtm.getNodeType(sourceNode);
-
-      if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType))
-      {
-        ResultTreeHandler rthandler = transformer.getResultTreeHandler();
-
-        // TODO: Process the use-attribute-sets stuff
-        ClonerToResultTree.cloneToResultTree(sourceNode, nodeType, dtm, 
-                                             rthandler, false);
-
-        if (DTM.ELEMENT_NODE == nodeType)
-        {
-          super.execute(transformer);
-          rthandler.processNSDecls(sourceNode, nodeType, dtm);
-          transformer.executeChildTemplates(this, true);
-          
-          String ns = dtm.getNamespaceURI(sourceNode);
-          String localName = dtm.getLocalName(sourceNode);
-          transformer.getResultTreeHandler().endElement(ns, localName,
-                                                        dtm.getNodeName(sourceNode));
-        }
-        else
-        {
-          if (TransformerImpl.S_DEBUG)
-            transformer.getTraceManager().fireTraceEvent(this);
-        }
-      }
-      else
-      {
-        if (TransformerImpl.S_DEBUG)
-          transformer.getTraceManager().fireTraceEvent(this);
-
-        super.execute(transformer);
-        transformer.executeChildTemplates(this, true);
-      }
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-                finally
-    {
-      xctxt.popCurrentNode();
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemCopyOf.java b/src/org/apache/xalan/templates/ElemCopyOf.java
deleted file mode 100644
index 8fafd1f..0000000
--- a/src/org/apache/xalan/templates/ElemCopyOf.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.ref.DTMTreeWalker;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.transformer.TreeWalker2Result;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:copy-of.
- * <pre>
- * <!ELEMENT xsl:copy-of EMPTY>
- * <!ATTLIST xsl:copy-of select %expr; #REQUIRED>
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#copy-of">copy-of in XSLT Specification</a>
- */
-public class ElemCopyOf extends ElemTemplateElement
-{
-
-  /**
-   * The required select attribute contains an expression.
-   * @serial
-   */
-  public XPath m_selectExpression = null;
-
-  /**
-   * Set the "select" attribute.
-   * The required select attribute contains an expression.
-   *
-   * @param expr Expression for select attribute 
-   */
-  public void setSelect(XPath expr)
-  {
-    m_selectExpression = expr;
-  }
-
-  /**
-   * Get the "select" attribute.
-   * The required select attribute contains an expression.
-   *
-   * @return Expression for select attribute 
-   */
-  public XPath getSelect()
-  {
-    return m_selectExpression;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    m_selectExpression.fixupVariables(cstate.getVariableNames(), cstate.getGlobalsSize());
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_COPY_OF;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_COPY_OF_STRING;
-  }
-
-  /**
-   * The xsl:copy-of element can be used to insert a result tree
-   * fragment into the result tree, without first converting it to
-   * a string as xsl:value-of does (see [7.6.1 Generating Text with
-   * xsl:value-of]).
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    try
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      XPathContext xctxt = transformer.getXPathContext();
-      int sourceNode = xctxt.getCurrentNode();
-      XObject value = m_selectExpression.execute(xctxt, sourceNode, this);
-
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-                                                        "select", m_selectExpression, value);
-
-      ResultTreeHandler handler = transformer.getResultTreeHandler();
-
-      if (null != value)
-                        {
-        int type = value.getType();
-        String s;
-
-        switch (type)
-        {
-        case XObject.CLASS_BOOLEAN :
-        case XObject.CLASS_NUMBER :
-        case XObject.CLASS_STRING :
-          s = value.str();
-
-          handler.characters(s.toCharArray(), 0, s.length());
-          break;
-        case XObject.CLASS_NODESET :
-
-          // System.out.println(value);
-          DTMIterator nl = value.iter();
-
-          // Copy the tree.
-          DTMTreeWalker tw = new TreeWalker2Result(transformer, handler);
-          int pos;
-
-          while (DTM.NULL != (pos = nl.nextNode()))
-          {
-            DTM dtm = xctxt.getDTMManager().getDTM(pos);
-            short t = dtm.getNodeType(pos);
-
-            // If we just copy the whole document, a startDoc and endDoc get 
-            // generated, so we need to only walk the child nodes.
-            if (t == DTM.DOCUMENT_NODE)
-            {
-              for (int child = dtm.getFirstChild(pos); child != DTM.NULL;
-                   child = dtm.getNextSibling(child))
-              {
-                tw.traverse(child);
-              }
-            }
-            else if (t == DTM.ATTRIBUTE_NODE)
-            {
-              handler.addAttribute(pos);
-            }
-            else
-            {
-              tw.traverse(pos);
-            }
-          }
-          // nl.detach();
-          break;
-        case XObject.CLASS_RTREEFRAG :
-          handler.outputResultTreeFragment(value,
-                                           transformer.getXPathContext());
-          break;
-        default :
-          
-          s = value.str();
-
-          handler.characters(s.toCharArray(), 0, s.length());
-          break;
-        }
-      }
-                        
-      // I don't think we want this.  -sb
-      //  if (TransformerImpl.S_DEBUG)
-      //  transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-      //  "endSelect", m_selectExpression, value);
-
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to this node's child list
-   *
-   * @return Child just added to child list
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    error(XSLTErrorResources.ER_CANNOT_ADD,
-          new Object[]{ newChild.getNodeName(),
-                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    return null;
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemElement.java b/src/org/apache/xalan/templates/ElemElement.java
deleted file mode 100644
index ba58f56..0000000
--- a/src/org/apache/xalan/templates/ElemElement.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:element
- * <pre>
- * <!ELEMENT xsl:element %template;>
- * <!ATTLIST xsl:element
- *   name %avt; #REQUIRED
- *   namespace %avt; #IMPLIED
- *   use-attribute-sets %qnames; #IMPLIED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Elements-with-xsl:element">XXX in XSLT Specification</a>
- */
-public class ElemElement extends ElemUse
-{
-
-  /**
-   * The name attribute is interpreted as an attribute value template.
-   * It is an error if the string that results from instantiating the
-   * attribute value template is not a QName.
-   * @serial
-   */
-  protected AVT m_name_avt = null;
-
-  /**
-   * Set the "name" attribute.
-   * The name attribute is interpreted as an attribute value template.
-   * It is an error if the string that results from instantiating the
-   * attribute value template is not a QName.
-   *
-   * @param v Name attribute to set for this element
-   */
-  public void setName(AVT v)
-  {
-    m_name_avt = v;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * The name attribute is interpreted as an attribute value template.
-   * It is an error if the string that results from instantiating the
-   * attribute value template is not a QName.
-   *
-   * @return Name attribute for this element
-   */
-  public AVT getName()
-  {
-    return m_name_avt;
-  }
-
-  /**
-   * If the namespace attribute is present, then it also is interpreted
-   * as an attribute value template. The string that results from
-   * instantiating the attribute value template should be a URI reference.
-   * It is not an error if the string is not a syntactically legal URI reference.
-   * @serial
-   */
-  protected AVT m_namespace_avt = null;
-
-  /**
-   * Set the "namespace" attribute.
-   * If the namespace attribute is present, then it also is interpreted
-   * as an attribute value template. The string that results from
-   * instantiating the attribute value template should be a URI reference.
-   * It is not an error if the string is not a syntactically legal URI reference.
-   *
-   * @param v NameSpace attribute to set for this element
-   */
-  public void setNamespace(AVT v)
-  {
-    m_namespace_avt = v;
-  }
-
-  /**
-   * Get the "namespace" attribute.
-   * If the namespace attribute is present, then it also is interpreted
-   * as an attribute value template. The string that results from
-   * instantiating the attribute value template should be a URI reference.
-   * It is not an error if the string is not a syntactically legal URI reference.
-   *
-   * @return Namespace attribute for this element
-   */
-  public AVT getNamespace()
-  {
-    return m_namespace_avt;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    java.util.Vector vnames = cstate.getVariableNames();
-    if(null != m_name_avt)
-      m_name_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_namespace_avt)
-      m_namespace_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-  }
-
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_ELEMENT;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return This element's name 
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_ELEMENT_STRING;
-  }
-  
-  /**
-   * Validate that the node name is good.
-   * 
-   * @param nodeName Name of the node being constructed, which may be null.
-   * 
-   * @return true if the node name is valid, false otherwise.
-   */
-   protected boolean validateNodeName(String nodeName)
-   {
-    if(nodeName == null)
-      return false;
-
-    int len = nodeName.length();
-    
-    if(len == 0)
-      return false;
-      
-    int indexOfNSSep = nodeName.indexOf(':');
-
-    if(indexOfNSSep + 1 == len)
-      return false;
-      
-    if(indexOfNSSep == 0)
-      return false;
-      
-    String localName = QName.getLocalPart(nodeName);
-      
-    if(isValidNCName(localName))
-    {
-      String prefix = QName.getPrefixPart(nodeName);
-      if(prefix.length() == 0)
-        return true;
-      if(isValidNCName(prefix))
-        return true;
-    }
-
-    return false;
-   }
-   
-  /**
-   * Resolve the namespace into a prefix.  Meant to be
-   * overidded by elemAttribute if this class is derived.
-   *
-   * @param rhandler The current result tree handler.
-   * @param prefix The probable prefix if already known.
-   * @param nodeNamespace  The namespace.
-   *
-   * @return The prefix to be used.
-   */
-  protected String resolvePrefix(ResultTreeHandler rhandler,
-                                 String prefix, String nodeNamespace)
-    throws TransformerException
-  {
-
-//    if (null != prefix && prefix.length() == 0)
-//    {
-//      String foundPrefix = rhandler.getPrefix(nodeNamespace);
-//
-//      // System.out.println("nsPrefix: "+nsPrefix);           
-//      if (null == foundPrefix)
-//        foundPrefix = "";
-//    }
-    return prefix;
-  }
-    
-  /**
-   * Create an element in the result tree.
-   * The xsl:element element allows an element to be created with a
-   * computed name. The expanded-name of the element to be created
-   * is specified by a required name attribute and an optional namespace
-   * attribute. The content of the xsl:element element is a template
-   * for the attributes and children of the created element.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-    XPathContext xctxt = transformer.getXPathContext();
-    int sourceNode = xctxt.getCurrentNode();
-    String nodeName = m_name_avt.evaluate(xctxt, sourceNode, this);
-
-    String prefix = null;
-    String nodeNamespace = "";
-
-    if (!validateNodeName(nodeName))
-    {
-      transformer.getMsgMgr().warn(
-        this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE,
-        new Object[]{ Constants.ATTRNAME_NAME, nodeName });
-
-      nodeName = null;
-    }
-
-    else
-    {
-      prefix = QName.getPrefixPart(nodeName);
-
-      if (null != m_namespace_avt)
-      {
-        nodeNamespace = m_namespace_avt.evaluate(xctxt, sourceNode, this);
-        if (null == nodeNamespace || 
-            (prefix != null && prefix.length()>0 && nodeNamespace.length()== 0) )
-          transformer.getMsgMgr().error(
-              this, XSLTErrorResources.ER_NULL_URI_NAMESPACE);
-        else
-        {
-        // Determine the actual prefix that we will use for this nodeNamespace
-
-        prefix = resolvePrefix(rhandler, prefix, nodeNamespace);
-        if (null == prefix)
-          prefix = "";
-
-        if (prefix.length() > 0)
-          nodeName = (prefix + ":" + QName.getLocalPart(nodeName));
-        else
-          nodeName = QName.getLocalPart(nodeName);
-        }
-      }
-
-      // No namespace attribute was supplied. Use the namespace declarations
-      // currently in effect for the xsl:element element.
-      else    
-      {
-        try
-        {
-          // Maybe temporary, until I get this worked out.  test: axes59
-          nodeNamespace = getNamespaceForPrefix(prefix);
-
-          // If we get back a null nodeNamespace, that means that this prefix could
-          // not be found in the table.  This is okay only for a default namespace
-          // that has never been declared.
-
-          if ( (null == nodeNamespace) && (prefix.length() == 0) )
-            nodeNamespace = "";
-          else if (null == nodeNamespace)
-          {
-            transformer.getMsgMgr().warn(
-              this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX,
-              new Object[]{ prefix });
-
-            nodeName = null;
-          }
-
-        }
-        catch (Exception ex)
-        {
-          transformer.getMsgMgr().warn(
-            this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX,
-            new Object[]{ prefix });
-
-          nodeName = null;
-        }
-      }
-    }
-
-    constructNode(nodeName, prefix, nodeNamespace, transformer);
-  }
-  
-  /**
-   * Construct a node in the result tree.  This method is overloaded by 
-   * xsl:attribute. At this class level, this method creates an element.
-   * If the node is null, we instantiate only the content of the node in accordance
-   * with section 7.1.2 of the XSLT 1.0 Recommendation.
-   *
-   * @param nodeName The name of the node, which may be <code>null</code>.  If <code>null</code>,
-   *                 only the non-attribute children of this node will be processed.
-   * @param prefix The prefix for the namespace, which may be <code>null</code>.
-   *               If not <code>null</code>, this prefix will be mapped and unmapped.
-   * @param nodeNamespace The namespace of the node, which may be not be <code>null</code>.
-   * @param transformer non-null reference to the the current transform-time state.
-   *
-   * @throws TransformerException
-   */
-  void constructNode(
-          String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    boolean shouldAddAttrs;
-
-    try
-    {
-      ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-
-      if (null == nodeName)
-      {
-        shouldAddAttrs = false;
-      }
-      else
-      {
-        // Add namespace declarations.
-        executeNSDecls(transformer);
-
-        if (null != prefix)
-        {
-          rhandler.startPrefixMapping(prefix, nodeNamespace, true);
-        }
-
-        rhandler.startElement(nodeNamespace, QName.getLocalPart(nodeName),
-                              nodeName, null);
-
-        super.execute(transformer);
-
-        shouldAddAttrs = true;
-      }
-
-      transformer.executeChildTemplates(this, shouldAddAttrs);
-
-      // Now end the element if name was valid
-      if (null != nodeName)
-      {
-        rhandler.endElement(nodeNamespace, QName.getLocalPart(nodeName),
-                            nodeName);
-        if (null != prefix)
-        {
-          rhandler.endPrefixMapping(prefix);
-        }
-        unexecuteNSDecls(transformer);
-      }
-    }
-    catch (SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemEmpty.java b/src/org/apache/xalan/templates/ElemEmpty.java
deleted file mode 100644
index b4e66e3..0000000
--- a/src/org/apache/xalan/templates/ElemEmpty.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="internal"/>
- * Simple empty elem to push on the stack when nothing
- * else got pushed, so that pop() works correctly.
- */
-public class ElemEmpty extends ElemTemplateElement
-{
-
-  /**
-   * Constructor ElemEmpty
-   *
-   */
-  public ElemEmpty(){}
-}
diff --git a/src/org/apache/xalan/templates/ElemExtensionCall.java b/src/org/apache/xalan/templates/ElemExtensionCall.java
deleted file mode 100644
index a451cda..0000000
--- a/src/org/apache/xalan/templates/ElemExtensionCall.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.io.*;
-
-import java.util.*;
-
-//import org.w3c.dom.*;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-
-import java.util.StringTokenizer;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xml.utils.StringToStringTable;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.MutableAttrListImpl;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.XPathContext;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.extensions.ExtensionHandler;
-import org.apache.xalan.extensions.ExtensionsTable;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.dtm.DTM;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement an extension element.
- * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
- */
-public class ElemExtensionCall extends ElemLiteralResult
-{
-
-  // ExtensionNSHandler nsh;
-
-  /** The Namespace URI for this extension call element.
-   *  @serial          */
-  String m_extns;
-
-  /** Language used by extension.
-   *  @serial          */
-  String m_lang;
-
-  /** URL pointing to extension.
-   *  @serial          */
-  String m_srcURL;
-
-  /** Source for script.
-   *  @serial          */
-  String m_scriptSrc;
-
-  /** Declaration for Extension element. 
-   *  @serial          */
-  ElemExtensionDecl m_decl = null;
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   *@return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_EXTENSIONCALL;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-
-  // public String getNodeName()
-  // {
-  // TODO: Need prefix.
-  // return localPart;
-  // }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-
-    super.compose(sroot);
-    m_extns = this.getNamespace();
-
-    StylesheetRoot stylesheet = this.getStylesheetRoot();
-
-    m_decl = getElemExtensionDecl(stylesheet, m_extns);
-
-    if (null != m_decl)
-    {
-      for (ElemTemplateElement child = m_decl.getFirstChildElem();
-              child != null; child = child.getNextSiblingElem())
-      {
-        if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken())
-        {
-          ElemExtensionScript sdecl = (ElemExtensionScript) child;
-
-          m_lang = sdecl.getLang();
-          m_srcURL = sdecl.getSrc();
-
-          ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem();
-
-          if (null != childOfSDecl)
-          {
-            if (Constants.ELEMNAME_TEXTLITERALRESULT
-                    == childOfSDecl.getXSLToken())
-            {
-              ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl;
-              char[] chars = tl.getChars();
-
-              m_scriptSrc = new String(chars);
-            }
-          }
-
-          break;
-        }
-      }
-    }
-    else
-    {
-
-      // stylesheet.error(xxx);
-    }
-  }
-
-  /**
-   * Return the ElemExtensionDecl for this extension element 
-   *
-   *
-   * @param stylesheet Stylesheet root associated with this extension element
-   * @param namespace Namespace associated with this extension element
-   *
-   * @return the ElemExtensionDecl for this extension element. 
-   */
-  private ElemExtensionDecl getElemExtensionDecl(StylesheetRoot stylesheet,
-          String namespace)
-  {
-
-    ElemExtensionDecl decl = null;
-    int n = stylesheet.getGlobalImportCount();
-
-    for (int i = 0; i < n; i++)
-    {
-      Stylesheet imported = stylesheet.getGlobalImport(i);
-
-      for (ElemTemplateElement child = imported.getFirstChildElem();
-              child != null; child = child.getNextSiblingElem())
-      {
-        if (Constants.ELEMNAME_EXTENSIONDECL == child.getXSLToken())
-        {
-          decl = (ElemExtensionDecl) child;
-
-          String prefix = decl.getPrefix();
-          String declNamespace = child.getNamespaceForPrefix(prefix);
-
-          if (namespace.equals(declNamespace))
-          {
-            return decl;
-          }
-        }
-      }
-    }
-
-    return decl;
-  }
-  
-  /**
-   * Execute the fallbacks when an extension is not available.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void executeFallbacks(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-    for (ElemTemplateElement child = m_firstChild; child != null;
-             child = child.m_nextSibling)
-    {
-      if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK)
-      {
-        try
-        {
-          transformer.pushElemTemplateElement(child);
-          ((ElemFallback) child).executeFallback(transformer);
-        }
-        finally
-        {
-          transformer.popElemTemplateElement();
-        }
-      }
-    }
-
-  }
-
-
-  /**
-   * Execute an extension.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    try
-    {
-      transformer.getResultTreeHandler().flushPending();
-
-      XPathContext liaison = ((XPathContext) transformer.getXPathContext());
-      ExtensionsTable etable = liaison.getExtensionsTable();
-      ExtensionHandler nsh = etable.get(m_extns);
-
-      // We're seeing this extension namespace used for the first time.  Try to
-      // autodeclare it as a java namespace.
-
-      if (null == nsh)
-      {
-        nsh = etable.makeJavaNamespace(m_extns);
-
-        if(null != nsh)
-          etable.addExtensionNamespace(m_extns, nsh);
-        else
-        {
-          executeFallbacks(transformer);
-          return;
-        }
-
-      }
-
-      try
-      {
-        nsh.processElement(this.getLocalName(), this, transformer,
-                           getStylesheet(), this);
-      }
-      catch (Exception e)
-      {
-
-        // System.out.println(e);
-        // e.printzStackTrace();
-        String msg = e.getMessage();
-        
-        TransformerException te;
-        if(e instanceof TransformerException)
-        {
-          te = (TransformerException)e;
-        }
-        else
-        {
-          if(null != msg)
-            te = new TransformerException(e);
-          else
-            te = new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_UNKNOWN_ERROR_CALLING_EXTENSION, null), e); //"Unknown error when calling extension!", e);
-        }
-        if(null == te.getLocator())
-          te.setLocator(this);
-
-        if (null != msg)
-        {
-          if (msg.indexOf("fatal") >= 0)
-          {
-            transformer.getErrorListener().fatalError(te);
-          }
-          else if(e instanceof RuntimeException)      
-            transformer.getErrorListener().error(te); // ??
-          else
-            transformer.getErrorListener().warning(te);
-
-        }
-        else      
-          transformer.getErrorListener().error(te); // ??
-
-        executeFallbacks(
-          transformer);
-      }
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      transformer.getErrorListener().fatalError(new TransformerException(se));
-    }
-  }
-
-  /**
-   * Return the raw value of the attribute.
-   *
-   * @param rawName Raw name of the attribute to get
-   *
-   * @return the raw value of the attribute or null if not found
-   */
-  public String getAttribute(String rawName)
-  {
-
-    AVT avt = getLiteralResultAttribute(rawName);
-
-    if ((null != avt) && avt.getRawName().equals(rawName))
-    {
-      return avt.getSimpleString();
-    }
-
-    return null;
-  }
-
-  /**
-   * Return the value of the attribute interpreted as an Attribute
-   * Value Template (in other words, you can use curly expressions
-   * such as href="http://{website}".
-   *
-   * @param rawName Raw name of the attribute to get
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param transformer non-null reference to the the current transform-time state.
-   *
-   * @return the value of the attribute
-   *
-   * @throws TransformerException
-   */
-  public String getAttribute(
-          String rawName, org.w3c.dom.Node sourceNode, TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    AVT avt = getLiteralResultAttribute(rawName);
-
-    if ((null != avt) && avt.getRawName().equals(rawName))
-    {
-      XPathContext xctxt = transformer.getXPathContext();
-
-      return avt.evaluate(xctxt, 
-            xctxt.getDTMHandleFromNode(sourceNode), 
-            this);
-    }
-
-    return null;
-  }
-  
-}
diff --git a/src/org/apache/xalan/templates/ElemExtensionDecl.java b/src/org/apache/xalan/templates/ElemExtensionDecl.java
deleted file mode 100644
index c59963e..0000000
--- a/src/org/apache/xalan/templates/ElemExtensionDecl.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xml.utils.StringToStringTable;
-import org.apache.xml.utils.StringVector;
-import org.apache.xalan.extensions.ExtensionHandler;
-import org.apache.xalan.extensions.ExtensionHandlerGeneral;
-import org.apache.xalan.extensions.ExtensionsTable;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * <meta name="usage" content="internal"/>
- * Implement the declaration of an extension element 
- */
-public class ElemExtensionDecl extends ElemTemplateElement
-{
-
-  /**
-   * Constructor ElemExtensionDecl
-   *
-   */
-  public ElemExtensionDecl()
-  {
-
-    // System.out.println("ElemExtensionDecl ctor");
-  }
-
-  /** Prefix string for this extension element.
-   *  @serial         */
-  private String m_prefix = null;
-
-  /**
-   * Set the prefix for this extension element  
-   *
-   *
-   * @param v Prefix to set for this extension element
-   */
-  public void setPrefix(String v)
-  {
-    m_prefix = v;
-  }
-
-  /**
-   * Set the prefix for this extension element
-   *
-   *
-   * @return Prefix for this extension element
-   */
-  public String getPrefix()
-  {
-    return m_prefix;
-  }
-
-  /** StringVector holding the names of functions defined in this extension.
-   *  @serial     */
-  private StringVector m_functions = new StringVector();
-
-  /**
-   * Set the names of functions defined in this extension  
-   *
-   *
-   * @param v StringVector holding the names of functions defined in this extension
-   */
-  public void setFunctions(StringVector v)
-  {
-    m_functions = v;
-  }
-
-  /**
-   * Get the names of functions defined in this extension
-   *
-   *
-   * @return StringVector holding the names of functions defined in this extension
-   */
-  public StringVector getFunctions()
-  {
-    return m_functions;
-  }
-
-  /**
-   * Get a function at a given index in this extension element 
-   *
-   *
-   * @param i Index of function to get
-   *
-   * @return Name of Function at given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public String getFunction(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_functions)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (String) m_functions.elementAt(i);
-  }
-
-  /**
-   * Get count of functions defined in this extension element
-   *
-   *
-   * @return count of functions defined in this extension element
-   */
-  public int getFunctionCount()
-  {
-    return (null != m_functions) ? m_functions.size() : 0;
-  }
-
-  /** StringVector of elements defined in this extension.
-   *  @serial         */
-  private StringVector m_elements = null;
-
-  /**
-   * Set StringVector of elements for this extension
-   *
-   *
-   * @param v StringVector of elements to set
-   */
-  public void setElements(StringVector v)
-  {
-    m_elements = v;
-  }
-
-  /**
-   * Get StringVector of elements defined for this extension  
-   *
-   *
-   * @return StringVector of elements defined for this extension
-   */
-  public StringVector getElements()
-  {
-    return m_elements;
-  }
-
-  /**
-   * Get the element at the given index
-   *
-   *
-   * @param i Index of element to get
-   *
-   * @return The element at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public String getElement(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_elements)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (String) m_elements.elementAt(i);
-  }
-
-  /**
-   * Return the count of elements defined for this extension element 
-   *
-   *
-   * @return the count of elements defined for this extension element
-   */
-  public int getElementCount()
-  {
-    return (null != m_elements) ? m_elements.size() : 0;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_EXTENSIONDECL;
-  }
-
-  /**
-   * This function will be called on top-level elements
-   * only, just before the transform begins.
-   *
-   * @param transformer The XSLT TransformerFactory.
-   *
-   * @throws TransformerException
-   */
-  public void runtimeInit(TransformerImpl transformer) throws TransformerException
-  {
-
-    String lang = null;
-    String srcURL = null;
-    String scriptSrc = null;
-    String prefix = getPrefix();
-    String declNamespace = getNamespaceForPrefix(prefix);
-
-    if (null == declNamespace)
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix
-                             //+ " does not have a corresponding "
-                             //+ "namespace declaration");
-
-    for (ElemTemplateElement child = getFirstChildElem(); child != null;
-            child = child.getNextSiblingElem())
-    {
-      if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken())
-      {
-        ElemExtensionScript sdecl = (ElemExtensionScript) child;
-
-        lang = sdecl.getLang();
-        srcURL = sdecl.getSrc();
-
-        ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem();
-
-        if (null != childOfSDecl)
-        {
-          if (Constants.ELEMNAME_TEXTLITERALRESULT
-                  == childOfSDecl.getXSLToken())
-          {
-            ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl;
-            char[] chars = tl.getChars();
-
-            scriptSrc = new String(chars);
-
-            if (scriptSrc.trim().length() == 0)
-              scriptSrc = null;
-          }
-        }
-      }
-    }
-
-    if (null == lang)
-      lang = "javaclass";
-
-    if (lang.equals("javaclass") && (scriptSrc != null))
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass "
-                             //+ scriptSrc);
-
-    XPathContext liaison = ((XPathContext) transformer.getXPathContext());
-    ExtensionsTable etable = liaison.getExtensionsTable();
-    ExtensionHandler nsh = etable.get(declNamespace);
-
-    // If we have no prior ExtensionHandler for this namespace, we need to
-    // create one.
-    // If the script element is for javaclass, this is our special compiled java.
-    // Element content is not supported for this so we throw an exception if
-    // it is provided.  Otherwise, we look up the srcURL to see if we already have
-    // an ExtensionHandler.
-    if (null == nsh)
-    {
-      if (lang.equals("javaclass"))
-      {
-        if (null == srcURL)
-        {
-          nsh = etable.makeJavaNamespace(declNamespace);
-        }
-        else
-        {
-          nsh = etable.get(srcURL);
-
-          if (null == nsh)
-          {
-            nsh = etable.makeJavaNamespace(srcURL);
-          }
-        }
-      }
-      else  // not java
-      {
-        nsh = new ExtensionHandlerGeneral(declNamespace, this.m_elements,
-                                          this.m_functions, lang, srcURL,
-                                          scriptSrc, getSystemId());
-
-        // System.out.println("Adding NS Handler: declNamespace = "+
-        //                   declNamespace+", lang = "+lang+", srcURL = "+
-        //                   srcURL+", scriptSrc="+scriptSrc);
-      }
-
-      etable.addExtensionNamespace(declNamespace, nsh);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemExtensionScript.java b/src/org/apache/xalan/templates/ElemExtensionScript.java
deleted file mode 100644
index 96b277b..0000000
--- a/src/org/apache/xalan/templates/ElemExtensionScript.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-/**
- * <meta name="usage" content="internal"/>
- * Implement Script extension element
- */
-public class ElemExtensionScript extends ElemTemplateElement
-{
-
-  /**
-   * Constructor ElemExtensionScript
-   *
-   */
-  public ElemExtensionScript()
-  {
-
-    // System.out.println("ElemExtensionScript ctor");
-  }
-
-  /** Language used in extension.
-   *  @serial          */
-  private String m_lang = null;
-
-  /**
-   * Set language used by extension
-   *
-   *
-   * @param v Language used by extension
-   */
-  public void setLang(String v)
-  {
-    m_lang = v;
-  }
-
-  /**
-   * Get language used by extension
-   *
-   *
-   * @return Language used by extension
-   */
-  public String getLang()
-  {
-    return m_lang;
-  }
-
-  /** Extension handler.
-   *  @serial          */
-  private String m_src = null;
-
-  /**
-   * Set Extension handler name for this extension
-   *
-   *
-   * @param v Extension handler name to set
-   */
-  public void setSrc(String v)
-  {
-    m_src = v;
-  }
-
-  /**
-   * Get Extension handler name for this extension
-   *
-   *
-   * @return Extension handler name
-   */
-  public String getSrc()
-  {
-    return m_src;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element 
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_EXTENSIONSCRIPT;
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemFallback.java b/src/org/apache/xalan/templates/ElemFallback.java
deleted file mode 100644
index 4cd6691..0000000
--- a/src/org/apache/xalan/templates/ElemFallback.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-// import org.apache.xpath.*;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:fallback.
- * <pre>
- * <!ELEMENT xsl:fallback %template;>
- * <!ATTLIST xsl:fallback %space-att;>
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#fallback">fallback in XSLT Specification</a>
- */
-public class ElemFallback extends ElemTemplateElement
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_FALLBACK;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The Element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_FALLBACK_STRING;
-  }
-
-  /**
-   * This is the normal call when xsl:fallback is instantiated.
-   * In accordance with the XSLT 1.0 Recommendation, chapter 15,
-   * "Normally, instantiating an xsl:fallback element does nothing."
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-  }
-
-  /**
-   * Execute the fallback elements.  This must be explicitly called to
-   * instantiate the content of an xsl:fallback element.
-   * When an XSLT transformer performs fallback for an instruction
-   * element, if the instruction element has one or more xsl:fallback
-   * children, then the content of each of the xsl:fallback children
-   * must be instantiated in sequence; otherwise, an error must
-   * be signaled. The content of an xsl:fallback element is a template.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void executeFallback(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (Constants.ELEMNAME_EXTENSIONCALL == m_parentNode.getXSLToken())
-    {
-
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      transformer.executeChildTemplates(this, true);
-
-    }
-    else
-    {
-
-      // Should never happen
-      System.out.println(
-        "Error!  parent of xsl:fallback must be an extension element!");
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemForEach.java b/src/org/apache/xalan/templates/ElemForEach.java
deleted file mode 100644
index 35dd0d8..0000000
--- a/src/org/apache/xalan/templates/ElemForEach.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMManager;
-
-// Experemental
-import org.apache.xml.dtm.ref.ExpandedNameTable;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.objects.XObject;
-
-import java.util.Vector;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.NodeSorter;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xalan.transformer.StackGuard;
-import org.apache.xalan.transformer.ClonerToResultTree;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:for-each.
- * <pre>
- * <!ELEMENT xsl:for-each
- *  (#PCDATA
- *   %instructions;
- *   %result-elements;
- *   | xsl:sort)
- * >
- *
- * <!ATTLIST xsl:for-each
- *   select %expr; #REQUIRED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#for-each">for-each in XSLT Specification</a>
- */
-public class ElemForEach extends ElemTemplateElement
-{
-
-  /**
-   * Construct a element representing xsl:for-each.
-   */
-  public ElemForEach(){}
-
-  /**
-   * The "select" expression.
-   * @serial
-   */
-  protected Expression m_selectExpression = null;
-
-  /**
-   * Set the "select" attribute.
-   *
-   * @param xpath The XPath expression for the "select" attribute.
-   */
-  public void setSelect(XPath xpath)
-  {
-    m_selectExpression = xpath.getExpression();
-  }
-
-  /**
-   * Get the "select" attribute.
-   *
-   * @return The XPath expression for the "select" attribute.
-   */
-  public Expression getSelect()
-  {
-    return m_selectExpression;
-  }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   *
-   * NEEDSDOC @param sroot
-   *
-   * @throws TransformerException
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-
-    super.compose(sroot);
-
-    int length = getSortElemCount();
-
-    for (int i = 0; i < length; i++)
-    {
-      getSortElem(i).compose(sroot);
-    }
-
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-
-    if (null != m_selectExpression)
-      m_selectExpression.fixupVariables(
-        vnames, sroot.getComposeState().getGlobalsSize());
-    else
-    {
-      m_selectExpression =
-        getStylesheetRoot().m_selectDefault.getExpression();
-    }
-  }
-  
-  /**
-   * This after the template's children have been composed.
-   */
-  public void endCompose(StylesheetRoot sroot) throws TransformerException
-  {
-    int length = getSortElemCount();
-
-    for (int i = 0; i < length; i++)
-    {
-      getSortElem(i).endCompose(sroot);
-    }
-    
-    super.endCompose(sroot);
-  }
-
-
-  //  /**
-  //   * This function is called after everything else has been
-  //   * recomposed, and allows the template to set remaining
-  //   * values that may be based on some other property that
-  //   * depends on recomposition.
-  //   *
-  //   * @throws TransformerException
-  //   */
-  //  public void compose() throws TransformerException
-  //  {
-  //
-  //    if (null == m_selectExpression)
-  //    {
-  //      m_selectExpression =
-  //        getStylesheetRoot().m_selectDefault.getExpression();
-  //    }
-  //  }
-
-  /**
-   * Vector containing the xsl:sort elements associated with this element.
-   *  @serial
-   */
-  protected Vector m_sortElems = null;
-
-  /**
-   * Get the count xsl:sort elements associated with this element.
-   * @return The number of xsl:sort elements.
-   */
-  public int getSortElemCount()
-  {
-    return (m_sortElems == null) ? 0 : m_sortElems.size();
-  }
-
-  /**
-   * Get a xsl:sort element associated with this element.
-   *
-   * @param i Index of xsl:sort element to get
-   *
-   * @return xsl:sort element at given index
-   */
-  public ElemSort getSortElem(int i)
-  {
-    return (ElemSort) m_sortElems.elementAt(i);
-  }
-
-  /**
-   * Set a xsl:sort element associated with this element.
-   *
-   * @param sortElem xsl:sort element to set
-   */
-  public void setSortElem(ElemSort sortElem)
-  {
-
-    if (null == m_sortElems)
-      m_sortElems = new Vector();
-
-    m_sortElems.addElement(sortElem);
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_FOREACH;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_FOREACH_STRING;
-  }
-
-  /**
-   * Execute the xsl:for-each transformation
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-
-    transformer.pushCurrentTemplateRuleIsNull(true);
-
-    try
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      transformSelectedNodes(transformer);
-    }
-    finally
-    {
-      transformer.popCurrentTemplateRuleIsNull();
-    }
-  }
-
-  /**
-   * Get template element associated with this
-   *
-   *
-   * @return template element associated with this (itself)
-   */
-  protected ElemTemplateElement getTemplateMatch()
-  {
-    return this;
-  }
-
-  /**
-   * Sort given nodes
-   *
-   *
-   * @param xctxt The XPath runtime state for the sort.
-   * @param keys Vector of sort keyx
-   * @param sourceNodes Iterator of nodes to sort
-   *
-   * @return iterator of sorted nodes
-   *
-   * @throws TransformerException
-   */
-  public DTMIterator sortNodes(
-          XPathContext xctxt, Vector keys, DTMIterator sourceNodes)
-            throws TransformerException
-  {
-
-    NodeSorter sorter = new NodeSorter(xctxt);
-
-    sourceNodes.setShouldCacheNodes(true);
-    sourceNodes.runTo(-1);
-    xctxt.pushContextNodeList(sourceNodes);
-
-    try
-    {
-      sorter.sort(sourceNodes, keys, xctxt);
-      sourceNodes.setCurrentPos(0);
-    }
-    finally
-    {
-      xctxt.popContextNodeList();
-    }
-
-    return sourceNodes;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Perform a query if needed, and call transformNode for each child.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param template The owning template context.
-   *
-   * @throws TransformerException Thrown in a variety of circumstances.
-   */
-  public void transformSelectedNodes(TransformerImpl transformer)
-          throws TransformerException
-  {
-
-    final XPathContext xctxt = transformer.getXPathContext();
-    final int sourceNode = xctxt.getCurrentNode();
-    DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt,
-                                sourceNode);
-
-    try
-    {
-
-      final Vector keys = (m_sortElems == null)
-                          ? null
-                          : transformer.processSortKeys(this, sourceNode);
-
-      // Sort if we need to.
-      if (null != keys)
-        sourceNodes = sortNodes(xctxt, keys, sourceNodes);
-
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-                "select", new XPath(m_selectExpression),
-                new org.apache.xpath.objects.XNodeSet(sourceNodes));
-
-      final ResultTreeHandler rth = transformer.getResultTreeHandler();
-      ContentHandler chandler = rth.getContentHandler();
-
-      xctxt.pushCurrentNode(DTM.NULL);
-
-      int[] currentNodes = xctxt.getCurrentNodeStack();
-      int currentNodePos = xctxt.getCurrentNodeFirstFree() - 1;
-
-      xctxt.pushCurrentExpressionNode(DTM.NULL);
-
-      int[] currentExpressionNodes = xctxt.getCurrentExpressionNodeStack();
-      int currentExpressionNodePos =
-        xctxt.getCurrentExpressionNodesFirstFree() - 1;
-
-      xctxt.pushSAXLocatorNull();
-      xctxt.pushContextNodeList(sourceNodes);
-      transformer.pushElemTemplateElement(null);
-
-      // pushParams(transformer, xctxt);
-      // Should be able to get this from the iterator but there must be a bug.
-      DTM dtm = xctxt.getDTM(sourceNode);
-      int docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
-      int child;
-
-      while (DTM.NULL != (child = sourceNodes.nextNode()))
-      {
-        currentNodes[currentNodePos] = child;
-        currentExpressionNodes[currentExpressionNodePos] = child;
-
-        if ((child & DTMManager.IDENT_DTM_DEFAULT) != docID)
-        {
-          dtm = xctxt.getDTM(child);
-          docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
-        }
-
-        final int exNodeType = dtm.getExpandedTypeID(child);
-        final int nodeType = (exNodeType >> ExpandedNameTable.ROTAMOUNT_TYPE);
-
-        // Fire a trace event for the template.
-        if (TransformerImpl.S_DEBUG)
-          transformer.getTraceManager().fireTraceEvent(this);
-
-        // And execute the child templates.
-        // Loop through the children of the template, calling execute on 
-        // each of them.
-        for (ElemTemplateElement t = this.m_firstChild; t != null;
-                t = t.m_nextSibling)
-        {
-          xctxt.setSAXLocator(t);
-          transformer.setCurrentElement(t);
-          t.execute(transformer);
-        }
-      }
-    }
-    finally
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this,
-                "select", new XPath(m_selectExpression),
-                new org.apache.xpath.objects.XNodeSet(sourceNodes));
-
-      xctxt.popSAXLocator();
-      xctxt.popContextNodeList();
-      transformer.popElemTemplateElement();
-      xctxt.popCurrentExpressionNode();
-      xctxt.popCurrentNode();
-      sourceNodes.detach();
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   * <!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*>
-   * <!ATTLIST xsl:apply-templates
-   *   select %expr; "node()"
-   *   mode %qname; #IMPLIED
-   * >
-   *
-   * @param newChild Child to add to child list
-   *
-   * @return Child just added to child list
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    if (Constants.ELEMNAME_SORT == type)
-    {
-      setSortElem((ElemSort) newChild);
-
-      return newChild;
-    }
-    else
-      return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemIf.java b/src/org/apache/xalan/templates/ElemIf.java
deleted file mode 100644
index c435103..0000000
--- a/src/org/apache/xalan/templates/ElemIf.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:if.
- * <pre>
- * <!ELEMENT xsl:if %template;>
- * <!ATTLIST xsl:if
- *   test %expr; #REQUIRED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:if">XXX in XSLT Specification</a>
- */
-public class ElemIf extends ElemTemplateElement
-{
-
-  /**
-   * The xsl:if element must have a test attribute, which specifies an expression.
-   * @serial
-   */
-  private XPath m_test = null;
-
-  /**
-   * Set the "test" attribute.
-   * The xsl:if element must have a test attribute, which specifies an expression.
-   *
-   * @param v test attribute to set
-   */
-  public void setTest(XPath v)
-  {
-    m_test = v;
-  }
-
-  /**
-   * Get the "test" attribute.
-   * The xsl:if element must have a test attribute, which specifies an expression.
-   *
-   * @return the "test" attribute for this element.
-   */
-  public XPath getTest()
-  {
-    return m_test;
-  }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   *
-   * NEEDSDOC @param sroot
-   *
-   * @throws TransformerException
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-
-    super.compose(sroot);
-
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-
-    if (null != m_test)
-      m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_IF;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return the element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_IF_STRING;
-  }
-
-  /**
-   * Conditionally execute a sub-template.
-   * The expression is evaluated and the resulting object is converted
-   * to a boolean as if by a call to the boolean function. If the result
-   * is true, then the content template is instantiated; otherwise, nothing
-   * is created.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    XPathContext xctxt = transformer.getXPathContext();
-    int sourceNode = xctxt.getCurrentNode();
-
-    if (TransformerImpl.S_DEBUG)
-    {
-      XObject test = m_test.execute(xctxt, sourceNode, this);
-
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-                "test", m_test, test);
-
-      if (test.bool())
-      {
-        transformer.executeChildTemplates(this, true);
-      }
-
-      // I don't think we want this.  -sb
-      //  if (TransformerImpl.S_DEBUG)
-      //    transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-      //            "endTest", m_test, test);
-    }
-    else if (m_test.bool(xctxt, sourceNode, this))
-    {
-      transformer.executeChildTemplates(this, true);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemLiteralResult.java b/src/org/apache/xalan/templates/ElemLiteralResult.java
deleted file mode 100644
index f2be775..0000000
--- a/src/org/apache/xalan/templates/ElemLiteralResult.java
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-
-import java.util.StringTokenizer;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.StringToStringTable;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xml.utils.StringVector;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-
-import javax.xml.transform.TransformerException;
-
-import java.io.*;
-
-import java.util.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement a Literal Result Element.
- * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
- */
-public class ElemLiteralResult extends ElemUse
-{
-
-  /**
-   * Tells if this element represents a root element
-   * that is also the stylesheet element.
-   * TODO: This should be a derived class.
-   * @serial
-   */
-  private boolean isLiteralResultAsStylesheet = false;
-
-  /**
-   * Set whether this element represents a root element
-   * that is also the stylesheet element.
-   *
-   *
-   * @param b boolean flag indicating whether this element
-   * represents a root element that is also the stylesheet element.
-   */
-  public void setIsLiteralResultAsStylesheet(boolean b)
-  {
-    isLiteralResultAsStylesheet = b;
-  }
-
-  /**
-   * Return whether this element represents a root element
-   * that is also the stylesheet element.
-   *
-   *
-   * @return boolean flag indicating whether this element
-   * represents a root element that is also the stylesheet element.
-   */
-  public boolean getIsLiteralResultAsStylesheet()
-  {
-    return isLiteralResultAsStylesheet;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    java.util.Vector vnames = cstate.getVariableNames();
-    if (null != m_avts)
-    {
-      int nAttrs = m_avts.size();
-
-      for (int i = (nAttrs - 1); i >= 0; i--)
-      {
-        AVT avt = (AVT) m_avts.elementAt(i);
-        avt.fixupVariables(vnames, cstate.getGlobalsSize());
-      } 
-    }   
-  }
-  
-  /**
-   * The created element node will have the attribute nodes
-   * that were present on the element node in the stylesheet tree,
-   * other than attributes with names in the XSLT namespace.
-   * @serial
-   */
-  private Vector m_avts = null;
-
-  /** List of attributes with the XSLT namespace.
-   *  @serial */
-  private Vector m_xslAttr = null;
-
-  /**
-   * Set a literal result attribute (AVTs only).
-   *
-   * @param avt literal result attribute to add (AVT only)
-   */
-  public void addLiteralResultAttribute(AVT avt)
-  {
-
-    if (null == m_avts)
-      m_avts = new Vector();
-
-    m_avts.addElement(avt);
-  }
-
-  /**
-   * Set a literal result attribute (used for xsl attributes).
-   *
-   * @param att literal result attribute to add
-   */
-  public void addLiteralResultAttribute(String att)
-  {
-
-    if (null == m_xslAttr)
-      m_xslAttr = new Vector();
-
-    m_xslAttr.addElement(att);
-  }
-  
-  /**
-   * Set the "xml:space" attribute.
-   * A text node is preserved if an ancestor element of the text node
-   * has an xml:space attribute with a value of preserve, and
-   * no closer ancestor element has xml:space with a value of default.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a>
-   *
-   * @param v  Enumerated value, either Constants.ATTRVAL_PRESERVE 
-   * or Constants.ATTRVAL_STRIP.
-   */
-  public void setXmlSpace(AVT avt)
-  {
-    // This function is a bit-o-hack, I guess...
-    addLiteralResultAttribute(avt);
-    String val = avt.getSimpleString();
-    if(val.equals("default"))
-    {
-      super.setXmlSpace(Constants.ATTRVAL_STRIP);
-    }
-    else if(val.equals("preserve"))
-    {
-      super.setXmlSpace(Constants.ATTRVAL_PRESERVE);
-    }
-    // else maybe it's a real AVT, so we can't resolve it at this time.
-  }
-
-
-  /**
-   * Get a literal result attribute by name.
-   *
-   * @param name Name of literal result attribute to get
-   *
-   * @return literal result attribute (AVT)
-   */
-  public AVT getLiteralResultAttribute(String name)
-  {
-
-    if (null != m_avts)
-    {
-      int nAttrs = m_avts.size();
-
-      for (int i = (nAttrs - 1); i >= 0; i--)
-      {
-        AVT avt = (AVT) m_avts.elementAt(i);
-
-        if (avt.getRawName().equals(name))
-        {
-          return avt;
-        }
-      }  // end for
-    }
-
-    return null;
-  }
-
-  /**
-   * Get whether or not the passed URL is contained flagged by
-   * the "extension-element-prefixes" property.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param prefix non-null reference to prefix that might be excluded.
-   *
-   * @return true if the prefix should normally be excluded.
-   */
-  public boolean containsExcludeResultPrefix(String prefix)
-  {
-
-    if (null == m_excludeResultPrefixes)
-      return super.containsExcludeResultPrefix(prefix);
-
-    if (prefix.length() == 0)
-      prefix = Constants.ATTRVAL_DEFAULT_PREFIX;
-
-    if (m_excludeResultPrefixes.contains(prefix))
-      return true;
-    else
-      return super.containsExcludeResultPrefix(prefix);
-  }
-
-  /**
-   * Augment resolvePrefixTables, resolving the namespace aliases once
-   * the superclass has resolved the tables.
-   *
-   * @throws TransformerException
-   */
-  public void resolvePrefixTables() throws TransformerException
-  {
-
-    super.resolvePrefixTables();
-
-    StylesheetRoot stylesheet = getStylesheetRoot();
-
-    if ((null != m_namespace) && (m_namespace.length() > 0))
-    {
-      NamespaceAlias nsa = stylesheet.getNamespaceAliasComposed(m_namespace);
-
-      if (null != nsa)
-      {
-        m_namespace = nsa.getResultNamespace();
-
-        // String resultPrefix = nsa.getResultPrefix();
-        String resultPrefix = nsa.getStylesheetPrefix();  // As per xsl WG, Mike Kay
-
-        if ((null != resultPrefix) && (resultPrefix.length() > 0))
-          m_rawName = resultPrefix + ":" + m_localName;
-        else
-          m_rawName = m_localName;
-      }
-    }
-
-    if (null != m_avts)
-    {
-      int n = m_avts.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        AVT avt = (AVT) m_avts.elementAt(i);
-
-        // Should this stuff be a method on AVT?
-        String ns = avt.getURI();
-
-        if ((null != ns) && (ns.length() > 0))
-        {
-          NamespaceAlias nsa =
-            stylesheet.getNamespaceAliasComposed(m_namespace);
-
-          if (null != nsa)
-          {
-            String namespace = nsa.getResultNamespace();
-
-            // String resultPrefix = nsa.getResultPrefix();
-            String resultPrefix = nsa.getStylesheetPrefix();  // As per XSL WG
-            String rawName = avt.getName();
-
-            if ((null != resultPrefix) && (resultPrefix.length() > 0))
-              rawName = resultPrefix + ":" + rawName;
-
-            avt.setURI(namespace);
-            avt.setRawName(rawName);
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   * Return whether we need to check namespace prefixes
-   * against and exclude result prefixes list.
-   * Note that this will create a new prefix table if one
-   * has not been created already.
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  boolean needToCheckExclude()
-  {
-
-    if (null == m_excludeResultPrefixes && null == m_prefixTable)
-      return false;
-    else
-    {
-
-      // Create a new prefix table if one has not already been created.
-      if (null == m_prefixTable)
-        m_prefixTable = new Vector();
-
-      return true;
-    }
-  }
-
-  /**
-   * The namespace of the element to be created.
-   * @serial
-   */
-  private String m_namespace;
-
-  /**
-   * Set the namespace URI of the result element to be created.
-   * Note that after resolvePrefixTables has been called, this will
-   * return the aliased result namespace, not the original stylesheet
-   * namespace.
-   *
-   * @param ns The Namespace URI, or the empty string if the
-   *        element has no Namespace URI.
-   */
-  public void setNamespace(String ns)
-  {
-    if(null == ns) // defensive, shouldn't have to do this.
-      ns = "";
-    m_namespace = ns;
-  }
-
-  /**
-   * Get the original namespace of the Literal Result Element.
-   *
-   * @return The Namespace URI, or the empty string if the
-   *        element has no Namespace URI.
-   */
-  public String getNamespace()
-  {
-    return m_namespace;
-  }
-
-  /**
-   * The local name of the element to be created.
-   * @serial
-   */
-  private String m_localName;
-
-  /**
-   * Set the local name of the LRE.
-   *
-   * @param localName The local name (without prefix) of the result element
-   *                  to be created.
-   */
-  public void setLocalName(String localName)
-  {
-    m_localName = localName;
-  }
-
-  /**
-   * Get the local name of the Literal Result Element.
-   * Note that after resolvePrefixTables has been called, this will
-   * return the aliased name prefix, not the original stylesheet
-   * namespace prefix.
-   *
-   * @return The local name (without prefix) of the result element
-   *                  to be created.
-   */
-  public String getLocalName()
-  {
-    return m_localName;
-  }
-
-  /**
-   * The raw name of the element to be created.
-   * @serial
-   */
-  private String m_rawName;
-
-  /**
-   * Set the raw name of the LRE.
-   *
-   * @param rawName The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   */
-  public void setRawName(String rawName)
-  {
-    m_rawName = rawName;
-  }
-
-  /**
-   * Get the raw name of the Literal Result Element.
-   *
-   * @return  The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   */
-  public String getRawName()
-  {
-    return m_rawName;
-  }
-
-  /**
-   * The "extension-element-prefixes" property, actually contains URIs.
-   * @serial
-   */
-  private StringVector m_ExtensionElementURIs;
-
-  /**
-   * Set the "extension-element-prefixes" property.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param v Vector of URI to set as the "extension-element-prefixes" property
-   */
-  public void setExtensionElementPrefixes(StringVector v)
-  {
-    m_ExtensionElementURIs = v;
-  }
-
-  /**
-   * Get an "extension-element-prefix" property.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param i Index of URI ("extension-element-prefix" property) to get
-   *
-   * @return URI at given index ("extension-element-prefix" property)
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public String getExtensionElementPrefix(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_ExtensionElementURIs)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return m_ExtensionElementURIs.elementAt(i);
-  }
-
-  /**
-   * Get the number of "extension-element-prefixes" Strings.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @return the number of "extension-element-prefixes" Strings
-   */
-  public int getExtensionElementPrefixCount()
-  {
-    return (null != m_ExtensionElementURIs)
-           ? m_ExtensionElementURIs.size() : 0;
-  }
-
-  /**
-   * Find out if the given "extension-element-prefix" property is defined.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param uri The URI to find
-   *
-   * @return True if the given URI is found
-   */
-  public boolean containsExtensionElementURI(String uri)
-  {
-
-    if (null == m_ExtensionElementURIs)
-      return false;
-
-    return m_ExtensionElementURIs.contains(uri);
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_LITERALRESULT;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-
-    // TODO: Need prefix.
-    return m_rawName;
-  }
-
-  /**
-   * The XSLT version as specified by this element.
-   * @serial
-   */
-  private String m_version;
-
-  /**
-   * Set the "version" property.
-   * @see <a href="http://www.w3.org/TR/xslt#forwards">forwards in XSLT Specification</a>
-   *
-   * @param v Version property value to set
-   */
-  public void setVersion(String v)
-  {
-    m_version = v;
-  }
-
-  /**
-   * The "exclude-result-prefixes" property.
-   * @serial
-   */
-  private StringVector m_excludeResultPrefixes;
-
-  /**
-   * Set the "exclude-result-prefixes" property.
-   * The designation of a namespace as an excluded namespace is
-   * effective within the subtree of the stylesheet rooted at
-   * the element bearing the exclude-result-prefixes or
-   * xsl:exclude-result-prefixes attribute; a subtree rooted
-   * at an xsl:stylesheet element does not include any stylesheets
-   * imported or included by children of that xsl:stylesheet element.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param v vector of prefixes that are resolvable to strings.
-   */
-  public void setExcludeResultPrefixes(StringVector v)
-  {
-    m_excludeResultPrefixes = v;
-  }
-
-  /**
-   * Tell if the result namespace decl should be excluded.  Should be called before
-   * namespace aliasing (I think).
-   *
-   * @param prefix Prefix of namespace to check
-   * @param uri URI of namespace to check
-   *
-   * @return True if the given namespace should be excluded
-   *
-   * @throws TransformerException
-   */
-  private boolean excludeResultNSDecl(String prefix, String uri)
-          throws TransformerException
-  {
-
-    if (null != m_excludeResultPrefixes)
-    {
-      if (m_excludeResultPrefixes.contains(prefix))
-        return true;
-    }
-
-    return false;
-  }
-  
-  /**
-   * Copy a Literal Result Element into the Result tree, copy the
-   * non-excluded namespace attributes, copy the attributes not
-   * of the XSLT namespace, and execute the children of the LRE.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    try
-    {
-      ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-
-      // Add namespace declarations.
-      executeNSDecls(transformer);
-      rhandler.startElement(getNamespace(), getLocalName(), getRawName(), null);
-
-      try
-      {
-
-        // Process any possible attributes from xsl:use-attribute-sets first
-        super.execute(transformer);
-
-        //xsl:version, excludeResultPrefixes???
-        // Process the list of avts next
-        if (null != m_avts)
-        {
-          int nAttrs = m_avts.size();
-
-          for (int i = (nAttrs - 1); i >= 0; i--)
-          {
-            AVT avt = (AVT) m_avts.elementAt(i);
-            XPathContext xctxt = transformer.getXPathContext();
-            int sourceNode = xctxt.getCurrentNode();
-            String stringedValue = avt.evaluate(xctxt, sourceNode, this);
-
-            if (null != stringedValue)
-            {
-
-              // Important Note: I'm not going to check for excluded namespace 
-              // prefixes here.  It seems like it's to expensive, and I'm not 
-              // even sure this is right.  But I could be wrong, so this needs 
-              // to be tested against other implementations.
-              rhandler.addAttribute(avt.getURI(), avt.getName(),
-                                    avt.getRawName(), "CDATA", stringedValue);
-            }
-          }  // end for
-        }
-
-        // Now process all the elements in this subtree
-        // TODO: Process m_extensionElementPrefixes && m_attributeSetsNames
-        transformer.executeChildTemplates(this, true);
-      }
-      finally
-      {
-        // If you don't do this in a finally statement, an exception could 
-        // cause a system hang.
-        rhandler.endElement(getNamespace(), getLocalName(), getRawName());
-        unexecuteNSDecls(transformer);
-      }
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Compiling templates requires that we be able to list the AVTs
-   * ADDED 9/5/2000 to support compilation experiment
-   *
-   * @return an Enumeration of the literal result attributes associated
-   * with this element.
-   */
-  public Enumeration enumerateLiteralResultAttributes()
-  {
-    return (null == m_avts) ? null : m_avts.elements();
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemMessage.java b/src/org/apache/xalan/templates/ElemMessage.java
deleted file mode 100644
index 3ef3eb6..0000000
--- a/src/org/apache/xalan/templates/ElemMessage.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:message.
- * <pre>
- * <!ELEMENT xsl:message %template;>
- * <!ATTLIST xsl:message
- *   %space-att;
- *   terminate (yes|no) "no"
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#message">message in XSLT Specification</a>
- */
-public class ElemMessage extends ElemTemplateElement
-{
-
-  /**
-   * If the terminate attribute has the value yes, then the
-   * XSLT transformer should terminate processing after sending
-   * the message. The default value is no.
-   * @serial
-   */
-  private boolean m_terminate = Constants.ATTRVAL_NO;  // default value 
-
-  /**
-   * Set the "terminate" attribute.
-   * If the terminate attribute has the value yes, then the
-   * XSLT transformer should terminate processing after sending
-   * the message. The default value is no.
-   *
-   * @param v Value to set for "terminate" attribute. 
-   */
-  public void setTerminate(boolean v)
-  {
-    m_terminate = v;
-  }
-
-  /**
-   * Get the "terminate" attribute.
-   * If the terminate attribute has the value yes, then the
-   * XSLT transformer should terminate processing after sending
-   * the message. The default value is no.
-   *
-   * @return value of "terminate" attribute.
-   */
-  public boolean getTerminate()
-  {
-    return m_terminate;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_MESSAGE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return name of the element 
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_MESSAGE_STRING;
-  }
-
-  /**
-   * Send a message to diagnostics.
-   * The xsl:message instruction sends a message in a way that
-   * is dependent on the XSLT transformer. The content of the xsl:message
-   * instruction is a template. The xsl:message is instantiated by
-   * instantiating the content to create an XML fragment. This XML
-   * fragment is the content of the message.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    String data = transformer.transformToString(this);
-
-    transformer.getMsgMgr().message(this, data, m_terminate);
-    
-    if(m_terminate)
-      transformer.getErrorListener().fatalError(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_DIRECTED_TERMINATION, null))); //"Stylesheet directed termination"));
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemNumber.java b/src/org/apache/xalan/templates/ElemNumber.java
deleted file mode 100644
index be3af0f..0000000
--- a/src/org/apache/xalan/templates/ElemNumber.java
+++ /dev/null
@@ -1,2101 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-//import org.w3c.dom.*;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import org.xml.sax.*;
-
-import java.util.*;
-
-import java.text.NumberFormat;
-import java.text.DecimalFormat;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.StringBufferPool;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xalan.res.*;
-import org.apache.xalan.transformer.DecimalToRoman;
-import org.apache.xalan.transformer.CountersTable;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xml.utils.NodeVector;
-
-import javax.xml.transform.TransformerException;
-
-// import org.apache.xalan.dtm.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:number.
- * <pre>
- * <!ELEMENT xsl:number EMPTY>
- * <!ATTLIST xsl:number
- *    level (single|multiple|any) "single"
- *    count %pattern; #IMPLIED
- *    from %pattern; #IMPLIED
- *    value %expr; #IMPLIED
- *    format %avt; '1'
- *    lang %avt; #IMPLIED
- *    letter-value %avt; #IMPLIED
- *    grouping-separator %avt; #IMPLIED
- *    grouping-size %avt; #IMPLIED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#number">number in XSLT Specification</a>
- */
-public class ElemNumber extends ElemTemplateElement
-{
-
-  /**
-   * Only nodes are counted that match this pattern.
-   * @serial
-   */
-  private XPath m_countMatchPattern = null;
-
-  /**
-   * Set the "count" attribute.
-   * The count attribute is a pattern that specifies what nodes
-   * should be counted at those levels. If count attribute is not
-   * specified, then it defaults to the pattern that matches any
-   * node with the same node type as the current node and, if the
-   * current node has an expanded-name, with the same expanded-name
-   * as the current node.
-   *
-   * @param v Value to set for "count" attribute. 
-   */
-  public void setCount(XPath v)
-  {
-    m_countMatchPattern = v;
-  }
-
-  /**
-   * Get the "count" attribute.
-   * The count attribute is a pattern that specifies what nodes
-   * should be counted at those levels. If count attribute is not
-   * specified, then it defaults to the pattern that matches any
-   * node with the same node type as the current node and, if the
-   * current node has an expanded-name, with the same expanded-name
-   * as the current node.
-   *
-   * @return Value of "count" attribute.
-   */
-  public XPath getCount()
-  {
-    return m_countMatchPattern;
-  }
-
-  /**
-   * Specifies where to count from.
-   * For level="single" or level="multiple":
-   * Only ancestors that are searched are
-   * those that are descendants of the nearest ancestor that matches
-   * the from pattern.
-   * For level="any:
-   * Only nodes after the first node before the
-   * current node that match the from pattern are considered.
-   * @serial
-   */
-  private XPath m_fromMatchPattern = null;
-
-  /**
-   * Set the "from" attribute. Specifies where to count from.
-   * For level="single" or level="multiple":
-   * Only ancestors that are searched are
-   * those that are descendants of the nearest ancestor that matches
-   * the from pattern.
-   * For level="any:
-   * Only nodes after the first node before the
-   * current node that match the from pattern are considered.
-   *
-   * @param v Value to set for "from" attribute.
-   */
-  public void setFrom(XPath v)
-  {
-    m_fromMatchPattern = v;
-  }
-
-  /**
-   * Get the "from" attribute.
-   * For level="single" or level="multiple":
-   * Only ancestors that are searched are
-   * those that are descendants of the nearest ancestor that matches
-   * the from pattern.
-   * For level="any:
-   * Only nodes after the first node before the
-   * current node that match the from pattern are considered.
-   *
-   * @return Value of "from" attribute.
-   */
-  public XPath getFrom()
-  {
-    return m_fromMatchPattern;
-  }
-
-  /**
-   * When level="single", it goes up to the first node in the ancestor-or-self axis
-   * that matches the count pattern, and constructs a list of length one containing
-   * one plus the number of preceding siblings of that ancestor that match the count
-   * pattern. If there is no such ancestor, it constructs an empty list. If the from
-   * attribute is specified, then the only ancestors that are searched are those
-   * that are descendants of the nearest ancestor that matches the from pattern.
-   * Preceding siblings has the same meaning here as with the preceding-sibling axis.
-   *
-   * When level="multiple", it constructs a list of all ancestors of the current node
-   * in document order followed by the element itself; it then selects from the list
-   * those nodes that match the count pattern; it then maps each node in the list to
-   * one plus the number of preceding siblings of that node that match the count pattern.
-   * If the from attribute is specified, then the only ancestors that are searched are
-   * those that are descendants of the nearest ancestor that matches the from pattern.
-   * Preceding siblings has the same meaning here as with the preceding-sibling axis.
-   *
-   * When level="any", it constructs a list of length one containing the number of
-   * nodes that match the count pattern and belong to the set containing the current
-   * node and all nodes at any level of the document that are before the current node
-   * in document order, excluding any namespace and attribute nodes (in other words
-   * the union of the members of the preceding and ancestor-or-self axes). If the
-   * from attribute is specified, then only nodes after the first node before the
-   * current node that match the from pattern are considered.
-   * @serial
-   */
-  private int m_level = Constants.NUMBERLEVEL_SINGLE;
-
-  /**
-   * Set the "level" attribute.
-   * The level attribute specifies what levels of the source tree should
-   * be considered; it has the values single, multiple or any. The default
-   * is single.
-   *
-   * @param v Value to set for "level" attribute.
-   */
-  public void setLevel(int v)
-  {
-    m_level = v;
-  }
-
-  /**
-   * Get the "level" attribute.
-   * The level attribute specifies what levels of the source tree should
-   * be considered; it has the values single, multiple or any. The default
-   * is single.
-   *
-   * @return Value of "level" attribute.
-   */
-  public int getLevel()
-  {
-    return m_level;
-  }
-
-  /**
-   * The value attribute contains an expression. The expression is evaluated
-   * and the resulting object is converted to a number as if by a call to the
-   * number function.
-   * @serial
-   */
-  private XPath m_valueExpr = null;
-
-  /**
-   * Set the "value" attribute.
-   * The value attribute contains an expression. The expression is evaluated
-   * and the resulting object is converted to a number as if by a call to the
-   * number function.
-   *
-   * @param v Value to set for "value" attribute.
-   */
-  public void setValue(XPath v)
-  {
-    m_valueExpr = v;
-  }
-
-  /**
-   * Get the "value" attribute.
-   * The value attribute contains an expression. The expression is evaluated
-   * and the resulting object is converted to a number as if by a call to the
-   * number function.
-   *
-   * @return Value of "value" attribute.
-   */
-  public XPath getValue()
-  {
-    return m_valueExpr;
-  }
-
-  /**
-   * The "format" attribute is used to control conversion of a list of
-   * numbers into a string.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   * @serial
-   */
-  private AVT m_format_avt = null;
-
-  /**
-   * Set the "format" attribute.
-   * The "format" attribute is used to control conversion of a list of
-   * numbers into a string.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @param v Value to set for "format" attribute.
-   */
-  public void setFormat(AVT v)
-  {
-    m_format_avt = v;
-  }
-
-  /**
-   * Get the "format" attribute.
-   * The "format" attribute is used to control conversion of a list of
-   * numbers into a string.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @return Value of "format" attribute.
-   */
-  public AVT getFormat()
-  {
-    return m_format_avt;
-  }
-
-  /**
-   * When numbering with an alphabetic sequence, the lang attribute
-   * specifies which language's alphabet is to be used.
-   * @serial
-   */
-  private AVT m_lang_avt = null;
-
-  /**
-   * Set the "lang" attribute.
-   * When numbering with an alphabetic sequence, the lang attribute
-   * specifies which language's alphabet is to be used; it has the same
-   * range of values as xml:lang [XML]; if no lang value is specified,
-   * the language should be determined from the system environment.
-   * Implementers should document for which languages they support numbering.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @param v Value to set for "lang" attribute.
-   */
-  public void setLang(AVT v)
-  {
-    m_lang_avt = v;
-  }
-
-  /**
-   * Get the "lang" attribute.
-   * When numbering with an alphabetic sequence, the lang attribute
-   * specifies which language's alphabet is to be used; it has the same
-   * range of values as xml:lang [XML]; if no lang value is specified,
-   * the language should be determined from the system environment.
-   * Implementers should document for which languages they support numbering.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @return Value ofr "lang" attribute.
-   */
-  public AVT getLang()
-  {
-    return m_lang_avt;
-  }
-
-  /**
-   * The letter-value attribute disambiguates between numbering
-   * sequences that use letters.
-   * @serial
-   */
-  private AVT m_lettervalue_avt = null;
-
-  /**
-   * Set the "letter-value" attribute.
-   * The letter-value attribute disambiguates between numbering sequences
-   * that use letters.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @param v Value to set for "letter-value" attribute.
-   */
-  public void setLetterValue(AVT v)
-  {
-    m_lettervalue_avt = v;
-  }
-
-  /**
-   * Get the "letter-value" attribute.
-   * The letter-value attribute disambiguates between numbering sequences
-   * that use letters.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @return Value to set for "letter-value" attribute.
-   */
-  public AVT getLetterValue()
-  {
-    return m_lettervalue_avt;
-  }
-
-  /**
-   * The grouping-separator attribute gives the separator
-   * used as a grouping (e.g. thousands) separator in decimal
-   * numbering sequences.
-   * @serial
-   */
-  private AVT m_groupingSeparator_avt = null;
-
-  /**
-   * Set the "grouping-separator" attribute.
-   * The grouping-separator attribute gives the separator
-   * used as a grouping (e.g. thousands) separator in decimal
-   * numbering sequences.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @param v Value to set for "grouping-separator" attribute.
-   */
-  public void setGroupingSeparator(AVT v)
-  {
-    m_groupingSeparator_avt = v;
-  }
-
-  /**
-   * Get the "grouping-separator" attribute.
-   * The grouping-separator attribute gives the separator
-   * used as a grouping (e.g. thousands) separator in decimal
-   * numbering sequences.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @return Value of "grouping-separator" attribute.
-   */
-  public AVT getGroupingSeparator()
-  {
-    return m_groupingSeparator_avt;
-  }
-
-  /**
-   * The optional grouping-size specifies the size (normally 3) of the grouping.
-   * @serial
-   */
-  private AVT m_groupingSize_avt = null;
-
-  /**
-   * Set the "grouping-size" attribute.
-   * The optional grouping-size specifies the size (normally 3) of the grouping.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @param v Value to set for "grouping-size" attribute.
-   */
-  public void setGroupingSize(AVT v)
-  {
-    m_groupingSize_avt = v;
-  }
-
-  /**
-   * Get the "grouping-size" attribute.
-   * The optional grouping-size specifies the size (normally 3) of the grouping.
-   * @see <a href="http://www.w3.org/TR/xslt#convert">convert in XSLT Specification</a>
-   *
-   * @return Value of "grouping-size" attribute.
-   */
-  public AVT getGroupingSize()
-  {
-    return m_groupingSize_avt;
-  }
-
-  /**
-   * Shouldn't this be in the transformer?  Big worries about threads...
-   */
-
-  // private XResourceBundle thisBundle;
-
-  /**
-   * Table to help in converting decimals to roman numerals.
-   * @see org.apache.xalan.transformer.DecimalToRoman
-   */
-  private final static DecimalToRoman m_romanConvertTable[] = {
-    new DecimalToRoman(1000, "M", 900, "CM"),
-    new DecimalToRoman(500, "D", 400, "CD"),
-    new DecimalToRoman(100L, "C", 90L, "XC"),
-    new DecimalToRoman(50L, "L", 40L, "XL"),
-    new DecimalToRoman(10L, "X", 9L, "IX"),
-    new DecimalToRoman(5L, "V", 4L, "IV"),
-    new DecimalToRoman(1L, "I", 1L, "I") };
-
-  /**
-   * Chars for converting integers into alpha counts.
-   * @see TransformerImpl#int2alphaCount
-   */
-  private static char[] m_alphaCountTable = null;
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    java.util.Vector vnames = cstate.getVariableNames();
-    if(null != m_countMatchPattern)
-      m_countMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_format_avt)
-      m_format_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_fromMatchPattern)
-      m_fromMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_groupingSeparator_avt)
-      m_groupingSeparator_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_groupingSize_avt)
-      m_groupingSize_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_lang_avt)
-      m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_lettervalue_avt)
-      m_lettervalue_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_valueExpr)
-      m_valueExpr.fixupVariables(vnames, cstate.getGlobalsSize());
-  }
-
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_NUMBER;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_NUMBER_STRING;
-  }
-
-  /**
-   * Execute an xsl:number instruction. The xsl:number element is
-   * used to insert a formatted number into the result tree.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    int sourceNode = transformer.getXPathContext().getCurrentNode();
-    String countString = getCountString(transformer, sourceNode);
-
-    try
-    {
-      transformer.getResultTreeHandler().characters(countString.toCharArray(),
-                                                    0, countString.length());
-    }
-    catch(SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to child list
-   *
-   * @return Child just added to child list
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    error(XSLTErrorResources.ER_CANNOT_ADD,
-          new Object[]{ newChild.getNodeName(),
-                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    return null;
-  }
-
-  /**
-   * Given a 'from' pattern (ala xsl:number), a match pattern
-   * and a context, find the first ancestor that matches the
-   * pattern (including the context handed in).
-   *
-   * @param xctxt The XPath runtime state for this.
-   * @param fromMatchPattern The ancestor must match this pattern.
-   * @param countMatchPattern The ancestor must also match this pattern.
-   * @param context The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * queries are supposed to be expanded.
-   *
-   * @return the first ancestor that matches the given pattern
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  int findAncestor(
-          XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, 
-          int context, ElemNumber namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-    DTM dtm = xctxt.getDTM(context);
-    while (DTM.NULL != context)
-    {
-      if (null != fromMatchPattern)
-      {
-        if (fromMatchPattern.getMatchScore(xctxt, context)
-                != XPath.MATCH_SCORE_NONE)
-        {
-
-          //context = null;
-          break;
-        }
-      }
-
-      if (null != countMatchPattern)
-      {
-        if (countMatchPattern.getMatchScore(xctxt, context)
-                != XPath.MATCH_SCORE_NONE)
-        {
-          break;
-        }
-      }
-
-      context = dtm.getParent(context);
-    }
-
-    return context;
-  }
-
-  /**
-   * Given a 'from' pattern (ala xsl:number), a match pattern
-   * and a context, find the first ancestor that matches the
-   * pattern (including the context handed in).
-   * @param xctxt The XPath runtime state for this.
-   * @param fromMatchPattern The ancestor must match this pattern.
-   * @param countMatchPattern The ancestor must also match this pattern.
-   * @param context The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * queries are supposed to be expanded.
-   *
-   * @return the first preceding, ancestor or self node that 
-   * matches the given pattern
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private int findPrecedingOrAncestorOrSelf(
-          XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, 
-          int context, ElemNumber namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-    DTM dtm = xctxt.getDTM(context);
-    while (DTM.NULL != context)
-    {
-      if (null != fromMatchPattern)
-      {
-        if (fromMatchPattern.getMatchScore(xctxt, context)
-                != XPath.MATCH_SCORE_NONE)
-        {
-          context = DTM.NULL;
-
-          break;
-        }
-      }
-
-      if (null != countMatchPattern)
-      {
-        if (countMatchPattern.getMatchScore(xctxt, context)
-                != XPath.MATCH_SCORE_NONE)
-        {
-          break;
-        }
-      }
-
-      int prevSibling = dtm.getPreviousSibling(context);
-
-      if (DTM.NULL == prevSibling)
-      {
-        context = dtm.getParent(context);
-      }
-      else
-      {
-
-        // Now go down the chain of children of this sibling 
-        context = dtm.getLastChild(prevSibling);
-
-        if (context == DTM.NULL)
-          context = prevSibling;
-      }
-    }
-
-    return context;
-  }
-
-  /**
-   * Get the count match pattern, or a default value.
-   *
-   * @param support The XPath runtime state for this.
-   * @param contextNode The node that "." expresses.
-   *
-   * @return the count match pattern, or a default value. 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  XPath getCountMatchPattern(XPathContext support, int contextNode)
-          throws javax.xml.transform.TransformerException
-  {
-
-    XPath countMatchPattern = m_countMatchPattern;
-    DTM dtm = support.getDTM(contextNode);
-    if (null == countMatchPattern)
-    {
-      switch (dtm.getNodeType(contextNode))
-      {
-      case DTM.ELEMENT_NODE :
-
-        // countMatchPattern = m_stylesheet.createMatchPattern(contextNode.getNodeName(), this);
-        countMatchPattern = new XPath(dtm.getNodeName(contextNode), this, this,
-                                      XPath.MATCH, support.getErrorListener());
-        break;
-      case DTM.ATTRIBUTE_NODE :
-
-        // countMatchPattern = m_stylesheet.createMatchPattern("@"+contextNode.getNodeName(), this);
-        countMatchPattern = new XPath("@" + dtm.getNodeName(contextNode), this,
-                                      this, XPath.MATCH, support.getErrorListener());
-        break;
-      case DTM.CDATA_SECTION_NODE :
-      case DTM.TEXT_NODE :
-
-        // countMatchPattern = m_stylesheet.createMatchPattern("text()", this);
-        countMatchPattern = new XPath("text()", this, this, XPath.MATCH, support.getErrorListener());
-        break;
-      case DTM.COMMENT_NODE :
-
-        // countMatchPattern = m_stylesheet.createMatchPattern("comment()", this);
-        countMatchPattern = new XPath("comment()", this, this, XPath.MATCH, support.getErrorListener());
-        break;
-      case DTM.DOCUMENT_NODE :
-
-        // countMatchPattern = m_stylesheet.createMatchPattern("/", this);
-        countMatchPattern = new XPath("/", this, this, XPath.MATCH, support.getErrorListener());
-        break;
-      case DTM.PROCESSING_INSTRUCTION_NODE :
-
-        // countMatchPattern = m_stylesheet.createMatchPattern("pi("+contextNode.getNodeName()+")", this);
-        countMatchPattern = new XPath("pi(" + dtm.getNodeName(contextNode)
-                                      + ")", this, this, XPath.MATCH, support.getErrorListener());
-        break;
-      default :
-        countMatchPattern = null;
-      }
-    }
-
-    return countMatchPattern;
-  }
-
-  /**
-   * Given an XML source node, get the count according to the
-   * parameters set up by the xsl:number attributes.
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode The source node being counted.
-   *
-   * @return The count of nodes
-   *
-   * @throws TransformerException
-   */
-  String getCountString(TransformerImpl transformer, int sourceNode)
-          throws TransformerException
-  {
-
-    int[] list = null;
-    XPathContext xctxt = transformer.getXPathContext();
-    CountersTable ctable = transformer.getCountersTable();
-
-    if (null != m_valueExpr)
-    {
-      XObject countObj = m_valueExpr.execute(xctxt, sourceNode, this);
-      int count = (int) java.lang.Math.floor(countObj.num()+ 0.5);
-
-      list = new int[1];
-      list[0] = count;
-    }
-    else
-    {
-      if (Constants.NUMBERLEVEL_ANY == m_level)
-      {
-        list = new int[1];
-        list[0] = ctable.countNode(xctxt, this, sourceNode);
-      }
-      else
-      {
-        NodeVector ancestors =
-          getMatchingAncestors(xctxt, sourceNode,
-                               Constants.NUMBERLEVEL_SINGLE == m_level);
-        int lastIndex = ancestors.size() - 1;
-
-        if (lastIndex >= 0)
-        {
-          list = new int[lastIndex + 1];
-
-          for (int i = lastIndex; i >= 0; i--)
-          {
-            int target = ancestors.elementAt(i);
-
-            list[lastIndex - i] = ctable.countNode(xctxt, this, target);
-          }
-        }
-      }
-    }
-
-    return (null != list)
-           ? formatNumberList(transformer, list, sourceNode) : "";
-  }
-
-  /**
-   * Get the previous node to be counted.
-   *
-   * @param xctxt The XPath runtime state for this.
-   * @param pos The current node
-   *
-   * @return the previous node to be counted.
-   *
-   * @throws TransformerException
-   */
-  public int getPreviousNode(XPathContext xctxt, int pos)
-          throws TransformerException
-  {
-
-    XPath countMatchPattern = getCountMatchPattern(xctxt, pos);
-    DTM dtm = xctxt.getDTM(pos);
-
-    if (Constants.NUMBERLEVEL_ANY == m_level)
-    {
-      XPath fromMatchPattern = m_fromMatchPattern;
-
-      // Do a backwards document-order walk 'till a node is found that matches 
-      // the 'from' pattern, or a node is found that matches the 'count' pattern, 
-      // or the top of the tree is found.
-      while (DTM.NULL != pos)
-      {
-
-        // Get the previous sibling, if there is no previous sibling, 
-        // then count the parent, but if there is a previous sibling, 
-        // dive down to the lowest right-hand (last) child of that sibling.
-        int next = dtm.getPreviousSibling(pos);
-
-        if (DTM.NULL == next)
-        {
-          next = dtm.getParent(pos);
-
-          if ((DTM.NULL != next) && ((((null != fromMatchPattern) && (fromMatchPattern.getMatchScore(
-                  xctxt, next) != XPath.MATCH_SCORE_NONE))) 
-              || (dtm.getNodeType(next) == DTM.DOCUMENT_NODE)))
-          {
-            pos = DTM.NULL;  // return null from function.
-
-            break;  // from while loop
-          }
-        }
-        else
-        {
-
-          // dive down to the lowest right child.
-          int child = next;
-
-          while (DTM.NULL != child)
-          {
-            child = dtm.getLastChild(next);
-
-            if (DTM.NULL != child)
-              next = child;
-          }
-        }
-
-        pos = next;
-
-        if ((DTM.NULL != pos)
-                && ((null == countMatchPattern)
-                    || (countMatchPattern.getMatchScore(xctxt, pos)
-                        != XPath.MATCH_SCORE_NONE)))
-        {
-          break;
-        }
-      }
-    }
-    else  // NUMBERLEVEL_MULTI or NUMBERLEVEL_SINGLE
-    {
-      while (DTM.NULL != pos)
-      {
-        pos = dtm.getPreviousSibling(pos);
-
-        if ((DTM.NULL != pos)
-                && ((null == countMatchPattern)
-                    || (countMatchPattern.getMatchScore(xctxt, pos)
-                        != XPath.MATCH_SCORE_NONE)))
-        {
-          break;
-        }
-      }
-    }
-
-    return pos;
-  }
-
-  /**
-   * Get the target node that will be counted..
-   *
-   * @param xctxt The XPath runtime state for this.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   *
-   * @return the target node that will be counted
-   *
-   * @throws TransformerException
-   */
-  public int getTargetNode(XPathContext xctxt, int sourceNode)
-          throws TransformerException
-  {
-
-    int target = DTM.NULL;
-    XPath countMatchPattern = getCountMatchPattern(xctxt, sourceNode);
-
-    if (Constants.NUMBERLEVEL_ANY == m_level)
-    {
-      target = findPrecedingOrAncestorOrSelf(xctxt, m_fromMatchPattern,
-                                             countMatchPattern, sourceNode,
-                                             this);
-    }
-    else
-    {
-      target = findAncestor(xctxt, m_fromMatchPattern, countMatchPattern,
-                            sourceNode, this);
-    }
-
-    return target;
-  }
-
-  /**
-   * Get the ancestors, up to the root, that match the
-   * pattern.
-   * 
-   * @param patterns if non-null, count only nodes
-   * that match this pattern, if null count all ancestors.
-   * @param xctxt The XPath runtime state for this.
-   * @param node Count this node and it's ancestors.
-   * @param stopAtFirstFound Flag indicating to stop after the
-   * first node is found (difference between level = single
-   * or multiple)
-   * @return The number of ancestors that match the pattern.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  NodeVector getMatchingAncestors(
-          XPathContext xctxt, int node, boolean stopAtFirstFound)
-            throws javax.xml.transform.TransformerException
-  {
-
-    NodeSetDTM ancestors = new NodeSetDTM(xctxt.getDTMManager());
-    XPath countMatchPattern = getCountMatchPattern(xctxt, node);
-    DTM dtm = xctxt.getDTM(node);
-
-    while (DTM.NULL != node)
-    {
-      if ((null != m_fromMatchPattern)
-              && (m_fromMatchPattern.getMatchScore(xctxt, node)
-                  != XPath.MATCH_SCORE_NONE))
-      {
-
-        // The following if statement gives level="single" different 
-        // behavior from level="multiple", which seems incorrect according 
-        // to the XSLT spec.  For now we are leaving this in to replicate 
-        // the same behavior in XT, but, for all intents and purposes we 
-        // think this is a bug, or there is something about level="single" 
-        // that we still don't understand.
-        if (!stopAtFirstFound)
-          break;
-      }
-
-      if (null == countMatchPattern)
-        System.out.println(
-          "Programmers error! countMatchPattern should never be null!");
-
-      if (countMatchPattern.getMatchScore(xctxt, node)
-              != XPath.MATCH_SCORE_NONE)
-      {
-        ancestors.addElement(node);
-
-        if (stopAtFirstFound)
-          break;
-      }
-
-      node = dtm.getParent(node);
-    }
-
-    return ancestors;
-  }  // end getMatchingAncestors method
-
-  /**
-   * Get the locale we should be using.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param contextNode The node that "." expresses.
-   *
-   * @return The locale to use. May be specified by "lang" attribute,
-   * but if not, use default locale on the system. 
-   *
-   * @throws TransformerException
-   */
-  Locale getLocale(TransformerImpl transformer, int contextNode)
-          throws TransformerException
-  {
-
-    Locale locale = null;
-
-    if (null != m_lang_avt)
-    {
-      XPathContext xctxt = transformer.getXPathContext();
-      String langValue = m_lang_avt.evaluate(xctxt, contextNode, this);
-
-      if (null != langValue)
-      {
-
-        // Not really sure what to do about the country code, so I use the
-        // default from the system.
-        // TODO: fix xml:lang handling.
-        locale = new Locale(langValue.toUpperCase(), "");
-
-        //Locale.getDefault().getDisplayCountry());
-        if (null == locale)
-        {
-          transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode),
-                                       XSLTErrorResources.WG_LOCALE_NOT_FOUND,
-                                       new Object[]{ langValue });  //"Warning: Could not find locale for xml:lang="+langValue);
-
-          locale = Locale.getDefault();
-        }
-      }
-    }
-    else
-    {
-      locale = Locale.getDefault();
-    }
-
-    return locale;
-  }
-
-  /**
-   * Get the number formatter to be used the format the numbers
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param contextNode The node that "." expresses.
-   *
-   * ($objectName$) @return The number formatter to be used
-   *
-   * @throws TransformerException
-   */
-  private DecimalFormat getNumberFormatter(
-          TransformerImpl transformer, int contextNode) throws TransformerException
-  {
-    // Patch from Steven Serocki
-    // Maybe we really want to do the clone in getLocale() and return  
-    // a clone of the default Locale??
-    Locale locale = (Locale)getLocale(transformer, contextNode).clone();
-
-    // Helper to format local specific numbers to strings.
-    DecimalFormat formatter;
-
-    //synchronized (locale)
-    //{
-      formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale);
-    //}
-
-    String digitGroupSepValue =
-      (null != m_groupingSeparator_avt)
-      ? m_groupingSeparator_avt.evaluate(
-      transformer.getXPathContext(), contextNode, this) : null;
-    String nDigitsPerGroupValue =
-      (null != m_groupingSize_avt)
-      ? m_groupingSize_avt.evaluate(
-      transformer.getXPathContext(), contextNode, this) : null;
-
-    // TODO: Handle digit-group attributes
-    if ((null != digitGroupSepValue) && (null != nDigitsPerGroupValue))
-    {
-      try
-      {
-        formatter.setGroupingSize(
-          Integer.valueOf(nDigitsPerGroupValue).intValue());
-        formatter.getDecimalFormatSymbols().setGroupingSeparator(
-          digitGroupSepValue.charAt(0));
-        formatter.setGroupingUsed(true);
-      }
-      catch (NumberFormatException ex)
-      {
-        formatter.setGroupingUsed(false);
-      }
-    }
-
-    return formatter;
-  }
-
-  /**
-   * Format a vector of numbers into a formatted string.
-   * 
-   * @param xslNumberElement Element that takes %conversion-atts; attributes.
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param list Array of one or more integer numbers.
-   * @param contextNode The node that "." expresses.
-   * @return String that represents list according to
-   * %conversion-atts; attributes.
-   * TODO: Optimize formatNumberList so that it caches the last count and
-   * reuses that info for the next count.
-   *
-   * @throws TransformerException
-   */
-  String formatNumberList(
-          TransformerImpl transformer, int[] list, int contextNode)
-            throws TransformerException
-  {
-
-    String numStr;
-    FastStringBuffer formattedNumber = StringBufferPool.get();
-
-    try
-    {
-      int nNumbers = list.length, numberWidth = 1;
-      char numberType = '1';
-      String formatToken, lastSepString = null, formatTokenString = null;
-
-      // If a seperator hasn't been specified, then use "."  
-      // as a default separator. 
-      // For instance: [2][1][5] with a format value of "1 "
-      // should format to "2.1.5 " (I think).
-      // Otherwise, use the seperator specified in the format string.
-      // For instance: [2][1][5] with a format value of "01-001. "
-      // should format to "02-001-005 ".
-      String lastSep = ".";
-      boolean isFirstToken = true;  // true if first token  
-      String formatValue =
-        (null != m_format_avt)
-        ? m_format_avt.evaluate(
-        transformer.getXPathContext(), contextNode, this) : null;
-
-      if (null == formatValue)
-        formatValue = "1";
-
-      NumberFormatStringTokenizer formatTokenizer =
-        new NumberFormatStringTokenizer(formatValue);
-
-      // int sepCount = 0;                  // keep track of seperators
-      // Loop through all the numbers in the list.
-      for (int i = 0; i < nNumbers; i++)
-      {
-
-        // Loop to the next digit, letter, or separator.
-        if (formatTokenizer.hasMoreTokens())
-        {
-          formatToken = formatTokenizer.nextToken();
-
-          // If the first character of this token is a character or digit, then 
-          // it is a number format directive.
-          if (Character.isLetterOrDigit(
-                  formatToken.charAt(formatToken.length() - 1)))
-          {
-            numberWidth = formatToken.length();
-            numberType = formatToken.charAt(numberWidth - 1);
-          }
-
-          // If there is a number format directive ahead, 
-          // then append the formatToken.
-          else if (formatTokenizer.isLetterOrDigitAhead())
-          {
-            formatTokenString = formatToken;
-
-            // Append the formatToken string...
-            // For instance [2][1][5] with a format value of "1--1. "
-            // should format to "2--1--5. " (I guess).
-            while (formatTokenizer.nextIsSep())
-            {
-              formatToken = formatTokenizer.nextToken();
-              formatTokenString += formatToken;
-            }
-
-            // Record this separator, so it can be used as the 
-            // next separator, if the next is the last.
-            // For instance: [2][1][5] with a format value of "1-1 "
-            // should format to "2-1-5 ".
-            if (!isFirstToken)
-              lastSep = formatTokenString;
-
-            // Since we know the next is a number or digit, we get it now.
-            formatToken = formatTokenizer.nextToken();
-            numberWidth = formatToken.length();
-            numberType = formatToken.charAt(numberWidth - 1);
-          }
-          else  // only separators left
-          {
-
-            // Set up the string for the trailing characters after 
-            // the last number is formatted (i.e. after the loop).
-            lastSepString = formatToken;
-
-            // And append any remaining characters to the lastSepString.
-            while (formatTokenizer.hasMoreTokens())
-            {
-              formatToken = formatTokenizer.nextToken();
-              lastSepString += formatToken;
-            }
-          }  // else
-        }  // end if(formatTokenizer.hasMoreTokens())
-
-        // if this is the first token and there was a prefix
-        // append the prefix else, append the separator
-        // For instance, [2][1][5] with a format value of "(1-1.) "
-        // should format to "(2-1-5.) " (I guess).
-        if (null != formatTokenString && isFirstToken)
-        {
-          formattedNumber.append(formatTokenString);
-        }
-        else if (null != lastSep &&!isFirstToken)
-          formattedNumber.append(lastSep);
-
-        getFormattedNumber(transformer, contextNode, numberType, numberWidth,
-                           list[i], formattedNumber);
-
-        isFirstToken = false;  // After the first pass, this should be false
-      }  // end for loop
-
-      // Check to see if we finished up the format string...
-      // Skip past all remaining letters or digits
-      while (formatTokenizer.isLetterOrDigitAhead())
-      {
-        formatTokenizer.nextToken();
-      }
-
-      if (lastSepString != null)
-        formattedNumber.append(lastSepString);
-
-      while (formatTokenizer.hasMoreTokens())
-      {
-        formatToken = formatTokenizer.nextToken();
-
-        formattedNumber.append(formatToken);
-      }
-
-      numStr = formattedNumber.toString();
-    }
-    finally
-    {
-      StringBufferPool.free(formattedNumber);
-    }
-
-    return numStr;
-  }  // end formatNumberList method
-
-  /*
-  * Get Formatted number
-  */
-
-  /**
-   * Format the given number and store it in the given buffer 
-   *
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param contextNode The node that "." expresses.
-   * @param numberType Type to format to
-   * @param numberWidth Maximum length of formatted number
-   * @param listElement Number to format
-   * @param formattedNumber Buffer to store formatted number
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private void getFormattedNumber(
-          TransformerImpl transformer, int contextNode, 
-          char numberType, int numberWidth, int listElement, 
-          FastStringBuffer formattedNumber)
-            throws javax.xml.transform.TransformerException
-  {
-
-    DecimalFormat formatter = getNumberFormatter(transformer, contextNode);
-    String padString = formatter.format(0);
-    String letterVal =
-      (m_lettervalue_avt != null)
-      ? m_lettervalue_avt.evaluate(
-      transformer.getXPathContext(), contextNode, this) : null;
-
-    switch (numberType)
-    {
-    case 'A' :
-      if (m_alphaCountTable == null)
-      {
-        XResourceBundle thisBundle;
-
-        thisBundle =
-          (XResourceBundle) XResourceBundle.loadResourceBundle(
-            org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode));
-
-        char[] alphabet;
-
-        alphabet = (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET);
-        m_alphaCountTable = alphabet;
-      }
-
-      int2alphaCount(listElement, m_alphaCountTable, formattedNumber);
-      break;
-    case 'a' :
-      if (m_alphaCountTable == null)
-      {
-        XResourceBundle thisBundle;
-
-        thisBundle =
-          (XResourceBundle) XResourceBundle.loadResourceBundle(
-            org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode));
-
-        char[] alphabet;
-
-        alphabet = (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET);
-        m_alphaCountTable = alphabet;
-      }
-
-      FastStringBuffer stringBuf = StringBufferPool.get();
-
-      try
-      {
-        int2alphaCount(listElement, m_alphaCountTable, stringBuf);
-        formattedNumber.append(
-          stringBuf.toString().toLowerCase(
-            getLocale(transformer, contextNode)));
-      }
-      finally
-      {
-        StringBufferPool.free(stringBuf);
-      }
-      break;
-    case 'I' :
-      formattedNumber.append(long2roman(listElement, true));
-      break;
-    case 'i' :
-      formattedNumber.append(
-        long2roman(listElement, true).toLowerCase(
-          getLocale(transformer, contextNode)));
-      break;
-    case 0x3042 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HA"));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        formattedNumber.append(
-          int2singlealphaCount(
-            listElement,
-            (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
-
-      break;
-    }
-    case 0x3044 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HI"));
-
-      if ((letterVal != null)
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        formattedNumber.append(
-          int2singlealphaCount(
-            listElement,
-            (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
-
-      break;
-    }
-    case 0x30A2 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "A"));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        formattedNumber.append(
-          int2singlealphaCount(
-            listElement,
-            (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
-
-      break;
-    }
-    case 0x30A4 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "I"));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        formattedNumber.append(
-          int2singlealphaCount(
-            listElement,
-            (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
-
-      break;
-    }
-    case 0x4E00 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("zh", "CN"));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-      {
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      }
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    case 0x58F9 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("zh", "TW"));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    case 0x0E51 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("th", ""));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    case 0x05D0 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("he", ""));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    case 0x10D0 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ka", ""));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    case 0x03B1 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("el", ""));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    case 0x0430 :
-    {
-      XResourceBundle thisBundle;
-
-      thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("cy", ""));
-
-      if (letterVal != null
-              && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
-        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
-      else  //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
-        int2alphaCount(listElement,
-                       (char[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
-                       formattedNumber);
-
-      break;
-    }
-    default :  // "1"
-      String numString = formatter.format(listElement);
-      int nPadding = numberWidth - numString.length();
-
-      for (int k = 0; k < nPadding; k++)
-      {
-        formattedNumber.append(padString);
-      }
-
-      formattedNumber.append(numString);
-    }
-  }
-  
-  /**
-   * Get a string value for zero, which is not really defined by the 1.0 spec, 
-   * thought I think it might be cleared up by the erreta.
-   */
-   String getZeroString()
-   {
-     return ""+0;
-   }
-
-  /**
-   * Convert a long integer into alphabetic counting, in other words
-   * count using the sequence A B C ... Z.
-   * 
-   * @param val Value to convert -- must be greater than zero.
-   * @param table a table containing one character for each digit in the radix
-   * @return String representing alpha count of number.
-   * @see TransformerImpl#DecimalToRoman
-   *
-   * Note that the radix of the conversion is inferred from the size
-   * of the table.
-   */
-  protected String int2singlealphaCount(int val, char[] table)
-  {
-
-    int radix = table.length;
-
-    // TODO:  throw error on out of range input
-    if (val > radix)
-    {
-      return getZeroString();
-    }
-    else
-      return (new Character(table[val - 1])).toString();  // index into table is off one, starts at 0
-  }
-
-  /**
-   * Convert a long integer into alphabetic counting, in other words
-   * count using the sequence A B C ... Z AA AB AC.... etc.
-   * 
-   * @param val Value to convert -- must be greater than zero.
-   * @param table a table containing one character for each digit in the radix
-   * @param aTable Array of alpha characters representing numbers
-   * @param stringBuf Buffer where to save the string representing alpha count of number.
-   * 
-   * @see TransformerImpl#DecimalToRoman
-   *
-   * Note that the radix of the conversion is inferred from the size
-   * of the table.
-   */
-  protected void int2alphaCount(int val, char[] aTable,
-                                FastStringBuffer stringBuf)
-  {
-
-    int radix = aTable.length;
-    char[] table = new char[aTable.length];
-
-    // start table at 1, add last char at index 0. Reason explained above and below.
-    int i;
-
-    for (i = 0; i < aTable.length - 1; i++)
-    {
-      table[i + 1] = aTable[i];
-    }
-
-    table[0] = aTable[i];
-
-    // Create a buffer to hold the result
-    // TODO:  size of the table can be detereined by computing
-    // logs of the radix.  For now, we fake it.
-    char buf[] = new char[100];
-
-    //some languages go left to right(ie. english), right to left (ie. Hebrew),
-    //top to bottom (ie.Japanese), etc... Handle them differently
-    //String orientation = thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_ORIENTATION);
-    // next character to set in the buffer
-    int charPos;
-
-    charPos = buf.length - 1;  // work backward through buf[]  
-
-    // index in table of the last character that we stored
-    int lookupIndex = 1;  // start off with anything other than zero to make correction work
-
-    //                                          Correction number
-    //
-    //  Correction can take on exactly two values:
-    //
-    //          0       if the next character is to be emitted is usual
-    //
-    //      radix - 1
-    //                  if the next char to be emitted should be one less than
-    //                  you would expect
-    //                  
-    // For example, consider radix 10, where 1="A" and 10="J"
-    //
-    // In this scheme, we count: A, B, C ...   H, I, J (not A0 and certainly
-    // not AJ), A1
-    //
-    // So, how do we keep from emitting AJ for 10?  After correctly emitting the
-    // J, lookupIndex is zero.  We now compute a correction number of 9 (radix-1).
-    // In the following line, we'll compute (val+correction) % radix, which is,
-    // (val+9)/10.  By this time, val is 1, so we compute (1+9) % 10, which
-    // is 10 % 10 or zero.  So, we'll prepare to emit "JJ", but then we'll
-    // later suppress the leading J as representing zero (in the mod system,
-    // it can represent either 10 or zero).  In summary, the correction value of
-    // "radix-1" acts like "-1" when run through the mod operator, but with the
-    // desireable characteristic that it never produces a negative number.
-    int correction = 0;
-
-    // TODO:  throw error on out of range input
-    do
-    {
-
-      // most of the correction calculation is explained above,  the reason for the
-      // term after the "|| " is that it correctly propagates carries across
-      // multiple columns.
-      correction =
-        ((lookupIndex == 0) || (correction != 0 && lookupIndex == radix - 1))
-        ? (radix - 1) : 0;
-
-      // index in "table" of the next char to emit
-      lookupIndex = (val + correction) % radix;
-
-      // shift input by one "column"
-      val = (val / radix);
-
-      // if the next value we'd put out would be a leading zero, we're done.
-      if (lookupIndex == 0 && val == 0)
-        break;
-
-      // put out the next character of output
-      buf[charPos--] = table[lookupIndex];  // left to right or top to bottom   
-    }
-    while (val > 0);
-
-    stringBuf.append(buf, charPos + 1, (buf.length - charPos - 1));
-  }
-
-  /**
-   * Convert a long integer into traditional alphabetic counting, in other words
-   * count using the traditional numbering.
-   * 
-   * @param val Value to convert -- must be greater than zero.
-   * @param table a table containing one character for each digit in the radix
-   * @param thisBundle Resource bundle to use
-   * 
-   * @return String representing alpha count of number.
-   * @see XSLProcessor#DecimalToRoman
-   *
-   * Note that the radix of the conversion is inferred from the size
-   * of the table.
-   */
-  protected String tradAlphaCount(int val, XResourceBundle thisBundle)
-  {
-
-    // if this number is larger than the largest number we can represent, error!
-    //if (val > ((Integer)thisBundle.getObject("MaxNumericalValue")).intValue())
-    //return XSLTErrorResources.ERROR_STRING;
-    char[] table = null;
-
-    // index in table of the last character that we stored
-    int lookupIndex = 1;  // start off with anything other than zero to make correction work
-
-    // Create a buffer to hold the result
-    // TODO:  size of the table can be detereined by computing
-    // logs of the radix.  For now, we fake it.
-    char buf[] = new char[100];
-
-    //some languages go left to right(ie. english), right to left (ie. Hebrew),
-    //top to bottom (ie.Japanese), etc... Handle them differently
-    //String orientation = thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_ORIENTATION);
-    // next character to set in the buffer
-    int charPos;
-
-    charPos = 0;  //start at 0
-
-    // array of number groups: ie.1000, 100, 10, 1
-    int[] groups = (int[]) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_NUMBERGROUPS);
-
-    // array of tables of hundreds, tens, digits...
-    String[] tables =
-      (String[]) (thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_NUM_TABLES));
-
-    //some languages have additive alphabetical notation,
-    //some multiplicative-additive, etc... Handle them differently.
-    String numbering = thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_NUMBERING);
-
-    // do multiplicative part first
-    if (numbering.equals(org.apache.xml.utils.res.XResourceBundle.LANG_MULT_ADD))
-    {
-      String mult_order = thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.MULT_ORDER);
-      int[] multiplier =
-        (int[]) (thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_MULTIPLIER));
-      char[] zeroChar = (char[]) thisBundle.getObject("zero");
-      int i = 0;
-
-      // skip to correct multiplier
-      while (i < multiplier.length && val < multiplier[i])
-      {
-        i++;
-      }
-
-      do
-      {
-        if (i >= multiplier.length)
-          break;  //number is smaller than multipliers
-
-        // some languages (ie chinese) put a zero character (and only one) when
-        // the multiplier is multiplied by zero. (ie, 1001 is 1X1000 + 0X100 + 0X10 + 1)
-        // 0X100 is replaced by the zero character, we don't need one for 0X10
-        if (val < multiplier[i])
-        {
-          if (zeroChar.length == 0)
-          {
-            i++;
-          }
-          else
-          {
-            if (buf[charPos - 1] != zeroChar[0])
-              buf[charPos++] = zeroChar[0];
-
-            i++;
-          }
-        }
-        else if (val >= multiplier[i])
-        {
-          int mult = val / multiplier[i];
-
-          val = val % multiplier[i];  // save this.
-
-          int k = 0;
-
-          while (k < groups.length)
-          {
-            lookupIndex = 1;  // initialize for each table
-
-            if (mult / groups[k] <= 0)  // look for right table
-              k++;
-            else
-            {
-
-              // get the table
-              char[] THEletters = (char[]) thisBundle.getObject(tables[k]);
-
-              table = new char[THEletters.length + 1];
-
-              int j;
-
-              for (j = 0; j < THEletters.length; j++)
-              {
-                table[j + 1] = THEletters[j];
-              }
-
-              table[0] = THEletters[j - 1];  // don't need this                                                                         
-
-              // index in "table" of the next char to emit
-              lookupIndex = mult / groups[k];
-
-              //this should not happen
-              if (lookupIndex == 0 && mult == 0)
-                break;
-
-              char multiplierChar = ((char[]) (thisBundle.getObject(
-                org.apache.xml.utils.res.XResourceBundle.LANG_MULTIPLIER_CHAR)))[i];
-
-              // put out the next character of output   
-              if (lookupIndex < table.length)
-              {
-                if (mult_order.equals(org.apache.xml.utils.res.XResourceBundle.MULT_PRECEDES))
-                {
-                  buf[charPos++] = multiplierChar;
-                  buf[charPos++] = table[lookupIndex];
-                }
-                else
-                {
-
-                  // don't put out 1 (ie 1X10 is just 10)
-                  if (lookupIndex == 1 && i == multiplier.length - 1){}
-                  else
-                    buf[charPos++] = table[lookupIndex];
-
-                  buf[charPos++] = multiplierChar;
-                }
-
-                break;  // all done!
-              }
-              else
-                return XSLTErrorResources.ERROR_STRING;
-            }  //end else
-          }  // end while        
-
-          i++;
-        }  // end else if
-      }  // end do while
-      while (i < multiplier.length);
-    }
-
-    // Now do additive part...
-    int count = 0;
-    String tableName;
-
-    // do this for each table of hundreds, tens, digits...
-    while (count < groups.length)
-    {
-      if (val / groups[count] <= 0)  // look for correct table
-        count++;
-      else
-      {
-        char[] theletters = (char[]) thisBundle.getObject(tables[count]);
-
-        table = new char[theletters.length + 1];
-
-        int j;
-
-        // need to start filling the table up at index 1
-        for (j = 0; j < theletters.length; j++)
-        {
-          table[j + 1] = theletters[j];
-        }
-
-        table[0] = theletters[j - 1];  // don't need this
-
-        // index in "table" of the next char to emit
-        lookupIndex = val / groups[count];
-
-        // shift input by one "column"
-        val = val % groups[count];
-
-        // this should not happen
-        if (lookupIndex == 0 && val == 0)
-          break;
-
-        if (lookupIndex < table.length)
-        {
-
-          // put out the next character of output       
-          buf[charPos++] = table[lookupIndex];  // left to right or top to bottom                                       
-        }
-        else
-          return XSLTErrorResources.ERROR_STRING;
-
-        count++;
-      }
-    }  // end while
-
-    // String s = new String(buf, 0, charPos);
-    return new String(buf, 0, charPos);
-  }
-
-  /**
-   * Convert a long integer into roman numerals.
-   * @param val Value to convert.
-   * @param prefixesAreOK true_ to enable prefix notation (e.g. 4 = "IV"),
-   * false_ to disable prefix notation (e.g. 4 = "IIII").
-   * @return Roman numeral string.
-   * @see DecimalToRoman
-   * @see m_romanConvertTable
-   */
-  protected String long2roman(long val, boolean prefixesAreOK)
-  {
-
-    if (val <= 0)
-    {
-      return getZeroString();
-    }
-
-    String roman = "";
-    int place = 0;
-
-    if (val <= 3999L)
-    {
-      do
-      {
-        while (val >= m_romanConvertTable[place].m_postValue)
-        {
-          roman += m_romanConvertTable[place].m_postLetter;
-          val -= m_romanConvertTable[place].m_postValue;
-        }
-
-        if (prefixesAreOK)
-        {
-          if (val >= m_romanConvertTable[place].m_preValue)
-          {
-            roman += m_romanConvertTable[place].m_preLetter;
-            val -= m_romanConvertTable[place].m_preValue;
-          }
-        }
-
-        place++;
-      }
-      while (val > 0);
-    }
-    else
-    {
-      roman = XSLTErrorResources.ERROR_STRING;
-    }
-
-    return roman;
-  }  // end long2roman
-
-  /**
-   * This class returns tokens using non-alphanumberic
-   * characters as delimiters.
-   */
-  class NumberFormatStringTokenizer
-  {
-
-    /** Current position in the format string          */
-    private int currentPosition;
-
-    /** Index of last character in the format string      */
-    private int maxPosition;
-
-    /** Format string to be tokenized        */
-    private String str;
-
-    /**
-     * Construct a NumberFormatStringTokenizer.
-     *
-     * @param str Format string to be tokenized
-     */
-    public NumberFormatStringTokenizer(String str)
-    {
-      this.str = str;
-      maxPosition = str.length();
-    }
-
-    /**
-     * Reset tokenizer so that nextToken() starts from the beginning.
-     */
-    public void reset()
-    {
-      currentPosition = 0;
-    }
-
-    /**
-     * Returns the next token from this string tokenizer.
-     *
-     * @return     the next token from this string tokenizer.
-     * @throws  NoSuchElementException  if there are no more tokens in this
-     *               tokenizer's string.
-     */
-    public String nextToken()
-    {
-
-      if (currentPosition >= maxPosition)
-      {
-        throw new NoSuchElementException();
-      }
-
-      int start = currentPosition;
-
-      while ((currentPosition < maxPosition)
-             && Character.isLetterOrDigit(str.charAt(currentPosition)))
-      {
-        currentPosition++;
-      }
-
-      if ((start == currentPosition)
-              && (!Character.isLetterOrDigit(str.charAt(currentPosition))))
-      {
-        currentPosition++;
-      }
-
-      return str.substring(start, currentPosition);
-    }
-
-    /**
-     * Tells if there is a digit or a letter character ahead.
-     *
-     * @return     true if there is a number or character ahead.
-     */
-    public boolean isLetterOrDigitAhead()
-    {
-
-      int pos = currentPosition;
-
-      while (pos < maxPosition)
-      {
-        if (Character.isLetterOrDigit(str.charAt(pos)))
-          return true;
-
-        pos++;
-      }
-
-      return false;
-    }
-
-    /**
-     * Tells if there is a digit or a letter character ahead.
-     *
-     * @return     true if there is a number or character ahead.
-     */
-    public boolean nextIsSep()
-    {
-
-      if (Character.isLetterOrDigit(str.charAt(currentPosition)))
-        return false;
-      else
-        return true;
-    }
-
-    /**
-     * Tells if <code>nextToken</code> will throw an exception
-     * if it is called.
-     *
-     * @return true if <code>nextToken</code> can be called
-     * without throwing an exception.
-     */
-    public boolean hasMoreTokens()
-    {
-      return (currentPosition >= maxPosition) ? false : true;
-    }
-
-    /**
-     * Calculates the number of times that this tokenizer's
-     * <code>nextToken</code> method can be called before it generates an
-     * exception.
-     *
-     * @return  the number of tokens remaining in the string using the current
-     *          delimiter set.
-     * @see     java.util.StringTokenizer#nextToken()
-     */
-    public int countTokens()
-    {
-
-      int count = 0;
-      int currpos = currentPosition;
-
-      while (currpos < maxPosition)
-      {
-        int start = currpos;
-
-        while ((currpos < maxPosition)
-               && Character.isLetterOrDigit(str.charAt(currpos)))
-        {
-          currpos++;
-        }
-
-        if ((start == currpos)
-                && (Character.isLetterOrDigit(str.charAt(currpos)) == false))
-        {
-          currpos++;
-        }
-
-        count++;
-      }
-
-      return count;
-    }
-  }  // end NumberFormatStringTokenizer
-}
diff --git a/src/org/apache/xalan/templates/ElemOtherwise.java b/src/org/apache/xalan/templates/ElemOtherwise.java
deleted file mode 100644
index b1907d5..0000000
--- a/src/org/apache/xalan/templates/ElemOtherwise.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:otherwise.
- * <pre>
- * <!ELEMENT xsl:otherwise %template;>
- * <!ATTLIST xsl:otherwise %space-att;>
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose">XXX in XSLT Specification</a>
- */
-public class ElemOtherwise extends ElemTemplateElement
-{
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for this element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_OTHERWISE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_OTHERWISE_STRING;
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemPI.java b/src/org/apache/xalan/templates/ElemPI.java
deleted file mode 100644
index 864ed68..0000000
--- a/src/org/apache/xalan/templates/ElemPI.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:processing-instruction.
- * <pre>
- * <!ELEMENT xsl:processing-instruction %char-template;>
- * <!ATTLIST xsl:processing-instruction
- *   name %avt; #REQUIRED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Processing-Instructions">section-Creating-Processing-Instructions in XSLT Specification</a>
- */
-public class ElemPI extends ElemTemplateElement
-{
-
-  /**
-   * The xsl:processing-instruction element has a required name
-   * attribute that specifies the name of the processing instruction node.
-   * The value of the name attribute is interpreted as an
-   * attribute value template.
-   * @serial
-   */
-  private AVT m_name_atv = null;
-
-  /**
-   * Set the "name" attribute.
-   * DJD
-   *
-   * @param v Value for the name attribute
-   */
-  public void setName(AVT v)
-  {
-    m_name_atv = v;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * DJD
-   *
-   * @return The value of the "name" attribute 
-   */
-  public AVT getName()
-  {
-    return m_name_atv;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-    if(null != m_name_atv)
-      m_name_atv.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-  }
-
-
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for the element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_PI;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_PI_STRING;
-  }
-
-  /**
-   * Create a processing instruction in the result tree.
-   * The content of the xsl:processing-instruction element is a
-   * template for the string-value of the processing instruction node.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Processing-Instructions">section-Creating-Processing-Instructions in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    XPathContext xctxt = transformer.getXPathContext();
-    int sourceNode = xctxt.getCurrentNode();
-    String piName = m_name_atv.evaluate(xctxt, sourceNode, this);
-
-    if (piName.equalsIgnoreCase("xml"))
-    {
-      error(XSLTErrorResources.ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML);  //"processing-instruction name can not be 'xml'");
-    }
-    else if (!isValidNCName(piName))
-    {
-      error(XSLTErrorResources.ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
-            new Object[]{ piName });  //"processing-instruction name must be a valid NCName: "+piName);
-    }
-
-    // Note the content model is:
-    // <!ENTITY % instructions "
-    // %char-instructions;
-    // | xsl:processing-instruction
-    // | xsl:comment
-    // | xsl:element
-    // | xsl:attribute
-    // ">
-    String data = transformer.transformToString(this);
-
-    try
-    {
-      transformer.getResultTreeHandler().processingInstruction(piName, data);
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to child list
-   *
-   * @return The child just added to the child list
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    switch (type)
-    {
-
-    // char-instructions 
-    case Constants.ELEMNAME_TEXTLITERALRESULT :
-    case Constants.ELEMNAME_APPLY_TEMPLATES :
-    case Constants.ELEMNAME_APPLY_IMPORTS :
-    case Constants.ELEMNAME_CALLTEMPLATE :
-    case Constants.ELEMNAME_FOREACH :
-    case Constants.ELEMNAME_VALUEOF :
-    case Constants.ELEMNAME_COPY_OF :
-    case Constants.ELEMNAME_NUMBER :
-    case Constants.ELEMNAME_CHOOSE :
-    case Constants.ELEMNAME_IF :
-    case Constants.ELEMNAME_TEXT :
-    case Constants.ELEMNAME_COPY :
-    case Constants.ELEMNAME_VARIABLE :
-    case Constants.ELEMNAME_MESSAGE :
-
-      // instructions 
-      // case Constants.ELEMNAME_PI:
-      // case Constants.ELEMNAME_COMMENT:
-      // case Constants.ELEMNAME_ELEMENT:
-      // case Constants.ELEMNAME_ATTRIBUTE:
-      break;
-    default :
-      error(XSLTErrorResources.ER_CANNOT_ADD,
-            new Object[]{ newChild.getNodeName(),
-                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    }
-
-    return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemParam.java b/src/org/apache/xalan/templates/ElemParam.java
deleted file mode 100644
index e3132cd..0000000
--- a/src/org/apache/xalan/templates/ElemParam.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xalan.trace.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:param.
- * <pre>
- * <!ELEMENT xsl:param %template;>
- * <!ATTLIST xsl:param
- *   name %qname; #REQUIRED
- *   select %expr; #IMPLIED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
- */
-public class ElemParam extends ElemVariable
-{
-  int m_qnameID;
-
-  /**
-   * Constructor ElemParam
-   *
-   */
-  public ElemParam(){}
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID of the element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_PARAMVARIABLE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_PARAMVARIABLE_STRING;
-  }
-
-  /**
-   * Copy constructor.
-   *
-   * @param param Element from an xsl:param
-   *
-   * @throws TransformerException
-   */
-  public ElemParam(ElemParam param) throws TransformerException
-  {
-    super(param);
-  }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    m_qnameID = sroot.getComposeState().getQNameID(m_qname);
-    if(m_parentNode.getXSLToken() == Constants.ELEMNAME_TEMPLATE)
-      ((ElemTemplate)m_parentNode).m_inArgsSize++;
-  }
-  
-  /**
-   * Execute a variable declaration and push it onto the variable stack.
-   * @see <a href="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-      
-    VariableStack vars = transformer.getXPathContext().getVarStack();
-    
-    if(!vars.isLocalSet(m_index))
-    {
-
-      int sourceNode = transformer.getXPathContext().getCurrentNode();
-      XObject var = getValue(transformer, sourceNode);
-  
-      // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var);
-      transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var);
-    }
-  }
-  
-}
diff --git a/src/org/apache/xalan/templates/ElemSort.java b/src/org/apache/xalan/templates/ElemSort.java
deleted file mode 100644
index 722e533..0000000
--- a/src/org/apache/xalan/templates/ElemSort.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:sort.
- * <pre>
- * <!ELEMENT xsl:sort EMPTY>
- * <!ATTLIST xsl:sort
- *   select %expr; "."
- *   lang %avt; #IMPLIED
- *   data-type %avt; "text"
- *   order %avt; "ascending"
- *   case-order %avt; #IMPLIED
- * >
- * <!-- xsl:sort cannot occur after any other elements or
- * any non-whitespace character -->
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#sorting">sorting in XSLT Specification</a>
- */
-public class ElemSort extends ElemTemplateElement
-{
-
-  /**
-   * xsl:sort has a select attribute whose value is an expression.
-   * @serial
-   */
-  private XPath m_selectExpression = null;
-
-  /**
-   * Set the "select" attribute.
-   * xsl:sort has a select attribute whose value is an expression.
-   * For each node to be processed, the expression is evaluated
-   * with that node as the current node and with the complete
-   * list of nodes being processed in unsorted order as the current
-   * node list. The resulting object is converted to a string as if
-   * by a call to the string function; this string is used as the
-   * sort key for that node. The default value of the select attribute
-   * is ., which will cause the string-value of the current node to
-   * be used as the sort key.
-   *
-   * @param v Value to set for the "select" attribute
-   */
-  public void setSelect(XPath v)
-  {
-
-    if (v.getPatternString().indexOf("{") < 0)
-      m_selectExpression = v;
-    else
-      error(XSLTErrorResources.ER_NO_CURLYBRACE, null);
-  }
-
-  /**
-   * Get the "select" attribute.
-   * xsl:sort has a select attribute whose value is an expression.
-   * For each node to be processed, the expression is evaluated
-   * with that node as the current node and with the complete
-   * list of nodes being processed in unsorted order as the current
-   * node list. The resulting object is converted to a string as if
-   * by a call to the string function; this string is used as the
-   * sort key for that node. The default value of the select attribute
-   * is ., which will cause the string-value of the current node to
-   * be used as the sort key.
-   *
-   * @return The value of the "select" attribute
-   */
-  public XPath getSelect()
-  {
-    return m_selectExpression;
-  }
-
-  /**
-   * lang specifies the language of the sort keys.
-   * @serial
-   */
-  private AVT m_lang_avt = null;
-
-  /**
-   * Set the "lang" attribute.
-   * lang specifies the language of the sort keys; it has the same
-   * range of values as xml:lang [XML]; if no lang value is
-   * specified, the language should be determined from the system environment.
-   *
-   * @param v The value to set for the "lang" attribute
-   */
-  public void setLang(AVT v)
-  {
-    m_lang_avt = v;
-  }
-
-  /**
-   * Get the "lang" attribute.
-   * lang specifies the language of the sort keys; it has the same
-   * range of values as xml:lang [XML]; if no lang value is
-   * specified, the language should be determined from the system environment.
-   *
-   * @return The value of the "lang" attribute
-   */
-  public AVT getLang()
-  {
-    return m_lang_avt;
-  }
-
-  /**
-   * data-type specifies the data type of the
-   * strings to be sorted.
-   * @serial
-   */
-  private AVT m_dataType_avt = null;
-
-  /**
-   * Set the "data-type" attribute.
-   * <code>data-type</code> specifies the data type of the
-   * strings; the following values are allowed:
-   * <ul>
-   * <li>
-   * <code>text</code> specifies that the sort keys should be
-   * sorted lexicographically in the culturally correct manner for the
-   * language specified by <code>lang</code>.
-   * </li>
-   * <li>
-   * <code>number</code> specifies that the sort keys should be
-   * converted to numbers and then sorted according to the numeric value;
-   * the sort key is converted to a number as if by a call to the
-   * <b><a href="http://www.w3.org/TR/xpath#function-number">number</a></b> function; the <code>lang</code>
-   * attribute is ignored.
-   * </li>
-   * <li>
-   * A <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> with a prefix
-   * is expanded into an <a href="http://www.w3.org/TR/xpath#dt-expanded-name">expanded-name</a> as described
-   * in <a href="#qname">[<b>2.4 Qualified Names</b>]</a>; the expanded-name identifies the data-type;
-   * the behavior in this case is not specified by this document.
-   * </li>
-   * </ul>
-   * <p>The default value is <code>text</code>.</p>
-   * <blockquote>
-   * <b>NOTE: </b>The XSL Working Group plans that future versions of XSLT will
-   * leverage XML Schemas to define further values for this
-   * attribute.</blockquote>
-   *
-   * @param v Value to set for the "data-type" attribute
-   */
-  public void setDataType(AVT v)
-  {
-    m_dataType_avt = v;
-  }
-
-  /**
-   * Get the "data-type" attribute.
-   * <code>data-type</code> specifies the data type of the
-   * strings; the following values are allowed:
-   * <ul>
-   * <li>
-   * <code>text</code> specifies that the sort keys should be
-   * sorted lexicographically in the culturally correct manner for the
-   * language specified by <code>lang</code>.
-   * </li>
-   * <li>
-   * <code>number</code> specifies that the sort keys should be
-   * converted to numbers and then sorted according to the numeric value;
-   * the sort key is converted to a number as if by a call to the
-   * <b><a href="http://www.w3.org/TR/xpath#function-number">number</a></b> function; the <code>lang</code>
-   * attribute is ignored.
-   * </li>
-   * <li>
-   * A <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> with a prefix
-   * is expanded into an <a href="http://www.w3.org/TR/xpath#dt-expanded-name">expanded-name</a> as described
-   * in <a href="#qname">[<b>2.4 Qualified Names</b>]</a>; the expanded-name identifies the data-type;
-   * the behavior in this case is not specified by this document.
-   * </li>
-   * </ul>
-   * <p>The default value is <code>text</code>.</p>
-   * <blockquote>
-   * <b>NOTE: </b>The XSL Working Group plans that future versions of XSLT will
-   * leverage XML Schemas to define further values for this
-   * attribute.</blockquote>
-   *
-   * @return The value of the "data-type" attribute
-   */
-  public AVT getDataType()
-  {
-    return m_dataType_avt;
-  }
-
-  /**
-   * order specifies whether the strings should be sorted in ascending
-   * or descending order.
-   * @serial
-   */
-  private AVT m_order_avt = null;
-
-  /**
-   * Set the "order" attribute.
-   * order specifies whether the strings should be sorted in ascending
-   * or descending order; ascending specifies ascending order; descending
-   * specifies descending order; the default is ascending.
-   *
-   * @param v The value to set for the "order" attribute
-   */
-  public void setOrder(AVT v)
-  {
-    m_order_avt = v;
-  }
-
-  /**
-   * Get the "order" attribute.
-   * order specifies whether the strings should be sorted in ascending
-   * or descending order; ascending specifies ascending order; descending
-   * specifies descending order; the default is ascending.
-   *
-   * @return The value of the "order" attribute
-   */
-  public AVT getOrder()
-  {
-    return m_order_avt;
-  }
-
-  /**
-   * case-order has the value upper-first or lower-first.
-   * The default value is language dependent.
-   * @serial
-   */
-  private AVT m_caseorder_avt = null;
-
-  /**
-   * Set the "case-order" attribute.
-   * case-order has the value upper-first or lower-first; this applies
-   * when data-type="text", and specifies that upper-case letters should
-   * sort before lower-case letters or vice-versa respectively.
-   * For example, if lang="en", then A a B b are sorted with
-   * case-order="upper-first" and a A b B are sorted with case-order="lower-first".
-   * The default value is language dependent.
-   *
-   * @param v The value to set for the "case-order" attribute
-   * 
-   * @serial
-   */
-  public void setCaseOrder(AVT v)
-  {
-    m_caseorder_avt = v;
-  }
-
-  /**
-   * Get the "case-order" attribute.
-   * case-order has the value upper-first or lower-first; this applies
-   * when data-type="text", and specifies that upper-case letters should
-   * sort before lower-case letters or vice-versa respectively.
-   * For example, if lang="en", then A a B b are sorted with
-   * case-order="upper-first" and a A b B are sorted with case-order="lower-first".
-   * The default value is language dependent.
-   *
-   * @return The value of the "case-order" attribute
-   */
-  public AVT getCaseOrder()
-  {
-    return m_caseorder_avt;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID of the element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_SORT;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_SORT_STRING;
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to the child list
-   *
-   * @return Child just added to the child list
-   *
-   * @throws DOMException
-   */
-  public Node appendChild(Node newChild) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_CANNOT_ADD,
-          new Object[]{ newChild.getNodeName(),
-                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    return null;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) 
-    throws javax.xml.transform.TransformerException
-  {
-    super.compose(sroot);
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    java.util.Vector vnames = cstate.getVariableNames();
-    if(null != m_caseorder_avt)
-      m_caseorder_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_dataType_avt)
-      m_dataType_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_lang_avt)
-      m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_order_avt)
-      m_order_avt.fixupVariables(vnames, cstate.getGlobalsSize());
-    if(null != m_selectExpression)
-      m_selectExpression.fixupVariables(vnames, cstate.getGlobalsSize());
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemTemplate.java b/src/org/apache/xalan/templates/ElemTemplate.java
deleted file mode 100644
index 9da409d..0000000
--- a/src/org/apache/xalan/templates/ElemTemplate.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:template.
- * <pre>
- * <!ELEMENT xsl:template
- *  (#PCDATA
- *   %instructions;
- *   %result-elements;
- *   | xsl:param)
- * >
- *
- * <!ATTLIST xsl:template
- *   match %pattern; #IMPLIED
- *   name %qname; #IMPLIED
- *   priority %priority; #IMPLIED
- *   mode %qname; #IMPLIED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
- */
-public class ElemTemplate extends ElemTemplateElement
-{
-
-  /** The public identifier for the current document event.
-   *  @serial          */
-  private String m_publicId;
-
-  /** The system identifier for the current document event.
-   *  @serial          */
-  private String m_systemId;
-
-  /**
-   * Return the public identifier for the current document event.
-   * <p>This will be the public identifier
-   * @return A string containing the public identifier, or
-   *         null if none is available.
-   * @see #getSystemId
-   */
-  public String getPublicId()
-  {
-    return m_publicId;
-  }
-
-  /**
-   * Return the system identifier for the current document event.
-   *
-   * <p>If the system identifier is a URL, the parser must resolve it
-   * fully before passing it to the application.</p>
-   *
-   * @return A string containing the system identifier, or null
-   *         if none is available.
-   * @see #getPublicId
-   */
-  public String getSystemId()
-  {
-    return m_systemId;
-  }
-
-  /**
-   * Set the location information for this element.
-   *
-   * @param locator SourceLocator holding location information 
-   */
-  public void setLocaterInfo(SourceLocator locator)
-  {
-
-    m_publicId = locator.getPublicId();
-    m_systemId = locator.getSystemId();
-
-    super.setLocaterInfo(locator);
-  }
-
-  /**
-   * The owning stylesheet.
-   * (Should this only be put on the template element, to
-   * conserve space?)
-   * @serial
-   */
-  private Stylesheet m_stylesheet;
-
-  /**
-   * Get the stylesheet composed (resolves includes and
-   * imports and has methods on it that return "composed" properties.
-   * 
-   * @return The stylesheet composed.
-   */
-  public StylesheetComposed getStylesheetComposed()
-  {
-    return m_stylesheet.getStylesheetComposed();
-  }
-
-  /**
-   * Get the owning stylesheet.
-   *
-   * @return The owning stylesheet.
-   */
-  public Stylesheet getStylesheet()
-  {
-    return m_stylesheet;
-  }
-
-  /**
-   * Set the owning stylesheet.
-   *
-   * @param sheet The owning stylesheet for this element
-   */
-  public void setStylesheet(Stylesheet sheet)
-  {
-    m_stylesheet = sheet;
-  }
-
-  /**
-   * Get the root stylesheet.
-   *
-   * @return The root stylesheet for this element
-   */
-  public StylesheetRoot getStylesheetRoot()
-  {
-    return m_stylesheet.getStylesheetRoot();
-  }
-
-  /**
-   * The match attribute is a Pattern that identifies the source
-   * node or nodes to which the rule applies.
-   * @serial
-   */
-  private XPath m_matchPattern = null;
-
-  /**
-   * Set the "match" attribute.
-   * The match attribute is a Pattern that identifies the source
-   * node or nodes to which the rule applies. The match attribute
-   * is required unless the xsl:template element has a name
-   * attribute (see [6 Named Templates]). It is an error for the
-   * value of the match attribute to contain a VariableReference.
-   * @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a>
-   *
-   * @param v Value to set for the "match" attribute
-   */
-  public void setMatch(XPath v)
-  {
-    m_matchPattern = v;
-  }
-
-  /**
-   * Get the "match" attribute.
-   * The match attribute is a Pattern that identifies the source
-   * node or nodes to which the rule applies. The match attribute
-   * is required unless the xsl:template element has a name
-   * attribute (see [6 Named Templates]). It is an error for the
-   * value of the match attribute to contain a VariableReference.
-   * @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a>
-   *
-   * @return Value of the "match" attribute 
-   */
-  public XPath getMatch()
-  {
-    return m_matchPattern;
-  }
-
-  /**
-   * An xsl:template element with a name attribute specifies a named template.
-   * @serial
-   */
-  private QName m_name = null;
-
-  /**
-   * Set the "name" attribute.
-   * An xsl:template element with a name attribute specifies a named template.
-   * If an xsl:template element has a name attribute, it may, but need not,
-   * also have a match attribute.
-   * @see <a href="http://www.w3.org/TR/xslt#named-templates">named-templates in XSLT Specification</a>
-   *
-   * @param v Value to set the "name" attribute
-   */
-  public void setName(QName v)
-  {
-    m_name = v;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * An xsl:template element with a name attribute specifies a named template.
-   * If an xsl:template element has a name attribute, it may, but need not,
-   * also have a match attribute.
-   * @see <a href="http://www.w3.org/TR/xslt#named-templates">named-templates in XSLT Specification</a>
-   *
-   * @return Value of the "name" attribute
-   */
-  public QName getName()
-  {
-    return m_name;
-  }
-
-  /**
-   * Modes allow an element to be processed multiple times,
-   * each time producing a different result.
-   * @serial
-   */
-  private QName m_mode;
-
-  /**
-   * Set the "mode" attribute.
-   * Modes allow an element to be processed multiple times,
-   * each time producing a different result.  If xsl:template
-   * does not have a match attribute, it must not have a mode attribute.
-   * @see <a href="http://www.w3.org/TR/xslt#modes">modes in XSLT Specification</a>
-   *
-   * @param v Value to set the "mode" attribute
-   */
-  public void setMode(QName v)
-  {
-    m_mode = v;
-  }
-
-  /**
-   * Get the "mode" attribute.
-   * Modes allow an element to be processed multiple times,
-   * each time producing a different result.  If xsl:template
-   * does not have a match attribute, it must not have a mode attribute.
-   * @see <a href="http://www.w3.org/TR/xslt#modes">modes in XSLT Specification</a>
-   *
-   * @return Value of the "mode" attribute
-   */
-  public QName getMode()
-  {
-    return m_mode;
-  }
-
-  /**
-   * The priority of a template rule is specified by the priority
-   * attribute on the template rule.
-   * @serial
-   */
-  private double m_priority = XPath.MATCH_SCORE_NONE;
-
-  /**
-   * Set the "priority" attribute.
-   * The priority of a template rule is specified by the priority
-   * attribute on the template rule. The value of this must be a
-   * real number (positive or negative), matching the production
-   * Number with an optional leading minus sign (-).
-   * @see <a href="http://www.w3.org/TR/xslt#conflict">conflict in XSLT Specification</a>
-   *
-   * @param v The value to set for the "priority" attribute
-   */
-  public void setPriority(double v)
-  {
-    m_priority = v;
-  }
-
-  /**
-   * Get the "priority" attribute.
-   * The priority of a template rule is specified by the priority
-   * attribute on the template rule. The value of this must be a
-   * real number (positive or negative), matching the production
-   * Number with an optional leading minus sign (-).
-   * @see <a href="http://www.w3.org/TR/xslt#conflict">conflict in XSLT Specification</a>
-   *
-   * @return The value of the "priority" attribute
-   */
-  public double getPriority()
-  {
-    return m_priority;
-  }
-
-  /**
-   * Get an int constant identifying the type of element.
-   * @see org.apache.xalan.templates.Constants
-   *
-   * @return The token ID for the element
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_TEMPLATE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_TEMPLATE_STRING;
-  }
-  
-  /**
-   * The stack frame size for this template, which is equal to the maximum number 
-   * of params and variables that can be declared in the template at one time.
-   */
-  public int m_frameSize;
-  
-  /**
-   * The size of the portion of the stack frame that can hold parameter 
-   * arguments.
-   */
-  int m_inArgsSize;
-  
-  /**
-   * List of namespace/local-name pairs, DTM style, that are unique 
-   * qname identifiers for the arguments.  The position of a given qname 
-   * in the list is the argument ID, and thus the position in the stack
-   * frame.
-   */
-  private int[] m_argsQNameIDs;
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    super.compose(sroot);
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    java.util.Vector vnames = cstate.getVariableNames();
-    if(null != m_matchPattern)
-      m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-      
-    cstate.resetStackFrameSize();
-    m_inArgsSize = 0;
-  }
-  
-  /**
-   * This after the template's children have been composed.
-   */
-  public void endCompose(StylesheetRoot sroot) throws TransformerException
-  {
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    super.endCompose(sroot);
-    m_frameSize = cstate.getFrameSize();
-    
-    cstate.resetStackFrameSize();
-  }
-
-  /**
-   * Copy the template contents into the result tree.
-   * The content of the xsl:template element is the template
-   * that is instantiated when the template rule is applied.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-      // %REVIEW% commenting out of the code below.
-//    if (null != sourceNode)
-//    {
-      transformer.executeChildTemplates(this, true);
-//    }
-//    else  // if(null == sourceNode)
-//    {
-//      transformer.getMsgMgr().error(this,
-//        this, sourceNode,
-//        XSLTErrorResources.ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES);
-//
-//      //"sourceNode is null in handleApplyTemplatesInstruction!");
-//    }
-  }
-
-  /**
-   * This function is called during recomposition to
-   * control how this element is composed.
-   * @param root The root stylesheet for this transformation.
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeTemplates(this);
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/ElemTemplateElement.java b/src/org/apache/xalan/templates/ElemTemplateElement.java
deleted file mode 100644
index 6e05b9e..0000000
--- a/src/org/apache/xalan/templates/ElemTemplateElement.java
+++ /dev/null
@@ -1,1466 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.lang.InstantiationException;
-
-import java.io.Serializable;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-// Xalan imports
-import org.apache.xml.utils.UnImplNode;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.StringToStringTable;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultNameSpace;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.WhitespaceStrippingElementMatcher;
-
-// TRaX imports
-import javax.xml.transform.Templates;
-import javax.xml.transform.SourceLocator;
-
-// DOM Imports
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.apache.xml.dtm.DTM;
-
-// SAX Imports
-import org.xml.sax.Locator;
-import javax.xml.transform.TransformerException;
-
-import org.xml.sax.helpers.NamespaceSupport;
-import org.apache.xml.utils.NamespaceSupport2;
-
-/**
- * <meta name="usage" content="advanced"/>
- * An instance of this class represents an element inside
- * an xsl:template class.  It has a single "execute" method
- * which is expected to perform the given action on the
- * result tree.
- * This class acts like a Element node, and implements the
- * Element interface, but is not a full implementation
- * of that interface... it only implements enough for
- * basic traversal of the tree.
- *
- * @see Stylesheet
- */
-public class ElemTemplateElement extends UnImplNode
-        implements PrefixResolver, Serializable, SourceLocator, 
-                   WhitespaceStrippingElementMatcher
-{
-
-  /**
-   * Construct a template element instance.
-   *
-   * @param transformer The XSLT TransformerFactory.
-   * @param stylesheetTree The owning stylesheet.
-   * @param name The name of the element.
-   * @param atts The element attributes.
-   * @param lineNumber The line in the XSLT file that the element occurs on.
-   * @param columnNumber The column index in the XSLT file that the element occurs on.
-   */
-  public ElemTemplateElement(){}
-
-  /**
-   * Tell if this template is a compiled template.
-   *
-   * @return Boolean flag indicating whether this is a compiled template   
-   */
-  public boolean isCompiledTemplate()
-  {
-    return false;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_UNDEFINED;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return An invalid node name
-   */
-  public String getNodeName()
-  {
-    return "Unknown XSLT Element";
-  }
-
-  /**
-   * This function will be called on top-level elements
-   * only, just before the transform begins.
-   *
-   * @param transformer The XSLT TransformerFactory.
-   *
-   * @throws TransformerException
-   */
-  public void runtimeInit(TransformerImpl transformer) throws TransformerException{}
-
-  /**
-   * Execute the element's primary function.  Subclasses of this
-   * function may recursivly execute down the element tree.
-   *
-   * @param transformer The XSLT TransformerFactory.
-   * @param sourceNode The current context node.
-   * @param mode The current mode.
-   * 
-   * @throws TransformerException if any checked exception occurs.
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException{}
-
-  /**
-   * Get the owning "composed" stylesheet.  This looks up the
-   * inheritance chain until it calls getStylesheetComposed
-   * on a Stylesheet object, which will Get the owning
-   * aggregated stylesheet, or that stylesheet if it is aggregated.
-   *
-   * @return the owning "composed" stylesheet.
-   */
-  public StylesheetComposed getStylesheetComposed()
-  {
-    return m_parentNode.getStylesheetComposed();
-  }
-
-  /**
-   * Get the owning stylesheet.  This looks up the
-   * inheritance chain until it calls getStylesheet
-   * on a Stylesheet object, which will return itself.
-   *
-   * @return the owning stylesheet
-   */
-  public Stylesheet getStylesheet()
-  {
-    return m_parentNode.getStylesheet();
-  }
-
-  /**
-   * Get the owning root stylesheet.  This looks up the
-   * inheritance chain until it calls StylesheetRoot
-   * on a Stylesheet object, which will return a reference
-   * to the root stylesheet.
-   *
-   * @return the owning root stylesheet
-   */
-  public StylesheetRoot getStylesheetRoot()
-  {
-    return m_parentNode.getStylesheetRoot();
-  }
-
-  /**
-   * This function is called during recomposition to
-   * control how this element is composed.
-   */
-  public void recompose(StylesheetRoot root) throws TransformerException
-  {
-  }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    resolvePrefixTables();
-    ElemTemplateElement t = getFirstChildElem();
-    m_hasTextLitOnly = ((t != null) 
-              && (t.getXSLToken() == Constants.ELEMNAME_TEXTLITERALRESULT) 
-              && (t.getNextSiblingElem() == null));
-              
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    cstate.pushStackMark();
-  }
-  
-  /**
-   * This after the template's children have been composed.
-   */
-  public void endCompose(StylesheetRoot sroot) throws TransformerException
-  {
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    cstate.popStackMark();
-  }
-
-  /**
-   * Validate that the string is an NCName.
-   *
-   * @param s The name in question.
-   * @return True if the string is a valid NCName according to XML rules.
-   * @see <a href="http://www.w3.org/TR/REC-xml-names#NT-NCName">XXX in XSLT Specification</a>
-   */
-  protected boolean isValidNCName(String s)
-  {
-
-    int len = s.length();
-    char c = s.charAt(0);
-
-    if (!(Character.isLetter(c) || (c == '_')))
-      return false;
-
-    if (len > 0)
-    {
-      for (int i = 1; i < len; i++)
-      {
-        c = s.charAt(i);
-
-        if (!(Character.isLetterOrDigit(c) || (c == '_') || (c == '-')
-              || (c == '.')))
-          return false;
-      }
-    }
-
-    return true;
-  }
-
-  /**
-   * Throw a template element runtime error.  (Note: should we throw a TransformerException instead?)
-   *
-   * @param msg Description of the error that occured.
-   * @param args Arguments to be used in the message
-   */
-  public void error(int msg, Object[] args)
-  {
-
-    String themsg = XSLMessages.createMessage(msg, args);
-
-    error(
-      XSLMessages.createMessage(
-        XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[]{ themsg }));  //"ElemTemplateElement error: "+msg);
-  }
-  
-  /**
-   * Throw an error.
-   *
-   * @param msg Message code for the error
-   */
-  public void error(int msg)
-  {
-    error(msg, null);
-  }
-  
-  /**
-   * Throw a template element runtime error.  (Note: should we throw a TransformerException instead?)
-   *
-   * @param msg Description of the error that occured.
-   * @param args Arguments to be used in the message
-   */
-  public void error(String msg)
-  {
-    throw new RuntimeException(msg);
-  }
-  
-
-  // Implemented DOM Element methods.
-  /**
-   * Add a child to the child list.
-   * NOTE: This presumes the child did not previously have a parent.
-   * Making that assumption makes this a less expensive operation -- but
-   * requires that if you *do* want to reparent a node, you use removeChild()
-   * first to remove it from its previous context. Failing to do so will
-   * damage the tree.
-   *
-   * @param newChild Child to be added to child list
-   *
-   * @return Child just added to the child list
-   * @throws DOMException
-   */
-  public Node appendChild(Node newChild) throws DOMException
-  {
-
-    if (null == newChild)
-    {
-      error(XSLTErrorResources.ER_NULL_CHILD, null);  //"Trying to add a null child!");
-    }
-
-    ElemTemplateElement elem = (ElemTemplateElement) newChild;
-
-    if (null == m_firstChild)
-    {
-      m_firstChild = elem;
-    }
-    else
-    {
-      ElemTemplateElement last = (ElemTemplateElement) getLastChild();
-
-      last.m_nextSibling = elem;
-    }
-
-    elem.m_parentNode = this;
-
-    return newChild;
-  }
-
-  /**
-   * Add a child to the child list.
-   * NOTE: This presumes the child did not previously have a parent.
-   * Making that assumption makes this a less expensive operation -- but
-   * requires that if you *do* want to reparent a node, you use removeChild()
-   * first to remove it from its previous context. Failing to do so will
-   * damage the tree.
-   *
-   * @param newChild Child to be added to child list
-   *
-   * @return Child just added to the child list
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement elem)
-  {
-
-    if (null == elem)
-    {
-      error(XSLTErrorResources.ER_NULL_CHILD, null);  //"Trying to add a null child!");
-    }
-
-    if (null == m_firstChild)
-    {
-      m_firstChild = elem;
-    }
-    else
-    {
-      ElemTemplateElement last = getLastChildElem();
-
-      last.m_nextSibling = elem;
-    }
-
-    elem.setParentElem(this);
-
-    return elem;
-  }
-
-
-  /**
-   * Tell if there are child nodes.
-   *
-   * @return True if there are child nodes
-   */
-  public boolean hasChildNodes()
-  {
-    return (null != m_firstChild);
-  }
-
-  /**
-   * Get the type of the node.
-   *
-   * @return Constant for this node type
-   */
-  public short getNodeType()
-  {
-    return org.w3c.dom.Node.ELEMENT_NODE;
-  }
-
-  /**
-   * Return the nodelist (same reference).
-   *
-   * @return The nodelist containing the child nodes (this)
-   */
-  public NodeList getChildNodes()
-  {
-    return this;
-  }
-
-  /**
-   * Remove a child.
-   * ADDED 9/8/200 to support compilation.
-   * TODO: ***** Alternative is "removeMe() from my parent if any"
-   * ... which is less well checked, but more convenient in some cases.
-   * Given that we assume only experts are calling this class, it might
-   * be preferable. It's less DOMish, though.
-   * 
-   * @param childETE The child to remove. This operation is a no-op
-   * if oldChild is not a child of this node.
-   *
-   * @return the removed child, or null if the specified
-   * node was not a child of this element.
-   */
-  public ElemTemplateElement removeChild(ElemTemplateElement childETE)
-  {
-
-    if (childETE == null || childETE.m_parentNode != this)
-      return null;
-
-    // Pointers to the child
-    if (childETE == m_firstChild)
-      m_firstChild = childETE.m_nextSibling;
-    else
-    {
-      ElemTemplateElement prev = childETE.getPreviousSiblingElem();
-
-      prev.m_nextSibling = childETE.m_nextSibling;
-    }
-
-    // Pointers from the child
-    childETE.m_parentNode = null;
-    childETE.m_nextSibling = null;
-
-    return childETE;
-  }
-
-  /**
-   * Replace the old child with a new child.
-   *
-   * @param newChild New child to replace with
-   * @param oldChild Old child to be replaced
-   *
-   * @return The new child
-   *
-   * @throws DOMException
-   */
-  public Node replaceChild(Node newChild, Node oldChild) throws DOMException
-  {
-
-    if (oldChild == null || oldChild.getParentNode() != this)
-      return null;
-
-    ElemTemplateElement newChildElem = ((ElemTemplateElement) newChild);
-    ElemTemplateElement oldChildElem = ((ElemTemplateElement) oldChild);
-
-    // Fix up previous sibling.
-    ElemTemplateElement prev =
-      (ElemTemplateElement) oldChildElem.getPreviousSibling();
-
-    if (null != prev)
-      prev.m_nextSibling = newChildElem;
-
-    // Fix up parent (this)
-    if (m_firstChild == oldChildElem)
-      m_firstChild = newChildElem;
-
-    newChildElem.m_parentNode = this;
-    oldChildElem.m_parentNode = null;
-    newChildElem.m_nextSibling = oldChildElem.m_nextSibling;
-    oldChildElem.m_nextSibling = null;
-
-    // newChildElem.m_stylesheet = oldChildElem.m_stylesheet;
-    // oldChildElem.m_stylesheet = null;
-    return newChildElem;
-  }
-
-  /**
-   * Replace the old child with a new child.
-   *
-   * @param newChild New child to replace with
-   * @param oldChild Old child to be replaced
-   *
-   * @return The new child
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement replaceChild(ElemTemplateElement newChildElem, 
-                                          ElemTemplateElement oldChildElem)
-  {
-
-    if (oldChildElem == null || oldChildElem.getParentElem() != this)
-      return null;
-
-    // Fix up previous sibling.
-    ElemTemplateElement prev =
-      oldChildElem.getPreviousSiblingElem();
-
-    if (null != prev)
-      prev.m_nextSibling = newChildElem;
-
-    // Fix up parent (this)
-    if (m_firstChild == oldChildElem)
-      m_firstChild = newChildElem;
-
-    newChildElem.m_parentNode = this;
-    oldChildElem.m_parentNode = null;
-    newChildElem.m_nextSibling = oldChildElem.m_nextSibling;
-    oldChildElem.m_nextSibling = null;
-
-    // newChildElem.m_stylesheet = oldChildElem.m_stylesheet;
-    // oldChildElem.m_stylesheet = null;
-    return newChildElem;
-  }
-
-  /**
-   * NodeList method: Count the immediate children of this node
-   *
-   * @return The count of children of this node
-   */
-  public int getLength()
-  {
-
-    // It is assumed that the getChildNodes call synchronized
-    // the children. Therefore, we can access the first child
-    // reference directly.
-    int count = 0;
-
-    for (ElemTemplateElement node = m_firstChild; node != null;
-            node = node.m_nextSibling)
-    {
-      count++;
-    }
-
-    return count;
-  }  // getLength():int
-
-  /**
-   * NodeList method: Return the Nth immediate child of this node, or
-   * null if the index is out of bounds.
-   *
-   * @param index Index of child to find
-   * @return org.w3c.dom.Node: the child node at given index
-   */
-  public Node item(int index)
-  {
-
-    // It is assumed that the getChildNodes call synchronized
-    // the children. Therefore, we can access the first child
-    // reference directly.
-    ElemTemplateElement node = m_firstChild;
-
-    for (int i = 0; i < index && node != null; i++)
-    {
-      node = node.m_nextSibling;
-    }
-
-    return node;
-  }  // item(int):Node
-
-  /**
-   * Get the stylesheet owner.
-   *
-   * @return The stylesheet owner
-   */
-  public Document getOwnerDocument()
-  {
-    return getStylesheet();
-  }
-
-  /**
-   * Return the element name.
-   *
-   * @return The element name
-   */
-  public String getTagName()
-  {
-    return getNodeName();
-  }
-  
-  /**
-   * Tell if this element only has one text child, for optimization purposes.
-   * @return true of this element only has one text literal child.
-   */
-  public boolean hasTextLitOnly()
-  {
-    return m_hasTextLitOnly;
-  }
-
-  /**
-   * Return the base identifier.
-   *
-   * @return The base identifier 
-   */
-  public String getBaseIdentifier()
-  {
-
-    // Should this always be absolute?
-    return this.getSystemId();
-  }
-
-  /** line number where the current document event ends.
-   *  @serial         */
-  private int m_lineNumber;
-
-  /**
-   * Return the line number where the current document event ends.
-   * Note that this is the line position of the first character
-   * after the text associated with the document event.
-   * @return The line number, or -1 if none is available.
-   * @see #getColumnNumber
-   */
-  public int getLineNumber()
-  {
-    return m_lineNumber;
-  }
-
-  /** the column number where the current document event ends.
-   *  @serial        */
-  private int m_columnNumber;
-
-  /**
-   * Return the column number where the current document event ends.
-   * Note that this is the column number of the first
-   * character after the text associated with the document
-   * event.  The first column in a line is position 1.
-   * @return The column number, or -1 if none is available.
-   * @see #getLineNumber
-   */
-  public int getColumnNumber()
-  {
-    return m_columnNumber;
-  }
-
-  /**
-   * Return the public identifier for the current document event.
-   * <p>This will be the public identifier
-   * @return A string containing the public identifier, or
-   *         null if none is available.
-   * @see #getSystemId
-   */
-  public String getPublicId()
-  {
-    return (null != m_parentNode) ? m_parentNode.getPublicId() : null;
-  }
-
-  /**
-   * Return the system identifier for the current document event.
-   *
-   * <p>If the system identifier is a URL, the parser must resolve it
-   * fully before passing it to the application.</p>
-   *
-   * @return A string containing the system identifier, or null
-   *         if none is available.
-   * @see #getPublicId
-   */
-  public String getSystemId()
-  {
-    return this.getStylesheet().getHref();
-  }
-
-  /**
-   * Set the location information for this element.
-   *
-   * @param locator Source Locator with location information for this element
-   */
-  public void setLocaterInfo(SourceLocator locator)
-  {
-    m_lineNumber = locator.getLineNumber();
-    m_columnNumber = locator.getColumnNumber();
-  }
-
-  /**
-   * Tell if this element has the default space handling
-   * turned off or on according to the xml:space attribute.
-   * @serial
-   */
-  private boolean m_defaultSpace = true;
-
-  /**
-   * Tell if this element only has one text child, for optimization purposes.
-   * @serial
-   */
-  private boolean m_hasTextLitOnly = false;
-
-  /**
-   * Tell if this element only has one text child, for optimization purposes.
-   * @serial
-   */
-  protected boolean m_hasVariableDecl = false;
-  
-  public boolean hasVariableDecl()
-  {
-    return m_hasVariableDecl;
-  }
-
-  /**
-   * Set the "xml:space" attribute.
-   * A text node is preserved if an ancestor element of the text node
-   * has an xml:space attribute with a value of preserve, and
-   * no closer ancestor element has xml:space with a value of default.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a>
-   *
-   * @param v  Enumerated value, either Constants.ATTRVAL_PRESERVE 
-   * or Constants.ATTRVAL_STRIP.
-   */
-  public void setXmlSpace(int v)
-  {
-    m_defaultSpace = ((Constants.ATTRVAL_STRIP == v) ? true : false);
-  }
-
-  /**
-   * Get the "xml:space" attribute.
-   * A text node is preserved if an ancestor element of the text node
-   * has an xml:space attribute with a value of preserve, and
-   * no closer ancestor element has xml:space with a value of default.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a>
-   *
-   * @return The value of the xml:space attribute
-   */
-  public boolean getXmlSpace()
-  {
-    return m_defaultSpace;
-  }
-
-  /**
-   * The list of namespace declarations for this element only.
-   * @serial
-   */
-  private Vector m_declaredPrefixes;
-
-  /**
-   * Return a table that contains all prefixes available
-   * within this element context.
-   *
-   * @return Vector containing the prefixes available within this
-   * element context 
-   */
-  public Vector getDeclaredPrefixes()
-  {
-    return m_declaredPrefixes;
-  }
-
-  /**
-   * From the SAX2 helper class, set the namespace table for
-   * this element.  Take care to call resolveInheritedNamespaceDecls.
-   * after all namespace declarations have been added.
-   *
-   * @param nsSupport non-null reference to NamespaceSupport from 
-   * the ContentHandler.
-   *
-   * @throws TransformerException
-   */
-  public void setPrefixes(NamespaceSupport nsSupport) throws TransformerException
-  {
-    setPrefixes(nsSupport, false);
-  }
-
-  /**
-   * Copy the namespace declarations from the NamespaceSupport object.  
-   * Take care to call resolveInheritedNamespaceDecls.
-   * after all namespace declarations have been added.
-   *
-   * @param nsSupport non-null reference to NamespaceSupport from 
-   * the ContentHandler.
-   * @param excludeXSLDecl true if XSLT namespaces should be ignored.
-   *
-   * @throws TransformerException
-   */
-  public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl)
-          throws TransformerException
-  {
-
-    Enumeration decls = nsSupport.getDeclaredPrefixes();
-
-    while (decls.hasMoreElements())
-    {
-      String prefix = (String) decls.nextElement();
-
-      if (null == m_declaredPrefixes)
-        m_declaredPrefixes = new Vector();
-
-      String uri = nsSupport.getURI(prefix);
-
-      if (excludeXSLDecl && uri.equals(Constants.S_XSLNAMESPACEURL))
-        continue;
-
-      // System.out.println("setPrefixes - "+prefix+", "+uri);
-      XMLNSDecl decl = new XMLNSDecl(prefix, uri, false);
-
-      m_declaredPrefixes.addElement(decl);
-    }
-  }
-
-  /**
-   * Fullfill the PrefixResolver interface.  Calling this for this class 
-   * will throw an error.
-   *
-   * @param prefix The prefix to look up, which may be an empty string ("") 
-   *               for the default Namespace.
-   * @param context The node context from which to look up the URI.
-   *
-   * @return null if the error listener does not choose to throw an exception.
-   */
-  public String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context)
-  {
-
-    this.error(XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, null);
-
-    return null;
-  }
-
-  /**
-   * Given a namespace, get the corrisponding prefix.
-   * 9/15/00: This had been iteratively examining the m_declaredPrefixes
-   * field for this node and its parents. That makes life difficult for
-   * the compilation experiment, which doesn't have a static vector of
-   * local declarations. Replaced a recursive solution, which permits
-   * easier subclassing/overriding.
-   *
-   * @param prefix non-null reference to prefix string, which should map 
-   *               to a namespace URL.
-   *
-   * @return The namespace URL that the prefix maps to, or null if no 
-   *         mapping can be found.
-   */
-  public String getNamespaceForPrefix(String prefix)
-  {
-//    if (null != prefix && prefix.equals("xmlns"))
-//    {
-//      return Constants.S_XMLNAMESPACEURI;
-//    }
-
-    Vector nsDecls = m_declaredPrefixes;
-
-    if (null != nsDecls)
-    {
-      int n = nsDecls.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        XMLNSDecl decl = (XMLNSDecl) nsDecls.elementAt(i);
-
-        if (prefix.equals(decl.getPrefix()))
-          return decl.getURI();
-      }
-    }
-
-    // Not found; ask our ancestors
-    if (null != m_parentNode)
-      return m_parentNode.getNamespaceForPrefix(prefix);
-
-    // No parent, so no definition
-    return null;
-  }
-
-  /**
-   * The table of {@link XMLNSDecl}s for this element
-   * and all parent elements, screened for excluded prefixes.
-   * @serial
-   */
-  Vector m_prefixTable;
-
-  /**
-   * Return a table that contains all prefixes available
-   * within this element context.
-   *
-   * @return reference to vector of {@link XMLNSDecl}s, which may be null.
-   */
-  public Vector getPrefixes()
-  {
-    return m_prefixTable;
-  }
-  
-  /**
-   * Get whether or not the passed URL is contained flagged by
-   * the "extension-element-prefixes" property.  This method is overridden 
-   * by {@link ElemLiteralResult#containsExcludeResultPrefix}.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param prefix non-null reference to prefix that might be excluded.
-   *
-   * @return true if the prefix should normally be excluded.
-   */
-  public boolean containsExcludeResultPrefix(String prefix)
-  {
-    ElemTemplateElement parent = this.getParentElem();
-    if(null != parent)
-      return parent.containsExcludeResultPrefix(prefix);
-      
-    return false;
-  }
-
-  /**
-   * Tell if the result namespace decl should be excluded.  Should be called before
-   * namespace aliasing (I think).
-   *
-   * @param prefix non-null reference to prefix.
-   * @param uri reference to namespace that prefix maps to, which is protected 
-   *            for null, but should really never be passed as null.
-   *
-   * @return true if the given namespace should be excluded.
-   *
-   * @throws TransformerException
-   */
-  private boolean excludeResultNSDecl(String prefix, String uri)
-          throws TransformerException
-  {
-
-    if (uri != null)
-    {
-      if (uri.equals(Constants.S_XSLNAMESPACEURL)
-              || getStylesheet().containsExtensionElementURI(uri)
-              || uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL))
-        return true;
-
-      if (containsExcludeResultPrefix(prefix))
-        return true;
-    }
-
-    return false;
-  }
-  
-  /**
-   * Combine the parent's namespaces with this namespace
-   * for fast processing, taking care to reference the
-   * parent's namespace if this namespace adds nothing new.
-   * (Recursive method, walking the elements depth-first,
-   * processing parents before children).
-   * Note that this method builds m_prefixTable with aliased 
-   * namespaces, *not* the original namespaces.
-   *
-   * @throws TransformerException
-   */
-  public void resolvePrefixTables() throws TransformerException
-  {
-    // Always start with a fresh prefix table!
-    m_prefixTable = null;
-
-    // If we have declared declarations, then we look for 
-    // a parent that has namespace decls, and add them 
-    // to this element's decls.  Otherwise we just point 
-    // to the parent that has decls.
-    if (null != this.m_declaredPrefixes)
-    {
-      StylesheetRoot stylesheet = this.getStylesheetRoot();
-      
-      // Add this element's declared prefixes to the 
-      // prefix table.
-      int n = m_declaredPrefixes.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        XMLNSDecl decl = (XMLNSDecl) m_declaredPrefixes.elementAt(i);
-        String prefix = decl.getPrefix();
-        String uri = decl.getURI();
-        if(null == uri)
-          uri = "";
-        boolean shouldExclude = excludeResultNSDecl(prefix, uri);
-
-        // Create a new prefix table if one has not already been created.
-        if (null == m_prefixTable)
-          m_prefixTable = new Vector();
-
-        NamespaceAlias nsAlias = stylesheet.getNamespaceAliasComposed(uri);
-        if(null != nsAlias)
-        {
-          // Should I leave the non-aliased element in the table as 
-          // an excluded element?
-          
-          // The exclusion should apply to the non-aliased prefix, so 
-          // we don't calculate it here.  -sb
-          // Use stylesheet prefix, as per xsl WG
-          decl = new XMLNSDecl(nsAlias.getStylesheetPrefix(), 
-                              nsAlias.getResultNamespace(), shouldExclude);
-        }
-        else
-          decl = new XMLNSDecl(prefix, uri, shouldExclude);
-
-        m_prefixTable.addElement(decl);
-        
-      }
-    }
-
-    ElemTemplateElement parent = this.getParentNodeElem();
-
-    if (null != parent)
-    {
-
-      // The prefix table of the parent should never be null!
-      Vector prefixes = parent.m_prefixTable;
-
-      if (null == m_prefixTable && !needToCheckExclude())
-      {
-
-        // Nothing to combine, so just use parent's table!
-        this.m_prefixTable = parent.m_prefixTable;
-      }
-      else
-      {
-
-        // Add the prefixes from the parent's prefix table.
-        int n = prefixes.size();
-        
-        for (int i = 0; i < n; i++)
-        {
-          XMLNSDecl decl = (XMLNSDecl) prefixes.elementAt(i);
-          boolean shouldExclude = excludeResultNSDecl(decl.getPrefix(),
-                                                      decl.getURI());
-
-          if (shouldExclude != decl.getIsExcluded())
-          {
-            decl = new XMLNSDecl(decl.getPrefix(), decl.getURI(),
-                                 shouldExclude);
-          }
-          
-          //m_prefixTable.addElement(decl);
-          addOrReplaceDecls(decl);
-        }
-      }
-    }
-    else if (null == m_prefixTable)
-    {
-
-      // Must be stylesheet element without any result prefixes!
-      m_prefixTable = new Vector();
-    }
-  }
-  
-  /**
-   * Add or replace this namespace declaration in list
-   * of namespaces in scope for this element.
-   *
-   * @param newDecl namespace declaration to add to list
-   */
-  void addOrReplaceDecls(XMLNSDecl newDecl)
-  {
-      int n = m_prefixTable.size();
-
-        for (int i = n - 1; i >= 0; i--)
-        {
-          XMLNSDecl decl = (XMLNSDecl) m_prefixTable.elementAt(i);
-
-          if (decl.getPrefix().equals(newDecl.getPrefix()))
-          {
-            return;
-          }
-        }
-      m_prefixTable.addElement(newDecl);    
-    
-  }
-  
-  /**
-   * Return whether we need to check namespace prefixes 
-   * against and exclude result prefixes list.
-   */
-  boolean needToCheckExclude()
-  {
-    return false;    
-  } 
-
-  /**
-   * Send startPrefixMapping events to the result tree handler
-   * for all declared prefix mappings in the stylesheet.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   *
-   * @throws TransformerException
-   */
-  void executeNSDecls(TransformerImpl transformer) throws TransformerException
-  {
-
-    try
-    {
-      if (null != m_prefixTable)
-      {
-        ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-        int n = m_prefixTable.size();
-
-        for (int i = n - 1; i >= 0; i--)
-        {
-          XMLNSDecl decl = (XMLNSDecl) m_prefixTable.elementAt(i);
-
-          if (!decl.getIsExcluded())
-          {
-            rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true);
-          }
-        }
-      }
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Send startPrefixMapping events to the result tree handler
-   * for all declared prefix mappings in the stylesheet.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   *
-   * @throws TransformerException
-   */
-  void unexecuteNSDecls(TransformerImpl transformer) throws TransformerException
-  {
-
-    try
-    {
-      if (null != m_prefixTable)
-      {
-        ResultTreeHandler rhandler = transformer.getResultTreeHandler();
-        int n = m_prefixTable.size();
-
-        for (int i = 0; i < n; i++)
-        {
-          XMLNSDecl decl = (XMLNSDecl) m_prefixTable.elementAt(i);
-
-          if (!decl.getIsExcluded())
-          {
-            rhandler.endPrefixMapping(decl.getPrefix());
-          }
-        }
-      }
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-  
-  /** The *relative* document order number of this element.
-   *  @serial */
-  protected int m_docOrderNumber = -1;
-  
-  /**
-   * Set the UID (document order index).
-   *
-   * @param kIndex Index of this child.
-   */
-  public void setUid(int i)
-  {
-    m_docOrderNumber = i;
-  }
-
-  /**
-   * Get the UID (document order index).
-   *
-   * @return Index of this child
-   */
-  public int getUid()
-  {
-    return m_docOrderNumber;
-  }
-
-
-  /**
-   * Parent node.
-   * @serial
-   */
-  protected ElemTemplateElement m_parentNode;
-
-  /**
-   * Get the parent as a Node.
-   *
-   * @return This node's parent node
-   */
-  public Node getParentNode()
-  {
-    return m_parentNode;
-  }
-
-  /**
-   * Get the parent as an ElemTemplateElement.
-   *
-   * @return This node's parent as an ElemTemplateElement
-   */
-  public ElemTemplateElement getParentElem()
-  {
-    return m_parentNode;
-  }
-
-  /**
-   * Set the parent as an ElemTemplateElement.
-   *
-   * @param parent This node's parent as an ElemTemplateElement
-   */
-  public void setParentElem(ElemTemplateElement p)
-  {
-    m_parentNode = p;
-  }
-
-  /**
-   * Next sibling.
-   * @serial
-   */
-  ElemTemplateElement m_nextSibling;
-
-  /**
-   * Get the next sibling (as a Node) or return null.
-   *
-   * @return this node's next sibling or null
-   */
-  public Node getNextSibling()
-  {
-    return m_nextSibling;
-  }
-
-  /**
-   * Get the previous sibling (as a Node) or return null.
-   * Note that this may be expensive if the parent has many kids;
-   * we accept that price in exchange for avoiding the prev pointer
-   * TODO: If we were sure parents and sibs are always ElemTemplateElements,
-   * we could hit the fields directly rather than thru accessors.
-   *
-   * @return This node's previous sibling or null
-   */
-  public Node getPreviousSibling()
-  {
-
-    Node walker = getParentNode(), prev = null;
-
-    if (walker != null)
-      for (walker = walker.getFirstChild(); walker != null;
-              prev = walker, walker = walker.getNextSibling())
-      {
-        if (walker == this)
-          return prev;
-      }
-
-    return null;
-  }
-
-  /**
-   * Get the previous sibling (as a Node) or return null.
-   * Note that this may be expensive if the parent has many kids;
-   * we accept that price in exchange for avoiding the prev pointer
-   * TODO: If we were sure parents and sibs are always ElemTemplateElements,
-   * we could hit the fields directly rather than thru accessors.
-   *
-   * @return This node's previous sibling or null
-   */
-  public ElemTemplateElement getPreviousSiblingElem()
-  {
-
-    ElemTemplateElement walker = getParentNodeElem();
-    ElemTemplateElement prev = null;
-
-    if (walker != null)
-      for (walker = walker.getFirstChildElem(); walker != null;
-              prev = walker, walker = walker.getNextSiblingElem())
-      {
-        if (walker == this)
-          return prev;
-      }
-
-    return null;
-  }
-
-
-  /**
-   * Get the next sibling (as a ElemTemplateElement) or return null.
-   *
-   * @return This node's next sibling (as a ElemTemplateElement) or null 
-   */
-  public ElemTemplateElement getNextSiblingElem()
-  {
-    return m_nextSibling;
-  }
-  
-  /**
-   * Get the parent element.
-   *
-   * @return This node's next parent (as a ElemTemplateElement) or null 
-   */
-  public ElemTemplateElement getParentNodeElem()
-  {
-    return m_parentNode;
-  }
-
-
-  /**
-   * First child.
-   * @serial
-   */
-  ElemTemplateElement m_firstChild;
-
-  /**
-   * Get the first child as a Node.
-   *
-   * @return This node's first child or null
-   */
-  public Node getFirstChild()
-  {
-    return m_firstChild;
-  }
-
-  /**
-   * Get the first child as a ElemTemplateElement.
-   *
-   * @return This node's first child (as a ElemTemplateElement) or null
-   */
-  public ElemTemplateElement getFirstChildElem()
-  {
-    return m_firstChild;
-  }
-
-  /**
-   * Get the last child.
-   *
-   * @return This node's last child
-   */
-  public Node getLastChild()
-  {
-
-    ElemTemplateElement lastChild = null;
-
-    for (ElemTemplateElement node = m_firstChild; node != null;
-            node = node.m_nextSibling)
-    {
-      lastChild = node;
-    }
-
-    return lastChild;
-  }
-
-  /**
-   * Get the last child.
-   *
-   * @return This node's last child
-   */
-  public ElemTemplateElement getLastChildElem()
-  {
-
-    ElemTemplateElement lastChild = null;
-
-    for (ElemTemplateElement node = m_firstChild; node != null;
-            node = node.m_nextSibling)
-    {
-      lastChild = node;
-    }
-
-    return lastChild;
-  }
-
-
-  /** DOM backpointer that this element originated from.          */
-  transient private org.w3c.dom.Node m_DOMBackPointer;
-
-  /**
-   * If this stylesheet was created from a DOM, get the
-   * DOM backpointer that this element originated from.
-   * For tooling use.
-   *
-   * @return DOM backpointer that this element originated from or null.
-   */
-  public org.w3c.dom.Node getDOMBackPointer()
-  {
-    return m_DOMBackPointer;
-  }
-
-  /**
-   * If this stylesheet was created from a DOM, set the
-   * DOM backpointer that this element originated from.
-   * For tooling use.
-   *
-   * @param n DOM backpointer that this element originated from.
-   */
-  public void setDOMBackPointer(org.w3c.dom.Node n)
-  {
-    m_DOMBackPointer = n;
-  }
-
-  /**
-   * Compares this object with the specified object for precedence order.
-   * The order is determined by the getImportCountComposed() of the containing
-   * composed stylesheet and the getUid() of this element.
-   * Returns a negative integer, zero, or a positive integer as this
-   * object is less than, equal to, or greater than the specified object.
-   * 
-   * @param o The object to be compared to this object
-   * @returns a negative integer, zero, or a positive integer as this object is
-   *          less than, equal to, or greater than the specified object.
-   * @throws ClassCastException if the specified object's
-   *         type prevents it from being compared to this Object.
-   */
-  public int compareTo(Object o) throws ClassCastException {
-    
-    ElemTemplateElement ro = (ElemTemplateElement) o;
-    int roPrecedence = ro.getStylesheetComposed().getImportCountComposed();
-    int myPrecedence = this.getStylesheetComposed().getImportCountComposed();
-
-    if (myPrecedence < roPrecedence)
-      return -1;
-    else if (myPrecedence > roPrecedence)
-      return 1;
-    else
-      return this.getUid() - ro.getUid();
-  }
-  
-  /**
-   * Get information about whether or not an element should strip whitespace.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param support The XPath runtime state.
-   * @param targetElement Element to check
-   *
-   * @return true if the whitespace should be stripped.
-   *
-   * @throws TransformerException
-   */
-  public boolean shouldStripWhiteSpace(
-          org.apache.xpath.XPathContext support, 
-          org.w3c.dom.Element targetElement) throws TransformerException
-  {
-    StylesheetRoot sroot = this.getStylesheetRoot();
-    return (null != sroot) ? sroot.shouldStripWhiteSpace(support, targetElement) :false;
-  }
-  
-  /**
-   * Get information about whether or not whitespace can be stripped.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @return true if the whitespace can be stripped.
-   */
-  public boolean canStripWhiteSpace()
-  {
-    StylesheetRoot sroot = this.getStylesheetRoot();
-    return (null != sroot) ? sroot.canStripWhiteSpace() : false;
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/ElemText.java b/src/org/apache/xalan/templates/ElemText.java
deleted file mode 100644
index 30d435b..0000000
--- a/src/org/apache/xalan/templates/ElemText.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import java.io.*;
-
-import java.util.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:template.
- * This primarily acts as a marker on the element
- * stack to signal that whitespace should be preserved.
- * <pre>
- * <!ELEMENT xsl:text (#PCDATA)>
- * <!ATTLIST xsl:text
- *   disable-output-escaping (yes|no) "no"
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a>
- */
-public class ElemText extends ElemTemplateElement
-{
-
-  /**
-   * Tells if this element should disable escaping.
-   * @serial
-   */
-  private boolean m_disableOutputEscaping = false;
-
-  /**
-   * Set the "disable-output-escaping" attribute.
-   * Normally, the xml output method escapes & and < (and
-   * possibly other characters) when outputting text nodes.
-   * This ensures that the output is well-formed XML. However,
-   * it is sometimes convenient to be able to produce output
-   * that is almost, but not quite well-formed XML; for
-   * example, the output may include ill-formed sections
-   * which are intended to be transformed into well-formed
-   * XML by a subsequent non-XML aware process. For this reason,
-   * XSLT provides a mechanism for disabling output escaping.
-   * An xsl:value-of or xsl:text element may have a
-   * disable-output-escaping attribute; the allowed values
-   * are yes or no; the default is no; if the value is yes,
-   * then a text node generated by instantiating the xsl:value-of
-   * or xsl:text element should be output without any escaping.
-   * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
-   *
-   * @param v Boolean flag indicating whether this element should disable escaping
-   */
-  public void setDisableOutputEscaping(boolean v)
-  {
-    m_disableOutputEscaping = v;
-  }
-
-  /**
-   * Get the "disable-output-escaping" attribute.
-   * Normally, the xml output method escapes & and < (and
-   * possibly other characters) when outputting text nodes.
-   * This ensures that the output is well-formed XML. However,
-   * it is sometimes convenient to be able to produce output
-   * that is almost, but not quite well-formed XML; for
-   * example, the output may include ill-formed sections
-   * which are intended to be transformed into well-formed
-   * XML by a subsequent non-XML aware process. For this reason,
-   * XSLT provides a mechanism for disabling output escaping.
-   * An xsl:value-of or xsl:text element may have a
-   * disable-output-escaping attribute; the allowed values
-   * are yes or no; the default is no; if the value is yes,
-   * then a text node generated by instantiating the xsl:value-of
-   * or xsl:text element should be output without any escaping.
-   * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
-   *
-   * @return Boolean flag indicating whether this element should disable escaping
-   */
-  public boolean getDisableOutputEscaping()
-  {
-    return m_disableOutputEscaping;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_TEXT;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_TEXT_STRING;
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to children list
-   *
-   * @return Child added to children list
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    int type = ((ElemTemplateElement) newChild).getXSLToken();
-
-    switch (type)
-    {
-    case Constants.ELEMNAME_TEXTLITERALRESULT :
-      break;
-    default :
-      error(XSLTErrorResources.ER_CANNOT_ADD,
-            new Object[]{ newChild.getNodeName(),
-                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    }
-
-    return super.appendChild(newChild);
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemTextLiteral.java b/src/org/apache/xalan/templates/ElemTextLiteral.java
deleted file mode 100644
index e1ca063..0000000
--- a/src/org/apache/xalan/templates/ElemTextLiteral.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
- 
-import org.xml.sax.*;
-
-import org.apache.xml.utils.QName;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement a text literal.
- * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a>
- */
-public class ElemTextLiteral extends ElemTemplateElement
-{
-
-  /**
-   * Tell if space should be preserved.
-   * @serial
-   */
-  private boolean m_preserveSpace;
-
-  /**
-   * Set whether or not space should be preserved.
-   *
-   * @param v Boolean flag indicating whether 
-   * or not space should be preserved
-   */
-  public void setPreserveSpace(boolean v)
-  {
-    m_preserveSpace = v;
-  }
-
-  /**
-   * Get whether or not space should be preserved.
-   *
-   * @return Boolean flag indicating whether 
-   * or not space should be preserved 
-   */
-  public boolean getPreserveSpace()
-  {
-    return m_preserveSpace;
-  }
-
-  /**
-   * The character array.
-   * @serial
-   */
-  private char m_ch[];
-  
-  /**
-   * The character array as a string.
-   * @serial
-   */
-  private String m_str;
-
-  /**
-   * Set the characters that will be output to the result tree..
-   *
-   * @param v Array of characters that will be output to the result tree 
-   */
-  public void setChars(char[] v)
-  {
-    m_ch = v;
-  }
-
-  /**
-   * Get the characters that will be output to the result tree..
-   *
-   * @return Array of characters that will be output to the result tree
-   */
-  public char[] getChars()
-  {
-    return m_ch;
-  }
-  
-  /**
-   * Get the value of the node as a string.
-   *
-   * @return null
-   */
-  public synchronized String getNodeValue()
-  {
-
-    if(null == m_str)
-    {
-      m_str = new String(m_ch);
-    }
-
-    return m_str;
-  }
-
-
-  /**
-   * Tells if this element should disable escaping.
-   * @serial
-   */
-  private boolean m_disableOutputEscaping = false;
-
-  /**
-   * Set the "disable-output-escaping" attribute.
-   * Normally, the xml output method escapes & and < (and
-   * possibly other characters) when outputting text nodes.
-   * This ensures that the output is well-formed XML. However,
-   * it is sometimes convenient to be able to produce output
-   * that is almost, but not quite well-formed XML; for
-   * example, the output may include ill-formed sections
-   * which are intended to be transformed into well-formed
-   * XML by a subsequent non-XML aware process. For this reason,
-   * XSLT provides a mechanism for disabling output escaping.
-   * An xsl:value-of or xsl:text element may have a
-   * disable-output-escaping attribute; the allowed values
-   * are yes or no; the default is no; if the value is yes,
-   * then a text node generated by instantiating the xsl:value-of
-   * or xsl:text element should be output without any escaping.
-   * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
-   *
-   * @param v Boolean value for "disable-output-escaping" attribute.
-   */
-  public void setDisableOutputEscaping(boolean v)
-  {
-    m_disableOutputEscaping = v;
-  }
-
-  /**
-   * Get the "disable-output-escaping" attribute.
-   * Normally, the xml output method escapes & and < (and
-   * possibly other characters) when outputting text nodes.
-   * This ensures that the output is well-formed XML. However,
-   * it is sometimes convenient to be able to produce output
-   * that is almost, but not quite well-formed XML; for
-   * example, the output may include ill-formed sections
-   * which are intended to be transformed into well-formed
-   * XML by a subsequent non-XML aware process. For this reason,
-   * XSLT provides a mechanism for disabling output escaping.
-   * An xsl:value-of or xsl:text element may have a
-   * disable-output-escaping attribute; the allowed values
-   * are yes or no; the default is no; if the value is yes,
-   * then a text node generated by instantiating the xsl:value-of
-   * or xsl:text element should be output without any escaping.
-   * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
-   *
-   * @return Boolean value of "disable-output-escaping" attribute.
-   */
-  public boolean getDisableOutputEscaping()
-  {
-    return m_disableOutputEscaping;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_TEXTLITERALRESULT;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The element's name
-   */
-  public String getNodeName()
-  {
-    return "#Text";
-  }
-
-  /**
-   * Copy the text literal to the result tree.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-    try
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      ResultTreeHandler rth = transformer.getResultTreeHandler();
-      if (m_disableOutputEscaping)
-      {
-        rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
-      }
-
-      rth.characters(m_ch, 0, m_ch.length);
-
-      if (m_disableOutputEscaping)
-      {
-        rth.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
-      }
-    }
-    catch(SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemUnknown.java b/src/org/apache/xalan/templates/ElemUnknown.java
deleted file mode 100644
index 1225c61..0000000
--- a/src/org/apache/xalan/templates/ElemUnknown.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-
-import java.util.StringTokenizer;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.StringToStringTable;
-import org.apache.xml.utils.NameSpace;
-import org.apache.xml.utils.StringVector;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-
-import java.io.*;
-
-import java.util.*;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement a Literal Result Element.
- */
-public class ElemUnknown extends ElemLiteralResult
-{
-
-  /**
-   * Copy an unknown element to the result tree
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException{}
-}
diff --git a/src/org/apache/xalan/templates/ElemUse.java b/src/org/apache/xalan/templates/ElemUse.java
deleted file mode 100644
index dcee15d..0000000
--- a/src/org/apache/xalan/templates/ElemUse.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.*;
-import org.apache.xml.utils.QName;
-
-import java.util.StringTokenizer;
-
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:use.
- * This acts as a superclass for ElemCopy, ElemAttributeSet,
- * ElemElement, and ElemLiteralResult, on order to implement
- * shared behavior the use-attribute-sets attribute.
- * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
- */
-public class ElemUse extends ElemTemplateElement
-{
-
-  /**
-   * The value of the "use-attribute-sets" attribute.
-   * @serial
-   */
-  private QName m_attributeSetsNames[] = null;
-
-  /**
-   * Set the "use-attribute-sets" attribute.
-   * Attribute sets are used by specifying a use-attribute-sets
-   * attribute on xsl:element, xsl:copy (see [7.5 Copying]) or
-   * xsl:attribute-set elements. The value of the use-attribute-sets
-   * attribute is a whitespace-separated list of names of attribute
-   * sets. Each name is specified as a QName, which is expanded as
-   * described in [2.4 Qualified Names].
-   *
-   * @param v The value to set for the "use-attribute-sets" attribute. 
-   */
-  public void setUseAttributeSets(Vector v)
-  {
-
-    int n = v.size();
-
-    m_attributeSetsNames = new QName[n];
-
-    for (int i = 0; i < n; i++)
-    {
-      m_attributeSetsNames[i] = (QName) v.elementAt(i);
-    }
-  }
-
-  /**
-   * Set the "use-attribute-sets" attribute.
-   * Attribute sets are used by specifying a use-attribute-sets
-   * attribute on xsl:element, xsl:copy (see [7.5 Copying]) or
-   * xsl:attribute-set elements. The value of the use-attribute-sets
-   * attribute is a whitespace-separated list of names of attribute
-   * sets. Each name is specified as a QName, which is expanded as
-   * described in [2.4 Qualified Names].
-   *
-   * @param v The value to set for the "use-attribute-sets" attribute. 
-   */
-  public void setUseAttributeSets(QName[] v)
-  {
-    m_attributeSetsNames = v;
-  }
-
-  /**
-   * Get the "use-attribute-sets" attribute.
-   * Attribute sets are used by specifying a use-attribute-sets
-   * attribute on xsl:element, xsl:copy (see [7.5 Copying]) or
-   * xsl:attribute-set elements, or a xsl:use-attribute-sets attribute on
-   * Literal Result Elements.
-   * The value of the use-attribute-sets
-   * attribute is a whitespace-separated list of names of attribute
-   * sets. Each name is specified as a QName, which is expanded as
-   * described in [2.4 Qualified Names].
-   *
-   * @return The value of the "use-attribute-sets" attribute. 
-   */
-  public QName[] getUseAttributeSets()
-  {
-    return m_attributeSetsNames;
-  }
-  
-  /**
-   * Add the attributes from the named attribute sets to the attribute list.
-   * TODO: Error handling for: "It is an error if there are two attribute sets
-   * with the same expanded-name and with equal import precedence and that both
-   * contain the same attribute unless there is a definition of the attribute
-   * set with higher import precedence that also contains the attribute."
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param stylesheet The owning root stylesheet
-   * @param attributeSetsNames List of attribute sets names to apply
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void applyAttrSets(
-          TransformerImpl transformer, StylesheetRoot stylesheet)
-            throws TransformerException
-  {
-    applyAttrSets(transformer, stylesheet, m_attributeSetsNames);
-  }
-
-  /**
-   * Add the attributes from the named attribute sets to the attribute list.
-   * TODO: Error handling for: "It is an error if there are two attribute sets
-   * with the same expanded-name and with equal import precedence and that both
-   * contain the same attribute unless there is a definition of the attribute
-   * set with higher import precedence that also contains the attribute."
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param stylesheet The owning root stylesheet
-   * @param attributeSetsNames List of attribute sets names to apply
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  private void applyAttrSets(
-          TransformerImpl transformer, StylesheetRoot stylesheet, QName attributeSetsNames[])
-            throws TransformerException
-  {
-
-    if (null != attributeSetsNames)
-    {
-      int nNames = attributeSetsNames.length;
-
-      for (int i = 0; i < nNames; i++)
-      {
-        QName qname = attributeSetsNames[i];
-        Vector attrSets = stylesheet.getAttributeSetComposed(qname);
-
-        if (null != attrSets)
-        {
-          int nSets = attrSets.size();
-
-          for (int k = 0; k < nSets; k++)
-          {
-            ElemAttributeSet attrSet =
-              (ElemAttributeSet) attrSets.elementAt(k);
-
-            attrSet.execute(transformer);
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   * Copy attributes specified by use-attribute-sets to the result tree.
-   * Specifying a use-attribute-sets attribute is equivalent to adding
-   * xsl:attribute elements for each of the attributes in each of the
-   * named attribute sets to the beginning of the content of the element
-   * with the use-attribute-sets attribute, in the same order in which
-   * the names of the attribute sets are specified in the use-attribute-sets
-   * attribute. It is an error if use of use-attribute-sets attributes
-   * on xsl:attribute-set elements causes an attribute set to directly
-   * or indirectly use itself.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    if (null != m_attributeSetsNames)
-    {
-      applyAttrSets(transformer, getStylesheetRoot(),
-                    m_attributeSetsNames);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemValueOf.java b/src/org/apache/xalan/templates/ElemValueOf.java
deleted file mode 100644
index 4140f8e..0000000
--- a/src/org/apache/xalan/templates/ElemValueOf.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.ResultTreeHandler;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.XMLString;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:value-of.
- * <pre>
- * <!ELEMENT xsl:value-of EMPTY>
- * <!ATTLIST xsl:value-of
- *   select %expr; #REQUIRED
- *   disable-output-escaping (yes|no) "no"
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#value-of">value-of in XSLT Specification</a>
- */
-public class ElemValueOf extends ElemTemplateElement
-{
-
-  /**
-   * The select expression to be executed.
-   * @serial
-   */
-  private XPath m_selectExpression = null;
-
-  /**
-   * True if the pattern is a simple ".".
-   * @serial
-   */
-  private boolean m_isDot = false;
-
-  /**
-   * Set the "select" attribute.
-   * The required select attribute is an expression; this expression
-   * is evaluated and the resulting object is converted to a
-   * string as if by a call to the string function.
-   *
-   * @param v The value to set for the "select" attribute.
-   */
-  public void setSelect(XPath v)
-  {
-
-    if (null != v)
-    {
-      String s = v.getPatternString();
-
-      m_isDot = (null != s) && s.equals(".");
-    }
-
-    m_selectExpression = v;
-  }
-
-  /**
-   * Get the "select" attribute.
-   * The required select attribute is an expression; this expression
-   * is evaluated and the resulting object is converted to a
-   * string as if by a call to the string function.
-   *
-   * @return The value of the "select" attribute.
-   */
-  public XPath getSelect()
-  {
-    return m_selectExpression;
-  }
-
-  /**
-   * Tells if this element should disable escaping.
-   * @serial
-   */
-  private boolean m_disableOutputEscaping = false;
-
-  /**
-   * Set the "disable-output-escaping" attribute.
-   * Normally, the xml output method escapes & and < (and
-   * possibly other characters) when outputting text nodes.
-   * This ensures that the output is well-formed XML. However,
-   * it is sometimes convenient to be able to produce output
-   * that is almost, but not quite well-formed XML; for
-   * example, the output may include ill-formed sections
-   * which are intended to be transformed into well-formed
-   * XML by a subsequent non-XML aware process. For this reason,
-   * XSLT provides a mechanism for disabling output escaping.
-   * An xsl:value-of or xsl:text element may have a
-   * disable-output-escaping attribute; the allowed values
-   * are yes or no; the default is no; if the value is yes,
-   * then a text node generated by instantiating the xsl:value-of
-   * or xsl:text element should be output without any escaping.
-   * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
-   *
-   * @param v The value to set for the "disable-output-escaping" attribute.
-   */
-  public void setDisableOutputEscaping(boolean v)
-  {
-    m_disableOutputEscaping = v;
-  }
-
-  /**
-   * Get the "disable-output-escaping" attribute.
-   * Normally, the xml output method escapes & and < (and
-   * possibly other characters) when outputting text nodes.
-   * This ensures that the output is well-formed XML. However,
-   * it is sometimes convenient to be able to produce output
-   * that is almost, but not quite well-formed XML; for
-   * example, the output may include ill-formed sections
-   * which are intended to be transformed into well-formed
-   * XML by a subsequent non-XML aware process. For this reason,
-   * XSLT provides a mechanism for disabling output escaping.
-   * An xsl:value-of or xsl:text element may have a
-   * disable-output-escaping attribute; the allowed values
-   * are yes or no; the default is no; if the value is yes,
-   * then a text node generated by instantiating the xsl:value-of
-   * or xsl:text element should be output without any escaping.
-   * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
-   *
-   * @return The value of the "disable-output-escaping" attribute.
-   */
-  public boolean getDisableOutputEscaping()
-  {
-    return m_disableOutputEscaping;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_VALUEOF;
-  }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   *
-   * NEEDSDOC @param sroot
-   *
-   * @throws TransformerException
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-
-    super.compose(sroot);
-
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-
-    if (null != m_selectExpression)
-      m_selectExpression.fixupVariables(
-        vnames, sroot.getComposeState().getGlobalsSize());
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The node name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_VALUEOF_STRING;
-  }
-
-  /**
-   * Execute the string expression and copy the text to the
-   * result tree.
-   * The required select attribute is an expression; this expression
-   * is evaluated and the resulting object is converted to a string
-   * as if by a call to the string function. The string specifies
-   * the string-value of the created text node. If the string is
-   * empty, no text node will be created. The created text node will
-   * be merged with any adjacent text nodes.
-   * @see <a href="http://www.w3.org/TR/xslt#value-of">value-of in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-
-    XPathContext xctxt = transformer.getXPathContext();
-    ResultTreeHandler rth = transformer.getResultTreeHandler();
-
-    try
-    {
-      if (TransformerImpl.S_DEBUG)
-        transformer.getTraceManager().fireTraceEvent(this);
-
-      // Optimize for "."
-      if (false && m_isDot &&!TransformerImpl.S_DEBUG)
-      {
-        int child = xctxt.getCurrentNode();
-        DTM dtm = xctxt.getDTM(child);
-
-        xctxt.pushCurrentNode(child);
-
-        if (m_disableOutputEscaping)
-          rth.processingInstruction(
-            javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
-
-        try
-        {
-          dtm.dispatchCharactersEvents(child, rth, false);
-        }
-        finally
-        {
-          if (m_disableOutputEscaping)
-            rth.processingInstruction(
-              javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
-
-          xctxt.popCurrentNode();
-        }
-      }
-      else
-      {
-        xctxt.pushNamespaceContext(this);
-
-        int current = xctxt.getCurrentNode();
-
-        xctxt.pushCurrentNodeAndExpression(current, current);
-
-        if (m_disableOutputEscaping)
-          rth.processingInstruction(
-            javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
-
-        try
-        {
-          Expression expr = m_selectExpression.getExpression();
-
-          if (TransformerImpl.S_DEBUG)
-          {
-            XObject obj = expr.execute(xctxt);
-
-            transformer.getTraceManager().fireSelectedEvent(current, this,
-                    "select", m_selectExpression, obj);
-            obj.dispatchCharactersEvents(rth);
-          }
-          else
-          {
-            expr.executeCharsToContentHandler(xctxt, rth);
-          }
-        }
-        finally
-        {
-          if (m_disableOutputEscaping)
-            rth.processingInstruction(
-              javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
-
-          xctxt.popNamespaceContext();
-          xctxt.popCurrentNodeAndExpression();
-        }
-      }
-    }
-    catch (SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Add a child to the child list.
-   *
-   * @param newChild Child to add to children list
-   *
-   * @return Child just added to children list
-   *
-   * @throws DOMException
-   */
-  public ElemTemplateElement appendChild(ElemTemplateElement newChild)
-  {
-
-    error(XSLTErrorResources.ER_CANNOT_ADD,
-          new Object[]{ newChild.getNodeName(),
-                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
-    return null;
-  }
-}
diff --git a/src/org/apache/xalan/templates/ElemVariable.java b/src/org/apache/xalan/templates/ElemVariable.java
deleted file mode 100644
index da3873e..0000000
--- a/src/org/apache/xalan/templates/ElemVariable.java
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xpath.objects.XRTreeFragSelectWrapper;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:variable.
- * <pre>
- * <!ELEMENT xsl:variable %template;>
- * <!ATTLIST xsl:variable
- *   name %qname; #REQUIRED
- *   select %expr; #IMPLIED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
- */
-public class ElemVariable extends ElemTemplateElement
-{
-
-  /**
-   * Constructor ElemVariable
-   *
-   */
-  public ElemVariable(){}
-
-  /**
-   * This is the index into the stack frame.  If the index is above the 
-   * global area, it will have to be offset at execution time.
-   */
-  protected int m_index;
-  
-  /**
-   * Sets the relative position of this variable within the stack frame (if local)
-   * or the global area (if global).  Note that this should be called only for
-   * global variables since the local position is computed in the compose() method.
-   */
-  public void setIndex(int index)
-  {
-    m_index = index;
-  }
-
-  /**
-   * If this element is not at the top-level, get the relative position of the
-   * variable into the stack frame.  If this variable is at the top-level, get
-   * the relative position within the global area.
-   */
-  public int getIndex()
-  {
-    return m_index;
-  }
-
-  /**
-   * The value of the "select" attribute.
-   * @serial
-   */
-  private XPath m_selectPattern;
-
-  /**
-   * Set the "select" attribute.
-   * If the variable-binding element has a select attribute,
-   * then the value of the attribute must be an expression and
-   * the value of the variable is the object that results from
-   * evaluating the expression. In this case, the content
-   * of the variable must be empty.
-   *
-   * @param v Value to set for the "select" attribute.
-   */
-  public void setSelect(XPath v)
-  {
-    m_selectPattern = v;
-  }
-
-  /**
-   * Get the "select" attribute.
-   * If the variable-binding element has a select attribute,
-   * then the value of the attribute must be an expression and
-   * the value of the variable is the object that results from
-   * evaluating the expression. In this case, the content
-   * of the variable must be empty.
-   *
-   * @return Value of the "select" attribute.
-   */
-  public XPath getSelect()
-  {
-    return m_selectPattern;
-  }
-
-  /**
-   * The value of the "name" attribute.
-   * @serial
-   */
-  protected QName m_qname;
-
-  /**
-   * Set the "name" attribute.
-   * Both xsl:variable and xsl:param have a required name
-   * attribute, which specifies the name of the variable. The
-   * value of the name attribute is a QName, which is expanded
-   * as described in [2.4 Qualified Names].
-   * @see <a href="http://www.w3.org/TR/xslt#qname">qname in XSLT Specification</a>
-   *
-   * @param v Value to set for the "name" attribute.
-   */
-  public void setName(QName v)
-  {
-    m_qname = v;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * Both xsl:variable and xsl:param have a required name
-   * attribute, which specifies the name of the variable. The
-   * value of the name attribute is a QName, which is expanded
-   * as described in [2.4 Qualified Names].
-   * @see <a href="http://www.w3.org/TR/xslt#qname">qname in XSLT Specification</a>
-   *
-   * @return Value of the "name" attribute.
-   */
-  public QName getName()
-  {
-    return m_qname;
-  }
-
-  /**
-   * Tells if this is a top-level variable or param, or not.
-   * @serial
-   */
-  private boolean m_isTopLevel = false;
-
-  /**
-   * Set if this is a top-level variable or param, or not.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param v Boolean indicating whether this is a top-level variable
-   * or param, or not.
-   */
-  public void setIsTopLevel(boolean v)
-  {
-    m_isTopLevel = v;
-  }
-
-  /**
-   * Get if this is a top-level variable or param, or not.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @return Boolean indicating whether this is a top-level variable
-   * or param, or not.
-   */
-  public boolean getIsTopLevel()
-  {
-    return m_isTopLevel;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_VARIABLE;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The node name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_VARIABLE_STRING;
-  }
-
-  /**
-   * Copy constructor.
-   *
-   * @param param An element created from an xsl:variable
-   *
-   * @throws TransformerException
-   */
-  public ElemVariable(ElemVariable param) throws TransformerException
-  {
-
-    m_selectPattern = param.m_selectPattern;
-    m_qname = param.m_qname;
-    m_isTopLevel = param.m_isTopLevel;
-
-    // m_value = param.m_value;
-    // m_varContext = param.m_varContext;
-  }
-
-  /**
-   * Execute a variable declaration and push it onto the variable stack.
-   * @see <a href="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   *
-   * @throws TransformerException
-   */
-  public void execute(TransformerImpl transformer) throws TransformerException
-  {
-
-    if (TransformerImpl.S_DEBUG)
-      transformer.getTraceManager().fireTraceEvent(this);
-
-    int sourceNode = transformer.getXPathContext().getCurrentNode();
-    XObject var = getValue(transformer, sourceNode);
-
-    // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var);
-    transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var);
-  }
-
-  /**
-   * Get the XObject representation of the variable.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   *
-   * @return the XObject representation of the variable.
-   *
-   * @throws TransformerException
-   */
-  public XObject getValue(TransformerImpl transformer, int sourceNode)
-          throws TransformerException
-  {
-
-    XObject var;
-    XPathContext xctxt = transformer.getXPathContext();
-
-    xctxt.pushCurrentNode(sourceNode);
-
-    try
-    {
-      if (null != m_selectPattern)
-      {
-        var = m_selectPattern.execute(xctxt, sourceNode, this);
-
-        var.allowDetachToRelease(false);
-
-        if (TransformerImpl.S_DEBUG)
-          transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-                  "select", m_selectPattern, var);
-      }
-      else if (null == getFirstChildElem())
-      {
-        var = XString.EMPTYSTRING;
-      }
-      else
-      {
-
-        // Use result tree fragment
-        int df = transformer.transformToRTF(this);
-
-        var = new XRTreeFrag(df, xctxt);
-      }
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-    }
-
-    return var;
-  }
-  
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    // See if we can reduce an RTF to a select with a string expression.
-    if(null == m_selectPattern  
-       && org.apache.xalan.processor.TransformerFactoryImpl.m_optimize)
-    {
-      XPath newSelect = rewriteChildToExpression(this);
-      if(null != newSelect)
-        m_selectPattern = newSelect;
-    }
-    
-    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
-    
-    // This should be done before addVariableName, so we don't have visibility 
-    // to the variable now being defined.
-    java.util.Vector vnames = cstate.getVariableNames();
-    if(null != m_selectPattern)
-      m_selectPattern.fixupVariables(vnames, cstate.getGlobalsSize());
-      
-    // Only add the variable if this is not a global.  If it is a global, 
-    // it was already added by stylesheet root.
-    if(!(m_parentNode instanceof Stylesheet))
-      m_index = cstate.addVariableName(m_qname) - cstate.getGlobalsSize();
-    
-    // This has to be done after the addVariableName, so that the variable 
-    // pushed won't be immediately popped again in endCompose.
-    super.compose(sroot);
-  }
-  
-  
-//  /**
-//   * This after the template's children have been composed.
-//   */
-//  public void endCompose() throws TransformerException
-//  {
-//    super.endCompose();
-//  }
-
-
-  /**
-   * If the children of a variable is a single xsl:value-of or text literal, 
-   * it is cheaper to evaluate this as an expression, so try and adapt the 
-   * child an an expression.
-   *
-   * @param varElem Should be a ElemParam, ElemVariable, or ElemWithParam.
-   *
-   * @return An XPath if rewrite is possible, else null.
-   *
-   * @throws TransformerException
-   */
-  static XPath rewriteChildToExpression(ElemTemplateElement varElem)
-          throws TransformerException
-  {
-
-    ElemTemplateElement t = varElem.getFirstChildElem();
-
-    // Down the line this can be done with multiple string objects using 
-    // the concat function.
-    if (null != t && null == t.getNextSiblingElem())
-    {
-      int etype = t.getXSLToken();
-
-      if (Constants.ELEMNAME_VALUEOF == etype)
-      {
-        ElemValueOf valueof = (ElemValueOf) t;
-
-        // %TBD% I'm worried about extended attributes here.
-        if (valueof.getDisableOutputEscaping() == false
-                && valueof.getDOMBackPointer() == null)
-        {
-          varElem.m_firstChild = null;
-
-          return new XPath(new XRTreeFragSelectWrapper(valueof.getSelect().getExpression()));
-        }
-      }
-      else if (Constants.ELEMNAME_TEXTLITERALRESULT == etype)
-      {
-        ElemTextLiteral lit = (ElemTextLiteral) t;
-
-        if (lit.getDisableOutputEscaping() == false
-                && lit.getDOMBackPointer() == null)
-        {
-          String str = lit.getNodeValue();
-          XString xstr = new XString(str);
-
-          varElem.m_firstChild = null;
-
-          return new XPath(new XRTreeFragSelectWrapper(xstr));
-        }
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * This function is called during recomposition to
-   * control how this element is composed.
-   * @param root The root stylesheet for this transformation.
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeVariables(this);
-  }
-  
-  /**
-   * Set the parent as an ElemTemplateElement.
-   *
-   * @param parent This node's parent as an ElemTemplateElement
-   */
-  public void setParentElem(ElemTemplateElement p)
-  {
-    super.setParentElem(p);
-    p.m_hasVariableDecl = true;
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/ElemWhen.java b/src/org/apache/xalan/templates/ElemWhen.java
deleted file mode 100644
index d1f8c6a..0000000
--- a/src/org/apache/xalan/templates/ElemWhen.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:when.
- * <pre>
- * <!ELEMENT xsl:when %template;>
- * <!ATTLIST xsl:when
- *   test %expr; #REQUIRED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose">XXX in XSLT Specification</a>
- */
-public class ElemWhen extends ElemTemplateElement
-{
-
-  /**
-   * Each xsl:when element has a single attribute, test,
-   * which specifies an expression.
-   * @serial
-   */
-  private XPath m_test;
-
-  /**
-   * Set the "test" attribute.
-   * Each xsl:when element has a single attribute, test,
-   * which specifies an expression.
-   *
-   * @param v Value to set for the "test" attribute.
-   */
-  public void setTest(XPath v)
-  {
-    m_test = v;
-  }
-
-  /**
-   * Get the "test" attribute.
-   * Each xsl:when element has a single attribute, test,
-   * which specifies an expression.
-   *
-   * @return Value of the "test" attribute.
-   */
-  public XPath getTest()
-  {
-    return m_test;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_WHEN;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) 
-    throws javax.xml.transform.TransformerException
-  {
-    super.compose(sroot);
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-    if(null != m_test)
-      m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The node name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_WHEN_STRING;
-  }
-
-  /**
-   * Constructor ElemWhen
-   *
-   */
-  public ElemWhen(){}
-}
diff --git a/src/org/apache/xalan/templates/ElemWithParam.java b/src/org/apache/xalan/templates/ElemWithParam.java
deleted file mode 100644
index d6be1d5..0000000
--- a/src/org/apache/xalan/templates/ElemWithParam.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.*;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.transformer.TransformerImpl;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implement xsl:with-param.  xsl:with-param is allowed within
- * both xsl:call-template and xsl:apply-templates.
- * <pre>
- * <!ELEMENT xsl:with-param %template;>
- * <!ATTLIST xsl:with-param
- *   name %qname; #REQUIRED
- *   select %expr; #IMPLIED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#element-with-param">element-with-param in XSLT Specification</a>
- */
-public class ElemWithParam extends ElemTemplateElement
-{
-  /**
-   * This is the index to the stack frame being called, <emph>not</emph> the 
-   * stack frame that contains this element.
-   */
-  int m_index;
-
-  /**
-   * The "select" attribute, which specifies the value of the
-   * argument, if element content is not specified.
-   * @serial
-   */
-  private XPath m_selectPattern = null;
-
-  /**
-   * Set the "select" attribute.
-   * The "select" attribute specifies the value of the
-   * argument, if element content is not specified.
-   *
-   * @param v Value to set for the "select" attribute. 
-   */
-  public void setSelect(XPath v)
-  {
-    m_selectPattern = v;
-  }
-
-  /**
-   * Get the "select" attribute.
-   * The "select" attribute specifies the value of the
-   * argument, if element content is not specified.
-   *
-   * @return Value of the "select" attribute. 
-   */
-  public XPath getSelect()
-  {
-    return m_selectPattern;
-  }
-
-  /**
-   * The required name attribute specifies the name of the
-   * parameter (the variable the value of whose binding is
-   * to be replaced). The value of the name attribute is a QName,
-   * which is expanded as described in [2.4 Qualified Names].
-   * @serial
-   */
-  private QName m_qname = null;
-  
-  int m_qnameID;
-
-  /**
-   * Set the "name" attribute.
-   * DJD
-   *
-   * @param v Value to set for the "name" attribute.
-   */
-  public void setName(QName v)
-  {
-    m_qname = v;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * DJD
-   *
-   * @return Value of the "name" attribute.
-   */
-  public QName getName()
-  {
-    return m_qname;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_WITHPARAM;
-  }
-
-
-  /**
-   * Return the node name.
-   *
-   * @return the node name.
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_WITHPARAM_STRING;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-    // See if we can reduce an RTF to a select with a string expression.
-    if(null == m_selectPattern  
-       && org.apache.xalan.processor.TransformerFactoryImpl.m_optimize)
-    {
-      XPath newSelect = ElemVariable.rewriteChildToExpression(this);
-      if(null != newSelect)
-        m_selectPattern = newSelect;
-    }
-    m_qnameID = sroot.getComposeState().getQNameID(m_qname);
-    super.compose(sroot);
-    
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-    if(null != m_selectPattern)
-      m_selectPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-      
-    // m_index must be resolved by ElemApplyTemplates and ElemCallTemplate!
-  }
-  
-  /**
-   * Set the parent as an ElemTemplateElement.
-   *
-   * @param parent This node's parent as an ElemTemplateElement
-   */
-  public void setParentElem(ElemTemplateElement p)
-  {
-    super.setParentElem(p);
-    p.m_hasVariableDecl = true;
-  }
-  
-  /**
-   * Get the XObject representation of the variable.
-   *
-   * @param transformer non-null reference to the the current transform-time state.
-   * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
-   *
-   * @return the XObject representation of the variable.
-   *
-   * @throws TransformerException
-   */
-  public XObject getValue(TransformerImpl transformer, int sourceNode)
-          throws TransformerException
-  {
-
-    XObject var;
-    XPathContext xctxt = transformer.getXPathContext();
-
-    xctxt.pushCurrentNode(sourceNode);
-
-    try
-    {
-      if (null != m_selectPattern)
-      {
-        var = m_selectPattern.execute(xctxt, sourceNode, this);
-
-        var.allowDetachToRelease(false);
-
-        if (TransformerImpl.S_DEBUG)
-          transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
-                  "select", m_selectPattern, var);
-      }
-      else if (null == getFirstChildElem())
-      {
-        var = XString.EMPTYSTRING;
-      }
-      else
-      {
-
-        // Use result tree fragment
-        int df = transformer.transformToRTF(this);
-
-        var = new XRTreeFrag(df, xctxt);
-      }
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-    }
-
-    return var;
-  }
-
-
-}
diff --git a/src/org/apache/xalan/templates/FuncDocument.java b/src/org/apache/xalan/templates/FuncDocument.java
deleted file mode 100644
index 14a551b..0000000
--- a/src/org/apache/xalan/templates/FuncDocument.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-
-import java.io.StringWriter;
-import java.io.PrintWriter;
-import java.io.IOException;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMManager;
-
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.functions.Function;
-import org.apache.xpath.functions.Function2Args;
-import org.apache.xpath.functions.WrongNumberArgsException;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.SourceTreeManager;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.XPathContext;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
-
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Doc() function.
- *
- * When the document function has exactly one argument and the argument
- * is a node-set, then the result is the union, for each node in the
- * argument node-set, of the result of calling the document function with
- * the first argument being the string-value of the node, and the second
- * argument being a node-set with the node as its only member. When the
- * document function has two arguments and the first argument is a node-set,
- * then the result is the union, for each node in the argument node-set,
- * of the result of calling the document function with the first argument
- * being the string-value of the node, and with the second argument being
- * the second argument passed to the document function.
- */
-public class FuncDocument extends Function2Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    int context = xctxt.getCurrentNode();
-    DTM dtm = xctxt.getDTM(context);
-    
-    int docContext = dtm.getDocument();
-    XObject arg = (XObject) this.getArg0().execute(xctxt);
-
-    String base = "";
-    Expression arg1Expr = this.getArg1();
-
-    if (null != arg1Expr)
-    {
-
-      // The URI reference may be relative. The base URI (see [3.2 Base URI]) 
-      // of the node in the second argument node-set that is first in document 
-      // order is used as the base URI for resolving the 
-      // relative URI into an absolute URI. 
-      XObject arg2 = arg1Expr.execute(xctxt);
-
-      if (XObject.CLASS_NODESET == arg2.getType())
-      {
-        int baseNode = arg2.iter().nextNode();
-
-        if (baseNode == DTM.NULL)
-          warn(xctxt, XSLTErrorResources.WG_EMPTY_SECOND_ARG, null);
-        
-        DTM baseDTM = xctxt.getDTM(baseNode);
-        base = baseDTM.getDocumentBaseURI();
-
-        // %REVIEW% This doesn't seem to be a problem with the conformance
-        // suite, but maybe it's just not doing a good test?
-//        int baseDoc = baseDTM.getDocument();
-//
-//        if (baseDoc == DTM.NULL /* || baseDoc instanceof Stylesheet  -->What to do?? */)
-//        {
-//
-//          // base = ((Stylesheet)baseDoc).getBaseIdentifier();
-//          base = xctxt.getNamespaceContext().getBaseIdentifier();
-//        }
-//        else
-//          base = xctxt.getSourceTreeManager().findURIFromDoc(baseDoc);
-      }
-      else
-      {
-        base = arg2.str();
-      }
-    }
-    else
-    {
-
-      // If the second argument is omitted, then it defaults to 
-      // the node in the stylesheet that contains the expression that 
-      // includes the call to the document function. Note that a 
-      // zero-length URI reference is a reference to the document 
-      // relative to which the URI reference is being resolved; thus 
-      // document("") refers to the root node of the stylesheet; 
-      // the tree representation of the stylesheet is exactly 
-      // the same as if the XML document containing the stylesheet 
-      // was the initial source document.
-      base = xctxt.getNamespaceContext().getBaseIdentifier();
-    }
-
-    XNodeSet nodes = new XNodeSet(xctxt.getDTMManager());
-    NodeSetDTM mnl = nodes.mutableNodeset();
-    DTMIterator iterator = (XObject.CLASS_NODESET == arg.getType())
-                            ? arg.iter() : null;
-    int pos = DTM.NULL;
-
-    while ((null == iterator) || (DTM.NULL != (pos = iterator.nextNode())))
-    {
-      XMLString ref = (null != iterator)
-                   ? xctxt.getDTM(pos).getStringValue(pos) : arg.xstr();
-      
-      // The first and only argument was a nodeset, the base in that
-      // case is the base URI of the node from the first argument nodeset. 
-      // Remember, when the document function has exactly one argument and
-      // the argument is a node-set, then the result is the union, for each
-      // node in the argument node-set, of the result of calling the document
-      // function with the first argument being the string-value of the node,
-      // and the second argument being a node-set with the node as its only 
-      // member.
-      if (null == arg1Expr && DTM.NULL != pos)
-      {
-        DTM baseDTM = xctxt.getDTM(pos);
-        base = baseDTM.getDocumentBaseURI();
-      }
-
-      if (null == ref)
-        continue;
-
-      if (DTM.NULL == docContext)
-      {
-        error(xctxt, XSLTErrorResources.ER_NO_CONTEXT_OWNERDOC, null);  //"context does not have an owner document!");
-      }
-
-      // From http://www.ics.uci.edu/pub/ietf/uri/rfc1630.txt
-      // A partial form can be distinguished from an absolute form in that the
-      // latter must have a colon and that colon must occur before any slash
-      // characters. Systems not requiring partial forms should not use any
-      // unencoded slashes in their naming schemes.  If they do, absolute URIs
-      // will still work, but confusion may result.
-      int indexOfColon = ref.indexOf(':');
-      int indexOfSlash = ref.indexOf('/');
-
-      if ((indexOfColon != -1) && (indexOfSlash != -1)
-              && (indexOfColon < indexOfSlash))
-      {
-
-        // The url (or filename, for that matter) is absolute.
-        base = null;
-      }
-
-      int newDoc = getDoc(xctxt, context, ref.toString(), base);
-
-      // nodes.mutableNodeset().addNode(newDoc);  
-      if (DTM.NULL != newDoc)
-      {
-        // TODO: mnl.addNodeInDocOrder(newDoc, true, xctxt); ??
-        if (!mnl.contains(newDoc))
-        {
-          mnl.addElement(newDoc);
-        }
-      }
-
-      if (null == iterator || newDoc == DTM.NULL)
-        break;
-    }
-
-    return nodes;
-  }
-
-  /**
-   * Get the document from the given URI and base
-   *
-   * @param xctxt The XPath runtime state.
-   * @param context The current context node
-   * @param uri Relative(?) URI of the document
-   * @param base Base to resolve relative URI from.
-   *
-   * @return The document Node pointing to the document at the given URI
-   * or null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  int getDoc(XPathContext xctxt, int context, String uri, String base)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // System.out.println("base: "+base+", uri: "+uri);
-    SourceTreeManager treeMgr = xctxt.getSourceTreeManager();
-    Source source;
-   
-    int newDoc;
-    try
-    {
-      source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator());
-      newDoc = treeMgr.getNode(source);
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerException(ioe.getMessage(), 
-        (SourceLocator)xctxt.getSAXLocator(), ioe);
-    }
-    catch(TransformerException te)
-    {
-      throw new TransformerException(te);
-    }
-
-    if (DTM.NULL != newDoc)
-      return newDoc;
-
-    // If the uri length is zero, get the uri of the stylesheet.
-    if (uri.length() == 0)
-    {
-      // Hmmm... this seems pretty bogus to me... -sb
-      uri = xctxt.getNamespaceContext().getBaseIdentifier();
-      try
-      {
-        source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator());
-      }
-      catch (IOException ioe)
-      {
-        throw new TransformerException(ioe.getMessage(), 
-          (SourceLocator)xctxt.getSAXLocator(), ioe);
-      }
-    }
-
-    String diagnosticsString = null;
-
-    try
-    {
-      if ((null != uri) && (uri.toString().length() > 0))
-      {
-        newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt);
-
-        // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName());
-      }
-      else
-        warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM,
-             new Object[]{ ((base == null) ? "" : base) + uri });  //"Can not make URL from: "+((base == null) ? "" : base )+uri);
-    }
-    catch (Throwable throwable)
-    {
-
-      // throwable.printStackTrace();
-      newDoc = DTM.NULL;
-
-      // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri);
-      while (throwable
-             instanceof org.apache.xml.utils.WrappedRuntimeException)
-      {
-        throwable =
-          ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException();
-      }
-
-      if ((throwable instanceof NullPointerException)
-              || (throwable instanceof ClassCastException))
-      {
-        throw new org.apache.xml.utils.WrappedRuntimeException(
-          (Exception) throwable);
-      }
-
-      StringWriter sw = new StringWriter();
-      PrintWriter diagnosticsWriter = new PrintWriter(sw);
-
-      if (throwable instanceof TransformerException)
-      {
-        TransformerException spe = (TransformerException) throwable;
-
-        {
-          Throwable e = spe;
-
-          while (null != e)
-          {
-            if (null != e.getMessage())
-            {
-              diagnosticsWriter.println(" (" + e.getClass().getName() + "): "
-                                        + e.getMessage());
-            }
-
-            if (e instanceof TransformerException)
-            {
-              TransformerException spe2 = (TransformerException) e;
-
-              SourceLocator locator = spe2.getLocator();
-              if ((null != locator) && (null != locator.getSystemId()))
-                diagnosticsWriter.println("   ID: " + locator.getSystemId()
-                                          + " Line #" + locator.getLineNumber()
-                                          + " Column #"
-                                          + locator.getColumnNumber());
-
-              e = spe2.getException();
-
-              if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
-                e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException();
-            }
-            else
-              e = null;
-          }
-        }
-      }
-      else
-      {
-        diagnosticsWriter.println(" (" + throwable.getClass().getName()
-                                  + "): " + throwable.getMessage());
-      }
-
-      diagnosticsString = throwable.getMessage(); //sw.toString();
-    }
-
-    if (DTM.NULL == newDoc)
-    {
-
-      // System.out.println("what?: "+base+", uri: "+uri);
-      if (null != diagnosticsString)
-      {
-        warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC,
-             new Object[]{ diagnosticsString });  //"Can not load requested doc: "+((base == null) ? "" : base )+uri);
-      }
-      else
-        warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC,
-             new Object[]{
-               uri == null
-               ? ((base == null) ? "" : base) + uri : uri.toString() });  //"Can not load requested doc: "+((base == null) ? "" : base )+uri);
-    }
-    else
-    {
-      // %REVIEW%
-      // TBD: What to do about XLocator?
-      // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null);
-    }
-
-    return newDoc;
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param xctxt The XPath runtime state.
-   * @param msg The error message code
-   * @param args Arguments to be used in the error message
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void error(XPathContext xctxt, int msg, Object args[])
-          throws javax.xml.transform.TransformerException
-  {
-
-    String formattedMsg = XSLMessages.createMessage(msg, args);
-    ErrorListener errHandler = xctxt.getErrorListener();
-    TransformerException spe = new TransformerException(formattedMsg,
-                              (SourceLocator)xctxt.getSAXLocator());
-
-    if (null != errHandler)
-      errHandler.error(spe);
-    else
-      System.out.println(formattedMsg);
-  }
-
-  /**
-   * Warn the user of a problem.
-   *
-   * @param xctxt The XPath runtime state.
-   * @param msg Warning message code
-   * @param args Arguments to be used in the warning message
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void warn(XPathContext xctxt, int msg, Object args[])
-          throws javax.xml.transform.TransformerException
-  {
-
-    String formattedMsg = XSLMessages.createWarning(msg, args);
-    ErrorListener errHandler = xctxt.getErrorListener();
-    TransformerException spe = new TransformerException(formattedMsg,
-                              (SourceLocator)xctxt.getSAXLocator());
-
-    if (null != errHandler)
-      errHandler.warning(spe);
-    else
-      System.out.println(formattedMsg);
-  }
-
- /**
-   * Overide the superclass method to allow one or two arguments.
-   *
-   *
-   * @param argNum Number of arguments passed in to this function
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if ((argNum < 1) || (argNum > 2))
-      throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_ONE_OR_TWO, null)); //"1 or 2");
-  }
-  
-  /**
-   * Tell if the expression is a nodeset expression.  In other words, tell 
-   * if you can execute {@link asNode() asNode} without an exception.
-   * @return true if the expression can be represented as a nodeset.
-   */
-  public boolean isNodesetExpr()
-  {
-    return true;
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/FuncFormatNumb.java b/src/org/apache/xalan/templates/FuncFormatNumb.java
deleted file mode 100644
index b1df0c9..0000000
--- a/src/org/apache/xalan/templates/FuncFormatNumb.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-
-import org.apache.xml.utils.QName;
-import org.apache.xpath.functions.Function;
-import org.apache.xpath.functions.Function3Args;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.XPath;
-import org.apache.xpath.Expression;
-import org.apache.xpath.functions.WrongNumberArgsException;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import org.w3c.dom.Node;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.ErrorListener;
-import org.apache.xml.utils.SAXSourceLocator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the FormatNumber() function.
- */
-public class FuncFormatNumb extends Function3Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    // A bit of an ugly hack to get our context.
-    ElemTemplateElement templElem =
-      (ElemTemplateElement) xctxt.getNamespaceContext();
-    StylesheetRoot ss = templElem.getStylesheetRoot();
-    java.text.DecimalFormat formatter = null;
-    java.text.DecimalFormatSymbols dfs = null;
-    double num = getArg0().execute(xctxt).num();
-    String patternStr = getArg1().execute(xctxt).str();
-
-    // TODO: what should be the behavior here??
-    if (patternStr.indexOf(0x00A4) > 0)
-      ss.error(XSLTErrorResources.ER_CURRENCY_SIGN_ILLEGAL);  // currency sign not allowed
-
-    // this third argument is not a locale name. It is the name of a
-    // decimal-format declared in the stylesheet!(xsl:decimal-format
-    try
-    {
-      Expression arg2Expr = getArg2();
-
-      if (null != arg2Expr)
-      {
-        String dfName = arg2Expr.execute(xctxt).str();
-        QName qname = new QName(dfName, xctxt.getNamespaceContext());
-
-        dfs = ss.getDecimalFormatComposed(qname);
-
-        if (null == dfs)
-        {
-          warn(xctxt, XSLTErrorResources.WG_NO_DECIMALFORMAT_DECLARATION,
-               new Object[]{ dfName });  //"not found!!!
-
-          //formatter = new java.text.DecimalFormat(patternStr);
-        }
-        else
-        {
-
-          //formatter = new java.text.DecimalFormat(patternStr, dfs);
-          formatter = new java.text.DecimalFormat();
-
-          formatter.setDecimalFormatSymbols(dfs);
-          formatter.applyLocalizedPattern(patternStr);
-        }
-      }
-
-      //else
-      if (null == formatter)
-      {
-
-        // look for a possible default decimal-format
-        if (ss.getDecimalFormatCount() > 0)
-          dfs = ss.getDecimalFormatComposed(new QName(""));
-
-        if (dfs != null)
-        {
-          formatter = new java.text.DecimalFormat();
-
-          formatter.setDecimalFormatSymbols(dfs);
-          formatter.applyLocalizedPattern(patternStr);
-        }
-        else
-        {
-          dfs = new java.text.DecimalFormatSymbols(java.util.Locale.US);
-
-          dfs.setInfinity(Constants.ATTRVAL_INFINITY);
-          dfs.setNaN(Constants.ATTRVAL_NAN);
-
-          formatter = new java.text.DecimalFormat();
-
-          formatter.setDecimalFormatSymbols(dfs);
-
-          if (null != patternStr)
-            formatter.applyLocalizedPattern(patternStr);
-        }
-      }
-
-      return new XString(formatter.format(num));
-    }
-    catch (Exception iae)
-    {
-      templElem.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING,
-                      new Object[]{ patternStr });
-
-      return XString.EMPTYSTRING;
-
-      //throw new XSLProcessorException(iae);
-    }
-  }
-
-  /**
-   * Warn the user of a problem.
-   *
-   * @param xctxt The XPath runtime state.
-   * @param msg Warning message code
-   * @param args Arguments to be used in warning message
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void warn(XPathContext xctxt, int msg, Object args[])
-          throws javax.xml.transform.TransformerException
-  {
-
-    String formattedMsg = XSLMessages.createWarning(msg, args);
-    ErrorListener errHandler = xctxt.getErrorListener();
-
-    errHandler.warning(new TransformerException(formattedMsg,
-                                             (SAXSourceLocator)xctxt.getSAXLocator()));
-  }
-
-  /**
-   * Overide the superclass method to allow one or two arguments. 
-   *
-   *
-   * @param argNum Number of arguments passed in
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if ((argNum > 3) || (argNum < 2))
-      throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3");
-  }
-}
diff --git a/src/org/apache/xalan/templates/FuncKey.java b/src/org/apache/xalan/templates/FuncKey.java
deleted file mode 100644
index 4becc12..0000000
--- a/src/org/apache/xalan/templates/FuncKey.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-import java.util.Hashtable;
-
-import org.apache.xpath.functions.Function;
-import org.apache.xpath.functions.Function2Args;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xpath.axes.UnionPathIterator;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.KeyManager;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.XPathContext;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Key() function.
- */
-public class FuncKey extends Function2Args
-{
-
-  /** Dummy value to be used in usedrefs hashtable           */
-  static private Boolean ISTRUE = new Boolean(true);
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    // TransformerImpl transformer = (TransformerImpl)xctxt;
-    TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject();
-    XNodeSet nodes = null;
-    int context = xctxt.getCurrentNode();
-    DTM dtm = xctxt.getDTM(context);
-    int docContext = dtm.getDocument();
-
-    if (DTM.NULL == docContext)
-    {
-
-      // path.error(context, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC); //"context does not have an owner document!");
-    }
-
-    String xkeyname = getArg0().execute(xctxt).str();
-    QName keyname = new QName(xkeyname, xctxt.getNamespaceContext());
-    XObject arg = getArg1().execute(xctxt);
-    boolean argIsNodeSetDTM = (XObject.CLASS_NODESET == arg.getType());
-    KeyManager kmgr = transformer.getKeyManager();
-
-    if (argIsNodeSetDTM)
-    {
-      Hashtable usedrefs = null;
-      DTMIterator ni = arg.iter();
-      int pos;
-      UnionPathIterator upi = new UnionPathIterator();
-
-      while (DTM.NULL != (pos = ni.nextNode()))
-      {
-        dtm = xctxt.getDTM(pos);
-        XMLString ref = dtm.getStringValue(pos);
-
-        if (null == ref)
-          continue;
-
-        if (null == usedrefs)
-          usedrefs = new Hashtable();
-
-        if (usedrefs.get(ref) != null)
-        {
-          continue;  // We already have 'em.
-        }
-        else
-        {
-
-          // ISTRUE being used as a dummy value.
-          usedrefs.put(ref, ISTRUE);
-        }
-
-        LocPathIterator nl =
-          kmgr.getNodeSetDTMByKey(xctxt, docContext, keyname, ref,
-                               xctxt.getNamespaceContext());
-
-//        try
-//        {
-          upi.addIterator((LocPathIterator)nl.asIterator(xctxt, docContext));
-//        }
-//        catch(CloneNotSupportedException cnse)
-//        {
-//          // will never happen.
-//        }
-        //mnodeset.addNodesInDocOrder(nl, xctxt); needed??
-      }
-
-      int current = xctxt.getCurrentNode();
-      upi.setRoot(current, xctxt);
-
-      nodes = new XNodeSet(upi);
-    }
-    else
-    {
-      XMLString ref = arg.xstr();
-      LocPathIterator nl = kmgr.getNodeSetDTMByKey(xctxt, docContext, keyname,
-                                                ref,
-                                                xctxt.getNamespaceContext());
-
-      try
-      {
-        nodes = new XNodeSet((LocPathIterator)nl.cloneWithReset());
-      }
-      catch(CloneNotSupportedException cnse)
-      {
-        // will never happen.
-      }
-    }
-
-    return nodes;
-  }
-}
diff --git a/src/org/apache/xalan/templates/KeyDeclaration.java b/src/org/apache/xalan/templates/KeyDeclaration.java
deleted file mode 100644
index 8c29f35..0000000
--- a/src/org/apache/xalan/templates/KeyDeclaration.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xpath.XPath;
-import org.apache.xml.utils.QName;
-
-/**
- * <meta name="usage" content="internal"/>
- * Holds the attribute declarations for the xsl:keys element.
- * A stylesheet declares a set of keys for each document using
- * the xsl:key element. When this set of keys contains a member
- * with node x, name y and value z, we say that node x has a key
- * with name y and value z.
- * @see <a href="http://www.w3.org/TR/xslt#key">key in XSLT Specification</a>
- */
-public class KeyDeclaration extends ElemTemplateElement
-{
-
-  /**
-   * Constructs a new element representing the xsl:key.  The parameters
-   * are needed to prioritize this key element as part of the recomposing
-   * process.  For this element, they are not automatically created
-   * because the element is never added on to the stylesheet parent.
-   */
-  public KeyDeclaration(Stylesheet parentNode, int docOrderNumber)
-  {
-    m_parentNode = parentNode;
-    setUid(docOrderNumber);
-  }
-
-  /**
-   * The "name" property.
-   * @serial
-   */
-  private QName m_name;
-
-  /**
-   * Set the "name" attribute.
-   * The name attribute specifies the name of the key. The value
-   * of the name attribute is a QName, which is expanded as
-   * described in [2.4 Qualified Names].
-   *
-   * @param name Value to set for the "name" attribute.
-   */
-  public void setName(QName name)
-  {
-    m_name = name;
-  }
-
-  /**
-   * Get the "name" attribute.
-   * The name attribute specifies the name of the key. The value
-   * of the name attribute is a QName, which is expanded as
-   * described in [2.4 Qualified Names].
-   *
-   * @return Value of the "name" attribute.
-   */
-  public QName getName()
-  {
-    return m_name;
-  }
-
-  /**
-   * The "match" attribute.
-   * @serial
-   */
-  private XPath m_matchPattern = null;
-
-  /**
-   * Set the "match" attribute.
-   * The match attribute is a Pattern; an xsl:key element gives
-   * information about the keys of any node that matches the
-   * pattern specified in the match attribute.
-   * @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a>
-   *
-   * @param v Value to set for the "match" attribute.
-   */
-  public void setMatch(XPath v)
-  {
-    m_matchPattern = v;
-  }
-
-  /**
-   * Get the "match" attribute.
-   * The match attribute is a Pattern; an xsl:key element gives
-   * information about the keys of any node that matches the
-   * pattern specified in the match attribute.
-   * @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a>
-   *
-   * @return Value of the "match" attribute.
-   */
-  public XPath getMatch()
-  {
-    return m_matchPattern;
-  }
-
-  /**
-   * The "use" attribute.
-   * @serial
-   */
-  private XPath m_use;
-
-  /**
-   * Set the "use" attribute.
-   * The use attribute is an expression specifying the values
-   * of the key; the expression is evaluated once for each node
-   * that matches the pattern.
-   *
-   * @param v Value to set for the "use" attribute.
-   */
-  public void setUse(XPath v)
-  {
-    m_use = v;
-  }
-
-  /**
-   * Get the "use" attribute.
-   * The use attribute is an expression specifying the values
-   * of the key; the expression is evaluated once for each node
-   * that matches the pattern.
-   *
-   * @return Value of the "use" attribute.
-   */
-  public XPath getUse()
-  {
-    return m_use;
-  }
-  
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) 
-    throws javax.xml.transform.TransformerException
-  {
-    super.compose(sroot);
-    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
-    if(null != m_matchPattern)
-      m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-    if(null != m_use)
-      m_use.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
-  }
-
-  /**
-   * This function is called during recomposition to
-   * control how this element is composed.
-   * @param root The root stylesheet for this transformation.
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeKeys(this);
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/NamespaceAlias.java b/src/org/apache/xalan/templates/NamespaceAlias.java
deleted file mode 100644
index bcc7dfe..0000000
--- a/src/org/apache/xalan/templates/NamespaceAlias.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-/**
- * Object to hold an xsl:namespace element.
- * A stylesheet can use the xsl:namespace-alias element to declare
- * that one namespace URI is an alias for another namespace URI.
- * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
- */
-public class NamespaceAlias extends ElemTemplateElement
-{
-  
-  /**
-   * Constructor NamespaceAlias
-   * 
-   * @param docOrderNumber The document order number
-   *
-   */
-  public NamespaceAlias(int docOrderNumber)
-  {
-    super();
-    m_docOrderNumber = docOrderNumber;
-  }
-
-  /**
-   * The "stylesheet-prefix" attribute.
-   * @serial
-   */
-  private String m_StylesheetPrefix;
-
-  /**
-   * Set the "stylesheet-prefix" attribute.
-   *
-   * @param v non-null prefix value.
-   */
-  public void setStylesheetPrefix(String v)
-  {
-    m_StylesheetPrefix = v;
-  }
-
-  /**
-   * Get the "stylesheet-prefix" attribute.
-   *
-   * @return non-null prefix value.
-   */
-  public String getStylesheetPrefix()
-  {
-    return m_StylesheetPrefix;
-  }
-  
-  /**
-   * The namespace in the stylesheet space.
-   * @serial
-   */
-  private String m_StylesheetNamespace;
-
-  /**
-   * Set the value for the stylesheet namespace.
-   *
-   * @param v non-null prefix value.
-   */
-  public void setStylesheetNamespace(String v)
-  {
-    m_StylesheetNamespace = v;
-  }
-
-  /**
-   * Get the value for the stylesheet namespace.
-   *
-   * @return non-null prefix value.
-   */
-  public String getStylesheetNamespace()
-  {
-    return m_StylesheetNamespace;
-  }
-
-  /**
-   * The "result-prefix" attribute.
-   * @serial
-   */
-  private String m_ResultPrefix;
-
-  /**
-   * Set the "result-prefix" attribute.
-   *
-   * @param v non-null prefix value.
-   */
-  public void setResultPrefix(String v)
-  {
-    m_ResultPrefix = v;
-  }
-
-  /**
-   * Get the "result-prefix" attribute.
-   *
-   * @return non-null prefix value.
-   */
-  public String getResultPrefix()
-  {
-    return m_ResultPrefix;
-  }
-  
-  /**
-   * The result namespace.
-   * @serial
-   */
-  private String m_ResultNamespace;
-
-  /**
-   * Set the result namespace.
-   *
-   * @param v non-null namespace value
-   */
-  public void setResultNamespace(String v)
-  {
-    m_ResultNamespace = v;
-  }
-
-  /**
-   * Get the result namespace value.
-   *
-   * @return non-null namespace value.
-   */
-  public String getResultNamespace()
-  {
-    return m_ResultNamespace;
-  }
-
-  /**
-   * This function is called to recompose() all of the namespace alias properties elements.
-   * 
-   * @param root The owning root stylesheet
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeNamespaceAliases(this);
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/OutputProperties.java b/src/org/apache/xalan/templates/OutputProperties.java
deleted file mode 100644
index 40587b3..0000000
--- a/src/org/apache/xalan/templates/OutputProperties.java
+++ /dev/null
@@ -1,1082 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.Enumeration;
-
-import java.lang.Cloneable;
-
-import org.w3c.dom.Document;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xml.utils.WrappedRuntimeException;
-import org.apache.xalan.serialize.Method;
-import org.apache.xalan.extensions.ExtensionHandler;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.OutputKeys;
-
-/**
- * This class provides information from xsl:output elements. It is mainly
- * a wrapper for {@link java.util.Properties}, but can not extend that class
- * because it must be part of the {@link org.apache.xalan.templates.ElemTemplateElement}
- * heararchy.
- * <p>An OutputProperties list can contain another OutputProperties list as
- * its "defaults"; this second property list is searched if the property key
- * is not found in the original property list.</p>
- * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
- * @see <a href="http://www.w3.org/TR/xslt#output">xsl:output in XSLT Specification</a>
- * @
- */
-public class OutputProperties extends ElemTemplateElement
-        implements Cloneable
-{
-
-  /**
-   * Creates an empty OutputProperties with no default values.
-   */
-  public OutputProperties()
-  {
-    this(Method.XML);
-  }
-
-  /**
-   * Creates an empty OutputProperties with the specified defaults.
-   *
-   * @param   defaults   the defaults.
-   */
-  public OutputProperties(Properties defaults)
-  {
-    m_properties = new Properties(defaults);
-  }
-
-  /**
-   * Creates an empty OutputProperties with the defaults specified by
-   * a property file.  The method argument is used to construct a string of
-   * the form output_[method].properties (for instance, output_html.properties).
-   * The output_xml.properties file is always used as the base.
-   * <p>At the moment, anything other than 'text', 'xml', and 'html', will
-   * use the output_xml.properties file.</p>
-   *
-   * @param   method non-null reference to method name.
-   */
-  public OutputProperties(String method)
-  {
-    m_properties = new Properties(getDefaultMethodProperties(method));
-  }
-  
-  static final String S_XSLT_PREFIX = "xslt.output.";
-  static final int S_XSLT_PREFIX_LEN = S_XSLT_PREFIX.length();
-  static final String S_XALAN_PREFIX = "org.apache.xslt.";
-  static final int S_XALAN_PREFIX_LEN = S_XALAN_PREFIX.length();
-  
-  /** Built-in extensions namespace, reexpressed in {namespaceURI} syntax
-   * suitable for prepending to a localname to produce a "universal
-   * name".
-   */
-  static final String S_BUILTIN_EXTENSIONS_UNIVERSAL=
-        "{"+Constants.S_BUILTIN_EXTENSIONS_URL+"}";
-  
-  /**
-   * Fix up a string in an output properties file according to 
-   * the rules of {@link #loadPropertiesFile}.
-   * 
-   * @param s non-null reference to string that may need to be fixed up.
-   * @return A new string if fixup occured, otherwise the s argument.
-   */
-  static private String fixupPropertyString(String s, boolean doClipping)
-  {
-    int index;
-    if (doClipping && s.startsWith(S_XSLT_PREFIX))
-    {
-      s = s.substring(S_XSLT_PREFIX_LEN);
-    }
-    if (s.startsWith(S_XALAN_PREFIX))
-    {
-      s = S_BUILTIN_EXTENSIONS_UNIVERSAL + s.substring(S_XALAN_PREFIX_LEN);
-    }
-    if ((index = s.indexOf("\\u003a")) > 0)
-    {
-      String temp = s.substring(index+6);
-      s = s.substring(0, index) + ":" + temp;
-
-    }
-    return s;
-  }
-  
-  /**
-   * Load the properties file from a resource stream.  If a 
-   * key name such as "org.apache.xslt.xxx", fix up the start of 
-   * string to be a curly namespace.  If a key name starts with 
-   * "xslt.output.xxx", clip off "xslt.output.".  If a key name *or* a 
-   * key value is discovered, check for \u003a in the text, and 
-   * fix it up to be ":", since earlier versions of the JDK do not 
-   * handle the escape sequence (at least in key names).
-   * 
-   * @param resourceName non-null reference to resource name.
-   * @param defaults Default properties, which may be null.
-   */
-  static private Properties loadPropertiesFile(String resourceName, Properties defaults)
-    throws IOException
-  {
-
-    // This static method should eventually be moved to a thread-specific class
-    // so that we can cache the ContextClassLoader and bottleneck all properties file
-    // loading throughout Xalan.
-
-    Properties props = new Properties(defaults);
-
-    InputStream is = null;
-    BufferedInputStream bis = null;
-
-    try {
-      try {
-        java.lang.reflect.Method getCCL = Thread.class.getMethod("getContextClassLoader", NO_CLASSES);
-        if (getCCL != null) {
-          ClassLoader contextClassLoader = (ClassLoader) getCCL.invoke(Thread.currentThread(), NO_OBJS);
-          is = contextClassLoader.getResourceAsStream("org/apache/xalan/templates/" + resourceName);
-        }
-      }
-      catch (Exception e) {}
-
-      if ( is == null ) {
-        is = OutputProperties.class.getResourceAsStream(resourceName);
-      }
-      
-      bis = new BufferedInputStream(is);
-      props.load(bis);
-    } 
-    catch (IOException ioe) {
-      if ( defaults == null ) {
-        throw ioe;
-      }
-      else {
-        throw new WrappedRuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_LOAD_RESOURCE, new Object[]{resourceName}), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe);
-      }
-    }
-    catch (SecurityException se) {
-      // Repeat IOException handling for sandbox/applet case -sc
-      if ( defaults == null ) {
-        throw se;
-      }
-      else {
-        throw new WrappedRuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_LOAD_RESOURCE, new Object[]{resourceName}), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se);
-      }
-    } 
-    finally {
-      if ( bis != null ) {
-        bis.close();
-      }
-      if (is != null ) {
-        is.close();
-      }
-    }
-    
-    // Note that we're working at the HashTable level here, 
-    // and not at the Properties level!  This is important 
-    // because we don't want to modify the default properties.
-    // NB: If fixupPropertyString ends up changing the property
-    // name or value, we need to remove the old key and re-add
-    // with the new key and value.  However, then our Enumeration
-    // could lose its place in the HashTable.  So, we first
-    // clone the HashTable and enumerate over that since the
-    // clone will not change.  When we migrate to Collections,
-    // this code should be revisited and cleaned up to use
-    // an Iterator which may (or may not) alleviate the need for
-    // the clone.  Many thanks to Padraig O'hIceadha
-    // <padraig@gradient.ie> for finding this problem.  Bugzilla 2000.
-
-    Enumeration keys = ((Properties) props.clone()).keys();
-    while(keys.hasMoreElements())
-    {
-      String key = (String)keys.nextElement();
-      // Now check if the given key was specified as a 
-      // System property. If so, the system property 
-      // overides the default value in the propery file.
-      String value = null;
-      try {
-        value = System.getProperty(key);
-      }
-      catch (SecurityException se) {
-        // No-op for sandbox/applet case, leave null -sc
-      }
-      if (value == null)      
-        value = (String)props.get(key);                       
-      
-      String newKey = fixupPropertyString(key, true);
-      String newValue = null;
-      try {
-        newValue = System.getProperty(newKey);
-      }
-      catch (SecurityException se) {
-        // No-op for sandbox/applet case, leave null -sc
-      }
-      if (newValue == null)
-        newValue = fixupPropertyString(value, false);
-      else
-        newValue = fixupPropertyString(newValue, false);
-       
-      if(key != newKey || value != newValue)
-      {
-        props.remove(key);
-        props.put(newKey, newValue);
-      }
-      
-    }
-    
-    return props;
-  }
-
-  /**
-   * Creates an empty OutputProperties with the defaults specified by
-   * a property file.  The method argument is used to construct a string of
-   * the form output_[method].properties (for instance, output_html.properties).
-   * The output_xml.properties file is always used as the base.
-   * <p>At the moment, anything other than 'text', 'xml', and 'html', will
-   * use the output_xml.properties file.</p>
-   *
-   * @param   method non-null reference to method name.
-   *
-   * @return Properties object that holds the defaults for the given method.
-   */
-  static public Properties getDefaultMethodProperties(String method)
-  {
-    String fileName = null;
-    Properties defaultProperties = null;
-    // According to this article : Double-check locking does not work
-    // http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-toolbox.html
-    try
-    {
-      synchronized (m_synch_object)
-      {
-        if (null == m_xml_properties)  // double check
-        {
-          fileName = "output_xml.properties";
-          m_xml_properties = loadPropertiesFile(fileName, null);
-        }
-      }
-
-      if (method.equals(Method.XML))
-      {
-        defaultProperties = m_xml_properties;
-      }
-      else if (method.equals(Method.HTML))
-      {
-            if (null == m_html_properties)  // double check
-            {
-              fileName = "output_html.properties";
-              m_html_properties = loadPropertiesFile(fileName,
-                                                     m_xml_properties);
-            }
-
-        defaultProperties = m_html_properties;
-      }
-      else if (method.equals(Method.Text))
-      {
-            if (null == m_text_properties)  // double check
-            {
-              fileName = "output_text.properties";
-              m_text_properties = loadPropertiesFile(fileName,
-                                                     m_xml_properties);
-              if(null == m_text_properties.getProperty(OutputKeys.ENCODING))
-              {
-                String mimeEncoding = org.apache.xalan.serialize.Encodings.getMimeEncoding(null);
-                m_text_properties.put(OutputKeys.ENCODING, mimeEncoding);
-              }
-            }
-
-        defaultProperties = m_text_properties;
-      }
-      else
-      {
-
-        // TODO: Calculate res file from name.
-        defaultProperties = m_xml_properties;
-      }
-    }
-    catch (IOException ioe)
-    {
-      throw new WrappedRuntimeException(
-            "Output method is "+method+" could not load "+fileName+" (check CLASSPATH)",
-             ioe);
-    }
-
-    return defaultProperties;
-  }
-
-  /**
-   * Clone this OutputProperties, including a clone of the wrapped Properties
-   * reference.
-   *
-   * @return A new OutputProperties reference, mutation of which should not
-   *         effect this object.
-   */
-  public Object clone()
-  {
-
-    try
-    {
-      OutputProperties cloned = (OutputProperties) super.clone();
-
-      cloned.m_properties = (Properties) cloned.m_properties.clone();
-
-      return cloned;
-    }
-    catch (CloneNotSupportedException e)
-    {
-      return null;
-    }
-  }
-
-  /**
-   * Set an output property.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setProperty(QName key, String value)
-  {
-    setProperty(key.toNamespacedString(), value);
-  }
-
-  /**
-   * Set an output property.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setProperty(String key, String value)
-  {
-    if(key.equals(OutputKeys.METHOD))
-    {
-      setMethodDefaults(value);
-    }
-    m_properties.put(key, value);
-  }
-
-  /**
-   * Searches for the property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list with the specified key value.
-   */
-  public String getProperty(QName key)
-  {
-    return m_properties.getProperty(key.toNamespacedString());
-  }
-
-  /**
-   * Searches for the property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list with the specified key value.
-   */
-  public String getProperty(String key)
-  {
-    return m_properties.getProperty(key);
-  }
-
-  /**
-   * Set an output property.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setBooleanProperty(QName key, boolean value)
-  {
-    m_properties.put(key.toNamespacedString(), value ? "yes" : "no");
-  }
-
-  /**
-   * Set an output property.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setBooleanProperty(String key, boolean value)
-  {
-    m_properties.put(key, value ? "yes" : "no");
-  }
-
-  /**
-   * Searches for the boolean property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>false</code> if the property is not found, or if the value is other
-   * than "yes".
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a boolean value, or false
-   * if null or not "yes".
-   */
-  public boolean getBooleanProperty(QName key)
-  {
-    return getBooleanProperty(key.toNamespacedString());
-  }
-
-  /**
-   * Searches for the boolean property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>false</code> if the property is not found, or if the value is other
-   * than "yes".
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a boolean value, or false
-   * if null or not "yes".
-   */
-  public boolean getBooleanProperty(String key)
-  {
-    return getBooleanProperty(key, m_properties);
-  }
-
-  /**
-   * Searches for the boolean property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>false</code> if the property is not found, or if the value is other
-   * than "yes".
-   *
-   * @param   key   the property key.
-   * @param   props   the list of properties that will be searched.
-   * @return  the value in this property list as a boolean value, or false
-   * if null or not "yes".
-   */
-  public static boolean getBooleanProperty(String key, Properties props)
-  {
-
-    String s = props.getProperty(key);
-
-    if (null == s ||!s.equals("yes"))
-      return false;
-    else
-      return true;
-  }
-  
-  /**
-   * Set an output property.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setIntProperty(QName key, int value)
-  {
-    setIntProperty(key.toNamespacedString(), value);
-  }
-
-  /**
-   * Set an output property.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setIntProperty(String key, int value)
-  {
-    m_properties.put(key, Integer.toString(value));
-  }
-
-  /**
-   * Searches for the int property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>false</code> if the property is not found, or if the value is other
-   * than "yes".
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a int value, or false
-   * if null or not a number.
-   */
-  public int getIntProperty(QName key)
-  {
-    return getIntProperty(key.toNamespacedString());
-  }
-
-  /**
-   * Searches for the int property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>false</code> if the property is not found, or if the value is other
-   * than "yes".
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a int value, or false
-   * if null or not a number.
-   */
-  public int getIntProperty(String key)
-  {
-    return getIntProperty(key, m_properties);
-  }
-
-  /**
-   * Searches for the int property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>false</code> if the property is not found, or if the value is other
-   * than "yes".
-   *
-   * @param   key   the property key.
-   * @param   props   the list of properties that will be searched.
-   * @return  the value in this property list as a int value, or 0
-   * if null or not a number.
-   */
-  public static int getIntProperty(String key, Properties props)
-  {
-
-    String s = props.getProperty(key);
-
-    if (null == s)
-      return 0;
-    else
-      return Integer.parseInt(s);
-  }
-
-  /**
-   * Set an output property with a QName value.  The QName will be turned
-   * into a string with the namespace in curly brackets.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setQNameProperty(QName key, QName value)
-  {
-    setQNameProperty(key.toNamespacedString(), value);
-  }
-  
-  /**
-   * Reset the default properties based on the method.
-   *
-   * @param method the method value.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setMethodDefaults(String method)
-  {
-    String defaultMethod = m_properties.getProperty(OutputKeys.METHOD);
-    if((null == defaultMethod) || !defaultMethod.equals(method))
-    {
-      Properties savedProps = m_properties;
-      Properties newDefaults = getDefaultMethodProperties(method);
-      m_properties = new Properties(newDefaults);
-      copyFrom(savedProps, false);
-    }
-  }
-  
-
-  /**
-   * Set an output property with a QName value.  The QName will be turned
-   * into a string with the namespace in curly brackets.
-   *
-   * @param key the key to be placed into the property list.
-   * @param value the value corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setQNameProperty(String key, QName value)
-  {
-    setProperty(key, value.toNamespacedString());
-  }
-
-  /**
-   * Searches for the qname property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a QName value, or false
-   * if null or not "yes".
-   */
-  public QName getQNameProperty(QName key)
-  {
-    return getQNameProperty(key.toNamespacedString());
-  }
-
-  /**
-   * Searches for the qname property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a QName value, or false
-   * if null or not "yes".
-   */
-  public QName getQNameProperty(String key)
-  {
-    return getQNameProperty(key, m_properties);
-  }
-
-  /**
-   * Searches for the qname property with the specified key in the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @param props the list of properties to search in.
-   * @return  the value in this property list as a QName value, or false
-   * if null or not "yes".
-   */
-  public static QName getQNameProperty(String key, Properties props)
-  {
-
-    String s = props.getProperty(key);
-
-    if (null != s)
-      return QName.getQNameFromString(s);
-    else
-      return null;
-  }
-
-  /**
-   * Set an output property with a QName list value.  The QNames will be turned
-   * into strings with the namespace in curly brackets.
-   *
-   * @param key the key to be placed into the property list.
-   * @param v non-null list of QNames corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setQNameProperties(QName key, Vector v)
-  {
-    setQNameProperties(key.toNamespacedString(), v);
-  }
-
-  /**
-   * Set an output property with a QName list value.  The QNames will be turned
-   * into strings with the namespace in curly brackets.
-   *
-   * @param key the key to be placed into the property list.
-   * @param v non-null list of QNames corresponding to <tt>key</tt>.
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setQNameProperties(String key, Vector v)
-  {
-
-    int s = v.size();
-
-    // Just an initial guess at reasonable tuning parameters
-    FastStringBuffer fsb = new FastStringBuffer(9,9);
-
-    for (int i = 0; i < s; i++)
-    {
-      QName qname = (QName) v.elementAt(i);
-
-      fsb.append(qname.toNamespacedString());
-      // Don't append space after last value
-      if (i < s-1) 
-        fsb.append(' ');
-    }
-
-    m_properties.put(key, fsb.toString());
-  }
-
-  /**
-   * Searches for the list of qname properties with the specified key in
-   * the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a vector of QNames, or false
-   * if null or not "yes".
-   */
-  public Vector getQNameProperties(QName key)
-  {
-    return getQNameProperties(key.toNamespacedString());
-  }
-
-  /**
-   * Searches for the list of qname properties with the specified key in
-   * the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @return  the value in this property list as a vector of QNames, or false
-   * if null or not "yes".
-   */
-  public Vector getQNameProperties(String key)
-  {
-    return getQNameProperties(key, m_properties);
-  }
-
-  /**
-   * Searches for the list of qname properties with the specified key in
-   * the property list.
-   * If the key is not found in this property list, the default property list,
-   * and its defaults, recursively, are then checked. The method returns
-   * <code>null</code> if the property is not found.
-   *
-   * @param   key   the property key.
-   * @param props the list of properties to search in.
-   * @return  the value in this property list as a vector of QNames, or false
-   * if null or not "yes".
-   */
-  public static Vector getQNameProperties(String key, Properties props)
-  {
-
-    String s = props.getProperty(key);
-
-    if (null != s)
-    {
-      Vector v = new Vector();
-      int l = s.length();
-      boolean inCurly = false;
-      FastStringBuffer buf = new FastStringBuffer();
-
-      // parse through string, breaking on whitespaces.  I do this instead 
-      // of a tokenizer so I can track whitespace inside of curly brackets, 
-      // which theoretically shouldn't happen if they contain legal URLs.
-      for (int i = 0; i < l; i++)
-      {
-        char c = s.charAt(i);
-
-        if (Character.isWhitespace(c))
-        {
-          if (!inCurly)
-          {
-            if (buf.length() > 0)
-            {
-              QName qname = QName.getQNameFromString(buf.toString());
-              v.addElement(qname);
-              buf.reset();
-            }
-            continue;
-          }
-        }
-        else if ('{' == c)
-          inCurly = true;
-        else if ('}' == c)
-          inCurly = false;
-
-        buf.append(c);
-      }
-
-      if (buf.length() > 0)
-      {
-        QName qname = QName.getQNameFromString(buf.toString());
-        v.addElement(qname);
-        buf.reset();
-      }
-
-      return v;
-    }
-    else
-      return null;
-  }
-
-  /**
-   * This function is called to recompose all of the output format extended elements.
-   *
-   * @param root non-null reference to the stylesheet root object.
-   */
-  public void recompose(StylesheetRoot root)
-    throws TransformerException
-  {
-    root.recomposeOutput(this);
-  }
-
-  /**
-   * This function is called after everything else has been
-   * recomposed, and allows the template to set remaining
-   * values that may be based on some other property that
-   * depends on recomposition.
-   */
-  public void compose(StylesheetRoot sroot) throws TransformerException
-  {
-
-    super.compose(sroot);
-
-    m_propertiesLevels = null;
-  }
-
-  /**
-   * Get the Properties object that this class wraps.
-   *
-   * @return non-null reference to Properties object.
-   */
-  public Properties getProperties()
-  {
-    return m_properties;
-  }
-  
-  /**
-   * Copy the keys and values from the source to this object.  This will
-   * not copy the default values.  This is meant to be used by going from
-   * a higher precedence object to a lower precedence object, so that if a
-   * key already exists, this method will not reset it.
-   *
-   * @param src non-null reference to the source properties.
-   */
-  public void copyFrom(Properties src)
-  {
-    copyFrom(src, true);
-  }
-
-  /**
-   * Copy the keys and values from the source to this object.  This will
-   * not copy the default values.  This is meant to be used by going from
-   * a higher precedence object to a lower precedence object, so that if a
-   * key already exists, this method will not reset it.
-   *
-   * @param src non-null reference to the source properties.
-   * @param shouldResetDefaults true if the defaults should be reset based on 
-   *                            the method property.
-   */
-  public void copyFrom(Properties src, boolean shouldResetDefaults)
-  {
-
-    Enumeration enum = src.keys();
-
-    while (enum.hasMoreElements())
-    {
-      String key = (String) enum.nextElement();
-      Object oldValue = m_properties.get(key);
-      if (null == oldValue)
-      {
-        String val = (String) src.get(key);
-        
-        if(shouldResetDefaults && key.equals(OutputKeys.METHOD))
-        {
-          setMethodDefaults(val);
-        }
-
-        m_properties.put(key, val);
-      }
-      else if (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS))
-      {
-        m_properties.put(key, (String) oldValue + " " + (String) src.get(key));
-      }
-    }
-  }
-
-  /**
-   * Copy the keys and values from the source to this object.  This will
-   * not copy the default values.  This is meant to be used by going from
-   * a higher precedence object to a lower precedence object, so that if a
-   * key already exists, this method will not reset it.
-   *
-   * @param opsrc non-null reference to an OutputProperties.
-   */
-  public void copyFrom(OutputProperties opsrc)
-    throws TransformerException
-  {
-    checkDuplicates(opsrc);
-    copyFrom(opsrc.getProperties());
-  }
-
-  /**
-   * Check to see if a set of properties is at the same import level as the
-   * last set of properties set that was passed as an argument to this method.
-   * This operation assumes that the OutputProperties are being called
-   * from most important to least important, in document order.
-   *
-   * @param newProps non-null reference to OutputProperties that is about to
-   *                 be added to this set.
-   */
-  private void checkDuplicates(OutputProperties newProps)
-    throws TransformerException
-  {
-
-    if (null == m_propertiesLevels)
-      m_propertiesLevels = new Hashtable();
-
-    // This operation assumes that the OutputProperties are being called 
-    // from most important to least important, in reverse document order.
-
-    int newPrecedence = newProps.getStylesheetComposed().getImportCountComposed();
-
-    Properties p = newProps.getProperties();
-    Enumeration enum = p.keys();
-
-    while (enum.hasMoreElements())
-    {
-      String key = (String) enum.nextElement();
-
-      if (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS))
-        continue;
-
-      // Do we already have this property? Call hashtable operation, 
-      // since we don't want to look at default properties.
-      Integer oldPrecedence = (Integer) m_propertiesLevels.get(key);
-      if (null == oldPrecedence)
-      {
-        m_propertiesLevels.put(key, new Integer(newPrecedence));
-      }
-      else if (newPrecedence >= oldPrecedence.intValue())
-      {
-        String oldValue = (String) this.m_properties.get(key);
-        String newValue = (String) newProps.m_properties.get(key);
-        if ( ((oldValue == null) && (newValue != null)) || !oldValue.equals(newValue) )
-        {
-          String msg = key + " can not be multiply defined at the same "
-                       + "import level! Old value = " 
-                       + oldValue + "; New value = " + newValue;
-          throw new TransformerException(msg, newProps);
-        }
-      }
-    }
-}
-
-  /**
-   * Report if the key given as an argument is a legal xsl:output key.
-   *
-   * @param key non-null reference to key name.
-   *
-   * @return true if key is legal.
-   */
-  public boolean isLegalPropertyKey(String key)
-  {
-
-    return (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS)
-            || key.equals(OutputKeys.DOCTYPE_PUBLIC)
-            || key.equals(OutputKeys.DOCTYPE_SYSTEM)
-            || key.equals(OutputKeys.ENCODING)
-            || key.equals(OutputKeys.INDENT)
-            || key.equals(OutputKeys.MEDIA_TYPE)
-            || key.equals(OutputKeys.METHOD)
-            || key.equals(OutputKeys.OMIT_XML_DECLARATION)
-            || key.equals(OutputKeys.STANDALONE)
-            || key.equals(OutputKeys.VERSION)
-            || (key.length() > 0) && (key.charAt(0) == '{'));
-  }
-
-  /**
-   *  This ugly field is used during recomposition to track the import precedence
-   *  at which each attribute was first specified, so we can flag errors about values being
-   *  set multiple time at the same precedence level. Note that this field is only used
-   *  during recomposition, with the OutputProperties object owned by the
-   *  {@link org.apache.xalan.templates.StylesheetRoot} object.
-   */
-  private transient Hashtable m_propertiesLevels;
-
-  /** The output properties.
-   *  @serial */
-  private Properties m_properties = null;
-
-  // Some special Xalan keys.
-
-  /** The number of whitespaces to indent by, if indent="yes". */
-  public static String S_KEY_INDENT_AMOUNT =
-    S_BUILTIN_EXTENSIONS_UNIVERSAL+"indent-amount";
-
-  /**
-   * Fully qualified name of class with a default constructor that
-   *  implements the ContentHandler interface, where the result tree events
-   *  will be sent to.      
-   */
-  public static String S_KEY_CONTENT_HANDLER =
-    S_BUILTIN_EXTENSIONS_UNIVERSAL+"content-handler";
-
-  /** File name of file that specifies character to entity reference mappings. */
-  public static String S_KEY_ENTITIES =
-    S_BUILTIN_EXTENSIONS_UNIVERSAL+"entities";
-
-  /** Use a value of "yes" if the href values for HTML serialization should 
-   *  use %xx escaping. */
-  public static String S_USE_URL_ESCAPING =
-    S_BUILTIN_EXTENSIONS_UNIVERSAL+"use-url-escaping";
-
-  /** Use a value of "yes" if the META tag should be omitted where it would
-   *  otherwise be supplied.
-   */
-  public static String S_OMIT_META_TAG =
-    S_BUILTIN_EXTENSIONS_UNIVERSAL+"omit-meta-tag";
-
-  /** The default properties of all output files. */
-  private static Properties m_xml_properties = null;
-
-  /** The default properties when method="html". */
-  private static Properties m_html_properties = null;
-
-  /** The default properties when method="text". */
-  private static Properties m_text_properties = null;
-
-  /** Synchronization object for lazy initialization of the above tables. */
-  private static Integer m_synch_object = new Integer(1);
-
-  /** a zero length Class array used in loadPropertiesFile() */
-  private static final Class[] NO_CLASSES = new Class[0];
-
-  /** a zero length Object array used in loadPropertiesFile() */
-  private static final Object[] NO_OBJS = new Object[0];
-
-}
diff --git a/src/org/apache/xalan/templates/Stylesheet.java b/src/org/apache/xalan/templates/Stylesheet.java
deleted file mode 100644
index 8665a78..0000000
--- a/src/org/apache/xalan/templates/Stylesheet.java
+++ /dev/null
@@ -1,1403 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-// Java imports
-import java.io.ObjectInputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
-import java.text.DecimalFormatSymbols;
-
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-// Xalan imports
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.StringVector;
-import org.apache.xpath.XPath;
-
-// DOM Imports
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Document;
-import org.apache.xml.dtm.DTM;
-
-// SAX2 Imports
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Locator;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * Represents a stylesheet element.
- * <p>All properties in this class have a fixed form of bean-style property
- * accessors for all properties that represent XSL attributes or elements.
- * These properties have setter method names accessed generically by the
- * processor, and so these names must be fixed according to the system
- * defined in the <a href="XSLTAttributeDef#getSetterMethodName">getSetterMethodName</a>
- * function.</p>
- * <p><pre>
- * <!ENTITY % top-level "
- *  (xsl:import*,
- *   (xsl:include
- *   | xsl:strip-space
- *   | xsl:preserve-space
- *   | xsl:output
- *   | xsl:key
- *   | xsl:decimal-format
- *   | xsl:attribute-set
- *   | xsl:variable
- *   | xsl:param
- *   | xsl:template
- *   | xsl:namespace-alias
- *   %non-xsl-top-level;)*)
- * ">
- *
- * <!ENTITY % top-level-atts '
- *   extension-element-prefixes CDATA #IMPLIED
- *   exclude-result-prefixes CDATA #IMPLIED
- *   id ID #IMPLIED
- *   version NMTOKEN #REQUIRED
- *   xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform"
- *   %space-att;
- * '>
- *
- * <!ELEMENT xsl:stylesheet %top-level;>
- * <!ATTLIST xsl:stylesheet %top-level-atts;>
- *
- * <!ELEMENT xsl:transform %top-level;>
- * <!ATTLIST xsl:transform %top-level-atts;>
- *
- * </p></pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Stylesheet-Structure">section-Stylesheet-Structure in XSLT Specification</a>
- */
-public class Stylesheet extends ElemTemplateElement
-        implements java.io.Serializable /* , Document */
-{
-
-  /**
-   * Constructor for a Stylesheet.
-   * @param parent  The including or importing stylesheet.
-   */
-  public Stylesheet(Stylesheet parent)
-  {
-
-    if (null != parent)
-    {
-      m_stylesheetParent = parent;
-      m_stylesheetRoot = parent.getStylesheetRoot();
-    }
-  }
-
-  /**
-   * Get the owning stylesheet.  This looks up the
-   * inheritance chain until it calls getStylesheet
-   * on a Stylesheet object, which will return itself.
-   *
-   * @return The owning stylesheet, itself.
-   */
-  public Stylesheet getStylesheet()
-  {
-    return this;
-  }
-
-  /**
-   * Tell if this can be cast to a StylesheetComposed, meaning, you
-   * can ask questions from getXXXComposed functions.
-   *
-   * @return False if this is not a StylesheetComposed
-   */
-  public boolean isAggregatedType()
-  {
-    return false;
-  }
-
-  /**
-   * Tell if this is the root of the stylesheet tree.
-   *
-   * @return False is this is not the root of the stylesheet tree.
-   */
-  public boolean isRoot()
-  {
-    return false;
-  }
-
-  /**
-   * Extension to be used when serializing to disk.
-   */
-  public static final String STYLESHEET_EXT = ".lxc";
-
-  /**
-   * Read the stylesheet from a serialization stream.
-   *
-   * @param stream Input stream to read from
-   *
-   * @throws IOException
-   * @throws TransformerException
-   */
-  private void readObject(ObjectInputStream stream)
-          throws IOException, TransformerException
-  {
-
-    // System.out.println("Reading Stylesheet");
-    try
-    {
-      stream.defaultReadObject();
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new TransformerException(cnfe);
-    }
-
-    // System.out.println("Done reading Stylesheet");
-  }
-
-  /**
-   * Write out the given output stream 
-   *
-   *
-   * @param stream The output stream to write out
-   *
-   * @throws IOException
-   */
-  private void writeObject(ObjectOutputStream stream) throws IOException
-  {
-
-    // System.out.println("Writing Stylesheet");
-    stream.defaultWriteObject();
-
-    // System.out.println("Done writing Stylesheet");
-  }
-
-  //============== XSLT Properties =================
-
-  /**
-   * The "xmlns:xsl" property.
-   * @serial
-   */
-  private String m_XmlnsXsl;
-
-  /**
-   * Set the "xmlns:xsl" property.
-   * @see <a href="http://www.w3.org/TR/xslt#xslt-namespace">xslt-namespace in XSLT Specification</a>
-   *
-   * @param v The value to be set for the "xmlns:xsl" property.
-   */
-  public void setXmlnsXsl(String v)
-  {
-    m_XmlnsXsl = v;
-  }
-
-  /**
-   * Get the "xmlns:xsl" property.
-   * @see <a href="http://www.w3.org/TR/xslt#xslt-namespace">xslt-namespace in XSLT Specification</a>
-   *
-   * @return The value of the "xmlns:xsl" property.
-   */
-  public String getXmlnsXsl()
-  {
-    return m_XmlnsXsl;
-  }
-
-  /**
-   * The "extension-element-prefixes" property, actually contains URIs.
-   * @serial
-   */
-  private StringVector m_ExtensionElementURIs;
-
-  /**
-   * Set the "extension-element-prefixes" property.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param v The value to be set for the "extension-element-prefixes" 
-   * property: a vector of extension element URIs.
-   */
-  public void setExtensionElementPrefixes(StringVector v)
-  {
-    m_ExtensionElementURIs = v;
-  }
-
-  /**
-   * Get and "extension-element-prefix" property.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param i Index of extension element URI in list 
-   *
-   * @return The extension element URI at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public String getExtensionElementPrefix(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_ExtensionElementURIs)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return m_ExtensionElementURIs.elementAt(i);
-  }
-
-  /**
-   * Get the number of "extension-element-prefixes" Strings.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @return Number of URIs in the list
-   */
-  public int getExtensionElementPrefixCount()
-  {
-    return (null != m_ExtensionElementURIs)
-           ? m_ExtensionElementURIs.size() : 0;
-  }
-
-  /**
-   * Find out if this contains a given "extension-element-prefix" property.
-   * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a>
-   *
-   * @param uri URI of extension element to look for
-   *
-   * @return True if the given URI was found in the list 
-   */
-  public boolean containsExtensionElementURI(String uri)
-  {
-
-    if (null == m_ExtensionElementURIs)
-      return false;
-
-    return m_ExtensionElementURIs.contains(uri);
-  }
-
-  /**
-   * The "exclude-result-prefixes" property.
-   * @serial
-   */
-  private StringVector m_ExcludeResultPrefixs;
-
-  /**
-   * Set the "exclude-result-prefixes" property.
-   * The designation of a namespace as an excluded namespace is
-   * effective within the subtree of the stylesheet rooted at
-   * the element bearing the exclude-result-prefixes or
-   * xsl:exclude-result-prefixes attribute; a subtree rooted
-   * at an xsl:stylesheet element does not include any stylesheets
-   * imported or included by children of that xsl:stylesheet element.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param v A StringVector of prefixes to exclude 
-   */
-  public void setExcludeResultPrefixes(StringVector v)
-  {
-    m_ExcludeResultPrefixs = v;
-  }
-
-  /**
-   * Get an "exclude-result-prefix" property.
-   * The designation of a namespace as an excluded namespace is
-   * effective within the subtree of the stylesheet rooted at
-   * the element bearing the exclude-result-prefixes or
-   * xsl:exclude-result-prefixes attribute; a subtree rooted
-   * at an xsl:stylesheet element does not include any stylesheets
-   * imported or included by children of that xsl:stylesheet element.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param i Index of prefix to get in list 
-   *
-   * @return Prefix to be excluded at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public String getExcludeResultPrefix(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_ExcludeResultPrefixs)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return m_ExcludeResultPrefixs.elementAt(i);
-  }
-
-  /**
-   * Get the number of "exclude-result-prefixes" Strings.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @return The number of prefix strings to be excluded. 
-   */
-  public int getExcludeResultPrefixCount()
-  {
-    return (null != m_ExcludeResultPrefixs)
-           ? m_ExcludeResultPrefixs.size() : 0;
-  }
-
-  /**
-   * Get whether or not the passed prefix is contained flagged by
-   * the "exclude-result-prefixes" property.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param prefix non-null reference to prefix that might be excluded.
-   *
-   * @return true if the prefix should normally be excluded.>
-   */
-  public boolean containsExcludeResultPrefix(String prefix)
-  {
-
-    if (null == m_ExcludeResultPrefixs)
-      return false;
-
-    if (prefix.length() == 0)
-      prefix = Constants.ATTRVAL_DEFAULT_PREFIX;
-
-    return m_ExcludeResultPrefixs.contains(prefix);
-  }
-
-  /**
-   * The "id" property.
-   * @serial
-   */
-  private String m_Id;
-
-  /**
-   * Set the "id" property.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Embedding-Stylesheets">section-Embedding-Stylesheets in XSLT Specification</a>
-   *
-   * @param v Value for the "id" property.
-   */
-  public void setId(String v)
-  {
-    m_Id = v;
-  }
-
-  /**
-   * Get the "id" property.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Embedding-Stylesheets">section-Embedding-Stylesheets in XSLT Specification</a>
-   *
-   * @return The value of the "id" property.
-   */
-  public String getId()
-  {
-    return m_Id;
-  }
-
-  /**
-   * The "version" property.
-   * @serial
-   */
-  private String m_Version;
-
-  /**
-   * Set the "version" property.
-   * @see <a href="http://www.w3.org/TR/xslt#forwards">forwards in XSLT Specification</a>
-   *
-   * @param v Value for the "version" property.
-   */
-  public void setVersion(String v)
-  {
-    m_Version = v;
-  }
-
-  /**
-   * Get the "version" property.
-   * @see <a href="http://www.w3.org/TR/xslt#forwards">forwards in XSLT Specification</a>
-   *
-   * @return The value of the "version" property.
-   */
-  public String getVersion()
-  {
-    return m_Version;
-  }
-
-  /**
-   * The "xsl:import" list.
-   * @serial
-   */
-  private Vector m_imports;
-
-  /**
-   * Add a stylesheet to the "import" list.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @param v Stylesheet to add to the import list
-   */
-  public void setImport(StylesheetComposed v)
-  {
-
-    if (null == m_imports)
-      m_imports = new Vector();
-
-    // I'm going to insert the elements in backwards order,
-    // so I can walk them 0 to n.
-    m_imports.addElement(v);
-  }
-
-  /**
-   * Get a stylesheet from the "import" list.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @param i Index of the stylesheet to get
-   *
-   * @return The stylesheet at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public StylesheetComposed getImport(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_imports)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (StylesheetComposed) m_imports.elementAt(i);
-  }
-
-  /**
-   * Get the number of imported stylesheets.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @return the number of imported stylesheets.
-   */
-  public int getImportCount()
-  {
-    return (null != m_imports) ? m_imports.size() : 0;
-  }
-
-  /**
-   * The "xsl:include" properties.
-   * @serial
-   */
-  private Vector m_includes;
-
-  /**
-   * Add a stylesheet to the "include" list.
-   * @see <a href="http://www.w3.org/TR/xslt#include">include in XSLT Specification</a>
-   *
-   * @param v Stylesheet to add to the "include" list  
-   */
-  public void setInclude(Stylesheet v)
-  {
-
-    if (null == m_includes)
-      m_includes = new Vector();
-
-    m_includes.addElement(v);
-  }
-
-  /**
-   * Get the stylesheet at the given in index in "include" list
-   * @see <a href="http://www.w3.org/TR/xslt#include">include in XSLT Specification</a>
-   *
-   * @param i Index of stylesheet to get
-   *
-   * @return Stylesheet at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public Stylesheet getInclude(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_includes)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (Stylesheet) m_includes.elementAt(i);
-  }
-
-  /**
-   * Get the number of included stylesheets.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @return the number of included stylesheets.
-   */
-  public int getIncludeCount()
-  {
-    return (null != m_includes) ? m_includes.size() : 0;
-  }
-
-  /**
-   * Table of tables of element decimal-format.
-   * @see DecimalFormatProperties
-   * @serial
-   */
-  Stack m_DecimalFormatDeclarations;
-
-  /**
-   * Process the xsl:decimal-format element.
-   *
-   * @param edf Decimal-format element to push into stack  
-   */
-  public void setDecimalFormat(DecimalFormatProperties edf)
-  {
-
-    if (null == m_DecimalFormatDeclarations)
-      m_DecimalFormatDeclarations = new Stack();
-
-    // Elements are pushed in by order of importance
-    // so that when recomposed, they get overiden properly.
-    m_DecimalFormatDeclarations.push(edf);
-  }
-
-  /**
-   * Get an "xsl:decimal-format" property.
-   * 
-   * @see DecimalFormatProperties
-   * @see <a href="http://www.w3.org/TR/xslt#format-number">format-number in XSLT Specification</a>
-   *
-   * @param name The qualified name of the decimal format property.
-   * @return null if not found, otherwise a DecimalFormatProperties
-   * object, from which you can get a DecimalFormatSymbols object.
-   */
-  public DecimalFormatProperties getDecimalFormat(QName name)
-  {
-
-    if (null == m_DecimalFormatDeclarations)
-      return null;
-
-    int n = getDecimalFormatCount();
-
-    for (int i = (n - 1); i >= 0; i++)
-    {
-      DecimalFormatProperties dfp = getDecimalFormat(i);
-
-      if (dfp.getName().equals(name))
-        return dfp;
-    }
-
-    return null;
-  }
-
-  /**
-   * Get an "xsl:decimal-format" property.
-   * @see <a href="http://www.w3.org/TR/xslt#format-number">format-number in XSLT Specification</a>
-   * @see DecimalFormatProperties
-   *
-   * @param i Index of decimal-format property in stack
-   *
-   * @return The decimal-format property at the given index 
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public DecimalFormatProperties getDecimalFormat(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_DecimalFormatDeclarations)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (DecimalFormatProperties) m_DecimalFormatDeclarations.elementAt(i);
-  }
-
-  /**
-   * Get the number of xsl:decimal-format declarations.
-   * @see DecimalFormatProperties
-   *
-   * @return the number of xsl:decimal-format declarations.
-   */
-  public int getDecimalFormatCount()
-  {
-    return (null != m_DecimalFormatDeclarations)
-           ? m_DecimalFormatDeclarations.size() : 0;
-  }
-
-  /**
-   * The "xsl:strip-space" properties,
-   * A lookup table of all space stripping elements.
-   * @serial
-   */
-  private Vector m_whitespaceStrippingElements;
-
-  /**
-   * Set the "xsl:strip-space" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param wsi WhiteSpaceInfo element to add to list 
-   */
-  public void setStripSpaces(WhiteSpaceInfo wsi)
-  {
-
-    if (null == m_whitespaceStrippingElements)
-    {
-      m_whitespaceStrippingElements = new Vector();
-    }
-
-    m_whitespaceStrippingElements.addElement(wsi);
-  }
-
-  /**
-   * Get an "xsl:strip-space" property.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param i Index of WhiteSpaceInfo to get
-   *
-   * @return WhiteSpaceInfo at given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public WhiteSpaceInfo getStripSpace(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_whitespaceStrippingElements)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (WhiteSpaceInfo) m_whitespaceStrippingElements.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:strip-space" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @return the number of "xsl:strip-space" properties.
-   */
-  public int getStripSpaceCount()
-  {
-    return (null != m_whitespaceStrippingElements)
-           ? m_whitespaceStrippingElements.size() : 0;
-  }
-
-  /**
-   * The "xsl:preserve-space" property,
-   * A lookup table of all space preserving elements.
-   * @serial
-   */
-  private Vector m_whitespacePreservingElements;
-
-  /**
-   * Set the "xsl:preserve-space" property.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param wsi WhiteSpaceInfo element to add to list
-   */
-  public void setPreserveSpaces(WhiteSpaceInfo wsi)
-  {
-
-    if (null == m_whitespacePreservingElements)
-    {
-      m_whitespacePreservingElements = new Vector();
-    }
-
-    m_whitespacePreservingElements.addElement(wsi);
-  }
-
-  /**
-   * Get a "xsl:preserve-space" property.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param i Index of WhiteSpaceInfo to get
-   *
-   * @return WhiteSpaceInfo at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public WhiteSpaceInfo getPreserveSpace(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_whitespacePreservingElements)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (WhiteSpaceInfo) m_whitespacePreservingElements.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:preserve-space" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @return the number of "xsl:preserve-space" properties.
-   */
-  public int getPreserveSpaceCount()
-  {
-    return (null != m_whitespacePreservingElements)
-           ? m_whitespacePreservingElements.size() : 0;
-  }
-
-  /**
-   * The "xsl:output" properties.  This is a vector of OutputProperties objects.
-   * @serial
-   */
-  private Vector m_output;
-
-  /**
-   * Set the "xsl:output" property.
-   * @see <a href="http://www.w3.org/TR/xslt#output">output in XSLT Specification</a>
-   *
-   * @param v non-null reference to the OutputProperties object to be 
-   *          added to the collection.
-   */
-  public void setOutput(OutputProperties v)
-  {
-    if (null == m_output)
-    {
-      m_output = new Vector();
-    }
-
-    m_output.addElement(v);
-  }
-
-  /**
-   * Get an "xsl:output" property.
-   * @see <a href="http://www.w3.org/TR/xslt#output">output in XSLT Specification</a>
-   *
-   * @param i Index of OutputFormatExtended to get
-   *
-   * @return non-null reference to an OutputProperties object.
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public OutputProperties getOutput(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_output)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (OutputProperties) m_output.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:output" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#output">output in XSLT Specification</a>
-   *
-   * @return The number of OutputProperties objects contained in this stylesheet.
-   */
-  public int getOutputCount()
-  {
-    return (null != m_output)
-           ? m_output.size() : 0;
-  }
-
-  /**
-   * The "xsl:key" property.
-   * @serial
-   */
-  private Vector m_keyDeclarations;
-
-  /**
-   * Set the "xsl:key" property.
-   * @see <a href="http://www.w3.org/TR/xslt#key">key in XSLT Specification</a>
-   *
-   * @param v KeyDeclaration element to add to the list of key declarations 
-   */
-  public void setKey(KeyDeclaration v)
-  {
-
-    if (null == m_keyDeclarations)
-      m_keyDeclarations = new Vector();
-
-    m_keyDeclarations.addElement(v);
-  }
-
-  /**
-   * Get an "xsl:key" property.
-   * @see <a href="http://www.w3.org/TR/xslt#key">key in XSLT Specification</a>
-   *
-   * @param i Index of KeyDeclaration element to get
-   *
-   * @return KeyDeclaration element at given index in list 
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public KeyDeclaration getKey(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_keyDeclarations)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (KeyDeclaration) m_keyDeclarations.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:key" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#key">key in XSLT Specification</a>
-   *
-   * @return the number of "xsl:key" properties.
-   */
-  public int getKeyCount()
-  {
-    return (null != m_keyDeclarations) ? m_keyDeclarations.size() : 0;
-  }
-
-  /**
-   * The "xsl:attribute-set" property.
-   * @serial
-   */
-  private Vector m_attributeSets;
-
-  /**
-   * Set the "xsl:attribute-set" property.
-   * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
-   *
-   * @param attrSet ElemAttributeSet to add to the list of attribute sets
-   */
-  public void setAttributeSet(ElemAttributeSet attrSet)
-  {
-
-    if (null == m_attributeSets)
-    {
-      m_attributeSets = new Vector();
-    }
-
-    m_attributeSets.addElement(attrSet);
-  }
-
-  /**
-   * Get an "xsl:attribute-set" property.
-   * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
-   *
-   * @param i Index of ElemAttributeSet to get in list
-   *
-   * @return ElemAttributeSet at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public ElemAttributeSet getAttributeSet(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_attributeSets)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (ElemAttributeSet) m_attributeSets.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:attribute-set" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
-   *
-   * @return the number of "xsl:attribute-set" properties.
-   */
-  public int getAttributeSetCount()
-  {
-    return (null != m_attributeSets) ? m_attributeSets.size() : 0;
-  }
-
-  /**
-   * The "xsl:variable" and "xsl:param" properties.
-   * @serial
-   */
-  private Vector m_topLevelVariables;
-
-  /**
-   * Set the "xsl:variable" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param v ElemVariable object to add to list of top level variables
-   */
-  public void setVariable(ElemVariable v)
-  {
-
-    if (null == m_topLevelVariables)
-      m_topLevelVariables = new Vector();
-
-    m_topLevelVariables.addElement(v);
-  }
-  
-  /**
-   * Get an "xsl:variable" or "xsl:param" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param qname non-null reference to the qualified name of the variable.
-   *
-   * @return The ElemVariable with the given name in the list or null
-   */
-  public ElemVariable getVariableOrParam(QName qname)
-  {
-
-    if (null != m_topLevelVariables)
-    {
-      int n = getVariableOrParamCount();
-
-      for (int i = 0; i < n; i++)
-      {
-        ElemVariable var = (ElemVariable) getVariableOrParam(i);
-
-        if (var.getName().equals(qname))
-          return var;
-      }
-    }
-
-    return null;
-  }
-
-
-  /**
-   * Get an "xsl:variable" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param qname Qualified name of the xsl:variable to get 
-   *
-   * @return reference to the variable named by qname, or null if not found.
-   */
-  public ElemVariable getVariable(QName qname)
-  {
-
-    if (null != m_topLevelVariables)
-    {
-      int n = getVariableOrParamCount();
-
-      for (int i = 0; i < n; i++)
-      {
-        ElemVariable var = getVariableOrParam(i);
-        if((var.getXSLToken() == Constants.ELEMNAME_VARIABLE) &&
-           (var.getName().equals(qname)))
-          return var;
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * Get an "xsl:variable" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param i Index of variable to get in the list
-   *
-   * @return ElemVariable at the given index in the list 
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public ElemVariable getVariableOrParam(int i) throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_topLevelVariables)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (ElemVariable) m_topLevelVariables.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:variable" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @return the number of "xsl:variable" properties.
-   */
-  public int getVariableOrParamCount()
-  {
-    return (null != m_topLevelVariables) ? m_topLevelVariables.size() : 0;
-  }
-
-  /**
-   * Set an "xsl:param" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param v A non-null ElemParam reference.
-   */
-  public void setParam(ElemParam v)
-  {
-    setVariable(v);
-  }
-
-  /**
-   * Get an "xsl:param" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param qname non-null reference to qualified name of the parameter.
-   *
-   * @return ElemParam with the given name in the list or null
-   */
-  public ElemParam getParam(QName qname)
-  {
-
-    if (null != m_topLevelVariables)
-    {
-      int n = getVariableOrParamCount();
-
-      for (int i = 0; i < n; i++)
-      {
-        ElemVariable var = getVariableOrParam(i);
-        if((var.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE) &&
-           (var.getName().equals(qname)))
-          return (ElemParam)var;
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * The "xsl:template" properties.
-   * @serial
-   */
-  private Vector m_templates;
-
-  /**
-   * Set an "xsl:template" property.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
-   *
-   * @param v ElemTemplate to add to list of templates
-   */
-  public void setTemplate(ElemTemplate v)
-  {
-
-    if (null == m_templates)
-      m_templates = new Vector();
-
-    m_templates.addElement(v);
-    v.setStylesheet(this);
-  }
-
-  /**
-   * Get an "xsl:template" property.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
-   *
-   * @param i Index of ElemTemplate in the list to get
-   *
-   * @return ElemTemplate at the given index in the list
-   *
-   * @throws TransformerException
-   */
-  public ElemTemplate getTemplate(int i) throws TransformerException
-  {
-
-    if (null == m_templates)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (ElemTemplate) m_templates.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:template" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
-   *
-   * @return the number of "xsl:template" properties.
-   */
-  public int getTemplateCount()
-  {
-    return (null != m_templates) ? m_templates.size() : 0;
-  }
-
-  /**
-   * The "xsl:namespace-alias" properties.
-   * @serial
-   */
-  private Vector m_prefix_aliases;
-
-  /**
-   * Set the "xsl:namespace-alias" property.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param na NamespaceAlias elemeent to add to the list
-   */
-  public void setNamespaceAlias(NamespaceAlias na)
-  {
-
-    if (m_prefix_aliases == null)
-      m_prefix_aliases = new Vector();
-
-    m_prefix_aliases.addElement(na);
-  }
-
-  /**
-   * Get an "xsl:namespace-alias" property.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param i Index of NamespaceAlias element to get from the list 
-   *
-   * @return NamespaceAlias element at the given index in the list
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public NamespaceAlias getNamespaceAlias(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (null == m_prefix_aliases)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (NamespaceAlias) m_prefix_aliases.elementAt(i);
-  }
-
-  /**
-   * Get the number of "xsl:namespace-alias" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @return the number of "xsl:namespace-alias" properties.
-   */
-  public int getNamespaceAliasCount()
-  {
-    return (null != m_prefix_aliases) ? m_prefix_aliases.size() : 0;
-  }
-
-  /**
-   * The "non-xsl-top-level" properties.
-   * @serial
-   */
-  private Hashtable m_NonXslTopLevel;
-
-  /**
-   * Set found a non-xslt element.
-   * @see <a href="http://www.w3.org/TR/xslt#stylesheet-element">stylesheet-element in XSLT Specification</a>
-   *
-   * @param name Qualified name of the element
-   * @param obj The element object
-   */
-  public void setNonXslTopLevel(QName name, Object obj)
-  {
-
-    if (null == m_NonXslTopLevel)
-      m_NonXslTopLevel = new Hashtable();
-
-    m_NonXslTopLevel.put(name, obj);
-  }
-
-  /**
-   * Get a non-xslt element.
-   * @see <a href="http://www.w3.org/TR/xslt#stylesheet-element">stylesheet-element in XSLT Specification</a>
-   *
-   * @param name Qualified name of the element to get
-   *
-   * @return The object associate with the given name 
-   */
-  public Object getNonXslTopLevel(QName name)
-  {
-    return (null != m_NonXslTopLevel) ? m_NonXslTopLevel.get(name) : null;
-  }
-
-  // =========== End top-level XSLT properties ===========
-
-  /**
-   * The base URL of the XSL document.
-   * @serial
-   */
-  private String m_href = null;
-
-  /** The doctype-public element.
-   *  @serial          */
-  private String m_publicId;
-
-  /** The doctype-system element.
-   *  @serial          */
-  private String m_systemId;
-
-  /**
-   * Get the base identifier with which this stylesheet is associated.
-   *
-   * @return the base identifier with which this stylesheet is associated.
-   */
-  public String getHref()
-  {
-    return m_href;
-  }
-
-  /**
-   * Set the base identifier with which this stylesheet is associated.
-   *
-   * @param baseIdent the base identifier with which this stylesheet is associated.
-   */
-  public void setHref(String baseIdent)
-  {
-    m_href = baseIdent;
-  }
-
-  /**
-   * Set the location information for this element.
-   *
-   * @param locator SourceLocator object with location information  
-   */
-  public void setLocaterInfo(SourceLocator locator)
-  {
-
-    if (null != locator)
-    {
-      m_publicId = locator.getPublicId();
-      m_systemId = locator.getSystemId();
-
-      if (null != m_systemId)
-      {
-        try
-        {
-          m_href = SystemIDResolver.getAbsoluteURI(m_systemId, null);
-        }
-        catch (TransformerException se)
-        {
-
-          // Ignore this for right now
-        }
-      }
-
-      super.setLocaterInfo(locator);
-    }
-  }
-
-  /**
-   * The root of the stylesheet, where all the tables common
-   * to all stylesheets are kept.
-   * @serial
-   */
-  private StylesheetRoot m_stylesheetRoot;
-
-  /**
-   * Get the root of the stylesheet, where all the tables common
-   * to all stylesheets are kept.
-   *
-   * @return the root of the stylesheet
-   */
-  public StylesheetRoot getStylesheetRoot()
-  {
-    return m_stylesheetRoot;
-  }
-
-  /**
-   * Set the root of the stylesheet, where all the tables common
-   * to all stylesheets are kept.
-   *
-   * @param v the root of the stylesheet
-   */
-  public void setStylesheetRoot(StylesheetRoot v)
-  {
-    m_stylesheetRoot = v;
-  }
-
-  /**
-   * The parent of the stylesheet.  This will be null if this
-   * is the root stylesheet.
-   * @serial
-   */
-  private Stylesheet m_stylesheetParent;
-
-  /**
-   * Get the parent of the stylesheet.  This will be null if this
-   * is the root stylesheet.
-   *
-   * @return the parent of the stylesheet.
-   */
-  public Stylesheet getStylesheetParent()
-  {
-    return m_stylesheetParent;
-  }
-
-  /**
-   * Set the parent of the stylesheet.  This should be null if this
-   * is the root stylesheet.
-   *
-   * @param v the parent of the stylesheet.
-   */
-  public void setStylesheetParent(Stylesheet v)
-  {
-    m_stylesheetParent = v;
-  }
-
-  /**
-   * Get the owning aggregated stylesheet, or this
-   * stylesheet if it is aggregated.
-   *
-   * @return the owning aggregated stylesheet or itself
-   */
-  public StylesheetComposed getStylesheetComposed()
-  {
-
-    Stylesheet sheet = this;
-
-    while (!sheet.isAggregatedType())
-    {
-      sheet = sheet.getStylesheetParent();
-    }
-
-    return (StylesheetComposed) sheet;
-  }
-
-  /**
-   * Get the type of the node.  We'll pretend we're a Document.
-   *
-   * @return the type of the node: document node.
-   */
-  public short getNodeType()
-  {
-    return DTM.DOCUMENT_NODE;
-  }
-
-  /**
-   * Get an integer representation of the element type.
-   *
-   * @return An integer representation of the element, defined in the
-   *     Constants class.
-   * @see org.apache.xalan.templates.Constants
-   */
-  public int getXSLToken()
-  {
-    return Constants.ELEMNAME_STYLESHEET;
-  }
-
-  /**
-   * Return the node name.
-   *
-   * @return The node name
-   */
-  public String getNodeName()
-  {
-    return Constants.ELEMNAME_STYLESHEET_STRING;
-  }
-
-  /**
-   * Replace an "xsl:template" property.
-   * This is a hook for CompilingStylesheetHandler, to allow
-   * us to access a template, compile it, instantiate it,
-   * and replace the original with the compiled instance.
-   * ADDED 9/5/2000 to support compilation experiment
-   *
-   * @param v Compiled template to replace with
-   * @param i Index of template to be replaced
-   *
-   * @throws TransformerException
-   */
-  public void replaceTemplate(ElemTemplate v, int i) throws TransformerException
-  {
-
-    if (null == m_templates)
-      throw new ArrayIndexOutOfBoundsException();
-
-    replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i));
-    m_templates.setElementAt(v, i);
-    v.setStylesheet(this);
-  }
-  
-}
diff --git a/src/org/apache/xalan/templates/StylesheetComposed.java b/src/org/apache/xalan/templates/StylesheetComposed.java
deleted file mode 100644
index a5fb9c9..0000000
--- a/src/org/apache/xalan/templates/StylesheetComposed.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-import javax.xml.transform.TransformerConfigurationException;
-import org.apache.xpath.XPath;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xpath.XPathContext;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Element;
-
-import javax.xml.transform.TransformerException;
-
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-/**
- * Represents a stylesheet that has methods that resolve includes and
- * imports.  It has methods on it that
- * return "composed" properties, which mean that:
- * <ol>
- * <li>Properties that are aggregates, like OutputProperties, will
- * be composed of properties declared in this stylsheet and all
- * included stylesheets.</li>
- * <li>Properties that aren't found, will be searched for first in
- * the includes, and, if none are located, will be searched for in
- * the imports.</li>
- * <li>Properties in that are not atomic on a stylesheet will
- * have the form getXXXComposed. Some properties, like version and id,
- * are not inherited, and so won't have getXXXComposed methods.</li>
- * </ol>
- * <p>In some cases getXXXComposed methods may calculate the composed
- * values dynamically, while in other cases they may store the composed
- * values.</p>
- */
-public class StylesheetComposed extends Stylesheet
-{
-
-  /**
-   * Uses an XSL stylesheet document.
-   * @param parent  The including or importing stylesheet.
-   */
-  public StylesheetComposed(Stylesheet parent)
-  {
-    super(parent);
-  }
-
-  /**
-   * Tell if this can be cast to a StylesheetComposed, meaning, you
-   * can ask questions from getXXXComposed functions.
-   *
-   * @return True since this is a StylesheetComposed 
-   */
-  public boolean isAggregatedType()
-  {
-    return true;
-  }
-
-  /**
-   * Adds all recomposable values for this precedence level into the recomposableElements Vector
-   * that was passed in as the first parameter.  All elements added to the
-   * recomposableElements vector should extend ElemTemplateElement.
-   * @param recomposableElements a Vector of ElemTemplateElement objects that we will add all of
-   *        our recomposable objects to.
-   */
-  public void recompose(Vector recomposableElements) throws TransformerException
-  {
-
-    recomposeImports();         // Calculate the number of this import.
-    recomposeIncludes(this);    // Build the global include list for this stylesheet.
-
-    // Now add in all of the recomposable elements at this precedence level
-
-    int n = getIncludeCountComposed();
-
-    for (int i = -1; i < n; i++)
-    {
-      Stylesheet included = getIncludeComposed(i);
-
-      // Add in the output elements
-
-      int s = included.getOutputCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getOutput(j));
-      }
-
-      // Next, add in the attribute-set elements
-
-      s = included.getAttributeSetCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getAttributeSet(j));
-      }
-
-      // Now the decimal-formats
-
-      s = included.getDecimalFormatCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getDecimalFormat(j));
-      }
-
-      // Now the keys
-
-      s = included.getKeyCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getKey(j));
-      }
-
-      // And the namespace aliases
-
-      s = included.getNamespaceAliasCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getNamespaceAlias(j));
-      }
-
-      // Next comes the templates
-
-      s = included.getTemplateCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getTemplate(j));
-      }
-
-      // Then, the variables
-
-      s = included.getVariableOrParamCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getVariableOrParam(j));
-      }
-
-      // And lastly the whitespace preserving and stripping elements
-
-      s = included.getStripSpaceCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getStripSpace(j));
-      }
-
-      s = included.getPreserveSpaceCount();
-      for (int j = 0; j < s; j++)
-      {
-        recomposableElements.addElement(included.getPreserveSpace(j));
-      }
-    }
-  }
-
-  /** Order in import chain.
-   *  @serial         */
-  private int m_importNumber = -1;
-
-  /** The precedence of this stylesheet in the global import list.
-   *  The lowest precedence stylesheet is 0.  A higher
-   *  number has a higher precedence.
-   *  @serial
-   */
-  private int m_importCountComposed;
-
-  /**
-   * Recalculate the precedence of this stylesheet in the global
-   * import list.  The lowest precedence stylesheet is 0.  A higher
-   * number has a higher precedence.
-   */
-  void recomposeImports()
-  {
-
-    m_importNumber = getStylesheetRoot().getImportNumber(this);
-
-    StylesheetRoot root = getStylesheetRoot();
-    int globalImportCount = root.getGlobalImportCount();
-
-    m_importCountComposed = (globalImportCount - m_importNumber) - 1;
-  }
-
-  /**
-   * Get a stylesheet from the "import" list.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @param i Index of stylesheet in import list 
-   *
-   * @return The stylesheet at the given index
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public StylesheetComposed getImportComposed(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    StylesheetRoot root = getStylesheetRoot();
-
-    // Get the stylesheet that is offset past this stylesheet.
-    // Thus, if the index of this stylesheet is 3, an argument 
-    // to getImportComposed of 0 will return the 4th stylesheet 
-    // in the global import list.
-    return root.getGlobalImport(1 + m_importNumber + i);
-  }
-
-  /**
-   * Get the precedence of this stylesheet in the global import list.
-   * The lowest precedence is 0.  A higher number has a higher precedence.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @return the precedence of this stylesheet in the global import list.
-   */
-  public int getImportCountComposed()
-  {
-    return m_importCountComposed;
-  }
-
-  /**
-   * The combined list of includes.
-   * @serial
-   */
-  private transient Vector m_includesComposed;
-
-  /**
-   * Recompose the value of the composed include list.  Builds a composite
-   * list of all stylesheets included by this stylesheet to any depth.
-   *
-   * @param including Stylesheet to recompose
-   */
-  void recomposeIncludes(Stylesheet including)
-  {
-
-    int n = including.getIncludeCount();
-
-    if (n > 0)
-    {
-      if (null == m_includesComposed)
-        m_includesComposed = new Vector();
-
-      for (int i = 0; i < n; i++)
-      {
-        Stylesheet included = including.getInclude(i);
-        m_includesComposed.addElement(included);
-        recomposeIncludes(included);
-      }
-    }
-  }
-
-  /**
-   * Get an "xsl:include" property.
-   * @see <a href="http://www.w3.org/TR/xslt#include">include in XSLT Specification</a>
-   *
-   * @param i Index of stylesheet in "include" list 
-   *
-   * @return The stylesheet at the given index in the "include" list 
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public Stylesheet getIncludeComposed(int i)
-          throws ArrayIndexOutOfBoundsException
-  {
-
-    if (-1 == i)
-      return this;
-
-    if (null == m_includesComposed)
-      throw new ArrayIndexOutOfBoundsException();
-
-    return (Stylesheet) m_includesComposed.elementAt(i);
-  }
-
-  /**
-   * Get the number of included stylesheets.
-   * @see <a href="http://www.w3.org/TR/xslt#import">import in XSLT Specification</a>
-   *
-   * @return the number of included stylesheets.
-   */
-  public int getIncludeCountComposed()
-  {
-    return (null != m_includesComposed) ? m_includesComposed.size() : 0;
-  }
-
-  /**
-   * For compilation support, we need the option of overwriting
-   * (rather than appending to) previous composition.
-   * We could phase out the old API in favor of this one, but I'm
-   * holding off until we've made up our minds about compilation.
-   * ADDED 9/5/2000 to support compilation experiment.
-   * NOTE: GLP 29-Nov-00 I've left this method in so that CompilingStylesheetHandler will compile.  However,
-   *                     I'm not sure why it's needed or what it does and I've commented out the body.
-   *
-   * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
-   * @param flushFirst Flag indicating the option of overwriting
-   * (rather than appending to) previous composition.
-   *
-   * @throws TransformerException
-   */
-  public void recomposeTemplates(boolean flushFirst) throws TransformerException
-  {
-/***************************************  KEEP METHOD IN FOR COMPILATION
-    if (flushFirst)
-      m_templateList = new TemplateList(this);
-
-    recomposeTemplates();
-*****************************************/
-  }
-}
diff --git a/src/org/apache/xalan/templates/StylesheetRoot.java b/src/org/apache/xalan/templates/StylesheetRoot.java
deleted file mode 100644
index 415b8c1..0000000
--- a/src/org/apache/xalan/templates/StylesheetRoot.java
+++ /dev/null
@@ -1,1262 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-// import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-
-import java.util.*;
-
-import java.net.MalformedURLException;
-
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-import java.io.*;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-
-import org.apache.xalan.serialize.*;
-import org.apache.xml.utils.*;
-import org.apache.xpath.*;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xalan.trace.*;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.processor.XSLTSchema;
-import org.apache.xalan.transformer.TransformerImpl;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.Templates;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.ErrorListener;
-
-import org.apache.xml.dtm.ref.ExpandedNameTable;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents the root object of the stylesheet tree.
- */
-public class StylesheetRoot extends StylesheetComposed
-        implements java.io.Serializable, Templates
-{
-
-  /**
-   * Uses an XSL stylesheet document.
-   * @throws TransformerConfigurationException if the baseIdentifier can not be resolved to a URL.
-   */
-  public StylesheetRoot(ErrorListener errorListener) throws TransformerConfigurationException
-  {
-
-    super(null);
-
-    setStylesheetRoot(this);
-
-    try
-    {
-      m_selectDefault = new XPath("node()", this, this, XPath.SELECT, errorListener);
-
-      initDefaultRule(errorListener);
-    }
-    catch (TransformerException se)
-    {
-      throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se);
-    }
-  }
-
-  /**
-   * The schema used when creating this StylesheetRoot
-   * @serial
-   */
-  private Hashtable m_availElems;
-
-  /**
-   * Creates a StylesheetRoot and retains a pointer to the schema used to create this
-   * StylesheetRoot.  The schema may be needed later for an element-available() function call.
-   * 
-   * @param schema The schema used to create this stylesheet
-   * @throws TransformerConfigurationException if the baseIdentifier can not be resolved to a URL.
-   */
-  public StylesheetRoot(XSLTSchema schema, ErrorListener listener) throws TransformerConfigurationException
-  {
-
-    this(listener);
-    m_availElems = schema.getElemsAvailable();
-
-  }
-
-  /**
-   * Tell if this is the root of the stylesheet tree.
-   *
-   * @return True since this is the root of the stylesheet tree.
-   */
-  public boolean isRoot()
-  {
-    return true;
-  }
-
-  /**
-   * Get the hashtable of available elements.
-   *
-   * @return table of available elements, keyed by qualified names, and with 
-   * values of the same qualified names.
-   */
-  public Hashtable getAvailableElements()
-  {
-    return m_availElems;
-  }
-
-  //============== Templates Interface ================
-
-  /**
-   * Create a new transformation context for this Templates object.
-   *
-   * @return A Transformer instance, never null.
-   */
-  public Transformer newTransformer()
-  {
-    return new TransformerImpl(this);
-  }
-  
-
-  public Properties getDefaultOutputProps()
-  {
-    return m_outputProperties.getProperties();
-  }
-  
-  /**
-   * Get the static properties for xsl:output.  The object returned will
-   * be a clone of the internal values, and thus it can be mutated
-   * without mutating the Templates object, and then handed in to
-   * the process method.
-   *
-   * <p>For XSLT, Attribute Value Templates attribute values will
-   * be returned unexpanded (since there is no context at this point).</p>
-   *
-   * @return A Properties object, not null.
-   */
-  public Properties getOutputProperties()
-  {    
-    return (Properties)getDefaultOutputProps().clone();
-  }
-
-  //============== End Templates Interface ================
-
-  /**
-   * Recompose the values of all "composed" properties, meaning
-   * properties that need to be combined or calculated from
-   * the combination of imported and included stylesheets.  This
-   * method determines the proper import precedence of all imported
-   * stylesheets.  It then iterates through all of the elements and 
-   * properties in the proper order and triggers the individual recompose
-   * methods.
-   *
-   * @throws TransformerException
-   */
-  public void recompose() throws TransformerException
-  {
-
-    // First, we build the global import tree.
-
-    if (null == m_globalImportList)
-    {
-
-      Vector importList = new Vector();
-
-      addImports(this, true, importList);
-
-      // Now we create an array and reverse the order of the importList vector.
-      // We built the importList vector backwards so that we could use addElement
-      // to append to the end of the vector instead of constantly pushing new
-      // stylesheets onto the front of the vector and having to shift the rest
-      // of the vector each time.
-
-      m_globalImportList = new StylesheetComposed[importList.size()];
-
-      for (int i = importList.size() - 1, j= 0; i >= 0; i--)
-        m_globalImportList[j++] = (StylesheetComposed) importList.elementAt(i);
-    }
-
-    // Now we make a Vector that is going to hold all of the recomposable elements
-
-    Vector recomposableElements = new Vector();
-
-    // Next, we walk the import tree and add all of the recomposable elements to the vector.
-
-    int n = getGlobalImportCount();
-
-    for (int i = 0; i < n; i++)
-    {
-      StylesheetComposed imported = getGlobalImport(i);
-      imported.recompose(recomposableElements);
-    }
-
-    // We sort the elements into ascending order.
-
-    QuickSort2(recomposableElements, 0, recomposableElements.size() - 1);
-
-    // We set up the global variables that will hold the recomposed information.
-
-    m_outputProperties = new OutputProperties(Method.XML);
-    
-    m_attrSets = new Hashtable();
-    m_decimalFormatSymbols = new Hashtable();
-    m_keyDecls = new Vector();
-    m_namespaceAliasComposed = new Hashtable();
-    m_templateList = new TemplateList();
-    m_variables = new Vector();
-
-    // Now we sequence through the sorted elements, 
-    // calling the recompose() function on each one.  This will call back into the
-    // appropriate routine here to actually do the recomposition.
-    // Note that we're going backwards, encountering the highest precedence items first.
-    for (int i = recomposableElements.size() - 1; i >= 0; i--)
-      ((ElemTemplateElement) recomposableElements.elementAt(i)).recompose(this);
-    
-    initComposeState();
-
-    // Need final composition of TemplateList.  This adds the wild cards onto the chains.
-    m_templateList.compose(this);
-    
-    // Need to clear check for properties at the same import level.
-    m_outputProperties.compose(this);
-    m_outputProperties.endCompose(this);
-    
-    // Now call the compose() method on every element to give it a chance to adjust
-    // based on composed values.
-    
-    n = getGlobalImportCount();
-
-    for (int i = 0; i < n; i++)
-    {
-      StylesheetComposed imported = this.getGlobalImport(i);
-      int includedCount = imported.getIncludeCountComposed();
-      for (int j = -1; j < includedCount; j++)
-      {
-        Stylesheet included = imported.getIncludeComposed(j);
-        composeTemplates(included);
-      }
-    }
-    
-    clearComposeState();
-  }
-
-  /**
-   * Call the compose function for each ElemTemplateElement.
-   *
-   * @param templ non-null reference to template element that will have 
-   * the composed method called on it, and will have it's children's composed 
-   * methods called.
-   */
-  void composeTemplates(ElemTemplateElement templ) throws TransformerException
-  {
-
-    templ.compose(this);
-
-    for (ElemTemplateElement child = templ.getFirstChildElem();
-            child != null; child = child.getNextSiblingElem())
-    {
-      composeTemplates(child);
-    }
-    
-    templ.endCompose(this);
-  }
-
-  /**
-   * The combined list of imports.  The stylesheet with the highest
-   * import precedence will be at element 0.  The one with the lowest
-   * import precedence will be at element length - 1.
-   * @serial
-   */
-  private StylesheetComposed[] m_globalImportList;
-
-  /**
-   * Add the imports in the given sheet to the working importList vector.
-   * The will be added from highest import precedence to
-   * least import precedence.  This is a post-order traversal of the
-   * import tree as described in <a href="http://www.w3.org/TR/xslt.html#import">the
-   * XSLT Recommendation</a>.
-   * <p>For example, suppose</p>
-   * <p>stylesheet A imports stylesheets B and C in that order;</p>
-   * <p>stylesheet B imports stylesheet D;</p>
-   * <p>stylesheet C imports stylesheet E.</p>
-   * <p>Then the order of import precedence (highest first) is
-   * A, C, E, B, D.</p>
-   *
-   * @param stylesheet Stylesheet to examine for imports.
-   * @param addToList  <code>true</code> if this template should be added to the import list
-   * @param importList The working import list.  Templates are added here in the reverse
-   *        order of priority.  When we're all done, we'll reverse this to the correct
-   *        priority in an array.
-   */
-  protected void addImports(Stylesheet stylesheet, boolean addToList, Vector importList)
-  {
-
-    // Get the direct imports of this sheet.
-
-    int n = stylesheet.getImportCount();
-
-    if (n > 0)
-    {
-      for (int i = 0; i < n; i++)
-      {
-        Stylesheet imported = stylesheet.getImport(i);
-
-        addImports(imported, true, importList);
-      }
-    }
-
-    n = stylesheet.getIncludeCount();
-
-    if (n > 0)
-    {
-      for (int i = 0; i < n; i++)
-      {
-        Stylesheet included = stylesheet.getInclude(i);
-
-        addImports(included, false, importList);
-      }
-    }
-
-    if (addToList)
-      importList.addElement(stylesheet);
-
-  }
-
-  /**
-   * Get a stylesheet from the global import list. 
-   * TODO: JKESS PROPOSES SPECIAL-CASE FOR NO IMPORT LIST, TO MATCH COUNT.
-   * 
-   * @param i Index of stylesheet to get from global import list 
-   *
-   * @return The stylesheet at the given index 
-   */
-  public StylesheetComposed getGlobalImport(int i)
-  {
-    return m_globalImportList[i];
-  }
-
-  /**
-   * Get the total number of imports in the global import list.
-   * 
-   * @return The total number of imported stylesheets, including
-   * the root stylesheet, thus the number will always be 1 or
-   * greater.
-   * TODO: JKESS PROPOSES SPECIAL-CASE FOR NO IMPORT LIST, TO MATCH DESCRIPTION.
-   */
-  public int getGlobalImportCount()
-  {
-          return (m_globalImportList!=null)
-                        ? m_globalImportList.length 
-                          : 1;
-  }
-
-  /**
-   * Given a stylesheet, return the number of the stylesheet
-   * in the global import list.
-   * @param sheet The stylesheet which will be located in the
-   * global import list.
-   * @return The index into the global import list of the given stylesheet,
-   * or -1 if it is not found (which should never happen).
-   */
-  public int getImportNumber(StylesheetComposed sheet)
-  {
-
-    if (this == sheet)
-      return 0;
-
-    int n = getGlobalImportCount();
-
-    for (int i = 0; i < n; i++)
-    {
-      if (sheet == getGlobalImport(i))
-        return i;
-    }
-
-    return -1;
-  }
-
-  /**
-   * This will be set up with the default values, and then the values
-   * will be set as stylesheets are encountered.
-   * @serial
-   */
-  private OutputProperties m_outputProperties;
-
-  /**
-   * Recompose the output format object from the included elements.
-   *
-   * @param oprops non-null reference to xsl:output properties representation.
-   */
-  void recomposeOutput(OutputProperties oprops)
-    throws TransformerException
-  {
-    
-    m_outputProperties.copyFrom(oprops);
-  }
-
-  /**
-   * Get the combined "xsl:output" property with the properties
-   * combined from the included stylesheets.  If a xsl:output
-   * is not declared in this stylesheet or an included stylesheet,
-   * look in the imports.
-   * Please note that this returns a reference to the OutputProperties
-   * object, not a cloned object, like getOutputProperties does.
-   * @see <a href="http://www.w3.org/TR/xslt#output">output in XSLT Specification</a>
-   *
-   * @return non-null reference to composed output properties object.
-   */
-  public OutputProperties getOutputComposed()
-  {
-
-    // System.out.println("getOutputComposed.getIndent: "+m_outputProperties.getIndent());
-    // System.out.println("getOutputComposed.getIndenting: "+m_outputProperties.getIndenting());
-    return m_outputProperties;
-  }
-
-  /** Flag indicating whether an output method has been set by the user.
-   *  @serial           */
-  private boolean m_outputMethodSet = false;
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Find out if an output method has been set by the user.
-   *
-   * @return Value indicating whether an output method has been set by the user
-   */
-  public boolean isOutputMethodSet()
-  {
-    return m_outputMethodSet;
-  }
-
-  /**
-   * Composed set of all included and imported attribute set properties.
-   * Each entry is a vector of ElemAttributeSet objects.
-   * @serial
-   */
-  private Hashtable m_attrSets;
-
-  /**
-   * Recompose the attribute-set declarations.
-   *
-   * @param attrSet An attribute-set to add to the hashtable of attribute sets.
-   */
-  void recomposeAttributeSets(ElemAttributeSet attrSet)
-  {
-    Vector attrSetList = (Vector) m_attrSets.get(attrSet.getName());
-
-    if (null == attrSetList)
-    {
-      attrSetList = new Vector();
-
-      m_attrSets.put(attrSet.getName(), attrSetList);
-    }
-
-    attrSetList.addElement(attrSet);
-  }
-
-  /**
-   * Get a list "xsl:attribute-set" properties that match the qname.
-   * @see <a href="http://www.w3.org/TR/xslt#attribute-sets">attribute-sets in XSLT Specification</a>
-   *
-   * @param name Qualified name of attribute set properties to get
-   *
-   * @return A vector of attribute sets matching the given name
-   *
-   * @throws ArrayIndexOutOfBoundsException
-   */
-  public Vector getAttributeSetComposed(QName name)
-          throws ArrayIndexOutOfBoundsException
-  {
-    return (Vector) m_attrSets.get(name);
-  }
-
-  /**
-   * Table of DecimalFormatSymbols, keyed by QName.
-   * @serial
-   */
-  private Hashtable m_decimalFormatSymbols;
-
-  /**
-   * Recompose the decimal-format declarations.
-   *
-   * @param dfp A DecimalFormatProperties to add to the hashtable of decimal formats.
-   */
-  void recomposeDecimalFormats(DecimalFormatProperties dfp)
-  {
-    DecimalFormatSymbols oldDfs =
-                  (DecimalFormatSymbols) m_decimalFormatSymbols.get(dfp.getName());
-    if (null == oldDfs)
-    {
-      m_decimalFormatSymbols.put(dfp.getName(), dfp.getDecimalFormatSymbols());
-    }
-    else if (!dfp.getDecimalFormatSymbols().equals(oldDfs))
-    {
-      String themsg;
-      if (dfp.getName().equals(new QName("")))
-      {
-        // "Only one default xsl:decimal-format declaration is allowed."
-        themsg = XSLMessages.createWarning(
-                          XSLTErrorResources.WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
-                          new Object[0]);
-      }
-      else
-      {
-        // "xsl:decimal-format names must be unique. Name {0} has been duplicated."
-        themsg = XSLMessages.createWarning(
-                          XSLTErrorResources.WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
-                          new Object[] {dfp.getName()});
-      }
-
-      error(themsg);   // Should we throw TransformerException instead?
-    }
-
-  }
-
-  /**
-   * Given a valid element decimal-format name, return the
-   * decimalFormatSymbols with that name.
-   * <p>It is an error to declare either the default decimal-format or
-   * a decimal-format with a given name more than once (even with
-   * different import precedence), unless it is declared every
-   * time with the same value for all attributes (taking into
-   * account any default values).</p>
-   * <p>Which means, as far as I can tell, the decimal-format
-   * properties are not additive.</p>
-   *
-   * @param name Qualified name of the decimal format to find 
-   * @return DecimalFormatSymbols object matching the given name or
-   * null if name is not found.
-   */
-  public DecimalFormatSymbols getDecimalFormatComposed(QName name)
-  {
-    return (DecimalFormatSymbols) m_decimalFormatSymbols.get(name);
-  }
-
-  /**
-   * A list of all key declarations visible from this stylesheet and all
-   * lesser stylesheets.
-   * @serial
-   */
-  private Vector m_keyDecls;
-
-  /**
-   * Recompose the key declarations.
-   *
-   * @param keyDecl A KeyDeclaration to be added to the vector of key declarations.
-   */
-  void recomposeKeys(KeyDeclaration keyDecl)
-  {
-    m_keyDecls.addElement(keyDecl);
-  }
-
-  /**
-   * Get the composed "xsl:key" properties.
-   * @see <a href="http://www.w3.org/TR/xslt#key">key in XSLT Specification</a>
-   *
-   * @return A vector of the composed "xsl:key" properties.
-   */
-  public Vector getKeysComposed()
-  {
-    return m_keyDecls;
-  }
-
-  /**
-   * Composed set of all namespace aliases.
-   * @serial
-   */
-  private Hashtable m_namespaceAliasComposed;
-
-  /**
-   * Recompose the namespace-alias declarations.
-   *
-   * @param nsAlias A NamespaceAlias object to add to the hashtable of namespace aliases.
-   */
-  void recomposeNamespaceAliases(NamespaceAlias nsAlias)
-  {
-    m_namespaceAliasComposed.put(nsAlias.getStylesheetNamespace(),
-                                 nsAlias);
-  }
-
-  /**
-   * Get the "xsl:namespace-alias" property.
-   * Return the NamespaceAlias for a given namespace uri.
-   * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
-   *
-   * @param uri non-null reference to namespace that is to be aliased.
-   *
-   * @return NamespaceAlias that matches uri, or null if no match.
-   */
-  public NamespaceAlias getNamespaceAliasComposed(String uri)
-  {
-    return (NamespaceAlias) ((null == m_namespaceAliasComposed) 
-                    ? null : m_namespaceAliasComposed.get(uri));
-  }
-
-  /**
-   * The "xsl:template" properties.
-   * @serial
-   */
-  private TemplateList m_templateList;
-
-  /**
-   * Recompose the template declarations.
-   *
-   * @param template An ElemTemplate object to add to the template list.
-   */
-  void recomposeTemplates(ElemTemplate template)
-  {
-    m_templateList.setTemplate(template);
-  }
-
-  /**
-   * Accessor method to retrieve the <code>TemplateList</code> associated with
-   * this StylesheetRoot.
-   * 
-   * @return The composed <code>TemplateList</code>.
-   */
-  public final TemplateList getTemplateListComposed()
-  {
-    return m_templateList;
-  }
-
-  /**
-   * Mutator method to set the <code>TemplateList</code> associated with this
-   * StylesheetRoot.  This method should only be used by the compiler.  Normally,
-   * the template list is built during the recompose process and should not be
-   * altered by the user.
-   * @param templateList The new <code>TemplateList</code> for this StylesheetRoot.
-   */
-  public final void setTemplateListComposed(TemplateList templateList)
-  {
-    m_templateList = templateList;
-  }
-
-  /**
-   * Get an "xsl:template" property by node match. This looks in the imports as
-   * well as this stylesheet.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
-   *
-   * @param xctxt non-null reference to XPath runtime execution context.
-   * @param targetNode non-null reference of node that the template must match.
-   * @param mode qualified name of the node, or null.
-   * @param maxImportLevel The maximum importCountComposed that we should consider or -1
-   *        if we should consider all import levels.  This is used by apply-imports to
-   *        access templates that have been overridden.
-   * @param quietConflictWarnings true if conflict warnings should not be reported.
-   *
-   * @return reference to ElemTemplate that is the best match for targetNode, or 
-   *         null if no match could be made.
-   *
-   * @throws TransformerException
-   */
-  public ElemTemplate getTemplateComposed(XPathContext xctxt,
-                                          int targetNode,
-                                          QName mode,
-                                          int maxImportLevel,
-                                          boolean quietConflictWarnings,
-                                          DTM dtm)
-            throws TransformerException
-  {
-    return m_templateList.getTemplate(xctxt, targetNode, mode, 
-                                      maxImportLevel,
-                                      quietConflictWarnings,
-                                      dtm);
-  }
-
-  /**
-   * Get an "xsl:template" property. This looks in the imports as
-   * well as this stylesheet.
-   * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
-   *
-   * @param qname non-null reference to qualified name of template.
-   *
-   * @return reference to named template, or null if not found.
-   */
-  public ElemTemplate getTemplateComposed(QName qname)
-  {
-    return m_templateList.getTemplate(qname);
-  }
-  
-  /**
-   * Composed set of all variables and params.
-   * @serial
-   */
-  private Vector m_variables;
-
-  /**
-   * Recompose the top level variable and parameter declarations.
-   *
-   * @param elemVar A top level variable or parameter to be added to the Vector.
-   */
-  void recomposeVariables(ElemVariable elemVar)
-  {
-    // Don't overide higher priority variable        
-    if (getVariableOrParamComposed(elemVar.getName()) == null)
-    {
-      elemVar.setIsTopLevel(true);        // Mark as a top-level variable or param
-      elemVar.setIndex(m_variables.size());
-      m_variables.addElement(elemVar);
-    }
-  }
-
-  /**
-   * Get an "xsl:variable" property.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @param qname Qualified name of variable or param
-   *
-   * @return The ElemVariable with the given qualified name
-   */
-  public ElemVariable getVariableOrParamComposed(QName qname)
-  {
-    if (null != m_variables)
-    {
-      int n = m_variables.size();
-
-      for (int i = 0; i < n; i++)
-      {
-        ElemVariable var = (ElemVariable)m_variables.elementAt(i);
-        if(var.getName().equals(qname))
-          return var;
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * Get all global "xsl:variable" properties in scope for this stylesheet.
-   * @see <a href="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
-   *
-   * @return Vector of all variables and params in scope
-   */
-  public Vector getVariablesAndParamsComposed()
-  {
-    return m_variables;
-  }
-
-  /**
-   * A list of properties that specify how to do space
-   * stripping. This uses the same exact mechanism as Templates.
-   * @serial
-   */
-  private TemplateList m_whiteSpaceInfoList;
-
-  /**
-   * Recompose the strip-space and preserve-space declarations.
-   *
-   * @param wsi A WhiteSpaceInfo element to add to the list of WhiteSpaceInfo elements.
-   */
-  void recomposeWhiteSpaceInfo(WhiteSpaceInfo wsi)
-  {
-    if (null == m_whiteSpaceInfoList)
-      m_whiteSpaceInfoList = new TemplateList();
-
-    m_whiteSpaceInfoList.setTemplate(wsi);
-  }
-
-  /**
-   * Check to see if the caller should bother with check for
-   * whitespace nodes.
-   *
-   * @return Whether the caller should bother with check for
-   * whitespace nodes.
-   */
-  public boolean shouldCheckWhitespace()
-  {
-    return null != m_whiteSpaceInfoList;
-  }
-
-  /**
-   * Get information about whether or not an element should strip whitespace.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param support The XPath runtime state.
-   * @param targetElement Element to check
-   *
-   * @return WhiteSpaceInfo for the given element
-   *
-   * @throws TransformerException
-   */
-  public WhiteSpaceInfo getWhiteSpaceInfo(
-          XPathContext support, int targetElement, DTM dtm) throws TransformerException
-  {
-
-    if (null != m_whiteSpaceInfoList)
-      return (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support,
-              targetElement, null, -1, false, dtm);
-    else
-      return null;
-  }
-  
-  /**
-   * Get information about whether or not an element should strip whitespace.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param support The XPath runtime state.
-   * @param targetElement Element to check
-   *
-   * @return true if the whitespace should be stripped.
-   *
-   * @throws TransformerException
-   */
-  public boolean shouldStripWhiteSpace(
-          XPathContext support, int targetElement) throws TransformerException
-  {
-    if (null != m_whiteSpaceInfoList)
-    {
-      while(DTM.NULL != targetElement)
-      {
-        DTM dtm = support.getDTM(targetElement);
-        WhiteSpaceInfo info = (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support,
-                targetElement, null, -1, false, dtm);
-        if(null != info)
-          return info.getShouldStripSpace();
-        
-        int parent = dtm.getParent(targetElement);
-        if(DTM.NULL != parent && DTM.ELEMENT_NODE == dtm.getNodeType(parent))
-          targetElement = parent;
-        else
-          targetElement = DTM.NULL;
-      }
-    }
-    return false;
-  }
-  
-  /**
-   * Get information about whether or not whitespace can be stripped.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @return true if the whitespace can be stripped.
-   */
-  public boolean canStripWhiteSpace()
-  {
-    return (null != m_whiteSpaceInfoList);
-  }
-  
-
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The default template to use for text nodes if we don't find
-   * anything else.  This is initialized in initDefaultRule().
-   * @serial
-   */
-  private ElemTemplate m_defaultTextRule;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the default template for text.
-   *
-   * @return the default template for text.
-   */
-  public final ElemTemplate getDefaultTextRule()
-  {
-    return m_defaultTextRule;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The default template to use if we don't find anything
-   * else.  This is initialized in initDefaultRule().
-   * @serial
-   */
-  private ElemTemplate m_defaultRule;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the default template for elements.
-   *
-   * @return the default template for elements.
-   */
-  public final ElemTemplate getDefaultRule()
-  {
-    return m_defaultRule;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The default template to use for the root if we don't find
-   * anything else.  This is initialized in initDefaultRule().
-   * We kind of need this because the defaultRule isn't good
-   * enough because it doesn't supply a document context.
-   * For now, I default the root document element to "HTML".
-   * Don't know if this is really a good idea or not.
-   * I suspect it is not.
-   * @serial
-   */
-  private ElemTemplate m_defaultRootRule;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the default template for a root node.
-   *
-   * @return The default template for a root node.
-   */
-  public final ElemTemplate getDefaultRootRule()
-  {
-    return m_defaultRootRule;
-  }
-  
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The start rule to kick off the transformation.
-   * @serial
-   */
-  private ElemTemplate m_startRule;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the default template for a root node.
-   *
-   * @return The default template for a root node.
-   */
-  public final ElemTemplate getStartRule()
-  {
-    return m_startRule;
-  }
-
-
-  /**
-   * Used for default selection.
-   * @serial
-   */
-  XPath m_selectDefault;
-
-  /**
-   * Create the default rule if needed.
-   *
-   * @throws TransformerException
-   */
-  private void initDefaultRule(ErrorListener errorListener) throws TransformerException
-  {
-
-    // Then manufacture a default
-    m_defaultRule = new ElemTemplate();
-
-    m_defaultRule.setStylesheet(this);
-
-    XPath defMatch = new XPath("*", this, this, XPath.MATCH, errorListener);
-
-    m_defaultRule.setMatch(defMatch);
-
-    ElemApplyTemplates childrenElement = new ElemApplyTemplates();
-
-    childrenElement.setIsDefaultTemplate(true);
-    childrenElement.setSelect(m_selectDefault);
-    m_defaultRule.appendChild(childrenElement);
-    
-    m_startRule = m_defaultRule;
-
-    // -----------------------------
-    m_defaultTextRule = new ElemTemplate();
-
-    m_defaultTextRule.setStylesheet(this);
-
-    defMatch = new XPath("text() | @*", this, this, XPath.MATCH, errorListener);
-
-    m_defaultTextRule.setMatch(defMatch);
-
-    ElemValueOf elemValueOf = new ElemValueOf();
-
-    m_defaultTextRule.appendChild(elemValueOf);
-
-    XPath selectPattern = new XPath(".", this, this, XPath.SELECT, errorListener);
-
-    elemValueOf.setSelect(selectPattern);
-
-    //--------------------------------
-    m_defaultRootRule = new ElemTemplate();
-
-    m_defaultRootRule.setStylesheet(this);
-
-    defMatch = new XPath("/", this, this, XPath.MATCH, errorListener);
-
-    m_defaultRootRule.setMatch(defMatch);
-
-    childrenElement = new ElemApplyTemplates();
-
-    childrenElement.setIsDefaultTemplate(true);
-    m_defaultRootRule.appendChild(childrenElement);
-    childrenElement.setSelect(m_selectDefault);
-  }
-
-  /**
-   * This is a generic version of C.A.R Hoare's Quick Sort
-   * algorithm.  This will handle arrays that are already
-   * sorted, and arrays with duplicate keys.  It was lifted from
-   * the NodeSorter class but should probably be eliminated and replaced
-   * with a call to Collections.sort when we migrate to Java2.<BR>
-   *
-   * If you think of a one dimensional array as going from
-   * the lowest index on the left to the highest index on the right
-   * then the parameters to this function are lowest index or
-   * left and highest index or right.  The first time you call
-   * this function it will be with the parameters 0, a.length - 1.
-   *
-   * @param v       a vector of ElemTemplateElement elements 
-   * @param lo0     left boundary of partition
-   * @param hi0     right boundary of partition
-   *
-   */
-
-  private void QuickSort2(Vector v, int lo0, int hi0)
-    {
-      int lo = lo0;
-      int hi = hi0;
-
-      if ( hi0 > lo0)
-      {
-        // Arbitrarily establishing partition element as the midpoint of
-        // the array.
-        ElemTemplateElement midNode = (ElemTemplateElement) v.elementAt( ( lo0 + hi0 ) / 2 );
-
-        // loop through the array until indices cross
-        while( lo <= hi )
-        {
-          // find the first element that is greater than or equal to
-          // the partition element starting from the left Index.
-          while( (lo < hi0) && (((ElemTemplateElement) v.elementAt(lo)).compareTo(midNode) < 0) )
-          {
-            ++lo;
-          } // end while
-
-          // find an element that is smaller than or equal to
-          // the partition element starting from the right Index.
-          while( (hi > lo0) && (((ElemTemplateElement) v.elementAt(hi)).compareTo(midNode) > 0) )          {
-            --hi;
-          }
-
-          // if the indexes have not crossed, swap
-          if( lo <= hi )
-          {
-            ElemTemplateElement node = (ElemTemplateElement) v.elementAt(lo);
-            v.setElementAt(v.elementAt(hi), lo);
-            v.setElementAt(node, hi);
-
-            ++lo;
-            --hi;
-          }
-        }
-
-        // If the right index has not reached the left side of array
-        // must now sort the left partition.
-        if( lo0 < hi )
-        {
-          QuickSort2( v, lo0, hi );
-        }
-
-        // If the left index has not reached the right side of array
-        // must now sort the right partition.
-        if( lo < hi0 )
-        {
-          QuickSort2( v, lo, hi0 );
-        }
-      }
-    } // end QuickSort2  */
-    
-    private ComposeState m_composeState;
-    
-    /**
-     * Initialize a new ComposeState.
-     */
-    void initComposeState()
-    {
-      m_composeState = new ComposeState();
-    }
-
-    /**
-     * Return class to track state global state during the compose() operation.
-     * @return ComposeState reference, or null if endCompose has been called.
-     */
-    ComposeState getComposeState()
-    {
-      return m_composeState;
-    }
-    
-    /**
-     * Clear the compose state.
-     */
-    private void clearComposeState()
-    {
-      m_composeState = null;
-    }
-    
-    /**
-     * Class to track state global state during the compose() operation.
-     */
-    class ComposeState
-    {
-      ComposeState()
-      {
-        int size = m_variables.size();
-        for (int i = 0; i < size; i++) 
-        {
-          ElemVariable ev = (ElemVariable)m_variables.elementAt(i);
-          m_variableNames.addElement(ev.getName());
-        }
-        
-      }
-      
-      private ExpandedNameTable m_ent = new ExpandedNameTable();
-      
-      /**
-       * Given a qualified name, return an integer ID that can be 
-       * quickly compared.
-       *
-       * @param qname a qualified name object, must not be null.
-       *
-       * @return the expanded-name id of the qualified name.
-       */
-      public int getQNameID(QName qname)
-      {
-        
-        return m_ent.getExpandedTypeID(qname.getNamespace(), 
-                                       qname.getLocalName(),
-                                       // The type doesn't matter for our 
-                                       // purposes. 
-                                       org.apache.xml.dtm.DTM.ELEMENT_NODE);
-      }
-      
-      /**
-       * A Vector of the current params and QNames within the current template.
-       * Set by ElemTemplate and used by ProcessorVariable.
-       */
-      private java.util.Vector m_variableNames = new java.util.Vector();
-            
-      /**
-       * Add the name of a qualified name within the template.  The position in 
-       * the vector is its ID.
-       * @param qname A qualified name of a param or variable, should be non-null.
-       * @return the index where the variable was added.
-       */
-      int addVariableName(final org.apache.xml.utils.QName qname)
-      {
-        int pos = m_variableNames.size();
-        m_variableNames.addElement(qname);
-        int frameSize = m_variableNames.size() - getGlobalsSize();
-        if(frameSize > m_maxStackFrameSize)
-          m_maxStackFrameSize++;
-        return pos;
-      }
-      
-      void resetStackFrameSize()
-      {
-        m_maxStackFrameSize = 0;
-      }
-      
-      int getFrameSize()
-      {
-        return m_maxStackFrameSize;
-      }
-      
-      /**
-       * Get the current size of the stack frame.  Use this to record the position 
-       * in a template element at startElement, so that it can be popped 
-       * at endElement.
-       */
-      int getCurrentStackFrameSize()
-      {
-        return m_variableNames.size();
-      }
-      
-      /**
-       * Set the current size of the stack frame.
-       */
-      void setCurrentStackFrameSize(int sz)
-      {
-        m_variableNames.setSize(sz);
-      }
-      
-      int getGlobalsSize()
-      {
-        return m_variables.size();
-      }
-      
-      IntStack m_marks = new IntStack();
-      
-      void pushStackMark()
-      {
-        m_marks.push(getCurrentStackFrameSize());
-      }
-      
-      void popStackMark()
-      {
-        int mark = m_marks.pop();
-        setCurrentStackFrameSize(mark);
-      }
-      
-      /**
-       * Get the Vector of the current params and QNames to be collected 
-       * within the current template.
-       * @return A reference to the vector of variable names.  The reference 
-       * returned is owned by this class, and so should not really be mutated, or 
-       * stored anywhere.
-       */
-      java.util.Vector getVariableNames()
-      {
-        return m_variableNames;
-      }
-      
-      private int m_maxStackFrameSize;
-
-    }
-}
diff --git a/src/org/apache/xalan/templates/TemplateList.java b/src/org/apache/xalan/templates/TemplateList.java
deleted file mode 100644
index 9544d94..0000000
--- a/src/org/apache/xalan/templates/TemplateList.java
+++ /dev/null
@@ -1,894 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Enumeration;
-
-import java.io.Serializable;
-
-//import org.w3c.dom.Node;
-import org.apache.xml.dtm.DTM;
-
-import org.apache.xml.dtm.ref.ExpandedNameTable;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.PsuedoNames;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.Expression;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.patterns.StepPattern;
-import org.apache.xpath.patterns.UnionPattern;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Encapsulates a template list, and helps locate individual templates.
- */
-public class TemplateList implements java.io.Serializable
-{
-
-  /**
-   * Construct a TemplateList object. Needs to be public so it can
-   * be invoked from the CompilingStylesheetHandler.
-   */
-  public TemplateList()
-  {
-    super();
-  }
-
-  /**
-   * Add a template to the table of named templates and/or the table of templates
-   * with match patterns.  This routine should
-   * be called in decreasing order of precedence but it checks nonetheless.
-   *
-   * @param template
-   */
-  public void setTemplate(ElemTemplate template)
-  {
-    if (null != template.getName())
-    {
-      ElemTemplate existingTemplate = (ElemTemplate) m_namedTemplates.get(template.getName());
-      if (null == existingTemplate)
-      {
-        m_namedTemplates.put(template.getName(), template);
-      }
-      else
-      {
-        int existingPrecedence =
-                        existingTemplate.getStylesheetComposed().getImportCountComposed();
-        int newPrecedence = template.getStylesheetComposed().getImportCountComposed();
-        if (newPrecedence > existingPrecedence)
-        {
-          // This should never happen
-          m_namedTemplates.put(template.getName(), template);
-        }
-        else if (newPrecedence == existingPrecedence)
-          template.error(XSLTErrorResources.ER_DUPLICATE_NAMED_TEMPLATE,
-                       new Object[]{ template.getName() });
-      }
-    }
-
-    XPath matchXPath = template.getMatch();
-
-    if (null != matchXPath)
-    {
-      Expression matchExpr = matchXPath.getExpression();
-
-      if (matchExpr instanceof StepPattern)
-      {
-        insertPatternInTable((StepPattern) matchExpr, template);
-      }
-      else if (matchExpr instanceof UnionPattern)
-      {
-        UnionPattern upat = (UnionPattern) matchExpr;
-        StepPattern[] pats = upat.getPatterns();
-        int n = pats.length;
-
-        for (int i = 0; i < n; i++)
-        {
-          insertPatternInTable(pats[i], template);
-        }
-      }
-      else
-      {
-
-        // TODO: assert error
-      }
-    }
-  }
-
-  /** Flag to indicate whether in DEBUG mode          */
-  static boolean DEBUG = false;
-
-  /**
-   * Dump all patterns and elements that match those patterns
-   *
-   */
-  void dumpAssociationTables()
-  {
-
-    Enumeration associations = m_patternTable.elements();
-
-    while (associations.hasMoreElements())
-    {
-      TemplateSubPatternAssociation head =
-        (TemplateSubPatternAssociation) associations.nextElement();
-
-      while (null != head)
-      {
-        System.out.print("(" + head.getTargetString() + ", "
-                         + head.getPattern() + ")");
-
-        head = head.getNext();
-      }
-
-      System.out.println("\n.....");
-    }
-
-    TemplateSubPatternAssociation head = m_wildCardPatterns;
-
-    System.out.print("wild card list: ");
-
-    while (null != head)
-    {
-      System.out.print("(" + head.getTargetString() + ", "
-                       + head.getPattern() + ")");
-
-      head = head.getNext();
-    }
-
-    System.out.println("\n.....");
-  }
-
-  /**
-   * After all templates have been added, this function
-   * should be called.
-   */
-  public void compose(StylesheetRoot sroot)
-  {
-
-    if (DEBUG)
-    {
-      System.out.println("Before wildcard insert...");
-      dumpAssociationTables();
-    }
-
-    if (null != m_wildCardPatterns)
-    {
-      Enumeration associations = m_patternTable.elements();
-
-      while (associations.hasMoreElements())
-      {
-        TemplateSubPatternAssociation head =
-          (TemplateSubPatternAssociation) associations.nextElement();
-        TemplateSubPatternAssociation wild = m_wildCardPatterns;
-
-        while (null != wild)
-        {
-          try
-          {
-            head = insertAssociationIntoList(
-              head, (TemplateSubPatternAssociation) wild.clone(), true);
-          }
-          catch (CloneNotSupportedException cnse){}
-
-          wild = wild.getNext();
-        }
-      }
-    }
-
-    if (DEBUG)
-    {
-      System.out.println("After wildcard insert...");
-      dumpAssociationTables();
-    }
-  }
-
-  /**
-   * Insert the given TemplateSubPatternAssociation into the the linked
-   * list.  Sort by import precedence, then priority, then by document order.
-   *
-   * @param head The first TemplateSubPatternAssociation in the linked list.
-   * @param item The item that we want to insert into the proper place.
-   * @param isWildCardInsert <code>true</code> if we are inserting a wild card 
-   *             template onto this list.
-   * @return the new head of the list.
-   */
-  private TemplateSubPatternAssociation
-              insertAssociationIntoList(TemplateSubPatternAssociation head,
-                                         TemplateSubPatternAssociation item,
-                                         boolean isWildCardInsert)
-  {
-
-    // Sort first by import level (higher level is at front),
-    // then by priority (highest priority is at front),
-    // then by document order (later in document is at front).
-
-    double priority = getPriorityOrScore(item);
-    double workPriority;
-    int importLevel = item.getImportLevel();
-    int docOrder = item.getDocOrderPos();
-    TemplateSubPatternAssociation insertPoint = head;
-    TemplateSubPatternAssociation next;
-    boolean insertBefore;         // true means insert before insertPoint; otherwise after
-                                  // This can only be true if insertPoint is pointing to
-                                  // the first or last template.
-
-    // Spin down so that insertPoint points to:
-    // (a) the template immediately _before_ the first template on the chain with
-    // a precedence that is either (i) less than ours or (ii) the same as ours but
-    // the template document position is less than ours
-    // -or-
-    // (b) the last template on the chain if no such template described in (a) exists.
-    // If we are pointing to the first template or the last template (that is, case b),
-    // we need to determine whether to insert before or after the template.  Otherwise,
-    // we always insert after the insertPoint.
-
-    while (true)
-    {
-      next = insertPoint.getNext();
-      if (null == next)
-        break;
-      else
-      {
-        workPriority = getPriorityOrScore(next);
-        if (importLevel > next.getImportLevel())
-          break;
-        else if (importLevel < next.getImportLevel())
-          insertPoint = next;
-        else if (priority > workPriority)               // import precedence is equal
-          break;
-        else if (priority < workPriority)
-          insertPoint = next;
-        else if (docOrder >= next.getDocOrderPos())     // priorities, import are equal
-          break;
-        else
-          insertPoint = next;
-      }
-    }
-
-    if ( (null == next) || (insertPoint == head) )      // insert point is first or last
-    {
-      workPriority = getPriorityOrScore(insertPoint);
-      if (importLevel > insertPoint.getImportLevel())
-        insertBefore = true;
-      else if (importLevel < insertPoint.getImportLevel())
-        insertBefore = false;
-      else if (priority > workPriority)
-        insertBefore = true;
-      else if (priority < workPriority)
-        insertBefore = false;
-      else if (docOrder >= insertPoint.getDocOrderPos())
-        insertBefore = true;
-      else
-        insertBefore = false;
-    }
-    else
-      insertBefore = false;
-
-    // System.out.println("appending: "+target+" to "+matchPat.getPattern());
-    
-    if (isWildCardInsert)
-    {
-      if (insertBefore)
-      {
-        item.setNext(insertPoint);
-
-        String key = insertPoint.getTargetString();
-
-        item.setTargetString(key);
-        putHead(key, item);
-        return item;
-      }
-      else
-      {
-        item.setNext(next);
-        insertPoint.setNext(item);
-        return head;
-      }
-    }
-    else
-    {
-      if (insertBefore)
-      {
-        item.setNext(insertPoint);
-
-        if (insertPoint.isWild() || item.isWild())
-          m_wildCardPatterns = item;
-        else
-          putHead(item.getTargetString(), item);
-        return item;
-      }
-      else
-      {
-        item.setNext(next);
-        insertPoint.setNext(item);
-        return head;
-      }
-    }
-  }
-
-  /**
-   * Add a template to the template list.
-   *
-   * @param pattern
-   * @param template
-   */
-  private void insertPatternInTable(StepPattern pattern, ElemTemplate template)
-  {
-
-    String target = pattern.getTargetString();
-
-    if (null != target)
-    {
-      String pstring = template.getMatch().getPatternString();
-      TemplateSubPatternAssociation association =
-        new TemplateSubPatternAssociation(template, pattern, pstring);
-
-      // See if there's already one there
-      boolean isWildCard = association.isWild();
-      TemplateSubPatternAssociation head = isWildCard
-                                           ? m_wildCardPatterns
-                                           : getHead(target);
-
-      if (null == head)
-      {
-        if (isWildCard)
-          m_wildCardPatterns = association;
-        else
-          putHead(target, association);
-      }
-      else
-      {
-        insertAssociationIntoList(head, association, false);
-      }
-    }
-  }
-
-  /**
-   * Given a match pattern and template association, return the 
-   * score of that match.  This score or priority can always be 
-   * statically calculated.
-   *
-   * @param matchPat The match pattern to template association.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST}, 
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE}, 
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD}, 
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}, or 
-   *         the value defined by the priority attribute of the template.
-   *
-   */
-  private double getPriorityOrScore(TemplateSubPatternAssociation matchPat)
-  {
-
-    double priority = matchPat.getTemplate().getPriority();
-
-    if (priority == XPath.MATCH_SCORE_NONE)
-    {
-      Expression ex = matchPat.getStepPattern();
-
-      if (ex instanceof NodeTest)
-      {
-        return ((NodeTest) ex).getDefaultScore();
-      }
-    }
-
-    return priority;
-  }
-
-  /**
-   * Locate a named template.
-   *
-   * @param qname  Qualified name of the template.
-   *
-   * @return Template argument with the requested name, or null if not found.
-   */
-  public ElemTemplate getTemplate(QName qname)
-  {
-    return (ElemTemplate) m_namedTemplates.get(qname);
-  }
-
-  /**
-   * Get the head of the most likely list of associations to check, based on 
-   * the name and type of the targetNode argument.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param targetNode The target node that will be checked for a match.
-   * @param dtm The dtm owner for the target node.
-   *
-   * @return The head of a linked list that contains all possible match pattern to 
-   * template associations.
-   */
-  public TemplateSubPatternAssociation getHead(XPathContext xctxt, 
-                                               int targetNode, DTM dtm)
-  {
-    short targetNodeType = dtm.getNodeType(targetNode);
-    TemplateSubPatternAssociation head;
-
-    switch (targetNodeType)
-    {
-    case DTM.ELEMENT_NODE :
-    case DTM.ATTRIBUTE_NODE :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getLocalName(targetNode));
-      break;
-    case DTM.TEXT_NODE :
-    case DTM.CDATA_SECTION_NODE :
-      head = m_textPatterns;
-      break;
-    case DTM.ENTITY_REFERENCE_NODE :
-    case DTM.ENTITY_NODE :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
-      break;
-    case DTM.PROCESSING_INSTRUCTION_NODE :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getLocalName(targetNode));
-      break;
-    case DTM.COMMENT_NODE :
-      head = m_commentPatterns;
-      break;
-    case DTM.DOCUMENT_NODE :
-    case DTM.DOCUMENT_FRAGMENT_NODE :
-      head = m_docPatterns;
-      break;
-    case DTM.NOTATION_NODE :
-    default :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
-    }
-
-    return (null == head) ? m_wildCardPatterns : head;
-  }
-  
-  /**
-   * Given a target element, find the template that best
-   * matches in the given XSL document, according
-   * to the rules specified in the xsl draft.  This variation of getTemplate 
-   * assumes the current node and current expression node have already been 
-   * pushed. 
-   *
-   * @param xctxt
-   * @param targetNode
-   * @param mode A string indicating the display mode.
-   * @param maxImportLevel The maximum importCountComposed that we should consider or -1
-   *        if we should consider all import levels.  This is used by apply-imports to
-   *        access templates that have been overridden.
-   * @param quietConflictWarnings
-   * @return Rule that best matches targetElem.
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public ElemTemplate getTemplateFast(XPathContext xctxt,
-                                int targetNode,
-                                int expTypeID,
-                                QName mode,
-                                int maxImportLevel,
-                                boolean quietConflictWarnings,
-                                DTM dtm)
-            throws TransformerException
-  {
-    
-    TemplateSubPatternAssociation head;
-
-    switch (expTypeID >> ExpandedNameTable.ROTAMOUNT_TYPE)
-    {
-    case DTM.ELEMENT_NODE :
-    case DTM.ATTRIBUTE_NODE :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getLocalNameFromExpandedNameID(expTypeID));
-      break;
-    case DTM.TEXT_NODE :
-    case DTM.CDATA_SECTION_NODE :
-      head = m_textPatterns;
-      break;
-    case DTM.ENTITY_REFERENCE_NODE :
-    case DTM.ENTITY_NODE :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
-      break;
-    case DTM.PROCESSING_INSTRUCTION_NODE :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getLocalName(targetNode));
-      break;
-    case DTM.COMMENT_NODE :
-      head = m_commentPatterns;
-      break;
-    case DTM.DOCUMENT_NODE :
-    case DTM.DOCUMENT_FRAGMENT_NODE :
-      head = m_docPatterns;
-      break;
-    case DTM.NOTATION_NODE :
-    default :
-      head = (TemplateSubPatternAssociation) m_patternTable.get(
-        dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
-    }
-
-    if(null == head)
-    {
-      head = m_wildCardPatterns;
-      if(null == head)
-        return null;
-    }                                              
-
-    // XSLT functions, such as xsl:key, need to be able to get to 
-    // current ElemTemplateElement via a cast to the prefix resolver.
-    // Setting this fixes bug idkey03.
-    xctxt.pushNamespaceContextNull();
-    try
-    {
-      do
-      {
-        if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel) )
-        {
-          continue;
-        }
-        ElemTemplate template = head.getTemplate();        
-        xctxt.setNamespaceContext(template);
-        
-        if ((head.m_stepPattern.execute(xctxt, targetNode, dtm, expTypeID) != NodeTest.SCORE_NONE)
-                && head.matchMode(mode))
-        {
-          if (quietConflictWarnings)
-            checkConflicts(head, xctxt, targetNode, mode);
-
-          return template;
-        }
-      }
-      while (null != (head = head.getNext()));
-    }
-    finally
-    {
-      xctxt.popNamespaceContext();
-    }
-
-    return null;
-  }  // end findTemplate
-
-  /**
-   * Given a target element, find the template that best
-   * matches in the given XSL document, according
-   * to the rules specified in the xsl draft.
-   *
-   * @param xctxt
-   * @param targetNode
-   * @param mode A string indicating the display mode.
-   * @param maxImportLevel The maximum importCountComposed that we should consider or -1
-   *        if we should consider all import levels.  This is used by apply-imports to
-   *        access templates that have been overridden.
-   * @param quietConflictWarnings
-   * @return Rule that best matches targetElem.
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public ElemTemplate getTemplate(XPathContext xctxt,
-                                int targetNode,
-                                QName mode,
-                                int maxImportLevel,
-                                boolean quietConflictWarnings,
-                                DTM dtm)
-            throws TransformerException
-  {
-
-    TemplateSubPatternAssociation head = getHead(xctxt, targetNode, dtm);
-
-    if (null != head)
-    {
-      // XSLT functions, such as xsl:key, need to be able to get to 
-      // current ElemTemplateElement via a cast to the prefix resolver.
-      // Setting this fixes bug idkey03.
-      xctxt.pushNamespaceContextNull();
-      xctxt.pushCurrentNodeAndExpression(targetNode, targetNode);
-      try
-      {
-        do
-        {
-          if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel) )
-          {
-            continue;
-          }
-          ElemTemplate template = head.getTemplate();        
-          xctxt.setNamespaceContext(template);
-          
-          if ((head.m_stepPattern.execute(xctxt, targetNode) != NodeTest.SCORE_NONE)
-                  && head.matchMode(mode))
-          {
-            if (quietConflictWarnings)
-              checkConflicts(head, xctxt, targetNode, mode);
-
-            return template;
-          }
-        }
-        while (null != (head = head.getNext()));
-      }
-      finally
-      {
-        xctxt.popCurrentNodeAndExpression();
-        xctxt.popNamespaceContext();
-      }
-    }
-
-    return null;
-  }  // end findTemplate
-
-  /**
-   * Get a TemplateWalker for use by a compiler.  See the documentation for
-   * the TreeWalker inner class for further details.
-   */
-  public TemplateWalker getWalker()
-  {
-    return new TemplateWalker();
-  }
-
-  /**
-   * Check for match conflicts, and warn the stylesheet author.
-   *
-   * @param head Template pattern
-   * @param xctxt Current XPath context
-   * @param targetNode Node matching the pattern
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   */
-  private void checkConflicts(TemplateSubPatternAssociation head,
-                              XPathContext xctxt, int targetNode, QName mode)
-  {
-
-    // TODO: Check for conflicts.
-  }
-
-  /**
-   * Add object to vector if not already there.
-   *
-   * @param obj
-   * @param v
-   */
-  private void addObjectIfNotFound(Object obj, Vector v)
-  {
-
-    int n = v.size();
-    boolean addIt = true;
-
-    for (int i = 0; i < n; i++)
-    {
-      if (v.elementAt(i) == obj)
-      {
-        addIt = false;
-
-        break;
-      }
-    }
-
-    if (addIt)
-    {
-      v.addElement(obj);
-    }
-  }
-
-  /**
-   * Keyed on string macro names, and holding values
-   * that are macro elements in the XSL DOM tree.
-   * Initialized in initMacroLookupTable, and used in
-   * findNamedTemplate.
-   * @serial
-   */
-  private Hashtable m_namedTemplates = new Hashtable(89);
-
-  /**
-   * This table is keyed on the target elements
-   * of patterns, and contains linked lists of
-   * the actual patterns that match the target element
-   * to some degree of specifity.
-   * @serial
-   */
-  private Hashtable m_patternTable = new Hashtable(89);
-
-  /** Wildcard patterns.
-   *  @serial          */
-  private TemplateSubPatternAssociation m_wildCardPatterns = null;
-
-  /** Text Patterns.
-   *  @serial          */
-  private TemplateSubPatternAssociation m_textPatterns = null;
-
-  /** Root document Patterns.
-   *  @serial          */
-  private TemplateSubPatternAssociation m_docPatterns = null;
-
-  /** Comment Patterns.
-   *  @serial          */
-  private TemplateSubPatternAssociation m_commentPatterns = null;
-
-  /**
-   * Get table of named Templates.
-   * These are keyed on template names, and holding values
-   * that are template elements.
-   *
-   * @return A Hashtable dictionary that contains {@link java.lang.String}s 
-   * as the keys, and {@link org.apache.xalan.templates.ElemTemplate}s as the 
-   * values. 
-   */
-  private Hashtable getNamedTemplates()
-  {
-    return m_namedTemplates;
-  }
-
-  /**
-   * Set table of named Templates.
-   * These are keyed on string macro names, and holding values
-   * that are template elements in the XSL DOM tree.
-   *
-   * @param v Hashtable dictionary that contains {@link java.lang.String}s 
-   * as the keys, and {@link org.apache.xalan.templates.ElemTemplate}s as the 
-   * values.
-   */
-  private void setNamedTemplates(Hashtable v)
-  {
-    m_namedTemplates = v;
-  }
-
-  /**
-   * Get the head of the assocation list that is keyed by target.
-   *
-   * @param key The name of a node. 
-   *
-   * @return The head of a linked list that contains all possible match pattern to 
-   * template associations for the given key.
-   */
-  private TemplateSubPatternAssociation getHead(String key)
-  {
-    return (TemplateSubPatternAssociation) m_patternTable.get(key);
-  }
-
-  /**
-   * Get the head of the assocation list that is keyed by target.
-   *
-   * @param key
-   * @param assoc
-   */
-  private void putHead(String key, TemplateSubPatternAssociation assoc)
-  {
-
-    if (key.equals(PsuedoNames.PSEUDONAME_TEXT))
-      m_textPatterns = assoc;
-    else if (key.equals(PsuedoNames.PSEUDONAME_ROOT))
-      m_docPatterns = assoc;
-    else if (key.equals(PsuedoNames.PSEUDONAME_COMMENT))
-      m_commentPatterns = assoc;
-
-    m_patternTable.put(key, assoc);
-  }
-
-  /**
-   * An inner class used by a compiler to iterate over all of the ElemTemplates
-   * stored in this TemplateList.  The compiler can replace returned templates
-   * with their compiled equivalent.
-   */
-  public class TemplateWalker
-  {
-    private Enumeration hashIterator;
-    private boolean inPatterns;
-    private TemplateSubPatternAssociation curPattern;
-
-    private Hashtable m_compilerCache = new Hashtable();
-
-    private TemplateWalker()
-    {
-      hashIterator = m_patternTable.elements();
-      inPatterns = true;
-      curPattern = null;
-    }
-
-    public ElemTemplate next()
-    {
-
-      ElemTemplate retValue = null;
-      ElemTemplate ct;
-
-      while (true)
-      {
-        if (inPatterns)
-        {
-          if (null != curPattern)
-            curPattern = curPattern.getNext();
-
-          if (null != curPattern)
-            retValue = curPattern.getTemplate();
-          else
-          {
-            if (hashIterator.hasMoreElements())
-            {
-              curPattern = (TemplateSubPatternAssociation) hashIterator.nextElement();
-              retValue =  curPattern.getTemplate();
-            }
-            else
-            {
-              inPatterns = false;
-              hashIterator = m_namedTemplates.elements();
-            }
-          }
-        }
-
-        if (!inPatterns)
-        {
-          if (hashIterator.hasMoreElements())
-            retValue = (ElemTemplate) hashIterator.nextElement();
-          else
-            return null;
-        }
-
-        ct = (ElemTemplate) m_compilerCache.get(new Integer(retValue.getUid()));
-        if (null == ct)
-        {
-          m_compilerCache.put(new Integer(retValue.getUid()), retValue);
-          return retValue;
-        }
-      }
-    }
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/TemplateSubPatternAssociation.java b/src/org/apache/xalan/templates/TemplateSubPatternAssociation.java
deleted file mode 100644
index 4d55175..0000000
--- a/src/org/apache/xalan/templates/TemplateSubPatternAssociation.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import java.io.Serializable;
-
-//import org.w3c.dom.Node;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.patterns.StepPattern;
-import org.apache.xml.utils.QName;
-
-/**
- * A class to contain a match pattern and it's corresponding template.
- * This class also defines a node in a match pattern linked list.
- */
-class TemplateSubPatternAssociation implements Serializable, Cloneable
-{
-
-  /** Step pattern           */
-  StepPattern m_stepPattern;
-
-  /** Template pattern          */
-  private String m_pattern;
-
-  /** The template element         */
-  private ElemTemplate m_template;
-
-  /** Next pattern         */
-  private TemplateSubPatternAssociation m_next = null;
-
-  /** Flag indicating whether this is wild card pattern          */
-  private boolean m_wild;
-
-  /** Target string for this match pattern           */
-  private String m_targetString;
-
-  /**
-   * Construct a match pattern from a pattern and template.
-   * @param template The node that contains the template for this pattern.
-   * @param pattern An executable XSLT StepPattern.
-   * @param pat For now a Nodelist that contains old-style element patterns.
-   */
-  TemplateSubPatternAssociation(ElemTemplate template, StepPattern pattern, String pat)
-  {
-
-    m_pattern = pat;
-    m_template = template;
-    m_stepPattern = pattern;
-    m_targetString = m_stepPattern.getTargetString();
-    m_wild = m_targetString.equals("*");
-  }
-
-  /**
-   * Clone this object.
-   *
-   * @return The cloned object.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    TemplateSubPatternAssociation tspa =
-      (TemplateSubPatternAssociation) super.clone();
-
-    tspa.m_next = null;
-
-    return tspa;
-  }
-
-  /**
-   * Get the target string of the pattern.  For instance, if the pattern is
-   * "foo/baz/boo[@daba]", this string will be "boo".
-   *
-   * @return The "target" string.
-   */
-  public final String getTargetString()
-  {
-    return m_targetString;
-  }
-
-  /**
-   * Set Target String for this template pattern  
-   *
-   *
-   * @param key Target string to set
-   */
-  public void setTargetString(String key)
-  {
-    m_targetString = key;
-  }
-
-  /**
-   * Tell if two modes match according to the rules of XSLT.
-   *
-   * @param m1 mode to match
-   *
-   * @return True if the given mode matches this template's mode
-   */
-  boolean matchMode(QName m1)
-  {
-    return matchModes(m1, m_template.getMode());
-  }
-
-  /**
-   * Tell if two modes match according to the rules of XSLT.
-   *
-   * @param m1 First mode to match
-   * @param m2 Second mode to match
-   *
-   * @return True if the two given modes match
-   */
-  private boolean matchModes(QName m1, QName m2)
-  {
-    return (((null == m1) && (null == m2))
-            || ((null != m1) && (null != m2) && m1.equals(m2)));
-  }
-
-  /**
-   * Return the mode associated with the template.
-   *
-   *
-   * @param xctxt XPath context to use with this template
-   * @param targetNode Target node
-   * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
-   * @return The mode associated with the template.
-   *
-   * @throws TransformerException
-   */
-  public boolean matches(XPathContext xctxt, int targetNode, QName mode)
-          throws TransformerException
-  {
-
-    double score = m_stepPattern.getMatchScore(xctxt, targetNode);
-
-    return (XPath.MATCH_SCORE_NONE != score)
-           && matchModes(mode, m_template.getMode());
-  }
-
-  /**
-   * Tell if the pattern for this association is a wildcard.
-   *
-   * @return true if this pattern is considered to be a wild match.
-   */
-  public final boolean isWild()
-  {
-    return m_wild;
-  }
-
-  /**
-   * Get associated XSLT StepPattern.
-   *
-   * @return An executable StepPattern object, never null.
-   *
-   */
-  public final StepPattern getStepPattern()
-  {
-    return m_stepPattern;
-  }
-
-  /**
-   * Get the pattern string for diagnostic purposes.
-   *
-   * @return The pattern string for diagnostic purposes.
-   *
-   */
-  public final String getPattern()
-  {
-    return m_pattern;
-  }
-
-  /**
-   * Return the position of the template in document
-   * order in the stylesheet.
-   *
-   * @return The position of the template in the overall template order.
-   */
-  public int getDocOrderPos()
-  {
-    return m_template.getUid();
-  }
-
-  /**
-   * Return the import level associated with the stylesheet into which  
-   * this template is composed.
-   *
-   * @return The import level of this template.
-   */
-  public final int getImportLevel()
-  {
-    return m_template.getStylesheetComposed().getImportCountComposed();
-  }
-
-  /**
-   * Get the assocated xsl:template.
-   *
-   * @return An ElemTemplate, never null.
-   *
-   */
-  public final ElemTemplate getTemplate()
-  {
-    return m_template;
-  }
-
-  /**
-   * Get the next association.
-   *
-   * @return A valid TemplateSubPatternAssociation, or null.
-   */
-  public final TemplateSubPatternAssociation getNext()
-  {
-    return m_next;
-  }
-
-  /**
-   * Set the next element on this association
-   * list, which should be equal or less in priority to
-   * this association, and, if equal priority, should occur
-   * before this template in document order.
-   *
-   * @param mp The next association to score if this one fails.
-   *
-   */
-  public void setNext(TemplateSubPatternAssociation mp)
-  {
-    m_next = mp;
-  }
-}
diff --git a/src/org/apache/xalan/templates/WhiteSpaceInfo.java b/src/org/apache/xalan/templates/WhiteSpaceInfo.java
deleted file mode 100644
index 732f467..0000000
--- a/src/org/apache/xalan/templates/WhiteSpaceInfo.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xpath.XPath;
-
-/**
- * This is used as a special "fake" template that can be
- * handled by the TemplateList to do pattern matching
- * on nodes.
- */
-public class WhiteSpaceInfo extends ElemTemplate
-{
-
-  /** Flag indicating whether whitespaces should be stripped.
-   *  @serial        */
-  private boolean m_shouldStripSpace;
-
-  /**
-   * Return true if this element specifies that the node that
-   * matches the match pattern should be stripped, otherwise
-   * the space should be preserved.
-   *
-   * @return value of m_shouldStripSpace flag
-   */
-  public boolean getShouldStripSpace()
-  {
-    return m_shouldStripSpace;
-  }
-
-  /**
-   * Constructor WhiteSpaceInfo
-   *
-   *
-   * @param matchPattern Match pattern
-   * @param shouldStripSpace Flag indicating whether or not
-   * to strip whitespaces
-   * @param thisSheet The current stylesheet
-   */
-  public WhiteSpaceInfo(XPath matchPattern, boolean shouldStripSpace, Stylesheet thisSheet)
-  {
-
-    m_shouldStripSpace = shouldStripSpace;
-
-    setMatch(matchPattern);
-
-    setStylesheet(thisSheet);
-  }
-
-  /**
-   * This function is called to recompose() all of the WhiteSpaceInfo elements.
-   */
-  public void recompose(StylesheetRoot root)
-  {
-    root.recomposeWhiteSpaceInfo(this);
-  }
-
-}
diff --git a/src/org/apache/xalan/templates/XMLNSDecl.java b/src/org/apache/xalan/templates/XMLNSDecl.java
deleted file mode 100644
index ee20570..0000000
--- a/src/org/apache/xalan/templates/XMLNSDecl.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-/**
- * Represents an xmlns declaration
- */
-public class XMLNSDecl
-        implements java.io.Serializable // 20001009 jkess
-{
-
-  /**
-   * Constructor XMLNSDecl
-   *
-   * @param prefix non-null reference to prefix, using "" for default namespace.
-   * @param uri non-null reference to namespace URI.
-   * @param isExcluded true if this namespace declaration should normally be excluded.
-   */
-  public XMLNSDecl(String prefix, String uri, boolean isExcluded)
-  {
-
-    m_prefix = prefix;
-    m_uri = uri;
-    m_isExcluded = isExcluded;
-  }
-
-  /** non-null reference to prefix, using "" for default namespace.
-   *  @serial */
-  private String m_prefix;
-
-  /**
-   * Return the prefix.
-   * @return The prefix that is associated with this URI, or null
-   * if the XMLNSDecl is declaring the default namespace.
-   */
-  public String getPrefix()
-  {
-    return m_prefix;
-  }
-
-  /** non-null reference to namespace URI.
-   *  @serial  */
-  private String m_uri;
-
-  /**
-   * Return the URI.
-   * @return The URI that is associated with this declaration.
-   */
-  public String getURI()
-  {
-    return m_uri;
-  }
-
-  /** true if this namespace declaration should normally be excluded.
-   *  @serial  */
-  private boolean m_isExcluded;
-
-  /**
-   * Tell if this declaration should be excluded from the
-   * result namespace.
-   *
-   * @return true if this namespace declaration should normally be excluded.
-   */
-  public boolean getIsExcluded()
-  {
-    return m_isExcluded;
-  }
-}
diff --git a/src/org/apache/xalan/templates/XUnresolvedVariable.java b/src/org/apache/xalan/templates/XUnresolvedVariable.java
deleted file mode 100644
index d6c2f8d..0000000
--- a/src/org/apache/xalan/templates/XUnresolvedVariable.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.templates;
-
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xpath.objects.XString;
-
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-//import org.w3c.dom.DocumentFragment;
-//import org.w3c.dom.Node;
-import org.apache.xml.dtm.DTM;
-
-/**
- * An instance of this class holds unto a variable until 
- * it is executed.  It is used at this time for global 
- * variables which must (we think) forward reference.
- */
-public class XUnresolvedVariable extends XObject
-{  
-  /** The node context for execution. */
-  transient private int m_context;
-  
-  /** The transformer context for execution. */
-  transient private TransformerImpl m_transformer;
-  
-  /** An index to the point in the variable stack where we should
-   * begin variable searches for evaluation of expressions.
-   * This is -1 if m_isTopLevel is false. 
-   **/
-  transient private int m_varStackPos = -1;
-
-  /** An index into the variable stack where the variable context 
-   * ends, i.e. at the point we should terminate the search. 
-   **/
-  transient private int m_varStackContext;
-  
-  /** true if this variable or parameter is a global.
-   *  @serial */
-  private boolean m_isGlobal;
-  
-  /** true if this variable or parameter is not currently being evaluated. */
-  transient private boolean m_doneEval = true;
-  
-  /**
-   * Create an XUnresolvedVariable, that may be executed at a later time.
-   * This is primarily used so that forward referencing works with 
-   * global variables.  An XUnresolvedVariable is initially pushed 
-   * into the global variable stack, and then replaced with the real 
-   * thing when it is accessed.
-   *
-   * @param obj Must be a non-null reference to an ElemVariable.
-   * @param sourceNode The node context for execution.
-   * @param transformer The transformer execution context.
-   * @param varStackPos An index to the point in the variable stack where we should
-   * begin variable searches for evaluation of expressions.
-   * @param varStackContext An index into the variable stack where the variable context 
-   * ends, i.e. at the point we should terminate the search.
-   * @param isGlobal true if this is a global variable.
-   */
-  public XUnresolvedVariable(ElemVariable obj, int sourceNode, 
-                             TransformerImpl transformer,
-                             int varStackPos, int varStackContext,
-                             boolean isGlobal)
-  {
-    super(obj);
-    m_context = sourceNode;
-    m_transformer = transformer;
-    
-    // For globals, this value will have to be updated once we 
-    // have determined how many global variables have been pushed.
-    m_varStackPos = varStackPos;
-    
-    // For globals, this should zero.
-    m_varStackContext = varStackContext;
-    
-    m_isGlobal = isGlobal;
-  }
-    
-  /**
-   * For support of literal objects in xpaths.
-   *
-   * @param xctxt The XPath execution context.
-   *
-   * @return This object.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    if (!m_doneEval) 
-    {
-      this.m_transformer.getMsgMgr().error      
-        (xctxt.getSAXLocator(), XSLTErrorResources.ER_REFERENCING_ITSELF, 
-          new Object[]{((ElemVariable)this.object()).getName().getLocalName()}); 
-    }
-    VariableStack vars = xctxt.getVarStack();
-    
-    // These three statements need to be combined into one operation.
-    int currentFrame = vars.getStackFrame();
-    vars.setStackFrame(m_varStackPos);
-
-    try
-    {
-      m_doneEval = false;
-      ElemVariable velem = (ElemVariable)m_obj;
-      XObject var = velem.getValue(m_transformer, m_context);
-      m_doneEval = true;
-      return var;
-    }
-    finally
-    {
-      // These two statements need to be combined into one operation.
-      vars.setStackFrame(currentFrame);
-    }
-  }
-  
-  /**
-   * Set an index to the point in the variable stack where we should
-   * begin variable searches for evaluation of expressions.
-   * This is -1 if m_isTopLevel is false. 
-   * 
-   * @param top A valid value that specifies where in the variable 
-   * stack the search should begin.
-   */
-  public void setVarStackPos(int top)
-  {
-    m_varStackPos = top;
-  }
-
-  /**
-   * Set an index into the variable stack where the variable context 
-   * ends, i.e. at the point we should terminate the search.
-   * 
-   * @param The point at which the search should terminate, normally 
-   * zero for global variables.
-   */
-  public void setVarStackContext(int bottom)
-  {
-    m_varStackContext = bottom;
-  }
-  
-  /**
-   * Tell what kind of class this is.
-   *
-   * @return CLASS_UNRESOLVEDVARIABLE
-   */
-  public int getType()
-  {
-    return CLASS_UNRESOLVEDVARIABLE;
-  }
-  
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return An informational string.
-   */
-  public String getTypeString()
-  {
-    return "XUnresolvedVariable (" + object().getClass().getName() + ")";
-  }
-
-
-}
diff --git a/src/org/apache/xalan/templates/output_html.properties b/src/org/apache/xalan/templates/output_html.properties
deleted file mode 100644
index 976685b..0000000
--- a/src/org/apache/xalan/templates/output_html.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Specify defaults when method="html".  These defaults use output_xml.properties 
-# as a base.
-#
-
-# XSLT properties do not need namespace qualification.
-method=html
-indent=yes
-media-type=text/html
-version=4.0
-
-# Xalan-specific output properties.  These can be overridden in the stylesheet 
-# assigning a xalan namespace.  For example:
-# <xsl:stylesheet version="1.0"
-#          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-#          xmlns:xalan="http://xml.apache.org/xslt">
-#  <xsl:output method="html" encoding="UTF-8"
-#              xalan:content-handler="MyContentHandler"/>
-#  ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xslt}indent-amount=0
-{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToHTML
-{http\u003a//xml.apache.org/xslt}entities=HTMLEntities.res
-{http\u003a//xml.apache.org/xslt}use-url-escaping=yes
-{http\u003a//xml.apache.org/xslt}omit-meta-tag=no
diff --git a/src/org/apache/xalan/templates/output_text.properties b/src/org/apache/xalan/templates/output_text.properties
deleted file mode 100644
index 3b8f551..0000000
--- a/src/org/apache/xalan/templates/output_text.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Specify defaults when method="text".
-#
-
-# XSLT properties do not need namespace qualification.
-method=text
-media-type=text/plain
-
-# Xalan-specific output properties.  These can be overridden in the stylesheet 
-# assigning a xalan namespace.  For example:
-# <xsl:stylesheet version="1.0"
-#          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-#          xmlns:xalan="http://xml.apache.org/xslt">
-#  <xsl:output method="html" encoding="UTF-8"
-#              xalan:content-handler="MyContentHandler"/>
-#  ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToText
\ No newline at end of file
diff --git a/src/org/apache/xalan/templates/output_xml.properties b/src/org/apache/xalan/templates/output_xml.properties
deleted file mode 100644
index 8ae0f3a..0000000
--- a/src/org/apache/xalan/templates/output_xml.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Specify defaults when method="xml".  These defaults serve as a base for 
-# other defaults, such as output_html and output_text.
-#
-
-# XSLT properties do not need namespace qualification.
-method=xml
-version=1.0
-encoding=UTF-8
-indent=no
-omit-xml-declaration=no
-standalone=no
-media-type=text/xml
-
-# Xalan-specific output properties.  These can be overridden in the stylesheet 
-# assigning a xalan namespace.  For example:
-# <xsl:stylesheet version="1.0"
-#          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-#          xmlns:xalan="http://xml.apache.org/xslt">
-#  <xsl:output method="html" encoding="UTF-8"
-#              xalan:content-handler="MyContentHandler"/>
-#  ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xslt}indent-amount=0
-{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToXML
-
diff --git a/src/org/apache/xalan/templates/package.html b/src/org/apache/xalan/templates/package.html
deleted file mode 100644
index 36523ac..0000000
--- a/src/org/apache/xalan/templates/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html>
-  <title>Xalan Templates Package.</title>
-  <body>
-    <p>Implements the {@link javax.xml.transform.Templates} interface, 
-    and defines a set of classes that represent an XSLT stylesheet.</p>
-    
-    <p>{@link org.apache.xalan.templates.StylesheetRoot} implements the {@link javax.xml.transform.Templates} interface, and 
-    extends {@link org.apache.xalan.templates.StylesheetComposed}, 
-    which is a {@link org.apache.xalan.templates.Stylesheet} composed of itself 
-    and its included Stylesheet objects. A StylesheetRoot also contains a 
-    global list of all imported StylesheetComposed objects. The
-    role of these objects is to hold immutable stylesheet data, not to perform 
-    procedural tasks associated with the
-    construction of the data (the org.apache.xalan.processor package) or with the transformation (the org.apache.xalan.transformer
-    package).</p>
-    <p>{@link org.apache.xalan.templates.ElemTemplateElement} is the superclass of 
-    all XSLT instruction elements, including Stylesheet. The <i>x</i>Func classes
-    extend members of the org.apache.xpath package and implement XSLT functions. Unlike 
-    the Stylesheet "container" objects, the
-    instruction element and function classes do contain procedural execute() 
-    methods that are called during the transformation.</p>
-    <p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/trace/EndSelectionEvent.java b/src/org/apache/xalan/trace/EndSelectionEvent.java
deleted file mode 100644
index 2bb1035..0000000
--- a/src/org/apache/xalan/trace/EndSelectionEvent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.xalan.trace;
-
-import org.w3c.dom.*;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Event triggered by completion of a xsl:for-each selection or a 
- * xsl:apply-templates selection.
- */
-public class EndSelectionEvent extends SelectionEvent
-{
-
-  /**
-   * Create an EndSelectionEvent.
-   * 
-   * @param processor The XSLT TransformerFactory.
-   * @param sourceNode The current context node.
-   * @param mode The current mode.
-   * @param styleNode node in the style tree reference for the event.
-   * Should not be null.  That is not enforced.
-   * @param attributeName The attribute name from which the selection is made.
-   * @param xpath The XPath that executed the selection.
-   * @param selection The result of the selection.
-   */
-  public EndSelectionEvent(TransformerImpl processor, Node sourceNode,
-                        ElemTemplateElement styleNode, String attributeName,
-                        XPath xpath, XObject selection)
-  {
-
-    super(processor, sourceNode, styleNode, attributeName, xpath, selection);
-  }
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/trace/GenerateEvent.java b/src/org/apache/xalan/trace/GenerateEvent.java
deleted file mode 100644
index 3ba87cf..0000000
--- a/src/org/apache/xalan/trace/GenerateEvent.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.trace;
-
-import org.xml.sax.*;
-
-import java.util.*;
-
-import java.io.*;
-
-import org.apache.xalan.transformer.TransformerImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Event generated by the XSL processor after it generates a new node in the result tree.
- * This event responds to and is modeled on the SAX events that are sent to the
- * formatter listener FormatterToXXX)classes.
- *
- * @see org.apache.xml.utils.DOMBuilder
- * @see org.apache.xalan.serialize.SerializerToHTML
- * @see org.apache.xalan.serialize.SerializerToText
- * @see org.apache.xalan.serialize.SerializerToXML
- *
- */
-public class GenerateEvent implements java.util.EventListener
-{
-
-  /**
-   * The XSLT Transformer, which either directly or indirectly contains most needed information.
-   *
-   * @see org.apache.xalan.transformer.TransformerImpl
-   */
-  public TransformerImpl m_processor;
-
-  /**
-   * The type of SAX event that was generated, as enumerated in the EVENTTYPE_XXX constants below.
-   */
-  public int m_eventtype;
-
-  /**
-   * Event type generated when a document begins.
-   *
-   */
-  public static final int EVENTTYPE_STARTDOCUMENT = 1;
-
-  /**
-   * Event type generated when a document ends.
-   */
-  public static final int EVENTTYPE_ENDDOCUMENT = 2;
-
-  /**
-   * Event type generated when an element begins (after the attributes have been processed but before the children have been added).
-   */
-  public static final int EVENTTYPE_STARTELEMENT = 3;
-
-  /**
-   * Event type generated when an element ends, after it's children have been added.
-   */
-  public static final int EVENTTYPE_ENDELEMENT = 4;
-
-  /**
-   * Event type generated for character data (CDATA and Ignorable Whitespace have their own events).
-   */
-  public static final int EVENTTYPE_CHARACTERS = 5;
-
-  /**
-   * Event type generated for ignorable whitespace (I'm not sure how much this is actually called.
-   */
-  public static final int EVENTTYPE_IGNORABLEWHITESPACE = 6;
-
-  /**
-   * Event type generated for processing instructions.
-   */
-  public static final int EVENTTYPE_PI = 7;
-
-  /**
-   * Event type generated after a comment has been added.
-   */
-  public static final int EVENTTYPE_COMMENT = 8;
-
-  /**
-   * Event type generate after an entity ref is created.
-   */
-  public static final int EVENTTYPE_ENTITYREF = 9;
-
-  /**
-   * Event type generated after CDATA is generated.
-   */
-  public static final int EVENTTYPE_CDATA = 10;
-
-  /**
-   * Character data from a character or cdata event.
-   */
-  public char m_characters[];
-
-  /**
-   * The start position of the current data in m_characters.
-   */
-  public int m_start;
-
-  /**
-   * The length of the current data in m_characters.
-   */
-  public int m_length;
-
-  /**
-   * The name of the element or PI.
-   */
-  public String m_name;
-
-  /**
-   * The string data in the element (comments and PIs).
-   */
-  public String m_data;
-
-  /**
-   * The current attribute list.
-   */
-  public Attributes m_atts;
-
-  /**
-   * Constructor for startDocument, endDocument events.
-   *
-   * @param processor The XSLT TransformerFactory instance.
-   * @param eventType One of the EVENTTYPE_XXX constants.
-   */
-  public GenerateEvent(TransformerImpl processor, int eventType)
-  {
-    m_processor = processor;
-    m_eventtype = eventType;
-  }
-
-  /**
-   * Constructor for startElement, endElement events.
-   *
-   * @param processor The XSLT TransformerFactory Instance.
-   * @param eventType One of the EVENTTYPE_XXX constants.
-   * @param name The name of the element.
-   * @param atts The SAX attribute list.
-   */
-  public GenerateEvent(TransformerImpl processor, int eventType, String name,
-                       Attributes atts)
-  {
-
-    m_name = name;
-    m_atts = atts;
-    m_processor = processor;
-    m_eventtype = eventType;
-  }
-
-  /**
-   * Constructor for characters, cdate events.
-   *
-   * @param processor The XSLT TransformerFactory instance.
-   * @param eventType One of the EVENTTYPE_XXX constants.
-   * @param ch The char array from the SAX event.
-   * @param start The start offset to be used in the char array.
-   * @param length The end offset to be used in the chara array.
-   */
-  public GenerateEvent(TransformerImpl processor, int eventType, char ch[],
-                       int start, int length)
-  {
-
-    m_characters = ch;
-    m_start = start;
-    m_length = length;
-    m_processor = processor;
-    m_eventtype = eventType;
-  }
-
-  /**
-   * Constructor for processingInstruction events.
-   *
-   * @param processor The instance of the XSLT processor.
-   * @param eventType One of the EVENTTYPE_XXX constants.
-   * @param name The name of the processing instruction.
-   * @param data The processing instruction data.
-   */
-  public GenerateEvent(TransformerImpl processor, int eventType, String name,
-                       String data)
-  {
-
-    m_name = name;
-    m_data = data;
-    m_processor = processor;
-    m_eventtype = eventType;
-  }
-
-  /**
-   * Constructor for comment and entity ref events.
-   *
-   * @param processor The XSLT processor instance.
-   * @param eventType One of the EVENTTYPE_XXX constants.
-   * @param data The comment or entity ref data.
-   */
-  public GenerateEvent(TransformerImpl processor, int eventType, String data)
-  {
-
-    m_data = data;
-    m_processor = processor;
-    m_eventtype = eventType;
-  }
-}
diff --git a/src/org/apache/xalan/trace/PrintTraceListener.java b/src/org/apache/xalan/trace/PrintTraceListener.java
deleted file mode 100644
index 617b8f3..0000000
--- a/src/org/apache/xalan/trace/PrintTraceListener.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.trace;
-
-import java.io.*;
-
-import org.w3c.dom.*;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemTextLiteral;
-import org.apache.xalan.templates.Constants;
-import org.apache.xpath.axes.ContextNodeList;
-
-import javax.xml.transform.SourceLocator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.ref.DTMNodeProxy;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Implementation of the TraceListener interface that
- * prints each event to standard out as it occurs.
- *
- * @see org.apache.xalan.trace.TracerEvent
- */
-public class PrintTraceListener implements TraceListener
-{
-
-  /**
-   * Construct a trace listener.
-   *
-   * @param pw PrintWriter to use for tracing events
-   */
-  public PrintTraceListener(java.io.PrintWriter pw)
-  {
-    m_pw = pw;
-  }
-
-  /**
-   * The print writer where the events should be written.
-   */
-  java.io.PrintWriter m_pw;
-
-  /**
-   * This needs to be set to true if the listener is to print an event whenever a template is invoked.
-   */
-  public boolean m_traceTemplates = false;
-
-  /**
-   * Set to true if the listener is to print events that occur as each node is 'executed' in the stylesheet.
-   */
-  public boolean m_traceElements = false;
-
-  /**
-   * Set to true if the listener is to print information after each result-tree generation event.
-   */
-  public boolean m_traceGeneration = false;
-
-  /**
-   * Set to true if the listener is to print information after each selection event.
-   */
-  public boolean m_traceSelection = false;
-
-  /**
-   * Print information about a TracerEvent.
-   *
-   * @param ev the trace event.
-   */
-  public void trace(TracerEvent ev)
-  {
-
-    switch (ev.m_styleNode.getXSLToken())
-    {
-    case Constants.ELEMNAME_TEXTLITERALRESULT :
-      if (m_traceElements)
-      {
-        m_pw.print(ev.m_styleNode.getSystemId()+ " Line #" + ev.m_styleNode.getLineNumber() + ", "
-                   + "Column #" + ev.m_styleNode.getColumnNumber() + " -- "
-                   + ev.m_styleNode.getNodeName() + ": ");
-
-        ElemTextLiteral etl = (ElemTextLiteral) ev.m_styleNode;
-        String chars = new String(etl.getChars(), 0, etl.getChars().length);
-
-        m_pw.println("    " + chars.trim());
-      }
-      break;
-    case Constants.ELEMNAME_TEMPLATE :
-      if (m_traceTemplates || m_traceElements)
-      {
-        ElemTemplate et = (ElemTemplate) ev.m_styleNode;
-
-        m_pw.print(et.getSystemId()+ " Line #" + et.getLineNumber() + ", " + "Column #"
-                   + et.getColumnNumber() + ": " + et.getNodeName() + " ");
-
-        if (null != et.getMatch())
-        {
-          m_pw.print("match='" + et.getMatch().getPatternString() + "' ");
-        }
-
-        if (null != et.getName())
-        {
-          m_pw.print("name='" + et.getName() + "' ");
-        }
-
-        m_pw.println();
-      }
-      break;
-    default :
-      if (m_traceElements)
-      {
-        m_pw.println(ev.m_styleNode.getSystemId()+ " Line #" + ev.m_styleNode.getLineNumber() + ", "
-                     + "Column #" + ev.m_styleNode.getColumnNumber() + ": "
-                     + ev.m_styleNode.getNodeName());
-      }
-    }
-  }
-
-  /**
-   * Method that is called just after a select attribute has been evaluated.
-   *
-   * @param ev the generate event.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void selected(SelectionEvent ev) throws javax.xml.transform.TransformerException
-  {
-
-    if (m_traceSelection)
-    {
-      ElemTemplateElement ete = (ElemTemplateElement) ev.m_styleNode;
-      Node sourceNode = ev.m_sourceNode;
-      int nodeHandler = ((DTMNodeProxy)sourceNode).getDTMNodeNumber();
-      
-      SourceLocator locator = ((DTMNodeProxy)sourceNode).getDTM()
-        .getSourceLocatorFor(nodeHandler);
-
-      if (locator != null)      
-        m_pw.println("Selected source node '" + sourceNode.getNodeName()
-                 + "', at " + locator);
-
-      if (ev.m_styleNode.getLineNumber() == 0)
-      {
-
-        // You may not have line numbers if the selection is occuring from a
-        // default template.
-        ElemTemplateElement parent =
-          (ElemTemplateElement) ete.getParentElem();
-
-        if (parent == ete.getStylesheetRoot().getDefaultRootRule())
-        {
-          m_pw.print("(default root rule) ");
-        }
-        else if (parent == ete.getStylesheetRoot().getDefaultTextRule())
-        {
-          m_pw.print("(default text rule) ");
-        }
-        else if (parent == ete.getStylesheetRoot().getDefaultRule())
-        {
-          m_pw.print("(default rule) ");
-        }
-
-        m_pw.print(ete.getNodeName() + ", " + ev.m_attributeName + "='"
-                   + ev.m_xpath.getPatternString() + "': ");
-      }
-      else
-      {
-        m_pw.print(ev.m_styleNode.getSystemId()+ " Line #" + ev.m_styleNode.getLineNumber() + ", "
-                   + "Column #" + ev.m_styleNode.getColumnNumber() + ": "
-                   + ete.getNodeName() + ", " + ev.m_attributeName + "='"
-                   + ev.m_xpath.getPatternString() + "': ");
-      }
-
-                        if (ev.m_selection.getType() == ev.m_selection.CLASS_NODESET)
-                        {
-                                m_pw.println();
-                                
-                                org.apache.xml.dtm.DTMIterator nl = ev.m_selection.iter();
-
-                                try
-                                {
-                                        nl = nl.cloneWithReset();
-                                }
-                                catch(CloneNotSupportedException cnse)
-                                {
-                                        m_pw.println("     [Can't trace nodelist because it it threw a CloneNotSupportedException]");
-                                        return;
-                                }
-                                int pos = nl.nextNode();
-
-                                if (DTM.NULL == pos)
-                                {
-                                        m_pw.println("     [empty node list]");
-                                }
-                                else
-                                {
-                                        while (DTM.NULL != pos)
-                                        {
-                                                // m_pw.println("     " + ev.m_processor.getXPathContext().getDTM(pos).getNode(pos));
-                                                DTM dtm = ev.m_processor.getXPathContext().getDTM(pos);
-                                                m_pw.print("     ");
-                                                m_pw.print(Integer.toHexString(pos));
-                                                m_pw.print(": ");
-                                                m_pw.println(dtm.getNodeName(pos));
-
-                                                pos = nl.nextNode();
-                                        }
-                                }        
-                        }
-      else
-      {
-        m_pw.println(ev.m_selection.str());
-      }
-    }
-  }
-
-  /**
-   * Print information about a Generate event.
-   *
-   * @param ev the trace event.
-   */
-  public void generated(GenerateEvent ev)
-  {
-
-    if (m_traceGeneration)
-    {
-      switch (ev.m_eventtype)
-      {
-      case GenerateEvent.EVENTTYPE_STARTDOCUMENT :
-        m_pw.println("STARTDOCUMENT");
-        break;
-      case GenerateEvent.EVENTTYPE_ENDDOCUMENT :
-        m_pw.println("ENDDOCUMENT");
-        break;
-      case GenerateEvent.EVENTTYPE_STARTELEMENT :
-        m_pw.println("STARTELEMENT: " + ev.m_name);
-        break;
-      case GenerateEvent.EVENTTYPE_ENDELEMENT :
-        m_pw.println("ENDELEMENT: " + ev.m_name);
-        break;
-      case GenerateEvent.EVENTTYPE_CHARACTERS :
-      {
-        String chars = new String(ev.m_characters, ev.m_start, ev.m_length);
-
-        m_pw.println("CHARACTERS: " + chars);
-      }
-      break;
-      case GenerateEvent.EVENTTYPE_CDATA :
-      {
-        String chars = new String(ev.m_characters, ev.m_start, ev.m_length);
-
-        m_pw.println("CDATA: " + chars);
-      }
-      break;
-      case GenerateEvent.EVENTTYPE_COMMENT :
-        m_pw.println("COMMENT: " + ev.m_data);
-        break;
-      case GenerateEvent.EVENTTYPE_PI :
-        m_pw.println("PI: " + ev.m_name + ", " + ev.m_data);
-        break;
-      case GenerateEvent.EVENTTYPE_ENTITYREF :
-        m_pw.println("ENTITYREF: " + ev.m_name);
-        break;
-      case GenerateEvent.EVENTTYPE_IGNORABLEWHITESPACE :
-        m_pw.println("IGNORABLEWHITESPACE");
-        break;
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xalan/trace/SelectionEvent.java b/src/org/apache/xalan/trace/SelectionEvent.java
deleted file mode 100644
index d144e43..0000000
--- a/src/org/apache/xalan/trace/SelectionEvent.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.trace;
-
-import org.w3c.dom.*;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Event triggered by selection of a node in the style stree.
- */
-public class SelectionEvent implements java.util.EventListener
-{
-
-  /**
-   * The node in the style tree where the event occurs.
-   */
-  public final ElemTemplateElement m_styleNode;
-
-  /**
-   * The XSLT processor instance.
-   */
-  public final TransformerImpl m_processor;
-
-  /**
-   * The current context node.
-   */
-  public final Node m_sourceNode;
-
-  /**
-   * The attribute name from which the selection is made.
-   */
-  public final String m_attributeName;
-
-  /**
-   * The XPath that executed the selection.
-   */
-  public final XPath m_xpath;
-
-  /**
-   * The result of the selection.
-   */
-  public final XObject m_selection;
-
-  /**
-   * Create an event originating at the given node of the style tree.
-   * 
-   * @param processor The XSLT TransformerFactory.
-   * @param sourceNode The current context node.
-   * @param mode The current mode.
-   * @param styleNode node in the style tree reference for the event.
-   * Should not be null.  That is not enforced.
-   * @param attributeName The attribute name from which the selection is made.
-   * @param xpath The XPath that executed the selection.
-   * @param selection The result of the selection.
-   */
-  public SelectionEvent(TransformerImpl processor, Node sourceNode,
-                        ElemTemplateElement styleNode, String attributeName,
-                        XPath xpath, XObject selection)
-  {
-
-    this.m_processor = processor;
-    this.m_sourceNode = sourceNode;
-    this.m_styleNode = styleNode;
-    this.m_attributeName = attributeName;
-    this.m_xpath = xpath;
-    this.m_selection = selection;
-  }
-}
diff --git a/src/org/apache/xalan/trace/TraceListener.java b/src/org/apache/xalan/trace/TraceListener.java
deleted file mode 100644
index 8b37455..0000000
--- a/src/org/apache/xalan/trace/TraceListener.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.trace;
-
-import org.w3c.dom.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Interface the XSL processor calls when it matches a source node, selects a set of source nodes,
- * or generates a result node.
- * If you want an object instance to be called when a trace event occurs, use the TransformerImpl setTraceListener method.
- * @see org.apache.xalan.trace.TracerEvent
- * @see org.apache.xalan.trace.TraceManager#addTraceListener
- */
-public interface TraceListener extends java.util.EventListener
-{
-
-  /**
-   * Method that is called when a trace event occurs.
-   * The method is blocking.  It must return before processing continues.
-   *
-   * @param ev the trace event.
-   */
-  public void trace(TracerEvent ev);
-
-  /**
-   * Method that is called just after the formatter listener is called.
-   *
-   * @param ev the generate event.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void selected(SelectionEvent ev) throws javax.xml.transform.TransformerException;
-
-  /**
-   * Method that is called just after the formatter listener is called.
-   *
-   * @param ev the generate event.
-   */
-  public void generated(GenerateEvent ev);
-}
diff --git a/src/org/apache/xalan/trace/TraceListenerEx.java b/src/org/apache/xalan/trace/TraceListenerEx.java
deleted file mode 100644
index 2aaab97..0000000
--- a/src/org/apache/xalan/trace/TraceListenerEx.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.xalan.trace;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Extends TraceListener but adds a SelectEnd event.
- */
-public interface TraceListenerEx extends TraceListener
-{
-
-  /**
-   * Method that is called after an xsl:apply-templates or xsl:for-each 
-   * selection occurs.
-   *
-   * @param ev the generate event.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void selectEnd(EndSelectionEvent ev) throws javax.xml.transform.TransformerException;
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/trace/TraceManager.java b/src/org/apache/xalan/trace/TraceManager.java
deleted file mode 100644
index f2e9cf3..0000000
--- a/src/org/apache/xalan/trace/TraceManager.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.trace;
-
-import java.util.Vector;
-import java.util.TooManyListenersException;
-
-import org.w3c.dom.Node;
-
-import org.apache.xml.utils.QName;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPath;
-
-/**
- * This class manages trace listeners, and acts as an
- * interface for the tracing functionality in Xalan.
- */
-public class TraceManager
-{
-
-  /** A transformer instance */
-  private TransformerImpl m_transformer;
-
-  /**
-   * Constructor for the trace manager.
-   *
-   * @param transformer a non-null instance of a transformer
-   */
-  public TraceManager(TransformerImpl transformer)
-  {
-    m_transformer = transformer;
-  }
-
-  /**
-   * List of listeners who are interested in tracing what's
-   * being generated.
-   */
-  private Vector m_traceListeners = null;
-
-  /**
-   * Add a trace listener for the purposes of debugging and diagnosis.
-   * @param tl Trace listener to be added.
-   *
-   * @throws TooManyListenersException
-   */
-  public void addTraceListener(TraceListener tl)
-          throws TooManyListenersException
-  {
-
-    TransformerImpl.S_DEBUG = true;
-
-    if (null == m_traceListeners)
-      m_traceListeners = new Vector();
-
-    m_traceListeners.addElement(tl);
-  }
-
-  /**
-   * Remove a trace listener.
-   * @param tl Trace listener to be removed.
-   */
-  public void removeTraceListener(TraceListener tl)
-  {
-
-    if (null != m_traceListeners)
-    {
-      m_traceListeners.removeElement(tl);
-    }
-  }
-
-  /**
-   * Fire a generate event.
-   *
-   * @param te Generate Event to fire
-   */
-  public void fireGenerateEvent(GenerateEvent te)
-  {
-
-    if (null != m_traceListeners)
-    {
-      int nListeners = m_traceListeners.size();
-
-      for (int i = 0; i < nListeners; i++)
-      {
-        TraceListener tl = (TraceListener) m_traceListeners.elementAt(i);
-
-        tl.generated(te);
-      }
-    }
-  }
-
-  /**
-   * Tell if trace listeners are present.
-   *
-   * @return True if there are trace listeners
-   */
-  public boolean hasTraceListeners()
-  {
-    return (null != m_traceListeners);
-  }
-
-  /**
-   * Fire a trace event.
-   *
-   * @param sourceNode Current source node
-   * @param mode Template mode
-   * @param styleNode Stylesheet template node
-   */
-  public void fireTraceEvent(ElemTemplateElement styleNode)
-  {
-
-    if (hasTraceListeners())
-    {
-      int sourceNode = m_transformer.getXPathContext().getCurrentNode();
-      Node source = m_transformer.getXPathContext().getDTM(
-        sourceNode).getNode(sourceNode);
-
-      fireTraceEvent(new TracerEvent(m_transformer, source, 
-                     m_transformer.getMode(),  /*sourceNode, mode,*/
-                                     styleNode));
-    }
-  }
-
-  /**
-   * Fire a trace event.
-   *
-   * @param te Trace event to fire
-   */
-  public void fireTraceEvent(TracerEvent te)
-  {
-
-    if (hasTraceListeners())
-    {
-      int nListeners = m_traceListeners.size();
-
-      for (int i = 0; i < nListeners; i++)
-      {
-        TraceListener tl = (TraceListener) m_traceListeners.elementAt(i);
-
-        tl.trace(te);
-      }
-    }
-  }
-
-  /**
-   * Fire a selection event.
-   *
-   * @param sourceNode Current source node
-   * @param styleNode node in the style tree reference for the event.
-   * @param attributeName The attribute name from which the selection is made.
-   * @param xpath The XPath that executed the selection.
-   * @param selection The result of the selection.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void fireSelectedEvent(
-          int sourceNode, ElemTemplateElement styleNode, String attributeName, 
-          XPath xpath, XObject selection)
-            throws javax.xml.transform.TransformerException
-  {
-
-    if (hasTraceListeners())
-    {
-      Node source = m_transformer.getXPathContext().getDTM(
-        sourceNode).getNode(sourceNode);
-
-      fireSelectedEvent(new SelectionEvent(m_transformer, source, styleNode,
-                                           attributeName, xpath, selection));
-    }
-  }
-  
-  /**
-   * Fire a selection event.
-   *
-   * @param sourceNode Current source node
-   * @param styleNode node in the style tree reference for the event.
-   * @param attributeName The attribute name from which the selection is made.
-   * @param xpath The XPath that executed the selection.
-   * @param selection The result of the selection.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void fireSelectedEndEvent(
-          int sourceNode, ElemTemplateElement styleNode, String attributeName, 
-          XPath xpath, XObject selection)
-            throws javax.xml.transform.TransformerException
-  {
-
-    if (hasTraceListeners())
-    {
-      Node source = m_transformer.getXPathContext().getDTM(
-        sourceNode).getNode(sourceNode);
-
-      fireSelectedEndEvent(new EndSelectionEvent(m_transformer, source, styleNode,
-                                           attributeName, xpath, selection));
-    }
-  }
-  
-  /**
-   * Fire a selection event.
-   *
-   * @param se Selection event to fire
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void fireSelectedEndEvent(EndSelectionEvent se)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (hasTraceListeners())
-    {
-      int nListeners = m_traceListeners.size();
-
-      for (int i = 0; i < nListeners; i++)
-      {
-        TraceListener tl = (TraceListener) m_traceListeners.elementAt(i);
-
-        if(tl instanceof TraceListenerEx)
-          ((TraceListenerEx)tl).selectEnd(se);
-      }
-    }
-  }
-
-  /**
-   * Fire a selection event.
-   *
-   * @param se Selection event to fire
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void fireSelectedEvent(SelectionEvent se)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (hasTraceListeners())
-    {
-      int nListeners = m_traceListeners.size();
-
-      for (int i = 0; i < nListeners; i++)
-      {
-        TraceListener tl = (TraceListener) m_traceListeners.elementAt(i);
-
-        tl.selected(se);
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xalan/trace/TracerEvent.java b/src/org/apache/xalan/trace/TracerEvent.java
deleted file mode 100644
index 6288bfd..0000000
--- a/src/org/apache/xalan/trace/TracerEvent.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.trace;
-
-import org.w3c.dom.*;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xml.utils.QName;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Parent class of events generated for tracing the
- * progress of the XSL processor.
- */
-public class TracerEvent implements java.util.EventListener
-{
-
-  /**
-   * The node in the style tree where the event occurs.
-   */
-  public final ElemTemplateElement m_styleNode;
-
-  /**
-   * The XSLT processor instance.
-   */
-  public final TransformerImpl m_processor;
-
-  /**
-   * The current context node.
-   */
-  public final Node m_sourceNode;
-
-  /**
-   * The current mode.
-   */
-  public final QName m_mode;
-
-  /**
-   * Create an event originating at the given node of the style tree.
-   * @param processor The XSLT TransformerFactory.
-   * @param sourceNode The current context node.
-   * @param mode The current mode.
-   * @param m_styleNode node in the style tree reference for the event.
-   * Should not be null.  That is not enforced.
-   * @param styleNode The stylesheet element that is executing.
-   */
-  public TracerEvent(TransformerImpl processor, Node sourceNode, QName mode,
-                     ElemTemplateElement styleNode)
-  {
-
-    this.m_processor = processor;
-    this.m_sourceNode = sourceNode;
-    this.m_mode = mode;
-    this.m_styleNode = styleNode;
-  }
-
-  /**
-   * Returns a string representation of the node.
-   * The string returned for elements will contain the element name
-   * and any attributes enclosed in angle brackets.
-   * The string returned for attributes will be of form, "name=value."
-   *
-   * @param n any DOM node. Must not be null.
-   *
-   * @return a string representation of the given node.
-   */
-  public static String printNode(Node n)
-  {
-
-    String r = n.hashCode() + " ";
-
-    if (n instanceof Element)
-    {
-      r += "<" + n.getNodeName();
-
-      Node c = n.getFirstChild();
-
-      while (null != c)
-      {
-        if (c instanceof Attr)
-        {
-          r += printNode(c) + " ";
-        }
-
-        c = c.getNextSibling();
-      }
-
-      r += ">";
-    }
-    else
-    {
-      if (n instanceof Attr)
-      {
-        r += n.getNodeName() + "=" + n.getNodeValue();
-      }
-      else
-      {
-        r += n.getNodeName();
-      }
-    }
-
-    return r;
-  }
-
-  /**
-   * Returns a string representation of the node list.
-   * The string will contain the list of nodes inside square braces.
-   * Elements will contain the element name
-   * and any attributes enclosed in angle brackets.
-   * Attributes will be of form, "name=value."
-   *
-   * @param l any DOM node list. Must not be null.
-   *
-   * @return a string representation of the given node list.
-   */
-  public static String printNodeList(NodeList l)
-  {
-
-    String r = l.hashCode() + "[";
-    int len = l.getLength() - 1;
-    int i = 0;
-
-    while (i < len)
-    {
-      Node n = l.item(i);
-
-      if (null != n)
-      {
-        r += printNode(n) + ", ";
-      }
-
-      ++i;
-    }
-
-    if (i == len)
-    {
-      Node n = l.item(len);
-
-      if (null != n)
-      {
-        r += printNode(n);
-      }
-    }
-
-    return r + "]";
-  }
-}
diff --git a/src/org/apache/xalan/trace/package.html b/src/org/apache/xalan/trace/package.html
deleted file mode 100644
index 16d0153..0000000
--- a/src/org/apache/xalan/trace/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>Xalan Trace (debugger) Package.</title>
-  <body>
-    <p>Implementation of Xalan Trace events, for use by a debugger.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/transformer/ClonerToResultTree.java b/src/org/apache/xalan/transformer/ClonerToResultTree.java
deleted file mode 100644
index 482e8ae..0000000
--- a/src/org/apache/xalan/transformer/ClonerToResultTree.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import org.apache.xalan.templates.Stylesheet;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.utils.XMLString;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Attributes;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class used to clone a node, possibly including its children to 
- * a result tree.
- */
-public class ClonerToResultTree
-{
-
-  /** Result tree handler for the cloned tree           */
-  private ResultTreeHandler m_rth;
-
-  /** Transformer instance to use for cloning          */
-  private TransformerImpl m_transformer;
-
-  /**
-   * Constructor ClonerToResultTree
-   *
-   *
-   * @param transformer non-null transformer instance to use for the cloning
-   * @param rth non-null result tree handler for the cloned tree
-   */
-  public ClonerToResultTree(TransformerImpl transformer,
-                            ResultTreeHandler rth)
-  {
-    m_rth = rth;
-    m_transformer = transformer;
-  }
-
-//  /**
-//   * Clone an element with or without children.
-//   * TODO: Fix or figure out node clone failure!
-//   * the error condition is severe enough to halt processing.
-//   *
-//   * @param node The node to clone
-//   * @param shouldCloneAttributes Flag indicating whether to 
-//   * clone children attributes
-//   * 
-//   * @throws TransformerException
-//   */
-//  public void cloneToResultTree(int node, boolean shouldCloneAttributes)
-//    throws TransformerException
-//  {
-//
-//    try
-//    {
-//      XPathContext xctxt = m_transformer.getXPathContext();
-//      DTM dtm = xctxt.getDTM(node);
-//
-//      int type = dtm.getNodeType(node);
-//      switch (type)
-//      {
-//      case DTM.TEXT_NODE :
-//        dtm.dispatchCharactersEvents(node, m_rth, false);
-//        break;
-//      case DTM.DOCUMENT_FRAGMENT_NODE :
-//      case DTM.DOCUMENT_NODE :
-//
-//        // Can't clone a document, but refrain from throwing an error
-//        // so that copy-of will work
-//        break;
-//      case DTM.ELEMENT_NODE :
-//        {
-//          Attributes atts;
-//
-//          if (shouldCloneAttributes)
-//          {
-//            m_rth.addAttributes(node);
-//            m_rth.processNSDecls(node, type, dtm);
-//          }
-//
-//          String ns = dtm.getNamespaceURI(node);
-//          String localName = dtm.getLocalName(node);
-//
-//          m_rth.startElement(ns, localName, dtm.getNodeNameX(node), null);
-//        }
-//        break;
-//      case DTM.CDATA_SECTION_NODE :
-//        m_rth.startCDATA();          
-//        dtm.dispatchCharactersEvents(node, m_rth, false);
-//        m_rth.endCDATA();
-//        break;
-//      case DTM.ATTRIBUTE_NODE :
-//        m_rth.addAttribute(node);
-//        break;
-//      case DTM.COMMENT_NODE :
-//        XMLString xstr = dtm.getStringValue (node);
-//        xstr.dispatchAsComment(m_rth);
-//        break;
-//      case DTM.ENTITY_REFERENCE_NODE :
-//        m_rth.entityReference(dtm.getNodeNameX(node));
-//        break;
-//      case DTM.PROCESSING_INSTRUCTION_NODE :
-//        {
-//          // %REVIEW% Is the node name the same as the "target"?
-//          m_rth.processingInstruction(dtm.getNodeNameX(node), 
-//                                      dtm.getNodeValue(node));
-//        }
-//        break;
-//      default :
-//        //"Can not create item in result tree: "+node.getNodeName());
-//        m_transformer.getMsgMgr().error(null, 
-//                         XSLTErrorResources.ER_CANT_CREATE_ITEM,
-//                         new Object[]{ dtm.getNodeName(node) });  
-//      }
-//    }
-//    catch(org.xml.sax.SAXException se)
-//    {
-//      throw new TransformerException(se);
-//    }
-//  }  // end cloneToResultTree function
-  
-  /**
-   * Clone an element with or without children.
-   * TODO: Fix or figure out node clone failure!
-   * the error condition is severe enough to halt processing.
-   *
-   * @param node The node to clone
-   * @param shouldCloneAttributes Flag indicating whether to 
-   * clone children attributes
-   * 
-   * @throws TransformerException
-   */
-  public static void cloneToResultTree(int node, int nodeType, DTM dtm, 
-                                             ResultTreeHandler rth,
-                                             boolean shouldCloneAttributes)
-    throws TransformerException
-  {
-
-    try
-    {
-      switch (nodeType)
-      {
-      case DTM.TEXT_NODE :
-        dtm.dispatchCharactersEvents(node, rth, false);
-        break;
-      case DTM.DOCUMENT_FRAGMENT_NODE :
-      case DTM.DOCUMENT_NODE :
-
-        // Can't clone a document, but refrain from throwing an error
-        // so that copy-of will work
-        break;
-      case DTM.ELEMENT_NODE :
-        {
-          Attributes atts;
-
-          if (shouldCloneAttributes)
-          {
-            rth.addAttributes(node);
-            rth.processNSDecls(node, nodeType, dtm);
-          }
-
-          String ns = dtm.getNamespaceURI(node);
-          String localName = dtm.getLocalName(node);
-
-          rth.startElement(ns, localName, dtm.getNodeNameX(node), null);
-        }
-        break;
-      case DTM.CDATA_SECTION_NODE :
-        rth.startCDATA();          
-        dtm.dispatchCharactersEvents(node, rth, false);
-        rth.endCDATA();
-        break;
-      case DTM.ATTRIBUTE_NODE :
-        rth.addAttribute(node);
-        break;
-      case DTM.COMMENT_NODE :
-        XMLString xstr = dtm.getStringValue (node);
-        xstr.dispatchAsComment(rth);
-        break;
-      case DTM.ENTITY_REFERENCE_NODE :
-        rth.entityReference(dtm.getNodeNameX(node));
-        break;
-      case DTM.PROCESSING_INSTRUCTION_NODE :
-        {
-          // %REVIEW% Is the node name the same as the "target"?
-          rth.processingInstruction(dtm.getNodeNameX(node), 
-                                      dtm.getNodeValue(node));
-        }
-        break;
-      default :
-        //"Can not create item in result tree: "+node.getNodeName());
-        throw new  TransformerException(
-                         "Can't clone node: "+dtm.getNodeName(node));
-      }
-    }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }  // end cloneToResultTree function
-}
diff --git a/src/org/apache/xalan/transformer/Counter.java b/src/org/apache/xalan/transformer/Counter.java
deleted file mode 100644
index d23e0c1..0000000
--- a/src/org/apache/xalan/transformer/Counter.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-//import org.w3c.dom.Node;
-import org.apache.xml.dtm.DTM;
-
-import org.apache.xml.utils.NodeVector;
-import org.apache.xpath.NodeSetDTM;  // for isNodeAfter support
-import org.apache.xpath.XPathContext;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.XPath;
-import org.apache.xalan.templates.ElemNumber;
-
-/**
- * <meta name="usage" content="internal"/>
- * A class that does incremental counting for support of xsl:number.
- * This class stores a cache of counted nodes (m_countNodes).
- * It tries to cache the counted nodes in document order...
- * the node count is based on its position in the cache list
- */
-public class Counter
-{
-
-  /**
-   * Set the maximum ammount the m_countNodes list can
-   * grow to.
-   */
-  static final int MAXCOUNTNODES = 500;
-
-  /**
-   * The start count from where m_countNodes counts
-   * from.  In other words, the count of a given node
-   * in the m_countNodes vector is node position +
-   * m_countNodesStartCount.
-   */
-  int m_countNodesStartCount = 0;
-
-  /**
-   * A vector of all nodes counted so far.
-   */
-  NodeSetDTM m_countNodes;
-
-  /**
-   * The node from where the counting starts.  This is needed to
-   * find a counter if the node being counted is not immediatly
-   * found in the m_countNodes vector.
-   */
-  int m_fromNode = DTM.NULL;
-
-  /**
-   * The owning xsl:number element.
-   */
-  ElemNumber m_numberElem;
-
-  /**
-   * Value to store result of last getCount call, for benifit
-   * of returning val from CountersTable.getCounterByCounted,
-   * who calls getCount.
-   */
-  int m_countResult;
-
-  /**
-   * Construct a counter object.
-   *
-   * @param numberElem The owning xsl:number element. 
-   * @param countNodes A vector of all nodes counted so far.
-   *
-   * @throws TransformerException
-   */
-  Counter(ElemNumber numberElem, NodeSetDTM countNodes) throws TransformerException
-  {
-    m_countNodes = countNodes;
-    m_numberElem = numberElem;
-  }
-
-  /**
-   * Construct a counter object.
-   *
-   * @param numberElem The owning xsl:number element. 
-   *
-   * @throws TransformerException
-   *
-  Counter(ElemNumber numberElem) throws TransformerException
-  {
-    m_numberElem = numberElem;
-  }*/
-
-  /**
-   * Try and find a node that was previously counted. If found,
-   * return a positive integer that corresponds to the count.
-   *
-   * @param support The XPath context to use
-   * @param node The node to be counted.
-   * 
-   * @return The count of the node, or -1 if not found.
-   */
-  int getPreviouslyCounted(XPathContext support, int node)
-  {
-
-    int n = m_countNodes.size();
-
-    m_countResult = 0;
-
-    for (int i = n - 1; i >= 0; i--)
-    {
-      int countedNode = m_countNodes.elementAt(i);
-
-      if (node == countedNode)
-      {
-
-        // Since the list is in backwards order, the count is 
-        // how many are in the rest of the list.
-        m_countResult = i + 1 + m_countNodesStartCount;
-
-        break;
-      }
-      
-      DTM dtm = support.getDTM(countedNode);
-
-      // Try to see if the given node falls after the counted node...
-      // if it does, don't keep searching backwards.
-      if (dtm.isNodeAfter(countedNode, node))
-        break;
-    }
-
-    return m_countResult;
-  }
-
-  /**
-   * Get the last node in the list.
-   *
-   * @return the last node in the list.
-   */
-  int getLast()
-  {
-
-    int size = m_countNodes.size();
-
-    return (size > 0) ? m_countNodes.elementAt(size - 1) : DTM.NULL;
-  }
-}
diff --git a/src/org/apache/xalan/transformer/CountersTable.java b/src/org/apache/xalan/transformer/CountersTable.java
deleted file mode 100644
index 9328543..0000000
--- a/src/org/apache/xalan/transformer/CountersTable.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-//import org.w3c.dom.Node;
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xalan.templates.ElemNumber;
-
-/**
- * <meta name="usage" content="internal"/>
- * This is a table of counters, keyed by ElemNumber objects, each
- * of which has a list of Counter objects.  This really isn't a true
- * table, it is more like a list of lists (there must be a technical
- * term for that...).
- */
-public class CountersTable extends Hashtable
-{
-
-  /**
-   * Construct a CountersTable.
-   */
-  public CountersTable(){}
-
-  /**
-   * Get the list of counters that corresponds to
-   * the given ElemNumber object.
-   *
-   * @param numberElem the given xsl:number element.
-   *
-   * @return the list of counters that corresponds to
-   * the given ElemNumber object.
-   */
-  Vector getCounters(ElemNumber numberElem)
-  {
-
-    Vector counters = (Vector) this.get(numberElem);
-
-    return (null == counters) ? putElemNumber(numberElem) : counters;
-  }
-
-  /**
-   * Put a counter into the table and create an empty
-   * vector as it's value.
-   *
-   * @param numberElem the given xsl:number element.
-   *
-   * @return an empty vector to be used to store counts
-   * for this number element.
-   */
-  Vector putElemNumber(ElemNumber numberElem)
-  {
-
-    Vector counters = new Vector();
-
-    this.put(numberElem, counters);
-
-    return counters;
-  }
-
-  /**
-   * Place to collect new counters.
-   */
-  transient private NodeSetDTM m_newFound;
-
-  /**
-   * Add a list of counted nodes that were built in backwards document
-   * order, or a list of counted nodes that are in forwards document
-   * order.
-   *
-   * @param flist Vector of nodes built in forwards document order
-   * @param blist Vector of nodes built in backwards document order
-   */
-  void appendBtoFList(NodeSetDTM flist, NodeSetDTM blist)
-  {
-
-    int n = blist.size();
-
-    for (int i = (n - 1); i >= 0; i--)
-    {
-      flist.addElement(blist.item(i));
-    }
-  }
-
-  // For diagnostics
-
-  /** Number of counters created so far          */
-  transient int m_countersMade = 0;
-
-  /**
-   * Count forward until the given node is found, or until
-   * we have looked to the given amount.
-   *
-   * @param support The XPath context to use  
-   * @param numberElem The given xsl:number element.
-   * @param node The node to count.
-   * 
-   * @return The node count, or 0 if not found.
-   *
-   * @throws TransformerException
-   */
-  public int countNode(XPathContext support, ElemNumber numberElem, int node)
-          throws TransformerException
-  {
-
-    int count = 0;
-    Vector counters = getCounters(numberElem);
-    int nCounters = counters.size();
-
-    // XPath countMatchPattern = numberElem.getCountMatchPattern(support, node);
-    // XPath fromMatchPattern = numberElem.m_fromMatchPattern;
-    int target = numberElem.getTargetNode(support, node);
-
-    if (DTM.NULL != target)
-    {
-      for (int i = 0; i < nCounters; i++)
-      {
-        Counter counter = (Counter) counters.elementAt(i);
-
-        count = counter.getPreviouslyCounted(support, target);
-
-        if (count > 0)
-          return count;
-      }
-
-      // In the loop below, we collect the nodes in backwards doc order, so 
-      // we don't have to do inserts, but then we store the nodes in forwards 
-      // document order, so we don't have to insert nodes into that list, 
-      // so that's what the appendBtoFList stuff is all about.  In cases 
-      // of forward counting by one, this will mean a single node copy from 
-      // the backwards list (m_newFound) to the forwards list (counter.m_countNodes).
-      count = 0;
-      if (m_newFound == null)
-        m_newFound = new NodeSetDTM(support.getDTMManager());
-
-      for (; DTM.NULL != target;
-              target = numberElem.getPreviousNode(support, target))
-      {
-
-        // First time in, we should not have to check for previous counts, 
-        // since the original target node was already checked in the 
-        // block above.
-        if (0 != count)
-        {
-          for (int i = 0; i < nCounters; i++)
-          {
-            Counter counter = (Counter) counters.elementAt(i);
-            int cacheLen = counter.m_countNodes.size();
-
-            if ((cacheLen > 0)
-                    && (counter.m_countNodes.elementAt(cacheLen
-                                                      - 1) == target))
-            {
-              count += (cacheLen + counter.m_countNodesStartCount);
-
-              if (cacheLen > 0)
-                appendBtoFList(counter.m_countNodes, m_newFound);
-
-              m_newFound.removeAllElements();
-
-              return count;
-            }
-          }
-        }
-
-        m_newFound.addElement(target);
-
-        count++;
-      }
-
-      // If we got to this point, then we didn't find a counter, so make 
-      // one and add it to the list.
-      Counter counter = new Counter(numberElem, new NodeSetDTM(support.getDTMManager()));
-
-      m_countersMade++;  // for diagnostics
-
-      appendBtoFList(counter.m_countNodes, m_newFound);
-      m_newFound.removeAllElements();
-      counters.addElement(counter);
-    }
-
-    return count;
-  }
-}
diff --git a/src/org/apache/xalan/transformer/DecimalToRoman.java b/src/org/apache/xalan/transformer/DecimalToRoman.java
deleted file mode 100644
index a2bc9ee..0000000
--- a/src/org/apache/xalan/transformer/DecimalToRoman.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-/**
- * <meta name="usage" content="internal"/>
- * Structure to help in converting integers to roman numerals
- */
-public class DecimalToRoman
-{
-
-  /**
-   * Constructor DecimalToRoman
-   *
-   *
-   * @param postValue Minimum value for a given range of 
-   * roman numbers
-   * @param postLetter Correspoding letter (roman) to postValue
-   * @param preValue Value of last prefixed number within 
-   * that same range (i.e. IV if postval is 5 (V))
-   * @param preLetter Correspoding letter(roman) to preValue
-   */
-  public DecimalToRoman(long postValue, String postLetter, long preValue,
-                        String preLetter)
-  {
-
-    this.m_postValue = postValue;
-    this.m_postLetter = postLetter;
-    this.m_preValue = preValue;
-    this.m_preLetter = preLetter;
-  }
-
-  /** Minimum value for a given range of roman numbers          */
-  public long m_postValue;
-
-  /** Correspoding letter (roman) to m_postValue          */
-  public String m_postLetter;
-
-  /** Value of last prefixed number within that same range  */
-  public long m_preValue;
-
-  /** Correspoding letter (roman) to m_preValue          */
-  public String m_preLetter;
-}
diff --git a/src/org/apache/xalan/transformer/KeyIterator.java b/src/org/apache/xalan/transformer/KeyIterator.java
deleted file mode 100644
index 1f4deab..0000000
--- a/src/org/apache/xalan/transformer/KeyIterator.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Vector;
-
-import org.apache.xpath.axes.WalkingIterator;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.templates.KeyDeclaration;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPath;
-
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class implements an optimized iterator for 
- * "key()" patterns. This iterator incrementally walks the 
- * source tree and finds all the nodes that match
- * a given key name and match pattern.
- */
-public class KeyIterator extends WalkingIterator
-{
-  
-  /** The key table this iterator is associated to.
-   *  @serial          */
-  private KeyTable m_keyTable;
-
-  /** Key name.
-   *  @serial           */
-  private QName m_name;
-  
-  /** 
-   * Flag indicating whether the whole source tree has been walked.     
-   * True if we still need to finish walking the tree.
-   * */
-  transient private boolean m_lookForMoreNodes = true;
-
-  /**
-   * Get the key name from a key declaration this iterator will process
-   *
-   *
-   * @return Key name
-   */
-  public QName getName()
-  {
-    return m_name;
-  }
-
-  /** Vector of Key declarations in the stylesheet.
-   *  @serial          */
-  private Vector m_keyDeclarations;
-
-  /**
-   * Get the key declarations from the stylesheet 
-   *
-   *
-   * @return Vector containing the key declarations from the stylesheet
-   */
-  public Vector getKeyDeclarations()
-  {
-    return m_keyDeclarations;
-  }
-
-  /**
-   * Constructor KeyIterator
-   *
-   *
-   * @param doc The document node
-   * @param nscontext The prefix resolver for the execution context.
-   * @param name The key name
-   * @param keyDeclarations The key declarations from the stylesheet 
-   * @param xctxt The XPath runtime state
-   */
-  public KeyIterator(int doc, PrefixResolver nscontext, QName name,
-                     Vector keyDeclarations, XPathContext xctxt)
-  {
-
-    super(nscontext);
-
-    int current = xctxt.getCurrentNode();
-    setRoot(current, xctxt);
-
-    m_name = name;
-    m_keyDeclarations = keyDeclarations;
-    m_firstWalker = new KeyWalker(this);
-
-    this.setLastUsedWalker(m_firstWalker);
-  }
-
-  /**
-   * Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * 
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    int n = super.nextNode();
-
-    // System.out.println("--> "+((null == n) ? "null" : n.getNodeName()));
-    return n;
-  }
-
-  /**
-   * Set the value of the key that this iterator will look for 
-   *
-   *
-   * @param lookupKey value of the key to look for
-   */
-  public void setLookupKey(XMLString lookupKey)
-  {
-
-    // System.out.println("setLookupKey - lookupKey: "+lookupKey);
-    ((KeyWalker) m_firstWalker).m_lookupKey = lookupKey;
-
-    int context = getContext();
-    DTM dtm = this.getDTM(context);
-    m_firstWalker.setRoot(dtm.getDocument());
-    this.setLastUsedWalker(m_firstWalker);
-    this.setNextPosition(0);
-  }
-  
-  /**
-   * Set the KeyTable associated with this iterator  
-   *
-   *
-   * @param keyTable, the KeyTable associated with this iterator
-   */
-  void setKeyTable(KeyTable keyTable)
-  {
-    m_keyTable = keyTable;
-  }  
-  
-  /**
-   * Add this value(ref) to the refsTable in KeyTable  
-   *
-   *
-   * @param ref Key value(ref)(from key use field)
-   * @param node Node matching that ref 
-   */
-  void addRefNode(XMLString ref, int node)
-  {
-    m_keyTable.addRefNode(ref, node);
-  }
-  
-  /**
-   * Indicate whether we have walked the whole tree  
-   *
-   * @param b False if we have walked the whole tree
-   */
-  void setLookForMoreNodes(boolean b)
-  {
-    m_lookForMoreNodes = b;
-  }
-  
-  /**
-   * Get flag indicating whether we have walked the whole tree  
-   *
-   */
-  boolean getLookForMoreNodes()
-  {
-    return m_lookForMoreNodes;
-  }
-  
-}
diff --git a/src/org/apache/xalan/transformer/KeyManager.java b/src/org/apache/xalan/transformer/KeyManager.java
deleted file mode 100644
index b7c7e5e..0000000
--- a/src/org/apache/xalan/transformer/KeyManager.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Vector;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.NodeList;
-import org.apache.xml.dtm.DTM;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.XMLString;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.axes.LocPathIterator;
-
-/**
- * This class manages the key tables.
- */
-public class KeyManager
-{
-
-  /**
-   * Table of tables of element keys.
-   * @see org.apache.xalan.transformer.KeyTable
-   */
-  private transient Vector m_key_tables = null;
-
-  /**
-   * Given a valid element key, return the corresponding node list.
-   *
-   * @param xctxt The XPath runtime state
-   * @param doc The document node
-   * @param name The key element name
-   * @param ref The key value we're looking for 
-   * @param nscontext The prefix resolver for the execution context
-   *
-   * @return A nodelist of nodes mathing the given key
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public LocPathIterator getNodeSetDTMByKey(
-          XPathContext xctxt, int doc, QName name, XMLString ref, PrefixResolver nscontext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    LocPathIterator nl = null;
-    ElemTemplateElement template = (ElemTemplateElement) nscontext;  // yuck -sb
-
-    if ((null != template)
-            && null != template.getStylesheetRoot().getKeysComposed())
-    {
-      boolean foundDoc = false;
-
-      if (null == m_key_tables)
-      {
-        m_key_tables = new Vector(4);
-      }
-      else
-      {
-        int nKeyTables = m_key_tables.size();
-
-        for (int i = 0; i < nKeyTables; i++)
-        {
-          KeyTable kt = (KeyTable) m_key_tables.elementAt(i);
-
-          if (kt.getKeyTableName().equals(name) && doc == kt.getDocKey())
-          {
-            nl = kt.getNodeSetDTMByKey(name, ref);
-
-            if (nl != null)
-            {
-              foundDoc = true;
-
-              break;
-            }
-          }
-        }
-      }
-
-      if ((null == nl) &&!foundDoc /* && m_needToBuildKeysTable */)
-      {
-        KeyTable kt =
-          new KeyTable(doc, nscontext, name,
-                       template.getStylesheetRoot().getKeysComposed(),
-                       xctxt);
-
-        m_key_tables.addElement(kt);
-
-        if (doc == kt.getDocKey())
-        {
-          foundDoc = true;
-          nl = kt.getNodeSetDTMByKey(name, ref);
-        }
-      }
-    }
-
-    return nl;
-  }
-}
diff --git a/src/org/apache/xalan/transformer/KeyRefIterator.java b/src/org/apache/xalan/transformer/KeyRefIterator.java
deleted file mode 100644
index 7c081e9..0000000
--- a/src/org/apache/xalan/transformer/KeyRefIterator.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Vector;
-
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.XMLString;
-import org.apache.xalan.templates.KeyDeclaration;
-import org.apache.xpath.NodeSetDTM;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.DOMException;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class implements an optimized iterator for 
- * "key()" patterns. It uses a KeyIterator to walk the 
- * source tree and incrementally build a list of nodes that match
- * a given key name, match pattern and value.  
- */
-public class KeyRefIterator extends LocPathIterator
-{
-
-  /** Key name.
-   *  @serial         */
-  private final QName m_name;    
-  
-  /** Use field of key function.
-   *  @serial         */
-  private final XMLString m_lookupKey;  
-  
-  /** Main Key iterator for this iterator.
-   *  @serial    */
-  private final KeyIterator m_ki;    
-  
-  /**
-   * Get key name
-   *
-   *
-   * @return Key name
-   */
-  public QName getName()
-  {
-    return m_name;
-  }
-  
-  
-
-  /**
-   * Constructor KeyRefIterator
-   *
-   *
-   * @param ref Key value to match
-   * @param ki The main key iterator used to walk the source tree 
-   */
-  public KeyRefIterator(XMLString ref, KeyIterator ki)
-  {
-
-    super(ki.getPrefixResolver());   
-    m_ki = ki;
-    m_name = ki.getName();
-    m_lookupKey = ref;
-    this.m_execContext = ki.getXPathContext();
-    setShouldCacheNodes(true);
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * 
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-   if (m_foundLast)
-   {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-   }
-    
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    NodeSetDTM m_cachedNodes = getCachedNodes();
-    
-    // We are not using the NodeSetDTM methods getCurrentPos() and nextNode()
-    // in this case because the nodeset is not cloned and therefore
-    // the positions it indicates may not be associated with the 
-    // current iterator.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))        
-    {
-      int next = m_cachedNodes.elementAt(m_next); 
-      this.setCurrentPos(++m_next); 
-      m_lastFetched = next;
-      
-      return next;
-    }    
-
-    int next = DTM.NULL;       
-    if ( m_ki.getLookForMoreNodes()) 
-    {
-      ((KeyWalker)m_ki.getFirstWalker()).m_lookupKey = m_lookupKey;
-      next = m_ki.nextNode();        
-    }
-    
-    if (DTM.NULL != next)
-    {  
-      m_lastFetched = next;
-      this.setCurrentPos(++m_next);
-      return next;
-    }
-    else
-      m_foundLast = true;                      
-    
-    m_lastFetched = DTM.NULL;
-    return DTM.NULL;
-  }
-  
-  /**
-   * Get a cloned LocPathIterator that holds the same 
-   * position as this iterator.
-   *
-   * @return A clone of this iterator that holds the same node position.
-   *
-   * @throws CloneNotSupportedException 
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-    // I wonder if we really want to clone the second time.  Myriam review.
-    KeyRefIterator clone = (KeyRefIterator)super.clone();
-    // clone.m_ki = (KeyIterator)m_ki.clone();
-
-    return clone;
-  }
-  
-//  /**
-//   * Get a cloned Iterator that is reset to the beginning 
-//   * of the query.
-//   *
-//   * @return A cloned NodeIterator set of the start of the query.
-//   *
-//   * @throws CloneNotSupportedException
-//   */
-//  public NodeIterator cloneWithReset() throws CloneNotSupportedException
-//  {
-//    KeyRefIterator clone = (KeyRefIterator)super.cloneWithReset();
-//
-//    return clone;
-//  }
-  
-  /**
-   * Reset the iterator.
-   */
-  public void reset()
-  {
-    super.reset();
-    // setShouldCacheNodes(true);
-    setCurrentPos(0);
-  }
-  
-  /**
-   *  Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   */
-  public void detach()
-  {    
-    // I don't think we want to detach at all for this iterator.
-    // Myriam needs to review.  -sb.
-  }
-
-  
-  /**
-   * Add a node matching this ref to the cached nodes for this iterator 
-   *
-   *
-   * @param node Node to add to cached nodes
-   */
-  public void addNode(int node) 
-  {
-    NodeSetDTM m_cachedNodes = getCachedNodes();
-    if (null != m_cachedNodes)
-    {
-      if(!m_cachedNodes.contains(node))
-        m_cachedNodes.addElement(node);
-    }
-  }  
-       
-}
diff --git a/src/org/apache/xalan/transformer/KeyTable.java b/src/org/apache/xalan/transformer/KeyTable.java
deleted file mode 100644
index b29e8ef..0000000
--- a/src/org/apache/xalan/transformer/KeyTable.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-//import org.w3c.dom.Element;
-//import org.w3c.dom.NamedNodeMap;
-//import org.w3c.dom.Node;
-//import org.w3c.dom.NodeList;
-import org.apache.xml.dtm.DTM;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Enumeration;
-
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPathContext;
-//import org.apache.xpath.DOMHelper;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.templates.KeyDeclaration;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.XMLString;
-import org.apache.xpath.axes.LocPathIterator;
-
-// import org.apache.xalan.dtm.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Table of element keys, keyed by document node.  An instance of this
- * class is keyed by a Document node that should be matched with the
- * root of the current context.  It contains a table of name mappings
- * to tables that contain mappings of identifier values to nodes.
- */
-public class KeyTable
-{
-
-  /**
-   * The document key.  This table should only be used with contexts
-   * whose Document roots match this key.
-   */
-  private int m_docKey;
-
-  /**
-   * Get the document root matching this key.  
-   *
-   *
-   * @return the document root matching this key
-   */
-  public int getDocKey()
-  {
-    return m_docKey;
-  }
-
-  /** 
-   * The main iterator that will walk through the source  
-   * tree for this key.
-   */
-  private KeyIterator m_keyIter;
-  
-  /**
-   * Hashtable of keys.
-   * The table is:
-   * a) keyed by key name,
-   * b) with a value that is a hashtable keyed by key values 
-   * with at value of KeyRefIterator(cloned).
-   */
-  private Hashtable m_defsTable;
-
-  /**
-   * Build a keys table.
-   * @param doc The owner document key.
-   * @param nscontext The stylesheet's namespace context.
-   * @param name The key name
-   * @param keyDeclarations The stylesheet's xsl:key declarations.
-   * @param xmlLiaison The parser liaison for support of getNodeData(useNode).
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public KeyTable(
-          int doc, PrefixResolver nscontext, QName name, Vector keyDeclarations, XPathContext xmlLiaison)
-            throws javax.xml.transform.TransformerException
-  {
-
-    m_docKey = doc;
-    m_keyIter = new KeyIterator(doc, nscontext, name, keyDeclarations,
-                                xmlLiaison);
-    m_keyIter.setKeyTable(this);
-  }  
-
-  /**
-   * Given a valid element key, return the corresponding node list.
-   * 
-   * @param The name of the key, which must match the 'name' attribute on xsl:key.
-   * @param ref The value that must match the value found by the 'match' attribute on xsl:key.
-   * @return If the name was not declared with xsl:key, this will return null,
-   * if the identifier is not found, it will return null,
-   * otherwise it will return a LocPathIterator instance.
-   */
-  public LocPathIterator getNodeSetDTMByKey(QName name, XMLString ref)
-  {
-
-    KeyIterator ki;
-    KeyRefIterator kiRef;
-    Hashtable refsTable = null;
-
-    // First look for the key in the existing key names table
-    if (m_defsTable != null)
-    {
-      refsTable = (Hashtable)m_defsTable.get(name);
-      if (refsTable != null)
-      {
-        Object kiObj = refsTable.get(ref);
-        if (kiObj != null)
-        {
-          // An entry already exists for this key name and value.
-          // Return a clone of the node iterator found.
-          try
-          {
-            // clone with reset??
-            kiRef = (KeyRefIterator)((KeyRefIterator)kiObj).clone();
-            return kiRef;
-          }
-          catch (CloneNotSupportedException cnse)
-          {
-            ki = null;
-          }
-        }
-      }
-    }
-
-    // No entry was found for this key name and value. Create one.
-    {
-      if (m_defsTable == null)
-        m_defsTable = new Hashtable();
-      if (refsTable == null)
-        refsTable = new Hashtable();
-      
-      // initialize walker only once!
-      if (m_keyIter.getFirstWalker().getRoot() == DTM.NULL)
-        m_keyIter.setLookupKey(ref);
-      else
-        ((KeyWalker)m_keyIter.getFirstWalker()).m_lookupKey = ref;
-      kiRef = new KeyRefIterator(ref, m_keyIter);
-      refsTable.put(ref, kiRef);
-      m_defsTable.put(name,refsTable);
-      return kiRef;              
-    } 
-  }
-
-  /**
-   * Get Key Name for this KeyTable  
-   *
-   *
-   * @return Key name
-   */
-  public QName getKeyTableName()
-  {
-    return m_keyIter.getName();
-  }
-  
-  /**
-   * Add this node to the nodelist matching this key value. 
-   * If there was no existing entry for that key value, create
-   * one.   
-   *
-   * @param ref Key ref(from key use field)
-   * @param node Node matching that ref 
-   */
-  void addRefNode(XMLString ref, int node)
-  {
-    KeyRefIterator kiRef = null;
-    Hashtable refsTable = null;
-    if (m_defsTable != null)
-    {
-      refsTable = (Hashtable)m_defsTable.get(getKeyTableName());
-      if (refsTable != null)
-      {
-        Object kiObj = refsTable.get(ref);
-        if (kiObj != null)
-        {          
-          kiRef = (KeyRefIterator)kiObj;            
-        }
-      }
-    }
-    if (kiRef == null)
-    {  
-      if (m_defsTable == null)
-        m_defsTable = new Hashtable();
-      if (refsTable == null)
-      {  
-        refsTable = new Hashtable();
-        m_defsTable.put(getKeyTableName(),refsTable);
-      }
-      kiRef = new KeyRefIterator(ref, m_keyIter);
-      refsTable.put(ref, kiRef);      
-    }
-    kiRef.addNode(node); 
-  }
-  
-  
-}
diff --git a/src/org/apache/xalan/transformer/KeyWalker.java b/src/org/apache/xalan/transformer/KeyWalker.java
deleted file mode 100644
index a1362e6..0000000
--- a/src/org/apache/xalan/transformer/KeyWalker.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Vector;
-
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.XMLString;
-import org.apache.xalan.templates.KeyDeclaration;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.axes.AxesWalker;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPath;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.Axis;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Walker for a Key() function.
- */
-public class KeyWalker extends AxesWalker
-{
-
-  /**
-   * Construct a KeyWalker using a LocPathIterator.
-   *
-   * @param locPathIterator: this is usually a KeyIterator
-   */
-  public KeyWalker(LocPathIterator locPathIterator)
-  {
-    super(locPathIterator, Axis.DESCENDANTORSELF);
-  }
-
-  /**
-   *  Set the root node of the TreeWalker.
-   *
-   * @param root Document root node
-   */
-  public void setRoot(int root)
-  {
-
-    m_nextAttr = DTM.NULL;
-    m_foundAttrs = false;
-
-    super.setRoot(root);
-  }
-
-  /** First attribute of the current node.      */
-  transient int m_nextAttr;
-
-  /** Flag indicating that attibute nodes were found for the current node    */
-  transient boolean m_foundAttrs;
-
-  /** Key value that this is looking for.
-   *  @serial           */
-  XMLString m_lookupKey;
-
-  /**
-   * Get the next node in document order on the axes.
-   *
-   * @return The next node found or null.
-   */
-  protected int getNextNode()
-  {
-
-    int currentNode = getCurrentNode();
-    DTM dtm = this.m_lpi.getXPathContext().getDTM(currentNode);
-    if (!m_foundAttrs)
-    {
-      m_nextAttr = dtm.getFirstAttribute(currentNode);
-      m_foundAttrs = true;
-      if (DTM.NULL != m_nextAttr)
-        return m_nextAttr;
-    } 
-    else if (DTM.NULL != m_nextAttr)
-    {
-      m_nextAttr = dtm.getNextAttribute(m_nextAttr);
-      if (DTM.NULL != m_nextAttr)
-        return m_nextAttr;
-    }
-
-    int next = super.getNextNode();
-
-    if (DTM.NULL != next)
-      m_foundAttrs = false;
-
-    return next;
-  }
-
-  /**
-   *  Test whether a specified node is visible in the logical view of a
-   * TreeWalker or NodeIterator. This function will be called by the
-   * implementation of TreeWalker and NodeIterator; it is not intended to
-   * be called directly from user code.
-   * 
-   * @param testnode  The node to check to see if it passes the filter or not.
-   *
-   * @return  a constant to determine whether the node is accepted,
-   *   rejected, or skipped, as defined  above .
-   */
-  public short acceptNode(int testNode)
-  {
-    boolean foundKey = false;
-    KeyIterator ki = (KeyIterator) m_lpi;
-    Vector keys = ki.getKeyDeclarations();
-
-    QName name = ki.getName();
-    try
-    {
-      XMLString lookupKey = m_lookupKey;
-
-      // System.out.println("lookupKey: "+lookupKey);
-      int nDeclarations = keys.size();
-
-      // Walk through each of the declarations made with xsl:key
-      for (int i = 0; i < nDeclarations; i++)
-      {
-        KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i);
-
-        // Only continue if the name on this key declaration
-        // matches the name on the iterator for this walker. 
-        if(!kd.getName().equals(name)) 
-          continue;
-        
-                                foundKey = true;
-        ki.getXPathContext().setNamespaceContext(ki.getPrefixResolver());
-
-        // See if our node matches the given key declaration according to 
-        // the match attribute on xsl:key.
-        double score = kd.getMatch().getMatchScore(ki.getXPathContext(),
-                                                   testNode);
-
-        if (score == kd.getMatch().MATCH_SCORE_NONE)
-          continue;        
-                
-        // Query from the node, according the the select pattern in the
-        // use attribute in xsl:key.
-        XObject xuse = kd.getUse().execute(ki.getXPathContext(), testNode,
-                                           ki.getPrefixResolver());
-
-        if (xuse.getType() != xuse.CLASS_NODESET)
-        {
-          XMLString exprResult = xuse.xstr();
-          ((KeyIterator)m_lpi).addRefNode(exprResult, testNode);
-          
-          if (lookupKey.equals(exprResult))
-            return DTMIterator.FILTER_ACCEPT;
-        }
-        else
-        {
-          DTMIterator nl = xuse.iter();
-          int useNode;
-          short result = -1;
-          /*
-          We are walking through all the nodes in this nodeset
-          rather than stopping when we find the one we're looking
-          for because we don't currently save the state of KeyWalker
-          such that the next time it gets called it would continue
-          to look in this nodeset for any further matches. 
-          TODO: Try to save the state of KeyWalker, i.e. keep this node
-          iterator saved somewhere and finish walking through its nodes
-          the next time KeyWalker is called before we look for any new
-          matches. What if the next call is for the same match+use 
-          combination??
-          */
-          while (DTM.NULL != (useNode = nl.nextNode()))
-          {
-            DTM dtm = getDTM(useNode);
-            XMLString exprResult = dtm.getStringValue(useNode);
-            ((KeyIterator)m_lpi).addRefNode(exprResult, testNode); 
-            
-            if ((null != exprResult) && lookupKey.equals(exprResult))
-              result = DTMIterator.FILTER_ACCEPT;
-              //return DTMIterator.FILTER_ACCEPT;
-          }
-          if (-1 != result)
-            return result;
-        }       
-        
-      }  // end for(int i = 0; i < nDeclarations; i++)
-    }
-    catch (TransformerException se)
-    {
-
-      // TODO: What to do?
-    }
-
-                if (!foundKey)
-                        throw new RuntimeException
-                                (XSLMessages.createMessage(XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[]{name.getLocalName()}));
-    return DTMIterator.FILTER_REJECT;
-  }
-  
-   /**
-   *  Moves the <code>TreeWalker</code> to the next visible node in document
-   * order relative to the current node, and returns the new node. If the
-   * current node has no next node,  or if the search for nextNode attempts
-   * to step upward from the TreeWalker's root node, returns
-   * <code>null</code> , and retains the current node.
-   * 
-   * @return  The new node, or <code>null</code> if the current node has no
-   *   next node  in the TreeWalker's logical view.
-   */
-  public int nextNode()
-  {
-    int node = super.nextNode();
-    // If there is no next node, we have walked the whole source tree.
-    // Notify the iterator of that so that its callers know that there
-    // are no more nodes to be found.
-    if (node == DTM.NULL)
-      ((KeyIterator)m_lpi).setLookForMoreNodes(false);
-    return node;
-  }
-  
-}
diff --git a/src/org/apache/xalan/transformer/MsgMgr.java b/src/org/apache/xalan/transformer/MsgMgr.java
deleted file mode 100644
index e4e4bd4..0000000
--- a/src/org/apache/xalan/transformer/MsgMgr.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import org.apache.xalan.res.XSLMessages;
-
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.LocatorImpl;
-
-import org.w3c.dom.Node;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.dom.DOMLocator;
-import javax.xml.transform.SourceLocator;
-
-/**
- * This class will manage error messages, warning messages, and other types of
- * message events.
- */
-public class MsgMgr
-{
-
-  /**
-   * Create a message manager object.
-   *
-   * @param transformer non transformer instance
-   */
-  public MsgMgr(TransformerImpl transformer)
-  {
-    m_transformer = transformer;
-  }
-
-  /** Transformer instance          */
-  private TransformerImpl m_transformer;
-
-  /** XSLMessages instance, sets things up for issuing messages          */
-  private static XSLMessages m_XSLMessages = new XSLMessages();
-
-  /**
-   * Warn the user of a problem.
-   * This is public for access by extensions.
-   *
-   * @param msg The message text to issue
-   * @param terminate Flag indicating whether to terminate this process
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException
-  {
-
-    ErrorListener errHandler = m_transformer.getErrorListener();
-
-    if (null != errHandler)
-    {
-      errHandler.warning(new TransformerException(msg, srcLctr));
-    }
-    else
-    {
-      if (terminate)
-        throw new TransformerException(msg, srcLctr);
-      else
-        System.out.println(msg);
-    }
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of a problem.
-   *
-   * @param msg Message text to issue
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void warn(SourceLocator srcLctr, int msg) throws TransformerException
-  {
-    warn(srcLctr, null, null, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of a problem.
-   *
-   * @param msg Message text to issue
-   * @param args Arguments to pass to the message
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void warn(SourceLocator srcLctr, int msg, Object[] args) throws TransformerException
-  {
-    warn(srcLctr, null, null, msg, args);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of a problem.
-   *
-   * 
-   * @param styleNode Stylesheet node
-   * @param sourceNode Source tree node
-   * @param msg Message text to issue
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, int msg)
-          throws TransformerException
-  {
-    warn(srcLctr, styleNode, sourceNode, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Warn the user of a problem.
-   *
-   * @param styleNode Stylesheet node
-   * @param sourceNode Source tree node
-   * @param msg Message text to issue
-   * @param args Arguments to pass to the message
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, int msg, Object args[])
-          throws TransformerException
-  {
-
-    String formattedMsg = m_XSLMessages.createWarning(msg, args);
-    ErrorListener errHandler = m_transformer.getErrorListener();
-
-    if (null != errHandler)
-      errHandler.warning(new TransformerException(formattedMsg, srcLctr));
-    else
-      System.out.println(formattedMsg);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Message text to issue
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, String msg) throws TransformerException
-  {
-
-    // Locator locator = m_stylesheetLocatorStack.isEmpty()
-    //                  ? null :
-    //                    ((Locator)m_stylesheetLocatorStack.peek());
-    // Locator locator = null;
-    ErrorListener errHandler = m_transformer.getErrorListener();
-
-    if (null != errHandler)
-      errHandler.fatalError(new TransformerException(msg, srcLctr));
-    else
-      throw new TransformerException(msg, srcLctr);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Message text to issue
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, int msg) throws TransformerException
-  {
-    error(srcLctr, null, null, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Message text to issue
-   * @param args Arguments to be passed to the message 
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, int msg, Object[] args) throws TransformerException
-  {
-    error(srcLctr, null, null, msg, args);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Message text to issue
-   * @param e Exception to throw
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, int msg, Exception e) throws TransformerException
-  {
-    error(srcLctr, msg, null, e);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Message text to issue
-   * @param args Arguments to use in message
-   * @param e Exception to throw
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, int msg, Object args[], Exception e) throws TransformerException
-  {
-
-    //msg  = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg;
-    String formattedMsg = m_XSLMessages.createMessage(msg, args);
-
-    // Locator locator = m_stylesheetLocatorStack.isEmpty()
-    //                   ? null :
-    //                    ((Locator)m_stylesheetLocatorStack.peek());
-    // Locator locator = null;
-    ErrorListener errHandler = m_transformer.getErrorListener();
-
-    if (null != errHandler)
-      errHandler.fatalError(new TransformerException(formattedMsg, srcLctr));
-    else
-      throw new TransformerException(formattedMsg, srcLctr);
-  }
-
-  /**
-   *  <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param styleNode Stylesheet node
-   * @param sourceNode Source tree node
-   * @param msg Message text to issue
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, int msg)
-          throws TransformerException
-  {
-    error(srcLctr, styleNode, sourceNode, msg, null);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param styleNode Stylesheet node
-   * @param sourceNode Source tree node
-   * @param msg Message text to issue
-   * @param args Arguments to use in message
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws TransformerException
-   */
-  public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, int msg, Object args[])
-          throws TransformerException
-  {
-
-    String formattedMsg = m_XSLMessages.createMessage(msg, args);
-
-    // Locator locator = m_stylesheetLocatorStack.isEmpty()
-    //                   ? null :
-    //                    ((Locator)m_stylesheetLocatorStack.peek());
-    // Locator locator = null;
-    ErrorListener errHandler = m_transformer.getErrorListener();
-
-    if (null != errHandler)
-      errHandler.fatalError(new TransformerException(formattedMsg, srcLctr));
-    else
-      throw new TransformerException(formattedMsg, srcLctr);
-  }
-}
diff --git a/src/org/apache/xalan/transformer/NodeSortKey.java b/src/org/apache/xalan/transformer/NodeSortKey.java
deleted file mode 100644
index f6d9d79..0000000
--- a/src/org/apache/xalan/transformer/NodeSortKey.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Locale;
-
-import org.apache.xpath.XPath;
-
-import java.text.Collator;
-
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * <meta name="usage" content="internal"/>
- * Data structure for use by the NodeSorter class.
- */
-class NodeSortKey
-{
-
-  /** Select pattern for this sort key          */
-  XPath m_selectPat;
-
-  /** Flag indicating whether to treat thee result as a number     */
-  boolean m_treatAsNumbers;
-
-  /** Flag indicating whether to sort in descending order      */
-  boolean m_descending;
-
-  /** Flag indicating by case          */
-  boolean m_caseOrderUpper;
-
-  /** Collator instance          */
-  Collator m_col;
-
-  /** Locale we're in          */
-  Locale m_locale;
-
-  /** Prefix resolver to use          */
-  org.apache.xml.utils.PrefixResolver m_namespaceContext;
-
-  /** Transformer instance          */
-  TransformerImpl m_processor;  // needed for error reporting.
-
-  /**
-   * Constructor NodeSortKey
-   *
-   *
-   * @param transformer non null transformer instance
-   * @param selectPat Select pattern for this key 
-   * @param treatAsNumbers Flag indicating whether the result will be a number
-   * @param descending Flag indicating whether to sort in descending order
-   * @param langValue Lang value to use to get locale
-   * @param caseOrderUpper Flag indicating whether case is relevant
-   * @param namespaceContext Prefix resolver
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  NodeSortKey(
-          TransformerImpl transformer, XPath selectPat, boolean treatAsNumbers, 
-          boolean descending, String langValue, boolean caseOrderUpper, 
-          org.apache.xml.utils.PrefixResolver namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    m_processor = transformer;
-    m_namespaceContext = namespaceContext;
-    m_selectPat = selectPat;
-    m_treatAsNumbers = treatAsNumbers;
-    m_descending = descending;
-    m_caseOrderUpper = caseOrderUpper;
-
-    if (null != langValue && m_treatAsNumbers == false)
-    {
-      // See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2851
-      // The constructor of Locale is defined as 
-      //   public Locale(String language, String country)
-      // with
-      //   language - lowercase two-letter ISO-639 code
-      //   country - uppercase two-letter ISO-3166 code
-      // a) language must be provided as a lower-case ISO-code 
-      //    instead of an upper-case code
-      // b) country must be provided as an ISO-code 
-      //    instead of a full localized country name (e.g. "France")
-      m_locale = new Locale(langValue.toLowerCase(), 
-                  Locale.getDefault().getCountry());
-                  
-      // (old, before bug report 2851).
-      //  m_locale = new Locale(langValue.toUpperCase(),
-      //                        Locale.getDefault().getDisplayCountry());                    
-
-      if (null == m_locale)
-      {
-
-        // m_processor.warn("Could not find locale for <sort xml:lang="+langValue);
-        m_locale = Locale.getDefault();
-      }
-    }
-    else
-    {
-      m_locale = Locale.getDefault();
-    }
-
-    m_col = Collator.getInstance(m_locale);
-
-    if (null == m_col)
-    {
-      m_processor.getMsgMgr().warn(null, XSLTErrorResources.WG_CANNOT_FIND_COLLATOR,
-                                   new Object[]{ langValue });  //"Could not find Collator for <sort xml:lang="+langValue);
-
-      m_col = Collator.getInstance();
-    }
-  }
-}
diff --git a/src/org/apache/xalan/transformer/NodeSorter.java b/src/org/apache/xalan/transformer/NodeSorter.java
deleted file mode 100644
index d2fe6ce..0000000
--- a/src/org/apache/xalan/transformer/NodeSorter.java
+++ /dev/null
@@ -1,618 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Vector;
-
-import java.text.NumberFormat;
-import java.text.CollationKey;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xml.utils.NodeVector;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class can sort vectors of DOM nodes according to a select pattern.
- */
-public class NodeSorter
-{
-
-  /** Current XPath context           */
-  XPathContext m_execContext;
-
-  /** Vector of NodeSortKeys          */
-  Vector m_keys;  // vector of NodeSortKeys
-
-//  /**
-//   * TODO: Adjust this for locale.
-//   */
-//  NumberFormat m_formatter = NumberFormat.getNumberInstance();
-
-  /**
-   * Construct a NodeSorter, passing in the XSL TransformerFactory
-   * so it can know how to get the node data according to
-   * the proper whitespace rules.
-   *
-   * @param p Xpath context to use
-   */
-  public NodeSorter(XPathContext p)
-  {
-    m_execContext = p;
-  }
-
-  /**
-   * Given a vector of nodes, sort each node according to
-   * the criteria in the keys.
-   * @param v an vector of Nodes.
-   * @param keys a vector of NodeSortKeys.
-   * @param support XPath context to use
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void sort(DTMIterator v, Vector keys, XPathContext support)
-          throws javax.xml.transform.TransformerException
-  {
-
-    m_keys = keys;
-
-    // QuickSort2(v, 0, v.size() - 1 );
-    int n = v.getLength();
-
-    // %OPT% Change mergesort to just take a DTMIterator?
-    // We would also have to adapt DTMIterator to have the function 
-    // of NodeCompareElem.
-    
-    // Create a vector of node compare elements
-    // based on the input vector of nodes
-    Vector nodes = new Vector();
-
-    for (int i = 0; i < n; i++)
-    {
-      NodeCompareElem elem = new NodeCompareElem(v.item(i));
-
-      nodes.addElement(elem);
-    }
-
-    Vector scratchVector = new Vector();
-
-    mergesort(nodes, scratchVector, 0, n - 1, support);
-
-    // return sorted vector of nodes
-    for (int i = 0; i < n; i++)
-    {
-      v.setItem(((NodeCompareElem) nodes.elementAt(i)).m_node, i);
-    }
-    v.setCurrentPos(0);
-
-    // old code...
-    //NodeVector scratchVector = new NodeVector(n);
-    //mergesort(v, scratchVector, 0, n - 1, support);
-  }
-
-  /**
-   * Return the results of a compare of two nodes.
-   * TODO: Optimize compare -- cache the getStringExpr results, key by m_selectPat + hash of node.
-   *
-   * @param n1 First node to use in compare
-   * @param n2 Second node to use in compare
-   * @param kIndex Index of NodeSortKey to use for sort
-   * @param support XPath context to use
-   *
-   * @return The results of the compare of the two nodes.
-   *
-   * @throws TransformerException
-   */
-  int compare(
-          NodeCompareElem n1, NodeCompareElem n2, int kIndex, XPathContext support)
-            throws TransformerException
-  {
-
-    int result = 0;
-    NodeSortKey k = (NodeSortKey) m_keys.elementAt(kIndex);
-
-    if (k.m_treatAsNumbers)
-    {
-      double n1Num, n2Num;
-
-      if (kIndex == 0)
-      {
-        n1Num = ((Double) n1.m_key1Value).doubleValue();
-        n2Num = ((Double) n2.m_key1Value).doubleValue();
-      }
-      else if (kIndex == 1)
-      {
-        n1Num = ((Double) n1.m_key2Value).doubleValue();
-        n2Num = ((Double) n2.m_key2Value).doubleValue();
-      }
-
-      /* Leave this in case we decide to use an array later
-      if (kIndex < maxkey)
-      {
-      double n1Num = (double)n1.m_keyValue[kIndex];
-      double n2Num = (double)n2.m_keyValue[kIndex];
-      }*/
-      else
-      {
-
-        // Get values dynamically
-        XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node,
-                                           k.m_namespaceContext);
-        XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node,
-                                           k.m_namespaceContext);
-        n1Num = r1.num();
-
-        // Can't use NaN for compare. They are never equal. Use zero instead.
-        // That way we can keep elements in document order. 
-        //n1Num = Double.isNaN(d) ? 0.0 : d;
-        n2Num = r2.num();
-        //n2Num = Double.isNaN(d) ? 0.0 : d;
-      }
-
-      if ((n1Num == n2Num) && ((kIndex + 1) < m_keys.size()))
-      {
-        result = compare(n1, n2, kIndex + 1, support);
-      }
-      else
-      {
-        double diff;
-        if (Double.isNaN(n1Num))
-        {
-          if (Double.isNaN(n2Num))
-            diff = 0.0;
-          else
-            diff = -1;
-        }
-        else if (Double.isNaN(n2Num))
-           diff = 1;
-        else
-          diff = n1Num - n2Num;
-
-        // process order parameter 
-        result = (int) ((diff < 0.0)
-                        ? (k.m_descending ? 1 : -1)
-                        : (diff > 0.0) ? (k.m_descending ? -1 : 1) : 0);
-      }
-    }  // end treat as numbers 
-    else
-    {
-      CollationKey n1String, n2String;
-
-      if (kIndex == 0)
-      {
-        n1String = (CollationKey) n1.m_key1Value;
-        n2String = (CollationKey) n2.m_key1Value;
-      }
-      else if (kIndex == 1)
-      {
-        n1String = (CollationKey) n1.m_key2Value;
-        n2String = (CollationKey) n2.m_key2Value;
-      }
-
-      /* Leave this in case we decide to use an array later
-      if (kIndex < maxkey)
-      {
-        String n1String = (String)n1.m_keyValue[kIndex];
-        String n2String = (String)n2.m_keyValue[kIndex];
-      }*/
-      else
-      {
-
-        // Get values dynamically
-        XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node,
-                                           k.m_namespaceContext);
-        XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node,
-                                           k.m_namespaceContext);
-
-        n1String = k.m_col.getCollationKey(r1.str());
-        n2String = k.m_col.getCollationKey(r2.str());
-      }
-
-      // Use collation keys for faster compare, but note that whitespaces 
-      // etc... are treated differently from if we were comparing Strings.
-      result = n1String.compareTo(n2String);
-
-      //Process caseOrder parameter
-      if (k.m_caseOrderUpper)
-      {
-        String tempN1 = n1String.getSourceString().toLowerCase();
-        String tempN2 = n2String.getSourceString().toLowerCase();
-
-        if (tempN1.equals(tempN2))
-        {
-
-          //java defaults to upper case is greater.
-          result = result == 0 ? 0 : -result;
-        }
-      }
-
-      //Process order parameter
-      if (k.m_descending)
-      {
-        result = -result;
-      }
-    }  //end else
-
-    if (0 == result)
-    {
-      if ((kIndex + 1) < m_keys.size())
-      {
-        result = compare(n1, n2, kIndex + 1, support);
-      }
-    }
-
-    if (0 == result)
-    {
-
-      // I shouldn't have to do this except that there seems to 
-      // be a glitch in the mergesort
-      // if(r1.getType() == r1.CLASS_NODESET)
-      // {
-      DTM dtm = support.getDTM(n1.m_node); // %OPT%
-      result = dtm.isNodeAfter(n1.m_node, n2.m_node) ? -1 : 1;
-
-      // }
-    }
-
-    return result;
-  }
-
-  /**
-   * This implements a standard Mergesort, as described in
-   * Robert Sedgewick's Algorithms book.  This is a better
-   * sort for our purpose than the Quicksort because it
-   * maintains the original document order of the input if
-   * the order isn't changed by the sort.
-   *
-   * @param a First vector of nodes to compare
-   * @param b Second vector of  nodes to compare 
-   * @param l Left boundary of  partition
-   * @param r Right boundary of  partition
-   * @param support XPath context to use
-   *
-   * @throws TransformerException
-   */
-  void mergesort(Vector a, Vector b, int l, int r, XPathContext support)
-          throws TransformerException
-  {
-
-    if ((r - l) > 0)
-    {
-      int m = (r + l) / 2;
-
-      mergesort(a, b, l, m, support);
-      mergesort(a, b, m + 1, r, support);
-
-      int i, j, k;
-
-      for (i = m; i >= l; i--)
-      {
-
-        // b[i] = a[i];
-        // Use insert if we need to increment vector size.
-        if (i >= b.size())
-          b.insertElementAt(a.elementAt(i), i);
-        else
-          b.setElementAt(a.elementAt(i), i);
-      }
-
-      i = l;
-
-      for (j = (m + 1); j <= r; j++)
-      {
-
-        // b[r+m+1-j] = a[j];
-        if (r + m + 1 - j >= b.size())
-          b.insertElementAt(a.elementAt(j), r + m + 1 - j);
-        else
-          b.setElementAt(a.elementAt(j), r + m + 1 - j);
-      }
-
-      j = r;
-
-      int compVal;
-
-      for (k = l; k <= r; k++)
-      {
-
-        // if(b[i] < b[j])
-        if (i == j)
-          compVal = -1;
-        else
-          compVal = compare((NodeCompareElem) b.elementAt(i),
-                            (NodeCompareElem) b.elementAt(j), 0, support);
-
-        if (compVal < 0)
-        {
-
-          // a[k]=b[i];
-          a.setElementAt(b.elementAt(i), k);
-
-          i++;
-        }
-        else if (compVal > 0)
-        {
-
-          // a[k]=b[j]; 
-          a.setElementAt(b.elementAt(j), k);
-
-          j--;
-        }
-      }
-    }
-  }
-
-  /**
-   * This is a generic version of C.A.R Hoare's Quick Sort
-   * algorithm.  This will handle arrays that are already
-   * sorted, and arrays with duplicate keys.<BR>
-   *
-   * If you think of a one dimensional array as going from
-   * the lowest index on the left to the highest index on the right
-   * then the parameters to this function are lowest index or
-   * left and highest index or right.  The first time you call
-   * this function it will be with the parameters 0, a.length - 1.
-   *
-   * @param v       a vector of integers 
-   * @param lo0     left boundary of array partition
-   * @param hi0     right boundary of array partition
-   *
-   */
-
-  /*  private void QuickSort2(Vector v, int lo0, int hi0, XPathContext support)
-      throws javax.xml.transform.TransformerException,
-             java.net.MalformedURLException,
-             java.io.FileNotFoundException,
-             java.io.IOException
-    {
-      int lo = lo0;
-      int hi = hi0;
-
-      if ( hi0 > lo0)
-      {
-        // Arbitrarily establishing partition element as the midpoint of
-        // the array.
-        Node midNode = (Node)v.elementAt( ( lo0 + hi0 ) / 2 );
-
-        // loop through the array until indices cross
-        while( lo <= hi )
-        {
-          // find the first element that is greater than or equal to
-          // the partition element starting from the left Index.
-          while( (lo < hi0) && (compare((Node)v.elementAt(lo), midNode, 0, support) < 0) )
-          {
-            ++lo;
-          } // end while
-
-          // find an element that is smaller than or equal to
-          // the partition element starting from the right Index.
-          while( (hi > lo0) && (compare((Node)v.elementAt(hi), midNode, 0, support) > 0) )
-          {
-            --hi;
-          }
-
-          // if the indexes have not crossed, swap
-          if( lo <= hi )
-          {
-            swap(v, lo, hi);
-            ++lo;
-            --hi;
-          }
-        }
-
-        // If the right index has not reached the left side of array
-        // must now sort the left partition.
-        if( lo0 < hi )
-        {
-          QuickSort2( v, lo0, hi, support );
-        }
-
-        // If the left index has not reached the right side of array
-        // must now sort the right partition.
-        if( lo < hi0 )
-        {
-          QuickSort2( v, lo, hi0, support );
-        }
-      }
-    } // end QuickSort2  */
-
-//  /**
-//   * Simple function to swap two elements in
-//   * a vector.
-//   * 
-//   * @param v Vector of nodes to swap
-//   * @param i Index of first node to swap
-//   * @param i Index of second node to swap
-//   */
-//  private void swap(Vector v, int i, int j)
-//  {
-//
-//    int node = (Node) v.elementAt(i);
-//
-//    v.setElementAt(v.elementAt(j), i);
-//    v.setElementAt(node, j);
-//  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * This class holds the value(s) from executing the given
-   * node against the sort key(s). 
-   */
-  class NodeCompareElem
-  {
-
-    /** Current node          */
-    int m_node;
-
-    /** This maxkey value was chosen arbitrarily. We are assuming that the    
-    // maxkey + 1 keys will only hit fairly rarely and therefore, we
-    // will get the node values for those keys dynamically.
-    */
-    int maxkey = 2;
-
-    // Keep this in case we decide to use an array. Right now
-    // using two variables is cheaper.
-    //Object[] m_KeyValue = new Object[2];
-
-    /** Value from first sort key           */
-    Object m_key1Value;
-
-    /** Value from second sort key            */
-    Object m_key2Value;
-
-    /**
-     * Constructor NodeCompareElem
-     *
-     *
-     * @param node Current node
-     *
-     * @throws javax.xml.transform.TransformerException
-     */
-    NodeCompareElem(int node) throws javax.xml.transform.TransformerException
-    {
-
-      boolean tryNextKey = true;
-
-      m_node = node;
-
-      if (!m_keys.isEmpty())
-      {
-        NodeSortKey k1 = (NodeSortKey) m_keys.elementAt(0);
-        XObject r = k1.m_selectPat.execute(m_execContext, node,
-                                           k1.m_namespaceContext);
-
-        if (r == null)
-          tryNextKey = false;
-
-        double d;
-
-        if (k1.m_treatAsNumbers)
-        {
-          d = r.num();
-
-          // Can't use NaN for compare. They are never equal. Use zero instead.  
-          m_key1Value = new Double(d);
-        }
-        else
-        {
-          m_key1Value = k1.m_col.getCollationKey(r.str());
-        }
-
-        if (r.getType() == XObject.CLASS_NODESET)
-        {
-          // %REVIEW%
-          DTMIterator ni = (DTMIterator)r.object();
-          int current = ni.getCurrentNode();
-          if(DTM.NULL == current)
-            current = ni.nextNode();
-
-          // if (ni instanceof ContextNodeList) // %REVIEW%
-          tryNextKey = (DTM.NULL != current);
-
-          // else abdicate... should never happen, but... -sb
-        }
-
-        if (m_keys.size() > 1)
-        {
-          NodeSortKey k2 = (NodeSortKey) m_keys.elementAt(1);
-
-          if (!tryNextKey)
-          {
-            if (k2.m_treatAsNumbers)
-              m_key2Value = new Double(0.0);
-            else
-              m_key2Value = k2.m_col.getCollationKey("");
-          }
-          else
-          {
-            XObject r2 = k2.m_selectPat.execute(m_execContext, node,
-                                                k2.m_namespaceContext);
-
-            if (k2.m_treatAsNumbers)
-            {
-              d = r2.num();
-              m_key2Value = new Double(d);
-            }
-            else
-              m_key2Value = k2.m_col.getCollationKey(r2.str());
-          }
-        }
-
-        /* Leave this in case we decide to use an array later
-        while (kIndex <= m_keys.size() && kIndex < maxkey)
-        {
-          NodeSortKey k = (NodeSortKey)m_keys.elementAt(kIndex);
-          XObject r = k.m_selectPat.execute(m_execContext, node, k.m_namespaceContext);
-          if(k.m_treatAsNumbers)
-            m_KeyValue[kIndex] = r.num();
-          else
-            m_KeyValue[kIndex] = r.str();
-        } */
-      }  // end if not empty    
-    }
-  }  // end NodeCompareElem class
-}
diff --git a/src/org/apache/xalan/transformer/NumeratorFormatter.java b/src/org/apache/xalan/transformer/NumeratorFormatter.java
deleted file mode 100644
index 45d9e01..0000000
--- a/src/org/apache/xalan/transformer/NumeratorFormatter.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.util.Locale;
-import java.util.NoSuchElementException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Converts enumerated numbers into strings, using the XSL conversion attributes.
- * Having this in a class helps avoid being forced to extract the attributes repeatedly.
- */
-class NumeratorFormatter
-{
-
-  /** The owning xsl:number element.          */
-  protected Element m_xslNumberElement;
-
-  /** An instance of a Tokenizer          */
-  NumberFormatStringTokenizer m_formatTokenizer;
-
-  /** Locale we need to format in          */
-  Locale m_locale;
-
-  /** An instance of a NumberFormat         */
-  java.text.NumberFormat m_formatter;
-
-  /** An instance of a transformer          */
-  TransformerImpl m_processor;
-
-  /**
-   * Table to help in converting decimals to roman numerals.
-   * @see org.apache.xalan.transformer.DecimalToRoman
-   */
-  private final static DecimalToRoman m_romanConvertTable[] = {
-    new DecimalToRoman(1000, "M", 900, "CM"),
-    new DecimalToRoman(500, "D", 400, "CD"),
-    new DecimalToRoman(100L, "C", 90L, "XC"),
-    new DecimalToRoman(50L, "L", 40L, "XL"),
-    new DecimalToRoman(10L, "X", 9L, "IX"),
-    new DecimalToRoman(5L, "V", 4L, "IV"),
-    new DecimalToRoman(1L, "I", 1L, "I") };
-
-  /**
-   * Chars for converting integers into alpha counts.
-   * @see TransformerImpl#int2alphaCount
-   */
-  private final static char[] m_alphaCountTable = { 'Z',  // z for zero
-                                                    'A', 'B', 'C', 'D', 'E',
-                                                    'F', 'G', 'H', 'I', 'J',
-                                                    'K', 'L', 'M', 'N', 'O',
-                                                    'P', 'Q', 'R', 'S', 'T',
-                                                    'U', 'V', 'W', 'X', 'Y' };
-
-  /**
-   * Construct a NumeratorFormatter using an element
-   * that contains XSL number conversion attributes -
-   * format, letter-value, xml:lang, digit-group-sep,
-   * n-digits-per-group, and sequence-src.
-   *
-   * @param xslNumberElement The given xsl:number element
-   * @param processor a non-null transformer instance
-   */
-  NumeratorFormatter(Element xslNumberElement, TransformerImpl processor)
-  {
-    m_xslNumberElement = xslNumberElement;
-    m_processor = processor;
-  }  // end NumeratorFormatter(Element) constructor
-
-  /**
-   * Convert a long integer into alphabetic counting, in other words
-   * count using the sequence A B C ... Z AA AB AC.... etc.
-   * 
-   * @param val Value to convert -- must be greater than zero.
-   * @param table a table containing one character for each digit in the radix
-   * @return String representing alpha count of number.
-   * @see org.apache.xalan.transformer.DecimalToRoman
-   *
-   * Note that the radix of the conversion is inferred from the size
-   * of the table.
-   */
-  protected String int2alphaCount(int val, char[] table)
-  {
-
-    int radix = table.length;
-
-    // Create a buffer to hold the result
-    // TODO:  size of the table can be detereined by computing
-    // logs of the radix.  For now, we fake it.
-    char buf[] = new char[100];
-
-    // next character to set in the buffer
-    int charPos = buf.length - 1;  // work backward through buf[]
-
-    // index in table of the last character that we stored
-    int lookupIndex = 1;  // start off with anything other than zero to make correction work
-
-    //                                          Correction number
-    //
-    //  Correction can take on exactly two values:
-    //
-    //          0       if the next character is to be emitted is usual
-    //
-    //      radix - 1
-    //                  if the next char to be emitted should be one less than
-    //                  you would expect
-    //
-    // For example, consider radix 10, where 1="A" and 10="J"
-    //
-    // In this scheme, we count: A, B, C ...   H, I, J (not A0 and certainly
-    // not AJ), A1
-    //
-    // So, how do we keep from emitting AJ for 10?  After correctly emitting the
-    // J, lookupIndex is zero.  We now compute a correction number of 9 (radix-1).
-    // In the following line, we'll compute (val+correction) % radix, which is,
-    // (val+9)/10.  By this time, val is 1, so we compute (1+9) % 10, which
-    // is 10 % 10 or zero.  So, we'll prepare to emit "JJ", but then we'll
-    // later suppress the leading J as representing zero (in the mod system,
-    // it can represent either 10 or zero).  In summary, the correction value of
-    // "radix-1" acts like "-1" when run through the mod operator, but with the
-    // desireable characteristic that it never produces a negative number.
-    int correction = 0;
-
-    // TODO:  throw error on out of range input
-    do
-    {
-
-      // most of the correction calculation is explained above,  the reason for the
-      // term after the "|| " is that it correctly propagates carries across
-      // multiple columns.
-      correction =
-        ((lookupIndex == 0) || (correction != 0 && lookupIndex == radix - 1))
-        ? (radix - 1) : 0;
-
-      // index in "table" of the next char to emit
-      lookupIndex = (val + correction) % radix;
-
-      // shift input by one "column"
-      val = (val / radix);
-
-      // if the next value we'd put out would be a leading zero, we're done.
-      if (lookupIndex == 0 && val == 0)
-        break;
-
-      // put out the next character of output
-      buf[charPos--] = table[lookupIndex];
-    }
-    while (val > 0);
-
-    return new String(buf, charPos + 1, (buf.length - charPos - 1));
-  }
-
-  /**
-   * Convert a long integer into roman numerals.
-   * @param val Value to convert.
-   * @param prefixesAreOK true_ to enable prefix notation (e.g. 4 = "IV"),
-   * false_ to disable prefix notation (e.g. 4 = "IIII").
-   * @return Roman numeral string.
-   * @see DecimalToRoman
-   * @see m_romanConvertTable
-   */
-  String long2roman(long val, boolean prefixesAreOK)
-  {
-
-    if (val <= 0)
-    {
-      return "#E(" + val + ")";
-    }
-
-    String roman = "";
-    int place = 0;
-
-    if (val <= 3999L)
-    {
-      do
-      {
-        while (val >= m_romanConvertTable[place].m_postValue)
-        {
-          roman += m_romanConvertTable[place].m_postLetter;
-          val -= m_romanConvertTable[place].m_postValue;
-        }
-
-        if (prefixesAreOK)
-        {
-          if (val >= m_romanConvertTable[place].m_preValue)
-          {
-            roman += m_romanConvertTable[place].m_preLetter;
-            val -= m_romanConvertTable[place].m_preValue;
-          }
-        }
-
-        place++;
-      }
-      while (val > 0);
-    }
-    else
-    {
-      roman = "#error";
-    }
-
-    return roman;
-  }  // end long2roman
-
-  /**
-   * This class returns tokens using non-alphanumberic
-   * characters as delimiters.
-   */
-  class NumberFormatStringTokenizer
-  {
-
-    /** Field holding the current position in the string      */
-    private int currentPosition;
-
-    /** The total length of the string          */
-    private int maxPosition;
-
-    /** The string to tokenize          */
-    private String str;
-
-    /**
-     * Construct a NumberFormatStringTokenizer.
-     *
-     * @param str The string to tokenize
-     */
-    NumberFormatStringTokenizer(String str)
-    {
-      this.str = str;
-      maxPosition = str.length();
-    }
-    
-    /**
-     * Reset tokenizer so that nextToken() starts from the beginning. 
-     *
-     */
-    void reset()
-    {
-      currentPosition = 0;
-    }
-
-    /**
-     * Returns the next token from this string tokenizer.
-     *
-     * @return     the next token from this string tokenizer.
-     * @throws  NoSuchElementException  if there are no more tokens in this
-     *               tokenizer's string.
-     */
-    String nextToken()
-    {
-
-      if (currentPosition >= maxPosition)
-      {
-        throw new NoSuchElementException();
-      }
-
-      int start = currentPosition;
-
-      while ((currentPosition < maxPosition)
-             && Character.isLetterOrDigit(str.charAt(currentPosition)))
-      {
-        currentPosition++;
-      }
-
-      if ((start == currentPosition)
-              && (!Character.isLetterOrDigit(str.charAt(currentPosition))))
-      {
-        currentPosition++;
-      }
-
-      return str.substring(start, currentPosition);
-    }
-
-    /**
-     * Tells if <code>nextToken</code> will throw an exception      * if it is called.
-     *
-     * @return true if <code>nextToken</code> can be called      * without throwing an exception.
-     */
-    boolean hasMoreTokens()
-    {
-      return (currentPosition >= maxPosition) ? false : true;
-    }
-
-    /**
-     * Calculates the number of times that this tokenizer's
-     * <code>nextToken</code> method can be called before it generates an
-     * exception.
-     *
-     * @return  the number of tokens remaining in the string using the current
-     *          delimiter set.
-     * @see     java.util.StringTokenizer#nextToken()
-     */
-    int countTokens()
-    {
-
-      int count = 0;
-      int currpos = currentPosition;
-
-      while (currpos < maxPosition)
-      {
-        int start = currpos;
-
-        while ((currpos < maxPosition)
-               && Character.isLetterOrDigit(str.charAt(currpos)))
-        {
-          currpos++;
-        }
-
-        if ((start == currpos)
-                && (Character.isLetterOrDigit(str.charAt(currpos)) == false))
-        {
-          currpos++;
-        }
-
-        count++;
-      }
-
-      return count;
-    }
-  }  // end NumberFormatStringTokenizer
-}
diff --git a/src/org/apache/xalan/transformer/QueuedEvents.java b/src/org/apache/xalan/transformer/QueuedEvents.java
deleted file mode 100644
index f5bdd1a..0000000
--- a/src/org/apache/xalan/transformer/QueuedEvents.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Stack;
-import java.util.Vector;
-
-import org.apache.xml.utils.ObjectPool;
-
-import org.xml.sax.Attributes;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.utils.MutableAttrListImpl;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemTemplate;
-
-
-/**
- * This class acts as a base for ResultTreeHandler, and keeps
- * queud stack events.  In truth, we don't need a stack,
- * so I may change this down the line a bit.
- */
-public abstract class QueuedEvents
-{
-
-  /** The number of events queued          */
-  protected int m_eventCount = 0;
-
-  /** Queued start document          */
-  // QueuedStartDocument m_startDoc = new QueuedStartDocument();
-
-  /** Queued start element          */
-  // QueuedStartElement m_startElement = new QueuedStartElement();
-  
-  public boolean m_docPending = false;
-  protected boolean m_docEnded = false;
-  
-  /** Flag indicating that an event is pending.  Public for 
-   *  fast access by ElemForEach.         */
-  public boolean m_elemIsPending = false;
-
-  /** Flag indicating that an event is ended          */
-  public boolean m_elemIsEnded = false;
-  
-  /**
-   * The pending attributes.  We have to delay the call to
-   * m_flistener.startElement(name, atts) because of the
-   * xsl:attribute and xsl:copy calls.  In other words,
-   * the attributes have to be fully collected before you
-   * can call startElement.
-   */
-  protected MutableAttrListImpl m_attributes = new MutableAttrListImpl();
-
-  /**
-   * Flag to try and get the xmlns decls to the attribute list
-   * before other attributes are added.
-   */
-  protected boolean m_nsDeclsHaveBeenAdded = false;
-
-  /**
-   * The pending element, namespace, and local name.
-   */
-  protected String m_name;
-
-  /** Namespace URL of the element          */
-  protected String m_url;
-
-  /** Local part of qualified name of the element           */
-  protected String m_localName;
-  
-  
-  /** Vector of namespaces for this element          */
-  protected Vector m_namespaces = null;
-
-//  /**
-//   * Get the queued element.
-//   *
-//   * @return the queued element.
-//   */
-//  QueuedStartElement getQueuedElem()
-//  {
-//    return (m_eventCount > 1) ? m_startElement : null;
-//  }
-
-  /**
-   * To re-initialize the document and element events 
-   *
-   */
-  protected void reInitEvents()
-  {
-  }
-
-  /**
-   * Push document event and re-initialize events  
-   *
-   */
-  public void reset()
-  {
-    pushDocumentEvent();
-    reInitEvents();
-  }
-
-  /**
-   * Push the document event.  This never gets popped.
-   */
-  void pushDocumentEvent()
-  {
-
-    // m_startDoc.setPending(true);
-    // initQSE(m_startDoc);
-    m_docPending = true;
-
-    m_eventCount++;
-  }
-
-  /**
-   * Pop element event 
-   *
-   */
-  void popEvent()
-  {
-    m_elemIsPending = false;
-    m_attributes.clear();
-
-    m_nsDeclsHaveBeenAdded = false;
-    m_name = null;
-    m_url = null;
-    m_localName = null;
-    m_namespaces = null;
-
-    m_eventCount--;
-  }
-
-  /** Instance of a serializer          */
-  private org.apache.xalan.serialize.Serializer m_serializer;
-
-  /**
-   * This is only for use of object pooling, so that
-   * it can be reset.
-   *
-   * @param s non-null instance of a serializer 
-   */
-  void setSerializer(org.apache.xalan.serialize.Serializer s)
-  {
-    m_serializer = s;
-  }
-
-  /**
-   * This is only for use of object pooling, so the that
-   * it can be reset.
-   *
-   * @return The serializer
-   */
-  org.apache.xalan.serialize.Serializer getSerializer()
-  {
-    return m_serializer;
-  }
-}
diff --git a/src/org/apache/xalan/transformer/ResultNameSpace.java b/src/org/apache/xalan/transformer/ResultNameSpace.java
deleted file mode 100644
index 3292e87..0000000
--- a/src/org/apache/xalan/transformer/ResultNameSpace.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-/**
- * <meta name="usage" content="internal"/>
- * A representation of a result namespace.  One of these will
- * be pushed on the result tree namespace stack for each
- * result tree element.
- */
-public class ResultNameSpace
-{
-
-  /** Pointer to next ResultNameSpace          */
-  public ResultNameSpace m_next = null;
-
-  /** Prefix of namespace         */
-  public String m_prefix;
-
-  /** Namespace URI          */
-  public String m_uri;  // if null, then Element namespace is empty.
-
-  /**
-   * Construct a namespace for placement on the
-   * result tree namespace stack.
-   *
-   * @param prefix of result namespace
-   * @param uri URI of result namespace
-   */
-  public ResultNameSpace(String prefix, String uri)
-  {
-    m_prefix = prefix;
-    m_uri = uri;
-  }
-}
diff --git a/src/org/apache/xalan/transformer/ResultTreeHandler.java b/src/org/apache/xalan/transformer/ResultTreeHandler.java
deleted file mode 100644
index 33b63d0..0000000
--- a/src/org/apache/xalan/transformer/ResultTreeHandler.java
+++ /dev/null
@@ -1,1863 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Enumeration;
-
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.trace.GenerateEvent;
-import org.apache.xml.utils.MutableAttrListImpl;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.ObjectPool;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXException;
-import org.xml.sax.ErrorHandler;
-
-import org.xml.sax.helpers.NamespaceSupport;
-import org.apache.xml.utils.NamespaceSupport2;
-import org.xml.sax.Locator;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Transformer;
-
-/**
- * This class is a layer between the direct calls to the result
- * tree content handler, and the transformer.  For one thing,
- * we have to delay the call to
- * getContentHandler().startElement(name, atts) because of the
- * xsl:attribute and xsl:copy calls.  In other words,
- * the attributes have to be fully collected before you
- * can call startElement.
- */
-public class ResultTreeHandler extends QueuedEvents
-        implements ContentHandler, LexicalHandler, TransformState,
-        org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler,
-        ErrorHandler
-{
-
-  /** Indicate whether running in Debug mode */
-  private static final boolean DEBUG = false;
-
-  /**
-   * Null constructor for object pooling.
-   */
-  public ResultTreeHandler(){}
-
-  /**
-   * Create a new result tree handler.  The real content
-   * handler will be the ContentHandler passed as an argument.
-   *
-   * @param transformer non-null transformer instance
-   * @param realHandler Content Handler instance
-   */
-  public ResultTreeHandler(TransformerImpl transformer,
-                           ContentHandler realHandler)
-  {
-    init(transformer, realHandler);
-  }
-
-  /**
-   * Initializer method.
-   *
-   * @param transformer non-null transformer instance
-   * @param realHandler Content Handler instance
-   */
-  public void init(TransformerImpl transformer, ContentHandler realHandler)
-  {
-
-    m_transformer = transformer;
-
-    // m_startDoc.setTransformer(m_transformer);
-    TraceManager tracer = transformer.getTraceManager();
-
-    if ((null != tracer) && tracer.hasTraceListeners())
-      m_tracer = tracer;
-    else
-      m_tracer = null;
-
-    // m_startDoc.setTraceManager(m_tracer);
-    m_contentHandler = realHandler;
-
-    // m_startDoc.setContentHandler(m_contentHandler);
-    if (m_contentHandler instanceof LexicalHandler)
-      m_lexicalHandler = (LexicalHandler) m_contentHandler;
-    else
-      m_lexicalHandler = null;
-
-    m_isTransformClient = (m_contentHandler instanceof TransformerClient);
-
-    m_cloner = new ClonerToResultTree(transformer, this);
-
-    // The stylesheet is set at a rather late stage, so I do 
-    // this here, though it would probably be better done elsewhere.
-    if (null != m_transformer)
-      m_stylesheetRoot = m_transformer.getStylesheet();
-
-    pushDocumentEvent();  // not pending yet.
-  }
-
-  /**
-   * Bottleneck the startDocument event.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startDocument() throws org.xml.sax.SAXException{}
-
-  /**
-   * Bottleneck the endDocument event.  This may be called
-   * more than once in order to make sure the pending start
-   * document is called.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endDocument() throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (!m_docEnded)
-    {
-      m_contentHandler.endDocument();
-
-      if (null != m_tracer)
-      {
-        GenerateEvent ge =
-          new GenerateEvent(m_transformer,
-                            GenerateEvent.EVENTTYPE_ENDDOCUMENT, null);
-
-        m_tracer.fireGenerateEvent(ge);
-      }
-
-      m_docEnded = true;
-      m_docPending = false;
-    }
-  }
-
-  /**
-   * Bottleneck the startElement event.  This is used to "pend" an
-   * element, so that attributes can still be added to it before
-   * the real "startElement" is called on the result tree listener.
-   *
-   * @param ns Namespace URI of element
-   * @param localName Local part of qname of element
-   * @param name Name of element
-   * @param atts List of attributes for the element
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startElement(
-          String ns, String localName, String name, Attributes atts)
-            throws org.xml.sax.SAXException
-  {
-
-    if (DEBUG)
-    {
-      if (m_elemIsPending)
-        System.out.println("(ResultTreeHandler#startElement - pended: "
-                           + m_url + "#" + m_localName);
-
-      System.out.println("ResultTreeHandler#startElement: " + ns + "#"
-                         + localName);
-
-      //      if(null == ns)
-      //      {
-      //        (new RuntimeException(localName+" has a null namespace!")).printStackTrace();
-      //      }
-    }
-
-    if(m_docPending)
-      checkForSerializerSwitch(ns, localName);
-      
-    flushPending(true);
-
-    if (!m_nsContextPushed)
-    {
-      if (DEBUG)
-        System.out.println(
-          "ResultTreeHandler#startElement - push(startElement)");
-
-      m_nsSupport.pushContext();
-
-      m_nsContextPushed = true;
-    }
-    
-    if (ns != null)
-      ensurePrefixIsDeclared(ns, name);
-
-    m_name = name;
-    m_url = ns;
-    m_localName = localName;
-
-    if (null != atts)
-      m_attributes.addAttributes(atts);
-
-    m_elemIsPending = true;
-    m_elemIsEnded = false;
-    
-    if(m_isTransformClient && (null != m_transformer))
-    {
-      m_snapshot.m_currentElement = m_transformer.getCurrentElement();
-      m_snapshot.m_currentTemplate = m_transformer.getCurrentTemplate();
-      m_snapshot.m_matchedTemplate = m_transformer.getMatchedTemplate();
-      int currentNodeHandle = m_transformer.getCurrentNode();
-      DTM dtm = m_transformer.getXPathContext().getDTM(currentNodeHandle);
-      m_snapshot.m_currentNode = dtm.getNode(currentNodeHandle);
-      m_snapshot.m_matchedNode = m_transformer.getMatchedNode();
-      m_snapshot.m_contextNodeList = m_transformer.getContextNodeList(); // TODO: Need to clone
-    }
-    // initQSE(m_startElement);
-
-    m_eventCount++;
-  }
-
-  /**
-   * Bottleneck the endElement event.
-   *
-   * @param ns Namespace URI of element
-   * @param localName Local part of qname of element
-   * @param name Name of element
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endElement(String ns, String localName, String name)
-          throws org.xml.sax.SAXException
-  {
-
-    if (DEBUG)
-    {
-      if (m_elemIsPending)
-        System.out.println("(ResultTreeHandler#endElement - pended: "
-                           + m_url + "#" + m_localName);
-
-      System.out.println("ResultTreeHandler#endElement: " + ns + "#"
-                         + localName);
-    }
-
-    flushPending(true);
-    m_contentHandler.endElement(ns, localName, name);
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_ENDELEMENT,
-                                           name, (Attributes)null);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-
-    sendEndPrefixMappings();
-    popEvent();
-
-    if (DEBUG)
-      System.out.println("ResultTreeHandler#startElement pop: " + localName);
-
-    m_nsSupport.popContext();
-  }
-
-  /** Indicate whether a namespace context was pushed */
-  boolean m_nsContextPushed = false;
-
-  /**
-   * Begin the scope of a prefix-URI Namespace mapping.
-   *
-   * <p>The information from this event is not necessary for
-   * normal Namespace processing: the SAX XML reader will
-   * automatically replace prefixes for element and attribute
-   * names when the http://xml.org/sax/features/namespaces
-   * feature is true (the default).</p>
-   *
-   * <p>There are cases, however, when applications need to
-   * use prefixes in character data or in attribute values,
-   * where they cannot safely be expanded automatically; the
-   * start/endPrefixMapping event supplies the information
-   * to the application to expand prefixes in those contexts
-   * itself, if necessary.</p>
-   *
-   * <p>Note that start/endPrefixMapping events are not
-   * guaranteed to be properly nested relative to each-other:
-   * all startPrefixMapping events will occur before the
-   * corresponding startElement event, and all endPrefixMapping
-   * events will occur after the corresponding endElement event,
-   * but their order is not guaranteed.</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI the prefix is mapped to.
-   * @throws org.xml.sax.SAXException The client may throw
-   *            an exception during processing.
-   * @see #endPrefixMapping
-   * @see #startElement
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws org.xml.sax.SAXException
-  {
-    startPrefixMapping(prefix, uri, true);
-  }
-
-  /**
-   * Begin the scope of a prefix-URI Namespace mapping.
-   *
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI the prefix is mapped to.
-   * @param shouldFlush Indicate whether pending events needs
-   * to be flushed first
-   *
-   * @throws org.xml.sax.SAXException The client may throw
-   *            an exception during processing.
-   */
-  public void startPrefixMapping(
-          String prefix, String uri, boolean shouldFlush)
-            throws org.xml.sax.SAXException
-  {
-
-    if (shouldFlush)
-      flushPending(false);
-
-    if (!m_nsContextPushed)
-    {
-      if (DEBUG)
-        System.out.println(
-          "ResultTreeHandler#startPrefixMapping push(startPrefixMapping: "
-          + prefix + ")");
-
-      m_nsSupport.pushContext();
-
-      m_nsContextPushed = true;
-    }
-
-    if (null == prefix)
-      prefix = "";  // bit-o-hack, that that's OK
-
-    String existingURI = m_nsSupport.getURI(prefix);
-
-    if (null == existingURI)
-      existingURI = "";
-
-    if (null == uri)
-      uri = "";
-
-    if (!existingURI.equals(uri))
-    {
-      if (DEBUG)
-      {
-        System.out.println("ResultTreeHandler#startPrefixMapping Prefix: "
-                           + prefix);
-        System.out.println("ResultTreeHandler#startPrefixMapping uri: "
-                           + uri);
-      }
-
-      m_nsSupport.declarePrefix(prefix, uri);
-    }
-  }
-
-  /**
-   * End the scope of a prefix-URI mapping.
-   *
-   * <p>See startPrefixMapping for details.  This event will
-   * always occur after the corresponding endElement event,
-   * but the order of endPrefixMapping events is not otherwise
-   * guaranteed.</p>
-   *
-   * @param prefix The prefix that was being mapping.
-   * @throws org.xml.sax.SAXException The client may throw
-   *            an exception during processing.
-   * @see #startPrefixMapping
-   * @see #endElement
-   */
-  public void endPrefixMapping(String prefix)
-          throws org.xml.sax.SAXException{}
-
-  /**
-   * Bottleneck the characters event.
-   *
-   * @param ch Array of characters to process
-   * @param start start of characters in the array
-   * @param length Number of characters in the array
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void characters(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    // It would be nice to suppress all whitespace before the
-    // first element, but this is going to cause potential problems with 
-    // text serialization and with text entities (right term?).
-    // So this really needs to be done at the serializer level.
-
-    /*if (m_startDoc.isPending
-    && XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
-    return;*/
-    if (DEBUG)
-    {
-      System.out.print("ResultTreeHandler#characters: ");
-
-      int n = start + length;
-
-      for (int i = start; i < n; i++)
-      {
-        if (Character.isWhitespace(ch[i]))
-          System.out.print("\\" + ((int) ch[i]));
-        else
-          System.out.print(ch[i]);
-      }
-
-      System.out.println("");
-    }
-
-    flushPending(true);
-    m_contentHandler.characters(ch, start, length);
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_CHARACTERS,
-                                           ch, start, length);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-  
-  public void characters(org.w3c.dom.Node node)
-          throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-    
-    if(m_isTransformClient)
-      m_snapshot.m_currentNode = node;
-
-    String data = node.getNodeValue();
-    char [] ch = null;
-    int length = 0;
-    if (data != null)
-    {
-    ch = data.toCharArray();
-    length = data.length();
-    m_contentHandler.characters(ch, 0, length);
-    }
-    
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_CHARACTERS,
-                                           ch, 0, length);
-
-      m_tracer.fireGenerateEvent(ge);
-    }  
-    if(m_isTransformClient)
-      m_snapshot.m_currentNode = null;
-  }
-
-  /**
-   * Bottleneck the ignorableWhitespace event.
-   *
-   * @param ch Array of characters to process
-   * @param start start of characters in the array
-   * @param length Number of characters in the array
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    if (m_docPending
-            && XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
-      return;
-
-    flushPending(true);
-    m_contentHandler.ignorableWhitespace(ch, start, length);
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge =
-        new GenerateEvent(m_transformer,
-                          GenerateEvent.EVENTTYPE_IGNORABLEWHITESPACE, ch,
-                          start, length);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-
-  /**
-   * Bottleneck the processingInstruction event.
-   *
-   * @param target Processing instruction target name
-   * @param data Processing instruction data
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-    m_contentHandler.processingInstruction(target, data);
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_PI,
-                                           target, data);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-
-  /**
-   * Bottleneck the comment event.
-   *
-   * @param data Comment data
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void comment(String data) throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.comment(data.toCharArray(), 0, data.length());
-    }
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_COMMENT,
-                                           data);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-
-  /**
-   * Bottleneck the comment event.
-   *
-   * @param ch Character array with comment data
-   * @param start start of characters in the array
-   * @param length number of characters in the array
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void comment(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.comment(ch, start, length);
-    }
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_COMMENT,
-                                           new String(ch, start, length));
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-
-  /**
-   * Entity reference event.
-   *
-   * @param name Name of entity
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void entityReference(String name) throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startEntity(name);
-      m_lexicalHandler.endEntity(name);
-    }
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_ENTITYREF,
-                                           name);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-
-  /**
-   * Start an entity.
-   *
-   * @param name Name of the entity
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startEntity(String name) throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startEntity(name);
-    }
-  }
-
-  /**
-   * End an entity.
-   *
-   * @param name Name of the entity
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endEntity(String name) throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.endEntity(name);
-    }
-
-    if (null != m_tracer)
-    {
-      GenerateEvent ge = new GenerateEvent(m_transformer,
-                                           GenerateEvent.EVENTTYPE_ENTITYREF,
-                                           name);
-
-      m_tracer.fireGenerateEvent(ge);
-    }
-  }
-
-  /**
-   * Start the DTD.
-   *
-   * @param s1 The document type name.
-   * @param s2 The declared public identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @param s3 The declared system identifier for the
-   *        external DTD subset, or null if none was declared.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startDTD(String s1, String s2, String s3)
-          throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startDTD(s1, s2, s3);
-    }
-  }
-
-  /**
-   * End the DTD.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endDTD() throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.endDTD();
-    }
-  }
-
-  /**
-   * Start the CDATACharacters.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void startCDATA() throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startCDATA();
-    }
-  }
-
-  /**
-   * End the CDATA characters.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void endCDATA() throws org.xml.sax.SAXException
-  {
-
-    flushPending(true);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.endCDATA();
-    }
-  }
-
-  /**
-   * Receive notification of a skipped entity.
-   *
-   * <p>The Parser will invoke this method once for each entity
-   * skipped.  Non-validating processors may skip entities if they
-   * have not seen the declarations (because, for example, the
-   * entity was declared in an external DTD subset).  All processors
-   * may skip external entities, depending on the values of the
-   * http://xml.org/sax/features/external-general-entities and the
-   * http://xml.org/sax/features/external-parameter-entities
-   * properties.</p>
-   *
-   * @param name The name of the skipped entity.  If it is a
-   *        parameter entity, the name will begin with '%'.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void skippedEntity(String name) throws org.xml.sax.SAXException{}
-
-  /**
-   * Set whether Namespace declarations have been added to
-   * this element
-   *
-   *
-   * @param b Flag indicating whether Namespace declarations
-   * have been added to this element
-   */
-  public void setNSDeclsHaveBeenAdded(boolean b)
-  {
-
-    m_nsDeclsHaveBeenAdded = b;
-  }
-
-  /**
-   * Flush the event.
-   *
-   * @throws TransformerException
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  void flushDocEvent() throws org.xml.sax.SAXException
-  {
-
-    if (m_docPending)
-    {
-      m_contentHandler.startDocument();
-
-      if (null != m_tracer)
-      {
-        GenerateEvent ge =
-          new GenerateEvent(m_transformer,
-                            GenerateEvent.EVENTTYPE_STARTDOCUMENT);
-
-        m_tracer.fireGenerateEvent(ge);
-      }
-
-      if (m_contentHandler instanceof TransformerClient)
-      {
-        ((TransformerClient) m_contentHandler).setTransformState(this);
-      }
-
-      m_docPending = false;
-    }
-  }
-  
-  /**
-   * Flush the event.
-   *
-   * @throws SAXException
-   */
-  void flushElem() throws org.xml.sax.SAXException
-  {
-
-    if (m_elemIsPending)
-    {
-      if (null != m_name)
-      {
-        m_contentHandler.startElement(m_url, m_localName, m_name,
-                                      m_attributes);
-        
-        if(null != m_tracer)
-        {
-          GenerateEvent ge =
-            new GenerateEvent(m_transformer,
-                              GenerateEvent.EVENTTYPE_STARTELEMENT, m_name,
-                                      m_attributes);
-  
-          m_tracer.fireGenerateEvent(ge);
-        }
-        if(m_isTransformClient)
-          m_snapshot.m_currentNode = null;
-      }
-
-      m_elemIsPending = false;
-      m_attributes.clear();
-  
-      m_nsDeclsHaveBeenAdded = false;
-      m_name = null;
-      m_url = null;
-      m_localName = null;
-      m_namespaces = null;
-
-      // super.flush();
-    }
-  }
-
-
-  /**
-   * Flush the pending element.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public final void flushPending() throws org.xml.sax.SAXException
-  {
-    flushPending(true);
-  }
-
-  /**
-   * Flush the pending element.
-   *
-   * @param type Event type
-   *
-   * NEEDSDOC @param flushPrefixes
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public final void flushPending(boolean flushPrefixes)
-          throws org.xml.sax.SAXException
-  {
-
-    if (flushPrefixes && m_docPending)
-    {
-      flushDocEvent();
-    }
-
-    if (m_elemIsPending)
-    {
-      // Combined loop shoud be much more efficient.
-      // %REVIEW% %OPT% Will the "else" case ever arise?
-      if (!m_nsDeclsHaveBeenAdded)
-//        addNSDeclsToAttrs();
-          startAndAddPrefixMappings();  // new
-      else                              // new
-          sendStartPrefixMappings();
-
-
-      if (DEBUG)
-      {
-        System.out.println("ResultTreeHandler#flushPending - start flush: "
-                           + m_name);
-      }
-
-      flushElem();
-
-      if (DEBUG)
-      {
-        System.out.println(
-          "ResultTreeHandler#flushPending - after flush, isPending: "
-          + m_elemIsPending);
-      }
-
-      m_nsContextPushed = false;
-    }
-  }
-
-  /**
-   * Given a result tree fragment, walk the tree and
-   * output it to the result stream.
-   *
-   * @param obj Result tree fragment object
-   * @param support XPath context for the result tree fragment
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void outputResultTreeFragment(XObject obj, XPathContext support)
-          throws org.xml.sax.SAXException
-  {
-
-    int doc = obj.rtf();
-    DTM dtm = support.getDTM(doc);
-
-    for (int n = dtm.getFirstChild(doc); DTM.NULL != n;
-            n = dtm.getNextSibling(n))
-    {
-      flushPending(true);  // I think.
-      dtm.dispatchToEvents(n, this);
-    }
-  }
-
-  /**
-   * To fullfill the FormatterListener interface... no action
-   * for the moment.
-   *
-   * @param locator Document locator
-   */
-  public void setDocumentLocator(Locator locator){}
-
-  /**
-   * This function checks to make sure a given prefix is really
-   * declared.  It might not be, because it may be an excluded prefix.
-   * If it's not, it still needs to be declared at this point.
-   * TODO: This needs to be done at an earlier stage in the game... -sb
-   *
-   * @param ns Namespace URI of the element
-   * @param rawName Raw name of element (with prefix)
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void ensurePrefixIsDeclared(String ns, String rawName)
-          throws org.xml.sax.SAXException
-  {
-
-    if (ns != null && ns.length() > 0)
-    {
-      int index;
-      String prefix = (index = rawName.indexOf(":")) < 0
-                      ? "" : rawName.substring(0, index);
-
-      if (null != prefix)
-      {
-        String foundURI = m_nsSupport.getURI(prefix);
-
-        if ((null == foundURI) ||!foundURI.equals(ns))
-        {
-          startPrefixMapping(prefix, ns, false);
-        }
-      }
-    }
-  }
-
-  /**
-   * This function checks to make sure a given prefix is really
-   * declared.  It might not be, because it may be an excluded prefix.
-   * If it's not, it still needs to be declared at this point.
-   * TODO: This needs to be done at an earlier stage in the game... -sb
-   *
-   * @param ns Namespace URI of the element
-   * @param rawName Raw name of element (with prefix)
-   *
-   * NEEDSDOC @param dtm
-   * NEEDSDOC @param namespace
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void ensureNamespaceDeclDeclared(DTM dtm, int namespace)
-          throws org.xml.sax.SAXException
-  {
-
-    String uri = dtm.getNodeValue(namespace);
-    String prefix = dtm.getNodeNameX(namespace);
-
-    if ((uri != null && uri.length() > 0) && (null != prefix))
-    {
-      String foundURI = m_nsSupport.getURI(prefix);
-
-      if ((null == foundURI) ||!foundURI.equals(uri))
-      {
-        startPrefixMapping(prefix, uri, false);
-      }
-    }
-  }
-
-  /**
-   * Add the attributes that have been declared to the attribute list.
-   * (Seems like I shouldn't have to do this...)
-   * Internally deprecated in favor of combined startAndAddPrefixMappings();
-   * 
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void sendStartPrefixMappings() throws org.xml.sax.SAXException
-  {
-    Enumeration prefixes = m_nsSupport.getDeclaredPrefixes();
-    ContentHandler handler = m_contentHandler;
-    while (prefixes.hasMoreElements())
-    {
-      String prefix = (String) prefixes.nextElement();
-      handler.startPrefixMapping(prefix, m_nsSupport.getURI(prefix));
-    }
-  }
-
-  /**
-   * JJK: Combination of sendStartPrefixMappings and
-   * addNSDeclsToAttrs() (which it mostly replaces).  Merging the two
-   * loops is significantly more efficient.
-   *
-   * @throws org.xml.sax.SAXException */
-  protected void startAndAddPrefixMappings() throws org.xml.sax.SAXException
-  {
-
-    Enumeration prefixes = m_nsSupport.getDeclaredPrefixes();
-    ContentHandler handler = m_contentHandler;
-
-    while (prefixes.hasMoreElements())
-    {
-      String prefix = (String) prefixes.nextElement();
-      String uri=m_nsSupport.getURI(prefix);
-      
-      // Send event
-      handler.startPrefixMapping(prefix, uri);
-
-      // Set attribute
-      boolean isDefault = (prefix.length() == 0);
-      String name;
-
-      if (isDefault)
-      {
-        //prefix = "xml";
-        name = "xmlns";
-      }
-      else
-        name = "xmlns:" + prefix;
-
-      if (null == uri)
-        uri = "";
-
-      m_attributes.addAttribute("http://www.w3.org/2000/xmlns/", 
-                                prefix, name, "CDATA", uri);
-    }
-    m_nsDeclsHaveBeenAdded=true;
-  }
-
-  /**
-   * Add the attributes that have been declared to the attribute list.
-   * (Seems like I shouldn't have to do this...)
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void sendEndPrefixMappings() throws org.xml.sax.SAXException
-  {
-
-    Enumeration prefixes = m_nsSupport.getDeclaredPrefixes();
-    ContentHandler handler = m_contentHandler;
-
-    while (prefixes.hasMoreElements())
-    {
-      String prefix = (String) prefixes.nextElement();
-
-      handler.endPrefixMapping(prefix);
-    }
-  }
-
-  /**
-   * Check to see if we should switch serializers based on the
-   * first output element being an HTML element.
-   *
-   * @param ns Namespace URI of the element
-   * @param localName Local part of name of the element
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  private void checkForSerializerSwitch(String ns, String localName)
-          throws org.xml.sax.SAXException
-  {
-
-    try
-    {
-      if (m_docPending)
-      {
-        SerializerSwitcher.switchSerializerIfHTML(m_transformer, ns,
-                                                  localName);
-      }
-    }
-    catch (TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-
-  /**
-   * Add the attributes that have been declared to the attribute list.
-   *
-   * %REVIEW% This should have been done automatically during
-   * flushPending(boolean); is it ever explicitly reinvoked?
-   */
-  public void addNSDeclsToAttrs()
-  {
-
-    Enumeration prefixes = m_nsSupport.getDeclaredPrefixes();
-
-    while (prefixes.hasMoreElements())
-    {
-      String prefix = (String) prefixes.nextElement();
-      boolean isDefault = (prefix.length() == 0);
-      String name;
-
-      if (isDefault)
-      {
-
-        //prefix = "xml";
-        name = "xmlns";
-      }
-      else
-        name = "xmlns:" + prefix;
-
-      String uri = m_nsSupport.getURI(prefix);
-
-      if (null == uri)
-        uri = "";
-
-      m_attributes.addAttribute("http://www.w3.org/2000/xmlns/", 
-                                prefix, name, "CDATA", uri);
-    }
-
-    m_nsDeclsHaveBeenAdded = true;
-  }
-
-  /**
-   * Copy <KBD>xmlns:</KBD> attributes in if not already in scope.
-   *
-   * @param src Source Node
-   * NEEDSDOC @param type
-   * NEEDSDOC @param dtm
-   *
-   * @throws TransformerException
-   */
-  public void processNSDecls(int src, int type, DTM dtm)
-          throws TransformerException
-  {
-
-    try
-    {
-      if (type == DTM.ELEMENT_NODE)
-      {
-        for (int namespace = dtm.getFirstNamespaceNode(src, true);
-                DTM.NULL != namespace;
-                namespace = dtm.getNextNamespaceNode(src, namespace, true))
-        {
-
-          // String prefix = dtm.getPrefix(namespace);
-          String prefix = dtm.getNodeNameX(namespace);
-          String desturi = getURI(prefix);
-          String srcURI = dtm.getNodeValue(namespace);
-
-          if (!srcURI.equalsIgnoreCase(desturi))
-          {
-            this.startPrefixMapping(prefix, srcURI, false);
-          }
-        }
-      }
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-  }
-
-  /**
-   * Given a prefix, return the namespace,
-   *
-   * @param prefix Given prefix name
-   *
-   * @return Namespace associated with the given prefix, or null
-   */
-  public String getURI(String prefix)
-  {
-    return m_nsSupport.getURI(prefix);
-  }
-
-  /**
-   * Given a namespace, try and find a prefix.
-   *
-   * @param namespace Given namespace URI
-   *
-   * @return Prefix name associated with namespace URI
-   */
-  public String getPrefix(String namespace)
-  {
-
-    // This Enumeration business may be too slow for our purposes...
-    Enumeration enum = m_nsSupport.getPrefixes();
-
-    while (enum.hasMoreElements())
-    {
-      String prefix = (String) enum.nextElement();
-
-      if (m_nsSupport.getURI(prefix).equals(namespace))
-        return prefix;
-    }
-
-    return null;
-  }
-
-  /**
-   * Get the NamespaceSupport object.
-   *
-   * @return NamespaceSupport object.
-   */
-  public NamespaceSupport getNamespaceSupport()
-  {
-    return m_nsSupport;
-  }
-
-  //  /**
-  //   * Override QueuedEvents#initQSE.
-  //   *
-  //   * @param qse Give queued Sax event
-  //   */
-  //  protected void initQSE(QueuedSAXEvent qse)
-  //  {
-  //
-  //    // qse.setContentHandler(m_contentHandler);
-  //    // qse.setTransformer(m_transformer);
-  //    // qse.setTraceManager(m_tracer);
-  //  }
-
-  /**
-   * Return the current content handler.
-   *
-   * @return The current content handler, or null if none
-   *         has been registered.
-   * @see #setContentHandler
-   */
-  public final ContentHandler getContentHandler()
-  {
-    return m_contentHandler;
-  }
-
-  /**
-   * Set the current content handler.
-   *
-   *
-   * @param ch Content Handler to be set
-   * @return The current content handler, or null if none
-   *         has been registered.
-   * @see #getContentHandler
-   */
-  public void setContentHandler(ContentHandler ch)
-  {
-
-    m_contentHandler = ch;
-
-    m_isTransformClient = (m_contentHandler instanceof TransformerClient);
-
-    if (m_contentHandler instanceof LexicalHandler)
-      m_lexicalHandler = (LexicalHandler) m_contentHandler;
-    else
-      m_lexicalHandler = null;
-
-    reInitEvents();
-  }
-
-  /**
-   * Get a unique namespace value.
-   *
-   * @return a unique namespace value to be used with a
-   * fabricated prefix
-   */
-  public int getUniqueNSValue()
-  {
-    return m_uniqueNSValue++;
-  }
-
-  /**
-   * Get new unique namespace prefix.
-   *
-   * @return Unique fabricated prefix.
-   */
-  public String getNewUniqueNSPrefix()
-  {
-    return S_NAMESPACEPREFIX + String.valueOf(getUniqueNSValue());
-  }
-
-  /**
-   * Get the pending attributes.  We have to delay the call to
-   * m_flistener.startElement(name, atts) because of the
-   * xsl:attribute and xsl:copy calls.  In other words,
-   * the attributes have to be fully collected before you
-   * can call startElement.
-   *
-   * @return the pending attributes.
-   */
-  public MutableAttrListImpl getPendingAttributes()
-  {
-    return m_attributes;
-  }
-
-  /**
-   * Add an attribute to the end of the list.
-   *
-   * <p>Do not pass in xmlns decls to this function!
-   *
-   * <p>For the sake of speed, this method does no checking
-   * to see if the attribute is already in the list: that is
-   * the responsibility of the application.</p>
-   *
-   * @param uri The Namespace URI, or the empty string if
-   *        none is available or Namespace processing is not
-   *        being performed.
-   * @param localName The local name, or the empty string if
-   *        Namespace processing is not being performed.
-   * @param rawName The raw XML 1.0 name, or the empty string
-   *        if raw names are not available.
-   * @param type The attribute type as a string.
-   * @param value The attribute value.
-   *
-   * @throws TransformerException
-   */
-  public void addAttribute(
-          String uri, String localName, String rawName, String type, String value)
-            throws TransformerException
-  {
-
-    // %REVIEW% %OPT% Is this ever needed?????
-    if (!m_nsDeclsHaveBeenAdded)
-      addNSDeclsToAttrs();
-
-    if (null == uri)  // defensive, should not really need this.
-      uri = "";
-
-    try
-    {
-      if (!rawName.equals("xmlns"))  // don't handle xmlns default namespace.
-        ensurePrefixIsDeclared(uri, rawName);
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-
-    if (DEBUG)
-      System.out.println("ResultTreeHandler#addAttribute Adding attr: "
-                         + localName + ", " + uri);
-
-    if (!isDefinedNSDecl(rawName, value))
-      m_attributes.addAttribute(uri, localName, rawName, type, value);
-  }
-
-  /**
-   * Return whether or not a namespace declaration is defined
-   *
-   *
-   * @param rawName Raw name of namespace element
-   * @param value URI of given namespace
-   *
-   * @return True if the namespace is already defined in list of
-   * namespaces
-   */
-  public boolean isDefinedNSDecl(String rawName, String value)
-  {
-
-    if (rawName.equals("xmlns") || rawName.startsWith("xmlns:"))
-    {
-      int index;
-      String prefix = (index = rawName.indexOf(":")) < 0
-                      ? "" : rawName.substring(0, index);
-      String definedURI = m_nsSupport.getURI(prefix);
-
-      if (null != definedURI)
-      {
-        if (definedURI.equals(value))
-        {
-          return true;
-        }
-        else
-          return false;
-      }
-      else
-        return false;
-    }
-    else
-      return false;
-  }
-
-  /**
-   * Returns whether a namespace is defined
-   *
-   *
-   * @param attr Namespace attribute node
-   *
-   * @return True if the namespace is already defined in
-   * list of namespaces
-   */
-  public boolean isDefinedNSDecl(int attr)
-  {
-
-    DTM dtm = m_transformer.getXPathContext().getDTM(attr);
-
-    if (DTM.NAMESPACE_NODE == dtm.getNodeType(attr))
-    {
-
-      // String prefix = dtm.getPrefix(attr);
-      String prefix = dtm.getNodeNameX(attr);
-      String uri = getURI(prefix);
-
-      if ((null != uri) && uri.equals(dtm.getStringValue(attr)))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Returns whether a namespace is defined
-   *
-   *
-   * @param attr Namespace attribute node
-   * @param dtm The DTM that owns attr.
-   *
-   * @return True if the namespace is already defined in
-   * list of namespaces
-   */
-  public boolean isDefinedNSDecl(int attr, DTM dtm)
-  {
-
-    if (DTM.NAMESPACE_NODE == dtm.getNodeType(attr))
-    {
-
-      // String prefix = dtm.getPrefix(attr);
-      String prefix = dtm.getNodeNameX(attr);
-      String uri = getURI(prefix);
-
-      if ((null != uri) && uri.equals(dtm.getStringValue(attr)))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Copy an DOM attribute to the created output element, executing
-   * attribute templates as need be, and processing the xsl:use
-   * attribute.
-   *
-   * @param attr Attribute node to add to result tree
-   *
-   * @throws TransformerException
-   */
-  public void addAttribute(int attr) throws TransformerException
-  {
-
-    DTM dtm = m_transformer.getXPathContext().getDTM(attr);
-
-    if (isDefinedNSDecl(attr, dtm))
-      return;
-
-    String ns = dtm.getNamespaceURI(attr);
-
-    if (ns == null)
-      ns = "";
-
-    // %OPT% ...can I just store the node handle?    
-    addAttribute(ns, dtm.getLocalName(attr), dtm.getNodeName(attr), "CDATA",
-                 dtm.getNodeValue(attr));
-  }  // end copyAttributeToTarget method
-
-  /**
-   * Copy DOM attributes to the result element.
-   *
-   * @param src Source node with the attributes
-   *
-   * @throws TransformerException
-   */
-  public void addAttributes(int src) throws TransformerException
-  {
-
-    DTM dtm = m_transformer.getXPathContext().getDTM(src);
-
-    for (int node = dtm.getFirstAttribute(src); DTM.NULL != node;
-            node = dtm.getNextAttribute(node))
-    {
-      addAttribute(node);
-    }
-  }
-
-  /**
-   * Tell if an element is pending, to be output to the result tree.
-   *
-   * @return True if an element is pending
-   */
-  public final boolean isElementPending()
-  {
-    
-    return m_elemIsPending;
-  }
-
-  /**
-   * Retrieves the stylesheet element that produced
-   * the SAX event.
-   *
-   * <p>Please note that the ElemTemplateElement returned may
-   * be in a default template, and thus may not be
-   * defined in the stylesheet.</p>
-   *
-   * @return the stylesheet element that produced the SAX event.
-   */
-  public ElemTemplateElement getCurrentElement()
-  {
-
-    if (m_elemIsPending)
-      return m_snapshot.m_currentElement;
-    else
-      return m_transformer.getCurrentElement();
-  }
-
-  /**
-   * This method retrieves the current context node
-   * in the source tree.
-   *
-   * @return the current context node in the source tree.
-   */
-  public org.w3c.dom.Node getCurrentNode()
-  {
-    
-    if (m_snapshot.m_currentNode != null)
-    {
-      return m_snapshot.m_currentNode;
-    }
-    else
-    {
-      DTM dtm = m_transformer.getXPathContext().getDTM(m_transformer.getCurrentNode());
-      return dtm.getNode(m_transformer.getCurrentNode());
-    }
-  }
-
-  /**
-   * This method retrieves the xsl:template
-   * that is in effect, which may be a matched template
-   * or a named template.
-   *
-   * <p>Please note that the ElemTemplate returned may
-   * be a default template, and thus may not have a template
-   * defined in the stylesheet.</p>
-   *
-   * @return the xsl:template that is in effect
-   */
-  public ElemTemplate getCurrentTemplate()
-  {
-
-    if (m_elemIsPending)
-      return m_snapshot.m_currentTemplate;
-    else
-      return m_transformer.getCurrentTemplate();
-  }
-
-  /**
-   * This method retrieves the xsl:template
-   * that was matched.  Note that this may not be
-   * the same thing as the current template (which
-   * may be from getCurrentElement()), since a named
-   * template may be in effect.
-   *
-   * <p>Please note that the ElemTemplate returned may
-   * be a default template, and thus may not have a template
-   * defined in the stylesheet.</p>
-   *
-   * @return the xsl:template that was matched.
-   */
-  public ElemTemplate getMatchedTemplate()
-  {
-
-    if (m_elemIsPending)
-      return m_snapshot.m_matchedTemplate;
-    else
-      return m_transformer.getMatchedTemplate();
-  }
-
-  /**
-   * Retrieves the node in the source tree that matched
-   * the template obtained via getMatchedTemplate().
-   *
-   * @return the node in the source tree that matched
-   * the template obtained via getMatchedTemplate().
-   */
-  public org.w3c.dom.Node getMatchedNode()
-  {
-
-    if (m_elemIsPending)
-    {
-      DTM dtm = m_transformer.getXPathContext().getDTM(m_snapshot.m_matchedNode);
-      return dtm.getNode(m_snapshot.m_matchedNode);
-    }
-    else
-    {
-      DTM dtm = m_transformer.getXPathContext().getDTM(m_transformer.getMatchedNode());
-      return dtm.getNode(m_transformer.getMatchedNode());
-    }
-  }
-
-  /**
-   * Get the current context node list.
-   *
-   * @return the current context node list.
-   */
-  public org.w3c.dom.traversal.NodeIterator getContextNodeList()
-  {
-
-    if (m_elemIsPending)
-    {
-      return new org.apache.xml.dtm.ref.DTMNodeIterator(m_snapshot.m_contextNodeList);
-    }
-    else
-      return new org.apache.xml.dtm.ref.DTMNodeIterator(m_transformer.getContextNodeList());
-  }
-
-  /**
-   * Get the TrAX Transformer object in effect.
-   *
-   * @return the TrAX Transformer object in effect.
-   */
-  public Transformer getTransformer()
-  {
-    return m_transformer;
-  }
-  
-  
-  // Implement ErrorHandler
-  
-  /**
-    * Receive notification of a warning.
-    *
-    * <p>SAX parsers will use this method to report conditions that
-    * are not errors or fatal errors as defined by the XML 1.0
-    * recommendation.  The default behaviour is to take no action.</p>
-    *
-    * <p>The SAX parser must continue to provide normal parsing events
-    * after invoking this method: it should still be possible for the
-    * application to process the document through to the end.</p>
-    *
-    * <p>Filters may use this method to report other, non-XML warnings
-    * as well.</p>
-    *
-    * @param exception The warning information encapsulated in a
-    *                  SAX parse exception.
-    * @exception org.xml.sax.SAXException Any SAX exception, possibly
-    *            wrapping another exception.
-    * @see org.xml.sax.SAXParseException 
-    */
-  public void warning (SAXParseException exception)
-    throws SAXException
-  {
-    if (m_contentHandler instanceof ErrorHandler)
-      ((ErrorHandler)m_contentHandler).warning(exception);
-  }
-    
-    
-   /**
-    * Receive notification of a recoverable error.
-    *
-    * <p>This corresponds to the definition of "error" in section 1.2
-    * of the W3C XML 1.0 Recommendation.  For example, a validating
-    * parser would use this callback to report the violation of a
-    * validity constraint.  The default behaviour is to take no
-    * action.</p>
-    *
-    * <p>The SAX parser must continue to provide normal parsing events
-    * after invoking this method: it should still be possible for the
-    * application to process the document through to the end.  If the
-    * application cannot do so, then the parser should report a fatal
-    * error even if the XML 1.0 recommendation does not require it to
-    * do so.</p>
-    *
-    * <p>Filters may use this method to report other, non-XML errors
-    * as well.</p>
-    *
-    * @param exception The error information encapsulated in a
-    *                  SAX parse exception.
-    * @exception org.xml.sax.SAXException Any SAX exception, possibly
-    *            wrapping another exception.
-    * @see org.xml.sax.SAXParseException 
-    */
-  public void error (SAXParseException exception)
-    throws SAXException
-  {
-    if (m_contentHandler instanceof ErrorHandler)
-      ((ErrorHandler)m_contentHandler).error(exception);
-  }
-    
-    
-   /**
-    * Receive notification of a non-recoverable error.
-    *
-    * <p>This corresponds to the definition of "fatal error" in
-    * section 1.2 of the W3C XML 1.0 Recommendation.  For example, a
-    * parser would use this callback to report the violation of a
-    * well-formedness constraint.</p>
-    *
-    * <p>The application must assume that the document is unusable
-    * after the parser has invoked this method, and should continue
-    * (if at all) only for the sake of collecting addition error
-    * messages: in fact, SAX parsers are free to stop reporting any
-    * other events once this method has been invoked.</p>
-    *
-    * @param exception The error information encapsulated in a
-    *                  SAX parse exception.  
-    * @exception org.xml.sax.SAXException Any SAX exception, possibly
-    *            wrapping another exception.
-    * @see org.xml.sax.SAXParseException
-    */
-  public void fatalError (SAXParseException exception)
-    throws SAXException
-  {      
-    m_elemIsPending = false;
-    m_docEnded = true;
-    m_docPending = false;
-    
-    if (m_contentHandler instanceof ErrorHandler)
-      ((ErrorHandler)m_contentHandler).fatalError(exception);
-  }
-  
-  boolean m_isTransformClient = false;
-
-  /**
-   * Use the SAX2 helper class to track result namespaces.
-   */
-  NamespaceSupport m_nsSupport = new NamespaceSupport2();
-
-  /**
-   * The transformer object.
-   */
-  private TransformerImpl m_transformer;
-
-  /**
-   * The content handler.  May be null, in which
-   * case, we'll defer to the content handler in the
-   * transformer.
-   */
-  private ContentHandler m_contentHandler;
-
-  /** The LexicalHandler */
-  private LexicalHandler m_lexicalHandler;
-
-  /**
-   * The root of a linked set of stylesheets.
-   */
-  private StylesheetRoot m_stylesheetRoot = null;
-
-  /**
-   * This is used whenever a unique namespace is needed.
-   */
-  private int m_uniqueNSValue = 0;
-
-  /** Prefix used to create unique prefix names */
-  private static final String S_NAMESPACEPREFIX = "ns";
-
-  /**
-   * This class clones nodes to the result tree.
-   */
-  public ClonerToResultTree m_cloner;
-
-  /**
-   * Trace manager for debug support.
-   */
-  private TraceManager m_tracer;
-  
-  private QueuedStateSnapshot m_snapshot = new QueuedStateSnapshot();
-
-  // These are passed to flushPending, to help it decide if it 
-  // should really flush.
-  
-  class QueuedStateSnapshot
-  {
-    /**
-     * The stylesheet element that produced the SAX event.
-     */
-    ElemTemplateElement m_currentElement;
-    
-    /**
-     * The current context node in the source tree.
-     */
-    org.w3c.dom.Node m_currentNode;
-    
-    /**
-     * The xsl:template that is in effect, which may be a matched template
-     * or a named template.
-     */
-    ElemTemplate m_currentTemplate;
-    
-    /**
-     * The xsl:template that was matched.
-     */
-    ElemTemplate m_matchedTemplate;
-    
-    /**
-     * The node in the source tree that matched
-     * the template obtained via getMatchedTemplate().
-     */
-    int m_matchedNode;
-    
-    /**
-     * The current context node list.
-     */
-    DTMIterator m_contextNodeList;
-  }
-}
diff --git a/src/org/apache/xalan/transformer/SerializerSwitcher.java b/src/org/apache/xalan/transformer/SerializerSwitcher.java
deleted file mode 100644
index 28430e5..0000000
--- a/src/org/apache/xalan/transformer/SerializerSwitcher.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.io.Writer;
-import java.io.OutputStream;
-
-import java.util.Properties;
-
-import org.apache.xalan.templates.StylesheetRoot;
-
-import org.xml.sax.ContentHandler;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.OutputKeys;
-
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.serialize.Method;
-import org.apache.xalan.templates.OutputProperties;
-
-/**
- * This is a helper class that decides if Xalan needs to switch
- * serializers, based on the first output element.
- */
-public class SerializerSwitcher
-{
-
-  /**
-   * Switch to HTML serializer if element is HTML
-   *
-   *
-   * @param transformer Non-null transformer instance
-   * @param ns Namespace URI of the element
-   * @param localName Local part of name of element
-   *
-   * @throws TransformerException
-   */
-  public static void switchSerializerIfHTML(
-          TransformerImpl transformer, String ns, String localName)
-            throws TransformerException
-  {
-
-    if (null == transformer)
-      return;
-
-    if (((null == ns) || (ns.length() == 0))
-            && localName.equalsIgnoreCase("html"))
-    {
-      // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+
-      //              transformer.getOutputPropertyNoDefault(OutputKeys.METHOD));     
-      // Access at level of hashtable to see if the method has been set.
-      if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD))
-        return;
-
-      // Getting the output properties this way won't cause a clone of 
-      // the properties.
-      Properties prevProperties = transformer.getOutputFormat().getProperties();
-      
-      // We have to make sure we get an output properties with the proper 
-      // defaults for the HTML method.  The easiest way to do this is to 
-      // have the OutputProperties class do it.
-      OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML);
-
-      htmlOutputProperties.copyFrom(prevProperties, true);
-      Properties htmlProperties = htmlOutputProperties.getProperties();
-
-      try
-      {
-        Serializer oldSerializer = transformer.getSerializer();
-
-        if (null != oldSerializer)
-        {
-          Serializer serializer =
-            SerializerFactory.getSerializer(htmlProperties);
-
-          Writer writer = oldSerializer.getWriter();
-
-          if (null != writer)
-            serializer.setWriter(writer);
-          else
-          {
-            OutputStream os = oldSerializer.getOutputStream();
-
-            if (null != os)
-              serializer.setOutputStream(os);
-          }
-
-          transformer.setSerializer(serializer);
-
-          ContentHandler ch = serializer.asContentHandler();
-
-          transformer.setContentHandler(ch);
-        }
-      }
-      catch (java.io.IOException e)
-      {
-        throw new TransformerException(e);
-      }
-    }
-  }
-  
-  /**
-   * Get the value of a property, without using the default properties.  This 
-   * can be used to test if a property has been explicitly set by the stylesheet 
-   * or user.
-   *
-   * @param name The property name, which is a fully-qualified URI.
-   *
-   * @return The value of the property, or null if not found.
-   *
-   * @throws IllegalArgumentException If the property is not supported, 
-   * and is not namespaced.
-   */
-  private static String getOutputPropertyNoDefault(String qnameString, Properties props)
-    throws IllegalArgumentException
-  {    
-    String value = (String)props.get(qnameString);
-    
-    return value;
-  }
-  
-  /**
-   * Switch to HTML serializer if element is HTML
-   *
-   *
-   * @param ns Namespace URI of the element
-   * @param localName Local part of name of element
-   *
-   * @throws TransformerException
-   * @return new contentHandler.
-   */
-  public static Serializer switchSerializerIfHTML(
-          String ns, String localName, Properties props, Serializer oldSerializer)
-            throws TransformerException
-  {
-    Serializer newSerializer = oldSerializer;
-
-    if (((null == ns) || (ns.length() == 0))
-            && localName.equalsIgnoreCase("html"))
-    {
-      // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+
-      //              transformer.getOutputPropertyNoDefault(OutputKeys.METHOD));     
-      // Access at level of hashtable to see if the method has been set.
-      if (null != getOutputPropertyNoDefault(OutputKeys.METHOD, props))
-        return newSerializer;
-
-      // Getting the output properties this way won't cause a clone of 
-      // the properties.
-      Properties prevProperties = props;
-      
-      // We have to make sure we get an output properties with the proper 
-      // defaults for the HTML method.  The easiest way to do this is to 
-      // have the OutputProperties class do it.
-      OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML);
-
-      htmlOutputProperties.copyFrom(prevProperties, true);
-      Properties htmlProperties = htmlOutputProperties.getProperties();
-
-//      try
-      {
-        if (null != oldSerializer)
-        {
-          Serializer serializer =
-            SerializerFactory.getSerializer(htmlProperties);
-
-          Writer writer = oldSerializer.getWriter();
-
-          if (null != writer)
-            serializer.setWriter(writer);
-          else
-          {
-            OutputStream os = serializer.getOutputStream();
-
-            if (null != os)
-              serializer.setOutputStream(os);
-          }
-          newSerializer = serializer;
-        }
-      }
-//      catch (java.io.IOException e)
-//      {
-//        throw new TransformerException(e);
-//      }
-    }
-    return newSerializer;
-  }
-  
-}
diff --git a/src/org/apache/xalan/transformer/StackGuard.java b/src/org/apache/xalan/transformer/StackGuard.java
deleted file mode 100644
index ae2799c..0000000
--- a/src/org/apache/xalan/transformer/StackGuard.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Text;
-//import org.w3c.dom.Element;
-import org.apache.xml.dtm.DTM;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xalan.templates.ElemTemplateElement;
-
-/**
- * Class to guard against recursion getting too deep.
- */
-public class StackGuard
-{
-
-  /**
-   * Used for infinite loop check. If the value is -1, do not
-   * check for infinite loops. Anyone who wants to enable that
-   * check should change the value of this variable to be the
-   * level of recursion that they want to check. Be careful setting
-   * this variable, if the number is too low, it may report an
-   * infinite loop situation, when there is none.
-   * Post version 1.0.0, we'll make this a runtime feature.
-   */
-  public static int m_recursionLimit = -1;
-
-  /**
-   * Get the recursion limit.
-   * Used for infinite loop check. If the value is -1, do not
-   * check for infinite loops. Anyone who wants to enable that
-   * check should change the value of this variable to be the
-   * level of recursion that they want to check. Be careful setting
-   * this variable, if the number is too low, it may report an
-   * infinite loop situation, when there is none.
-   * Post version 1.0.0, we'll make this a runtime feature.
-   *
-   * @return The recursion limit.
-   */
-  public int getRecursionLimit()
-  {
-    return m_recursionLimit;
-  }
-
-  /**
-   * Set the recursion limit.
-   * Used for infinite loop check. If the value is -1, do not
-   * check for infinite loops. Anyone who wants to enable that
-   * check should change the value of this variable to be the
-   * level of recursion that they want to check. Be careful setting
-   * this variable, if the number is too low, it may report an
-   * infinite loop situation, when there is none.
-   * Post version 1.0.0, we'll make this a runtime feature.
-   *
-   * @param limit The recursion limit.
-   */
-  public void setRecursionLimit(int limit)
-  {
-    m_recursionLimit = limit;
-  }
-
-  /** Stylesheet Template node          */
-  ElemTemplateElement m_xslRule;
-
-  /** Source node          */
-  int m_sourceXML;
-
-  /** Stack where ElemTempalteElements will be pushed          */
-  java.util.Stack stack = new java.util.Stack();
-
-  /**
-   * Constructor StackGuard
-   *
-   */
-  public StackGuard(){}
-
-  /**
-   * Constructor StackGuard
-   *
-   *
-   * @param xslTemplate Current template node
-   * @param sourceXML Source Node
-   */
-  public StackGuard(ElemTemplateElement xslTemplate, int sourceXML)
-  {
-    m_xslRule = xslTemplate;
-    m_sourceXML = sourceXML;
-  }
-
-  /**
-   * Overide equal method for StackGuard objects 
-   *
-   *
-   * @param obj StackGuard object to compare
-   *
-   * @return True if the given object matches this StackGuard object
-   */
-  public boolean equals(Object obj)
-  {
-
-    if (((StackGuard) obj).m_xslRule.equals(m_xslRule)
-            && ((StackGuard) obj).m_sourceXML == m_sourceXML)
-    {
-      return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Output diagnostics if in an infinite loop
-   *
-   *
-   * @param pw Non-null PrintWriter instance to use
-   */
-  public void print(PrintWriter pw)
-  {
-
-    // for the moment, these diagnostics are really bad...
-    // %DTBD% We need an execution context.
-//    if (m_sourceXML instanceof Text)
-//    {
-//      Text tx = (Text) m_sourceXML;
-//
-//      pw.println(tx.getData());
-//    }
-//    else if (m_sourceXML instanceof Element)
-//    {
-//      Element elem = (Element) m_sourceXML;
-//
-//      pw.println(elem.getNodeName());
-//    }
-  }
-
-  /**
-   * Check if we are in an infinite loop
-   *
-   *
-   * @param guard Current StackGuard object (matching current template)  
-   *
-   * @throws TransformerException
-   */
-  public void checkForInfinateLoop(StackGuard guard) throws TransformerException
-  {
-
-    int nRules = stack.size();
-    int loopCount = 0;
-
-    for (int i = (nRules - 1); i >= 0; i--)
-    {
-      if (stack.elementAt(i).equals(guard))
-      {
-        loopCount++;
-      }
-
-      if (loopCount >= m_recursionLimit)
-      {
-
-        // Print out really bad diagnostics.
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-
-        pw.println("Infinite loop diagnosed!  Stack trace:");
-
-        int k;
-
-        for (k = 0; k < nRules; k++)
-        {
-          pw.println("Source Elem #" + k + " ");
-
-          StackGuard guardOnStack = (StackGuard) stack.elementAt(i);
-
-          guardOnStack.print(pw);
-        }
-
-        pw.println("Source Elem #" + k + " ");
-        guard.print(pw);
-        pw.println("End of infinite loop diagnosis.");
-
-        throw new TransformerException(sw.getBuffer().toString());
-      }
-    }
-  }
-
-  /**
-   * Push in a StackGuard object mathing given template 
-   *
-   *
-   * @param xslTemplate Current template being processed
-   * @param sourceXML Current Source Node 
-   *
-   * @throws TransformerException
-   */
-  public void push(ElemTemplateElement xslTemplate, int sourceXML)
-          throws TransformerException
-  {
-
-    StackGuard guard = new StackGuard(xslTemplate, sourceXML);
-
-    checkForInfinateLoop(guard);
-    stack.push(guard);
-  }
-
-  /**
-   * Pop out Stack of StackGuard objects 
-   *
-   */
-  public void pop()
-  {
-    stack.pop();
-  }
-}
diff --git a/src/org/apache/xalan/transformer/TrAXFilter.java b/src/org/apache/xalan/transformer/TrAXFilter.java
deleted file mode 100644
index efdcfd7..0000000
--- a/src/org/apache/xalan/transformer/TrAXFilter.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package org.apache.xalan.transformer;
-
-import java.io.IOException;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.XMLFilterImpl;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.ErrorListener;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-public class TrAXFilter extends XMLFilterImpl
-{
-  private Templates m_templates;
-  private TransformerImpl m_transformer;
-    
-  /**
-   * Construct an empty XML filter, with no parent.
-   *
-   * <p>This filter will have no parent: you must assign a parent
-   * before you start a parse or do any configuration with
-   * setFeature or setProperty.</p>
-   *
-   * @see org.xml.sax.XMLReader#setFeature
-   * @see org.xml.sax.XMLReader#setProperty
-   */
-  public TrAXFilter (Templates templates)
-    throws TransformerConfigurationException
-  {
-    m_templates = templates;
-    m_transformer = (TransformerImpl)templates.newTransformer();
-  }
-  
-  /** Set the parent reader.
-   *
-   * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which 
-   * this filter will obtain its events and to which it will pass its 
-   * configuration requests.  The parent may itself be another filter.</p>
-   *
-   * <p>If there is no parent reader set, any attempt to parse
-   * or to set or get a feature or property will fail.</p>
-   *
-   * @param parent The parent XML reader.
-   * @throws java.lang.NullPointerException If the parent is null.
-   */
-  public void setParent (XMLReader parent)
-  { 
-    super.setParent(parent);
-    
-    if(null != parent.getContentHandler())
-      this.setContentHandler(parent.getContentHandler());
-
-    // Not really sure if we should do this here, but 
-    // it seems safer in case someone calls parse() on 
-    // the parent.
-    setupParse ();
-  }
-  
-  /**
-   * Parse a document.
-   *
-   * @param input The input source for the document entity.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @throws java.io.IOException An IO exception from the parser,
-   *            possibly from a byte stream or character stream
-   *            supplied by the application.
-   * @see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource)
-   */
-  public void parse (InputSource input)
-    throws org.xml.sax.SAXException, IOException
-  {
-    if(null == getParent())
-    {
-      XMLReader reader=null;
-
-      // Use JAXP1.1 ( if possible )
-      try {
-          javax.xml.parsers.SAXParserFactory factory=
-              javax.xml.parsers.SAXParserFactory.newInstance();
-          factory.setNamespaceAware( true );
-          javax.xml.parsers.SAXParser jaxpParser=
-              factory.newSAXParser();
-          reader=jaxpParser.getXMLReader();
-          
-      } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-          throw new org.xml.sax.SAXException( ex );
-      } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-          throw new org.xml.sax.SAXException( ex1.toString() );
-      } catch( NoSuchMethodError ex2 ) {
-      }
-      catch (AbstractMethodError ame){}
-
-      XMLReader parent;
-      if( reader==null )
-          parent= XMLReaderFactory.createXMLReader();
-      else
-          parent=reader;
-      try
-      {
-        parent.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                          true);
-        // Commented out as per discussion with Thomas2.Maesing@bgs-ag.de 
-        // about bug 2124.
-//        parent.setFeature("http://apache.org/xml/features/validation/dynamic",
-//                          true);
-      }
-      catch (org.xml.sax.SAXException se){}
-      // setParent calls setupParse...
-      setParent(parent);
-    }
-    else
-    {
-      // Make sure everything is set up.
-      setupParse ();
-    }
-    if(null == m_transformer.getContentHandler())
-    {
-      throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!");
-    }
-
-    getParent().parse(input);
-    Exception e = m_transformer.getExceptionThrown();
-    if(null != e)
-    {
-      if(e instanceof org.xml.sax.SAXException)
-        throw (org.xml.sax.SAXException)e;
-      else
-        throw new org.xml.sax.SAXException(e);
-    }
-  }
-  
-  /**
-   * Parse a document.
-   *
-   * @param systemId The system identifier as a fully-qualified URI.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @throws java.io.IOException An IO exception from the parser,
-   *            possibly from a byte stream or character stream
-   *            supplied by the application.
-   * @see org.xml.sax.XMLReader#parse(java.lang.String)
-   */
-  public void parse (String systemId)
-    throws org.xml.sax.SAXException, IOException
-  {
-    parse(new InputSource(systemId));
-  }
-
-
-  /**
-   * Set up before a parse.
-   *
-   * <p>Before every parse, check whether the parent is
-   * non-null, and re-register the filter for all of the 
-   * events.</p>
-   */
-  private void setupParse ()
-  {
-    XMLReader p = getParent();
-    if (p == null) {
-      throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_PARENT_FOR_FILTER, null)); //"No parent for filter");
-    }
-    
-    ContentHandler ch = m_transformer.getInputContentHandler();
-//    if(ch instanceof SourceTreeHandler)
-//      ((SourceTreeHandler)ch).setUseMultiThreading(true);
-    p.setContentHandler(ch);
-
-    if(ch instanceof EntityResolver)
-      p.setEntityResolver((EntityResolver)ch);
-    else
-      p.setEntityResolver(this);
-    
-    if(ch instanceof DTDHandler)
-      p.setDTDHandler((DTDHandler)ch);
-    else
-      p.setDTDHandler(this);
-    
-    ErrorListener elistener = m_transformer.getErrorListener();
-    if((null != elistener) && (elistener instanceof org.xml.sax.ErrorHandler))
-      p.setErrorHandler((org.xml.sax.ErrorHandler)elistener);
-    else
-      p.setErrorHandler(this);
-  }
-
-  /**
-   * Set the content event handler.
-   *
-   * @param resolver The new content handler.
-   * @throws java.lang.NullPointerException If the handler
-   *            is null.
-   * @see org.xml.sax.XMLReader#setContentHandler
-   */
-  public void setContentHandler (ContentHandler handler)
-  {
-    m_transformer.setContentHandler(handler);
-    // super.setContentHandler(m_transformer.getResultTreeHandler());
-  }
-  
-  public void setErrorListener (ErrorListener handler)
-  {
-    m_transformer.setErrorListener(handler);
-  }
-
-}
diff --git a/src/org/apache/xalan/transformer/TransformSnapshot.java b/src/org/apache/xalan/transformer/TransformSnapshot.java
deleted file mode 100644
index 7f5a1a4..0000000
--- a/src/org/apache/xalan/transformer/TransformSnapshot.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.apache.xalan.transformer;
-
-/**
- * This is an opaque interface that allows the transformer to return a 
- * "snapshot" of it's current state, which can later be restored.
- */
-public interface TransformSnapshot
-{
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xalan/transformer/TransformSnapshotImpl.java b/src/org/apache/xalan/transformer/TransformSnapshotImpl.java
deleted file mode 100644
index b1092e0..0000000
--- a/src/org/apache/xalan/transformer/TransformSnapshotImpl.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xml.utils.NodeVector;
-import org.apache.xml.utils.BoolStack;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xalan.templates.ElemTemplateElement;
-
-import java.util.Stack;
-
-import org.xml.sax.helpers.NamespaceSupport;
-import org.apache.xml.utils.NamespaceSupport2;
-
-import java.util.Enumeration;
-
-/**
- * This class holds a "snapshot" of it's current transformer state,
- * which can later be restored.
- *
- * This only saves state which can change over the course of the side-effect-free
- * (i.e. no extensions that call setURIResolver, etc.).
- */
-class TransformSnapshotImpl implements TransformSnapshot
-{
-
-  /**
-   * The stack of Variable stack frames.
-   */
-  private VariableStack m_variableStacks;
-
-  /**
-   * The stack of <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a> objects.
-   *  Not to be confused with the current node list.  
-   */
-  private int[] m_currentNodes;
-
-  /** A stack of the current sub-expression nodes. */
-  private int[] m_currentExpressionNodes;
-
-  /**
-   * The current context node lists stack.
-   */
-  private Stack m_contextNodeLists;
-
-  /**
-   * The current context node list.
-   */
-  private DTMIterator m_contextNodeList;
-
-  /**
-   * Stack of AxesIterators.
-   */
-  private Stack m_axesIteratorStack;
-
-  /**
-   * Is > 0 when we're processing a for-each.
-   */
-  private BoolStack m_currentTemplateRuleIsNull;
-
-  /**
-   * A node vector used as a stack to track the current
-   * ElemTemplateElement.  Needed for the
-   * org.apache.xalan.transformer.TransformState interface,
-   * so a tool can discover the calling template. 
-   */
-  private ElemTemplateElement[] m_currentTemplateElements;
-
-  /**
-   * A node vector used as a stack to track the current
-   * ElemTemplate that was matched, as well as the node that
-   * was matched.  Needed for the
-   * org.apache.xalan.transformer.TransformState interface,
-   * so a tool can discover the matched template, and matched
-   * node. 
-   */
-  private Stack m_currentMatchTemplates;
-
-  /**
-   * A node vector used as a stack to track the current
-   * ElemTemplate that was matched, as well as the node that
-   * was matched.  Needed for the
-   * org.apache.xalan.transformer.TransformState interface,
-   * so a tool can discover the matched template, and matched
-   * node. 
-   */
-  private NodeVector m_currentMatchNodes;
-
-  /**
-   * The table of counters for xsl:number support.
-   * @see ElemNumber
-   */
-  private CountersTable m_countersTable;
-
-  /**
-   * Stack for the purposes of flagging infinite recursion with
-   * attribute sets.
-   */
-  private Stack m_attrSetStack;
-
-  /** Indicate whether a namespace context was pushed */
-  boolean m_nsContextPushed;
-
-  /**
-   * Use the SAX2 helper class to track result namespaces.
-   */
-  private NamespaceSupport m_nsSupport;
-
-  /** The number of events queued */
-  int m_eventCount;
-
-  /**
-   * Constructor TransformSnapshotImpl
-   * Take a snapshot of the currently executing context.
-   *
-   * @param transformer Non null transformer instance
-   */
-  TransformSnapshotImpl(TransformerImpl transformer)
-  {
-
-    try
-    {
-
-      // Are all these clones deep enough?
-      ResultTreeHandler rtf = transformer.getResultTreeHandler();
-
-      m_eventCount = rtf.m_eventCount;
-
-      // yuck.  No clone. Hope this is good enough.
-      m_nsSupport = new NamespaceSupport2();
-
-      Enumeration prefixes = rtf.m_nsSupport.getPrefixes();
-
-      while (prefixes.hasMoreElements())
-      {
-        String prefix = (String) prefixes.nextElement();
-        String uri = rtf.m_nsSupport.getURI(prefix);
-
-        m_nsSupport.declarePrefix(prefix, uri);
-      }
-
-      m_nsContextPushed = rtf.m_nsContextPushed;
-
-      XPathContext xpc = transformer.getXPathContext();
-
-      m_variableStacks = (VariableStack) xpc.getVarStack().clone();
-      m_currentNodes = (int[]) xpc.getCurrentNodeStack().clone();
-      m_currentExpressionNodes =
-        (int[]) xpc.getCurrentExpressionNodeStack().clone();
-      m_contextNodeLists = (Stack) xpc.getContextNodeListsStack().clone();
-
-      if (!m_contextNodeLists.empty())
-        m_contextNodeList =
-          (DTMIterator) xpc.getContextNodeList().clone();
-
-      m_axesIteratorStack = (Stack) xpc.getAxesIteratorStackStacks().clone();
-      m_currentTemplateRuleIsNull =
-        (BoolStack) transformer.m_currentTemplateRuleIsNull.clone();
-      m_currentTemplateElements =
-        (ElemTemplateElement[]) transformer.m_currentTemplateElements.clone();
-      m_currentMatchTemplates =
-        (Stack) transformer.m_currentMatchTemplates.clone();
-      m_currentMatchNodes =
-        (NodeVector) transformer.m_currentMatchedNodes.clone();
-      m_countersTable =
-        (CountersTable) transformer.getCountersTable().clone();
-
-      if (transformer.m_attrSetStack != null)
-        m_attrSetStack = (Stack) transformer.m_attrSetStack.clone();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(cnse);
-    }
-  }
-
-  /**
-   * This will reset the stylesheet to a given execution context
-   * based on some previously taken snapshot where we can then start execution 
-   *
-   * @param transformer Non null transformer instance
-   */
-  void apply(TransformerImpl transformer)
-  {
-
-    try
-    {
-
-      // Are all these clones deep enough?
-      ResultTreeHandler rtf = transformer.getResultTreeHandler();
-
-      if (rtf != null)
-      {
-        rtf.m_eventCount = 1;  //1 for start document event! m_eventCount;
-
-        // yuck.  No clone. Hope this is good enough.
-        rtf.m_nsSupport = new NamespaceSupport();
-
-        Enumeration prefixes = m_nsSupport.getPrefixes();
-
-        while (prefixes.hasMoreElements())
-        {
-          String prefix = (String) prefixes.nextElement();
-          String uri = m_nsSupport.getURI(prefix);
-
-          rtf.m_nsSupport.declarePrefix(prefix, uri);
-        }
-
-        rtf.m_nsContextPushed = m_nsContextPushed;
-      }
-
-      XPathContext xpc = transformer.getXPathContext();
-
-      xpc.setVarStack((VariableStack) m_variableStacks.clone());
-      xpc.setCurrentNodeStack((int[]) m_currentNodes.clone());
-      xpc.setCurrentExpressionNodeStack(
-        (int[]) m_currentExpressionNodes.clone());
-      xpc.setContextNodeListsStack((Stack) m_contextNodeLists.clone());
-
-      if (m_contextNodeList != null)
-        xpc.pushContextNodeList((DTMIterator) m_contextNodeList.clone());
-
-      xpc.setAxesIteratorStackStacks((Stack) m_axesIteratorStack.clone());
-
-      transformer.m_currentTemplateRuleIsNull =
-        (BoolStack) m_currentTemplateRuleIsNull.clone();
-      transformer.m_currentTemplateElements =
-        (ElemTemplateElement[]) m_currentTemplateElements.clone();
-      transformer.m_currentMatchTemplates =
-        (Stack) m_currentMatchTemplates.clone();
-      transformer.m_currentMatchedNodes =
-        (NodeVector) m_currentMatchNodes.clone();
-      transformer.m_countersTable = (CountersTable) m_countersTable.clone();
-
-      if (m_attrSetStack != null)
-        transformer.m_attrSetStack = (Stack) m_attrSetStack.clone();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(cnse);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/transformer/TransformState.java b/src/org/apache/xalan/transformer/TransformState.java
deleted file mode 100644
index ed9a1fa..0000000
--- a/src/org/apache/xalan/transformer/TransformState.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTemplateElement;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeIterator;
-
-import javax.xml.transform.Transformer;
-
-/**
- * This interface is meant to be used by a consumer of
- * SAX2 events produced by Xalan, and enables the consumer
- * to get information about the state of the transform.  It
- * is primarily intended as a tooling interface.  A content
- * handler can get a reference to a TransformState by implementing
- * the TransformerClient interface.  Xalan will check for
- * that interface before it calls startDocument, and, if it
- * is implemented, pass in a TransformState reference to the
- * setTransformState method.
- *
- * <p>Note that the current stylesheet and root stylesheet can
- * be retrieved from the ElemTemplateElement obtained from
- * either getCurrentElement() or getCurrentTemplate().</p>
- */
-public interface TransformState
-{
-
-  /**
-   * Retrieves the stylesheet element that produced
-   * the SAX event.
-   *
-   * <p>Please note that the ElemTemplateElement returned may
-   * be in a default template, and thus may not be
-   * defined in the stylesheet.</p>
-   *
-   * @return the stylesheet element that produced the SAX event.
-   */
-  ElemTemplateElement getCurrentElement();
-
-  /**
-   * This method retrieves the current context node
-   * in the source tree.
-   *
-   * @return the current context node in the source tree.
-   */
-  Node getCurrentNode();
-
-  /**
-   * This method retrieves the xsl:template
-   * that is in effect, which may be a matched template
-   * or a named template.
-   *
-   * <p>Please note that the ElemTemplate returned may
-   * be a default template, and thus may not have a template
-   * defined in the stylesheet.</p>
-   *
-   * @return the xsl:template that is in effect
-   */
-  ElemTemplate getCurrentTemplate();
-
-  /**
-   * This method retrieves the xsl:template
-   * that was matched.  Note that this may not be
-   * the same thing as the current template (which
-   * may be from getCurrentElement()), since a named
-   * template may be in effect.
-   *
-   * <p>Please note that the ElemTemplate returned may
-   * be a default template, and thus may not have a template
-   * defined in the stylesheet.</p>
-   *
-   * @return the xsl:template that was matched.
-   */
-  ElemTemplate getMatchedTemplate();
-
-  /**
-   * Retrieves the node in the source tree that matched
-   * the template obtained via getMatchedTemplate().
-   *
-   * @return the node in the source tree that matched
-   * the template obtained via getMatchedTemplate().
-   */
-  Node getMatchedNode();
-
-  /**
-   * Get the current context node list.
-   *
-   * @return the current context node list.
-   */
-  NodeIterator getContextNodeList();
-
-  /**
-   * Get the TrAX Transformer object in effect.
-   *
-   * @return the TrAX Transformer object in effect.
-   */
-  Transformer getTransformer();
-}
diff --git a/src/org/apache/xalan/transformer/TransformerClient.java b/src/org/apache/xalan/transformer/TransformerClient.java
deleted file mode 100644
index 54654c8..0000000
--- a/src/org/apache/xalan/transformer/TransformerClient.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-/**
- * A content handler can get a reference
- * to a TransformState by implementing
- * the TransformerClient interface.  Xalan will check for
- * that interface before it calls startDocument, and, if it
- * is implemented, pass in a TransformState reference to the
- * setTransformState method.
- */
-public interface TransformerClient
-{
-
-  /**
-   * Pass in a reference to a TransformState object, which
-   * can be used during SAX ContentHandler events to obtain
-   * information about he state of the transformation. This
-   * method will be called  before each startDocument event.
-   *
-   * @param ts A reference to a TransformState object
-   */
-  void setTransformState(TransformState ts);
-}
diff --git a/src/org/apache/xalan/transformer/TransformerHandlerImpl.java b/src/org/apache/xalan/transformer/TransformerHandlerImpl.java
deleted file mode 100644
index 6ded15a..0000000
--- a/src/org/apache/xalan/transformer/TransformerHandlerImpl.java
+++ /dev/null
@@ -1,1105 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.io.IOException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xpath.objects.XString;
-
-// import org.xml.sax.ext.DeclHandler;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Result;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.ref.IncrementalSAXSource;
-import org.apache.xml.dtm.ref.IncrementalSAXSource_Filter;
-import org.apache.xml.dtm.ref.sax2dtm.SAX2DTM;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * A TransformerHandler
- * listens for SAX ContentHandler parse events and transforms
- * them to a Result.
- */
-public class TransformerHandlerImpl
-        implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler,
-                   LexicalHandler, TransformerHandler, DeclHandler
-{
-  
-  private boolean m_insideParse = false;
-
-  ////////////////////////////////////////////////////////////////////
-  // Constructors.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Construct a TransformerHandlerImpl.
-   *
-   * @param transformer Non-null reference to the Xalan transformer impl.
-   * @param doFragment True if the result should be a document fragement.
-   * @param baseSystemID  The system ID to use as the base for relative URLs.
-   */
-  public TransformerHandlerImpl(TransformerImpl transformer,
-                                boolean doFragment, String baseSystemID)
-  {
-
-    super();
-
-    m_transformer = transformer;
-    m_baseSystemID = baseSystemID;
-
-    XPathContext xctxt = transformer.getXPathContext();
-    DTM dtm = xctxt.getDTM(null, true, transformer, true, true);
-    
-    m_dtm = dtm;
-    dtm.setDocumentBaseURI(baseSystemID);
-
-    m_contentHandler = dtm.getContentHandler();
-    m_dtdHandler = dtm.getDTDHandler();
-    m_entityResolver = dtm.getEntityResolver();
-    m_errorHandler = dtm.getErrorHandler();
-    m_lexicalHandler = dtm.getLexicalHandler();
-  }
-  
-  /** 
-   * Do what needs to be done to shut down the CoRoutine management.
-   */
-  protected void clearCoRoutine()
-  {
-    clearCoRoutine(null);
-  }
-  
-  /** 
-   * Do what needs to be done to shut down the CoRoutine management.
-   */
-  protected void clearCoRoutine(SAXException ex)
-  {
-    if(null != ex)
-      m_transformer.setExceptionThrown(ex);
-    
-    if(m_dtm instanceof SAX2DTM)
-    {
-      if(DEBUG)
-        System.err.println("In clearCoRoutine...");
-      try
-      {
-        SAX2DTM sax2dtm = ((SAX2DTM)m_dtm);          
-        if(null != m_contentHandler 
-           && m_contentHandler instanceof IncrementalSAXSource_Filter)
-        {
-          IncrementalSAXSource_Filter sp =
-            (IncrementalSAXSource_Filter)m_contentHandler;
-          // This should now be all that's needed.
-          sp.deliverMoreNodes(false);
-        }
-        
-        sax2dtm.clearCoRoutine(true);
-        m_contentHandler = null;
-        m_dtdHandler = null;
-        m_entityResolver = null;
-        m_errorHandler = null;
-        m_lexicalHandler = null;
-      }
-      catch(Throwable throwable)
-      {
-        throwable.printStackTrace();
-      }
-      
-      if(DEBUG)
-        System.err.println("...exiting clearCoRoutine");
-    }
-  }
-  
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of javax.xml.transform.sax.TransformerHandler.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Enables the user of the TransformerHandler to set the
-   * to set the Result for the transformation.
-   *
-   * @param result A Result instance, should not be null.
-   *
-   * @throws IllegalArgumentException if result is invalid for some reason.
-   */
-  public void setResult(Result result) throws IllegalArgumentException
-  {
-
-    if (null == result)
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null");
-
-    try
-    {
-      ContentHandler handler =
-        m_transformer.createResultContentHandler(result);
-
-      m_transformer.setContentHandler(handler);
-    }
-    catch (javax.xml.transform.TransformerException te)
-    {
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set");
-    }
-
-    m_result = result;
-  }
-
-  /**
-   * Set the base ID (URI or system ID) from where relative
-   * URLs will be resolved.
-   * @param systemID Base URI for the source tree.
-   */
-  public void setSystemId(String systemID)
-  {
-    m_baseSystemID = systemID;
-    m_dtm.setDocumentBaseURI(systemID);
-  }
-
-  /**
-   * Get the base ID (URI or system ID) from where relative
-   * URLs will be resolved.
-   * @return The systemID that was set with {@link #setSystemId}.
-   */
-  public String getSystemId()
-  {
-    return m_baseSystemID;
-  }
-
-  /**
-   * Get the Transformer associated with this handler, which
-   * is needed in order to set parameters and output properties.
-   *
-   * @return The Transformer associated with this handler
-   */
-  public Transformer getTransformer()
-  {
-    return m_transformer;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of org.xml.sax.EntityResolver.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Filter an external entity resolution.
-   *
-   * @param publicId The entity's public identifier, or null.
-   * @param systemId The entity's system identifier.
-   * @return A new InputSource or null for the default.
-   *
-   * @throws IOException
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @throws java.io.IOException The client may throw an
-   *            I/O-related exception while obtaining the
-   *            new InputSource.
-   * @see org.xml.sax.EntityResolver#resolveEntity
-   */
-  public InputSource resolveEntity(String publicId, String systemId)
-          throws SAXException, IOException
-  {
-
-    if (m_entityResolver != null)
-    {
-      return m_entityResolver.resolveEntity(publicId, systemId);
-    }
-    else
-    {
-      return null;
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of org.xml.sax.DTDHandler.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Filter a notation declaration event.
-   *
-   * @param name The notation name.
-   * @param publicId The notation's public identifier, or null.
-   * @param systemId The notation's system identifier, or null.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.DTDHandler#notationDecl
-   */
-  public void notationDecl(String name, String publicId, String systemId)
-          throws SAXException
-  {
-
-    if (m_dtdHandler != null)
-    {
-      m_dtdHandler.notationDecl(name, publicId, systemId);
-    }
-  }
-
-  /**
-   * Filter an unparsed entity declaration event.
-   *
-   * @param name The entity name.
-   * @param publicId The entity's public identifier, or null.
-   * @param systemId The entity's system identifier, or null.
-   * @param notationName The name of the associated notation.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void unparsedEntityDecl(
-          String name, String publicId, String systemId, String notationName)
-            throws SAXException
-  {
-
-    if (m_dtdHandler != null)
-    {
-      m_dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName);
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of org.xml.sax.ContentHandler.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Filter a new document locator event.
-   *
-   * @param locator The document locator.
-   * @see org.xml.sax.ContentHandler#setDocumentLocator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#setDocumentLocator: "
-                         + locator.getSystemId());
-
-    this.m_locator = locator;
-    
-    if(null == m_baseSystemID)
-    {
-      setSystemId(locator.getSystemId());
-    }
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.setDocumentLocator(locator);
-    }
-  }
-
-  /**
-   * Filter a start document event.
-   *
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#startDocument
-   */
-  public void startDocument() throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#startDocument");
-      
-    m_insideParse = true;
-
-   // Thread listener = new Thread(m_transformer);
-
-    if (m_contentHandler != null)
-    {
-      //m_transformer.setTransformThread(listener);
-      if(DTMManager.getIncremental())
-      {
-        m_transformer.setSourceTreeDocForThread(m_dtm.getDocument());
-            
-        int cpriority = Thread.currentThread().getPriority();
-    
-        // runTransformThread is equivalent with the 2.0.1 code,
-        // except that the Thread may come from a pool.
-        m_transformer.runTransformThread( cpriority );
-      }
-
-      // This is now done _last_, because IncrementalSAXSource_Filter
-      // will immediately go into a "wait until events are requested"
-      // pause. I believe that will close our timing window.
-      // %REVIEW%
-      m_contentHandler.startDocument();
-   }
-        
-   //listener.setDaemon(false);
-   //listener.start();
-
-  }
-
-  /**
-   * Filter an end document event.
-   *
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#endDocument
-   */
-  public void endDocument() throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#endDocument");
-
-    m_insideParse = false;
-    
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.endDocument();
-    }
-    
-    if(DTMManager.getIncremental())
-    {
-      m_transformer.waitTransformThread();
-    }
-    else
-    {
-      m_transformer.setSourceTreeDocForThread(m_dtm.getDocument());
-      m_transformer.run();
-    }
-   /* Thread transformThread = m_transformer.getTransformThread();
-
-    if (null != transformThread)
-    {
-      try
-      {
-
-        // This should wait until the transformThread is considered not alive.
-        transformThread.join();
-
-        if (!m_transformer.hasTransformThreadErrorCatcher())
-        {
-          Exception e = m_transformer.getExceptionThrown();
-
-          if (null != e)
-            throw new org.xml.sax.SAXException(e);
-        }
-
-        m_transformer.setTransformThread(null);
-      }
-      catch (InterruptedException ie){}
-    }*/
-  }
-
-  /**
-   * Filter a start Namespace prefix mapping event.
-   *
-   * @param prefix The Namespace prefix.
-   * @param uri The Namespace URI.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#startPrefixMapping
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#startPrefixMapping: "
-                         + prefix + ", " + uri);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.startPrefixMapping(prefix, uri);
-    }
-  }
-
-  /**
-   * Filter an end Namespace prefix mapping event.
-   *
-   * @param prefix The Namespace prefix.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#endPrefixMapping
-   */
-  public void endPrefixMapping(String prefix) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#endPrefixMapping: "
-                         + prefix);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.endPrefixMapping(prefix);
-    }
-  }
-
-  /**
-   * Filter a start element event.
-   *
-   * @param uri The element's Namespace URI, or the empty string.
-   * @param localName The element's local name, or the empty string.
-   * @param qName The element's qualified (prefixed) name, or the empty
-   *        string.
-   * @param atts The element's attributes.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#startElement
-   */
-  public void startElement(
-          String uri, String localName, String qName, Attributes atts)
-            throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#startElement: " + qName);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.startElement(uri, localName, qName, atts);
-    }
-  }
-
-  /**
-   * Filter an end element event.
-   *
-   * @param uri The element's Namespace URI, or the empty string.
-   * @param localName The element's local name, or the empty string.
-   * @param qName The element's qualified (prefixed) name, or the empty
-   *        string.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#endElement
-   */
-  public void endElement(String uri, String localName, String qName)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#endElement: " + qName);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.endElement(uri, localName, qName);
-    }
-  }
-
-  /**
-   * Filter a character data event.
-   *
-   * @param ch An array of characters.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#characters
-   */
-  public void characters(char ch[], int start, int length) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#characters: " + start + ", "
-                         + length);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.characters(ch, start, length);
-    }
-  }
-
-  /**
-   * Filter an ignorable whitespace event.
-   *
-   * @param ch An array of characters.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#ignorableWhitespace
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#ignorableWhitespace: "
-                         + start + ", " + length);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.ignorableWhitespace(ch, start, length);
-    }
-  }
-
-  /**
-   * Filter a processing instruction event.
-   *
-   * @param target The processing instruction target.
-   * @param data The text following the target.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   */
-  public void processingInstruction(String target, String data)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#processingInstruction: "
-                         + target + ", " + data);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.processingInstruction(target, data);
-    }
-  }
-
-  /**
-   * Filter a skipped entity event.
-   *
-   * @param name The name of the skipped entity.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ContentHandler#skippedEntity
-   */
-  public void skippedEntity(String name) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#skippedEntity: " + name);
-
-    if (m_contentHandler != null)
-    {
-      m_contentHandler.skippedEntity(name);
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of org.xml.sax.ErrorHandler.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Filter a warning event.
-   *
-   * @param e The nwarning as an exception.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ErrorHandler#warning
-   */
-  public void warning(SAXParseException e) throws SAXException
-  {
-    // This is not great, but we really would rather have the error 
-    // handler be the error listener if it is a error handler.  Coroutine's fatalError 
-    // can't really be configured, so I think this is the best thing right now 
-    // for error reporting.  Possibly another JAXP 1.1 hole.  -sb
-    javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener();
-    if(errorListener instanceof ErrorHandler)
-    {
-      ((ErrorHandler)errorListener).warning(e);
-    }
-    else
-    {
-      try
-      {
-        errorListener.warning(new javax.xml.transform.TransformerException(e));
-      }
-      catch(javax.xml.transform.TransformerException te)
-      {
-        throw e;
-      }
-    }
-  }
-
-  /**
-   * Filter an error event.
-   *
-   * @param e The error as an exception.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ErrorHandler#error
-   */
-  public void error(SAXParseException e) throws SAXException
-  {
-    // %REVIEW% I don't think this should be called.  -sb
-    // clearCoRoutine(e);
-
-    // This is not great, but we really would rather have the error 
-    // handler be the error listener if it is a error handler.  Coroutine's fatalError 
-    // can't really be configured, so I think this is the best thing right now 
-    // for error reporting.  Possibly another JAXP 1.1 hole.  -sb
-    javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener();
-    if(errorListener instanceof ErrorHandler)
-    {
-      ((ErrorHandler)errorListener).error(e);
-      if(null != m_errorHandler)
-        m_errorHandler.error(e); // may not be called.
-    }
-    else
-    {
-      try
-      {
-        errorListener.error(new javax.xml.transform.TransformerException(e));
-        if(null != m_errorHandler)
-          m_errorHandler.error(e); // may not be called.
-      }
-      catch(javax.xml.transform.TransformerException te)
-      {
-        throw e;
-      }
-    }
-  }
-
-  /**
-   * Filter a fatal error event.
-   *
-   * @param e The error as an exception.
-   * @throws SAXException The client may throw
-   *            an exception during processing.
-   * @see org.xml.sax.ErrorHandler#fatalError
-   */
-  public void fatalError(SAXParseException e) throws SAXException
-  {
-    if(null != m_errorHandler)
-    {
-      try
-      {
-        m_errorHandler.fatalError(e);
-      }
-      catch(SAXParseException se)
-      {
-        // ignore
-      }
-      // clearCoRoutine(e);
-    }
-
-    // This is not great, but we really would rather have the error 
-    // handler be the error listener if it is a error handler.  Coroutine's fatalError 
-    // can't really be configured, so I think this is the best thing right now 
-    // for error reporting.  Possibly another JAXP 1.1 hole.  -sb
-    javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener();
-    
-    if(errorListener instanceof ErrorHandler)
-    {
-      ((ErrorHandler)errorListener).fatalError(e);
-      if(null != m_errorHandler)
-        m_errorHandler.fatalError(e); // may not be called.
-    }
-    else
-    {
-      try
-      {
-        errorListener.fatalError(new javax.xml.transform.TransformerException(e));
-        if(null != m_errorHandler)
-          m_errorHandler.fatalError(e); // may not be called.
-      }
-      catch(javax.xml.transform.TransformerException te)
-      {
-        throw e;
-      }
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of org.xml.sax.ext.LexicalHandler.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Report the start of DTD declarations, if any.
-   *
-   * <p>Any declarations are assumed to be in the internal subset
-   * unless otherwise indicated by a {@link #startEntity startEntity}
-   * event.</p>
-   *
-   * <p>Note that the start/endDTD events will appear within
-   * the start/endDocument events from ContentHandler and
-   * before the first startElement event.</p>
-   *
-   * @param name The document type name.
-   * @param publicId The declared public identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @param systemId The declared system identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @throws SAXException The application may raise an
-   *            exception.
-   * @see #endDTD
-   * @see #startEntity
-   */
-  public void startDTD(String name, String publicId, String systemId)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#startDTD: " + name + ", "
-                         + publicId + ", " + systemId);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startDTD(name, publicId, systemId);
-    }
-  }
-
-  /**
-   * Report the end of DTD declarations.
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #startDTD
-   */
-  public void endDTD() throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#endDTD");
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.endDTD();
-    }
-  }
-
-  /**
-   * Report the beginning of an entity in content.
-   *
-   * <p><strong>NOTE:</entity> entity references in attribute
-   * values -- and the start and end of the document entity --
-   * are never reported.</p>
-   *
-   * <p>The start and end of the external DTD subset are reported
-   * using the pseudo-name "[dtd]".  All other events must be
-   * properly nested within start/end entity events.</p>
-   *
-   * <p>Note that skipped entities will be reported through the
-   * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
-   * event, which is part of the ContentHandler interface.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @throws SAXException The application may raise an exception.
-   * @see #endEntity
-   * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
-   * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
-   */
-  public void startEntity(String name) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#startEntity: " + name);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startEntity(name);
-    }
-  }
-
-  /**
-   * Report the end of an entity.
-   *
-   * @param name The name of the entity that is ending.
-   * @throws SAXException The application may raise an exception.
-   * @see #startEntity
-   */
-  public void endEntity(String name) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#endEntity: " + name);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.endEntity(name);
-    }
-  }
-
-  /**
-   * Report the start of a CDATA section.
-   *
-   * <p>The contents of the CDATA section will be reported through
-   * the regular {@link org.xml.sax.ContentHandler#characters
-   * characters} event.</p>
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #endCDATA
-   */
-  public void startCDATA() throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#startCDATA");
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.startCDATA();
-    }
-  }
-
-  /**
-   * Report the end of a CDATA section.
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #startCDATA
-   */
-  public void endCDATA() throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#endCDATA");
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.endCDATA();
-    }
-  }
-
-  /**
-   * Report an XML comment anywhere in the document.
-   *
-   * <p>This callback will be used for comments inside or outside the
-   * document element, including comments in the external DTD
-   * subset (if read).</p>
-   *
-   * @param ch An array holding the characters in the comment.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void comment(char ch[], int start, int length) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#comment: " + start + ", "
-                         + length);
-
-    if (null != m_lexicalHandler)
-    {
-      m_lexicalHandler.comment(ch, start, length);
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of org.xml.sax.ext.DeclHandler.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Report an element type declaration.
-   *
-   * <p>The content model will consist of the string "EMPTY", the
-   * string "ANY", or a parenthesised group, optionally followed
-   * by an occurrence indicator.  The model will be normalized so
-   * that all whitespace is removed,and will include the enclosing
-   * parentheses.</p>
-   *
-   * @param name The element type name.
-   * @param model The content model as a normalized string.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void elementDecl(String name, String model) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", "
-                         + model);
-
-    if (null != m_declHandler)
-    {
-      m_declHandler.elementDecl(name, model);
-    }
-  }
-
-  /**
-   * Report an attribute type declaration.
-   *
-   * <p>Only the effective (first) declaration for an attribute will
-   * be reported.  The type will be one of the strings "CDATA",
-   * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
-   * "ENTITIES", or "NOTATION", or a parenthesized token group with
-   * the separator "|" and all whitespace removed.</p>
-   *
-   * @param eName The name of the associated element.
-   * @param aName The name of the attribute.
-   * @param type A string representing the attribute type.
-   * @param valueDefault A string representing the attribute default
-   *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
-   *        none of these applies.
-   * @param value A string representing the attribute's default value,
-   *        or null if there is none.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void attributeDecl(
-          String eName, String aName, String type, String valueDefault, String value)
-            throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#attributeDecl: " + eName
-                         + ", " + aName + ", etc...");
-
-    if (null != m_declHandler)
-    {
-      m_declHandler.attributeDecl(eName, aName, type, valueDefault, value);
-    }
-  }
-
-  /**
-   * Report an internal entity declaration.
-   *
-   * <p>Only the effective (first) declaration for each entity
-   * will be reported.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @param value The replacement text of the entity.
-   * @throws SAXException The application may raise an exception.
-   * @see #externalEntityDecl
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void internalEntityDecl(String name, String value)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#internalEntityDecl: " + name
-                         + ", " + value);
-
-    if (null != m_declHandler)
-    {
-      m_declHandler.internalEntityDecl(name, value);
-    }
-  }
-
-  /**
-   * Report a parsed external entity declaration.
-   *
-   * <p>Only the effective (first) declaration for each entity
-   * will be reported.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @param publicId The declared public identifier of the entity, or
-   *        null if none was declared.
-   * @param systemId The declared system identifier of the entity.
-   * @throws SAXException The application may raise an exception.
-   * @see #internalEntityDecl
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void externalEntityDecl(
-          String name, String publicId, String systemId) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("TransformerHandlerImpl#externalEntityDecl: " + name
-                         + ", " + publicId + ", " + systemId);
-
-    if (null != m_declHandler)
-    {
-      m_declHandler.externalEntityDecl(name, publicId, systemId);
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Internal state.
-  ////////////////////////////////////////////////////////////////////
-
-  /** Set to true for diagnostics output.         */
-  private static boolean DEBUG = false;
-
-  /**
-   * The transformer this will use to transform a
-   * source tree into a result tree.
-   */
-  private TransformerImpl m_transformer;
-
-  /** The system ID to use as a base for relative URLs. */
-  private String m_baseSystemID;
-
-  /** The result for the transformation. */
-  private Result m_result = null;
-
-  /** The locator for this TransformerHandler. */
-  private Locator m_locator = null;
-
-  /** The entity resolver to aggregate to. */
-  private EntityResolver m_entityResolver = null;
-
-  /** The DTD handler to aggregate to. */
-  private DTDHandler m_dtdHandler = null;
-
-  /** The content handler to aggregate to. */
-  private ContentHandler m_contentHandler = null;
-
-  /** The error handler to aggregate to. */
-  private ErrorHandler m_errorHandler = null;
-
-  /** The lexical handler to aggregate to. */
-  private LexicalHandler m_lexicalHandler = null;
-
-  /** The decl handler to aggregate to. */
-  private DeclHandler m_declHandler = null;
-  
-  /** The Document Table Instance we are transforming. */
-  DTM m_dtm;
-}
diff --git a/src/org/apache/xalan/transformer/TransformerIdentityImpl.java b/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
deleted file mode 100644
index ff18e0d..0000000
--- a/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
+++ /dev/null
@@ -1,1421 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import java.util.Properties;
-import java.util.Hashtable;
-
-import java.io.IOException;
-
-// TRaX Imports
-import javax.xml.transform.*;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.sax.*;
-import javax.xml.transform.stream.*;
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-import org.xml.sax.ext.*;
-
-import org.apache.xalan.serialize.*;
-import org.apache.xml.utils.DOMBuilder;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xalan.templates.OutputProperties;
-import org.apache.xalan.serialize.Method;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-import org.w3c.dom.*;
-
-/**
- * This class implements an identity transformer for
- * {@link javax.xml.transform.sax.SAXTransformerFactory#newTransformerHandler()
- * and {@link javax.xml.transform.TransformerFactory#newTransformer()}.  It
- * simply feeds SAX events directly to a serializer ContentHandler, if the
- * result is a stream.  If the result is a DOM, it will send the events to
- * {@link org.apache.xml.utils.DOMBuilder}.  If the result is another
- * content handler, it will simply pass the events on.
- */
-public class TransformerIdentityImpl extends Transformer
-        implements TransformerHandler, DeclHandler
-{
-
-  /**
-   * Constructor TransformerIdentityImpl creates an identity transform.
-   *
-   */
-  public TransformerIdentityImpl()
-  {
-    m_outputFormat = new OutputProperties(Method.XML);
-  }
-
-  /**
-   * Enables the user of the TransformerHandler to set the
-   * to set the Result for the transformation.
-   *
-   * @param result A Result instance, should not be null.
-   *
-   * @throws IllegalArgumentException if result is invalid for some reason.
-   */
-  public void setResult(Result result) throws IllegalArgumentException
-  {
-    if(null == result)
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null");        
-    m_result = result;
-  }
-
-  /**
-   * Set the base ID (URI or system ID) from where relative
-   * URLs will be resolved.
-   * @param systemID Base URI for the source tree.
-   */
-  public void setSystemId(String systemID)
-  {
-    m_systemID = systemID;
-  }
-
-  /**
-   * Get the base ID (URI or system ID) from where relative
-   * URLs will be resolved.
-   * @return The systemID that was set with {@link #setSystemId}.
-   */
-  public String getSystemId()
-  {
-    return m_systemID;
-  }
-
-  /**
-   * Get the Transformer associated with this handler, which
-   * is needed in order to set parameters and output properties.
-   *
-   * @return non-null reference to the transformer.
-   */
-  public Transformer getTransformer()
-  {
-    return this;
-  }
-
-  /**
-   * Create a result ContentHandler from a Result object, based
-   * on the current OutputProperties.
-   *
-   * @param outputTarget Where the transform result should go,
-   * should not be null.
-   *
-   * @return A valid ContentHandler that will create the
-   * result tree when it is fed SAX events.
-   *
-   * @throws TransformerException
-   */
-  private void createResultContentHandler(Result outputTarget)
-          throws TransformerException
-  {
-
-    if (outputTarget instanceof SAXResult)
-    {
-      SAXResult saxResult = (SAXResult) outputTarget;
-
-      m_resultContentHandler = saxResult.getHandler();
-      m_resultLexicalHandler = saxResult.getLexicalHandler();
-
-      if (m_resultContentHandler instanceof Serializer)
-      {
-
-        // Dubious but needed, I think.
-        m_serializer = (Serializer) m_resultContentHandler;
-      }
-    }
-    else if (outputTarget instanceof DOMResult)
-    {
-      DOMResult domResult = (DOMResult) outputTarget;
-      Node outputNode = domResult.getNode();
-      Document doc;
-      short type;
-
-      if (null != outputNode)
-      {
-        type = outputNode.getNodeType();
-        doc = (Node.DOCUMENT_NODE == type)
-              ? (Document) outputNode : outputNode.getOwnerDocument();
-      }
-      else
-      {
-        try
-        {
-          DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-
-          dbf.setNamespaceAware(true);
-
-          DocumentBuilder db = dbf.newDocumentBuilder();
-
-          doc = db.newDocument();
-        }
-        catch (ParserConfigurationException pce)
-        {
-          throw new TransformerException(pce);
-        }
-
-        outputNode = doc;
-        type = outputNode.getNodeType();
-
-        ((DOMResult) outputTarget).setNode(outputNode);
-      }
-
-      m_resultContentHandler =
-        (Node.DOCUMENT_FRAGMENT_NODE == type)
-        ? new DOMBuilder(doc, (DocumentFragment) outputNode)
-        : new DOMBuilder(doc, outputNode);
-      m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler;
-    }
-    else if (outputTarget instanceof StreamResult)
-    {
-      StreamResult sresult = (StreamResult) outputTarget;
-      String method = m_outputFormat.getProperty(OutputKeys.METHOD);
-
-      try
-      {
-        Serializer serializer =
-          SerializerFactory.getSerializer(m_outputFormat.getProperties());
-
-        m_serializer = serializer;
-
-        if (null != sresult.getWriter())
-          serializer.setWriter(sresult.getWriter());
-        else if (null != sresult.getOutputStream())
-          serializer.setOutputStream(sresult.getOutputStream());
-        else if (null != sresult.getSystemId())
-        {
-          String fileURL = sresult.getSystemId();
-
-          if (fileURL.startsWith("file:///"))
-          {
-            if (fileURL.substring(8).indexOf(":") >0)
-              fileURL = fileURL.substring(8);
-            else 
-              fileURL = fileURL.substring(7);
-          }
-
-          m_outputStream = new java.io.FileOutputStream(fileURL);
-          serializer.setOutputStream(m_outputStream);
-        }
-        else
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!");
-
-        m_resultContentHandler = serializer.asContentHandler();
-      }
-      catch (IOException ioe)
-      {
-        throw new TransformerException(ioe);
-      }
-    }
-    else
-    {
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type "
-                                    // + outputTarget.getClass().getName()
-                                    // + "!");
-    }
-
-    if (m_resultContentHandler instanceof DTDHandler)
-      m_resultDTDHandler = (DTDHandler) m_resultContentHandler;
-    
-    if (m_resultContentHandler instanceof DeclHandler)
-      m_resultDeclHandler = (DeclHandler) m_resultContentHandler;
-
-    if (m_resultContentHandler instanceof LexicalHandler)
-      m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler;
-  }
-
-  /**
-   * Process the source tree to the output result.
-   * @param source  The input for the source tree.
-   *
-   * @param outputTarget The output target.
-   *
-   * @throws TransformerException If an unrecoverable error occurs
-   * during the course of the transformation.
-   */
-  public void transform(Source source, Result outputTarget)
-          throws TransformerException
-  {
-
-    createResultContentHandler(outputTarget);
-
-    try
-    {
-      if (source instanceof DOMSource)
-      {
-        DOMSource dsource = (DOMSource) source;
-  
-        m_systemID = dsource.getSystemId();
-  
-        Node dNode = dsource.getNode();
-  
-        if (null != dNode)
-        {
-          try
-          {
-            if(dNode.getNodeType() != Node.DOCUMENT_NODE)
-              this.startDocument();
-            try
-            {
-              if(dNode.getNodeType() == Node.ATTRIBUTE_NODE)
-              {
-                String data = dNode.getNodeValue();
-                char[] chars = data.toCharArray();
-                characters(chars, 0, chars.length);
-              }
-              else
-              {
-                TreeWalker walker = new TreeWalker(this, new org.apache.xpath.DOM2Helper(), m_systemID);
-                walker.traverse(dNode);
-              }
-            }
-            finally
-            {
-              if(dNode.getNodeType() != Node.DOCUMENT_NODE)
-                this.endDocument();
-            }
-          }
-          catch (SAXException se)
-          {
-            throw new TransformerException(se);
-          }
-  
-          return;
-        }
-        else
-        {
-          String messageStr = XSLMessages.createMessage(
-            XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null);
-  
-          throw new IllegalArgumentException(messageStr);
-        }
-      }
-  
-      InputSource xmlSource = SAXSource.sourceToInputSource(source);
-  
-      if (null == xmlSource)
-      {
-        throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type "
-                                       //+ source.getClass().getName() + "!");
-      }
-  
-      if (null != xmlSource.getSystemId())
-        m_systemID = xmlSource.getSystemId();
-  
-      try
-      {
-        XMLReader reader = null;
-  
-        if (source instanceof SAXSource)
-          reader = ((SAXSource) source).getXMLReader();
-          
-        boolean isUserReader = (reader != null);
-  
-        if (null == reader)
-        {
-  
-          // Use JAXP1.1 ( if possible )      
-          try
-          {
-            javax.xml.parsers.SAXParserFactory factory =
-              javax.xml.parsers.SAXParserFactory.newInstance();
-  
-            factory.setNamespaceAware(true);
-  
-            javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser();
-  
-            reader = jaxpParser.getXMLReader();
-          }
-          catch (javax.xml.parsers.ParserConfigurationException ex)
-          {
-            throw new org.xml.sax.SAXException(ex);
-          }
-          catch (javax.xml.parsers.FactoryConfigurationError ex1)
-          {
-            throw new org.xml.sax.SAXException(ex1.toString());
-          }
-          catch (NoSuchMethodError ex2){}
-          catch (AbstractMethodError ame){}
-        }
-  
-        if (null == reader)
-        {
-          reader = XMLReaderFactory.createXMLReader();
-        }
-  
-        try
-        {
-          reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                            true);
-        // Commented out as per discussion with Thomas2.Maesing@bgs-ag.de 
-        // about bug 2124.
-//          if(!isUserReader)
-//            reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-//                              true);
-        }
-        catch (org.xml.sax.SAXException se)
-        {
-  
-          // We don't care.
-        }
-  
-        // Get the input content handler, which will handle the 
-        // parse events and create the source tree. 
-        ContentHandler inputHandler = this;
-  
-        reader.setContentHandler(inputHandler);
-  
-        if (inputHandler instanceof org.xml.sax.DTDHandler)
-          reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler);
-  
-        try
-        {
-          if (inputHandler instanceof org.xml.sax.ext.LexicalHandler)
-            reader.setProperty("http://xml.org/sax/properties/lexical-handler",
-                               inputHandler);
-  
-          if (inputHandler instanceof org.xml.sax.ext.DeclHandler)
-            reader.setProperty(
-              "http://xml.org/sax/properties/declaration-handler",
-              inputHandler);
-        }
-        catch (org.xml.sax.SAXException se){}
-  
-        try
-        {
-          if (inputHandler instanceof org.xml.sax.ext.LexicalHandler)
-            reader.setProperty("http://xml.org/sax/handlers/LexicalHandler",
-                               inputHandler);
-  
-          if (inputHandler instanceof org.xml.sax.ext.DeclHandler)
-            reader.setProperty("http://xml.org/sax/handlers/DeclHandler",
-                               inputHandler);
-        }
-        catch (org.xml.sax.SAXNotRecognizedException snre){}
-  
-        reader.parse(xmlSource);
-      }
-      catch (org.apache.xml.utils.WrappedRuntimeException wre)
-      {
-        Throwable throwable = wre.getException();
-  
-        while (throwable
-               instanceof org.apache.xml.utils.WrappedRuntimeException)
-        {
-          throwable =
-            ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException();
-        }
-  
-        throw new TransformerException(wre.getException());
-      }
-      catch (org.xml.sax.SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      catch (IOException ioe)
-      {
-        throw new TransformerException(ioe);
-      }
-    }
-    finally
-    {
-      if(null != m_outputStream)
-      {
-        try
-        {
-          m_outputStream.close();
-        }
-        catch(IOException ioe){}
-        m_outputStream = null;
-      }
-    }
-  }
-
-  /**
-   * Add a parameter for the transformation.
-   *
-   * <p>Pass a qualified name as a two-part string, the namespace URI
-   * enclosed in curly braces ({}), followed by the local name. If the
-   * name has a null URL, the String only contain the local name. An
-   * application can safely check for a non-null URI by testing to see if the first
-   * character of the name is a '{' character.</p>
-   * <p>For example, if a URI and local name were obtained from an element
-   * defined with &lt;xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
-   * then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that
-   * no prefix is used.</p>
-   *
-   * @param name The name of the parameter, which may begin with a namespace URI
-   * in curly braces ({}).
-   * @param value The value object.  This can be any valid Java object. It is
-   * up to the processor to provide the proper object coersion or to simply
-   * pass the object on for use in an extension.
-   */
-  public void setParameter(String name, Object value)
-  {
-
-    if (null == m_params)
-    {
-      m_params = new Hashtable();
-    }
-
-    m_params.put(name, value);
-  }
-
-  /**
-   * Get a parameter that was explicitly set with setParameter
-   * or setParameters.
-   *
-   * <p>This method does not return a default parameter value, which
-   * cannot be determined until the node context is evaluated during
-   * the transformation process.
-   *
-   *
-   * @param name Name of the parameter.
-   * @return A parameter that has been set with setParameter.
-   */
-  public Object getParameter(String name)
-  {
-
-    if (null == m_params)
-      return null;
-
-    return m_params.get(name);
-  }
-
-  /**
-   * Clear all parameters set with setParameter.
-   */
-  public void clearParameters()
-  {
-
-    if (null == m_params)
-      return;
-
-    m_params.clear();
-  }
-
-  /**
-   * Set an object that will be used to resolve URIs used in
-   * document().
-   *
-   * <p>If the resolver argument is null, the URIResolver value will
-   * be cleared, and the default behavior will be used.</p>
-   *
-   * @param resolver An object that implements the URIResolver interface,
-   * or null.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-    m_URIResolver = resolver;
-  }
-
-  /**
-   * Get an object that will be used to resolve URIs used in
-   * document(), etc.
-   *
-   * @return An object that implements the URIResolver interface,
-   * or null.
-   */
-  public URIResolver getURIResolver()
-  {
-    return m_URIResolver;
-  }
-
-  /**
-   * Set the output properties for the transformation.  These
-   * properties will override properties set in the Templates
-   * with xsl:output.
-   *
-   * <p>If argument to this function is null, any properties
-   * previously set are removed, and the value will revert to the value
-   * defined in the templates object.</p>
-   *
-   * <p>Pass a qualified property key name as a two-part string, the namespace URI
-   * enclosed in curly braces ({}), followed by the local name. If the
-   * name has a null URL, the String only contain the local name. An
-   * application can safely check for a non-null URI by testing to see if the first
-   * character of the name is a '{' character.</p>
-   * <p>For example, if a URI and local name were obtained from an element
-   * defined with &lt;xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
-   * then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that
-   * no prefix is used.</p>
-   *
-   * @param oformat A set of output properties that will be
-   * used to override any of the same properties in affect
-   * for the transformation.
-   *
-   * @see javax.xml.transform.OutputKeys
-   * @see java.util.Properties
-   *
-   * @throws IllegalArgumentException if any of the argument keys are not
-   * recognized and are not namespace qualified.
-   */
-  public void setOutputProperties(Properties oformat)
-          throws IllegalArgumentException
-  {
-
-    if (null != oformat)
-    {
-
-      // See if an *explicit* method was set.
-      String method = (String) oformat.get(OutputKeys.METHOD);
-
-      if (null != method)
-        m_outputFormat = new OutputProperties(method);
-      else
-        m_outputFormat = new OutputProperties();
-    }
-
-    if (null != oformat)
-    {
-      m_outputFormat.copyFrom(oformat);
-    }
-  }
-
-  /**
-   * Get a copy of the output properties for the transformation.
-   *
-   * <p>The properties returned should contain properties set by the user,
-   * and properties set by the stylesheet, and these properties
-   * are "defaulted" by default properties specified by <a href="http://www.w3.org/TR/xslt#output">section 16 of the
-   * XSL Transformations (XSLT) W3C Recommendation</a>.  The properties that
-   * were specifically set by the user or the stylesheet should be in the base
-   * Properties list, while the XSLT default properties that were not
-   * specifically set should be the default Properties list.  Thus,
-   * getOutputProperties().getProperty(String key) will obtain any
-   * property in that was set by {@link #setOutputProperty},
-   * {@link #setOutputProperties}, in the stylesheet, <em>or</em> the default
-   * properties, while
-   * getOutputProperties().get(String key) will only retrieve properties
-   * that were explicitly set by {@link #setOutputProperty},
-   * {@link #setOutputProperties}, or in the stylesheet.</p>
-   *
-   * <p>Note that mutation of the Properties object returned will not
-   * effect the properties that the transformation contains.</p>
-   *
-   * <p>If any of the argument keys are not recognized and are not
-   * namespace qualified, the property will be ignored.  In other words the
-   * behaviour is not orthogonal with setOutputProperties.</p>
-   *
-   * @return A copy of the set of output properties in effect
-   * for the next transformation.
-   *
-   * @see javax.xml.transform.OutputKeys
-   * @see java.util.Properties
-   */
-  public Properties getOutputProperties()
-  {
-    return (Properties) m_outputFormat.getProperties().clone();
-  }
-
-  /**
-   * Set an output property that will be in effect for the
-   * transformation.
-   *
-   * <p>Pass a qualified property name as a two-part string, the namespace URI
-   * enclosed in curly braces ({}), followed by the local name. If the
-   * name has a null URL, the String only contain the local name. An
-   * application can safely check for a non-null URI by testing to see if the first
-   * character of the name is a '{' character.</p>
-   * <p>For example, if a URI and local name were obtained from an element
-   * defined with &lt;xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
-   * then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that
-   * no prefix is used.</p>
-   *
-   * <p>The Properties object that was passed to {@link #setOutputProperties} won't
-   * be effected by calling this method.</p>
-   *
-   * @param name A non-null String that specifies an output
-   * property name, which may be namespace qualified.
-   * @param value The non-null string value of the output property.
-   *
-   * @throws IllegalArgumentException If the property is not supported, and is
-   * not qualified with a namespace.
-   *
-   * @see javax.xml.transform.OutputKeys
-   */
-  public void setOutputProperty(String name, String value)
-          throws IllegalArgumentException
-  {
-
-    if (!m_outputFormat.isLegalPropertyKey(name))
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: "
-                                         //+ name);
-
-    m_outputFormat.setProperty(name, value);
-  }
-
-  /**
-   * Get an output property that is in effect for the
-   * transformation.  The property specified may be a property
-   * that was set with setOutputProperty, or it may be a
-   * property specified in the stylesheet.
-   *
-   * @param name A non-null String that specifies an output
-   * property name, which may be namespace qualified.
-   *
-   * @return The string value of the output property, or null
-   * if no property was found.
-   *
-   * @throws IllegalArgumentException If the property is not supported.
-   *
-   * @see javax.xml.transform.OutputKeys
-   */
-  public String getOutputProperty(String name) throws IllegalArgumentException
-  {
-
-    String value = null;
-    OutputProperties props = m_outputFormat;
-
-    value = props.getProperty(name);
-
-    if (null == value)
-    {
-      if (!props.isLegalPropertyKey(name))
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: "
-                                          // + name);
-    }
-
-    return value;
-  }
-
-  /**
-   * Set the error event listener in effect for the transformation.
-   *
-   * @param listener The new error listener.
-   * @throws IllegalArgumentException if listener is null.
-   */
-  public void setErrorListener(ErrorListener listener)
-          throws IllegalArgumentException
-  {
-    m_errorListener = listener;
-  }
-
-  /**
-   * Get the error event handler in effect for the transformation.
-   *
-   * @return The current error handler, which should never be null.
-   */
-  public ErrorListener getErrorListener()
-  {
-    return m_errorListener;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Default implementation of DTDHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive notification of a notation declaration.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass if they wish to keep track of the notations
-   * declared in a document.</p>
-   *
-   * @param name The notation name.
-   * @param publicId The notation public identifier, or null if not
-   *                 available.
-   * @param systemId The notation system identifier.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.DTDHandler#notationDecl
-   *
-   * @throws SAXException
-   */
-  public void notationDecl(String name, String publicId, String systemId)
-          throws SAXException
-  {
-    if (null != m_resultDTDHandler)
-      m_resultDTDHandler.notationDecl(name, publicId, systemId);
-  }
-
-  /**
-   * Receive notification of an unparsed entity declaration.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to keep track of the unparsed entities
-   * declared in a document.</p>
-   *
-   * @param name The entity name.
-   * @param publicId The entity public identifier, or null if not
-   *                 available.
-   * @param systemId The entity system identifier.
-   * @param notationName The name of the associated notation.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   *
-   * @throws SAXException
-   */
-  public void unparsedEntityDecl(
-          String name, String publicId, String systemId, String notationName)
-            throws SAXException
-  {
-
-    if (null != m_resultDTDHandler)
-      m_resultDTDHandler.unparsedEntityDecl(name, publicId, systemId,
-                                            notationName);
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Default implementation of ContentHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive a Locator object for document events.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass if they wish to store the locator for use
-   * with other document events.</p>
-   *
-   * @param locator A locator for all SAX document events.
-   * @see org.xml.sax.ContentHandler#setDocumentLocator
-   * @see org.xml.sax.Locator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-    try
-    {
-      if (null == m_resultContentHandler)
-        createResultContentHandler(m_result);
-    }
-    catch (TransformerException te)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    }
-
-    m_resultContentHandler.setDocumentLocator(locator);
-  }
-
-  /**
-   * Receive notification of the beginning of the document.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the beginning
-   * of a document (such as allocating the root node of a tree or
-   * creating an output file).</p>
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startDocument
-   *
-   * @throws SAXException
-   */
-  public void startDocument() throws SAXException
-  {
-
-    try
-    {
-      if (null == m_resultContentHandler)
-        createResultContentHandler(m_result);
-    }
-    catch (TransformerException te)
-    {
-      throw new SAXException(te.getMessage(), te);
-    }
-
-    // Reset for multiple transforms with this transformer.
-    m_flushedStartDoc = false;
-    m_foundFirstElement = false;
-  }
-  
-  boolean m_flushedStartDoc = false;
-  
-  protected final void flushStartDoc()
-     throws SAXException
-  {
-    if(!m_flushedStartDoc)
-    {
-      m_resultContentHandler.startDocument();
-      m_flushedStartDoc = true;
-    }
-  }
-
-  /**
-   * Receive notification of the end of the document.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the end
-   * of a document (such as finalising a tree or closing an output
-   * file).</p>
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#endDocument
-   *
-   * @throws SAXException
-   */
-  public void endDocument() throws SAXException
-  {
-    flushStartDoc();
-    m_resultContentHandler.endDocument();
-  }
-
-  /**
-   * Receive notification of the start of a Namespace mapping.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the start of
-   * each Namespace prefix scope (such as storing the prefix mapping).</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI mapped to the prefix.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startPrefixMapping
-   *
-   * @throws SAXException
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws SAXException
-  {
-    flushStartDoc();
-    m_resultContentHandler.startPrefixMapping(prefix, uri);
-  }
-
-  /**
-   * Receive notification of the end of a Namespace mapping.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the end of
-   * each prefix mapping.</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#endPrefixMapping
-   *
-   * @throws SAXException
-   */
-  public void endPrefixMapping(String prefix) throws SAXException
-  {
-    flushStartDoc();
-    m_resultContentHandler.endPrefixMapping(prefix);
-  }
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the start of
-   * each element (such as allocating a new tree node or writing
-   * output to a file).</p>
-   *
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param qName The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   * @param attributes The specified or defaulted attributes.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startElement
-   *
-   * @throws SAXException
-   */
-  public void startElement(
-          String uri, String localName, String qName, Attributes attributes)
-            throws SAXException
-  {
-
-    if (!m_foundFirstElement && null != m_serializer)
-    {
-      m_foundFirstElement = true;
-
-      Serializer newSerializer;
-
-      try
-      {
-        newSerializer = SerializerSwitcher.switchSerializerIfHTML(uri,
-                localName, m_outputFormat.getProperties(), m_serializer);
-      }
-      catch (TransformerException te)
-      {
-        throw new SAXException(te);
-      }
-
-      if (newSerializer != m_serializer)
-      {
-        try
-        {
-          m_resultContentHandler = newSerializer.asContentHandler();
-        }
-        catch (IOException ioe)  // why?
-        {
-          throw new SAXException(ioe);
-        }
-
-        if (m_resultContentHandler instanceof DTDHandler)
-          m_resultDTDHandler = (DTDHandler) m_resultContentHandler;
-
-        if (m_resultContentHandler instanceof LexicalHandler)
-          m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler;
-
-        m_serializer = newSerializer;
-      }
-    }
-    flushStartDoc();
-    m_resultContentHandler.startElement(uri, localName, qName, attributes);
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the end of
-   * each element (such as finalising a tree node or writing
-   * output to a file).</p>
-   *
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param qName The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#endElement
-   *
-   * @throws SAXException
-   */
-  public void endElement(String uri, String localName, String qName)
-          throws SAXException
-  {
-    m_resultContentHandler.endElement(uri, localName, qName);
-  }
-
-  /**
-   * Receive notification of character data inside an element.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method to take specific actions for each chunk of character data
-   * (such as adding the data to a node or buffer, or printing it to
-   * a file).</p>
-   *
-   * @param ch The characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#characters
-   *
-   * @throws SAXException
-   */
-  public void characters(char ch[], int start, int length) throws SAXException
-  {
-    flushStartDoc();
-    m_resultContentHandler.characters(ch, start, length);
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method to take specific actions for each chunk of ignorable
-   * whitespace (such as adding data to a node or buffer, or printing
-   * it to a file).</p>
-   *
-   * @param ch The whitespace characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#ignorableWhitespace
-   *
-   * @throws SAXException
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws SAXException
-  {
-    m_resultContentHandler.ignorableWhitespace(ch, start, length);
-  }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions for each
-   * processing instruction, such as setting status variables or
-   * invoking other methods.</p>
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *             none is supplied.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   *
-   * @throws SAXException
-   */
-  public void processingInstruction(String target, String data)
-          throws SAXException
-  {
-    flushStartDoc();
-    m_resultContentHandler.processingInstruction(target, data);
-  }
-
-  /**
-   * Receive notification of a skipped entity.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions for each
-   * processing instruction, such as setting status variables or
-   * invoking other methods.</p>
-   *
-   * @param name The name of the skipped entity.
-   * @throws org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   *
-   * @throws SAXException
-   */
-  public void skippedEntity(String name) throws SAXException
-  {
-    flushStartDoc();
-    m_resultContentHandler.skippedEntity(name);
-  }
-
-  /**
-   * Report the start of DTD declarations, if any.
-   *
-   * <p>Any declarations are assumed to be in the internal subset
-   * unless otherwise indicated by a {@link #startEntity startEntity}
-   * event.</p>
-   *
-   * <p>Note that the start/endDTD events will appear within
-   * the start/endDocument events from ContentHandler and
-   * before the first startElement event.</p>
-   *
-   * @param name The document type name.
-   * @param publicId The declared public identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @param systemId The declared system identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @throws SAXException The application may raise an
-   *            exception.
-   * @see #endDTD
-   * @see #startEntity
-   */
-  public void startDTD(String name, String publicId, String systemId)
-          throws SAXException
-  {
-    flushStartDoc();
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.startDTD(name, publicId, systemId);
-  }
-
-  /**
-   * Report the end of DTD declarations.
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #startDTD
-   */
-  public void endDTD() throws SAXException
-  {
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.endDTD();
-  }
-
-  /**
-   * Report the beginning of an entity in content.
-   *
-   * <p><strong>NOTE:</entity> entity references in attribute
-   * values -- and the start and end of the document entity --
-   * are never reported.</p>
-   *
-   * <p>The start and end of the external DTD subset are reported
-   * using the pseudo-name "[dtd]".  All other events must be
-   * properly nested within start/end entity events.</p>
-   *
-   * <p>Note that skipped entities will be reported through the
-   * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
-   * event, which is part of the ContentHandler interface.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @throws SAXException The application may raise an exception.
-   * @see #endEntity
-   * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
-   * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
-   */
-  public void startEntity(String name) throws SAXException
-  {
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.startEntity(name);
-  }
-
-  /**
-   * Report the end of an entity.
-   *
-   * @param name The name of the entity that is ending.
-   * @throws SAXException The application may raise an exception.
-   * @see #startEntity
-   */
-  public void endEntity(String name) throws SAXException
-  {
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.endEntity(name);
-  }
-
-  /**
-   * Report the start of a CDATA section.
-   *
-   * <p>The contents of the CDATA section will be reported through
-   * the regular {@link org.xml.sax.ContentHandler#characters
-   * characters} event.</p>
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #endCDATA
-   */
-  public void startCDATA() throws SAXException
-  {
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.startCDATA();
-  }
-
-  /**
-   * Report the end of a CDATA section.
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #startCDATA
-   */
-  public void endCDATA() throws SAXException
-  {
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.endCDATA();
-  }
-
-  /**
-   * Report an XML comment anywhere in the document.
-   *
-   * <p>This callback will be used for comments inside or outside the
-   * document element, including comments in the external DTD
-   * subset (if read).</p>
-   *
-   * @param ch An array holding the characters in the comment.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void comment(char ch[], int start, int length) throws SAXException
-  {
-    flushStartDoc();
-    if (null != m_resultLexicalHandler)
-      m_resultLexicalHandler.comment(ch, start, length);
-  }
-  
-  // Implement DeclHandler
-  
-  /**
-     * Report an element type declaration.
-     *
-     * <p>The content model will consist of the string "EMPTY", the
-     * string "ANY", or a parenthesised group, optionally followed
-     * by an occurrence indicator.  The model will be normalized so
-     * that all whitespace is removed,and will include the enclosing
-     * parentheses.</p>
-     *
-     * @param name The element type name.
-     * @param model The content model as a normalized string.
-     * @exception SAXException The application may raise an exception.
-     */
-    public void elementDecl (String name, String model)
-        throws SAXException
-    {
-                        if (null != m_resultDeclHandler)
-                                m_resultDeclHandler.elementDecl(name, model);
-    }
-
-
-    /**
-     * Report an attribute type declaration.
-     *
-     * <p>Only the effective (first) declaration for an attribute will
-     * be reported.  The type will be one of the strings "CDATA",
-     * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
-     * "ENTITIES", or "NOTATION", or a parenthesized token group with 
-     * the separator "|" and all whitespace removed.</p>
-     *
-     * @param eName The name of the associated element.
-     * @param aName The name of the attribute.
-     * @param type A string representing the attribute type.
-     * @param valueDefault A string representing the attribute default
-     *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
-     *        none of these applies.
-     * @param value A string representing the attribute's default value,
-     *        or null if there is none.
-     * @exception SAXException The application may raise an exception.
-     */
-    public void attributeDecl (String eName,
-                                        String aName,
-                                        String type,
-                                        String valueDefault,
-                                        String value)
-        throws SAXException
-    {
-      if (null != m_resultDeclHandler)
-                                m_resultDeclHandler.attributeDecl(eName, aName, type, valueDefault, value);
-    }
-
-
-    /**
-     * Report an internal entity declaration.
-     *
-     * <p>Only the effective (first) declaration for each entity
-     * will be reported.</p>
-     *
-     * @param name The name of the entity.  If it is a parameter
-     *        entity, the name will begin with '%'.
-     * @param value The replacement text of the entity.
-     * @exception SAXException The application may raise an exception.
-     * @see #externalEntityDecl
-     * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-     */
-    public void internalEntityDecl (String name, String value)
-        throws SAXException
-    {
-      if (null != m_resultDeclHandler)
-                                m_resultDeclHandler.internalEntityDecl(name, value); 
-    }
-
-
-    /**
-     * Report a parsed external entity declaration.
-     *
-     * <p>Only the effective (first) declaration for each entity
-     * will be reported.</p>
-     *
-     * @param name The name of the entity.  If it is a parameter
-     *        entity, the name will begin with '%'.
-     * @param publicId The declared public identifier of the entity, or
-     *        null if none was declared.
-     * @param systemId The declared system identifier of the entity.
-     * @exception SAXException The application may raise an exception.
-     * @see #internalEntityDecl
-     * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-     */
-    public void externalEntityDecl (String name, String publicId,
-                                             String systemId)
-        throws SAXException
-    {
-      if (null != m_resultDeclHandler)
-                                m_resultDeclHandler.externalEntityDecl(name, publicId, systemId);
-    }
-  
-  /**
-   * This is null unless we own the stream.
-   */
-  private java.io.FileOutputStream m_outputStream = null;
-
-  /** The content handler where result events will be sent. */
-  private ContentHandler m_resultContentHandler;
-
-  /** The lexical handler where result events will be sent. */
-  private LexicalHandler m_resultLexicalHandler;
-
-  /** The DTD handler where result events will be sent. */
-  private DTDHandler m_resultDTDHandler;
-  
-  /** The Decl handler where result events will be sent. */
-  private DeclHandler m_resultDeclHandler;
-
-  /** The Serializer, which may or may not be null. */
-  private Serializer m_serializer;
-
-  /** The Result object. */
-  private Result m_result;
-
-  /**
-   * The system ID, which is unused, but must be returned to fullfill the
-   *  TransformerHandler interface.
-   */
-  private String m_systemID;
-
-  /**
-   * The parameters, which is unused, but must be returned to fullfill the
-   *  Transformer interface.
-   */
-  private Hashtable m_params;
-
-  /** The error listener for TrAX errors and warnings. */
-  private ErrorListener m_errorListener =
-    new org.apache.xml.utils.DefaultErrorHandler();
-
-  /**
-   * The URIResolver, which is unused, but must be returned to fullfill the
-   *  TransformerHandler interface.
-   */
-  URIResolver m_URIResolver;
-
-  /** The output properties. */
-  private OutputProperties m_outputFormat;
-
-  /** Flag to set if we've found the first element, so we can tell if we have 
-   *  to check to see if we should create an HTML serializer.      */
-  boolean m_foundFirstElement;
-}
diff --git a/src/org/apache/xalan/transformer/TransformerImpl.java b/src/org/apache/xalan/transformer/TransformerImpl.java
deleted file mode 100644
index 07fb856..0000000
--- a/src/org/apache/xalan/transformer/TransformerImpl.java
+++ /dev/null
@@ -1,3261 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-// Java imports
-import java.util.Stack;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import java.io.StringWriter;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-// Xalan imports
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.ElemAttributeSet;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.StylesheetComposed;
-import org.apache.xalan.templates.ElemForEach;
-import org.apache.xalan.templates.ElemApplyTemplates;
-import org.apache.xalan.templates.ElemUse;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.templates.ElemWithParam;
-import org.apache.xalan.templates.ElemSort;
-import org.apache.xalan.templates.AVT;
-import org.apache.xalan.templates.ElemVariable;
-import org.apache.xalan.templates.ElemParam;
-import org.apache.xalan.templates.ElemCallTemplate;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTextLiteral;
-import org.apache.xalan.templates.TemplateList;
-import org.apache.xalan.templates.XUnresolvedVariable;
-import org.apache.xalan.templates.OutputProperties;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.transformer.XalanProperties;
-import org.apache.xml.utils.DOMBuilder;
-import org.apache.xml.utils.NodeVector;
-import org.apache.xml.utils.BoolStack;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.ObjectPool;
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xpath.Arg;
-import org.apache.xpath.XPathAPI;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.SourceTreeManager;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.Expression;
-
-// Serializer Imports
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-import org.apache.xalan.serialize.Method;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.DTMWSFilter;
-
-// We have to figure out what to do about this one.
-import org.apache.xml.dtm.ref.ExpandedNameTable;
-
-// SAX2 Imports
-import org.xml.sax.ContentHandler;
-import org.xml.sax.helpers.XMLFilterImpl;
-import org.xml.sax.InputSource;
-
-import javax.xml.transform.TransformerException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-import javax.xml.transform.ErrorListener;
-
-// TRaX Imports
-import javax.xml.transform.Source;
-import javax.xml.transform.Result;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.OutputKeys;
-
-// Imported JAVA API for XML Parsing 1.0 classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements the
- * {@link javax.xml.transform.Transformer} interface, and is the core
- * representation of the transformation execution.</p>
- */
-public class TransformerImpl extends Transformer
-        implements Runnable, DTMWSFilter
-{
-
-  // Synch object to gaurd against setting values from the TrAX interface 
-  // or reentry while the transform is going on.
-
-  /** NEEDSDOC Field m_reentryGuard          */
-  private Boolean m_reentryGuard = new Boolean(true);
-
-  /**
-   * This is null unless we own the stream.
-   */
-  private java.io.FileOutputStream m_outputStream = null;
-
-  /**
-   * True if the parser events should be on the main thread,
-   * false if not.  Experemental.  Can not be set right now.
-   */
-  private boolean m_parserEventsOnMain = true;
-
-  /** The thread that the transformer is running on. */
-  private Thread m_transformThread;
-
-  /** The base URL of the source tree. */
-  private String m_urlOfSource = null;
-
-  /** The Result object at the start of the transform, if any. */
-  private Result m_outputTarget = null;
-
-  /**
-   * The output format object set by the user.  May be null.
-   */
-  private OutputProperties m_outputFormat;
-
-  /** The output serializer */
-  private Serializer m_serializer;
-
-  /**
-   * The content handler for the source input tree.
-   */
-  ContentHandler m_inputContentHandler;
-
-  /**
-   * The content handler for the result tree.
-   */
-  private ContentHandler m_outputContentHandler = null;
-
-  //  /*
-  //   * Use member variable to store param variables as they're
-  //   * being created, use member variable so we don't
-  //   * have to create a new vector every time.
-  //   */
-  //  private Vector m_newVars = new Vector();
-
-  /** The JAXP Document Builder, mainly to create Result Tree Fragments. */
-  DocumentBuilder m_docBuilder = null;
-
-  /**
-   * A pool of ResultTreeHandlers, for serialization of a subtree to text.
-   *  Please note that each of these also holds onto a Text Serializer.  
-   */
-  private ObjectPool m_textResultHandlerObjectPool =
-    new ObjectPool("org.apache.xalan.transformer.ResultTreeHandler");
-
-  /**
-   * Related to m_textResultHandlerObjectPool, this is a pool of
-   * StringWriters, which are passed to the Text Serializers.
-   * (I'm not sure if this is really needed any more.  -sb)      
-   */
-  private ObjectPool m_stringWriterObjectPool =
-    new ObjectPool("java.io.StringWriter");
-
-  /**
-   * A static text format object, which can be used over and
-   * over to create the text serializers.    
-   */
-  private OutputProperties m_textformat = new OutputProperties(Method.Text);
-
-  // Commenteded out in response to problem reported by 
-  // Nicola Brown <Nicola.Brown@jacobsrimell.com>
-  //  /**
-  //   * Flag to let us know if an exception should be reported inside the 
-  //   * postExceptionFromThread method.  This is needed if the transform is 
-  //   * being generated from SAX events, and thus there is no central place 
-  //   * to report the exception from.  (An exception is usually picked up in 
-  //   * the main thread from the transform thread in {@link #transform(Source source)} 
-  //   * from {@link #getExceptionThrown()}. )
-  //   */
-  //  private boolean m_reportInPostExceptionFromThread = false;
-
-  /**
-   * A node vector used as a stack to track the current
-   * ElemTemplateElement.  Needed for the
-   * org.apache.xalan.transformer.TransformState interface,
-   * so a tool can discover the calling template. Note the use of an array 
-   * for this limits the recursion depth to 4K.
-   */
-  ElemTemplateElement[] m_currentTemplateElements 
-      = new ElemTemplateElement[XPathContext.RECURSIONLIMIT];
-  
-  /** The top of the currentTemplateElements stack. */
-  int m_currentTemplateElementsTop = 0;
-
-  /**
-   * A node vector used as a stack to track the current
-   * ElemTemplate that was matched.
-   * Needed for the
-   * org.apache.xalan.transformer.TransformState interface,
-   * so a tool can discover the matched template
-   */
-  Stack m_currentMatchTemplates = new Stack();
-
-  /**
-   * A node vector used as a stack to track the current
-   * node that was matched.
-   * Needed for the
-   * org.apache.xalan.transformer.TransformState interface,
-   * so a tool can discover the matched
-   * node. 
-   */
-  NodeVector m_currentMatchedNodes = new NodeVector();
-
-  /**
-   * The root of a linked set of stylesheets.
-   */
-  private StylesheetRoot m_stylesheetRoot = null;
-
-  /**
-   * If this is set to true, do not warn about pattern
-   * match conflicts.
-   */
-  private boolean m_quietConflictWarnings = true;
-
-  /**
-   * The liason to the XML parser, so the XSL processor
-   * can handle included files, and the like, and do the
-   * initial parse of the XSL document.
-   */
-  private XPathContext m_xcontext;
-
-  /**
-   * Object to guard agains infinite recursion when
-   * doing queries.
-   */
-  private StackGuard m_stackGuard = new StackGuard();
-
-  /**
-   * Output handler to bottleneck SAX events.
-   */
-  private ResultTreeHandler m_resultTreeHandler;
-
-  /** The key manager, which manages xsl:keys. */
-  private KeyManager m_keyManager = new KeyManager();
-
-  /**
-   * Stack for the purposes of flagging infinite recursion with
-   * attribute sets.
-   */
-  Stack m_attrSetStack = null;
-
-  /**
-   * The table of counters for xsl:number support.
-   * @see ElemNumber
-   */
-  CountersTable m_countersTable = null;
-
-  /**
-   * Is > 0 when we're processing a for-each.
-   */
-  BoolStack m_currentTemplateRuleIsNull = new BoolStack();
-
-  /**
-   * The message manager, which manages error messages, warning
-   * messages, and other types of message events.   
-   */
-  private MsgMgr m_msgMgr;
-
-  /**
-   * This is a compile-time flag to turn off calling
-   * of trace listeners. Set this to false for optimization purposes.
-   */
-  public static boolean S_DEBUG = false;
-
-  /**
-   * This property specifies whether the transformation phase should
-   * keep track of line and column numbers for the input source
-   * document. By default is false. */
-  protected boolean m_useSourceLocationProperty = false;
-  
-  /**
-   * The SAX error handler, where errors and warnings are sent.
-   */
-  private ErrorListener m_errorHandler =
-    new org.apache.xml.utils.DefaultErrorHandler();
-
-  /**
-   * The trace manager.
-   */
-  private TraceManager m_traceManager = new TraceManager(this);
-
-  /**
-   * If the transform thread throws an exception, the exception needs to
-   * be stashed away so that the main thread can pass it on to the
-   * client. 
-   */
-  private Exception m_exceptionThrown = null;
-
-  /**
-   * The InputSource for the source tree, which is needed if the
-   * parse thread is not the main thread, in order for the parse
-   * thread's run method to get to the input source.
-   * (Delete this if reversing threads is outlawed. -sb)    
-   */
-  private Source m_xmlSource;
-
-  /**
-   * This is needed for support of setSourceTreeDocForThread(Node doc),
-   * which must be called in order for the transform thread's run
-   * method to obtain the root of the source tree to be transformed.     
-   */
-  private int m_doc;
-
-  /**
-   * If the the transform is on the secondary thread, we
-   * need to know when it is done, so we can return.
-   */
-  private boolean m_isTransformDone = false;
-
-  /** Flag to to tell if the tranformer needs to be reset. */
-  private boolean m_hasBeenReset = false;
-
-  /** NEEDSDOC Field m_shouldReset          */
-  private boolean m_shouldReset = true;
-
-  /**
-   * NEEDSDOC Method setShouldReset 
-   *
-   *
-   * NEEDSDOC @param shouldReset
-   */
-  public void setShouldReset(boolean shouldReset)
-  {
-    m_shouldReset = shouldReset;
-  }
-
-  /**
-   * A stack of current template modes.
-   */
-  private Stack m_modes = new Stack();
-
-  //==========================================================
-  // SECTION: Constructors
-  //==========================================================
-
-  /**
-   * Construct a TransformerImpl.
-   *
-   * @param stylesheet The root of the stylesheet tree.
-   */
-  public TransformerImpl(StylesheetRoot stylesheet)
-  {
-
-    setStylesheet(stylesheet);
-    setXPathContext(new XPathContext(this));
-    getXPathContext().setNamespaceContext(stylesheet);
-  }
-
-  /**
-   * Reset the state.  This needs to be called after a process() call
-   * is invoked, if the processor is to be used again.
-   */
-  public void reset()
-  {
-
-    if (!m_hasBeenReset && m_shouldReset)
-    {
-      m_hasBeenReset = true;
-
-      if (this.m_outputStream != null)
-      {
-        try
-        {
-          m_outputStream.close();
-        }
-        catch (java.io.IOException ioe){}
-      }
-
-      m_outputStream = null;
-
-      // I need to look more carefully at which of these really
-      // needs to be reset.
-      m_countersTable = null;
-      m_stackGuard = new StackGuard();
-
-      m_xcontext.reset();
-      m_xcontext.getVarStack().reset();
-
-      int n = m_currentTemplateElements.length;
-      for (int i = 0; i < n; i++) 
-      {
-        m_currentTemplateElements[i] = null;
-      }
-      m_currentTemplateElementsTop = 0;
-      
-      m_currentMatchTemplates.removeAllElements();
-      m_currentMatchedNodes.removeAllElements();
-
-      m_resultTreeHandler = null;
-      m_outputTarget = null;
-      m_keyManager = new KeyManager();
-      m_attrSetStack = null;
-      m_countersTable = null;
-      m_currentTemplateRuleIsNull = new BoolStack();
-      m_xmlSource = null;
-      m_doc = DTM.NULL;
-      m_isTransformDone = false;
-      m_transformThread = null;
-
-      // m_inputContentHandler = null;
-      // For now, reset the document cache each time.
-      m_xcontext.getSourceTreeManager().reset();
-    }
-
-    //    m_reportInPostExceptionFromThread = false;
-  }
-
-  /**
-   * <code>getProperty</code> returns the current setting of the
-   * property described by the <code>property</code> argument.
-   *
-   * @param property a <code>String</code> value
-   * @return a <code>boolean</code> value
-   */
-  public boolean getProperty(String property)
-  {
-    if (property.equals(XalanProperties.SOURCE_LOCATION))
-      return m_useSourceLocationProperty;
-
-    return false;
-  }
-
-  /**
-   * Set a runtime property for this <code>TransformerImpl</code>.
-   *
-   * @param property a <code>String</code> value
-   * @param value an <code>Object</code> value
-   */
-  public void setProperty(String property, Object value)
-  {
-    if (property.equals(XalanProperties.SOURCE_LOCATION)) {
-      if (!(value instanceof Boolean))
-        throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_PROPERTY_VALUE_BOOLEAN, new Object[]{XalanProperties.SOURCE_LOCATION})); //"Value for property "
-                                   //+ XalanProperties.SOURCE_LOCATION
-                                   //+ " should be a Boolean instance");
-      m_useSourceLocationProperty = ((Boolean)value).booleanValue();
-    }
-  }
-
-  // ========= Transformer Interface Implementation ==========
-
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Get true if the parser events should be on the main thread,
-   * false if not.  Experimental.  Can not be set right now.
-   *
-   * @return true if the parser events should be on the main thread,
-   * false if not.
-   */
-  public boolean isParserEventsOnMain()
-  {
-    return m_parserEventsOnMain;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the thread that the transform process is on.
-   *
-   * @return The thread that the transform process is on, or null.
-   */
-  public Thread getTransformThread()
-  {
-    return m_transformThread;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the thread that the transform process is on.
-   *
-   * @param t The transform thread, may be null.
-   */
-  public void setTransformThread(Thread t)
-  {
-    m_transformThread = t;
-  }
-
-  /** NEEDSDOC Field m_hasTransformThreadErrorCatcher          */
-  private boolean m_hasTransformThreadErrorCatcher = false;
-
-  /**
-   * Return true if the transform was initiated from the transform method,
-   * otherwise it was probably done from a pure parse events.
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public boolean hasTransformThreadErrorCatcher()
-  {
-    return m_hasTransformThreadErrorCatcher;
-  }
-        
-        /**
-   * Process the source tree to SAX parse events.
-   * @param source  The input for the source tree.
-   *
-   * @throws TransformerException
-   */
-  public void transform(Source source) throws TransformerException
-  {
-                transform(source, true); 
-        }
-
-  /**
-   * Process the source tree to SAX parse events.
-   * @param source  The input for the source tree.
-   * @param shouldRelease  Flag indicating whether to release DTMManager.
-   *
-   * @throws TransformerException
-   */
-  public void transform(Source source, boolean shouldRelease) throws TransformerException
-  {
-
-    try
-    {
-      String base = source.getSystemId();
-      
-      // If no systemID of the source, use the base of the stylesheet.
-      if(null == base)
-      {
-        base = m_stylesheetRoot.getBaseIdentifier();
-      }
-
-      // As a last resort, use the current user dir.
-      if(null == base)
-      {
-        String currentDir = System.getProperty("user.dir");
-        
-        if (currentDir.startsWith(java.io.File.separator))
-          base = "file://" + currentDir;
-        else
-          base = "file:///" + currentDir;
-        
-        base = base + java.io.File.separatorChar
-               + source.getClass().getName();
-      }
-      setBaseURLOfSource(base);
-      DTMManager mgr = m_xcontext.getDTMManager();
-      DTM dtm = mgr.getDTM(source, false, this, true, true);
-      dtm.setProperty(XalanProperties.SOURCE_LOCATION,
-                      new Boolean(m_useSourceLocationProperty));
-      
-      boolean hardDelete = true;  // %REVIEW% I have to think about this. -sb
-
-      try
-      {
-        this.transformNode(dtm.getDocument());
-      }
-      finally
-      {
-        if (shouldRelease)
-          mgr.release(dtm, hardDelete);
-      }
-
-      // Kick off the parse.  When the ContentHandler gets 
-      // the startDocument event, it will call transformNode( node ).
-      // reader.parse( xmlSource );
-      // This has to be done to catch exceptions thrown from 
-      // the transform thread spawned by the STree handler.
-      Exception e = getExceptionThrown();
-
-      if (null != e)
-      {
-        if (e instanceof javax.xml.transform.TransformerException)
-        {
-          throw (javax.xml.transform.TransformerException) e;
-        }
-        else if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
-        {
-          m_errorHandler.fatalError(
-            new javax.xml.transform.TransformerException(
-              ((org.apache.xml.utils.WrappedRuntimeException) e).getException()));
-        }
-        else
-        {
-          throw new javax.xml.transform.TransformerException(e);
-        }
-      }
-      else if (null != m_resultTreeHandler)
-      {
-        m_resultTreeHandler.endDocument();
-      }
-    }
-    catch (org.apache.xml.utils.WrappedRuntimeException wre)
-    {
-      Throwable throwable = wre.getException();
-
-      while (throwable
-             instanceof org.apache.xml.utils.WrappedRuntimeException)
-      {
-        throwable =
-          ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException();
-      }
-
-      m_errorHandler.fatalError(new TransformerException(wre.getException()));
-    }
-
-    // Patch attributed to David Eisenberg <david@catcode.com>
-    catch (org.xml.sax.SAXParseException spe)
-    {
-      String msg = spe.getMessage();
-      SAXSourceLocator loc = new SAXSourceLocator(spe);
-
-      //m_errorHandler.fatalError(new TransformerException( msg, loc ));
-      m_errorHandler.fatalError(new TransformerException(spe));
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      m_errorHandler.fatalError(new TransformerException(se));
-    }
-    finally
-    {
-      m_hasTransformThreadErrorCatcher = false;
-
-      // This looks to be redundent to the one done in TransformNode.
-      reset();
-    }
-  }
-
-  /**
-   * Get the base URL of the source.
-   *
-   * @return The base URL of the source tree, or null.
-   */
-  public String getBaseURLOfSource()
-  {
-    return m_urlOfSource;
-  }
-
-  /**
-   * Get the base URL of the source.
-   *
-   *
-   * NEEDSDOC @param base
-   * @return The base URL of the source tree, or null.
-   */
-  public void setBaseURLOfSource(String base)
-  {
-    m_urlOfSource = base;
-  }
-
-  /**
-   * Get the original output target.
-   *
-   * @return The Result object used to kick of the transform or null.
-   */
-  public Result getOutputTarget()
-  {
-    return m_outputTarget;
-  }
-
-  /**
-   * Set the original output target.  This is useful when using a SAX transform and
-   * supplying a ContentHandler or when the URI of the output target should
-   * not be the same as the systemID of the original output target.
-   *
-   *
-   * NEEDSDOC @param outputTarget
-   */
-  public void setOutputTarget(Result outputTarget)
-  {
-    m_outputTarget = outputTarget;
-  }
-
-  /**
-   * Get an output property that is in effect for the
-   * transformation.  The property specified may be a property
-   * that was set with setOutputProperty, or it may be a
-   * property specified in the stylesheet.
-   *
-   * @param name A non-null String that specifies an output
-   * property name, which may be namespace qualified.
-   *
-   * NEEDSDOC @param qnameString
-   *
-   * @return The string value of the output property, or null
-   * if no property was found.
-   *
-   * @throws IllegalArgumentException If the property is not supported.
-   *
-   * @see javax.xml.transform.OutputKeys
-   */
-  public String getOutputProperty(String qnameString)
-          throws IllegalArgumentException
-  {
-
-    String value = null;
-    OutputProperties props = getOutputFormat();
-
-    value = props.getProperty(qnameString);
-
-    if (null == value)
-    {
-      if (!props.isLegalPropertyKey(qnameString))
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: "
-                                           //+ qnameString);
-    }
-
-    return value;
-  }
-
-  /**
-   * Get the value of a property, without using the default properties.  This
-   * can be used to test if a property has been explicitly set by the stylesheet
-   * or user.
-   *
-   * @param name The property name, which is a fully-qualified URI.
-   *
-   * NEEDSDOC @param qnameString
-   *
-   * @return The value of the property, or null if not found.
-   *
-   * @throws IllegalArgumentException If the property is not supported,
-   * and is not namespaced.
-   */
-  public String getOutputPropertyNoDefault(String qnameString)
-          throws IllegalArgumentException
-  {
-
-    String value = null;
-    OutputProperties props = getOutputFormat();
-
-    value = (String) props.getProperties().get(qnameString);
-
-    if (null == value)
-    {
-      if (!props.isLegalPropertyKey(qnameString))
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: "
-                                          // + qnameString);
-    }
-
-    return value;
-  }
-
-  /**
-   * Set the value of a property.  Recognized properties are:
-   *
-   * <p>"http://xml.apache.org/xslt/sourcebase" - the base URL for the
-   * source, which is needed when pure SAX ContentHandler transformation
-   * is to be done.</p>
-   *
-   * @param name The property name, which is a fully-qualified URI.
-   * @param value The requested value for the property.
-   * @throws IllegalArgumentException if the property name is not legal.
-   */
-  public void setOutputProperty(String name, String value)
-          throws IllegalArgumentException
-  {
-
-    synchronized (m_reentryGuard)
-    {
-
-      // Get the output format that was set by the user, otherwise get the 
-      // output format from the stylesheet.
-      if (null == m_outputFormat)
-      {
-        m_outputFormat =
-          (OutputProperties) getStylesheet().getOutputComposed().clone();
-      }
-
-      if (!m_outputFormat.isLegalPropertyKey(name))
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: "
-                                           //+ name);
-
-      m_outputFormat.setProperty(name, value);
-    }
-  }
-
-  /**
-   * Set the output properties for the transformation.  These
-   * properties will override properties set in the templates
-   * with xsl:output.
-   *
-   * <p>If argument to this function is null, any properties
-   * previously set will be removed.</p>
-   *
-   * @param oformat A set of output properties that will be
-   * used to override any of the same properties in effect
-   * for the transformation.
-   */
-  public void setOutputProperties(Properties oformat)
-  {
-
-    synchronized (m_reentryGuard)
-    {
-      if (null != oformat)
-      {
-
-        // See if an *explicit* method was set.
-        String method = (String) oformat.get(OutputKeys.METHOD);
-
-        if (null != method)
-          m_outputFormat = new OutputProperties(method);
-        else
-          m_outputFormat = new OutputProperties();
-      }
-
-      if (null != oformat)
-      {
-        m_outputFormat.copyFrom(oformat);
-      }
-
-      // copyFrom does not set properties that have been already set, so 
-      // this must be called after, which is a bit in the reverse from 
-      // what one might think.
-      m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties());
-    }
-  }
-
-  /**
-   * Get a copy of the output properties for the transformation.  These
-   * properties will override properties set in the templates
-   * with xsl:output.
-   *
-   * <p>Note that mutation of the Properties object returned will not
-   * effect the properties that the transformation contains.</p>
-   *
-   * @returns A copy of the set of output properties in effect
-   * for the next transformation.
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public Properties getOutputProperties()
-  {
-    return (Properties) getOutputFormat().getProperties().clone();
-  }
-
-  /**
-   * Create a result ContentHandler from a Result object, based
-   * on the current OutputProperties.
-   *
-   * @param outputTarget Where the transform result should go,
-   * should not be null.
-   *
-   * @return A valid ContentHandler that will create the
-   * result tree when it is fed SAX events.
-   *
-   * @throws TransformerException
-   */
-  public ContentHandler createResultContentHandler(Result outputTarget)
-          throws TransformerException
-  {
-    return createResultContentHandler(outputTarget, getOutputFormat());
-  }
-
-  /**
-   * Create a ContentHandler from a Result object and an OutputProperties.
-   *
-   * @param outputTarget Where the transform result should go,
-   * should not be null.
-   * @param format The OutputProperties object that will contain
-   * instructions on how to serialize the output.
-   *
-   * @return A valid ContentHandler that will create the
-   * result tree when it is fed SAX events.
-   *
-   * @throws TransformerException
-   */
-  public ContentHandler createResultContentHandler(
-          Result outputTarget, OutputProperties format)
-            throws TransformerException
-  {
-
-    ContentHandler handler = null;
-
-    // If the Result object contains a Node, then create 
-    // a ContentHandler that will add nodes to the input node.
-    org.w3c.dom.Node outputNode = null;
-
-    if (outputTarget instanceof DOMResult)
-    {
-      outputNode = ((DOMResult) outputTarget).getNode();
-
-      org.w3c.dom.Document doc;
-      short type;
-
-      if (null != outputNode)
-      {
-        type = outputNode.getNodeType();
-        doc = (org.w3c.dom.Node.DOCUMENT_NODE == type)
-              ? (org.w3c.dom.Document) outputNode
-              : outputNode.getOwnerDocument();
-      }
-      else
-      {
-        doc = org.apache.xpath.DOMHelper.createDocument();
-        outputNode = doc;
-        type = outputNode.getNodeType();
-
-        ((DOMResult) outputTarget).setNode(outputNode);
-      }
-
-      handler =
-        (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type)
-        ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode)
-        : new DOMBuilder(doc, outputNode);
-    }
-    else if (outputTarget instanceof SAXResult)
-    {
-      handler = ((SAXResult) outputTarget).getHandler();
-
-      if (null == handler)
-        throw new IllegalArgumentException(
-          "handler can not be null for a SAXResult");
-    }
-
-    // Otherwise, create a ContentHandler that will serialize the 
-    // result tree to either a stream or a writer.
-    else if (outputTarget instanceof StreamResult)
-    {
-      StreamResult sresult = (StreamResult) outputTarget;
-      String method = format.getProperty(OutputKeys.METHOD);
-
-      try
-      {
-        Serializer serializer =
-          SerializerFactory.getSerializer(format.getProperties());
-
-        if (null != sresult.getWriter())
-          serializer.setWriter(sresult.getWriter());
-        else if (null != sresult.getOutputStream())
-          serializer.setOutputStream(sresult.getOutputStream());
-        else if (null != sresult.getSystemId())
-        {
-          String fileURL = sresult.getSystemId();
-
-          if (fileURL.startsWith("file:///"))
-          {
-            if (fileURL.substring(8).indexOf(":") >0)
-              fileURL = fileURL.substring(8);
-            else 
-              fileURL = fileURL.substring(7);
-          }
-
-          m_outputStream = new java.io.FileOutputStream(fileURL);
-
-          serializer.setOutputStream(m_outputStream);
-        }
-        else
-          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!");
-
-        handler = serializer.asContentHandler();
-
-        this.setSerializer(serializer);
-      }
-      catch (UnsupportedEncodingException uee)
-      {
-        throw new TransformerException(uee);
-      }
-      catch (IOException ioe)
-      {
-        throw new TransformerException(ioe);
-      }
-    }
-    else
-    {
-      throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type "
-                                     //+ outputTarget.getClass().getName()
-                                     //+ "!");
-    }
-
-    return handler;
-  }
-        
-        /**
-   * Process the source tree to the output result.
-   * @param xmlSource  The input for the source tree.
-   * @param outputTarget The output source target.
-   *
-   * @throws TransformerException
-   */
-  public void transform(Source xmlSource, Result outputTarget)
-          throws TransformerException
-  {
-                transform(xmlSource, outputTarget, true);
-        }
-
-  /**
-   * Process the source tree to the output result.
-   * @param xmlSource  The input for the source tree.
-   * @param outputTarget The output source target.
-   * @param shouldRelease  Flag indicating whether to release DTMManager. 
-   *
-   * @throws TransformerException
-   */
-  public void transform(Source xmlSource, Result outputTarget, boolean shouldRelease)
-          throws TransformerException
-  {
-
-    synchronized (m_reentryGuard)
-    {
-      ContentHandler handler = createResultContentHandler(outputTarget);
-
-      m_outputTarget = outputTarget;
-
-      this.setContentHandler(handler);
-      transform(xmlSource, shouldRelease);
-    }
-  }
-
-  /**
-   * Process the source node to the output result, if the
-   * processor supports the "http://xml.org/trax/features/dom/input"
-   * feature.
-   * %REVIEW% Do we need a Node version of this?
-   * @param node  The input source node, which can be any valid DTM node.
-   * @param outputTarget The output source target.
-   *
-   * @throws TransformerException
-   */
-  public void transformNode(int node, Result outputTarget)
-          throws TransformerException
-  {
-
-    ContentHandler handler = createResultContentHandler(outputTarget);
-
-    m_outputTarget = outputTarget;
-
-    this.setContentHandler(handler);
-    transformNode(node);
-  }
-
-  /**
-   * Process the source node to the output result, if the
-   * processor supports the "http://xml.org/trax/features/dom/input"
-   * feature.
-   * %REVIEW% Do we need a Node version of this?
-   * @param node  The input source node, which can be any valid DTM node.
-   * @param outputTarget The output source target.
-   *
-   * @throws TransformerException
-   */
-  public void transformNode(int node) throws TransformerException
-  {
-
-    // Make sure we're not writing to the same output content handler.
-    synchronized (m_outputContentHandler)
-    {
-      m_hasBeenReset = false;
-      
-      XPathContext xctxt = getXPathContext();
-      DTM dtm = xctxt.getDTM(node);
-
-      try
-      {
-        pushGlobalVars(node);
-
-        // ==========
-        // Give the top-level templates a chance to pass information into 
-        // the context (this is mainly for setting up tables for extensions).
-        StylesheetRoot stylesheet = this.getStylesheet();
-        int n = stylesheet.getGlobalImportCount();
-
-        for (int i = 0; i < n; i++)
-        {
-          StylesheetComposed imported = stylesheet.getGlobalImport(i);
-          int includedCount = imported.getIncludeCountComposed();
-
-          for (int j = -1; j < includedCount; j++)
-          {
-            Stylesheet included = imported.getIncludeComposed(j);
-
-            included.runtimeInit(this);
-
-            for (ElemTemplateElement child = included.getFirstChildElem();
-                    child != null; child = child.getNextSiblingElem())
-            {
-              child.runtimeInit(this);
-            }
-          }
-        }
-
-        // ===========
-        // System.out.println("Calling applyTemplateToNode - "+Thread.currentThread().getName());
-        DTMIterator dtmIter = new org.apache.xpath.axes.SelfIteratorNoPredicate();
-        dtmIter.setRoot(node, xctxt);
-        xctxt.pushContextNodeList(dtmIter);
-        try
-        {
-          this.applyTemplateToNode(null, null, node);
-        }
-        finally
-        {
-          xctxt.popContextNodeList();
-        }
-        // m_stylesheetRoot.getStartRule().execute(this);
-
-        // System.out.println("Done with applyTemplateToNode - "+Thread.currentThread().getName());
-        if (null != m_resultTreeHandler)
-        {
-          m_resultTreeHandler.endDocument();
-        }
-      }
-      catch (Exception se)
-      {
-
-        // System.out.println(Thread.currentThread().getName()+" threw an exception! "
-        //                   +se.getMessage());
-        // If an exception was thrown, we need to make sure that any waiting 
-        // handlers can terminate, which I guess is best done by sending 
-        // an endDocument.
-        
-        // SAXSourceLocator
-        while(se instanceof org.apache.xml.utils.WrappedRuntimeException)
-        {
-          Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException();
-          if(null != e)
-            se = e;
-        }
-        
-        if (null != m_resultTreeHandler)
-        {
-          try
-          {
-            if(se instanceof org.xml.sax.SAXParseException)
-              m_resultTreeHandler.fatalError((org.xml.sax.SAXParseException)se);
-            else
-              m_resultTreeHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se));              
-          }
-          catch (Exception e){}
-        }        
-        
-        if(se instanceof TransformerException)
-        {
-          m_errorHandler.fatalError((TransformerException)se);
-        }
-        else if(se instanceof org.xml.sax.SAXParseException)
-        {
-          m_errorHandler.fatalError(new TransformerException(se.getMessage(), 
-                      new SAXSourceLocator((org.xml.sax.SAXParseException)se), 
-                      se));
-        }
-        else
-        {
-          m_errorHandler.fatalError(new TransformerException(se));
-        }
-        
-      }
-      finally
-      {
-        this.reset();
-      }
-    }
-  }
-
-  /**
-   * Get a SAX2 ContentHandler for the input.
-   *
-   * @return A valid ContentHandler, which should never be null, as
-   * long as getFeature("http://xml.org/trax/features/sax/input")
-   * returns true.
-   */
-  public ContentHandler getInputContentHandler()
-  {
-    return getInputContentHandler(false);
-  }
-
-  /**
-   * Get a SAX2 ContentHandler for the input.
-   *
-   * @param doDocFrag true if a DocumentFragment should be created as
-   * the root, rather than a Document.
-   *
-   * @return A valid ContentHandler, which should never be null, as
-   * long as getFeature("http://xml.org/trax/features/sax/input")
-   * returns true.
-   */
-  public ContentHandler getInputContentHandler(boolean doDocFrag)
-  {
-
-    if (null == m_inputContentHandler)
-    {
-
-      //      if(null == m_urlOfSource && null != m_stylesheetRoot)
-      //        m_urlOfSource = m_stylesheetRoot.getBaseIdentifier();
-      m_inputContentHandler = new TransformerHandlerImpl(this, doDocFrag,
-              m_urlOfSource);
-    }
-
-    return m_inputContentHandler;
-  }
-
-  /**
-   * Get a SAX2 DeclHandler for the input.
-   * @return A valid DeclHandler, which should never be null, as
-   * long as getFeature("http://xml.org/trax/features/sax/input")
-   * returns true.
-   */
-  public DeclHandler getInputDeclHandler()
-  {
-
-    if (m_inputContentHandler instanceof DeclHandler)
-      return (DeclHandler) m_inputContentHandler;
-    else
-      return null;
-  }
-
-  /**
-   * Get a SAX2 LexicalHandler for the input.
-   * @return A valid LexicalHandler, which should never be null, as
-   * long as getFeature("http://xml.org/trax/features/sax/input")
-   * returns true.
-   */
-  public LexicalHandler getInputLexicalHandler()
-  {
-
-    if (m_inputContentHandler instanceof LexicalHandler)
-      return (LexicalHandler) m_inputContentHandler;
-    else
-      return null;
-  }
-
-  /**
-   * Set the output properties for the transformation.  These
-   * properties will override properties set in the templates
-   * with xsl:output.
-   *
-   * @param oformat A valid OutputProperties object (which will
-   * not be mutated), or null.
-   */
-  public void setOutputFormat(OutputProperties oformat)
-  {
-    m_outputFormat = oformat;
-  }
-
-  /**
-   * Get the output properties used for the transformation.
-   *
-   * @return the output format that was set by the user,
-   * otherwise the output format from the stylesheet.
-   */
-  public OutputProperties getOutputFormat()
-  {
-
-    // Get the output format that was set by the user, otherwise get the 
-    // output format from the stylesheet.
-    OutputProperties format = (null == m_outputFormat)
-                              ? getStylesheet().getOutputComposed()
-                              : m_outputFormat;
-
-    return format;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the current serializer in use, which may well not
-   * be the main serializer (for instance, this may well be
-   * a text serializer for string creation from templates).
-   *
-   * @return The current serializer, or null if there is none.
-   */
-  public Serializer getSerializer()
-  {
-    return m_serializer;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Set the current serializer.
-   *
-   * @param s The current serializer, or null.
-   */
-  public void setSerializer(Serializer s)
-  {
-    m_serializer = s;
-  }
-  
-  /**
-   * Set a parameter for the templates.
-   * 
-   * @param name The name of the parameter.
-   * @param namespace The namespace of the parameter.
-   * @param value The value object.  This can be any valid Java object
-   * -- it's up to the processor to provide the proper
-   * coersion to the object, or simply pass it on for use
-   * in extensions.
-   */
-  public void setParameter(String name, String namespace, Object value)
-  {
-
-    VariableStack varstack = getXPathContext().getVarStack();
-    QName qname = new QName(namespace, name);
-    XObject xobject = XObject.create(value, getXPathContext());
-    
-    StylesheetRoot sroot = m_stylesheetRoot;
-    Vector vars = sroot.getVariablesAndParamsComposed();
-    int i = vars.size();
-    while (--i >= 0)
-    {
-      ElemVariable variable = (ElemVariable)vars.elementAt(i);
-      if(variable.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE && 
-         variable.getName().equals(qname))
-      {
-          varstack.setGlobalVariable(i, xobject);
-      }
-    }
-  }
-
-  /** NEEDSDOC Field m_userParams          */
-  Vector m_userParams;
-
-  /**
-   * Set a parameter for the transformation.
-   *
-   * @param name The name of the parameter,
-   *             which may have a namespace URI.
-   * @param value The value object.  This can be any valid Java object
-   * -- it's up to the processor to provide the proper
-   * coersion to the object, or simply pass it on for use
-   * in extensions.
-   */
-  public void setParameter(String name, Object value)
-  {
-
-    StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
-
-    try
-    {
-
-      // The first string might be the namespace, or it might be 
-      // the local name, if the namespace is null.
-      String s1 = tokenizer.nextToken();
-      String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
-
-      if (null == m_userParams)
-        m_userParams = new Vector();
-
-      if (null == s2)
-      {
-        replaceOrPushUserParam(new QName(s1), XObject.create(value, getXPathContext()));
-        setParameter(s1, null, value);
-      }
-      else
-      {
-        replaceOrPushUserParam(new QName(s1, s2), XObject.create(value, getXPathContext()));
-        setParameter(s2, s1, value);
-      }
-    }
-    catch (java.util.NoSuchElementException nsee)
-    {
-
-      // Should throw some sort of an error.
-    }
-  }
-
-  /**
-   * NEEDSDOC Method replaceOrPushUserParam 
-   *
-   *
-   * NEEDSDOC @param qname
-   * NEEDSDOC @param xval
-   */
-  private void replaceOrPushUserParam(QName qname, XObject xval)
-  {
-
-    int n = m_userParams.size();
-
-    for (int i = n - 1; i >= 0; i--)
-    {
-      Arg arg = (Arg) m_userParams.elementAt(i);
-
-      if (arg.getQName().equals(qname))
-      {
-        m_userParams.setElementAt(new Arg(qname, xval, true), i);
-
-        return;
-      }
-    }
-
-    m_userParams.addElement(new Arg(qname, xval, true));
-  }
-
-  /**
-   * Get a parameter that was explicitly set with setParameter
-   * or setParameters.
-   *
-   *
-   * NEEDSDOC @param name
-   * @return A parameter that has been set with setParameter
-   * or setParameters,
-   * *not* all the xsl:params on the stylesheet (which require
-   * a transformation Source to be evaluated).
-   */
-  public Object getParameter(String name)
-  {
-
-    try
-    {
-
-      // VariableStack varstack = getXPathContext().getVarStack();
-      // The first string might be the namespace, or it might be 
-      // the local name, if the namespace is null.
-      QName qname = QName.getQNameFromString(name);
-
-      if (null == m_userParams)
-        return null;
-
-      int n = m_userParams.size();
-
-      for (int i = n - 1; i >= 0; i--)
-      {
-        Arg arg = (Arg) m_userParams.elementAt(i);
-
-        if (arg.getQName().equals(qname))
-        {
-          return arg.getVal().object();
-        }
-      }
-
-      return null;
-    }
-    catch (java.util.NoSuchElementException nsee)
-    {
-
-      // Should throw some sort of an error.
-      return null;
-    }
-  }
-
-  /**
-   * Set a bag of parameters for the transformation. Note that
-   * these will not be additive, they will replace the existing
-   * set of parameters.
-   *
-   * @param name The name of the parameter,
-   *             which may have a namespace URI.
-   * @param value The value object.  This can be any valid Java object
-   * -- it's up to the processor to provide the proper
-   * coersion to the object, or simply pass it on for use
-   * in extensions.
-   *
-   * NEEDSDOC @param params
-   */
-  public void setParameters(Properties params)
-  {
-
-    clearParameters();
-
-    Enumeration names = params.propertyNames();
-
-    while (names.hasMoreElements())
-    {
-      String name = params.getProperty((String) names.nextElement());
-      StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
-
-      try
-      {
-
-        // The first string might be the namespace, or it might be 
-        // the local name, if the namespace is null.
-        String s1 = tokenizer.nextToken();
-        String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
-
-        if (null == s2)
-          setParameter(s1, null, params.getProperty(name));
-        else
-          setParameter(s2, s1, params.getProperty(name));
-      }
-      catch (java.util.NoSuchElementException nsee)
-      {
-
-        // Should throw some sort of an error.
-      }
-    }
-  }
-
-  /**
-   * Reset the parameters to a null list.
-   */
-  public void clearParameters()
-  {
-
-    synchronized (m_reentryGuard)
-    {
-      VariableStack varstack = new VariableStack();
-
-      m_xcontext.setVarStack(varstack);
-
-      m_userParams = null;
-    }
-  }
-
-
-  /**
-   * Internal -- push the global variables from the Stylesheet onto
-   * the context's runtime variable stack.
-   * <p>If we encounter a variable
-   * that is already defined in the variable stack, we ignore it.  This
-   * is because the second variable definition will be at a lower import
-   * precedence.  Presumably, global variables at the same import precedence
-   * with the same name will have been caught during the recompose process.
-   * <p>However, if we encounter a parameter that is already defined in the
-   * variable stack, we need to see if this is a parameter whose value was
-   * supplied by a setParameter call.  If so, we need to "receive" the one
-   * already in the stack, ignoring this one.  If it is just an earlier
-   * xsl:param or xsl:variable definition, we ignore it using the same
-   * reasoning as explained above for the variable.
-   *
-   * @param contextNode The root of the source tree, can't be null.
-   *
-   * @throws TransformerException
-   */
-  protected void pushGlobalVars(int contextNode) throws TransformerException
-  {
-
-    XPathContext xctxt = m_xcontext;
-    VariableStack vs = xctxt.getVarStack();
-    StylesheetRoot sr = getStylesheet();
-    Vector vars = sr.getVariablesAndParamsComposed();
-    
-    int i = vars.size();
-    vs.link(i);
-
-    while (--i >= 0)
-    {
-      ElemVariable v = (ElemVariable) vars.elementAt(i);
-
-      // XObject xobj = v.getValue(this, contextNode);
-      XObject xobj = new XUnresolvedVariable(v, contextNode, this,
-                                     vs.getStackFrame(), 0, true);
-      
-      if(null == vs.elementAt(i))                               
-        vs.setGlobalVariable(i, xobj);
-    }
-
-  }
-
-  /**
-   * Set an object that will be used to resolve URIs used in
-   * document(), etc.
-   * @param resolver An object that implements the URIResolver interface,
-   * or null.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-
-    synchronized (m_reentryGuard)
-    {
-      m_xcontext.getSourceTreeManager().setURIResolver(resolver);
-    }
-  }
-
-  /**
-   * Get an object that will be used to resolve URIs used in
-   * document(), etc.
-   *
-   * @return An object that implements the URIResolver interface,
-   * or null.
-   */
-  public URIResolver getURIResolver()
-  {
-    return m_xcontext.getSourceTreeManager().getURIResolver();
-  }
-
-  // ======== End Transformer Implementation ========  
-
-  /**
-   * Set the content event handler.
-   *
-   * @param resolver The new content handler.
-   *
-   * NEEDSDOC @param handler
-   * @throws java.lang.NullPointerException If the handler
-   *            is null.
-   * @see org.xml.sax.XMLReader#setContentHandler
-   */
-  public void setContentHandler(ContentHandler handler)
-  {
-
-    if (handler == null)
-    {
-      throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler");
-    }
-    else
-    {
-      m_outputContentHandler = handler;
-
-      if (null == m_resultTreeHandler)
-        m_resultTreeHandler = new ResultTreeHandler(this, handler);
-      else
-        m_resultTreeHandler.setContentHandler(handler);
-    }
-  }
-
-  /**
-   * Get the content event handler.
-   *
-   * @return The current content handler, or null if none was set.
-   * @see org.xml.sax.XMLReader#getContentHandler
-   */
-  public ContentHandler getContentHandler()
-  {
-    return m_outputContentHandler;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Given a stylesheet element, create a result tree fragment from it's
-   * contents.
-   * @param templateParent The template element that holds the fragment.
-   * @param sourceNode The current source context node.
-   * @param mode The mode under which the template is operating.
-   * @return An object that represents the result tree fragment.
-   *
-   * @throws TransformerException
-   */
-  public int transformToRTF(ElemTemplateElement templateParent)
-          throws TransformerException
-  {
-
-    XPathContext xctxt = m_xcontext;
-    DTM dtmFrag = xctxt.getDTM(null, true, this, false, false);
-    ContentHandler rtfHandler = dtmFrag.getContentHandler();
-
-    // Create a ResultTreeFrag object.
-    int resultFragment = resultFragment = dtmFrag.getDocument();
-
-    // Save the current result tree handler.
-    ResultTreeHandler savedRTreeHandler = this.m_resultTreeHandler;
-
-    // And make a new handler for the RTF.
-    m_resultTreeHandler = new ResultTreeHandler(this, rtfHandler);
-
-    ResultTreeHandler rth = m_resultTreeHandler;
-
-    try
-    {
-      rth.startDocument();
-
-      try
-      {
-
-        // Do the transformation of the child elements.
-        executeChildTemplates(templateParent, true);
-
-        // Make sure everything is flushed!
-        rth.flushPending();
-      }
-      finally
-      {
-        rth.endDocument();
-      }
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-    finally
-    {
-
-      // Restore the previous result tree handler.
-      this.m_resultTreeHandler = savedRTreeHandler;
-    }
-
-    return resultFragment;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the StringWriter pool, so that StringWriter
-   * objects may be reused.
-   *
-   * @return The string writer pool, not null.
-   */
-  public ObjectPool getStringWriterPool()
-  {
-    return m_stringWriterObjectPool;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Take the contents of a template element, process it, and
-   * convert it to a string.
-   *
-   * @param elem The parent element whose children will be output
-   * as a string.
-   * @param transformer The XSLT transformer instance.
-   * @param sourceNode The current source node context.
-   * @param mode The current xslt mode.
-   *
-   * @return The stringized result of executing the elements children.
-   *
-   * @throws TransformerException
-   */
-  public String transformToString(ElemTemplateElement elem)
-          throws TransformerException
-  {
-    ElemTemplateElement firstChild = elem.getFirstChildElem();
-    if(null == firstChild)
-      return "";
-    if(elem.hasTextLitOnly() && org.apache.xalan.processor.TransformerFactoryImpl.m_optimize)
-    {
-      return ((ElemTextLiteral)firstChild).getNodeValue();
-    }
-
-    // Save the current result tree handler.
-    ResultTreeHandler savedRTreeHandler = this.m_resultTreeHandler;
-
-    // Create a Serializer object that will handle the SAX events 
-    // and build the ResultTreeFrag nodes.
-    StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance();
-
-    m_resultTreeHandler =
-      (ResultTreeHandler) m_textResultHandlerObjectPool.getInstance();
-
-    Serializer serializer = m_resultTreeHandler.getSerializer();
-
-    try
-    {
-      if (null == serializer)
-      {
-        serializer =
-          SerializerFactory.getSerializer(m_textformat.getProperties());
-
-        m_resultTreeHandler.setSerializer(serializer);
-        serializer.setWriter(sw);
-
-        ContentHandler shandler = serializer.asContentHandler();
-
-        m_resultTreeHandler.init(this, shandler);
-      }
-      else
-      {
-
-        // Leave Commented.  -sb
-        // serializer.setWriter(sw);
-        // serializer.setOutputFormat(m_textformat);
-        // ContentHandler shandler = serializer.asContentHandler();
-        // m_resultTreeHandler.setContentHandler(shandler);
-      }
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerException(ioe);
-    }
-
-    String result;
-
-    try
-    {
-      this.m_resultTreeHandler.startDocument();
-
-      // Do the transformation of the child elements.
-      executeChildTemplates(elem, true);
-      this.m_resultTreeHandler.endDocument();
-
-      result = sw.toString();
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-    finally
-    {
-      sw.getBuffer().setLength(0);
-
-      try
-      {
-        sw.close();
-      }
-      catch (Exception ioe){}
-
-      m_stringWriterObjectPool.freeInstance(sw);
-      m_textResultHandlerObjectPool.freeInstance(m_resultTreeHandler);
-      m_resultTreeHandler.reset();
-
-      // Restore the previous result tree handler.
-      m_resultTreeHandler = savedRTreeHandler;
-    }
-
-    return result;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Given an element and mode, find the corresponding
-   * template and process the contents.
-   *
-   * @param xslInstruction The calling element.
-   * @param template The template to use if xsl:for-each, or null.
-   * @param child The source context node.
-   * @param mode The current mode, may be null.
-   * @throws TransformerException
-   * @return true if applied a template, false if not.
-   */
-  public boolean applyTemplateToNode(ElemTemplateElement xslInstruction,  // xsl:apply-templates or xsl:for-each
-                                     ElemTemplate template, int child)
-                                             throws TransformerException
-  {
-
-    DTM dtm = m_xcontext.getDTM(child);
-    short nodeType = dtm.getNodeType(child);
-    boolean isDefaultTextRule = false;
-
-    if (null == template)
-    {
-      int maxImportLevel;
-      boolean isApplyImports = ((xslInstruction == null)
-                                ? false
-                                : xslInstruction.getXSLToken()
-                                  == Constants.ELEMNAME_APPLY_IMPORTS);
-
-      if (isApplyImports)
-      {
-        maxImportLevel =
-          xslInstruction.getStylesheetComposed().getImportCountComposed() - 1;
-      }
-      else
-      {
-        maxImportLevel = -1;
-      }
-
-      // If we're trying an xsl:apply-imports at the top level (ie there are no
-      // imported stylesheets), we need to indicate that there is no matching template.
-      // The above logic will calculate a maxImportLevel of -1 which indicates
-      // that we should find any template.  This is because a value of -1 for
-      // maxImportLevel has a special meaning.  But we don't want that.
-      // We want to match -no- templates. See bugzilla bug 1170.
-      if (isApplyImports && (maxImportLevel == -1))
-      {
-        template = null;
-      }
-      else
-      {
-
-        // Find the XSL template that is the best match for the 
-        // element.        
-        XPathContext xctxt = m_xcontext;
-
-        try
-        {
-          xctxt.pushNamespaceContext(xslInstruction);
-
-          QName mode = this.getMode();
-
-          template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode,
-                  maxImportLevel, m_quietConflictWarnings, dtm);
-        }
-        finally
-        {
-          xctxt.popNamespaceContext();
-        }
-      }
-
-      // If that didn't locate a node, fall back to a default template rule.
-      // See http://www.w3.org/TR/xslt#built-in-rule.
-      if (null == template)
-      {
-        switch (nodeType)
-        {
-        case DTM.DOCUMENT_FRAGMENT_NODE :
-        case DTM.ELEMENT_NODE :
-          template = m_stylesheetRoot.getDefaultRule();
-          break;
-        case DTM.CDATA_SECTION_NODE :
-        case DTM.TEXT_NODE :
-        case DTM.ATTRIBUTE_NODE :
-          template = m_stylesheetRoot.getDefaultTextRule();
-          isDefaultTextRule = true;
-          break;
-        case DTM.DOCUMENT_NODE :
-          template = m_stylesheetRoot.getDefaultRootRule();
-          break;
-        default :
-
-          // No default rules for processing instructions and the like.
-          return false;
-        }
-      }
-    }
-
-    // If we are processing the default text rule, then just clone 
-    // the value directly to the result tree.
-    try
-    {
-      pushElemTemplateElement(template);
-      m_xcontext.pushCurrentNode(child);
-      pushPairCurrentMatched(template, child);
-      
-      // Fix copy copy29 test.
-      DTMIterator cnl = new org.apache.xpath.NodeSetDTM(child, m_xcontext.getDTMManager());
-      m_xcontext.pushContextNodeList(cnl);
-
-      if (isDefaultTextRule)
-      {
-        switch (nodeType)
-        {
-        case DTM.CDATA_SECTION_NODE :
-        case DTM.TEXT_NODE :
-          ClonerToResultTree.cloneToResultTree(child, nodeType, 
-                                        dtm, getResultTreeHandler(), false);
-          break;
-        case DTM.ATTRIBUTE_NODE :
-          dtm.dispatchCharactersEvents(child, getResultTreeHandler(), false);
-          break;
-        }
-      }
-      else
-      {
-
-        // Fire a trace event for the template.
-         
-                if (TransformerImpl.S_DEBUG)
-                  getTraceManager().fireTraceEvent(template);
-        // And execute the child templates.
-        // 9/11/00: If template has been compiled, hand off to it
-        // since much (most? all?) of the processing has been inlined.
-        // (It would be nice if there was a single entry point that
-        // worked for both... but the interpretive system works by
-        // having the Tranformer execute the children, while the
-        // compiled obviously has to run its own code. It's
-        // also unclear that "execute" is really the right name for
-        // that entry point.)
-        m_xcontext.setSAXLocator(template);
-        // m_xcontext.getVarStack().link();
-        m_xcontext.getVarStack().link(template.m_frameSize);
-        executeChildTemplates(template, true);
-      }
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-    finally
-    {
-      m_xcontext.getVarStack().unlink();
-      m_xcontext.popCurrentNode();
-      m_xcontext.popContextNodeList();
-      popCurrentMatched();
-      popElemTemplateElement();
-    }
-
-    return true;
-  }
-  
-  
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Execute each of the children of a template element.  This method
-   * is only for extension use.
-   *
-   * @param elem The ElemTemplateElement that contains the children
-   * that should execute.
-   * @param sourceNode The current context node.
-   * NEEDSDOC @param context
-   * @param mode The current mode.
-   * @param handler The ContentHandler to where the result events
-   * should be fed.
-   *
-   * @throws TransformerException
-   */
-  public void executeChildTemplates(
-          ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, ContentHandler handler)
-            throws TransformerException
-  {
-
-    XPathContext xctxt = m_xcontext;
-
-    try
-    {
-      if(null != mode)
-        pushMode(mode);
-      xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context));
-      executeChildTemplates(elem, handler);
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-      
-      // I'm not sure where or why this was here.  It is clearly in 
-      // error though, without a corresponding pushMode().
-      if (null != mode)
-        popMode();
-    }
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Execute each of the children of a template element.
-   *
-   * @param elem The ElemTemplateElement that contains the children
-   * that should execute.
-   * @param handler The ContentHandler to where the result events
-   * should be fed.
-   *
-   * @throws TransformerException
-   */
-  public void executeChildTemplates(
-          ElemTemplateElement elem, ContentHandler handler)
-            throws TransformerException
-  {
-
-    ResultTreeHandler rth = this.getResultTreeHandler();
-
-    // These may well not be the same!  In this case when calling 
-    // the Redirect extension, it has already set the ContentHandler
-    // in the Transformer.
-    ContentHandler savedRTHHandler = rth.getContentHandler();
-    ContentHandler savedHandler = this.getContentHandler();
-
-    try
-    {
-      getResultTreeHandler().flushPending();
-      this.setContentHandler(handler);
-
-      // %REVIEW% Make sure current node is being pushed.
-      executeChildTemplates(elem, true);
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-    finally
-    {
-      this.setContentHandler(savedHandler);
-
-      // This fixes a bug where the ResultTreeHandler's ContentHandler
-      // was being reset to the wrong ContentHandler.
-      rth.setContentHandler(savedRTHHandler);
-    }
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Execute each of the children of a template element.
-   *
-   * @param transformer The XSLT transformer instance.
-   *
-   * @param elem The ElemTemplateElement that contains the children
-   * that should execute.
-   * @param sourceNode The current context node.
-   * @param mode The current mode.
-   * @param shouldAddAttrs true if xsl:attributes should be executed.
-   *
-   * @throws TransformerException
-   */
-  public void executeChildTemplates(
-          ElemTemplateElement elem, boolean shouldAddAttrs)
-            throws TransformerException
-  {
-
-    // Does this element have any children?
-    ElemTemplateElement t = elem.getFirstChildElem();
-
-    if (null == t)
-      return;      
-    
-    if(elem.hasTextLitOnly() && org.apache.xalan.processor.TransformerFactoryImpl.m_optimize)
-    {      
-      char[] chars = ((ElemTextLiteral)t).getChars();
-      try
-      {
-        // Have to push stuff on for tooling...
-        this.pushElemTemplateElement(t);
-        m_resultTreeHandler.characters(chars, 0, chars.length);
-      }
-      catch(SAXException se)
-      {
-        throw new TransformerException(se);
-      }
-      finally
-      {
-        this.popElemTemplateElement();
-      }
-      return;
-    }
-
-//    // Check for infinite loops if we have to.
-//    boolean check = (m_stackGuard.m_recursionLimit > -1);
-//
-//    if (check)
-//      getStackGuard().push(elem, xctxt.getCurrentNode());
-
-    XPathContext xctxt = m_xcontext;
-    xctxt.pushSAXLocatorNull();
-    int currentTemplateElementsTop = m_currentTemplateElementsTop;
-    m_currentTemplateElementsTop++;
-
-    try
-    {
-      // Loop through the children of the template, calling execute on 
-      // each of them.
-      for (; t != null; t = t.getNextSiblingElem())
-      {
-        if (!shouldAddAttrs
-                && t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE)
-          continue;
-
-        xctxt.setSAXLocator(t);
-        m_currentTemplateElements[currentTemplateElementsTop] = t;
-        t.execute(this);
-      }
-    }
-    finally
-    {
-      m_currentTemplateElementsTop--;
-      xctxt.popSAXLocator();
-    }
-
-    // Check for infinite loops if we have to
-//    if (check)
-//      getStackGuard().pop();
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the keys for the xsl:sort elements.
-   * Note: Should this go into ElemForEach?
-   *
-   * @param foreach Valid ElemForEach element, not null.
-   * @param sourceNodeContext The current node context in the source tree,
-   * needed to evaluate the Attribute Value Templates.
-   *
-   * @return A Vector of NodeSortKeys, or null.
-   *
-   * @throws TransformerException
-   */
-  public Vector processSortKeys(ElemForEach foreach, int sourceNodeContext)
-          throws TransformerException
-  {
-
-    Vector keys = null;
-    XPathContext xctxt = m_xcontext;
-    int nElems = foreach.getSortElemCount();
-
-    if (nElems > 0)
-      keys = new Vector();
-
-    // March backwards, collecting the sort keys.
-    for (int i = 0; i < nElems; i++)
-    {
-      ElemSort sort = foreach.getSortElem(i);
-      String langString =
-        (null != sort.getLang())
-        ? sort.getLang().evaluate(xctxt, sourceNodeContext, foreach) : null;
-      String dataTypeString = sort.getDataType().evaluate(xctxt,
-                                sourceNodeContext, foreach);
-
-      if (dataTypeString.indexOf(":") >= 0)
-        System.out.println(
-          "TODO: Need to write the hooks for QNAME sort data type");
-      else if (!(dataTypeString.equalsIgnoreCase(Constants.ATTRVAL_DATATYPE_TEXT))
-               &&!(dataTypeString.equalsIgnoreCase(
-                 Constants.ATTRVAL_DATATYPE_NUMBER)))
-        foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE,
-                      new Object[]{ Constants.ATTRNAME_DATATYPE,
-                                    dataTypeString });
-
-      boolean treatAsNumbers =
-        ((null != dataTypeString) && dataTypeString.equals(
-        Constants.ATTRVAL_DATATYPE_NUMBER)) ? true : false;
-      String orderString = sort.getOrder().evaluate(xctxt, sourceNodeContext,
-                             foreach);
-
-      if (!(orderString.equalsIgnoreCase(Constants.ATTRVAL_ORDER_ASCENDING))
-              &&!(orderString.equalsIgnoreCase(
-                Constants.ATTRVAL_ORDER_DESCENDING)))
-        foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE,
-                      new Object[]{ Constants.ATTRNAME_ORDER,
-                                    orderString });
-
-      boolean descending =
-        ((null != orderString) && orderString.equals(
-        Constants.ATTRVAL_ORDER_DESCENDING)) ? true : false;
-      AVT caseOrder = sort.getCaseOrder();
-      boolean caseOrderUpper;
-
-      if (null != caseOrder)
-      {
-        String caseOrderString = caseOrder.evaluate(xctxt, sourceNodeContext,
-                                                    foreach);
-
-        if (!(caseOrderString.equalsIgnoreCase(Constants.ATTRVAL_CASEORDER_UPPER))
-                &&!(caseOrderString.equalsIgnoreCase(
-                  Constants.ATTRVAL_CASEORDER_LOWER)))
-          foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE,
-                        new Object[]{ Constants.ATTRNAME_CASEORDER,
-                                      caseOrderString });
-
-        caseOrderUpper =
-          ((null != caseOrderString) && caseOrderString.equals(
-          Constants.ATTRVAL_CASEORDER_UPPER)) ? true : false;
-      }
-      else
-      {
-        caseOrderUpper = false;
-      }
-
-      keys.addElement(new NodeSortKey(this, sort.getSelect(), treatAsNumbers,
-                                      descending, langString, caseOrderUpper,
-                                      foreach));
-    }
-
-    return keys;
-  }
-
-  //==========================================================
-  // SECTION: TransformState implementation
-  //==========================================================
-
-  /**
-   * Push the current template element.
-   *
-   * @param elem The current ElemTemplateElement (may be null, and then
-   * set via setCurrentElement).
-   */
-  public void pushElemTemplateElement(ElemTemplateElement elem)
-  {
-    m_currentTemplateElements[m_currentTemplateElementsTop++] = elem;
-  }
-
-  /**
-   * Pop the current template element.
-   */
-  public void popElemTemplateElement()
-  {
-    m_currentTemplateElementsTop--;
-  }
-
-  /**
-   * Set the top of the current template elements
-   * stack.
-   *
-   * @param e The current ElemTemplateElement about to
-   * be executed.
-   */
-  public void setCurrentElement(ElemTemplateElement e)
-  {
-    m_currentTemplateElements[m_currentTemplateElementsTop-1] = e;
-  }
-
-  /**
-   * Retrieves the current ElemTemplateElement that is
-   * being executed.
-   *
-   * @return The current ElemTemplateElement that is executing,
-   * should not normally be null.
-   */
-  public ElemTemplateElement getCurrentElement()
-  {
-    return m_currentTemplateElements[m_currentTemplateElementsTop-1];
-  }
-
-  /**
-   * This method retrieves the current context node
-   * in the source tree.
-   *
-   * @return The current context node (should never be null?).
-   */
-  public int getCurrentNode()
-  {
-    return m_xcontext.getCurrentNode();
-  }
-
-  /**
-   * This method retrieves the xsl:template
-   * that is in effect, which may be a matched template
-   * or a named template.
-   *
-   * <p>Please note that the ElemTemplate returned may
-   * be a default template, and thus may not have a template
-   * defined in the stylesheet.</p>
-   *
-   * @return The current xsl:template, should not be null.
-   */
-  public ElemTemplate getCurrentTemplate()
-  {
-
-    ElemTemplateElement elem = getCurrentElement();
-
-    while ((null != elem)
-           && (elem.getXSLToken() != Constants.ELEMNAME_TEMPLATE))
-    {
-      elem = elem.getParentElem();
-    }
-
-    return (ElemTemplate) elem;
-  }
-
-  /**
-   * Push both the current xsl:template or xsl:for-each onto the
-   * stack, along with the child node that was matched.
-   * (Note: should this only be used for xsl:templates?? -sb)
-   *
-   * @param template xsl:template or xsl:for-each.
-   * @param child The child that was matched.
-   */
-  public void pushPairCurrentMatched(ElemTemplateElement template, int child)
-  {
-    m_currentMatchTemplates.push(template);
-    m_currentMatchedNodes.push(child);
-  }
-
-  /**
-   * Pop the elements that were pushed via pushPairCurrentMatched.
-   */
-  public void popCurrentMatched()
-  {
-    m_currentMatchTemplates.pop();
-    m_currentMatchedNodes.pop();
-  }
-
-  /**
-   * This method retrieves the xsl:template
-   * that was matched.  Note that this may not be
-   * the same thing as the current template (which
-   * may be from getCurrentElement()), since a named
-   * template may be in effect.
-   *
-   * @return The pushed template that was pushed via pushPairCurrentMatched.
-   */
-  public ElemTemplate getMatchedTemplate()
-  {
-    return (ElemTemplate) m_currentMatchTemplates.peek();
-  }
-
-  /**
-   * Retrieves the node in the source tree that matched
-   * the template obtained via getMatchedTemplate().
-   *
-   * @return The matched node that corresponds to the
-   * match attribute of the current xsl:template.
-   */
-  public int getMatchedNode()
-  {
-    return m_currentMatchedNodes.peepTail();
-  }
-
-  /**
-   * Get the current context node list.
-   *
-   * @return A reset clone of the context node list.
-   */
-  public DTMIterator getContextNodeList()
-  {
-
-    try
-    {
-      DTMIterator cnl = m_xcontext.getContextNodeList();
-
-      return (cnl == null) ? null : (DTMIterator) cnl.cloneWithReset();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-
-      // should never happen.
-      return null;
-    }
-  }
-
-  /**
-   * Get the TrAX Transformer object in effect.
-   *
-   * @return This object.
-   */
-  public Transformer getTransformer()
-  {
-    return this;
-  }
-
-  //==========================================================
-  // SECTION: Accessor Functions
-  //==========================================================
-
-  /**
-   * Set the stylesheet for this processor.  If this is set, then the
-   * process calls that take only the input .xml will use
-   * this instead of looking for a stylesheet PI.  Also,
-   * setting the stylesheet is needed if you are going
-   * to use the processor as a SAX ContentHandler.
-   *
-   * @param stylesheetRoot A non-null StylesheetRoot object,
-   * or null if you wish to clear the stylesheet reference.
-   */
-  public void setStylesheet(StylesheetRoot stylesheetRoot)
-  {
-    m_stylesheetRoot = stylesheetRoot;
-  }
-
-  /**
-   * Get the current stylesheet for this processor.
-   *
-   * @return The stylesheet that is associated with this
-   * transformer.
-   */
-  public final StylesheetRoot getStylesheet()
-  {
-    return m_stylesheetRoot;
-  }
-
-  /**
-   * Get quietConflictWarnings property. If the quietConflictWarnings
-   * property is set to true, warnings about pattern conflicts won't be
-   * printed to the diagnostics stream.
-   *
-   * @return True if this transformer should not report
-   * template match conflicts.
-   */
-  public boolean getQuietConflictWarnings()
-  {
-    return m_quietConflictWarnings;
-  }
-
-  /**
-   * If the quietConflictWarnings property is set to
-   * true, warnings about pattern conflicts won't be
-   * printed to the diagnostics stream.
-   * False by default.
-   * (Currently setting this property will have no effect.)
-   *
-   * @param b true if conflict warnings should be suppressed.
-   */
-  public void setQuietConflictWarnings(boolean b)
-  {
-    m_quietConflictWarnings = b;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Set the execution context for XPath.
-   *
-   * @param xcontext A non-null reference to the XPathContext
-   * associated with this transformer.
-   */
-  public void setXPathContext(XPathContext xcontext)
-  {
-    m_xcontext = xcontext;
-  }
-
-  /**
-   * Get the XPath context associated with this transformer.
-   *
-   * @return The XPathContext reference, never null.
-   */
-  public final XPathContext getXPathContext()
-  {
-    return m_xcontext;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the object used to guard the stack from
-   * recursion.
-   *
-   * @return The StackGuard object, which should never be null.
-   */
-  public StackGuard getStackGuard()
-  {
-    return m_stackGuard;
-  }
-
-  /**
-   * Get the recursion limit.
-   * Used for infinite loop check. If the value is -1, do not
-   * check for infinite loops. Anyone who wants to enable that
-   * check should change the value of this variable to be the
-   * level of recursion that they want to check. Be careful setting
-   * this variable, if the number is too low, it may report an
-   * infinite loop situation, when there is none.
-   * Post version 1.0.0, we'll make this a runtime feature.
-   *
-   * @return The limit on recursion, or -1 if no check is to be made.
-   */
-  public int getRecursionLimit()
-  {
-    return m_stackGuard.getRecursionLimit();
-  }
-
-  /**
-   * Get the recursion limit.
-   * Used for infinite loop check. If the value is -1, do not
-   * check for infinite loops. Anyone who wants to enable that
-   * check should change the value of this variable to be the
-   * level of recursion that they want to check. Be careful setting
-   * this variable, if the number is too low, it may report an
-   * infinite loop situation, when there is none.
-   * Post version 1.0.0, we'll make this a runtime feature.
-   *
-   * @param limit A number that represents the limit of recursion,
-   * or -1 if no checking is to be done.
-   */
-  public void setRecursionLimit(int limit)
-  {
-    m_stackGuard.setRecursionLimit(limit);
-  }
-
-  /**
-   * Get the ResultTreeHandler object.
-   *
-   * @return The current ResultTreeHandler, which may not
-   * be the main result tree manager.
-   */
-  public ResultTreeHandler getResultTreeHandler()
-  {
-    return m_resultTreeHandler;
-  }
-
-  /**
-   * Get the KeyManager object.
-   *
-   * @return A reference to the KeyManager object, which should
-   * never be null.
-   */
-  public KeyManager getKeyManager()
-  {
-    return m_keyManager;
-  }
-
-  /**
-   * Check to see if this is a recursive attribute definition.
-   *
-   * @param attrSet A non-null ElemAttributeSet reference.
-   *
-   * @return true if the attribute set is recursive.
-   */
-  public boolean isRecursiveAttrSet(ElemAttributeSet attrSet)
-  {
-
-    if (null == m_attrSetStack)
-    {
-      m_attrSetStack = new Stack();
-    }
-
-    if (!m_attrSetStack.empty())
-    {
-      int loc = m_attrSetStack.search(attrSet);
-
-      if (loc > -1)
-      {
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  /**
-   * Push an executing attribute set, so we can check for
-   * recursive attribute definitions.
-   *
-   * @param attrSet A non-null ElemAttributeSet reference.
-   */
-  public void pushElemAttributeSet(ElemAttributeSet attrSet)
-  {
-    m_attrSetStack.push(attrSet);
-  }
-
-  /**
-   * Pop the current executing attribute set.
-   */
-  public void popElemAttributeSet()
-  {
-    m_attrSetStack.pop();
-  }
-
-  /**
-   * Get the table of counters, for optimized xsl:number support.
-   *
-   * @return The CountersTable, never null.
-   */
-  public CountersTable getCountersTable()
-  {
-
-    if (null == m_countersTable)
-      m_countersTable = new CountersTable();
-
-    return m_countersTable;
-  }
-
-  /**
-   * Tell if the current template rule is null, i.e. if we are
-   * directly within an apply-templates.  Used for xsl:apply-imports.
-   *
-   * @return True if the current template rule is null.
-   */
-  public boolean currentTemplateRuleIsNull()
-  {
-    return ((!m_currentTemplateRuleIsNull.isEmpty())
-            && (m_currentTemplateRuleIsNull.peek() == true));
-  }
-
-  /**
-   * Push true if the current template rule is null, false
-   * otherwise.
-   *
-   * @param b True if the we are executing an xsl:for-each
-   * (or xsl:call-template?).
-   */
-  public void pushCurrentTemplateRuleIsNull(boolean b)
-  {
-    m_currentTemplateRuleIsNull.push(b);
-  }
-
-  /**
-   * Push true if the current template rule is null, false
-   * otherwise.
-   */
-  public void popCurrentTemplateRuleIsNull()
-  {
-    m_currentTemplateRuleIsNull.pop();
-  }
-
-  /**
-   * Return the message manager.
-   *
-   * @return The message manager, never null.
-   */
-  public MsgMgr getMsgMgr()
-  {
-
-    if (null == m_msgMgr)
-      m_msgMgr = new MsgMgr(this);
-
-    return m_msgMgr;
-  }
-
-  /**
-   * Set the error event listener.
-   *
-   * @param listener The new error listener.
-   * @throws IllegalArgumentException if
-   */
-  public void setErrorListener(ErrorListener listener)
-          throws IllegalArgumentException
-  {
-
-    synchronized (m_reentryGuard)
-    {
-      if (listener == null)
-        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler");
-
-      m_errorHandler = listener;
-    }
-  }
-
-  /**
-   * Get the current error event handler.
-   *
-   * @return The current error handler, which should never be null.
-   */
-  public ErrorListener getErrorListener()
-  {
-    return m_errorHandler;
-  }
-
-  /**
-   * Get an instance of the trace manager for this transformation.
-   * This object can be used to set trace listeners on various
-   * events during the transformation.
-   *
-   * @return A reference to the TraceManager, never null.
-   */
-  public TraceManager getTraceManager()
-  {
-    return m_traceManager;
-  }
-
-  /**
-   * Look up the value of a feature.
-   *
-   * <p>The feature name is any fully-qualified URI.  It is
-   * possible for an TransformerFactory to recognize a feature name but
-   * to be unable to return its value; this is especially true
-   * in the case of an adapter for a SAX1 Parser, which has
-   * no way of knowing whether the underlying parser is
-   * validating, for example.</p>
-   *
-   * <h3>Open issues:</h3>
-   * <dl>
-   *    <dt><h4>Should getFeature be changed to hasFeature?</h4></dt>
-   *    <dd>Keith Visco writes: Should getFeature be changed to hasFeature?
-   *        It returns a boolean which indicated whether the "state"
-   *        of feature is "true or false". I assume this means whether
-   *        or not a feature is supported? I know SAX is using "getFeature",
-   *        but to me "hasFeature" is cleaner.</dd>
-   * </dl>
-   *
-   * @param name The feature name, which is a fully-qualified
-   *        URI.
-   * @return The current state of the feature (true or false).
-   * @throws org.xml.sax.SAXNotRecognizedException When the
-   *            TransformerFactory does not recognize the feature name.
-   * @throws org.xml.sax.SAXNotSupportedException When the
-   *            TransformerFactory recognizes the feature name but
-   *            cannot determine its value at this time.
-   *
-   * @throws SAXNotRecognizedException
-   * @throws SAXNotSupportedException
-   */
-  public boolean getFeature(String name)
-          throws SAXNotRecognizedException, SAXNotSupportedException
-  {
-
-    if ("http://xml.org/trax/features/sax/input".equals(name))
-      return true;
-    else if ("http://xml.org/trax/features/dom/input".equals(name))
-      return true;
-
-    throw new SAXNotRecognizedException(name);
-  }
-
-  // %TODO% Doc
-
-  /**
-   * NEEDSDOC Method getMode 
-   *
-   *
-   * NEEDSDOC (getMode) @return
-   */
-  public QName getMode()
-  {
-    return m_modes.isEmpty() ? null : (QName) m_modes.peek();
-  }
-
-  // %TODO% Doc
-
-  /**
-   * NEEDSDOC Method pushMode 
-   *
-   *
-   * NEEDSDOC @param mode
-   */
-  public void pushMode(QName mode)
-  {
-    m_modes.push(mode);
-  }
-
-  // %TODO% Doc
-
-  /**
-   * NEEDSDOC Method popMode 
-   *
-   */
-  public void popMode()
-  {
-    m_modes.pop();
-  }
-
-  ////////////////////////
-  // Implement Runnable //  
-  ////////////////////////
-
-  /**
-   * Base thread controler for xalan. Must be overriden with
-   * a derived class to support thread pooling.
-   *
-   * All thread-related stuff is in this class.
-   * 
-   * <p><em>WARNING!</em>  This class will probably move since the DTM 
-   * CoroutineSAXParser depends on it.  This class should move 
-   * to the CoroutineSAXParser.  You can use it, but be aware 
-   * that your code will have to change when the move occurs.</p>
-   */
-  public static class ThreadControler
-  {
-
-    /**
-     * Will get a thread from the pool, execute the task
-     *  and return the thread to the pool.
-     *
-     *  The return value is used only to wait for completion
-     *
-     *
-     * NEEDSDOC @param task
-     * @param priority if >0 the task will run with the given priority
-     *  ( doesn't seem to be used in xalan, since it's allways the default )
-     * @returns The thread that is running the task, can be used
-     *          to wait for completion
-     *
-     * NEEDSDOC ($objectName$) @return
-     */
-    public Thread run(Runnable task, int priority)
-    {
-
-      Thread t = new Thread(task);
-
-      t.start();
-
-      //       if( priority > 0 )
-      //      t.setPriority( priority );
-      return t;
-    }
-
-    /**
-     *  Wait until the task is completed on the worker
-     *  thread.
-     *
-     * NEEDSDOC @param worker
-     * NEEDSDOC @param task
-     *
-     * @throws InterruptedException
-     */
-    public void waitThread(Thread worker, Runnable task)
-            throws InterruptedException
-    {
-
-      // This should wait until the transformThread is considered not alive.
-      worker.join();
-    }
-  }
-
-  /** NEEDSDOC Field tpool          */
-  static ThreadControler tpool = new ThreadControler();
-
-  /**
-   * Change the ThreadControler that will be used to
-   *  manage the transform threads.
-   *
-   * NEEDSDOC @param tp
-   */
-  public static void setThreadControler(ThreadControler tp)
-  {
-    tpool = tp;
-  }
-
-  /**
-   * Called by SourceTreeHandler to start the transformation
-   *  in a separate thread
-   *
-   * NEEDSDOC @param priority
-   */
-  public void runTransformThread(int priority)
-  {
-
-    // used in SourceTreeHandler
-    Thread t = tpool.run(this, priority);
-
-    this.setTransformThread(t);
-  }
-
-  /**
-   * Called by this.transform() if isParserEventsOnMain()==false.
-   *  Similar with runTransformThread(), but no priority is set
-   *  and setTransformThread is not set.
-   */
-  public void runTransformThread()
-  {
-    tpool.run(this, -1);
-  }
-  
-  /**
-   * Called by CoRoutineSAXParser. Launches the CoroutineSAXParser
-   * in a thread, and prepares it to invoke the parser from that thread
-   * upon request. 
-   *  
-   */
-  public static void runTransformThread(Runnable runnable)
-  {
-    tpool.run(runnable, -1);
-  }
-
-  /**
-   * Used by SourceTreeHandler to wait until the transform
-   *   completes
-   *
-   * @throws SAXException
-   */
-  public void waitTransformThread() throws SAXException
-  {
-
-    // This is called to make sure the task is done.
-    // It is possible that the thread has been reused -
-    // but for a different transformation. ( what if we 
-    // recycle the transformer ? Not a problem since this is
-    // still in use. )
-    Thread transformThread = this.getTransformThread();
-
-    if (null != transformThread)
-    {
-      try
-      {
-        tpool.waitThread(transformThread, this);
-
-        if (!this.hasTransformThreadErrorCatcher())
-        {
-          Exception e = this.getExceptionThrown();
-
-          if (null != e)
-          {
-            e.printStackTrace();
-            throw new org.xml.sax.SAXException(e);
-          }
-        }
-
-        this.setTransformThread(null);
-      }
-      catch (InterruptedException ie){}
-    }
-  }
-
-  /**
-   * Get the exception thrown by the secondary thread (normally
-   * the transform thread).
-   *
-   * @return The thrown exception, or null if no exception was
-   * thrown.
-   */
-  public Exception getExceptionThrown()
-  {
-    return m_exceptionThrown;
-  }
-
-  /**
-   * Set the exception thrown by the secondary thread (normally
-   * the transform thread).
-   *
-   * @param e The thrown exception, or null if no exception was
-   * thrown.
-   */
-  public void setExceptionThrown(Exception e)
-  {
-    m_exceptionThrown = e;
-  }
-
-  /**
-   * This is just a way to set the document for run().
-   *
-   * @param doc A non-null reference to the root of the
-   * tree to be transformed.
-   */
-  public void setSourceTreeDocForThread(int doc)
-  {
-    m_doc = doc;
-  }
-
-  /**
-   * Set the input source for the source tree, which is needed if the
-   * parse thread is not the main thread, in order for the parse
-   * thread's run method to get to the input source.
-   *
-   * @param source The input source for the source tree.
-   */
-  public void setXMLSource(Source source)
-  {
-    m_xmlSource = source;
-  }
-
-  /**
-   * Tell if the transform method is completed.
-   *
-   * @return True if transformNode has completed, or
-   * an exception was thrown.
-   */
-  public boolean isTransformDone()
-  {
-
-    synchronized (this)
-    {
-      return m_isTransformDone;
-    }
-  }
-
-  /**
-   * Set if the transform method is completed.
-   *
-   * @param done True if transformNode has completed, or
-   * an exception was thrown.
-   */
-  public void setIsTransformDone(boolean done)
-  {
-
-    synchronized (this)
-    {
-      m_isTransformDone = done;
-    }
-  }
-
-  /**
-   * From a secondary thread, post the exception, so that
-   * it can be picked up from the main thread.
-   *
-   * @param e The exception that was thrown.
-   */
-  void postExceptionFromThread(Exception e)
-  {
-
-    // Commented out in response to problem reported by Nicola Brown <Nicola.Brown@jacobsrimell.com>
-    //    if(m_reportInPostExceptionFromThread)
-    //    {
-    //      // Consider re-throwing the exception if this flag is set.
-    //      e.printStackTrace();
-    //    }
-    // %REVIEW Need DTM equivelent?    
-    //    if (m_inputContentHandler instanceof SourceTreeHandler)
-    //    {
-    //      SourceTreeHandler sth = (SourceTreeHandler) m_inputContentHandler;
-    //
-    //      sth.setExceptionThrown(e);
-    //    }
-    ContentHandler ch = getContentHandler();
-
-    //    if(ch instanceof SourceTreeHandler)
-    //    {
-    //      SourceTreeHandler sth = (SourceTreeHandler) ch;
-    //      ((TransformerImpl)(sth.getTransformer())).postExceptionFromThread(e);
-    //    }
-    m_isTransformDone = true;
-    m_exceptionThrown = e;
-    ;  // should have already been reported via the error handler?
-
-    synchronized (this)
-    {
-
-      // See message from me on 3/27/2001 to Patrick Moore.
-      //      String msg = e.getMessage();
-      // System.out.println(e.getMessage());
-      // Is this really needed?  -sb
-      notifyAll();
-
-      //      if (null == msg)
-      //      {
-      //
-      //        // m_throwNewError = false;
-      //        e.printStackTrace();
-      //      }
-      // throw new org.apache.xml.utils.WrappedRuntimeException(e);
-    }
-  }
-
-  /**
-   * Run the transform thread.
-   */
-  public void run()
-  {
-
-    m_hasBeenReset = false;
-
-    try
-    {
-
-      // int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot();
-      // transformNode(n);
-      try
-      {
-        m_isTransformDone = false;
-        
-        // Should no longer be needed...
-//          if(m_inputContentHandler instanceof TransformerHandlerImpl)
-//          {
-//            TransformerHandlerImpl thi = (TransformerHandlerImpl)m_inputContentHandler;
-//            thi.waitForInitialEvents();
-//          }
-
-        transformNode(m_doc);
-        
-      }
-      catch (Exception e)
-      {
-        // e.printStackTrace();
-
-        // Strange that the other catch won't catch this...
-        if (null != m_transformThread)
-          postExceptionFromThread(e);   // Assume we're on the main thread
-        else 
-          throw new RuntimeException(e.getMessage());
-      }
-      finally
-      {
-        m_isTransformDone = true;
-
-        if (m_inputContentHandler instanceof TransformerHandlerImpl)
-        {
-          ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine();
-        }
-
-        //        synchronized (this)
-        //        {
-        //          notifyAll();
-        //        }
-      }
-    }
-    catch (Exception e)
-    {
-
-      // e.printStackTrace();
-      if (null != m_transformThread)
-        postExceptionFromThread(e);
-      else 
-        throw new RuntimeException(e.getMessage());         // Assume we're on the main thread.
-    }
-  }
-
-  // Fragment re-execution interfaces for a tool.
-
-  /**
-   * This will get a snapshot of the current executing context 
-   *
-   *
-   * @return TransformerSnapshot object, snapshot of executing context
-   */
-  public TransformSnapshot getSnapshot()
-  {
-    return new TransformSnapshotImpl(this);
-  }
-
-  /**
-   * This will execute the following XSLT instructions
-   * from the snapshot point, after the stylesheet execution
-   * context has been reset from the snapshot point. 
-   *
-   * @param ts The snapshot of where to start execution
-   *
-   * @throws TransformerException
-   */
-  public void executeFromSnapshot(TransformSnapshot ts)
-          throws TransformerException
-  {
-
-    ElemTemplateElement template = getMatchedTemplate();
-    int child = getMatchedNode();
-
-    pushElemTemplateElement(template);  //needed??
-    m_xcontext.pushCurrentNode(child);  //needed??
-    this.executeChildTemplates(template, true);  // getResultTreeHandler());
-  }
-
-  /**
-   * This will reset the stylesheet execution context
-   * from the snapshot point.
-   *
-   * @param ts The snapshot of where to start execution
-   */
-  public void resetToStylesheet(TransformSnapshot ts)
-  {
-    ((TransformSnapshotImpl) ts).apply(this);
-  }
-
-  /**
-   * NEEDSDOC Method stopTransformation 
-   *
-   */
-  public void stopTransformation(){}
-
-  /**
-   * Test whether whitespace-only text nodes are visible in the logical
-   * view of <code>DTM</code>. Normally, this function
-   * will be called by the implementation of <code>DTM</code>;
-   * it is not normally called directly from
-   * user code.
-   *
-   * @param elementHandle int Handle of the element.
-   * @return one of NOTSTRIP, STRIP, or INHERIT.
-   */
-  public short getShouldStripSpace(int elementHandle, DTM dtm)
-  {
-
-    try
-    {
-      org.apache.xalan.templates.WhiteSpaceInfo info =
-        m_stylesheetRoot.getWhiteSpaceInfo(m_xcontext, elementHandle, dtm);
-
-      if (null == info)
-      {
-        return DTMWSFilter.INHERIT;
-      }
-      else
-      {
-
-        // System.out.println("getShouldStripSpace: "+info.getShouldStripSpace());
-        return info.getShouldStripSpace()
-               ? DTMWSFilter.STRIP : DTMWSFilter.NOTSTRIP;
-      }
-    }
-    catch (TransformerException se)
-    {
-      return DTMWSFilter.INHERIT;
-    }
-  }
-}  // end TransformerImpl class
-
diff --git a/src/org/apache/xalan/transformer/TreeWalker2Result.java b/src/org/apache/xalan/transformer/TreeWalker2Result.java
deleted file mode 100644
index ab3f6fa..0000000
--- a/src/org/apache/xalan/transformer/TreeWalker2Result.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-import org.w3c.dom.Node;
-import org.apache.xml.dtm.DTM;
-
-import org.xml.sax.*;
-
-import org.apache.xml.dtm.ref.DTMTreeWalker;
-import org.apache.xml.utils.MutableAttrListImpl;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.XPathContext;
-
-/**
- * <meta name="usage" content="internal"/>
- * Handle a walk of a tree, but screen out attributes for
- * the result tree.
- */
-public class TreeWalker2Result extends DTMTreeWalker
-{
-
-  /** The transformer instance          */
-  TransformerImpl m_transformer;
-
-  /** The result tree handler          */
-  ResultTreeHandler m_handler;
-
-  /** Node where to start the tree walk           */
-  int m_startNode;
-
-  /**
-   * Constructor.
-   *
-   * @param transformer Non-null transformer instance
-   * @param handler The Result tree handler to use
-   */
-  public TreeWalker2Result(TransformerImpl transformer,
-                           ResultTreeHandler handler)
-  {
-
-    super(handler, null);
-
-    m_transformer = transformer;
-    m_handler = handler;
-  }
-
-  /**
-   * Perform a pre-order traversal non-recursive style.
-   *
-   * @param pos Start node for traversal
-   *
-   * @throws TransformerException
-   */
-  public void traverse(int pos) throws org.xml.sax.SAXException
-  {
-    m_dtm = m_transformer.getXPathContext().getDTM(pos);
-    m_startNode = pos;
-
-    super.traverse(pos);
-  }
-        
-        /**
-   * End processing of given node 
-   *
-   *
-   * @param node Node we just finished processing
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void endNode(int node) throws org.xml.sax.SAXException
-  {
-    super.endNode(node);
-    if(DTM.ELEMENT_NODE == m_dtm.getNodeType(node))
-    {
-      m_transformer.getXPathContext().popCurrentNode();
-    }
-  }
-
-  /**
-   * Start traversal of the tree at the given node
-   *
-   *
-   * @param node Starting node for traversal
-   *
-   * @throws TransformerException
-   */
-  protected void startNode(int node) throws org.xml.sax.SAXException
-  {
-
-    XPathContext xcntxt = m_transformer.getXPathContext();
-    try
-    {
-      
-      if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node))
-      {
-        xcntxt.pushCurrentNode(node);                   
-                                        
-        if(m_startNode != node)
-        {
-          super.startNode(node);
-        }
-        else
-        {
-          String elemName = m_dtm.getNodeName(node);
-          String localName = m_dtm.getLocalName(node);
-          String namespace = m_dtm.getNamespaceURI(node);
-                                        
-          //xcntxt.pushCurrentNode(node);       
-          m_handler.startElement(namespace, localName, elemName, null);
-
-          boolean hasNSDecls = false;
-          DTM dtm = m_dtm;
-          for (int ns = dtm.getFirstNamespaceNode(node, true); 
-               DTM.NULL != ns; ns = dtm.getNextNamespaceNode(node, ns, true))
-          {
-            m_handler.ensureNamespaceDeclDeclared(dtm, ns);
-          }
-                                                
-          // %REVIEW% This flag is apparently never set true. Is that
-          // a bug, or should this code be phased out?
-          if(hasNSDecls)
-          {
-            m_handler.addNSDeclsToAttrs();
-          }
-                                                
-          for (int attr = dtm.getFirstAttribute(node); 
-               DTM.NULL != attr; attr = dtm.getNextAttribute(attr))
-          {
-            m_handler.addAttribute(attr);
-          }
-        }
-                                
-      }
-      else
-      {
-        xcntxt.pushCurrentNode(node);
-        super.startNode(node);
-        xcntxt.popCurrentNode();
-      }
-    }
-    catch(javax.xml.transform.TransformerException te)
-    {
-      throw new org.xml.sax.SAXException(te);
-    }
-  }
-}
diff --git a/src/org/apache/xalan/transformer/XSLInfiniteLoopException.java b/src/org/apache/xalan/transformer/XSLInfiniteLoopException.java
deleted file mode 100644
index 6dd0f90..0000000
--- a/src/org/apache/xalan/transformer/XSLInfiniteLoopException.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.transformer;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class used to create an Infinite Loop Exception 
- */
-class XSLInfiniteLoopException
-{
-
-  /**
-   * Constructor XSLInfiniteLoopException
-   *
-   */
-  XSLInfiniteLoopException()
-  {
-    super();
-  }
-
-  /**
-   * Get Message associated with the exception
-   *
-   *
-   * @return Message associated with the exception
-   */
-  public String getMessage()
-  {
-    return "Processing Terminated.";
-  }
-}
diff --git a/src/org/apache/xalan/transformer/XalanProperties.java b/src/org/apache/xalan/transformer/XalanProperties.java
deleted file mode 100644
index 27c14a3..0000000
--- a/src/org/apache/xalan/transformer/XalanProperties.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by Ovidiu
- * Predescu <ovidiu@cup.hp.com> on behalf of the Apache Software
- * Foundation and was originally developed at Hewlett Packard Company.
- * For more information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.transformer;
-
-/**
- * <code>XalanProperties</code> defines the features understood by
- * Xalan.
- *
- * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
- @ @since May 23, 2001
- */
-public class XalanProperties
-{
-  public final static String SOURCE_LOCATION
-    = "http://xml.apache.org/xalan/properties/source-location";
-}
diff --git a/src/org/apache/xalan/transformer/package.html b/src/org/apache/xalan/transformer/package.html
deleted file mode 100644
index 1283815..0000000
--- a/src/org/apache/xalan/transformer/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-  <title>Xalan Transformer Package.</title>
-  <body>
-    <p>In charge of run-time transformations and the production of result trees.</p>
-    
-    <p>{@link org.apache.xalan.transformer.TransformerImpl} implements the 
-    {@link javax.xml.transform.Transformer} interface, and is the core representation 
-    of the transformation execution.</p>
-    <p>For each node in the XML source, TransformerImpl uses the StylesheetRoot and underlying XSLT schema to determine which
-    template to apply: one of the templates in the StylesheetRoot, a default template rule as specified in the XSLT spec, or
-    none.</p>
-    <p>The Transformer works with {@link org.apache.xalan.transformer.ResultTreeHandler} to 
-    forward the SAX events produced by the
-    transformation to the appropriate output ContentHandler.</p>
-    <p>To the degree possible, the parsing of the XML source and application of the Templates object to that source are performed
-    concurrently in separate threads. When necessary, the Transformer waits for the parse events that must be in place before a
-    given template may be applied.</p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/xslt/EnvironmentCheck.java b/src/org/apache/xalan/xslt/EnvironmentCheck.java
deleted file mode 100644
index e5d8357..0000000
--- a/src/org/apache/xalan/xslt/EnvironmentCheck.java
+++ /dev/null
@@ -1,1223 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Field;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-// Used in append* methods only
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Utility class to report simple information about the environment.
- * Simplistic reporting about certain classes found in your JVM may 
- * help answer some FAQs for simple problems.
- *
- * <p>Usage-command line:  
- * <code>
- * java org.apache.xalan.xslt.EnvironmentCheck [-out outFile]
- * </code></p>
- * 
- * <p>Usage-from program:  
- * <code>
- * boolean environmentOK = 
- * (new EnvironmentCheck()).checkEnvironment(yourPrintWriter);
- * </code></p>
- *
- * <p>Usage-from stylesheet:  
- * <code><pre>
- *    &lt;?xml version="1.0"?&gt;
- *    &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- *        xmlns:xalan="http://xml.apache.org/xalan"
- *        exclude-result-prefixes="xalan"&gt;
- *    &lt;xsl:output indent="yes"/&gt;
- *    &lt;xsl:template match="/"&gt;
- *      &lt;xsl:copy-of select="xalan:checkEnvironment()"/&gt;
- *    &lt;/xsl:template&gt;
- *    &lt;/xsl:stylesheet&gt;
- * </pre></code></p>
- *  
- * <p>Xalan users reporting problems are encouraged to use this class 
- * to see if there are potential problems with their actual 
- * Java environment <b>before</b> reporting a bug.  Note that you 
- * should both check from the JVM/JRE's command line as well as 
- * temporarily calling checkEnvironment() directly from your code, 
- * since the classpath may differ (especially for servlets, etc).</p>
- *
- * <p>Also see http://xml.apache.org/xalan-j/faq.html</p>
- *
- * <p>Note: This class is pretty simplistic: it does a fairly simple 
- * unordered search of the classpath; it only uses Class.forName() 
- * to load things, not actually querying the classloader; so the 
- * results are not necessarily definitive nor will it find all 
- * problems related to environment setup.  Also, you should avoid 
- * calling this in deployed production code, both because it is 
- * quite slow and because it forces classes to get loaded.</p>
- *
- * <p>Note: This class explicitly has very limited compile-time 
- * dependencies to enable easy compilation and usage even when 
- * Xalan, DOM/SAX/JAXP, etc. are not present.</p>
- * 
- * @author Shane_Curcuru@lotus.com
- * @version $Id$
- */
-public class EnvironmentCheck
-{
-
-  /**
-   * Command line runnability: checks for [-out outFilename] arg.
-   * <p>Command line entrypoint; Sets output and calls 
-   * {@link #checkEnvironment(PrintWriter)}.</p>
-   * @param args command line args
-   */
-  public static void main(String[] args)
-  {
-    // Default to System.out, autoflushing
-    PrintWriter sendOutputTo = new PrintWriter(System.out, true);
-
-    // Read our simplistic input args, if supplied
-    for (int i = 0; i < args.length; i++)
-    {
-      if ("-out".equalsIgnoreCase(args[i]))
-      {
-        i++;
-
-        if (i < args.length)
-        {
-          try
-          {
-            sendOutputTo = new PrintWriter(new FileWriter(args[i], true));
-          }
-          catch (Exception e)
-          {
-            System.err.println("# WARNING: -out " + args[i] + " threw "
-                               + e.toString());
-          }
-        }
-        else
-        {
-          System.err.println(
-            "# WARNING: -out argument should have a filename, output sent to console");
-        }
-      }
-    }
-
-    EnvironmentCheck app = new EnvironmentCheck();
-    app.checkEnvironment(sendOutputTo);
-  }
-
-  /**
-   * Programmatic entrypoint: Report on basic Java environment 
-   * and CLASSPATH settings that affect Xalan.
-   *
-   * <p>Note that this class is not advanced enough to tell you 
-   * everything about the environment that affects Xalan, and 
-   * sometimes reports errors that will not actually affect 
-   * Xalan's behavior.  Currently, it very simplistically 
-   * checks the JVM's environment for some basic properties and 
-   * logs them out; it will report a problem if it finds a setting 
-   * or .jar file that is <i>likely</i> to cause problems.</p>
-   *
-   * <p>Advanced users can peruse the code herein to help them 
-   * investigate potential environment problems found; other users 
-   * may simply send the output from this tool along with any bugs 
-   * they submit to help us in the debugging process.</p>
-   *
-   * @param pw PrintWriter to send output to; can be sent to a 
-   * file that will look similar to a Properties file; defaults 
-   * to System.out if null
-   * @return true if your environment appears to have no major 
-   * problems; false if potential environment problems found
-   * @see #getEnvironmentHash()
-   */
-  public boolean checkEnvironment(PrintWriter pw)
-  {
-
-    // Use user-specified output writer if non-null
-    if (null != pw)
-      outWriter = pw;
-
-    // Setup a hash to store various environment information in
-    Hashtable hash = getEnvironmentHash();
-
-    // Check for ERROR keys in the hashtable, and print report
-    boolean environmentHasErrors = writeEnvironmentReport(hash);
-
-    if (environmentHasErrors)
-    {
-      // Note: many logMsg calls have # at the start to 
-      //  fake a property-file like output
-      logMsg("# WARNING: Potential problems found in your environment!");
-      logMsg("#    Check any 'ERROR' items above against the Xalan FAQs");
-      logMsg("#    to correct potential problems with your classes/jars");
-      logMsg("#    http://xml.apache.org/xalan-j/faq.html");
-      if (null != outWriter)
-        outWriter.flush();
-      return false;
-    }
-    else
-    {
-      logMsg("# YAHOO! Your environment seems to be OK.");
-      if (null != outWriter)
-        outWriter.flush();
-      return true;
-    }
-  }
-
-  /**
-   * Fill a hash with basic environment settings that affect Xalan.
-   *
-   * <p>Worker method called from various places.</p>
-   * <p>Various system and CLASSPATH, etc. properties are put into 
-   * the hash as keys with a brief description of the current state 
-   * of that item as the value.  Any serious problems will be put in 
-   * with a key that is prefixed with {@link #ERROR 'ERROR.'} so it
-   * stands out in any resulting report; also a key with just that 
-   * constant will be set as well for any error.</p>
-   * <p>Note that some legitimate cases are flaged as potential 
-   * errors - namely when a developer recompiles xalan.jar on their 
-   * own - and even a non-error state doesn't guaruntee that 
-   * everything in the environment is correct.  But this will help 
-   * point out the most common classpath and system property
-   * problems that we've seen.</p>   
-   *
-   * @return Hashtable full of useful environment info about Xalan 
-   * and related system properties, etc.
-   */
-  public Hashtable getEnvironmentHash()
-  {
-    // Setup a hash to store various environment information in
-    Hashtable hash = new Hashtable();
-
-    // Call various worker methods to fill in the hash
-    //  These are explicitly separate for maintenance and so 
-    //  advanced users could call them standalone
-    checkJAXPVersion(hash);
-    checkProcessorVersion(hash);
-    checkParserVersion(hash);
-    checkDOMVersion(hash);
-    checkSAXVersion(hash);
-    checkSystemProperties(hash);
-
-    return hash;
-  }
-
-  /**
-   * Dump a basic Xalan environment report to outWriter.  
-   *
-   * <p>This dumps a simple header and then each of the entries in 
-   * the Hashtable to our PrintWriter; it does special processing 
-   * for entries that are .jars found in the classpath.</p>
-   *
-   * @param h Hashtable of items to report on; presumably
-   * filled in by our various check*() methods
-   * @return true if your environment appears to have no major 
-   * problems; false if potential environment problems found
-   * @see #appendEnvironmentReport(Node, Document, Hashtable)
-   * for an equivalent that appends to a Node instead
-   */
-  protected boolean writeEnvironmentReport(Hashtable h)
-  {
-
-    if (null == h)
-    {
-      logMsg("# ERROR: writeEnvironmentReport called with null Hashtable");
-      return false;
-    }
-
-    boolean errors = false;
-
-    logMsg(
-      "#---- BEGIN writeEnvironmentReport($Revision$): Useful properties found: ----");
-
-    // Fake the Properties-like output
-    for (Enumeration enum = h.keys(); 
-         enum.hasMoreElements();
-        /* no increment portion */
-        )
-    {
-      Object key = enum.nextElement();
-      String keyStr = (String) key;
-      try
-      {
-        // Special processing for classes found..
-        if (keyStr.startsWith(FOUNDCLASSES))
-        {
-          Vector v = (Vector) h.get(keyStr);
-          errors |= logFoundJars(v, keyStr);
-        }
-        // ..normal processing for all other entries
-        else
-        {
-          // Note: we could just check for the ERROR key by itself, 
-          //    since we now set that, but since we have to go 
-          //    through the whole hash anyway, do it this way,
-          //    which is safer for maintenance
-          if (keyStr.startsWith(ERROR))
-          {
-            errors = true;
-          }
-          logMsg(keyStr + "=" + h.get(keyStr));
-        }
-      }
-      catch (Exception e)
-      {
-        logMsg("Reading-" + key + "= threw: " + e.toString());
-      }
-    }
-
-    logMsg(
-      "#----- END writeEnvironmentReport: Useful properties found: -----");
-
-    return errors;
-  }
-
-  /** Prefixed to hash keys that signify serious problems.  */
-  public static final String ERROR = "ERROR.";
-
-  /** Added to descriptions that signify potential problems.  */
-  public static final String WARNING = "WARNING.";
-
-  /** Value for any error found.  */
-  public static final String ERROR_FOUND = "At least one error was found!";
-
-  /** Prefixed to hash keys that signify version numbers.  */
-  public static final String VERSION = "version.";
-
-  /** Prefixed to hash keys that signify .jars found in classpath.  */
-  public static final String FOUNDCLASSES = "foundclasses.";
-
-  /** Marker that a class or .jar was found.  */
-  public static final String CLASS_PRESENT = "present-unknown-version";
-
-  /** Marker that a class or .jar was not found.  */
-  public static final String CLASS_NOTPRESENT = "not-present";
-
-  /** Listing of common .jar files that include Xalan-related classes.  */
-  public String[] jarNames =
-  {
-    "xalan.jar", "xalansamples.jar", "xalanj1compat.jar", "xalanservlet.jar",
-    "xerces.jar", 
-    "testxsl.jar", 
-    "crimson.jar", 
-    "lotusxsl.jar", 
-    "jaxp.jar", "parser.jar", "dom.jar", "sax.jar", "xml.jar", 
-    "xsltc.jar"
-  };
-
-  /**
-   * Print out report of .jars found in a classpath. 
-   *
-   * Takes the information encoded from a checkPathForJars() 
-   * call and dumps it out to our PrintWriter.
-   *
-   * @param v Vector of Hashtables of .jar file info
-   * @param desc description to print out in header
-   *
-   * @return false if OK, true if any .jars were reported 
-   * as having errors
-   * @see #checkPathForJars(String, String[])
-   */
-  protected boolean logFoundJars(Vector v, String desc)
-  {
-
-    if ((null == v) || (v.size() < 1))
-      return false;
-
-    boolean errors = false;
-
-    logMsg("#---- BEGIN Listing XML-related jars in: " + desc + " ----");
-
-    for (int i = 0; i < v.size(); i++)
-    {
-      Hashtable subhash = (Hashtable) v.elementAt(i);
-
-      for (Enumeration enum = subhash.keys(); 
-           enum.hasMoreElements();
-           /* no increment portion */
-          )
-      {
-        Object key = enum.nextElement();
-        String keyStr = (String) key;
-        try
-        {
-          if (keyStr.startsWith(ERROR))
-          {
-            errors = true;
-          }
-          logMsg(keyStr + "=" + subhash.get(keyStr));
-
-        }
-        catch (Exception e)
-        {
-          errors = true;
-          logMsg("Reading-" + key + "= threw: " + e.toString());
-        }
-      }
-    }
-
-    logMsg("#----- END Listing XML-related jars in: " + desc + " -----");
-
-    return errors;
-  }
-
-  /**
-   * Stylesheet extension entrypoint: Dump a basic Xalan 
-   * environment report from getEnvironmentHash() to a Node.  
-   * 
-   * <p>Copy of writeEnvironmentReport that creates a Node suitable 
-   * for other processing instead of a properties-like text output.
-   * </p>
-   * @param container Node to append our report to
-   * @param factory Document providing createElement, etc. services
-   * @param h Hash presumably from {@link #getEnvironmentHash()}
-   * @see #writeEnvironmentReport(Hashtable)
-   * for an equivalent that writes to a PrintWriter instead
-   */
-  public void appendEnvironmentReport(Node container, Document factory, Hashtable h)
-  {
-    if ((null == container) || (null == factory))
-    {
-      return;
-    }
-  
-    try
-    {
-      Element envCheckNode = factory.createElement("EnvironmentCheck");
-      envCheckNode.setAttribute("version", "$Revision$");
-      container.appendChild(envCheckNode);
-
-      if (null == h)
-      {
-        Element statusNode = factory.createElement("status");
-        statusNode.setAttribute("result", "ERROR");
-        statusNode.appendChild(factory.createTextNode("appendEnvironmentReport called with null Hashtable!"));
-        envCheckNode.appendChild(statusNode);
-        return;
-      }
-
-      boolean errors = false;
-
-      Element hashNode = factory.createElement("environment");
-      envCheckNode.appendChild(hashNode);
-      
-      for (Enumeration enum = h.keys(); 
-           enum.hasMoreElements();
-          /* no increment portion */
-          )
-      {
-        Object key = enum.nextElement();
-        String keyStr = (String) key;
-        try
-        {
-          // Special processing for classes found..
-          if (keyStr.startsWith(FOUNDCLASSES))
-          {
-            Vector v = (Vector) h.get(keyStr);
-            // errors |= logFoundJars(v, keyStr);
-            errors |= appendFoundJars(hashNode, factory, v, keyStr);
-          }
-          // ..normal processing for all other entries
-          else 
-          {
-            // Note: we could just check for the ERROR key by itself, 
-            //    since we now set that, but since we have to go 
-            //    through the whole hash anyway, do it this way,
-            //    which is safer for maintenance
-            if (keyStr.startsWith(ERROR))
-            {
-              errors = true;
-            }
-            Element node = factory.createElement("item");
-            node.setAttribute("key", keyStr);
-            node.appendChild(factory.createTextNode((String)h.get(keyStr)));
-            hashNode.appendChild(node);
-          }
-        }
-        catch (Exception e)
-        {
-          errors = true;
-          Element node = factory.createElement("item");
-          node.setAttribute("key", keyStr);
-          node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString()));
-          hashNode.appendChild(node);
-        }
-      } // end of for...
-
-      Element statusNode = factory.createElement("status");
-      statusNode.setAttribute("result", (errors ? "ERROR" : "OK" ));
-      envCheckNode.appendChild(statusNode);
-    }
-    catch (Exception e2)
-    {
-      System.err.println("appendEnvironmentReport threw: " + e2.toString());
-      e2.printStackTrace();
-    }
-  }    
-
-  /**
-   * Print out report of .jars found in a classpath. 
-   *
-   * Takes the information encoded from a checkPathForJars() 
-   * call and dumps it out to our PrintWriter.
-   *
-   * @param container Node to append our report to
-   * @param factory Document providing createElement, etc. services
-   * @param v Vector of Hashtables of .jar file info
-   * @param desc description to print out in header
-   *
-   * @return false if OK, true if any .jars were reported 
-   * as having errors
-   * @see #checkPathForJars(String, String[])
-   */
-  protected boolean appendFoundJars(Node container, Document factory, 
-        Vector v, String desc)
-  {
-
-    if ((null == v) || (v.size() < 1))
-      return false;
-
-    boolean errors = false;
-
-    for (int i = 0; i < v.size(); i++)
-    {
-      Hashtable subhash = (Hashtable) v.elementAt(i);
-
-      for (Enumeration enum = subhash.keys(); 
-           enum.hasMoreElements();
-           /* no increment portion */
-          )
-      {
-        Object key = enum.nextElement();
-        try
-        {
-          String keyStr = (String) key;
-          if (keyStr.startsWith(ERROR))
-          {
-            errors = true;
-          }
-          Element node = factory.createElement("foundJar");
-          node.setAttribute("name", keyStr.substring(0, keyStr.indexOf("-")));
-          node.setAttribute("desc", keyStr.substring(keyStr.indexOf("-") + 1));
-          node.appendChild(factory.createTextNode((String)subhash.get(keyStr)));
-          container.appendChild(node);
-        }
-        catch (Exception e)
-        {
-          errors = true;
-          Element node = factory.createElement("foundJar");
-          node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString()));
-          container.appendChild(node);
-        }
-      }
-    }
-    return errors;
-  }
-
-  /**
-   * Fillin hash with info about SystemProperties.  
-   *
-   * Logs java.class.path and other likely paths; then attempts 
-   * to search those paths for .jar files with Xalan-related classes.
-   *
-   * //@todo NOTE: We don't actually search java.ext.dirs for 
-   * //  *.jar files therein! This should be updated
-   *
-   * @param h Hashtable to put information in
-   * @see #jarNames
-   * @see #checkPathForJars(String, String[])
-   */
-  protected void checkSystemProperties(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    // Grab java version for later use
-    try
-    {
-      String javaVersion = System.getProperty("java.version");
-
-      h.put("java.version", javaVersion);
-    }
-    catch (SecurityException se)
-    {
-
-      // For applet context, etc.
-      h.put(
-        "java.version",
-        "WARNING: SecurityException thrown accessing system version properties");
-    }
-
-    // Printout jar files on classpath(s) that may affect operation
-    //  Do this in order
-    try
-    {
-
-      // This is present in all JVM's
-      String cp = System.getProperty("java.class.path");
-
-      h.put("java.class.path", cp);
-
-      Vector classpathJars = checkPathForJars(cp, jarNames);
-
-      if (null != classpathJars)
-        h.put(FOUNDCLASSES + "java.class.path", classpathJars);
-
-      // Also check for JDK 1.2+ type classpaths
-      String othercp = System.getProperty("sun.boot.class.path");
-
-      if (null != othercp)
-      {
-        h.put("sun.boot.class.path", othercp);
-
-        classpathJars = checkPathForJars(othercp, jarNames);
-
-        if (null != classpathJars)
-          h.put(FOUNDCLASSES + "sun.boot.class.path", classpathJars);
-      }
-
-      //@todo NOTE: We don't actually search java.ext.dirs for 
-      //  *.jar files therein! This should be updated
-      othercp = System.getProperty("java.ext.dirs");
-
-      if (null != othercp)
-      {
-        h.put("java.ext.dirs", othercp);
-
-        classpathJars = checkPathForJars(othercp, jarNames);
-
-        if (null != classpathJars)
-          h.put(FOUNDCLASSES + "java.ext.dirs", classpathJars);
-      }
-
-      //@todo also check other System properties' paths?
-      //  v2 = checkPathForJars(System.getProperty("sun.boot.library.path"), jarNames);   // ?? may not be needed
-      //  v3 = checkPathForJars(System.getProperty("java.library.path"), jarNames);   // ?? may not be needed
-    }
-    catch (SecurityException se2)
-    {
-      // For applet context, etc.
-      h.put(
-        "java.class.path",
-        "WARNING: SecurityException thrown accessing system classpath properties");
-    }
-  }
-
-  /**
-   * Cheap-o listing of specified .jars found in the classpath. 
-   *
-   * cp should be separated by the usual File.pathSeparator.  We 
-   * then do a simplistic search of the path for any requested 
-   * .jar filenames, and return a listing of their names and 
-   * where (apparently) they came from.
-   *
-   * @param cp classpath to search
-   * @param jars array of .jar base filenames to look for
-   *
-   * @return Vector of Hashtables filled with info about found .jars
-   * @see #jarNames
-   * @see #logFoundJars(Vector, String)
-   * @see #appendFoundJars(Node, Document, Vector, String )
-   * @see #getApparentVersion(String, long)
-   */
-  protected Vector checkPathForJars(String cp, String[] jars)
-  {
-
-    if ((null == cp) || (null == jars) || (0 == cp.length())
-            || (0 == jars.length))
-      return null;
-
-    Vector v = new Vector();
-    StringTokenizer st = new StringTokenizer(cp, File.pathSeparator);
-
-    while (st.hasMoreTokens())
-    {
-
-      // Look at each classpath entry for each of our requested jarNames
-      String filename = st.nextToken().toLowerCase();
-
-      for (int i = 0; i < jars.length; i++)
-      {
-        if (filename.indexOf(jars[i]) > -1)
-        {
-          File f = new File(filename);
-
-          if (f.exists())
-          {
-
-            // If any requested jarName exists, report on 
-            //  the details of that .jar file
-            try
-            {
-              Hashtable h = new Hashtable(2);
-              // Note "-" char is looked for in appendFoundJars
-              h.put(jars[i] + "-path", f.getAbsolutePath());
-              h.put(jars[i] + "-apparent.version",
-                    getApparentVersion(jars[i], f.length()));
-              v.addElement(h);
-            }
-            catch (Exception e)
-            {
-
-              /* no-op, don't add it  */
-            }
-          }
-          else
-          {
-            Hashtable h = new Hashtable(2);
-            // Note "-" char is looked for in appendFoundJars
-            h.put(jars[i] + "-path", WARNING + " Classpath entry: " 
-                  + filename + " does not exist");
-            h.put(jars[i] + "-apparent.version", CLASS_NOTPRESENT);
-            v.addElement(h);
-          }
-        }
-      }
-    }
-
-    return v;
-  }
-
-  /**
-   * Cheap-o method to determine the product version of a .jar.   
-   *
-   * Currently does a lookup into a local table of some recent 
-   * shipped Xalan builds to determine where the .jar probably 
-   * came from.  Note that if you recompile Xalan or Xerces 
-   * yourself this will likely report a potential error, since 
-   * we can't certify builds other than the ones we ship.
-   * Only reports against selected posted Xalan-J builds.
-   *
-   * //@todo actually look up version info in manifests
-   *
-   * @param jarName base filename of the .jarfile
-   * @param jarSize size of the .jarfile
-   *
-   * @return String describing where the .jar file probably 
-   * came from
-   */
-  protected String getApparentVersion(String jarName, long jarSize)
-  {
-
-    // Lookup in a manual table of known .jar sizes; 
-    //  only includes shipped versions of certain projects
-    Hashtable jarVersions = new Hashtable();
-
-    // key=jarsize, value=jarname ' from ' distro name
-    // Note assumption: two jars cannot have the same size!
-    // Note: hackish Hashtable, this could use improvement
-    jarVersions.put(new Long(857192), "xalan.jar from xalan-j_1_1");
-    jarVersions.put(new Long(440237), "xalan.jar from xalan-j_1_2");
-    jarVersions.put(new Long(436094), "xalan.jar from xalan-j_1_2_1");
-    jarVersions.put(new Long(426249), "xalan.jar from xalan-j_1_2_2");
-    jarVersions.put(new Long(702536), "xalan.jar from xalan-j_2_0_0");
-    jarVersions.put(new Long(720930), "xalan.jar from xalan-j_2_0_1");
-    jarVersions.put(new Long(872241), "xalan.jar from xalan-j_2_2_D10");
-    jarVersions.put(new Long(857171), "xalan.jar from lotusxsl-j_1_0_1");
-    jarVersions.put(new Long(802165), "xalan.jar from lotusxsl-j_2_0_0");
-    jarVersions.put(new Long(857692), "xalan.jar from lotusxsl-j_2_2");
-    // If the below were more common I would update it to report 
-    //  errors better; but this is so old hardly anyone has it
-    jarVersions.put(new Long(424490), "xalan.jar from Xerces Tools releases - ERROR:DO NOT USE!");
-
-    jarVersions.put(new Long(1591855), "xerces.jar from xalan-j_1_1 from xerces-1...");
-    jarVersions.put(new Long(1498679), "xerces.jar from xalan-j_1_2 from xerces-1_2_0.bin");
-    jarVersions.put(new Long(1484896), "xerces.jar from xalan-j_1_2_1 from xerces-1_2_1.bin");
-    jarVersions.put(new Long(804460),  "xerces.jar from xalan-j_1_2_2 from xerces-1_2_2.bin");
-    jarVersions.put(new Long(1499244), "xerces.jar from xalan-j_2_0_0 from xerces-1_2_3.bin");
-    jarVersions.put(new Long(1605266), "xerces.jar from xalan-j_2_0_1 from xerces-1_3_0.bin");
-    jarVersions.put(new Long(1190776), "xerces.jar from lotusxsl_1_0_1 apparently-from xerces-1_0_3.bin");
-    jarVersions.put(new Long(1489400), "xerces.jar from lotusxsl-j_2_0_0 from XML4J-3_1_1");
-    jarVersions.put(new Long(1787796), "xerces.jar from lotusxsl-j_2_2 or xerces-1_4_1.bin");
-    jarVersions.put(new Long(904030), "xerces.jar from xerces-1_4_0.bin");
-    jarVersions.put(new Long(1802885), "xerces.jar from xerces-1_4_2.bin");
-    jarVersions.put(new Long(1808883), "xerces.jar from xalan-j_2_2_D10 or xerces-1_4_3.bin");
-    jarVersions.put(new Long(1803877), "xerces.jar from XML4J-3_2_1");
-
-    jarVersions.put(new Long(37485), "xalanj1compat.jar from xalan-j_2_0_0");
-    jarVersions.put(new Long(38100), "xalanj1compat.jar from xalan-j_2_0_1");
-
-    jarVersions.put(new Long(18779), "xalanservlet.jar from xalan-j_2_0_0");
-    jarVersions.put(new Long(21453), "xalanservlet.jar from xalan-j_2_0_1");
-
-    // For those who've downloaded JAXP from sun
-    jarVersions.put(new Long(5618), "jaxp.jar from jaxp1.0.1");
-    jarVersions.put(new Long(136133), "parser.jar from jaxp1.0.1");
-    jarVersions.put(new Long(28404), "jaxp.jar from jaxp-1.1");
-    jarVersions.put(new Long(187162), "crimson.jar from jaxp-1.1");
-    jarVersions.put(new Long(801714), "xalan.jar from jaxp-1.1");
-
-    // jakarta-ant: since many people use ant these days
-    jarVersions.put(new Long(5537), "jaxp.jar from jakarta-ant-1.3 or 1.2");
-    jarVersions.put(new Long(136198),
-                    "parser.jar from jakarta-ant-1.3 or 1.2");
-
-    // Various LotusXSL versions, which are based on Xalan code 
-    //  (LotusXSL was donated by Lotus to Apache to become Xalan)
-    jarVersions.put(new Long(120274), "lotusxsl.jar from lotusxsl-0_16_4");
-    jarVersions.put(new Long(120293), "lotusxsl.jar from lotusxsl-0_16_5");
-    jarVersions.put(new Long(283777), "lotusxsl.jar from lotusxsl-0_17_2");
-    jarVersions.put(new Long(305577), "lotusxsl.jar from lotusxsl-0_17_3");
-    jarVersions.put(new Long(304500), "lotusxsl.jar from lotusxsl-0_17_4");
-    jarVersions.put(new Long(714959), "lotusxsl.jar from lotusxsl-0_18_1");
-    jarVersions.put(new Long(717674), "lotusxsl.jar from lotusxsl-0_18_2");
-    jarVersions.put(new Long(752343), "lotusxsl.jar from lotusxsl-0_18_3");
-    jarVersions.put(new Long(907101), "lotusxsl.jar from lotusxsl-0_18_4");
-    
-
-    // If we found a matching size and it's for our 
-    //  jar, then return it's description
-    String foundSize = (String) jarVersions.get(new Long(jarSize));
-
-    if ((null != foundSize) && (foundSize.startsWith(jarName)))
-    {
-      return foundSize;
-    }
-    else
-    {
-      if ("xerces.jar".equalsIgnoreCase(jarName)
-              || "xalan.jar".equalsIgnoreCase(jarName))
-      {
-
-        // For xalan.jar and xerces.jar, which we ship together:
-        // The jar is not from a shipped copy of xalan-j, so 
-        //  it's up to the user to ensure that it's compatible
-        return jarName + " " + WARNING + CLASS_PRESENT;
-      }
-      else
-      {
-
-        // Otherwise, it's just a jar we don't have the version info calculated for
-        return jarName + " " + CLASS_PRESENT;
-      }
-    }
-  }
-
-  /**
-   * Report version information about JAXP interfaces.
-   *
-   * Currently distinguishes between JAXP 1.0.1 and JAXP 1.1, 
-   * and not found; only tests the interfaces, and does not 
-   * check for reference implementation versions.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkJAXPVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final Class noArgs[] = new Class[0];
-    Class clazz = null;
-
-    try
-    {
-      final String JAXP1_CLASS = "javax.xml.parsers.DocumentBuilder";
-      final String JAXP11_METHOD = "getDOMImplementation";
-
-      clazz = Class.forName(JAXP1_CLASS);
-
-      Method method = clazz.getMethod(JAXP11_METHOD, noArgs);
-
-      // If we succeeded, we at least have JAXP 1.1 available
-      h.put(VERSION + "JAXP", "1.1");
-    }
-    catch (Exception e)
-    {
-      if (null != clazz)
-      {
-
-        // We must have found the class itself, just not the 
-        //  method, so we (probably) have JAXP 1.0.1
-        h.put(ERROR + VERSION + "JAXP", "1.0.1");
-        h.put(ERROR, ERROR_FOUND);
-      }
-      else
-      {
-
-        // We couldn't even find the class, and don't have 
-        //  any JAXP support at all
-        h.put(ERROR + VERSION + "JAXP", CLASS_NOTPRESENT);
-        h.put(ERROR, ERROR_FOUND);
-      }
-    }
-  }
-
-  /**
-   * Report product version information from Xalan-J.
-   *
-   * Looks for version info in xalan.jar from Xalan-J products.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkProcessorVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    try
-    {
-      final String XALAN1_VERSION_CLASS =
-        "org.apache.xalan.xslt.XSLProcessorVersion";
-      Class clazz = Class.forName(XALAN1_VERSION_CLASS);
-
-      // Found Xalan-J 1.x, grab it's version fields
-      StringBuffer buf = new StringBuffer();
-      Field f = clazz.getField("PRODUCT");
-
-      buf.append(f.get(null));
-      buf.append(';');
-
-      f = clazz.getField("LANGUAGE");
-
-      buf.append(f.get(null));
-      buf.append(';');
-
-      f = clazz.getField("S_VERSION");
-
-      buf.append(f.get(null));
-      buf.append(';');
-      h.put(VERSION + "xalan1", buf.toString());
-    }
-    catch (Exception e1)
-    {
-      h.put(VERSION + "xalan1", CLASS_NOTPRESENT);
-    }
-
-    try
-    {
-      final String XALAN2_VERSION_CLASS =
-        "org.apache.xalan.processor.XSLProcessorVersion";
-      Class clazz = Class.forName(XALAN2_VERSION_CLASS);
-
-      // Found Xalan-J 2.x, grab it's version fields
-      StringBuffer buf = new StringBuffer();
-      Field f = clazz.getField("PRODUCT");
-
-      buf.append(f.get(null));
-      buf.append(";");
-
-      f = clazz.getField("LANGUAGE");
-
-      buf.append(f.get(null));
-      buf.append(";");
-
-      f = clazz.getField("S_VERSION");
-
-      buf.append(f.get(null));
-      buf.append(";");
-      h.put(VERSION + "xalan2", buf.toString());
-    }
-    catch (Exception e2)
-    {
-      h.put(VERSION + "xalan2", CLASS_NOTPRESENT);
-    }
-  }
-
-  /**
-   * Report product version information from common parsers.
-   *
-   * Looks for version info in xerces.jar/crimson.jar.
-   *
-   * //@todo actually look up version info in crimson manifest
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkParserVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final String XERCES1_VERSION_CLASS =
-      "org.apache.xerces.framework.Version";
-    final String XERCES2_VERSION_CLASS =
-      "org.apache.xerces.impl.Version";
-
-    try
-    {
-      Class clazz = Class.forName(XERCES1_VERSION_CLASS);
-
-      // Found Xerces-J 1.x, grab it's version fields
-      Field f = clazz.getField("fVersion");
-      String parserVersion = (String) f.get(null);
-
-      h.put(VERSION + "xerces", parserVersion);
-    }
-    catch (Exception e)
-    {
-      try
-      {
-        // Oops, no 1.x found, look for 2.x
-        Class clazz = Class.forName(XERCES2_VERSION_CLASS);
-
-        // Found Xerces-J 2.x, grab it's version fields
-        Field f = clazz.getField("fVersion");
-        String parserVersion = (String) f.get(null);
-
-        h.put(VERSION + "xerces", parserVersion);
-      }
-      catch (Exception e2)
-      {
-
-        // This isn't necessarily an error, since the user might 
-        //  be using some other parser
-        h.put(VERSION + "xerces", CLASS_NOTPRESENT);
-      }
-
-      // This isn't necessarily an error, since the user might 
-      //  be using some other parser
-      h.put(VERSION + "xerces", CLASS_NOTPRESENT);
-    }
-
-    try
-    {
-      final String CRIMSON_CLASS = "org.apache.crimson.Parser2";
-      Class clazz = Class.forName(CRIMSON_CLASS);
-
-      //@todo determine specific crimson version
-      h.put(VERSION + "crimson", CLASS_PRESENT);
-    }
-    catch (Exception e)
-    {
-      h.put(VERSION + "crimson", CLASS_NOTPRESENT);
-    }
-  }
-
-  /**
-   * Report version info from DOM interfaces. 
-   *
-   * Currently distinguishes between pre-DOM level 2, the DOM 
-   * level 2 working draft, the DOM level 2 final draft, 
-   * and not found.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkDOMVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final String DOM_LEVEL2_CLASS = "org.w3c.dom.Document";
-    final String DOM_LEVEL2_METHOD = "createElementNS";  // String, String
-    final String DOM_LEVEL2WD_CLASS = "org.w3c.dom.Node";
-    final String DOM_LEVEL2WD_METHOD = "supported";  // String, String
-    final String DOM_LEVEL2FD_CLASS = "org.w3c.dom.Node";
-    final String DOM_LEVEL2FD_METHOD = "isSupported";  // String, String
-    final Class twoStringArgs[] = { java.lang.String.class,
-                                    java.lang.String.class };
-
-    try
-    {
-      Class clazz = Class.forName(DOM_LEVEL2_CLASS);
-      Method method = clazz.getMethod(DOM_LEVEL2_METHOD, twoStringArgs);
-
-      // If we succeeded, we have loaded interfaces from a 
-      //  level 2 DOM somewhere
-      h.put(VERSION + "DOM", "2.0");
-
-      try
-      {
-
-        // Check for the working draft version, which is 
-        //  commonly found, but won't work anymore
-        clazz = Class.forName(DOM_LEVEL2WD_CLASS);
-        method = clazz.getMethod(DOM_LEVEL2WD_METHOD, twoStringArgs);
-
-        h.put(ERROR + VERSION + "DOM.draftlevel", "2.0wd");
-        h.put(ERROR, ERROR_FOUND);
-      }
-      catch (Exception e2)
-      {
-        try
-        {
-
-          // Check for the final draft version as well
-          clazz = Class.forName(DOM_LEVEL2FD_CLASS);
-          method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs);
-
-          h.put(VERSION + "DOM.draftlevel", "2.0fd");
-        }
-        catch (Exception e3)
-        {
-          h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown");
-          h.put(ERROR, ERROR_FOUND);
-        }
-      }
-    }
-    catch (Exception e)
-    {
-      h.put(ERROR + VERSION + "DOM",
-            "ERROR attempting to load DOM level 2 class: " + e.toString());
-      h.put(ERROR, ERROR_FOUND);
-    }
-
-    //@todo load an actual DOM implmementation and query it as well
-    //@todo load an actual DOM implmementation and check if 
-    //  isNamespaceAware() == true, which is needed to parse 
-    //  xsl stylesheet files into a DOM
-  }
-
-  /**
-   * Report version info from SAX interfaces. 
-   *
-   * Currently distinguishes between SAX 2, SAX 2.0beta2, 
-   * SAX1, and not found.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkSAXVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final String SAX_VERSION1_CLASS = "org.xml.sax.Parser";
-    final String SAX_VERSION1_METHOD = "parse";  // String
-    final String SAX_VERSION2_CLASS = "org.xml.sax.XMLReader";
-    final String SAX_VERSION2_METHOD = "parse";  // String
-    final String SAX_VERSION2BETA_CLASSNF = "org.xml.sax.helpers.AttributesImpl";
-    final String SAX_VERSION2BETA_METHODNF = "setAttributes";  // Attributes
-    final Class oneStringArg[] = { java.lang.String.class };
-    // Note this introduces a minor dependency on SAX...
-    final Class attributesArg[] = { org.xml.sax.Attributes.class };
-
-    try
-    {
-      // This method was only added in the final SAX 2.0 release; 
-      //  see changes.html "Changes from SAX 2.0beta2 to SAX 2.0prerelease"
-      Class clazz = Class.forName(SAX_VERSION2BETA_CLASSNF);
-      Method method = clazz.getMethod(SAX_VERSION2BETA_METHODNF, attributesArg);
-
-      // If we succeeded, we have loaded interfaces from a 
-      //  real, final SAX version 2.0 somewhere
-      h.put(VERSION + "SAX", "2.0");
-    }
-    catch (Exception e)
-    {
-      // If we didn't find the SAX 2.0 class, look for a 2.0beta2
-      h.put(ERROR + VERSION + "SAX",
-            "ERROR attempting to load SAX version 2 class: " + e.toString());
-      h.put(ERROR, ERROR_FOUND);
-            
-      try
-      {
-        Class clazz = Class.forName(SAX_VERSION2_CLASS);
-        Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg);
-
-        // If we succeeded, we have loaded interfaces from a 
-        //  SAX version 2.0beta2 or earlier; these might work but 
-        //  you should really have the final SAX 2.0 
-        h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier");
-      }
-      catch (Exception e2)
-      {
-        // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one
-        h.put(ERROR + VERSION + "SAX",
-              "ERROR attempting to load SAX version 2 class: " + e.toString());
-        h.put(ERROR, ERROR_FOUND);
-          
-        try
-        {
-          Class clazz = Class.forName(SAX_VERSION1_CLASS);
-          Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg);
-
-          // If we succeeded, we have loaded interfaces from a 
-          //  SAX version 1.0 somewhere; which won't work very 
-          //  well for JAXP 1.1 or beyond!
-          h.put(VERSION + "SAX-backlevel", "1.0");
-        }
-        catch (Exception e3)
-        {
-          // If we didn't find the SAX 2.0 class, look for a 1.0 one
-          // Note that either 1.0 or no SAX are both errors
-          h.put(ERROR + VERSION + "SAX-backlevel",
-                "ERROR attempting to load SAX version 1 class: " + e3.toString());
-            
-        }
-      }
-    }
-  }
-
-  /** Simple PrintWriter we send output to; defaults to System.out.  */
-  protected PrintWriter outWriter = new PrintWriter(System.out, true);
-
-  /**
-   * Bottleneck output: calls outWriter.println(s).  
-   * @param s String to print
-   */
-  protected void logMsg(String s)
-  {
-    outWriter.println(s);
-  }
-}
diff --git a/src/org/apache/xalan/xslt/Process.java b/src/org/apache/xalan/xslt/Process.java
deleted file mode 100644
index 84bd25d..0000000
--- a/src/org/apache/xalan/xslt/Process.java
+++ /dev/null
@@ -1,957 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xalan.xslt;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.InputStream;
-import java.io.BufferedInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.StringReader;
-
-import java.lang.reflect.Constructor;
-
-import java.util.TooManyListenersException;
-import java.util.Vector;
-import java.util.Properties;
-import java.util.Enumeration;
-import java.util.Date;
-
-// Needed Xalan classes
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.processor.XSLProcessorVersion;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.transformer.XalanProperties;
-import org.apache.xalan.processor.TransformerFactoryImpl;
-import org.apache.xalan.trace.PrintTraceListener;
-import org.apache.xalan.trace.TraceListener;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xml.utils.DefaultErrorHandler;
-
-// Needed TRaX classes
-import javax.xml.transform.Result;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.sax.*;
-import javax.xml.parsers.*;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-// Needed Serializer classes
-import org.apache.xalan.serialize.Serializer;
-import org.apache.xalan.serialize.SerializerFactory;
-
-/**
- * <meta name="usage" content="general"/>
- * The main() method handles the Xalan command-line interface.
- */
-public class Process
-{
-
-  /**
-   * Prints argument options.
-   *
-   * @param resbundle Resource bundle
-   */
-  protected static void printArgOptions(XSLTErrorResources resbundle)
-  {
-
-    System.out.println(resbundle.getString("xslProc_option"));  //"xslproc options: ");
-    System.out.println(resbundle.getString("optionIN"));  //"    -IN inputXMLURL");
-    System.out.println(resbundle.getString("optionXSL"));  //"   [-XSL XSLTransformationURL]");
-    System.out.println(resbundle.getString("optionOUT"));  //"   [-OUT outputFileName]");
-
-    // System.out.println(resbundle.getString("optionE")); //"   [-E (Do not expand entity refs)]");
-    System.out.println(resbundle.getString("optionV"));  //"   [-V (Version info)]");
-    System.out.println(resbundle.getString("optionQC"));  //"   [-QC (Quiet Pattern Conflicts Warnings)]");
-
-    // System.out.println(resbundle.getString("optionQ"));  //"   [-Q  (Quiet Mode)]"); // sc 28-Feb-01 commented out
-    System.out.println(resbundle.getString("optionTT"));  //"   [-TT (Trace the templates as they are being called.)]");
-    System.out.println(resbundle.getString("optionTG"));  //"   [-TG (Trace each generation event.)]");
-    System.out.println(resbundle.getString("optionTS"));  //"   [-TS (Trace each selection event.)]");
-    System.out.println(resbundle.getString("optionTTC"));  //"   [-TTC (Trace the template children as they are being processed.)]");
-    System.out.println(resbundle.getString("optionTCLASS"));  //"   [-TCLASS (TraceListener class for trace extensions.)]");
-
-    // System.out.println(resbundle.getString("optionVALIDATE")); //"   [-VALIDATE (Set whether validation occurs.  Validation is off by default.)]");
-    System.out.println(resbundle.getString("optionEDUMP"));  //"   [-EDUMP {optional filename} (Do stackdump on error.)]");
-    System.out.println(resbundle.getString("optionXML"));  //"   [-XML (Use XML formatter and add XML header.)]");
-    System.out.println(resbundle.getString("optionTEXT"));  //"   [-TEXT (Use simple Text formatter.)]");
-    System.out.println(resbundle.getString("optionHTML"));  //"   [-HTML (Use HTML formatter.)]");
-    System.out.println(resbundle.getString("optionPARAM"));  //"   [-PARAM name expression (Set a stylesheet parameter)]");
-    System.out.println(resbundle.getString("optionLINENUMBERS")); //"   [-L use line numbers]"
-    
-    // sc 28-Feb-01 these below should really be added as resources
-    System.out.println(
-      "   [-MEDIA mediaType (use media attribute to find stylesheet associated with a document.)]");
-    System.out.println(
-      "   [-FLAVOR flavorName (Explicitly use s2s=SAX or d2d=DOM to do transform.)]");  // Added by sboag/scurcuru; experimental
-    System.out.println(
-      "   [-DIAG (Print overall milliseconds transform took.)]");
-    System.out.println(resbundle.getString("optionURIRESOLVER"));  //"   [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]");
-    System.out.println(resbundle.getString("optionENTITYRESOLVER"));  //"   [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]");
-    System.out.println(resbundle.getString("optionCONTENTHANDLER"));  //"   [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]");
-  }
-  
-  /**
-   * Command line interface to transform an XML document according to
-   * the instructions found in an XSL stylesheet.  
-   * <p>The Process class provides basic functionality for 
-   * performing transformations from the command line.  To see a 
-   * list of arguments supported, call with zero arguments.</p>
-   * <p>To set stylesheet parameters from the command line, use 
-   * <code>-PARAM name expression</code>. If you want to set the 
-   * parameter to a string value, simply pass the string value 
-   * as-is, and it will be interpreted as a string.  (Note: if 
-   * the value has spaces in it, you may need to quote it depending 
-   * on your shell environment).</p>
-   *
-   * @param argv Input parameters from command line
-   */
-  public static void main(String argv[])
-  {
-    
-    // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off
-    boolean doStackDumpOnError = false;
-    boolean setQuietMode = false;
-    boolean doDiag = false;
-
-    // Runtime.getRuntime().traceMethodCalls(false);
-    // Runtime.getRuntime().traceInstructions(false);
-
-    /**
-     * The default diagnostic writer...
-     */
-    java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true);
-    java.io.PrintWriter dumpWriter = diagnosticsWriter;
-    XSLTErrorResources resbundle =
-      (XSLTErrorResources) (XSLMessages.loadResourceBundle(
-        org.apache.xml.utils.res.XResourceBundle.ERROR_RESOURCES));
-    String flavor = "s2s";
-
-    if (argv.length < 1)
-    {
-      printArgOptions(resbundle);
-    }
-    else
-    {
-      TransformerFactory tfactory;
-
-      try
-      {
-        tfactory = TransformerFactory.newInstance();
-      }
-      catch (TransformerFactoryConfigurationError pfe)
-      {
-        pfe.printStackTrace(dumpWriter);
-        diagnosticsWriter.println(
-          XSLMessages.createMessage(
-            XSLTErrorResources.ER_NOT_SUCCESSFUL, null));  //"XSL Process was not successful.");
-
-        tfactory = null;  // shut up compiler
-
-        doExit(-1);
-      }
-
-      boolean formatOutput = false;
-      boolean useSourceLocation = false;
-      String inFileName = null;
-      String outFileName = null;
-      String dumpFileName = null;
-      String xslFileName = null;
-      String treedumpFileName = null;
-      PrintTraceListener tracer = null;
-      String outputType = null;
-      String media = null;
-      Vector params = new Vector();
-      boolean quietConflictWarnings = false;
-      URIResolver uriResolver = null;
-      EntityResolver entityResolver = null;
-      ContentHandler contentHandler = null;
-
-      for (int i = 0; i < argv.length; i++)
-      {
-        if ("-TT".equalsIgnoreCase(argv[i]))
-        {
-          if (null == tracer)
-            tracer = new PrintTraceListener(diagnosticsWriter);
-
-          tracer.m_traceTemplates = true;
-
-          // tfactory.setTraceTemplates(true);
-        }
-        else if ("-TG".equalsIgnoreCase(argv[i]))
-        {
-          if (null == tracer)
-            tracer = new PrintTraceListener(diagnosticsWriter);
-
-          tracer.m_traceGeneration = true;
-
-          // tfactory.setTraceSelect(true);
-        }
-        else if ("-TS".equalsIgnoreCase(argv[i]))
-        {
-          if (null == tracer)
-            tracer = new PrintTraceListener(diagnosticsWriter);
-
-          tracer.m_traceSelection = true;
-
-          // tfactory.setTraceTemplates(true);
-        }
-        else if ("-TTC".equalsIgnoreCase(argv[i]))
-        {
-          if (null == tracer)
-            tracer = new PrintTraceListener(diagnosticsWriter);
-
-          tracer.m_traceElements = true;
-
-          // tfactory.setTraceTemplateChildren(true);
-        }
-        else if ("-INDENT".equalsIgnoreCase(argv[i]))
-        {
-          int indentAmount;
-
-          if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-'))
-          {
-            indentAmount = Integer.parseInt(argv[++i]);
-          }
-          else
-          {
-            indentAmount = 0;
-          }
-
-          // TBD:
-          // xmlProcessorLiaison.setIndent(indentAmount);
-        }
-        else if ("-IN".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-            inFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-IN" }));  //"Missing argument for);
-        }
-        else if ("-MEDIA".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-            media = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-MEDIA" }));  //"Missing argument for);
-        }
-        else if ("-OUT".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-            outFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-OUT" }));  //"Missing argument for);
-        }
-        else if ("-XSL".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-            xslFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-XSL" }));  //"Missing argument for);
-        }
-        else if ("-FLAVOR".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            flavor = argv[++i];
-          }
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-FLAVOR" }));  //"Missing argument for);
-        }
-        else if ("-PARAM".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 2 < argv.length)
-          {
-            String name = argv[++i];
-
-            params.addElement(name);
-
-            String expression = argv[++i];
-
-            params.addElement(expression);
-          }
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-PARAM" }));  //"Missing argument for);
-        }
-        else if ("-treedump".equalsIgnoreCase(argv[i]))  // sc 28-Feb-01 appears to be unused; can we remove?
-        {
-          if (i + 1 < argv.length)
-            treedumpFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-treedump" }));  //"Missing argument for);
-        }
-        else if ("-F".equalsIgnoreCase(argv[i]))  // sc 28-Feb-01 appears to be unused; can we remove?
-        {
-          formatOutput = true;
-        }
-        else if ("-E".equalsIgnoreCase(argv[i]))
-        {
-
-          // TBD:
-          // xmlProcessorLiaison.setShouldExpandEntityRefs(false);
-        }
-        else if ("-V".equalsIgnoreCase(argv[i]))
-        {
-          diagnosticsWriter.println(resbundle.getString("version")  //">>>>>>> Xalan Version "
-                                    + XSLProcessorVersion.S_VERSION + ", " +
-
-          /* xmlProcessorLiaison.getParserDescription()+ */
-          resbundle.getString("version2"));  // "<<<<<<<");
-        }
-        else if ("-QC".equalsIgnoreCase(argv[i]))
-        {
-          quietConflictWarnings = true;
-        }
-        else if ("-Q".equalsIgnoreCase(argv[i]))
-        {
-          setQuietMode = true;
-        }
-
-        /*
-        else if("-VALIDATE".equalsIgnoreCase(argv[i]))
-        {
-          String shouldValidate;
-          if(((i+1) < argv.length) && (argv[i+1].charAt(0) != '-'))
-          {
-            shouldValidate = argv[++i];
-          }
-          else
-          {
-            shouldValidate = "yes";
-          }
-
-          // xmlProcessorLiaison.setUseValidation(shouldValidate.equalsIgnoreCase("yes"));
-        }
-        */
-        else if ("-DIAG".equalsIgnoreCase(argv[i]))
-        {
-          doDiag = true;
-        }
-        else if ("-XML".equalsIgnoreCase(argv[i]))
-        {
-          outputType = "xml";
-        }
-        else if ("-TEXT".equalsIgnoreCase(argv[i]))
-        {
-          outputType = "text";
-        }
-        else if ("-HTML".equalsIgnoreCase(argv[i]))
-        {
-          outputType = "html";
-        }
-        else if ("-EDUMP".equalsIgnoreCase(argv[i]))
-        {
-          doStackDumpOnError = true;
-
-          if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-'))
-          {
-            dumpFileName = argv[++i];
-          }
-        }
-        else if ("-URIRESOLVER".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            try
-            {
-              uriResolver =
-                (URIResolver) Class.forName(argv[++i]).newInstance();
-
-              tfactory.setURIResolver(uriResolver);
-            }
-            catch (Exception cnfe)
-            {
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
-                  new Object[]{ "-URIResolver" }));
-              doExit(-1);
-            }
-          }
-          else
-          {
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-URIResolver" }));  //"Missing argument for);
-            doExit(-1);
-          }
-        }
-        else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            try
-            {
-              entityResolver =
-                (EntityResolver) Class.forName(argv[++i]).newInstance();
-            }
-            catch (Exception cnfe)
-            {
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
-                  new Object[]{ "-EntityResolver" }));
-              doExit(-1);
-            }
-          }
-          else
-          {
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-EntityResolver" }));  //"Missing argument for);
-            doExit(-1);
-          }
-        }
-        else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            try
-            {
-              contentHandler =
-                (ContentHandler) Class.forName(argv[++i]).newInstance();
-            }
-            catch (Exception cnfe)
-            {
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
-                  new Object[]{ "-ContentHandler" }));
-              doExit(-1);
-            }
-          }
-          else
-          {
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-ContentHandler" }));  //"Missing argument for);
-            doExit(-1);
-          }
-        }
-        else if ("-L".equalsIgnoreCase(argv[i]))
-          useSourceLocation = true;
-        else
-          System.err.println(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] }));  //"Invalid argument:);
-      }
-
-      // Note that there are usage cases for calling us without a -IN arg
-      // The main XSL transformation occurs here!
-      try
-      {
-        long start = System.currentTimeMillis();
-
-        if (null != dumpFileName)
-        {
-          dumpWriter = new PrintWriter(new FileWriter(dumpFileName));
-        }
-
-        Templates stylesheet = null;
-
-        if (null != xslFileName)
-        {
-          if (flavor.equals("d2d"))
-          {
-
-            // Parse in the xml data into a DOM
-            DocumentBuilderFactory dfactory =
-              DocumentBuilderFactory.newInstance();
-
-            dfactory.setNamespaceAware(true);
-
-            DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-            Node xslDOM = docBuilder.parse(new InputSource(xslFileName));
-
-            stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
-                    xslFileName));
-          }
-          else
-          {
-            // System.out.println("Calling newTemplates: "+xslFileName);
-            stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
-            // System.out.println("Done calling newTemplates: "+xslFileName);
-          }
-        }
-
-        PrintWriter resultWriter;
-        StreamResult strResult;
-
-        if (null != outFileName)
-        {
-          strResult = new StreamResult(new FileOutputStream(outFileName));
-        }
-        else
-        {
-          strResult = new StreamResult(System.out);
-          tfactory.setAttribute(
-           org.apache.xalan.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL
-           , Boolean.TRUE);
-        }
-
-        SAXTransformerFactory stf = (SAXTransformerFactory) tfactory;
-
-        // Did they pass in a stylesheet, or should we get it from the 
-        // document?
-        if (null == stylesheet)
-        {
-          Source source =
-            stf.getAssociatedStylesheet(new StreamSource(inFileName), media,
-                                        null, null);
-
-          if (null != source)
-            stylesheet = tfactory.newTemplates(source);
-          else
-          {
-            if (null != media)
-              throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: "
-                                            // + inFileName + ", media="
-                                            // + media);
-            else
-              throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: "
-                                             //+ inFileName);
-          }
-        }
-
-        if (null != stylesheet)
-        {
-          Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
-
-          // Override the output format?
-          if (null != outputType)
-          {
-            transformer.setOutputProperty(OutputKeys.METHOD, outputType);
-          }
-
-          if (transformer instanceof TransformerImpl)
-          {
-            TransformerImpl impl = ((TransformerImpl) transformer);
-            TraceManager tm = impl.getTraceManager();
-
-            if (null != tracer)
-              tm.addTraceListener(tracer);
-
-            impl.setQuietConflictWarnings(quietConflictWarnings);
-
-            if (useSourceLocation)
-              impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
-
-            // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions
-            // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter );
-          }
-
-          int nParams = params.size();
-
-          for (int i = 0; i < nParams; i += 2)
-          {
-            transformer.setParameter((String) params.elementAt(i),
-                                     (String) params.elementAt(i + 1));
-          }
-
-          if (uriResolver != null)
-            transformer.setURIResolver(uriResolver);
-
-          if (null != inFileName)
-          {
-            if (flavor.equals("d2d"))
-            {
-
-              // Parse in the xml data into a DOM
-              DocumentBuilderFactory dfactory =
-                DocumentBuilderFactory.newInstance();
-
-              dfactory.setCoalescing(true);
-              dfactory.setNamespaceAware(true);
-
-              DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-
-              if (entityResolver != null)
-                docBuilder.setEntityResolver(entityResolver);
-
-              Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
-              Document doc = docBuilder.newDocument();
-              org.w3c.dom.DocumentFragment outNode =
-                doc.createDocumentFragment();
-
-              transformer.transform(new DOMSource(xmlDoc, inFileName),
-                                    new DOMResult(outNode));
-
-              // Now serialize output to disk with identity transformer
-              Transformer serializer = stf.newTransformer();
-              Properties serializationProps =
-                stylesheet.getOutputProperties();
-
-              serializer.setOutputProperties(serializationProps);
-
-              if (contentHandler != null)
-              {
-                SAXResult result = new SAXResult(contentHandler);
-
-                serializer.transform(new DOMSource(outNode), result);
-              }
-              else
-                serializer.transform(new DOMSource(outNode), strResult);
-            }
-            else if (flavor.equals("th"))
-            {
-              for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior
-              {
-              // System.out.println("Testing the TransformerHandler...");
-
-              // ===============
-              XMLReader reader = null;
-
-              // Use JAXP1.1 ( if possible )      
-              try
-              {
-                javax.xml.parsers.SAXParserFactory factory =
-                  javax.xml.parsers.SAXParserFactory.newInstance();
-
-                factory.setNamespaceAware(true);
-
-                javax.xml.parsers.SAXParser jaxpParser =
-                  factory.newSAXParser();
-
-                reader = jaxpParser.getXMLReader();
-              }
-              catch (javax.xml.parsers.ParserConfigurationException ex)
-              {
-                throw new org.xml.sax.SAXException(ex);
-              }
-              catch (javax.xml.parsers.FactoryConfigurationError ex1)
-              {
-                throw new org.xml.sax.SAXException(ex1.toString());
-              }
-              catch (NoSuchMethodError ex2){}
-              catch (AbstractMethodError ame){}
-
-              if (null == reader)
-              {
-                reader = XMLReaderFactory.createXMLReader();
-              }
-              
-              stf.setAttribute(org.apache.xalan.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL, 
-                 Boolean.TRUE);
-                 
-              TransformerHandler th = stf.newTransformerHandler(stylesheet);
-              
-              reader.setContentHandler(th);
-              reader.setDTDHandler(th);
-              
-              if(th instanceof org.xml.sax.ErrorHandler)
-                reader.setErrorHandler((org.xml.sax.ErrorHandler)th);
-              
-              try
-              {
-                reader.setProperty(
-                  "http://xml.org/sax/properties/lexical-handler", th);
-              }
-              catch (org.xml.sax.SAXNotRecognizedException e){}
-              catch (org.xml.sax.SAXNotSupportedException e){}
-              try
-              {
-                reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                                  true);
-              } catch (org.xml.sax.SAXException se) {}
-        
-              try
-              {
-                reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-                                  true);
-              } catch (org.xml.sax.SAXException se) {}
-              
-              th.setResult(strResult);
-              
-              // System.out.println("sending parse events to the handler...");
-              // for (int i = 0; i < 50; i++) 
-              {
-// System.out.print(".");
-// if((i % 50) == 0)
-//   System.out.println("");
-                reader.parse(new InputSource(inFileName));
-                // Transformer t = ((org.apache.xalan.transformer.TransformerHandlerImpl)th).getTransformer();
-                // System.err.println("Calling reset");
-                // ((TransformerImpl)t).reset();
-              }
-              
-              
-
-//              if (contentHandler != null)
-//              {
-//                SAXResult result = new SAXResult(contentHandler);
-//
-//                transformer.transform(
-//                  new SAXSource(reader, new InputSource(inFileName)), result);
-//              }
-//              else
-//              {
-//                transformer.transform(
-//                  new SAXSource(reader, new InputSource(inFileName)),
-//                  strResult);
-//              }
-
-              // ===============
-              }
-            }
-            else
-            {
-              if (entityResolver != null)
-              {
-                XMLReader reader = null;
-
-                // Use JAXP1.1 ( if possible )      
-                try
-                {
-                  javax.xml.parsers.SAXParserFactory factory =
-                    javax.xml.parsers.SAXParserFactory.newInstance();
-
-                  factory.setNamespaceAware(true);
-
-                  javax.xml.parsers.SAXParser jaxpParser =
-                    factory.newSAXParser();
-
-                  reader = jaxpParser.getXMLReader();
-                }
-                catch (javax.xml.parsers.ParserConfigurationException ex)
-                {
-                  throw new org.xml.sax.SAXException(ex);
-                }
-                catch (javax.xml.parsers.FactoryConfigurationError ex1)
-                {
-                  throw new org.xml.sax.SAXException(ex1.toString());
-                }
-                catch (NoSuchMethodError ex2){}
-                catch (AbstractMethodError ame){}
-
-                if (null == reader)
-                {
-                  reader = XMLReaderFactory.createXMLReader();
-                }
-
-                reader.setEntityResolver(entityResolver);
-
-                if (contentHandler != null)
-                {
-                  SAXResult result = new SAXResult(contentHandler);
-
-                  transformer.transform(
-                    new SAXSource(reader, new InputSource(inFileName)),
-                    result);
-                }
-                else
-                {
-                  transformer.transform(
-                    new SAXSource(reader, new InputSource(inFileName)),
-                    strResult);
-                }
-              }
-              else if (contentHandler != null)
-              {
-                SAXResult result = new SAXResult(contentHandler);
-
-                transformer.transform(new StreamSource(inFileName), result);
-              }
-              else
-              {
-                // System.out.println("Starting transform");
-                transformer.transform(new StreamSource(inFileName),
-                                      strResult);
-                // System.out.println("Done with transform");
-              }
-            }
-          }
-          else
-          {
-            StringReader reader =
-              new StringReader("<?xml version=\"1.0\"?> <doc/>");
-
-            transformer.transform(new StreamSource(reader), strResult);
-          }
-        }
-        else
-        {
-          diagnosticsWriter.println(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_NOT_SUCCESSFUL, null));  //"XSL Process was not successful.");
-          doExit(-1);
-        }
-
-        long stop = System.currentTimeMillis();
-        long millisecondsDuration = stop - start;
-
-        if (doDiag)
-          diagnosticsWriter.println("\n\n========\nTransform of "
-                                    + inFileName + " via " + xslFileName
-                                    + " took " + millisecondsDuration
-                                    + " ms");
-      }
-      catch (Throwable throwable)
-      {
-        while (throwable
-               instanceof org.apache.xml.utils.WrappedRuntimeException)
-        {
-          throwable =
-            ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException();
-        }
-
-        if ((throwable instanceof NullPointerException)
-                || (throwable instanceof ClassCastException))
-          doStackDumpOnError = true;
-
-        diagnosticsWriter.println();
-
-        if (doStackDumpOnError)
-          throwable.printStackTrace(dumpWriter);
-        else
-        {
-          DefaultErrorHandler.printLocation(diagnosticsWriter, throwable);
-          diagnosticsWriter.println(
-            XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null)
-            + " (" + throwable.getClass().getName() + "): "
-            + throwable.getMessage());
-        }
-
-        // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful.");
-        if (null != dumpFileName)
-        {
-          dumpWriter.close();
-        }
-
-        doExit(-1);
-      }
-
-      if (null != dumpFileName)
-      {
-        dumpWriter.close();
-      }
-
-      if (null != diagnosticsWriter)
-      {
-
-        // diagnosticsWriter.close();
-      }
-
-      // if(!setQuietMode)
-      //  diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done");
-      // else
-      diagnosticsWriter.println("");  //"Xalan: done");
-    }
-  }
-  
-  /** It is _much_ easier to debug under VJ++ if I can set a single breakpoint 
-   * before this blows itself out of the water...
-   * (I keep checking this in, it keeps vanishing. Grr!)
-   * */
-  static void doExit(int i)
-  {
-          System.exit(i);
-  }
-}
diff --git a/src/org/apache/xalan/xslt/package.html b/src/org/apache/xalan/xslt/package.html
deleted file mode 100644
index 2686996..0000000
--- a/src/org/apache/xalan/xslt/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>Xalan command-line interface.</title>
-  <body>
-    <p>Implementation of Xalan command-line interface.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xalan/xsltc/DOM.java b/src/org/apache/xalan/xsltc/DOM.java
deleted file mode 100644
index 6e0ca8d..0000000
--- a/src/org/apache/xalan/xsltc/DOM.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public interface DOM {
-    public final static int  FIRST_TYPE             = 0;
-
-    public final static int  NO_TYPE                = -1;
-    public final static int  ROOT                   = 0;
-    public final static int  TEXT                   = 1;
-    public final static int  UNUSED                 = 2;
-    public final static int  ELEMENT                = 3;
-    public final static int  ATTRIBUTE              = 4;
-    public final static int  PROCESSING_INSTRUCTION = 5;
-    public final static int  COMMENT                = 6;
-	
-    public final static int  NTYPES                 = 7;
-    
-    // 0 is reserved for NodeIterator.END
-    public final static int NULL     = 0;
-    // index of root node
-    public final static int ROOTNODE = 1;
-    
-    /** returns singleton iterator containg the document root */
-    public NodeIterator getIterator();
-    public String getStringValue();
-	
-    public NodeIterator getChildren(final int node);
-    public NodeIterator getTypedChildren(final int type);
-    public NodeIterator getAxisIterator(final int axis);
-    public NodeIterator getTypedAxisIterator(final int axis, final int type);
-    public NodeIterator getNthDescendant(int node, int n);
-    public NodeIterator getNamespaceAxisIterator(final int axis, final int ns);
-    public NodeIterator getNodeValueIterator(NodeIterator iter,
-					     String value, boolean op);
-    public NodeIterator orderNodes(NodeIterator source, int node);
-    public String getNodeName(final int node);
-    public String getNamespaceName(final int node);
-    public int getType(final int node);
-    public int getNamespaceType(final int node);
-    public int getParent(final int node);
-    public int getAttributeNode(final int gType, final int element);
-    public String getNodeValue(final int node);
-    public void copy(final int node, TransletOutputHandler handler)
-	throws TransletException;
-    public void copy(NodeIterator nodes, TransletOutputHandler handler)
-	throws TransletException;
-    public String shallowCopy(final int node, TransletOutputHandler handler)
-	throws TransletException;
-    public boolean lessThan(final int node1, final int node2);
-    public void characters(final int textNode, TransletOutputHandler handler)
-	throws TransletException;
-    public Node makeNode(int index);
-    public Node makeNode(NodeIterator iter);
-    public NodeList makeNodeList(int index);
-    public NodeList makeNodeList(NodeIterator iter);
-    public String getLanguage(int node);
-    public int getSize();
-    public String getDocumentURI(int node);
-    public int getTypedPosition(NodeIterator iterator, int type, int node);
-    public int getTypedLast(NodeIterator iterator, int type, int node);
-    public void setFilter(StripFilter filter);
-    public void setupMapping(String[] names, String[] namespaces);
-}
diff --git a/src/org/apache/xalan/xsltc/DOMCache.java b/src/org/apache/xalan/xsltc/DOMCache.java
deleted file mode 100644
index 6bc1406..0000000
--- a/src/org/apache/xalan/xsltc/DOMCache.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-
-public interface DOMCache {
-
-    /**
-     * This method is responsible for:
-     *
-     * (1) building the DOMImpl tree
-     *  
-     *      Parser  _parser = new Parser();
-     *      DOMImpl _dom = new DOMImpl();
-     *      _parser.setDocumentHandler(_dom.getBuilder());
-     *      _parser.parse(uri);
-     *
-     * (2) building indicies for all ID elements (declared in DTD):
-     *
-     *      DTDMonitor _dtdMonitor = new DTDMonitor();
-     *      _parser.setDTDHandler(_dtdMonitor);
-     *      translet.setIndexSize(dom.getSize());
-     *      dtd.buildIdIndex(dom, mask, translet);
-     *
-     * (3) passing unparsed entity URI elements from DTD to translet:
-     *
-     *      translet.setUnparsedEntityURIs(dtd.getUnparsedEntityURIs());
-     *
-     * (4) setting the document URI:
-     *
-     *      _dom.setDocumentURI(uri);
-     */
-    public DOMImpl retrieveDocument(String uri, int mask, Translet translet);
-
-}
diff --git a/src/org/apache/xalan/xsltc/NodeIterator.java b/src/org/apache/xalan/xsltc/NodeIterator.java
deleted file mode 100644
index bf305ad..0000000
--- a/src/org/apache/xalan/xsltc/NodeIterator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-public interface NodeIterator extends Cloneable {
-    public static final int END = DOM.NULL;
-
-    /** 
-     * Callers should not call next() after it returns END.
-     */
-    public int next();
-
-    /**
-     * Resets the iterator to the last start node.
-     */
-    public NodeIterator reset();
-
-    /**
-     * Returns the number of elements in this iterator.
-     */
-    public int getLast();
-
-    /**
-     * Returns the position of the current node in the set.
-     */
-    public int getPosition();
-
-    /**
-     * Remembers the current node for the next call to gotoMark().
-     */
-    public void setMark();
-
-    /**
-     * Restores the current node remembered by setMark().
-     */
-    public void gotoMark();
-
-    /** 
-     * Set start to END should 'close' the iterator, 
-     * i.e. subsequent call to next() should return END.
-     */
-    public NodeIterator setStartNode(int node);
-
-    /**
-     * True if this iterator has a reversed axis.
-     */
-    public boolean isReverse();
-
-    /**
-     * Returns a deep copy of this iterator.
-     */
-    public NodeIterator cloneIterator();
-
-}
diff --git a/src/org/apache/xalan/xsltc/StripFilter.java b/src/org/apache/xalan/xsltc/StripFilter.java
deleted file mode 100644
index f61fb55..0000000
--- a/src/org/apache/xalan/xsltc/StripFilter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-import org.apache.xalan.xsltc.DOM;
-
-public interface StripFilter {
-    public boolean stripSpace(DOM dom, int node, int type);
-}
diff --git a/src/org/apache/xalan/xsltc/Translet.java b/src/org/apache/xalan/xsltc/Translet.java
deleted file mode 100644
index 0287a13..0000000
--- a/src/org/apache/xalan/xsltc/Translet.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-public interface Translet {
-
-    public void transform(DOM document, TransletOutputHandler handler)
-	throws TransletException;
-    public void transform(DOM document, TransletOutputHandler[] handlers)
-	throws TransletException;
-    public void transform(DOM document, NodeIterator iterator,
-			  TransletOutputHandler handler)
-	throws TransletException;
-
-    public Object addParameter(String name, Object value);
-
-    public void buildKeys(DOM document, NodeIterator iterator,
-			  TransletOutputHandler handler, int root)
-	throws TransletException;
-}
diff --git a/src/org/apache/xalan/xsltc/TransletException.java b/src/org/apache/xalan/xsltc/TransletException.java
deleted file mode 100644
index 07836c0..0000000
--- a/src/org/apache/xalan/xsltc/TransletException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-public final class TransletException extends Exception {
-    public TransletException() {
-	super();
-    }
-    
-    public TransletException(Exception e) {
-	super(e.toString());
-    }
-    
-    public TransletException(String message) {
-	super(message);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/TransletOutputHandler.java b/src/org/apache/xalan/xsltc/TransletOutputHandler.java
deleted file mode 100644
index f53fa11..0000000
--- a/src/org/apache/xalan/xsltc/TransletOutputHandler.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc;
-
-import java.io.*;
-import org.apache.xalan.xsltc.runtime.Hashtable;
-
-public interface TransletOutputHandler {
-
-    public void startDocument() throws TransletException;
-    public void endDocument() throws TransletException;
-    public void startElement(String elementName) throws TransletException;
-    public void endElement(String elementName) throws TransletException;
-    public void characters(char[] characters, int offset, int length)
-	throws TransletException;
-    public void attribute(String attributeName, String attributeValue)
-	throws TransletException;
-    public void namespace(String prefix, String uri) throws TransletException;
-    public void comment(String comment) throws TransletException;
-    public void processingInstruction(String target, String data)
-	throws TransletException;
-    public void setType(int type);
-    public void setIndent(boolean indent);
-    public void omitHeader(boolean value);
-    public boolean setEscaping(boolean escape) throws TransletException;
-    public void setCdataElements(Hashtable elements);
-    public void close();
-}
diff --git a/src/org/apache/xalan/xsltc/cmdline/Compile.java b/src/org/apache/xalan/xsltc/cmdline/Compile.java
deleted file mode 100644
index 8dc5fb4..0000000
--- a/src/org/apache/xalan/xsltc/cmdline/Compile.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.cmdline;
-
-import java.io.*;
-import java.util.Vector;
-import java.net.URL;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.TransletOutputHandler;
-
-import org.apache.xalan.xsltc.compiler.XSLTC;
-import org.apache.xalan.xsltc.compiler.util.Util;
-import org.apache.xalan.xsltc.cmdline.getopt.*;
-
-public final class Compile {
-
-    private final static String USAGE_STRING =
-	"Usage:\n" + 
-	"   xsltc [-o <output>] [-d <directory>] [-j <jarfile>]\n"+
-	"         [-p <package name>] [-x] [-u] <stylesheet>... \n\n"+
-	"   Where <output> is the name to give the the generated translet.\n"+
-	"         <stylesheet> is one or more stylesheet file names, or if,\n"+
-	"         the -u options is specified, one or more stylesheet URLs.\n"+
-	"         <directory> is the output directory.\n"+
-	"         <jarfile> is the name of a JAR-file to put all generated classes in.\n"+
-	"         <package-name> is a package name to prefix all class names with.\n\n"+
-	"   Notes:\n"+
-	"         The -o option is ignored when multiple stylesheets are specified.\n"+
-	"         The -x option switched on debug messages.";
-    
-    public static void printUsage() {
-	System.err.println(USAGE_STRING);
-	System.exit(-1);
-    }
-
-    /** 
-     * This method implements the command line compiler. See the USAGE_STRING
-     * constant for a description. It may make sense to move the command-line
-     * handling to a separate package (ie. make one xsltc.cmdline.Compiler
-     * class that contains this main() method and one xsltc.cmdline.Transform
-     * class that contains the DefaultRun stuff).
-     */
-    public static void main(String[] args) {
-	try {
-	    boolean inputIsURL = false;
-
-	    final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhs");
-	    if (args.length < 1) printUsage();
-
-	    final XSLTC xsltc = new XSLTC();
-	    xsltc.init();
-
-	    int c;
-	    while ((c = getopt.getNextOption()) != -1) {
-		switch(c) {
-		case 'o':
-		    xsltc.setClassName(getopt.getOptionArg());
-		    break;
-		case 'd':
-		    xsltc.setDestDirectory(getopt.getOptionArg());
-		    break;
-		case 'p':
-		    xsltc.setPackageName(getopt.getOptionArg());
-		    break;
-		case 'j':  
-		    xsltc.setJarFileName(getopt.getOptionArg());
-		    break;
-		case 'x':
-		    xsltc.setDebug(true);
-		    break;
-		case 'u':
-		    inputIsURL = true;
-		    break;
-		case 'h':
-		default:
-		    printUsage();
-		    break; 
-		}
-	    }
-
-	    // Generate a vector containg URLs for all stylesheets specified
-	    final String[] stylesheetNames = getopt.getCmdArgs();
-	    final Vector   stylesheetVector = new Vector();
-	    for (int i = 0; i < stylesheetNames.length; i++) {
-		final String name = stylesheetNames[i];
-		URL url;
-		if (inputIsURL)
-		    url = new URL(name);
-		else
-		    url = (new File(name)).toURL();
-		stylesheetVector.addElement(url);
-	    }
-
-	    // Compile the stylesheet and output class/jar file(s)
-	    if (xsltc.compile(stylesheetVector)) {
-		xsltc.printWarnings();
-		if (xsltc.getJarFileName() != null) xsltc.outputToJar();
-		System.exit(0);
-	    }
-	    else {
-		xsltc.printWarnings();
-		xsltc.printErrors();
-		System.exit(-1);
-	    }
-	}
-	catch (GetOptsException ex) {
-	    System.err.println(ex);
-	    printUsage(); // exits with code '-1'
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	    System.exit(-1);
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/cmdline/Transform.java b/src/org/apache/xalan/xsltc/cmdline/Transform.java
deleted file mode 100644
index 6106dbe..0000000
--- a/src/org/apache/xalan/xsltc/cmdline/Transform.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.cmdline;
-
-import java.io.*;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.UnknownHostException;
-import java.util.Vector;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.TransletException;
-import org.apache.xalan.xsltc.TransletOutputHandler;
-
-import org.apache.xalan.xsltc.runtime.*;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-import org.apache.xalan.xsltc.dom.DOMBuilder;
-import org.apache.xalan.xsltc.dom.Axis;
-import org.apache.xalan.xsltc.dom.DTDMonitor;
-
-final public class Transform {
-
-    private TransletOutputHandler _handler;
-
-    private String  _fileName;
-    private String  _className;
-    private String  _jarFileSrc;
-    private boolean _isJarFileSpecified = false;
-    private Vector  _params = null;
-    private boolean _uri, _debug;
-
-    public Transform(String className, String fileName,
-		     boolean uri, boolean debug) {
-	_fileName = fileName;
-	_className = className;
-	_uri = uri;
-	_debug = debug;
-    }
-
-    public void setParameters(Vector params) {
-	_params = params;
-    }
-
-    private void setJarFileInputSrc(boolean flag,  String jarFile) {
-	// TODO: at this time we do not do anything with this
-	// information, attempts to add the jarfile to the CLASSPATH
-	// were successful via System.setProperty, but the effects
-	// were not visible to the running JVM. For now we add jarfile
-	// to CLASSPATH in the wrapper script that calls this program. 
-	_isJarFileSpecified = flag;
-	// TODO verify jarFile exists...
-	_jarFileSrc = jarFile;	
-    }
-
-    private void doTransform() {
-	try {
-	    final Class clazz = Class.forName(_className);
-	    final Translet translet = (Translet)clazz.newInstance();
-
-	    // Create a SAX parser and get the XMLReader object it uses
-	    final SAXParserFactory factory = SAXParserFactory.newInstance();
-	    try {
-		factory.setFeature(Constants.NAMESPACE_FEATURE,true);
-	    }
-	    catch (Exception e) {
-		factory.setNamespaceAware(true);
-	    }
-	    final SAXParser parser = factory.newSAXParser();
-	    final XMLReader reader = parser.getXMLReader();
-
-	    // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
-	    final DOMImpl dom = new DOMImpl();
-	    final DOMBuilder builder = dom.getBuilder();
-	    reader.setContentHandler(builder);
-
-	    try {
-		String prop = "http://xml.org/sax/properties/lexical-handler";
-		reader.setProperty(prop, builder);
-	    }
-	    catch (SAXException e) {
-		// quitely ignored
-	    }
-	    
-	    // Create a DTD monitor and pass it to the XMLReader object
-	    final DTDMonitor dtdMonitor = new DTDMonitor();
-	    dtdMonitor.handleDTD(reader);
-
-	    AbstractTranslet _translet = (AbstractTranslet)translet;
-	    dom.setDocumentURI(_fileName);
-	    if (_uri)
-		reader.parse(_fileName);
-	    else
-		reader.parse("file:"+(new File(_fileName).getAbsolutePath()));
-	    
-	    // Set size of key/id indices
-	    _translet.setIndexSize(dom.getSize());
-	    // If there are any elements with ID attributes, build an index
-	    dtdMonitor.buildIdIndex(dom, 0, _translet);
-
-	    _translet.setDTDMonitor(dtdMonitor);
-
-	    // Pass global parameters
-	    int n = _params.size();
-	    for (int i = 0; i < n; i++) {
-		Parameter param = (Parameter) _params.elementAt(i);
-		translet.addParameter(param._name, param._value);
-	    }
-
-	    // Transform the document
-	    String encoding = _translet._encoding;
-
-	    // Create our default SAX/DTD handler
-	    DefaultSAXOutputHandler saxHandler =
-		new DefaultSAXOutputHandler(System.out, encoding);
-	    // Create a translet output handler and plug in the SAX/DTD handler
-	    TextOutput textOutput =
-		new TextOutput((ContentHandler)saxHandler,
-			       (LexicalHandler)saxHandler, encoding);
-	    // Transform and pass output to the translet output handler
-	    translet.transform(dom, textOutput);
-
-	    if (_debug) {
-		TransletOutputBase handler = new TransletOutputBase();
-		long start = System.currentTimeMillis();
-		final int nTimes = 100;
-		for (int i = 0; i < nTimes; i++)
-		    translet.transform(dom, dom.getIterator(), handler);
-		long end = System.currentTimeMillis();
-		System.out.println("total " + (end - start) + " msec for " 
-				   + nTimes + " transformations");
-		System.out.println(((double)end - start)/nTimes + " msec avg");
-	    }
-	}
-	catch (TransletException e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("\nTranslet Error: " + e.getMessage());
-	    System.exit(-1);	    
-	}
-	catch (RuntimeException e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("\nRuntime Error: " + e.getMessage());
-	    System.exit(-1);
-	}
-	catch (FileNotFoundException e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("Error: File or URI '"+_fileName+"' not found.");
-	    System.exit(-1);
-	}
-	catch (MalformedURLException e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("Error: Invalid URI '"+_fileName+"'.");
-	    System.exit(-1);
-	}
-	catch (ClassNotFoundException e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("Error: Cannot find class '"+_className+"'.");
-	    System.exit(-1);
-	}
-        catch (UnknownHostException e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("Error: Can't resolve URI specification '"+ 
-			       _fileName+"'.");
-	    System.exit(-1);
-        }
-	catch (Exception e) {
-	    if (_debug) e.printStackTrace();
-	    System.err.println("Error: "+e.getMessage());
-	    System.exit(-1);
-	}
-    }
-
-    private final static String USAGE_STRING =
-	"Usage: \n" +
-	"     xslt [-j <jarfile>] {-u <document_url> | <document>} <class>\n"+
-	"          [<name1>=<value1> ...]\n\n" +
-	"           <document> is the xml document to be transformed, or\n" +
-	"           <document_url> is a url for the xml document,\n" +
-	"           <class> is the translet class which is either in\n" +
-	"           user's CLASSPATH or in the <jarfile> specified \n" +
-	"           with the -j option.\n" +
-	"          also: [-x] (debug), [-s] (don't allow System.exit)";	
-
-    public static void printUsage() {
-	System.err.println(USAGE_STRING);
-	System.exit(-1);
-    }
-
-    public static void main(String[] args) {
-	try {
-	    if (args.length > 0) {
-		int i;
-		boolean uri = false, debug = false;
-		boolean isJarFileSpecified = false;
-		String  jarFile = null;
-
-		// Parse options starting with '-'
-		for (i = 0; i < args.length && args[i].charAt(0) == '-'; i++) {
-		    if (args[i].equals("-u")) {
-			uri = true;
-		    }
-		    else if (args[i].equals("-x")) {
-			debug = true;
-		    }
-		    else if (args[i].equals("-j")) {
-			isJarFileSpecified = true;	
-			jarFile = args[++i];
-		    }
-		    else {
-			printUsage();
-		    }
-		}
-
-		// Enough arguments left ?
-		if (args.length - i < 2) printUsage();
-
-		// Get document file and class name
-		Transform handler = new Transform(args[i+1],args[i],uri,debug);
-		handler.setJarFileInputSrc(isJarFileSpecified,	jarFile);
-
-		// Parse stylesheet parameters
-		Vector params = new Vector();
-		for (i += 2; i < args.length; i++) {
-		    final int equal = args[i].indexOf('=');
-		    if (equal > 0) {
-			final String name  = args[i].substring(0, equal);
-			final String value = args[i].substring(equal+1);
-			params.addElement(new Parameter(name, value));
-		    }
-		    else {
-			printUsage();
-		    }
-		}
-
-		if (i == args.length) {
-		    handler.setParameters(params);
-		    handler.doTransform();
-		    System.exit(0);
-		}
-	    } else {
-		printUsage();
-	    }
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java b/src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
deleted file mode 100644
index ac6b698..0000000
--- a/src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * $Id$ 
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G Todd Miller 
- *
- */
-
-package org.apache.xalan.xsltc.cmdline.getopt; 
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import java.util.List;
-
-import org.apache.xalan.xsltc.cmdline.getopt.IllegalArgumentException;
-import org.apache.xalan.xsltc.cmdline.getopt.MissingOptArgException;
-
-
-/**
-* GetOpt is a Java equivalent to the C getopt() library function
-* discussed in man page getopt(3C). It provides command line
-* parsing for Java applications. It supports the most rules of the
-* command line standard (see man page intro(1)) including stacked
-* options such as '-sxm' (which is equivalent to -s -x -m); it
-* handles special '--' option that signifies the end of options.
-* Additionally this implementation of getopt will check for
-* mandatory arguments to options such as in the case of
-* '-d <file>' it will throw a MissingOptArgException if the 
-* option argument '<file>' is not included on the commandline.
-* getopt(3C) does not check for this. 
-*/
-public class GetOpt{
-    public GetOpt(String[] args, String optString){
-	theOptions = new ArrayList();		 
-	int currOptIndex = 0; 
-	theCmdArgs = new ArrayList(); 
-	theOptionMatcher = new OptionMatcher(optString);
-	// fill in the options list
-	for(int i=0; i<args.length; i++){
-	    String token = args[i];
-	    int tokenLength = token.length();
-	    if(token.equals("--")){	    // end of opts
-	        currOptIndex = i+1;	    // set index of first operand
-                break;                      // end of options
-	    }
-	    else if(token.startsWith("-") && tokenLength == 2){ 
-		// simple option token such as '-s' found
-		theOptions.add(new Option(token.charAt(1)));	
-	    }
-	    else if(token.startsWith("-") && tokenLength > 2){
-		// stacked options found, such as '-shm'
-		// iterate thru the tokens after the dash and
-		// add them to theOptions list
-		for(int j=1; j<tokenLength; j++){
-		    theOptions.add(new Option(token.charAt(j)));
-		}
-	    }		
-	    else if(!token.startsWith("-")){
-		// case 1- there are not options stored yet therefore
-		// this must be an command argument, not an option argument
-		if(theOptions.size() == 0){
-		    currOptIndex = i;
-		    break;		// stop processing options
-		}
-		else {
-		    // case 2- 
-		    // there are options stored, check to see if
-		    // this arg belong to the last arg stored	
-		    int indexoflast=0;
-		    indexoflast = theOptions.size()-1;
-		    Option op = (Option)theOptions.get(indexoflast);
-		    char opLetter = op.getArgLetter();
-		    if(!op.hasArg() && theOptionMatcher.hasArg(opLetter)){
-		        op.setArg(token);
-		    }
-		    else{
-		        // case 3 - 
-		        // the last option stored does not take
-		        // an argument, so again, this argument
-		        // must be a command argument, not 
-		        // an option argument
-		        currOptIndex = i;
-		        break; 			// end of options 
-		    }
-	  	}
-	    }// end option does not start with "-"
-	} // end for args loop
-
-        //  attach an iterator to list of options 
-	theOptionsIterator = theOptions.listIterator();
-
-	// options are done, now fill out cmd arg list with remaining args
-	for(int i=currOptIndex; i<args.length; i++){
-	    String token = args[i];
-	    theCmdArgs.add(token);
-	}
-    }
-
-
-    /**
-    * debugging routine to print out all options collected
-    */
-    public void printOptions(){
-	for(ListIterator it=theOptions.listIterator(); it.hasNext();){
-	    Option opt = (Option)it.next();
-	    System.out.print("OPT =" + opt.getArgLetter());
-	    String arg = opt.getArgument();
-	    if(arg != null){
-	       System.out.print(" " + arg);
-	    }
-	    System.out.println();
-	}
-    }
-
-    /**
-    * gets the next option found in the commandline. Distinguishes
-    * between two bad cases, one case is when an illegal option
-    * is found, and then other case is when an option takes an
-    * argument but no argument was found for that option.
-    * If the option found was not declared in the optString, then 
-    * an IllegalArgumentException will be thrown (case 1). 
-    * If the next option found has been declared to take an argument, 
-    * and no such argument exists, then a MissingOptArgException
-    * is thrown (case 2).
-    * @param none
-    * @return int - the next option found.
-    * @throws IllegalArgumentException, MissingOptArgException. 
-    */
-    public int getNextOption() throws IllegalArgumentException, 
-	MissingOptArgException
-    {
-	int retval = -1;
-	if(theOptionsIterator.hasNext()){
-	    theCurrentOption = (Option)theOptionsIterator.next();
-	    char c = theCurrentOption.getArgLetter();
-	    boolean shouldHaveArg = theOptionMatcher.hasArg(c);
-	    String arg = theCurrentOption.getArgument();
-	    if(!theOptionMatcher.match(c)){
-		throw (new IllegalArgumentException("Option " +
-			c + " is not valid."));
-	    }
-	    else if(shouldHaveArg && (arg == null)){
-		throw (new MissingOptArgException("Option " + 
-			c + " is missing its argument."));
-	    }
-	    retval = c;
-	}
-	return retval;
-    }
-
-    /**
-    * gets the argument for the current parsed option. For example,
-    * in case of '-d <file>', if current option parsed is 'd' then
-    * getOptionArg() would return '<file>'.
-    * @param none
-    * @return String - argument for current parsed option.
-    */
-    public String getOptionArg(){
-	String retval = null;
-	String tmp = theCurrentOption.getArgument();
-	char c = theCurrentOption.getArgLetter();
-	if(theOptionMatcher.hasArg(c)){
-	    retval = tmp;
-	}
-	return retval;	
-    }
-
-    /**
-    * gets list of the commandline arguments. For example, in command
-    * such as 'cmd -s -d file file2 file3 file4'  with the usage
-    * 'cmd [-s] [-d <file>] <file>...', getCmdArgs() would return
-    * the list {file2, file3, file4}.
-    * @params none
-    * @return String[] - list of command arguments that may appear
-    *                    after options and option arguments.
-    */
-    public String[] getCmdArgs(){
-	String[] retval = new String[theCmdArgs.size()];
-	int i=0;
-        for(ListIterator it=theCmdArgs.listIterator(); it.hasNext();){
-            retval[i++] = (String)it.next();
-        }
-	return retval;
-    }
-
-
-    private Option theCurrentOption = null;
-    private ListIterator theOptionsIterator; 
-    private List theOptions = null;
-    private List theCmdArgs = null;
-    private OptionMatcher theOptionMatcher = null;
-
-    ///////////////////////////////////////////////////////////
-    //
-    //   Inner Classes
-    //
-    ///////////////////////////////////////////////////////////
-
-    // inner class to model an option
-    class Option{
-        private char theArgLetter;
-        private String theArgument = null;
-        public Option(char argLetter) { theArgLetter = argLetter; }
-        public void setArg(String arg) { 
-	    theArgument = arg;
-        }
-        public boolean hasArg() { return (theArgument != null); } 
-        public char getArgLetter() { return theArgLetter; }
-        public String getArgument() { return theArgument; }
-    } // end class Option
-
-
-    // inner class to query optString for a possible option match,
-    // and whether or not a given legal option takes an argument. 
-    //  
-    class OptionMatcher{
-        public OptionMatcher(String optString){
-	    theOptString = optString;	
-        }
-        public boolean match(char c){
-	    boolean retval = false;
-	    if(theOptString.indexOf(c) != -1){
-	        retval = true;
-	    }
-	    return retval;	
-        }
-        public boolean hasArg(char c){
-	    boolean retval = false;
-	    int index = theOptString.indexOf(c)+1; 
-	    if (index == theOptString.length()){
-	        // reached end of theOptString
-	        retval = false;
-	    }
-            else if(theOptString.charAt(index) == ':'){
-                retval = true;
-            }
-            return retval;
-        }
-        private String theOptString = null;
-    } // end class OptionMatcher
-}// end class GetOpt
-    
diff --git a/src/org/apache/xalan/xsltc/cmdline/getopt/GetOptsException.java b/src/org/apache/xalan/xsltc/cmdline/getopt/GetOptsException.java
deleted file mode 100644
index e323f6b..0000000
--- a/src/org/apache/xalan/xsltc/cmdline/getopt/GetOptsException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * $Id$ 
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G Todd Miller 
- */
-
-package org.apache.xalan.xsltc.cmdline.getopt; 
-
-public class GetOptsException extends Exception{
-    public GetOptsException(String msg){
-	super(msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/cmdline/getopt/IllegalArgumentException.java b/src/org/apache/xalan/xsltc/cmdline/getopt/IllegalArgumentException.java
deleted file mode 100644
index 101d1ce..0000000
--- a/src/org/apache/xalan/xsltc/cmdline/getopt/IllegalArgumentException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * $Id$ 
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.xalan.xsltc.cmdline.getopt;
-
-import org.apache.xalan.xsltc.cmdline.getopt.GetOptsException;
-
-class IllegalArgumentException extends GetOptsException{
-    public IllegalArgumentException(String msg){
-	super(msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/cmdline/getopt/MissingOptArgException.java b/src/org/apache/xalan/xsltc/cmdline/getopt/MissingOptArgException.java
deleted file mode 100644
index 8687ba6..0000000
--- a/src/org/apache/xalan/xsltc/cmdline/getopt/MissingOptArgException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * $Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G Todd Miller 
- */
-
-package org.apache.xalan.xsltc.cmdline.getopt; 
-
-import org.apache.xalan.xsltc.cmdline.getopt.GetOptsException;
-
-class MissingOptArgException extends GetOptsException{
-    public MissingOptArgException(String msg){
-	super(msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java b/src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java
deleted file mode 100644
index f8a4b3f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class AbsoluteLocationPath extends Expression {
-    private Expression _path;	// may be null 
-
-    public AbsoluteLocationPath() {
-	_path = null;
-    }
-
-    public AbsoluteLocationPath(Expression path) {
-	_path = path;
-	if (path != null) {
-	    _path.setParent(this);
-	}
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_path != null) {
-	    _path.setParser(parser);
-	}
-    }
-
-    public Expression getPath() {
-	return(_path);
-    }
-    
-    public String toString() {
-	return "AbsoluteLocationPath(" +
-	    (_path != null ? _path.toString() : "null") + ')';
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_path != null) {
-	    final Type ptype = _path.typeCheck(stable);
-	    if (ptype instanceof NodeType) {		// promote to node-set
-		_path = new CastExpr(_path, Type.NodeSet);
-	    }
-	}
-	return _type = Type.NodeSet;	
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	if (_path != null) {
-	    final int initAI = cpg.addMethodref(ABSOLUTE_ITERATOR,
-						"<init>",
-						"("
-						+ NODE_ITERATOR_SIG
-						+ ")V");
-	    // Create new AbsoluteIterator
-	    il.append(new NEW(cpg.addClass(ABSOLUTE_ITERATOR)));
-	    il.append(DUP);
-
-	    // Compile relative path iterator(s)
-	    _path.translate(classGen, methodGen);
-
-	    // Initialize AbsoluteIterator with iterator from the stack
-	    il.append(new INVOKESPECIAL(initAI));
-	}
-	else {
-	    final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
-						       "getIterator",
-						       "()"+NODE_ITERATOR_SIG);
-	    il.append(methodGen.loadDOM());
-	    il.append(new INVOKEINTERFACE(gitr, 1));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java b/src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java
deleted file mode 100644
index 7c77092..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class AbsolutePathPattern extends LocationPathPattern {
-    private final RelativePathPattern _left; // may be null
-
-    public AbsolutePathPattern(RelativePathPattern left) {
-	_left = left;
-	if (left != null) {
-	    left.setParent(this);
-	}
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_left != null)
-	    _left.setParser(parser);
-    }
-    
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return _left == null ? Type.Root : _left.typeCheck(stable);
-    }
-
-    public boolean isWildcard() {
-	return false;
-    }
-	
-    public StepPattern getKernelPattern() {
-	return _left != null ? _left.getKernelPattern() : null;
-    }
-	
-    public void reduceKernelPattern() {
-	_left.reduceKernelPattern();
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_left != null) {
-	    if (_left instanceof StepPattern) {
-		final LocalVariableGen local = 
-		    // absolute path pattern temporary
-		    methodGen.addLocalVariable2("apptmp", 
-						Util.getJCRefType(NODE_SIG),
-						il.getEnd());
-		il.append(DUP);
-		il.append(new ISTORE(local.getIndex()));
-		_left.translate(classGen, methodGen);
-		il.append(methodGen.loadDOM());
-		local.setEnd(il.append(new ILOAD(local.getIndex())));
-		methodGen.removeLocalVariable(local);
-	    }
-	    else {
-		_left.translate(classGen, methodGen);
-	    }
-	    _trueList.append(_left._trueList);
-	    _falseList.append(_left._falseList);
-	}
-	final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
-							GET_PARENT,
-							GET_PARENT_SIG);
-	final int getType = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getType", "(I)I");
-	il.append(methodGen.loadDOM());
-	il.append(SWAP);
-	il.append(new INVOKEINTERFACE(getParent, 2));
-	if (_left instanceof AncestorPattern) {
-	    il.append(methodGen.loadDOM());
-	    il.append(SWAP);
-	}
-	il.append(new INVOKEINTERFACE(getType, 2));
-	il.append(new PUSH(cpg, DOM.ROOT));
-	_falseList.add(il.append(new IF_ICMPNE(null)));
-    }
-	
-    public String toString() {
-	return "absolutePathPattern(" + (_left!=null ? _left.toString() : ")");
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AlternativePattern.java b/src/org/apache/xalan/xsltc/compiler/AlternativePattern.java
deleted file mode 100644
index 33d917b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AlternativePattern.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class AlternativePattern extends Pattern {
-    private final Pattern _left;
-    private final Pattern _right;
-		
-    /**
-     * Construct an alternative pattern. The method <code>setParent</code>
-     * should not be called in this case.
-     */
-    public AlternativePattern(Pattern left, Pattern right) {
-	_left = left;
-	_right = right;
-    }
-		
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-	_right.setParser(parser);
-    }
-    
-    public Pattern getLeft() {
-	return _left;
-    }
-
-    public Pattern getRight() {
-	return _right;
-    }
-
-    /**
-     * The type of an '|' is not really defined, hence null is returned.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_left.typeCheck(stable);
-	_right.typeCheck(stable);
-	return null;
-    }
-
-    public double getPriority() {
-	double left = _left.getPriority();
-	double right = _right.getPriority();
-	
-	if (left < right)
-	    return(left);
-	else
-	    return(right);
-    }
-
-    public String toString() {
-	return "alternative(" + _left + ", " + _right + ')';
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-
-	_left.translate(classGen, methodGen);
-	final InstructionHandle gotot = il.append(new GOTO(null));
-	il.append(methodGen.loadContextNode());
-	_right.translate(classGen, methodGen);
-
-	_left._trueList.backPatch(gotot);
-	_left._falseList.backPatch(gotot.getNext());
-
-	_trueList.append(_right._trueList.add(gotot));
-	_falseList.append(_right._falseList);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AncestorPattern.java b/src/org/apache/xalan/xsltc/compiler/AncestorPattern.java
deleted file mode 100644
index 004f0c0..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AncestorPattern.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class AncestorPattern extends RelativePathPattern {
-    private final Pattern _left;	// may be null
-    private final RelativePathPattern _right;
-		
-    public AncestorPattern(RelativePathPattern right) {
-	this(null, right);
-    }
-
-    public AncestorPattern(Pattern left, RelativePathPattern right) {
-	_left = left;
-	(_right = right).setParent(this);
-	if (left != null) {
-	    left.setParent(this);
-	}
-    }
-	
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_left != null) {
-	    _left.setParser(parser);
-	}
-	_right.setParser(parser);
-    }
-    
-    public boolean isWildcard() {
-	//!!! can be wildcard
-	return false;
-    }
-	
-    public StepPattern getKernelPattern() {
-	return _right.getKernelPattern();
-    }
-
-    public void reduceKernelPattern() {
-	_right.reduceKernelPattern();
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_left != null) _left.typeCheck(stable);
-	return _right.typeCheck(stable);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	InstructionHandle loop, eloop;
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final LocalVariableGen local =
-	    methodGen.addLocalVariable2("app", 
-					Util.getJCRefType(NODE_SIG),
-					il.getEnd());
-
-	final de.fub.bytecode.generic.Instruction loadLocal =
-	    new ILOAD(local.getIndex());
-	final de.fub.bytecode.generic.Instruction storeLocal =
-	    new ISTORE(local.getIndex());
-
-	if (_right instanceof StepPattern) {
-	    il.append(DUP);
-	    il.append(storeLocal);
-	    _right.translate(classGen, methodGen);
-	    il.append(methodGen.loadDOM());
-	    il.append(loadLocal);
-	}
-	else {
-	    _right.translate(classGen, methodGen);
-	}
-
-	if (_left != null) {
-	    final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
-							    GET_PARENT,
-							    GET_PARENT_SIG);
-	    loop = il.append(new INVOKEINTERFACE(getParent, 2));
-	    
-	    il.append(DUP);
-	    il.append(storeLocal);
-	    _falseList.add(il.append(new IFEQ(null)));
-	    il.append(loadLocal);
-
-	    _left.translate(classGen, methodGen);
-
-
-	    final SyntaxTreeNode p = getParent();
-	    if ((p == null) || 
-		(p instanceof Instruction) ||
-		(p instanceof TopLevelElement)) {
-		// do nothing
-	    }
-	    else {
-		il.append(loadLocal);
-	    }
-
-	    final BranchHandle exit = il.append(new GOTO(null));
-	    eloop = il.append(methodGen.loadDOM());
-	    il.append(loadLocal);
-	    local.setEnd(eloop);
-	    il.append(new GOTO(loop));
-	    exit.setTarget(il.append(NOP));
-	    _left.backPatchFalseList(eloop);
-
-	    _trueList.append(_left._trueList);	
-	}
-	else {
-	    il.append(POP2);
-	}
-	methodGen.removeLocalVariable(local);
-
-	_trueList.append(_right._trueList);
-	_falseList.append(_right._falseList);
-    }
-
-    public String toString() {
-	return "AncestorPattern(" + _left + ", " + _right + ')';
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ApplyImports.java b/src/org/apache/xalan/xsltc/compiler/ApplyImports.java
deleted file mode 100644
index a08f6a6..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ApplyImports.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ApplyImports extends Instruction {
-
-    private Expression _select;
-    private QName      _modeName;
-    private String     _functionName;
-	
-    public void display(int indent) {
-	indent(indent);
-	Util.println("ApplyTemplates");
-	indent(indent + IndentIncrement);
-	Util.println("select " + _select.toString());
-	if (_modeName != null) {
-	    indent(indent + IndentIncrement);
-	    Util.println("mode " + _modeName);
-	}
-    }
-
-    public boolean hasWithParams() {
-	return hasContents();
-    }
-
-    public void parseContents(Parser parser) {
-	final String select = getAttribute("select");
-	final String mode   = getAttribute("mode");
-	
-	if (select.length() > 0) {
-	    _select = parser.parseExpression(this, "select", null);
-	}
-	
-	if (mode.length() > 0) {
-	    _modeName = parser.getQName(mode);
-	}
-	
-	// instantiate Mode if needed, cache (apply temp) function name
-	_functionName =
-	    parser.getTopLevelStylesheet().getMode(_modeName).functionName();
-	parseChildren(parser);	// with-params
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_select != null) {
-	    Type tselect = _select.typeCheck(stable);
-	    if (tselect instanceof NodeType ||
-		tselect instanceof ReferenceType) {
-		_select = new CastExpr(_select, Type.NodeSet);
-		tselect = Type.NodeSet;
-	    }
-	    if (tselect instanceof NodeSetType) {
-		typeCheckContents(stable);		// with-params
-		return Type.Void;
-	    } 
-	    throw new TypeCheckError(this);
-	}
-	else {
-	    typeCheckContents(stable);		// with-params
-	    return Type.Void;
-	}
-    }
-
-    /**
-     * Translate call-template. A parameter frame is pushed only if
-     * some template in the stylesheet uses parameters. 
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final Stylesheet stylesheet = classGen.getStylesheet();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final int current = methodGen.getLocalIndex("current");
-
-	// check if sorting nodes is required
-	final Vector sortObjects = new Vector();
-	final Enumeration children = elements();
-	while (children.hasMoreElements()) {
-	    final Object child = children.nextElement();
-	    if (child instanceof Sort) {
-		sortObjects.addElement(child);
-	    }
-	}
-	
-	// Push a new parameter frame
-	if (stylesheet.hasLocalParams()) {
-	    il.append(classGen.loadTranslet());
-	    final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
-						   PUSH_PARAM_FRAME,
-						   PUSH_PARAM_FRAME_SIG);
-	    il.append(new INVOKEVIRTUAL(pushFrame));
-	    // translate with-params
-	    translateContents(classGen, methodGen);
-	}
-
-	// push arguments for final call to applyTemplates
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadDOM());
-		
-	// compute node iterator for applyTemplates
-	if (sortObjects.size() > 0) {
-	    Sort.translateSortIterator(classGen, methodGen,
-				       _select, sortObjects);
-	}
-	else {
-	    if (_select == null) {
-		Mode.compileGetChildren(classGen, methodGen, current);
-	    }
-	    else {
-		_select.translate(classGen, methodGen);
-	    }
-	}
-	if (_select != null) {
-	    _select.startResetIterator(classGen, methodGen);
-	}
-	
-	//!!! need to instantiate all needed modes
-	final String className = classGen.getStylesheet().getClassName();
-	il.append(methodGen.loadHandler());
-	final String applyTemplatesSig = classGen.getApplyTemplatesSig();
-	final int applyTemplates = cpg.addMethodref(className,
-						    _functionName,
-						    applyTemplatesSig);
-	il.append(new INVOKEVIRTUAL(applyTemplates));
-	
-	// Pop parameter frame
-	if (stylesheet.hasLocalParams()) {
-	    il.append(classGen.loadTranslet());
-	    final int popFrame = cpg.addMethodref(TRANSLET_CLASS,
-						  POP_PARAM_FRAME,
-						  POP_PARAM_FRAME_SIG);
-	    il.append(new INVOKEVIRTUAL(popFrame));
-	}
-    }
-
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java b/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
deleted file mode 100644
index 0b75534..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ApplyTemplates extends Instruction {
-    private Expression _select;
-    private Type       _type = null;
-    private QName      _modeName;
-    private String     _functionName;
-	
-    public void display(int indent) {
-	indent(indent);
-	Util.println("ApplyTemplates");
-	indent(indent + IndentIncrement);
-	Util.println("select " + _select.toString());
-	if (_modeName != null) {
-	    indent(indent + IndentIncrement);
-	    Util.println("mode " + _modeName);
-	}
-    }
-
-    public boolean hasWithParams() {
-	return hasContents();
-    }
-
-    public void parseContents(Parser parser) {
-	final String select = getAttribute("select");
-	final String mode   = getAttribute("mode");
-	
-	if (select.length() > 0) {
-	    _select = parser.parseExpression(this, "select", null);
-	}
-	
-	if (mode.length() > 0) {
-	    _modeName = parser.getQName(mode);
-	}
-	
-	// instantiate Mode if needed, cache (apply temp) function name
-	_functionName =
-	    parser.getTopLevelStylesheet().getMode(_modeName).functionName();
-	parseChildren(parser);// with-params
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_select != null) {
-	    _type = _select.typeCheck(stable);
-	    if (_type instanceof NodeType || _type instanceof ReferenceType) {
-		_select = new CastExpr(_select, Type.NodeSet);
-		_type = Type.NodeSet;
-	    }
-	    if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
-		typeCheckContents(stable); // with-params
-		return Type.Void;
-	    }
-	    String msg = "Unsupported type for <xsl:apply-templates select='"+
-		_type+"'/>";
-	    throw new TypeCheckError(new ErrorMsg(msg));
-	}
-	else {
-	    typeCheckContents(stable);		// with-params
-	    return Type.Void;
-	}
-    }
-
-    /**
-     * Translate call-template. A parameter frame is pushed only if
-     * some template in the stylesheet uses parameters. 
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final Stylesheet stylesheet = classGen.getStylesheet();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final int current = methodGen.getLocalIndex("current");
-
-	// check if sorting nodes is required
-	final Vector sortObjects = new Vector();
-	final Enumeration children = elements();
-	while (children.hasMoreElements()) {
-	    final Object child = children.nextElement();
-	    if (child instanceof Sort) {
-		sortObjects.addElement(child);
-	    }
-	}
-	
-	// Push a new parameter frame
-	if (stylesheet.hasLocalParams()) {
-	    il.append(classGen.loadTranslet());
-	    final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
-						   PUSH_PARAM_FRAME,
-						   PUSH_PARAM_FRAME_SIG);
-	    il.append(new INVOKEVIRTUAL(pushFrame));
-	    // translate with-params
-	    translateContents(classGen, methodGen);
-	}
-
-	il.append(classGen.loadTranslet());
-
-	// The 'select' expression is a result-tree
-	if ((_type != null) && (_type instanceof ResultTreeType)) {
-	    // <xsl:sort> cannot be applied to a result tree - issue warning
-	    if (sortObjects.size() > 0) {
-		ErrorMsg msg = new ErrorMsg(ErrorMsg.TREESORT_ERR);
-		getParser().reportError(WARNING, msg);
-	    }
-	    // Put the result tree (a DOM adapter) on the stack
-	    _select.translate(classGen, methodGen);	
-	    // Get back the DOM and iterator (not just iterator!!!)
-	    _type.translateTo(classGen, methodGen, Type.NodeSet);
-	}
-	else {
-	    il.append(methodGen.loadDOM());
-
-	    // compute node iterator for applyTemplates
-	    if (sortObjects.size() > 0) {
-		Sort.translateSortIterator(classGen, methodGen,
-					   _select, sortObjects);
-	    }
-	    else {
-		if (_select == null)
-		    Mode.compileGetChildren(classGen, methodGen, current);
-		else
-		    _select.translate(classGen, methodGen);
-	    }
-	}
-
-	if (_select != null) {
-	    _select.startResetIterator(classGen, methodGen);
-	}
-
-	//!!! need to instantiate all needed modes
-	final String className = classGen.getStylesheet().getClassName();
-	il.append(methodGen.loadHandler());
-	final String applyTemplatesSig = classGen.getApplyTemplatesSig();
-	final int applyTemplates = cpg.addMethodref(className,
-						    _functionName,
-						    applyTemplatesSig);
-	il.append(new INVOKEVIRTUAL(applyTemplates));
-	
-	// Pop parameter frame
-	if (stylesheet.hasLocalParams()) {
-	    il.append(classGen.loadTranslet());
-	    final int popFrame = cpg.addMethodref(TRANSLET_CLASS,
-						  POP_PARAM_FRAME,
-						  POP_PARAM_FRAME_SIG);
-	    il.append(new INVOKEVIRTUAL(popFrame));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ArgumentList.java b/src/org/apache/xalan/xsltc/compiler/ArgumentList.java
deleted file mode 100644
index 66f67eb..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ArgumentList.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-final class ArgumentList {
-    private final Expression   _arg;
-    private final ArgumentList _rest;
-	
-    public ArgumentList(Expression arg, ArgumentList rest) {
-	_arg = arg;
-	_rest = rest;
-    }
-		
-    public String toString() {
-	return _rest == null
-	    ? _arg.toString()
-	    : _arg.toString() + ", " + _rest.toString();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Attribute.java b/src/org/apache/xalan/xsltc/compiler/Attribute.java
deleted file mode 100644
index be960e6..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Attribute.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Attribute extends Instruction {
-    private QName _name;
-	
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Attribute " + _name);
-	displayContents(indent + IndentIncrement);
-    }
-
-    public void parseContents(Parser parser) {
-	_name = parser.getQName(getAttribute("name"));
-	parseChildren(parser);
-	//!!! add text nodes
-	//!!! take care of value templates
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AttributeSet.java b/src/org/apache/xalan/xsltc/compiler/AttributeSet.java
deleted file mode 100644
index fdad5dc..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AttributeSet.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class AttributeSet extends TopLevelElement {
-
-    // Error messages
-    private static final String NO_NAME_ERROR =
-	"Attribute set missing 'name' attribute.";
-    private static final String BASTARD_ERROR =
-	"Attribute sets can only have <xsl:attribute> child elements.";
-
-    // This prefix is used for the method name of attribute set methods
-    private static final String AttributeSetPrefix = "$as$";
-    
-    // Element contents
-    private QName            _name;
-    private UseAttributeSets _useSets;
-    private String           _method;
-    private boolean          _ignore = false;
-    
-    /**
-     * Returns the QName of this attribute set
-     */
-    public QName getName() {
-	return _name;
-    }
-
-    /**
-     * Returns the method name of this attribute set. This method name is
-     * generated by the compiler (XSLTC)
-     */
-    public String getMethodName() {
-	return _method;
-    }
-
-    /**
-     * Call this method to prevent a method for being compiled for this set.
-     * This is used in case several <xsl:attribute-set...> elements constitute
-     * a single set (with one name). The last element will merge itself with
-     * any previous set(s) with the same name and disable the other set(s).
-     */
-    public void ignore() {
-	_ignore = true;
-    }
-
-    /**
-     * Parse the contents of this attribute set. Recognised attributes are
-     * "name" (required) and "use-attribute-sets" (optional).
-     */
-    public void parseContents(Parser parser) {
-	
-	// Get this attribute set's name
-	_name = parser.getQName(getAttribute("name"));
-	if ((_name == null) || (_name.equals(Constants.EMPTYSTRING))) {
-	    final ErrorMsg msg = new ErrorMsg(NO_NAME_ERROR, getLineNumber());
-	    parser.reportError(Constants.ERROR, msg);
-	}
-
-	// Get any included attribute sets (similar to inheritance...)
-	final String useSets = getAttribute("use-attribute-sets");
-	if (useSets.length() > 0) {
-	    _useSets = new UseAttributeSets(useSets, parser);
-	}
-
-	// Parse the contents of this node. All child elements must be
-	// <xsl:attribute> elements. Other elements cause an error.
-	final Vector contents = getContents();
-	final int count = contents.size();
-	for (int i=0; i<count; i++) {
-	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
-	    if (child instanceof XslAttribute) {
-		parser.getSymbolTable().setCurrentNode(child);
-		child.parseContents(parser);
-	    }
-	    else {
-		final ErrorMsg msg =
-		    new ErrorMsg(BASTARD_ERROR, getLineNumber());
-		parser.reportError(Constants.ERROR, msg);
-	    }
-	}
-
-	// Point the symbol table back at us...
-	parser.getSymbolTable().setCurrentNode(this);
-    }
-
-    /**
-     * Type check the contents of this element
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-	if (_ignore) return (Type.Void);
-
-	final AttributeSet other = stable.addAttributeSet(this);
-	if (other != null) {
-	    _method = other.getMethodName();
-	    merge(other);
-	    other.ignore();
-	}
-	else {
-	    _method = AttributeSetPrefix + getXSLTC().nextAttributeSetSerial();
-	}
-
-	if (_useSets != null) _useSets.typeCheck(stable);
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    /**
-     * Merge this attribute set with some other one
-     */
-    private void merge(AttributeSet other) {
-	// Both attribute sets may inherit from other sets...
-	if (_useSets == null)
-	    _useSets = other._useSets;
-	else
-	    _useSets.addAttributeSets(other.getAttribute("use-attribute-sets"));
-
-	// Merge the contents of the two attribute sets...
-	final Enumeration attributes = other.elements();
-	while (attributes.hasMoreElements())
-	    setFirstElement((XslAttribute)attributes.nextElement());
-    }
-
-    /**
-     * Compile a method that outputs the attributes in this set
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	if (_ignore) return;
-
-	// Create a new method generator for an attribute set method
-	methodGen = new AttributeSetMethodGenerator(_method, classGen);
-
-	// Translate other used attribute sets first, as local attributes
-	// take precedence (last attributes overrides first)
-	if (_useSets != null) _useSets.translate(classGen, methodGen);
-
-	// Translate all local attributes
-	final Enumeration attributes = elements();
-	while (attributes.hasMoreElements()) {
-	    final XslAttribute attribute =
-		(XslAttribute)attributes.nextElement();
-	    attribute.translate(classGen, methodGen);
-	}
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(RETURN);
-	
-	methodGen.stripAttributes(true);
-	methodGen.setMaxLocals();
-	methodGen.setMaxStack();
-	methodGen.removeNOPs();
-	classGen.addMethod(methodGen.getMethod());
-    }
-
-    public String toString() {
-	StringBuffer buf = new StringBuffer("attribute-set: ");
-	// Translate all local attributes
-	final Enumeration attributes = elements();
-	while (attributes.hasMoreElements()) {
-	    final XslAttribute attribute =
-		(XslAttribute)attributes.nextElement();
-	    buf.append(attribute);
-	}
-	return(buf.toString());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AttributeValue.java b/src/org/apache/xalan/xsltc/compiler/AttributeValue.java
deleted file mode 100644
index 64c0340..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AttributeValue.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-abstract class AttributeValue extends Expression {
-
-    public static final AttributeValue create(SyntaxTreeNode parent,
-					      String text, Parser parser) {
-
-	AttributeValue result;
-	if (text.indexOf('{') != -1) {
-	    result = new AttributeValueTemplate(text, parser);
-	}
-	else if (text.indexOf('}') != -1) {
-	    result = new AttributeValueTemplate(text, parser);
-	}
-	else {
-	    result = new SimpleAttributeValue(text);
-	    result.setParser(parser);
-	}
-	result.setParent(parent);
-	return result;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java b/src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
deleted file mode 100644
index 76a8101..0000000
--- a/src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class AttributeValueTemplate extends AttributeValue {
-
-    public AttributeValueTemplate(String value, Parser parser) {
-	check(value);
-	parseAVTemplate(0, value, parser);
-	setParser(parser);
-    }
-
-    private void parseAVTemplate(final int start, String text, Parser parser) {
-	String str;
-
-	if (text == null) return;
-
-	// Get first single opening braces
-	int open = start - 2;
-	do {
-	    open = text.indexOf('{', open+2);
-	} while ((open != -1) && 
-		 (open < (text.length()-1)) && 
-		 (text.charAt(open+1) == '{'));
-
-	if (open != -1) {
-	    // Get first single closing braces
-	    int close = open - 2;
-	    do {
-		close = text.indexOf('}', close+2);
-	    } while ((close != -1) && 
-		     (close < (text.length()-1)) && 
-		     (text.charAt(close+1) == '}'));
-	    
-	    // Add literal expressiong before AVT
-	    if (open > start) {
-		str = removeDuplicateBraces(text.substring(start, open));
-		addElement(new LiteralExpr(str));
-	    }
-	    // Add the AVT itself
-	    if (close > open + 1) {
-		str = text.substring(open + 1, close);
-		str = removeDuplicateBraces(text.substring(open+1,close));
-		addElement(parser.parseExpression(this, str));
-	    }
-	    // Parse rest of string
-	    parseAVTemplate(close + 1, text, parser);
-	    
-	}
-	else if (start < text.length()) {
-	    // Add literal expression following AVT
-	    str = removeDuplicateBraces(text.substring(start));
-	    addElement(new LiteralExpr(str));
-	}
-    }
-
-    public String removeDuplicateBraces(String orig) {
-	String result = orig;
-	int index;
-
-	while ((index = result.indexOf("{{")) != -1) {
-	    result = result.substring(0,index) + 
-		result.substring(index+1,result.length());
-	}
-
-	while ((index = result.indexOf("}}")) != -1) {
-	    result = result.substring(0,index) + 
-		result.substring(index+1,result.length());
-	}
-
-	return(result);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Vector contents = getContents();
-	final int n = contents.size();
-	for (int i = 0; i < n; i++) {
-	    final Expression exp = (Expression)contents.elementAt(i);
-	    if (!exp.typeCheck(stable).identicalTo(Type.String)) {
-		contents.setElementAt(new CastExpr(exp, Type.String), i);
-	    }
-	}
-	return _type = Type.String;
-    }
-
-    public String toString() {
-	final StringBuffer buffer = new StringBuffer("AVT:[");
-	final int count = elementCount();
-	for (int i = 0; i < count; i++) {
-	    buffer.append(elementAt(i).toString());
-	    if (i < count - 1)
-		buffer.append(' ');
-	}
-	return buffer.append(']').toString();
-    }
-		
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	if (elementCount() == 1) {
-	    final Expression exp = (Expression)elementAt(0);
-	    exp.translate(classGen, methodGen);
-	}
-	else {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final InstructionList il = methodGen.getInstructionList();
-	    final int initBuffer = cpg.addMethodref(STRING_BUFFER_CLASS,
-						    "<init>", "()V");
-	    final Instruction append =
-		new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS,
-						   "append",
-						   "(" + STRING_SIG + ")"
-						   + STRING_BUFFER_SIG));
-	    
-	    final int toString = cpg.addMethodref(STRING_BUFFER_CLASS,
-						  "toString",
-						  "()"+STRING_SIG);
-	    il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
-	    il.append(DUP);
-	    il.append(new INVOKESPECIAL(initBuffer));
-	    // StringBuffer is on the stack
-	    final Enumeration enum = elements();
-	    while (enum.hasMoreElements()) {
-		final Expression exp = (Expression)enum.nextElement();
-		exp.translate(classGen, methodGen);
-		il.append(append);
-	    }
-	    il.append(new INVOKEVIRTUAL(toString));
-	}
-    }
-
-    private void check(String value) {
-	// !!! how about quoted/escaped braces?
-	if (value == null) return;
-
-	final char[] chars = value.toCharArray();
-	int level = 0;
-	for (int i = 0; i < chars.length; i++) {
-	    switch (chars[i]) {
-	    case '{':
-		if (((i+1) == (chars.length)) || (chars[i+1] != '{'))
-		    ++level;
-		else
-		    i++;
-		break;
-	    case '}':	
-		if (((i+1) == (chars.length)) || (chars[i+1] != '}'))
-		    --level;
-		else
-		    i++;
-		break;
-	    default:
-		continue;
-	    }
-	    switch (level) {
-	    case 0:
-	    case 1:
-		continue;
-	    default:
-		throw new Error("bad AttributeValueTemplate: " + value);
-	    }
-	}
-	if (level != 0)
-	    throw new Error("bad AttributeValueTemplate: " + value);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/BinOpExpr.java b/src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
deleted file mode 100644
index e11526d..0000000
--- a/src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class BinOpExpr extends Expression {
-    public static final int PLUS  = 0;
-    public static final int MINUS = 1;
-    public static final int TIMES = 2;
-    public static final int DIV   = 3;
-    public static final int MOD   = 4;
-	
-    private static final String[] Ops = {
-	"+", "-", "*", "/", "%"
-    };
-
-    private int _op;
-    private Expression _left, _right;
-	
-    public BinOpExpr(int op, Expression left, Expression right) {
-	_op = op;
-	(_left = left).setParent(this);
-	(_right = right).setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-	_right.setParser(parser);
-    }
-    
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type tleft = _left.typeCheck(stable); 
-	final Type tright = _right.typeCheck(stable);
-	final MethodType ptype = lookupPrimop(stable, Ops[_op],
-					      new MethodType(Type.Void,
-							     tleft, tright)); 
-	if (ptype != null) {
-	    final Type arg1 = (Type) ptype.argsType().elementAt(0);
-	    if (!arg1.identicalTo(tleft)) {
-		_left = new CastExpr(_left, arg1);
-	    }
-	    final Type arg2 = (Type) ptype.argsType().elementAt(1);
-	    if (!arg2.identicalTo(tright)) {
-		_right = new CastExpr(_right, arg1);
-	    }
-	    return _type = ptype.resultType();
-	}
-	throw new TypeCheckError(this);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-
-	_left.translate(classGen, methodGen);
-	_right.translate(classGen, methodGen);
-
-	switch (_op) {
-	case PLUS:
-	    il.append(_type.ADD());
-	    break;
-	case MINUS:
-	    il.append(_type.SUB());
-	    break;
-	case TIMES:
-	    il.append(_type.MUL());
-	    break;
-	case DIV:
-	    il.append(_type.DIV());
-	    break;
-	case MOD:
-	    il.append(_type.REM());
-	    break;
-	default:
-	    final ErrorMsg msg =
-		new ErrorMsg("Unknown operator for binary expression");
-	    getParser().reportError(Constants.ERROR, msg);
-	}
-    }
-
-    public String toString() {
-	return Ops[_op] + '(' + _left + ", " + _right + ')';
-    }
-} 
diff --git a/src/org/apache/xalan/xsltc/compiler/BooleanCall.java b/src/org/apache/xalan/xsltc/compiler/BooleanCall.java
deleted file mode 100644
index 2b9197d..0000000
--- a/src/org/apache/xalan/xsltc/compiler/BooleanCall.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class BooleanCall extends FunctionCall {
-
-    private Expression _arg = null;
-
-    public BooleanCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-	_arg = argument(0);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_arg.typeCheck(stable);
-	return _type = Type.Boolean;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	_arg.translate(classGen, methodGen);
-	final Type targ = _arg.getType();
-	if (!targ.identicalTo(Type.Boolean)) {
-	    _arg.startResetIterator(classGen, methodGen);
-	    targ.translateTo(classGen, methodGen, Type.Boolean);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/BooleanExpr.java b/src/org/apache/xalan/xsltc/compiler/BooleanExpr.java
deleted file mode 100644
index 65bc38a..0000000
--- a/src/org/apache/xalan/xsltc/compiler/BooleanExpr.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-/**
- * This class implements inlined calls to the XSLT standard functions 
- * true() and false().
- */
-final class BooleanExpr extends Expression {
-    private boolean _value;
-
-    public BooleanExpr(boolean value) {
-	_value = value;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_type = Type.Boolean;
-	return _type;
-    }
-
-    public String toString() {
-	return _value ? "true()" : "false()";
-    }
-
-    public boolean getValue() {
-	return _value;
-    }
-
-    public boolean contextDependent() {
-	return false;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-	il.append(new PUSH(cpg, _value));
-    }
-
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	if (_value) {
-	    il.append(NOP);	// true list falls through
-	}
-	else {
-	    _falseList.add(il.append(new GOTO(null)));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/CallTemplate.java b/src/org/apache/xalan/xsltc/compiler/CallTemplate.java
deleted file mode 100644
index ab6e800..0000000
--- a/src/org/apache/xalan/xsltc/compiler/CallTemplate.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class CallTemplate extends Instruction {
-    private QName _name;
-
-    public void display(int indent) {
-	indent(indent);
-	System.out.print("CallTemplate");
-	Util.println(" name " + _name);
-	displayContents(indent + IndentIncrement);
-    }
-		
-    public boolean hasWithParams() {
-	return elementCount() > 0;
-    }
-
-    public void parseContents(Parser parser) {
-	_name = parser.getQName(getAttribute("name"));
-	parseChildren(parser);
-    }
-		
-    /**
-     * Verify that a template with this name exists.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Template template = stable.lookupTemplate(_name);
-	if (template != null) {
-	    typeCheckContents(stable);
-	}
-	else {
-	    ErrorMsg errorMsg = new ErrorMsg(ErrorMsg.TMPUNDEF_ERR, _name);
-	    throw new TypeCheckError(errorMsg);
-	}
-	return Type.Void;
-    }
-
-    /**
-     * Translate call-template.
-     * A parameter frame is pushed only if some template in the stylesheet
-     * uses parameters.
-     * TODO: optimize by checking if the callee has parameters.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final Stylesheet stylesheet = classGen.getStylesheet();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Push a new parameter frame
-	if (stylesheet.hasLocalParams() || hasContents()) {
-	    il.append(classGen.loadTranslet()); // push param frame
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS, 
-							 PUSH_PARAM_FRAME,
-							 PUSH_PARAM_FRAME_SIG)
-					));
-
-	    // translate with-params
-	    translateContents(classGen, methodGen);
-	}
-
-	final String className = stylesheet.getClassName();
-	// Generate a valid Java method name
-	String methodName = _name.toString();
-	methodName = methodName.replace('.', '$');
-	methodName = methodName.replace('-', '$');
-
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadDOM());
-	il.append(methodGen.loadIterator());
-	il.append(methodGen.loadHandler());
-	il.append(methodGen.loadCurrentNode());
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
-						     methodName,
-						     "("
-						     + DOM_INTF_SIG
-						     + NODE_ITERATOR_SIG
-						     + TRANSLET_OUTPUT_SIG
-						     + NODE_SIG
-						     +")V")));
-	
-
-	// Pop parameter frame
-	if (stylesheet.hasLocalParams() || hasContents()) {
-	    il.append(classGen.loadTranslet()); // pop param frame
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 POP_PARAM_FRAME,
-							 POP_PARAM_FRAME_SIG)
-					));
-	    
-	}
-    }
-} 
diff --git a/src/org/apache/xalan/xsltc/compiler/CastExpr.java b/src/org/apache/xalan/xsltc/compiler/CastExpr.java
deleted file mode 100644
index 6823abf..0000000
--- a/src/org/apache/xalan/xsltc/compiler/CastExpr.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class CastExpr extends Expression {
-    private final Expression _left;
-
-    /**
-     * Legal conversions between internal types.
-     */
-    static private MultiHashtable InternalTypeMap = new MultiHashtable();
-
-    static {
-	// Possible type conversions between internal types
-	InternalTypeMap.put(Type.Boolean, Type.Boolean);
-	InternalTypeMap.put(Type.Boolean, Type.Real);
-	InternalTypeMap.put(Type.Boolean, Type.String);
-	InternalTypeMap.put(Type.Boolean, Type.Reference);
-
-	InternalTypeMap.put(Type.Real, Type.Real);
-	InternalTypeMap.put(Type.Real, Type.Int);
-	InternalTypeMap.put(Type.Real, Type.Boolean);
-	InternalTypeMap.put(Type.Real, Type.String);
-	InternalTypeMap.put(Type.Real, Type.Reference);
-
-	InternalTypeMap.put(Type.Int, Type.Int);
-	InternalTypeMap.put(Type.Int, Type.Real);
-	InternalTypeMap.put(Type.Int, Type.Boolean);
-	InternalTypeMap.put(Type.Int, Type.String);
-	InternalTypeMap.put(Type.Int, Type.Reference);
-
-	InternalTypeMap.put(Type.String, Type.String);
-	InternalTypeMap.put(Type.String, Type.Boolean);
-	InternalTypeMap.put(Type.String, Type.Real);
-	InternalTypeMap.put(Type.String, Type.Reference);
-
-	InternalTypeMap.put(Type.NodeSet, Type.NodeSet);
-	InternalTypeMap.put(Type.NodeSet, Type.Boolean);
-	InternalTypeMap.put(Type.NodeSet, Type.Real);
-	InternalTypeMap.put(Type.NodeSet, Type.String);
-	InternalTypeMap.put(Type.NodeSet, Type.Node);
-	InternalTypeMap.put(Type.NodeSet, Type.Reference);
-
-	InternalTypeMap.put(Type.Node, Type.Node);
-	InternalTypeMap.put(Type.Node, Type.Boolean);
-	InternalTypeMap.put(Type.Node, Type.Real);
-	InternalTypeMap.put(Type.Node, Type.String);
-	InternalTypeMap.put(Type.Node, Type.NodeSet);
-	InternalTypeMap.put(Type.Node, Type.Reference);
-
-	InternalTypeMap.put(Type.ResultTree, Type.ResultTree);
-	InternalTypeMap.put(Type.ResultTree, Type.Boolean);
-	InternalTypeMap.put(Type.ResultTree, Type.Real);
-	InternalTypeMap.put(Type.ResultTree, Type.String);
-	InternalTypeMap.put(Type.ResultTree, Type.NodeSet);
-	InternalTypeMap.put(Type.ResultTree, Type.Reference);
-
-	InternalTypeMap.put(Type.Reference, Type.Reference);
-	InternalTypeMap.put(Type.Reference, Type.Boolean);
-	InternalTypeMap.put(Type.Reference, Type.Int);
-	InternalTypeMap.put(Type.Reference, Type.Real);
-	InternalTypeMap.put(Type.Reference, Type.String);
-	InternalTypeMap.put(Type.Reference, Type.Node);
-	InternalTypeMap.put(Type.Reference, Type.NodeSet);
-
-	InternalTypeMap.put(Type.Void, Type.String);
-    }
-
-    private boolean _typeTest = false;
-
-    /**
-     * Construct a cast expression and check that the conversion is 
-     * valid by calling typeCheck().
-     */
-    public CastExpr(Expression left, Type type) throws TypeCheckError {
-	_left = left;
-	_type = type;		// use inherited field
-
-	if ((_left instanceof Step) && (_type == Type.Boolean)) {
-	    Step step = (Step)_left;
-	    if ((step.isSelf()) && (step.getNodeType() != -1)) 
-		_typeTest = true;
-	}
-	
-	// check if conversion is valid
-	setParser(left.getParser());
-	setParent(left.getParent());
-	left.setParent(this);
-	typeCheck(left.getParser().getSymbolTable());
-    }
-		
-    public Expression getExpr() {
-	return _left;
-    }
-
-    public String toString() {
-	return "cast(" + _left + ", " + _type + ")";
-    }
-
-    /**
-     * Type checking a cast expression amounts to verifying that the  
-     * type conversion is legal. Cast expressions are created during 
-     * type checking, but typeCheck() is usually not called on them. 
-     * As a result, this method is called from the constructor.
-     */	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	Type tleft = _left.getType();
-	if (tleft == null) {
-	    tleft = _left.typeCheck(stable);
-	}
-	if (tleft instanceof NodeType) {
-	    tleft = Type.Node;	// multiple instances
-	}
-	else if (tleft instanceof ResultTreeType) {
-	    tleft = Type.ResultTree; // multiple instances
-	}
-	if (InternalTypeMap.maps(tleft, _type)) {
-	    return _type;
-	}
-	throw new TypeCheckError(this);	
-    }
-
-    public void translateDesynthesized(ClassGenerator classGen, 
-				       MethodGenerator methodGen) {
-	FlowList fl;
-	final Type ltype = _left.getType();
-
-	// This is a special case for the self:: axis. Instead of letting
-	// the Step object create and iterator that we cast back to a single
-	// node, we simply ask the DOM for the node type.
-	if (_typeTest) {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final InstructionList il = methodGen.getInstructionList();
-
-	    final int idx = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getType", "(I)I");
-	    il.append(new SIPUSH((short)((Step)_left).getNodeType()));
-	    il.append(methodGen.loadDOM());
-	    il.append(methodGen.loadContextNode());
-	    il.append(new INVOKEINTERFACE(idx, 2));
-	    _falseList.add(il.append(new IF_ICMPNE(null)));
-	}
-	else {
-
-	    _left.translate(classGen, methodGen);
-	    if (_type != ltype) {
-		_left.startResetIterator(classGen, methodGen);
-		if (_type instanceof BooleanType) {
-		    fl = ltype.translateToDesynthesized(classGen, methodGen,
-							_type);
-		    if (fl != null) {
-			_falseList.append(fl);
-		    }
-		}
-		else {
-		    ltype.translateTo(classGen, methodGen, _type);	
-		}
-	    }
-	}
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final Type ltype = _left.getType();
-	_left.translate(classGen, methodGen);
-	if (_type.identicalTo(ltype) == false) {
-	    _left.startResetIterator(classGen, methodGen);
-	    ltype.translateTo(classGen, methodGen, _type);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/CeilingCall.java b/src/org/apache/xalan/xsltc/compiler/CeilingCall.java
deleted file mode 100644
index e5d1181..0000000
--- a/src/org/apache/xalan/xsltc/compiler/CeilingCall.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class CeilingCall extends FunctionCall {
-    public CeilingCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	argument(0).translate(classGen, methodGen);
-	il.append(new INVOKESTATIC(cpg.addMethodref(MATH_CLASS,
-						    "ceil", "(D)D")));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Choose.java b/src/org/apache/xalan/xsltc/compiler/Choose.java
deleted file mode 100644
index 625170b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Choose.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Choose extends Instruction {
-
-    private final static String MISSING_WHEN_ERROR =
-	"At least one When element required in Choose";
-    private final static String ILLEGAL_ELEMENT_ERROR =
-	"Only When|Otherwise elements allowed in Choose";
-    private final static String MULTIPLE_OTHERWISE_ERROR =
-	"Only one Otherwise element allowed in Choose";
-
-    /**
-     * Display the element contents (a lot of when's and an otherwise)
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Choose");
-	indent(indent + IndentIncrement);
-	displayContents(indent + IndentIncrement);
-    }
-	
-    /**
-     * Translate this Choose element. Generate a test-chain for the various
-     * <xsl:when> elements and default to the <xsl:otherwise> if present.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final Vector whenElements = new Vector();
-	Otherwise otherwise = null;
-	Enumeration elements = elements();
-
-	// These two are for reporting errors only
-	ErrorMsg error = null;
-	final int line = getLineNumber();
-
-	// Traverse all child nodes - must be either When or Otherwise
-	while (elements.hasMoreElements()) {
-	    Object element = elements.nextElement();
-	    // Add a When child element
-	    if (element instanceof When) {
-		whenElements.addElement(element);
-	    }
-	    // Add an Otherwise child element
-	    else if (element instanceof Otherwise) {
-		if (otherwise == null) {
-		    otherwise = (Otherwise)element;
-		}
-		else {
-		    error = new ErrorMsg(MULTIPLE_OTHERWISE_ERROR, line);
-		    getParser().reportError(Constants.ERROR, error);
-		}
-	    }
-	    // It is an error if we find some other element here
-	    else {
-		error = new ErrorMsg(ILLEGAL_ELEMENT_ERROR, line);
-		getParser().reportError(Constants.ERROR, error);
-	    }
-	}
-
-	// Make sure that there is at least one <xsl:when> element
-	if (whenElements.size() == 0) {
-	    error = new ErrorMsg(MISSING_WHEN_ERROR, getLineNumber());
-	    getParser().reportError(Constants.ERROR, error);
-	    return;
-	}
-
-	InstructionList il = methodGen.getInstructionList();
-
-	// next element will hold a handle to the beginning of next
-	// When/Otherwise if test on current When fails
-	BranchHandle nextElement = null;
-	Vector exitHandles = new Vector();
-	InstructionHandle exit = null;
-
-	Enumeration whens = whenElements.elements();
-	while (whens.hasMoreElements()) {
-	    final When when = (When)whens.nextElement();
-	    final Expression test = when.getTest();
-
-	    InstructionHandle truec = il.getEnd();
-
-	    if (nextElement != null) 
-		nextElement.setTarget(il.append(NOP));
-	    test.translateDesynthesized(classGen, methodGen);
-
-	    if (test instanceof FunctionCall) {
-		FunctionCall call = (FunctionCall)test;
-		try {
-		    Type type = call.typeCheck(getParser().getSymbolTable());
-		    if (type != Type.Boolean) {
-			test._falseList.add(il.append(new IFEQ(null)));
-		    }
-		}
-		catch (TypeCheckError e) { 
-		    // handled later!
-		}
-	    }
-	    // remember end of condition
-	    truec = il.getEnd();
-
-	    // The When object should be ignored completely in case it tests
-	    // for the support of a non-available element
-	    if (!when.ignore()) when.translateContents(classGen, methodGen);
-
-	    // goto exit after executing the body of when
-	    exitHandles.addElement(il.append(new GOTO(null)));
-	    if (whens.hasMoreElements() || otherwise != null) {
-		nextElement = il.append(new GOTO(null));
-		test.backPatchFalseList(nextElement);
-	    }
-	    else
-		test.backPatchFalseList(exit = il.append(NOP));
-	    test.backPatchTrueList(truec.getNext());
-	}
-	
-	// Translate any <xsl:otherwise> element
-	if (otherwise != null) {
-	    nextElement.setTarget(il.append(NOP));
-	    otherwise.translateContents(classGen, methodGen);
-	    exit = il.append(NOP);
-	}
-
-	// now that end is known set targets of exit gotos
-	Enumeration exitGotos = exitHandles.elements();
-	while (exitGotos.hasMoreElements()) {
-	    BranchHandle gotoExit = (BranchHandle)exitGotos.nextElement();
-	    gotoExit.setTarget(exit);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Comment.java b/src/org/apache/xalan/xsltc/compiler/Comment.java
deleted file mode 100644
index 582a863..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Comment.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.JavaClass;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Comment extends Instruction {
-
-    public void parseContents(Parser parser) {
-	parseChildren(parser);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	typeCheckContents(stable);
-	return Type.String;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Save the current handler base on the stack
-	il.append(methodGen.loadHandler());
-	il.append(DUP);		// first arg to "comment" call
-
-	// Get the translet's StringValueHandler
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       "stringValueHandler",
-					       STRING_VALUE_HANDLER_SIG)));
-	il.append(DUP);
-	il.append(methodGen.storeHandler());
-
-	// translate contents with substituted handler
-	translateContents(classGen, methodGen);
-
-	// get String out of the handler
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
-						     "getValue",
-						     "()" + STRING_SIG)));
-	// call "comment"
-	final int comment =
-	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-				      "comment", 
-				      "(" + STRING_SIG + ")V");
-	il.append(new INVOKEINTERFACE(comment, 2));
-	// Restore old handler base from stack
-	il.append(methodGen.storeHandler());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/CompilerException.java b/src/org/apache/xalan/xsltc/compiler/CompilerException.java
deleted file mode 100644
index 7abd281..0000000
--- a/src/org/apache/xalan/xsltc/compiler/CompilerException.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-public final class CompilerException extends Exception {
-
-    private String _msg;
-
-    public CompilerException() {
-	super();
-    }
-    
-    public CompilerException(Exception e) {
-	super(e.toString());
-	_msg = e.toString(); 
-    }
-    
-    public CompilerException(String message) {
-	super(message);
-	_msg = message;
-    }
-
-    public String getMessage() {
-	final int col = _msg.indexOf(':');
-
-	if (col > -1)
-	    return(_msg.substring(col));
-	else
-	    return(_msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ConcatCall.java b/src/org/apache/xalan/xsltc/compiler/ConcatCall.java
deleted file mode 100644
index 8477f7b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ConcatCall.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ConcatCall extends FunctionCall {
-    public ConcatCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	for (int i = 0; i < argumentCount(); i++) {
-	    final Expression exp = argument(i);
-	    if (!exp.typeCheck(stable).identicalTo(Type.String)) {
-		setArgument(i, new CastExpr(exp, Type.String));
-	    }
-	}
-	return _type = Type.String;
-    }
-	
-    /** translate leaves a String on the stack */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final int nArgs = argumentCount();
-	
-	switch (nArgs) {
-	case 0:
-	    il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	    break;
-	    
-	case 1:
-	    argument().translate(classGen, methodGen);
-	    break;
-
-	default:
-	    final int initBuffer = cpg.addMethodref(STRING_BUFFER_CLASS,
-						    "<init>", "()V");
-	    final Instruction append =
-		new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS,
-						   "append",
-						   "("+STRING_SIG+")"
-						   +STRING_BUFFER_SIG));
-	    
-	    final int toString = cpg.addMethodref(STRING_BUFFER_CLASS,
-						  "toString",
-						  "()"+STRING_SIG);
-	    
-	    il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
-	    il.append(DUP);
-	    il.append(new INVOKESPECIAL(initBuffer));
-	    for (int i = 0; i < nArgs; i++) {
-		argument(i).translate(classGen, methodGen);
-		il.append(append);
-	    }
-	    il.append(new INVOKEVIRTUAL(toString));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Constants.java b/src/org/apache/xalan/xsltc/compiler/Constants.java
deleted file mode 100644
index 63d360c..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Constants.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import de.fub.bytecode.generic.InstructionConstants;
-
-public interface Constants extends InstructionConstants {
-
-    // Error categories used to report errors to Parser.reportError()
-
-    // Unexpected internal errors, such as null-ptr exceptions, etc.
-    // Immediately terminates compilation, no translet produced
-    public final int INTERNAL        = 0;
-    // XSLT elements that are not implemented and unsupported ext.
-    // Immediately terminates compilation, no translet produced
-    public final int UNSUPPORTED     = 1;
-    // Fatal error in the stylesheet input (parsing or content)
-    // Immediately terminates compilation, no translet produced
-    public final int FATAL           = 2;
-    // Other error in the stylesheet input (parsing or content)
-    // Does not terminate compilation, no translet produced
-    public final int ERROR           = 3;
-    // Other error in the stylesheet input (content errors only)
-    // Does not terminate compilation, a translet is produced
-    public final int WARNING         = 4;
-
-    public static final String EMPTYSTRING = "";
-
-    public static final String NAMESPACE_FEATURE =
-	"http://xml.org/sax/features/namespaces";
-
-    public static final String TRANSLET_INTF
-	= "org.apache.xalan.xsltc.Translet";
-    public static final String TRANSLET_INTF_SIG        
-	= "Lorg/apache/xalan/xsltc/Translet;";
-    
-    public static final String ATTRIBUTES_SIG 
-	= "Lorg/apache/xalan/xsltc/runtime/Attributes;";
-    public static final String NODE_ITERATOR_SIG
-	= "Lorg/apache/xalan/xsltc/NodeIterator;";
-    public static final String DOM_INTF_SIG
-	= "Lorg/apache/xalan/xsltc/DOM;";
-    public static final String DOM_IMPL_CLASS
-	= "org/apache/xalan/xsltc/dom/DOMImpl";
-    public static final String DOM_IMPL_SIG
-	= "Lorg/apache/xalan/xsltc/dom/DOMImpl;";
-    public static final String DOM_ADAPTER_CLASS
-	= "org/apache/xalan/xsltc/dom/DOMAdapter";
-    public static final String DOM_ADAPTER_SIG
-	= "Lorg/apache/xalan/xsltc/dom/DOMAdapter;";
-    public static final String MULTI_DOM_CLASS
-	= "org.apache.xalan.xsltc.dom.MultiDOM";
-    public static final String MULTI_DOM_SIG
-	= "Lorg/apache/xalan/xsltc/dom/MultiDOM;";
-
-    public static final String STRING    
-	= "java.lang.String";
-
-    public static final int ACC_PUBLIC    
-	= de.fub.bytecode.Constants.ACC_PUBLIC;
-    public static final int ACC_SUPER     
-	= de.fub.bytecode.Constants.ACC_SUPER;
-    public static final int ACC_FINAL     
-	= de.fub.bytecode.Constants.ACC_FINAL;
-    public static final int ACC_PRIVATE   
-	= de.fub.bytecode.Constants.ACC_PRIVATE;
-    public static final int ACC_PROTECTED 
-	= de.fub.bytecode.Constants.ACC_PROTECTED;
-
-    public static final String STRING_SIG         
-	= "Ljava/lang/String;";
-    public static final String STRING_BUFFER_SIG  
-	= "Ljava/lang/StringBuffer;";
-    public static final String OBJECT_SIG         
-	= "Ljava/lang/Object;";
-    public static final String DOUBLE_SIG         
-	= "Ljava/lang/Double;";
-    public static final String INTEGER_SIG        
-	= "Ljava/lang/Integer;";
-    public static final String COLLATOR_CLASS
-        = "java/text/Collator";
-    public static final String COLLATOR_SIG
-        = "Ljava/text/Collator;";
-
-    public static final String NODE               
-	= "int";
-    public static final String NODE_ITERATOR      
-	= "org.apache.xalan.xsltc.NodeIterator";
-    public static final String SORT_ITERATOR      
-	= "org.apache.xalan.xsltc.dom.SortingIterator";
-    public static final String SORT_ITERATOR_SIG     
-	= "Lorg.apache.xalan.xsltc.dom.SortingIterator;";
-    public static final String REVERSE_ITERATOR      
-	= "org.apache.xalan.xsltc.dom.ReverseIterator";
-    public static final String NODE_SORT_RECORD 
-	= "org.apache.xalan.xsltc.dom.NodeSortRecord";
-    public static final String NODE_SORT_FACTORY
-	= "org/apache/xalan/xsltc/dom/NodeSortRecordFactory";
-    public static final String NODE_SORT_RECORD_SIG 
-	= "Lorg/apache/xalan/xsltc/dom/NodeSortRecord;";
-    public static final String NODE_SORT_FACTORY_SIG
-	= "Lorg/apache/xalan/xsltc/dom/NodeSortRecordFactory;";
-    public static final String STRING_VALUE_HANDLER
-	= "org.apache.xalan.xsltc.runtime.StringValueHandler";
-    public static final String STRING_VALUE_HANDLER_SIG 
-	= "Lorg/apache/xalan/xsltc/runtime/StringValueHandler;";
-    public static final String OUTPUT_HANDLER
-	= "org/apache/xalan/xsltc/TransletOutputHandler";
-    public static final String OUTPUT_HANDLER_SIG
-	= "Lorg/apache/xalan/xsltc/TransletOutputHandler;";
-    public static final String TEXT_OUTPUT
-	= "org/apache/xalan/xsltc/runtime/TextOutput";
-    public static final String TEXT_OUTPUT_SIG
-	= "Lorg/apache/xalan/xsltc/runtime/TextOutput;";
-    public static final String FILTER_INTERFACE   
-	= "org.apache.xalan.xsltc.dom.Filter";
-    public static final String FILTER_INTERFACE_SIG   
-	= "Lorg/apache/xalan/xsltc/dom/Filter;";
-    public static final String UNION_ITERATOR_CLASS
-	= "org.apache.xalan.xsltc.dom.UnionIterator";
-    public static final String STEP_ITERATOR_CLASS
-	= "org.apache.xalan.xsltc.dom.StepIterator";
-    public static final String NTH_ITERATOR_CLASS
-	= "org.apache.xalan.xsltc.dom.NthIterator";
-    public static final String ABSOLUTE_ITERATOR
-	= "org.apache.xalan.xsltc.dom.AbsoluteIterator";
-    public static final String DUP_FILTERED_ITERATOR
-	= "org.apache.xalan.xsltc.dom.DupFilterIterator";
-    public static final String CURRENT_NODE_LIST_ITERATOR
-	= "org.apache.xalan.xsltc.dom.CurrentNodeListIterator";
-    public static final String CURRENT_NODE_LIST_FILTER
-	= "org.apache.xalan.xsltc.dom.CurrentNodeListFilter";
-    public static final String CURRENT_NODE_LIST_ITERATOR_SIG 
-	= "Lorg/apache/xalan/xsltc/dom/CurrentNodeListIterator;";
-    public static final String CURRENT_NODE_LIST_FILTER_SIG
-	= "Lorg/apache/xalan/xsltc/dom/CurrentNodeListFilter;";
-    public static final String FILTER_STEP_ITERATOR 
-	= "org.apache.xalan.xsltc.dom.FilteredStepIterator";
-    public static final String FILTER_ITERATOR 
-	= "org.apache.xalan.xsltc.dom.FilterIterator";
-    public static final String SINGLETON_ITERATOR 
-	= "org.apache.xalan.xsltc.dom.SingletonIterator";
-    public static final String MATCHING_ITERATOR 
-	= "org.apache.xalan.xsltc.dom.MatchingIterator";
-    public static final String NODE_SIG           
-	= "I";
-    public static final String GET_PARENT         
-	= "getParent";
-    public static final String GET_PARENT_SIG     
-	= "(" + NODE_SIG + ")" + NODE_SIG;
-    public static final String NEXT_SIG           
-	= "()" + NODE_SIG;
-    public static final String NEXT               
-	= "next";
-    public static final String MAKE_NODE          
-	= "makeNode";
-    public static final String MAKE_NODE_LIST     
-	= "makeNodeList";
-    public static final String STRING_TO_REAL     
-	= "stringToReal";
-    public static final String STRING_TO_REAL_SIG 
-	= "(" + STRING_SIG + ")D";
-    public static final String STRING_TO_INT     
-	= "stringToInt";
-    public static final String STRING_TO_INT_SIG 
-	= "(" + STRING_SIG + ")I";
-
-    public static final String XSLT_PACKAGE       
-	= "org.apache.xalan.xsltc";
-    public static final String COMPILER_PACKAGE   
-	= XSLT_PACKAGE + ".compiler";
-    public static final String RUNTIME_PACKAGE    
-	= XSLT_PACKAGE + ".runtime";
-    public static final String TRANSLET_CLASS     
-	= RUNTIME_PACKAGE + ".AbstractTranslet";
-
-    public static final String TRANSLET_SIG        
-	= "Lorg/apache/xalan/xsltc/runtime/AbstractTranslet;";
-    public static final String UNION_ITERATOR_SIG  
-	= "Lorg/apache/xalan/xsltc/dom/UnionIterator;";
-    public static final String TRANSLET_OUTPUT_BASE_SIG    
-	= "Lorg/apache/xalan/xsltc/TransletOutputBase;";
-    public static final String TRANSLET_OUTPUT_SIG    
-	= "Lorg/apache/xalan/xsltc/TransletOutputHandler;";
-    public static final String MAKE_NODE_SIG       
-	= "(I)Lorg/w3c/dom/Node;";
-    public static final String MAKE_NODE_SIG2      
-	= "(" + NODE_ITERATOR_SIG + ")Lorg/w3c/dom/Node;";
-    public static final String MAKE_NODE_LIST_SIG  
-	= "(I)Lorg/w3c/dom/NodeList;";
-    public static final String MAKE_NODE_LIST_SIG2 
-	= "(" + NODE_ITERATOR_SIG + ")Lorg/w3c/dom/NodeList;";
-
-    public static final String LOAD_DOCUMENT_CLASS
-	= "org.apache.xalan.xsltc.dom.LoadDocument";
-
-    public static final String KEY_INDEX_CLASS
-	= "org/apache/xalan/xsltc/dom/KeyIndex";
-    public static final String KEY_INDEX_SIG
-	= "Lorg/apache/xalan/xsltc/dom/KeyIndex;";
-
-    public static final String DOM_INTF
-	= "org.apache.xalan.xsltc.DOM";
-    public static final String DOM_IMPL
-	= "org.apache.xalan.xsltc.dom.DOMImpl";
-    public static final String STRING_CLASS 		
-	= "java.lang.String";
-    public static final String OBJECT_CLASS 		
-	= "java.lang.Object";
-    public static final String BOOLEAN_CLASS 		
-	= "java.lang.Boolean";
-    public static final String STRING_BUFFER_CLASS
-	= "java.lang.StringBuffer";
-
-    public static final String TRANSLET_OUTPUT_BASE       
-	= "org.apache.xalan.xsltc.TransletOutputBase";
-    // output interface
-    public static final String TRANSLET_OUTPUT_INTERFACE
-	= "org.apache.xalan.xsltc.TransletOutputHandler";
-    public static final String BASIS_LIBRARY_CLASS 
-	= "org.apache.xalan.xsltc.runtime.BasisLibrary";
-    public static final String ATTRIBUTE_LIST_IMPL_CLASS 
-	= "org.apache.xalan.xsltc.runtime.AttributeListImpl";
-    public static final String DOUBLE_CLASS       
-	= "java.lang.Double";
-    public static final String INTEGER_CLASS      
-	= "java.lang.Integer";
-    public static final String RUNTIME_NODE_CLASS 
-	= "org.apache.xalan.xsltc.runtime.Node";
-    public static final String MATH_CLASS         
-	= "java.lang.Math";
-
-    public static final String BOOLEAN_VALUE      
-	= "booleanValue";
-    public static final String BOOLEAN_VALUE_SIG  
-	= "()Z";
-    public static final String INT_VALUE          
-	= "intValue";
-    public static final String INT_VALUE_SIG      
-	= "()I";
-    public static final String DOUBLE_VALUE       
-	= "doubleValue";
-    public static final String DOUBLE_VALUE_SIG   
-	= "()D";
-
-    public static final String NODE_PNAME         
-	= "node";
-    public static final String TRANSLET_OUTPUT_PNAME 
-	= "handler";
-    public static final String ITERATOR_PNAME     
-	= "iterator";
-    public static final String DOCUMENT_PNAME     
-	= "document";
-
-    public static final String GET_NODE_NAME      
-	= "getNodeName";
-    public static final String CHARACTERSW        
-	= "characters";
-    public static final String GET_CHILDREN       
-	= "getChildren";
-    public static final String GET_TYPED_CHILDREN 
-	= "getTypedChildren";
-    public static final String CHARACTERS         
-	= "characters";
-    public static final String APPLY_TEMPLATES    
-	= "applyTemplates";
-    public static final String GET_NODE_TYPE      
-	= "getNodeType";
-    public static final String GET_NODE_VALUE     
-	= "getNodeValue";
-    public static final String GET_ELEMENT_VALUE  
-	= "getElementValue";
-    public static final String GET_ATTRIBUTE_VALUE  
-	= "getAttributeValue";
-    public static final String HAS_ATTRIBUTE      
-	= "hasAttribute";
-    public static final String ADD_ITERATOR       
-	= "addIterator";
-    public static final String SET_START_NODE     
-	= "setStartNode";
-    public static final String RESET     	    
-	= "reset";
-
-    public static final String ATTR_SET_SIG
-	= "(" + TRANSLET_OUTPUT_SIG + NODE_ITERATOR_SIG + ")V";
-
-    public static final String GET_NODE_NAME_SIG   
-	= "(" + NODE_SIG + ")" + STRING_SIG;
-    public static final String CHARACTERSW_SIG     
-	= "("  + STRING_SIG + TRANSLET_OUTPUT_SIG + ")V";
-    public static final String CHARACTERS_SIG     
-	= "(" + NODE_SIG + TRANSLET_OUTPUT_SIG + ")V";
-    public static final String GET_CHILDREN_SIG
-	= "(" + NODE_SIG +")" + NODE_ITERATOR_SIG;
-    public static final String GET_TYPED_CHILDREN_SIG
-	= "(I)" + NODE_ITERATOR_SIG;
-    public static final String GET_NODE_TYPE_SIG
-	= "()S";
-    public static final String GET_NODE_VALUE_SIG
-	= "(I)" + STRING_SIG;
-    public static final String GET_ELEMENT_VALUE_SIG
-	= "(I)" + STRING_SIG;
-    public static final String GET_ATTRIBUTE_VALUE_SIG
-	= "(II)" + STRING_SIG;
-    public static final String HAS_ATTRIBUTE_SIG
-	= "(II)Z";
-    public static final String GET_ITERATOR_SIG
-	= "()" + NODE_ITERATOR_SIG;
-
-    public static final String NAMES_INDEX
-	= "namesArray";
-    public static final String NAMES_INDEX_SIG
-	= "[" + STRING_SIG;
-    public static final String NAMESPACE_INDEX
-	= "namespaceArray";
-    public static final String NAMESPACE_INDEX_SIG
-	= "[" + STRING_SIG;
-
-    public static final String DOM_FIELD
-	= "_dom";
-    public static final String FORMAT_SYMBOLS_FIELD	 
-	= "format_symbols";
-
-    public static final String ITERATOR_FIELD_SIG      
-	= NODE_ITERATOR_SIG;
-    public static final String NODE_FIELD		 
-	= "node";
-    public static final String NODE_FIELD_SIG		 
-	= "I";
-	
-    public static final String EMPTYATTR_FIELD	     
-	= "EmptyAttributes";
-    public static final String ATTRIBUTE_LIST_FIELD    
-	= "attributeList";
-    public static final String CLEAR_ATTRIBUTES        
-	= "clear";
-    public static final String ADD_ATTRIBUTE           
-	= "addAttribute";
-    public static final String ATTRIBUTE_LIST_IMPL_SIG 
-	= "Lorg/apache/xalan/xsltc/runtime/AttributeListImpl;";
-    public static final String CLEAR_ATTRIBUTES_SIG    
-	= "()" + ATTRIBUTE_LIST_IMPL_SIG;
-    public static final String ADD_ATTRIBUTE_SIG   
-	= "(" + STRING_SIG + STRING_SIG + ")" + ATTRIBUTE_LIST_IMPL_SIG;
-	
-    public static final String ADD_ITERATOR_SIG   
-	= "(" + NODE_ITERATOR_SIG +")" + UNION_ITERATOR_SIG;
-	
-    public static final String SET_START_NODE_SIG   
-	= "(" + NODE_SIG + ")" + NODE_ITERATOR_SIG;
-
-    public static final String NODE_COUNTER 
-	= "org.apache.xalan.xsltc.dom.NodeCounter";
-    public static final String NODE_COUNTER_SIG 
-	= "Lorg/apache/xalan/xsltc/dom/NodeCounter;";
-    public static final String DEFAULT_NODE_COUNTER 
-	= "org.apache.xalan.xsltc.dom.DefaultNodeCounter";
-    public static final String DEFAULT_NODE_COUNTER_SIG 
-	= "Lorg/apache/xalan/xsltc/dom/DefaultNodeCounter;";
-    public static final String TRANSLET_FIELD 
-	= "translet";
-    public static final String TRANSLET_FIELD_SIG 
-	= TRANSLET_SIG;
-
-    public static final String RESET_SIG   	       
-	= "()" + NODE_ITERATOR_SIG;
-    public static final String GET_PARAMETER      
-	= "getParameter";
-    public static final String ADD_PARAMETER         
-	= "addParameter";
-    public static final String PUSH_PARAM_FRAME
-	= "pushParamFrame";
-    public static final String PUSH_PARAM_FRAME_SIG  
-	= "()V";
-    public static final String POP_PARAM_FRAME       
-	= "popParamFrame";
-    public static final String POP_PARAM_FRAME_SIG   
-	= "()V";
-    public static final String GET_PARAMETER_SIG     
-	= "(" + STRING_SIG + ")" + OBJECT_SIG;
-    public static final String ADD_PARAMETER_SIG
-	= "(" + STRING_SIG + OBJECT_SIG + "Z)" + OBJECT_SIG;
-    public static final String PUSH_VAR_FRAME
-	= "pushVarFrame";
-    public static final String PUSH_VAR_FRAME_SIG
-	= "(I)V";
-    public static final String POP_VAR_FRAME
-	= "popVarFrame";
-    public static final String POP_VAR_FRAME_SIG
-	= "()V";
-    public static final String ADD_VARIABLE
-	= "addVariable";
-    public static final String ADD_VARIABLE_SIG
-	= "(I" + OBJECT_SIG + ")V";
-    public static final String GET_VARIABLE
-	= "getVariable";
-    public static final String GET_VARIABLE_SIG
-	= "(I)" + OBJECT_SIG;
-
-    public static final String STRIP_SPACE
-	= "stripSpace";
-    public static final String STRIP_SPACE_INTF
-	= "org/apache/xalan/xsltc/StripFilter";
-    public static final String STRIP_SPACE_SIG
-	= "Lorg/apache/xalan/xsltc/StripFilter;";
-    public static final String STRIP_SPACE_PARAMS
-	= "(Lorg/apache/xalan/xsltc/DOM;II)Z";
-
-    public static final String GET_NODE_VALUE_ITERATOR
-	= "getNodeValueIterator";
-    public static final String GET_NODE_VALUE_ITERATOR_SIG
-	= "("+NODE_ITERATOR_SIG+STRING_SIG+"Z)"+NODE_ITERATOR_SIG;
-
-    public static final int POSITION_INDEX = 2;
-    public static final int LAST_INDEX     = 3;
-
-    public static final String XSLT_URI
-	= "http://www.w3.org/1999/XSL/Transform";
-    public static final String TRANSLET_URI
-	= "http://xml.apache.org/xalan/xsltc";
-    public static final String FALLBACK_CLASS
-	= "org.apache.xalan.xsltc.compiler.Fallback";
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ContainsCall.java b/src/org/apache/xalan/xsltc/compiler/ContainsCall.java
deleted file mode 100644
index e2b28cf..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ContainsCall.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
-import org.apache.xalan.xsltc.compiler.util.ErrorMsg;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ContainsCall extends FunctionCall {
-
-    private Expression _base = null;
-    private Expression _token = null;
-
-    /**
-     * Create a contains() call - two arguments, both strings
-     */
-    public ContainsCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * This XPath function returns true/false values
-     */
-    public boolean isBoolean() {
-	return true;
-    }
-
-    /**
-     * Type check the two parameters for this function
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-	// Check that the function was passed exactly two arguments
-	if (argumentCount() != 2) {
-	    throw new TypeCheckError(ErrorMsg.FUNRESOL_ERR, getName());
-	}
-
-	// The first argument must be a String, or cast to a String
-	_base = argument(0);
-	Type baseType = _base.typeCheck(stable);	
-	if (baseType != Type.String)
-	    _base = new CastExpr(_base, Type.String);
-
-	// The second argument must also be a String, or cast to a String
-	_token = argument(1);
-	Type tokenType = _token.typeCheck(stable);	
-	if (tokenType != Type.String)
-	    _token = new CastExpr(_token, Type.String);
-
-	return _type = Type.Boolean;
-    }
-
-    /**
-     * Compile the expression - leave boolean expression on stack
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	translateDesynthesized(classGen, methodGen);
-	synthesize(classGen, methodGen);
-    }
-
-    /**
-     * Compile expression and update true/false-lists
-     */
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	_base.translate(classGen, methodGen);
-	_token.translate(classGen, methodGen);
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
-						     "indexOf",
-						     "("+STRING_SIG+")I")));
-	_falseList.add(il.append(new IFLT(null)));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Copy.java b/src/org/apache/xalan/xsltc/compiler/Copy.java
deleted file mode 100644
index dbf01e9..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Copy.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Copy extends Instruction {
-    private UseAttributeSets _useSets;
-    
-    public void parseContents(Parser parser) {
-	final String useSets = getAttribute("use-attribute-sets");
-	if (useSets.length() > 0) {
-	    _useSets = new UseAttributeSets(useSets, parser);
-	}
-	parseChildren(parser);
-    }
-    
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Copy");
-	indent(indent + IndentIncrement);
-	displayContents(indent + IndentIncrement);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_useSets != null) {
-	    _useSets.typeCheck(stable);
-	}
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	final LocalVariableGen name =
-	    methodGen.addLocalVariable2("name",
-					Util.getJCRefType(STRING_SIG),
-					il.getEnd());
-	final LocalVariableGen length =
-	    methodGen.addLocalVariable2("length",
-					Util.getJCRefType("I"),
-					il.getEnd());
-
-	// Get the name of the node to copy and save for later
-	il.append(methodGen.loadDOM());
-	il.append(methodGen.loadCurrentNode());
-	il.append(methodGen.loadHandler());
-	final int cpy = cpg.addInterfaceMethodref(DOM_INTF,
-						  "shallowCopy",
-						  "("
-						  + NODE_SIG
-						  + TRANSLET_OUTPUT_SIG
-						  + ")" + STRING_SIG); 
-	il.append(new INVOKEINTERFACE(cpy, 3));
-	il.append(DUP);
-	il.append(new ASTORE(name.getIndex()));
-	final BranchHandle ifBlock1 = il.append(new IFNULL(null));
-
-	// Get the length of the node name and save for later
-	il.append(new ALOAD(name.getIndex()));
-	final int lengthMethod = cpg.addMethodref(STRING_CLASS,"length","()I");
-	il.append(new INVOKEVIRTUAL(lengthMethod));
-	il.append(new ISTORE(length.getIndex()));
-
-	// Copy in attribute sets if specified
-	if (_useSets != null) {
-	    // If the parent of this element will result in an element being
-	    // output then we know that it is safe to copy out the attributes
-	    final SyntaxTreeNode parent = getParent();
-	    if ((parent instanceof LiteralElement) ||
-		(parent instanceof LiteralElement)) {
-		_useSets.translate(classGen, methodGen);
-	    }
-	    // If not we have to check to see if the copy will result in an
-	    // element being output.
-	    else {
-		// check if element; if not skip to translate body
-		il.append(new ILOAD(length.getIndex()));
-		final BranchHandle ifBlock2 = il.append(new IFEQ(null));
-		// length != 0 -> element -> do attribute sets
-		_useSets.translate(classGen, methodGen);
-		// not an element; root
-		ifBlock2.setTarget(il.append(NOP));
-	    }
-	}
-
-	// Instantiate body of xsl:copy
-	translateContents(classGen, methodGen);
-
-	// Call the output handler's endElement() if we copied an element
-	// (The DOM.shallowCopy() method calls startElement().)
-	il.append(new ILOAD(length.getIndex()));
-	final BranchHandle ifBlock3 = il.append(new IFEQ(null));
-	il.append(methodGen.loadHandler());
-	il.append(new ALOAD(name.getIndex()));
-	il.append(methodGen.endElement());
-	
-	final InstructionHandle end = il.append(NOP);
-	ifBlock1.setTarget(end);
-	ifBlock3.setTarget(end);
-	methodGen.removeLocalVariable(name);
-	methodGen.removeLocalVariable(length);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/CopyOf.java b/src/org/apache/xalan/xsltc/compiler/CopyOf.java
deleted file mode 100644
index 23165f0..0000000
--- a/src/org/apache/xalan/xsltc/compiler/CopyOf.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class CopyOf extends Instruction {
-    private Expression _select;
-	
-    public void display(int indent) {
-	indent(indent);
-	Util.println("CopyOf");
-	indent(indent + IndentIncrement);
-	Util.println("select " + _select.toString());
-    }
-
-    public void parseContents(Parser parser) {
-	_select = parser.parseExpression(this, "select", null);
-        // make sure required attribute(s) have been set
-        if (_select.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "select");
-	    return;
-        }
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type tselect = _select.typeCheck(stable);
-	if (tselect instanceof NodeType ||
-	    tselect instanceof NodeSetType ||
-	    tselect instanceof ReferenceType ||
-	    tselect instanceof ResultTreeType) {
-	    // falls through 
-	}
-	else {
-	    _select = new CastExpr(_select, Type.String);
-	}
-	return Type.Void;
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final Type tselect = _select.getType();
-
-	final String CPY1_SIG = "("+NODE_ITERATOR_SIG+TRANSLET_OUTPUT_SIG+")V";
-	final int cpy1 = cpg.addInterfaceMethodref(DOM_INTF, "copy", CPY1_SIG);
-
-	final String CPY2_SIG = "("+NODE_SIG+TRANSLET_OUTPUT_SIG+")V";
-	final int cpy2 = cpg.addInterfaceMethodref(DOM_INTF, "copy", CPY2_SIG);
-
-	if (tselect instanceof NodeSetType) {
-	    il.append(methodGen.loadDOM());
-
-	    // push NodeIterator
-	    _select.translate(classGen, methodGen);	
-	    _select.startResetIterator(classGen, methodGen);
-
-	    // call copy from the DOM 'library'
-	    il.append(methodGen.loadHandler());
-	    il.append(new INVOKEINTERFACE(cpy1, 3));
-	}
-	else if (tselect instanceof NodeType) {
-	    il.append(methodGen.loadDOM());
-	    _select.translate(classGen, methodGen);	
-	    il.append(methodGen.loadHandler());
-	    il.append(new INVOKEINTERFACE(cpy2, 3));
-	}
-	else if (tselect instanceof ResultTreeType) {
-	    _select.translate(classGen, methodGen);	
-	    // We want the whole tree, so we start with the root node
-	    il.append(ICONST_1);
-	    il.append(methodGen.loadHandler());
-	    il.append(new INVOKEINTERFACE(cpy2, 3));
-	}
-	else if (tselect instanceof ReferenceType) {
-	    _select.translate(classGen, methodGen);
-	    il.append(methodGen.loadHandler());
-	    il.append(methodGen.loadCurrentNode());
-	    il.append(methodGen.loadDOM());
-	    final int copy = cpg.addMethodref(BASIS_LIBRARY_CLASS, "copy",
-					      "(" 
-					      + OBJECT_SIG  
-					      + TRANSLET_OUTPUT_SIG 
-					      + NODE_SIG
-					      + DOM_INTF_SIG
-					      + ")V");
-	    il.append(new INVOKESTATIC(copy));
-	}
-	else {
-	    il.append(classGen.loadTranslet());
-	    _select.translate(classGen, methodGen);	
-	    il.append(methodGen.loadHandler());
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 CHARACTERSW,
-							 CHARACTERSW_SIG)));
-	}
-
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/CurrentCall.java b/src/org/apache/xalan/xsltc/compiler/CurrentCall.java
deleted file mode 100644
index 3d52633..0000000
--- a/src/org/apache/xalan/xsltc/compiler/CurrentCall.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class CurrentCall extends FunctionCall {
-    public CurrentCall(QName fname) {
-	super(fname);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	methodGen.getInstructionList().append(methodGen.loadCurrentNode());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java b/src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java
deleted file mode 100644
index b32d79e..0000000
--- a/src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-import org.apache.xalan.xsltc.runtime.AttributeList;
-import org.apache.xalan.xsltc.compiler.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class DecimalFormatting extends TopLevelElement {
-
-    private static final String DFS_CLASS = "java.text.DecimalFormatSymbols";
-    private static final String DFS_SIG   = "Ljava/text/DecimalFormatSymbols;";
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void;
-    }
-
-    /**
-     * This method is called when the constructor is compiled in
-     * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-	
-	// DecimalFormatSymbols.<init>();
-	final int init = cpg.addMethodref(DFS_CLASS, "<init>", "()V");
-
-	// Push the format name on the stack for call to addDecimalFormat()
-	il.append(classGen.loadTranslet());
-	il.append(new PUSH(cpg, getAttribute("name")));
-
-	// Manufacture a DecimalFormatSymbols on the stack
-	// for call to addDecimalFormat()
-	il.append(new NEW(cpg.addClass(DFS_CLASS)));
-	il.append(DUP);
-	il.append(new INVOKESPECIAL(init));
-	
-	final int nAttributes = _attributes.getLength();
-	for (int i = 0; i < nAttributes; i++) {
-	    final String name = _attributes.getQName(i);
-	    final String value = _attributes.getValue(i);
-
-	    boolean valid = true;
-	    int method = 0;
-
-	    if (name.equals("decimal-separator")) {
-		// DecimalFormatSymbols.setDecimalSeparator();
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setDecimalSeparator", "(C)V");
-	    }
-	    else if (name.equals("grouping-separator")) {
-		method =  cpg.addMethodref(DFS_CLASS,
-					   "setGroupingSeparator", "(C)V");
-	    }
-	    else if (name.equals("minus-sign")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setMinusSign", "(C)V");
-	    }
-	    else if (name.equals("percent")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setPercent", "(C)V");
-	    }
-	    else if (name.equals("per-mille")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setPerMill", "(C)V");
-	    }
-	    else if (name.equals("zero-digit")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setZeroDigit", "(C)V");
-	    }
-	    else if (name.equals("digit")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setDigit", "(C)V");
-	    }
-	    else if (name.equals("pattern-separator")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setPatternSeparator", "(C)V");
-	    }
-	    else if (name.equals("NaN")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setNaN", "(Ljava/lang/String;)V");
-	        il.append(DUP);
-		il.append(new PUSH(cpg, value));
-		il.append(new INVOKEVIRTUAL(method));
-		valid = false;
-	    }
-	    else if (name.equals("infinity")) {
-		method = cpg.addMethodref(DFS_CLASS,
-					  "setInfinity",
-					  "(Ljava/lang/String;)V");
-	        il.append(DUP);
-		il.append(new PUSH(cpg, value));
-		il.append(new INVOKEVIRTUAL(method));
-		valid = false;
-	    }
-	    else {
-		valid = false;
-	    }
-
-	    if (valid) {
-		il.append(DUP);
-		il.append(new PUSH(cpg, value.charAt(0)));
-		il.append(new INVOKEVIRTUAL(method));
-	    }
-
-	}
-
-	final int put = cpg.addMethodref(TRANSLET_CLASS,
-					 "addDecimalFormat",
-					 "("+STRING_SIG+DFS_SIG+")V");
-	il.append(new INVOKEVIRTUAL(put));
-    }
-
-    /**
-     * Creates the default, nameless, DecimalFormat object in
-     * AbstractTranslet's format_symbols hashtable.
-     * This should be called for every stylesheet, and the entry
-     * may be overridden by later nameless xsl:decimal-format instructions.
-     */
-    public static void translateDefaultDFS(ClassGenerator classGen,
-					   MethodGenerator methodGen) {
-
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-	final int init = cpg.addMethodref(DFS_CLASS, "<init>", "()V");
-
-	// Push the format name, which is empty, on the stack
-	// for call to addDecimalFormat()
-	il.append(classGen.loadTranslet());
-	il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-
-	// Manufacture a DecimalFormatSymbols on the stack
-	// for call to addDecimalFormat()
-	il.append(new NEW(cpg.addClass(DFS_CLASS)));
-	il.append(DUP);
-	il.append(new INVOKESPECIAL(init));
-
-	final int put = cpg.addMethodref(TRANSLET_CLASS,
-					 "addDecimalFormat",
-					 "("+STRING_SIG+DFS_SIG+")V");
-	il.append(new INVOKEVIRTUAL(put));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/DocumentCall.java b/src/org/apache/xalan/xsltc/compiler/DocumentCall.java
deleted file mode 100644
index 1493573..0000000
--- a/src/org/apache/xalan/xsltc/compiler/DocumentCall.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
-import org.apache.xalan.xsltc.compiler.util.ErrorMsg;
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class DocumentCall extends FunctionCall {
-
-    private Expression _uri = null;
-    private Expression _base = null;
-    private Type       _uriType;
-
-    /**
-     * Default function call constructor
-     */
-    public DocumentCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * Type checks the arguments passed to the document() function. The first
-     * argument can be any type (we must cast it to a string) and contains the
-     * URI of the document
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// At least one argument - two at most
-	final int ac = argumentCount();
-	if ((ac < 1) || (ac > 2)) {
-	    ErrorMsg msg = new ErrorMsg("Illegal number of arguments "+
-					"to document() function");
-	    throw new TypeCheckError(msg);
-	}
-
-	// Parse the first argument - the document URI
-	_uri = argument(0);
-	if (_uri instanceof LiteralExpr) {
-	    LiteralExpr expr = (LiteralExpr)_uri;
-	    if (expr.getValue().equals(Constants.EMPTYSTRING)) {
-		Stylesheet stylesheet = getStylesheet();
-		if (stylesheet == null) {
-		    ErrorMsg msg = new ErrorMsg("Illegal argument "+
-						"to document() function");
-		    throw new TypeCheckError(msg);
-		}
-		_uri = new LiteralExpr(stylesheet.getSystemId(),
-				       Constants.EMPTYSTRING);
-	    }
-	}
-
-	_uriType = _uri.typeCheck(stable);
-	if ((_uriType != Type.NodeSet) && (_uriType != Type.String)) {
-	    _uri = new CastExpr(_uri, Type.String);
-	}
-
-	// Parse the second argument - the document URI base
-	if (ac == 2) {
-	    _base = argument(1);
-	    if (!_base.typeCheck(stable).identicalTo(Type.NodeSet)) {
-		ErrorMsg msg = new ErrorMsg("Second argument to document() "+
-					    "function must be a node-set.");
-		throw new TypeCheckError(msg);
-	    }
-	}
-
-	return _type = Type.NodeSet;
-    }
-	
-    /**
-     * Translates the document() function call to a call to LoadDocument()'s
-     * static method document().
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	final int domField = cpg.addFieldref(classGen.getClassName(),
-					     DOM_FIELD,
-					     DOM_INTF_SIG);
-	final String docParamList =
-	    "("+OBJECT_SIG+STRING_SIG+TRANSLET_SIG+DOM_INTF_SIG+")"+
-	    NODE_ITERATOR_SIG;
-	final int docIdx = cpg.addMethodref(LOAD_DOCUMENT_CLASS,
-					    "document", docParamList);
-
-	final int uriIdx = cpg.addInterfaceMethodref(DOM_INTF,
-						     "getDocumentURI",
-						     "(I)"+STRING_SIG);
-
-	final int nextIdx = cpg.addInterfaceMethodref(NODE_ITERATOR,
-						      NEXT, NEXT_SIG);
-
-	// The URI can be either a node-set or something else cast to a string
-	_uri.translate(classGen, methodGen);
-	if (_uriType == Type.NodeSet)
-	    _uri.startResetIterator(classGen, methodGen);
-
-	// The base of the URI may be given as a second argument (a node-set)
-	il.append(methodGen.loadDOM());
-	if (_base != null) {
-	    _base.translate(classGen, methodGen);
-	    il.append(new INVOKEINTERFACE(nextIdx, 1));
-	}
-	else {
-	     il.append(methodGen.loadContextNode());
-	}
-	il.append(new INVOKEINTERFACE(uriIdx, 2));
-
-	// Feck the rest of the parameters on the stack
-	il.append(classGen.loadTranslet());
-	il.append(DUP);
-	il.append(new GETFIELD(domField));
-	il.append(new INVOKESTATIC(docIdx));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java b/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
deleted file mode 100644
index 52f0a37..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.HashSet;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ElementAvailableCall extends FunctionCall {
-
-    public ElementAvailableCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * Force the argument to this function to be a literal string.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (argument() instanceof LiteralExpr) {
-	    return _type = Type.Boolean;
-	}
-	throw new TypeCheckError(ErrorMsg.LITERALS_ERR, "element-available");
-    }
-
-    /**
-     * Returns the result that this function will return
-     */
-    public boolean getResult() {
-	final Parser parser = getParser();
-	final LiteralExpr arg = (LiteralExpr)argument();
-	final QName qname = parser.getQName(arg.getValue());
-	return(parser.elementSupported(qname));
-    }
-
-    /**
-     * Calls to 'element-available' are resolved at compile time since 
-     * the namespaces declared in the stylsheet are not available at run
-     * time. Consequently, arguments to this function must be literals.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final boolean result = getResult();
-	methodGen.getInstructionList().append(new PUSH(cpg, result));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/EqualityExpr.java b/src/org/apache/xalan/xsltc/compiler/EqualityExpr.java
deleted file mode 100644
index 2be43e7..0000000
--- a/src/org/apache/xalan/xsltc/compiler/EqualityExpr.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import org.apache.xalan.xsltc.runtime.Operators;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class EqualityExpr extends Expression implements Operators {
-    private final int _op;
-    private Expression _left;
-    private Expression _right;
-		
-    public EqualityExpr(int op, Expression left, Expression right) {
-	_op = op;
-	(_left = left).setParent(this);
-	(_right = right).setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-	_right.setParser(parser);
-    }
-    
-    public String toString() {
-	return Operators.names[_op] + '(' + _left + ", " + _right + ')';
-    }
-
-    public Expression getLeft() {
-	return _left;
-    }
-
-    public Expression getRight() {
-	return _right;
-    }
-
-    public boolean getOp() {
-	if (_op == Operators.NE)
-	    return false;
-	else
-	    return true;
-    }
-
-    private void swapArguments() {
-	final Expression temp = _left;
-	_left = _right;
-	_right = temp;
-    }
-
-    /**
-     * Typing rules: see XSLT Reference by M. Kay page 345.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type tleft = _left.typeCheck(stable); 
-	final Type tright = _right.typeCheck(stable);
-
-	if (tleft.isSimple() && tright.isSimple()) {
-	    if (tleft != tright) {
-		if (tleft instanceof BooleanType) {
-		    _right = new CastExpr(_right, Type.Boolean);
-		}
-		else if (tright instanceof BooleanType) {
-		    _left = new CastExpr(_left, Type.Boolean);
-		}
-		else if (tleft instanceof NumberType || 
-			 tright instanceof NumberType) {
-		    _left = new CastExpr(_left, Type.Real);
-		    _right = new CastExpr(_right, Type.Real);
-		}
-		else {		// both compared as strings
-		    _left = new CastExpr(_left,   Type.String);
-		    _right = new CastExpr(_right, Type.String);
-		}
-	    }
-	}
-	else if (tleft instanceof ReferenceType) {
-	    _right = new CastExpr(_right, Type.Reference);
-	}
-	else if (tright instanceof ReferenceType) {
-	    _left = new CastExpr(_left, Type.Reference);
-	}
-	// the following 2 cases optimize @attr|.|.. = 'string'
-	else if (tleft instanceof NodeType && tright == Type.String) {
-	    _left = new CastExpr(_left, Type.String);
-	}
-	else if (tleft == Type.String && tright instanceof NodeType) {
-	    _right = new CastExpr(_right, Type.String);
-	}
-	// optimize node/node
-	else if (tleft instanceof NodeType && tright instanceof NodeType) {
-	    _left = new CastExpr(_left, Type.String);
-	    _right = new CastExpr(_right, Type.String);
-	}
-	else if (tleft instanceof NodeType && tright instanceof NodeSetType) {
-	    // compare(Node, NodeSet) will be invoked
-	}
-	else if (tleft instanceof NodeSetType && tright instanceof NodeType) {
-	    swapArguments();	// for compare(Node, NodeSet)
-	}
-	else {	
-	    // At least one argument is of type node, node-set or result-tree
-
-	    // Promote an expression of type node to node-set
-	    if (tleft instanceof NodeType) {
-		_left = new CastExpr(_left, Type.NodeSet);
-	    }
-	    if (tright instanceof NodeType) {
-		_right = new CastExpr(_right, Type.NodeSet);
-	    }
-
-	    // If one arg is a node-set then make it the left one
-	    if (tleft.isSimple() ||
-		tleft instanceof ResultTreeType &&
-		tright instanceof NodeSetType) {
-		swapArguments();
-	    }
-
-	    // Promote integers to doubles to have fewer compares
-	    if (_right.getType() instanceof IntType) {
-		_right = new CastExpr(_right, Type.Real);
-	    }
-	}
-	return _type = Type.Boolean;
-    }
-
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-	final Type tleft = _left.getType();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (tleft instanceof BooleanType) {
-	    _left.translate(classGen, methodGen);
-	    _right.translate(classGen, methodGen);
-	    _falseList.add(il.append(_op == Operators.EQ ? 
-				     (BranchInstruction)new IF_ICMPNE(null) :
-				     (BranchInstruction)new IF_ICMPEQ(null)));
-	}
-	else if (tleft instanceof NumberType) {
-	    _left.translate(classGen, methodGen);
-	    _right.translate(classGen, methodGen);
-
-	    if (tleft instanceof RealType) {
-		il.append(DCMPG);
-		_falseList.add(il.append(_op == Operators.EQ ? 
-					 (BranchInstruction)new IFNE(null) : 
-					 (BranchInstruction)new IFEQ(null)));
-	    }
-	    else {
-		_falseList.add(il.append(_op == Operators.EQ ? 
-					 (BranchInstruction)new IF_ICMPNE(null) :
-					 (BranchInstruction)new IF_ICMPEQ(null)));
-	    }
-	}
-	else {
-	    translate(classGen, methodGen);
-	    desynthesize(classGen, methodGen);
-	}
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	final Type tleft = _left.getType();
-	Type tright = _right.getType();
-
-	if (tleft instanceof BooleanType || tleft instanceof NumberType) {
-	    translateDesynthesized(classGen, methodGen);
-	    synthesize(classGen, methodGen);
-	    return;
-	}
-
-	if (tleft instanceof StringType) {
-	    final int equals = cpg.addMethodref(STRING_CLASS,
-						"equals",
-						"(" + OBJECT_SIG +")Z");
-	    _left.translate(classGen, methodGen);
-	    _right.translate(classGen, methodGen);
-	    il.append(new INVOKEVIRTUAL(equals));
-
-	    if (_op == Operators.NE) {
-		il.append(ICONST_1);
-		il.append(IXOR);			// not x <-> x xor 1
-	    }
-	    return;
-	}
-
-	BranchHandle truec, falsec;
-	
-	if (tleft instanceof ResultTreeType) {
-	    if (tright instanceof BooleanType) {
-		_right.translate(classGen, methodGen);
-		if (_op == Operators.NE) {
-		    il.append(ICONST_1);
-		    il.append(IXOR); // not x <-> x xor 1
-		}
-		return;
-	    }
-
-	    if (tright instanceof RealType) {
-		_left.translate(classGen, methodGen);
-		tleft.translateTo(classGen, methodGen, Type.Real);
-		_right.translate(classGen, methodGen);
-
-		il.append(DCMPG);
-		falsec = il.append(_op == Operators.EQ ? 
-				   (BranchInstruction) new IFNE(null) : 
-				   (BranchInstruction) new IFEQ(null));
-		il.append(ICONST_1);
-		truec = il.append(new GOTO(null));
-		falsec.setTarget(il.append(ICONST_0));
-		truec.setTarget(il.append(NOP));
-		return;
-	    }
-
-	    // Next, result-tree/string and result-tree/result-tree comparisons
-
-	    _left.translate(classGen, methodGen);
-	    tleft.translateTo(classGen, methodGen, Type.String);
-	    _right.translate(classGen, methodGen);
-
-	    if (tright instanceof ResultTreeType) {
-		tright.translateTo(classGen, methodGen, Type.String);
-	    }
-
-	    final int equals = cpg.addMethodref(STRING_CLASS,
-						"equals",
-						"(" +OBJECT_SIG+ ")Z");
-	    il.append(new INVOKEVIRTUAL(equals));
-
-	    if (_op == Operators.NE) {
-		il.append(ICONST_1);
-		il.append(IXOR);			// not x <-> x xor 1
-	    }
-	    return;
-	}
-
-	if (tleft instanceof NodeSetType && tright instanceof BooleanType) {
-	    _left.translate(classGen, methodGen);
-	    _left.startResetIterator(classGen, methodGen);
-	    Type.NodeSet.translateTo(classGen, methodGen, Type.Boolean);
-	    _right.translate(classGen, methodGen);
-
-	    il.append(IXOR); // x != y <-> x xor y
-	    if (_op == EQ) {
-		il.append(ICONST_1);
-		il.append(IXOR); // not x <-> x xor 1
-	    }
-	    return;
-	}
-
-	if (tleft instanceof NodeSetType && tright instanceof StringType) {
-	    _left.translate(classGen, methodGen);
-	    _left.startResetIterator(classGen, methodGen); // needed ?
-	    _right.translate(classGen, methodGen);
-	    il.append(new PUSH(cpg, _op));
-	    il.append(methodGen.loadDOM());
-	    final int cmp = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-					     "compare",
-					     "("
-					     + tleft.toSignature() 
-					     + tright.toSignature()
-					     + "I"
-					     + DOM_INTF_SIG
-					     + ")Z");
-	    il.append(new INVOKESTATIC(cmp));
-	    return;
-	}
-
-	// Next, node-set/t for t in {real, string, node-set, result-tree}
-	_left.translate(classGen, methodGen);
-	_left.startResetIterator(classGen, methodGen);
-	_right.translate(classGen, methodGen);
-	_right.startResetIterator(classGen, methodGen);
-
-	// Cast a result tree to a string to use an existing compare
-	if (tright instanceof ResultTreeType) {
-	    tright.translateTo(classGen, methodGen, Type.String);	
-	    tright = Type.String;
-	}
-
-	// Call the appropriate compare() from the BasisLibrary
-	il.append(new PUSH(cpg, _op));
-	il.append(methodGen.loadContextNode());
-	il.append(methodGen.loadDOM());
-
-	final int compare = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-					     "compare",
-					     "("
-					     + tleft.toSignature() 
-					     + tright.toSignature()
-					     + "I"
-					     + NODE_SIG
-					     + DOM_INTF_SIG
-					     + ")Z");
-	il.append(new INVOKESTATIC(compare));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Expression.java b/src/org/apache/xalan/xsltc/compiler/Expression.java
deleted file mode 100644
index 39b55ca..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Expression.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-import java.util.Vector;
-
-import de.fub.bytecode.generic.*;
-
-abstract class Expression extends SyntaxTreeNode {
-    /**
-     * The type of this expression. It is set after calling 
-     * <code>typeCheck()</code>.
-     */
-    protected Type _type;
-
-    /**
-     * True if this expression is of node-set type and its corresponding
-     * iterator has been started or reset.
-     */
-    protected boolean _startReset = false;
-
-    /**
-     * Instruction handles that comprise the true list.
-     */
-    protected FlowList _trueList = new FlowList();
-
-    /**
-     * Instruction handles that comprise the false list.
-     */
-    protected FlowList _falseList = new FlowList();
-
-    public Type getType() {
-	return _type;
-    }
-
-    public abstract String toString();
-		
-    /**
-     * Type check all the children of this node.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return typeCheckContents(stable);
-    }
-
-    /**
-     * Translate this node into JVM bytecodes.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	getParser().notYetImplemented("expression: " + getClass());
-    }
-	
-    /**
-     * Translate this node into a fresh instruction list.
-     * The original instruction list is saved and restored.
-     */
-    public final InstructionList compile(ClassGenerator classGen,
-					 MethodGenerator methodGen) {
-	final InstructionList result, save = methodGen.getInstructionList();
-	methodGen.setInstructionList(result = new InstructionList());
-	translate(classGen, methodGen);
-	methodGen.setInstructionList(save);
-	return result;
-    }
-
-    /**
-     * Redefined by expressions of type boolean that use flow lists.
-     */
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-	translate(classGen, methodGen);
-	if (_type instanceof BooleanType) {
-	    desynthesize(classGen, methodGen);
-	}
-    }
-
-    /**
-     * Expects an object on the stack and if this object can be proven
-     * to be a node iterator then the iterator is reset or started
-     * depending on the type of this expression.
-     * If this expression is a var reference then the iterator 
-     * is reset, otherwise it is started.
-     */
-    public void startResetIterator(ClassGenerator classGen,
-				   MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_startReset) {
-	    return;			// already started
-	}
-	_startReset = true;
-
-	if (_type instanceof NodeSetType == false) {
-	    return;		// nothing to do
-	}
-
-	if (this instanceof VariableRefBase) {
-	    // The method cloneIterator() also does resetting
-	    final int clone =
-		cpg.addInterfaceMethodref(NODE_ITERATOR,
-					  "cloneIterator",
-					  "()" + NODE_ITERATOR_SIG);
-	    il.append(new INVOKEINTERFACE(clone, 1));
-	}
-	else {
-	    il.append(methodGen.loadContextNode());
-	    il.append(methodGen.setStartNode());
-	}
-    }
-
-    /**
-     * Synthesize a boolean expression, i.e., either push a 0 or 1 onto the 
-     * operand stack for the next statement to succeed. Returns the handle
-     * of the instruction to be backpatched.
-     */
-    public void synthesize(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	_trueList.backPatch(il.append(ICONST_1));
-	final BranchHandle truec = il.append(new GOTO_W(null));
-	_falseList.backPatch(il.append(ICONST_0));
-	truec.setTarget(il.append(NOP));
-    }
-
-    public void desynthesize(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	_falseList.add(il.append(new IFEQ(null)));
-    }
-
-    public void backPatchFalseList(InstructionHandle ih) {
-	_falseList.backPatch(ih);
-    }
-
-    public void backPatchTrueList(InstructionHandle ih) {
-	_trueList.backPatch(ih);
-    }
-
-    /**
-     * Search for a primop in the symbol table that matches the method type 
-     * <code>ctype</code>. Two methods match if they have the same arity.
-     * If a primop is overloaded then the "closest match" is returned. The
-     * first entry in the vector of primops that has the right arity is 
-     * considered to be the default one.
-     */
-    public MethodType lookupPrimop(SymbolTable stable, String op,
-				   MethodType ctype) {
-	MethodType result = null;
-	final Vector primop = stable.lookupPrimop(op);
-	if (primop != null) {
-	    final int n = primop.size();
-	    int minDistance = Integer.MAX_VALUE;
-	    for (int i = 0; i < n; i++) {
-		final MethodType ptype = (MethodType) primop.elementAt(i);
-		// Skip if different arity
-		if (ptype.argsCount() != ctype.argsCount()) {
-		    continue;
-		}
-				
-		// The first method with the right arity is the default
-		if (result == null) {
-		    result = ptype;		// default method
-		}
-
-		// Check if better than last one found
-		final int distance = ctype.distanceTo(ptype);
-		if (distance < minDistance) {
-		    minDistance = distance;
-		    result = ptype;
-		}
-	    }		
-	}	
-	return result;
-    }	
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Fallback.java b/src/org/apache/xalan/xsltc/compiler/Fallback.java
deleted file mode 100644
index 8d4ec87..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Fallback.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Fallback extends Instruction {
-
-    private boolean _active = false;
-
-    /**
-     * This element never produces any data on the stack
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_active) {
-	    return(typeCheckContents(stable));
-	}
-	else {
-	    return Type.Void;
-	}
-    }
-
-    /**
-     * Activate this fallback element
-     */
-    public void activate() {
-	_active = true;
-    }
-
-    public String toString() {
-	return("fallback");
-    }
-
-    /**
-     * Parse contents only if this fallback element is put in place of
-     * some unsupported element or non-XSLTC extension element
-     */
-    public void parseContents(Parser parser) {
-	if (_active) parseChildren(parser);
-    }
-
-    /**
-     * Translate contents only if this fallback element is put in place of
-     * some unsupported element or non-XSLTC extension element
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_active) translateContents(classGen, methodGen);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FilterExpr.java b/src/org/apache/xalan/xsltc/compiler/FilterExpr.java
deleted file mode 100644
index a43b7aa..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FilterExpr.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-class FilterExpr extends Expression {
-    private Expression   _primary;
-    private final Vector _predicates;
-
-    public FilterExpr(Expression primary, Vector predicates) {
-	_primary = primary;
-	_predicates = predicates;
-	primary.setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_primary.setParser(parser);
-	if (_predicates != null) {
-	    final int n = _predicates.size();
-	    for (int i = 0; i < n; i++) {
-		final Expression exp = (Expression)_predicates.elementAt(i);
-		exp.setParser(parser);
-		exp.setParent(this);
-	    }
-	}
-    }
-    
-    public String toString() {
-	return "filter-expr(" + _primary + ", " + _predicates + ")";
-    }
-
-    /**
-     * Type check a FilterParentPath. If the filter is not a node-set add a 
-     * cast to node-set only if it is of reference type. This type coercion 
-     * is needed for expressions like $x where $x is a parameter reference.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	Type ptype = _primary.typeCheck(stable);
-
-	if (ptype instanceof NodeSetType == false) {
-	    if (ptype instanceof ReferenceType)  {
-		_primary = new CastExpr(_primary, Type.NodeSet);
-	    }
-	    else {
-		throw new TypeCheckError(this);
-	    }
-	}
-
-	int n = _predicates.size();
-	for (int i = 0; i < n; i++) {
-	    Expression pred = (Expression)_predicates.elementAt(i);
-	    pred.typeCheck(stable);
-	}
-	return _type = Type.NodeSet;	
-    }
-	
-    /**
-     * Translate a filter expression by pushing the appropriate iterator
-     * onto the stack.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	if (_predicates.size() > 0) {
-	    translatePredicates(classGen, methodGen);
-	}
-	else {
-	    _primary.translate(classGen, methodGen);
-	    _primary.startResetIterator(classGen, methodGen);
-	}
-    }
-
-    /**
-     * Translate a sequence of predicates.
-     * Each predicate is translated by constructing an instance
-     * of <code>CurrentNodeListIterator</code> which is initialized from
-     * another iterator (recursive call), a filter and a closure
-     * (call to translate on the predicate) and "this". 
-     */
-    public void translatePredicates(ClassGenerator classGen,
-				    MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_predicates.size() == 0) {
-	    translate(classGen, methodGen);
-	}
-	else {
-	    final int initCNLI = cpg.addMethodref(CURRENT_NODE_LIST_ITERATOR,
-						  "<init>",
-						  "("+NODE_ITERATOR_SIG+"Z"+
-						  CURRENT_NODE_LIST_FILTER_SIG +
-						  NODE_SIG+TRANSLET_SIG+")V");
-
-	    Predicate predicate = (Predicate)_predicates.lastElement();
-	    _predicates.remove(predicate);
-
-	    if (predicate.isNthPositionFilter()) {
-		final int start = cpg.addInterfaceMethodref(NODE_ITERATOR,
-							    "setStartNode", 
-							    "(I)"+
-							    NODE_ITERATOR_SIG);
-		final int reset = cpg.addInterfaceMethodref(NODE_ITERATOR,
-							    "reset",
-							    "()"+
-							    NODE_ITERATOR_SIG);
-		translatePredicates(classGen, methodGen); // get the base itr.
-		predicate.translate(classGen, methodGen); // get the position
-		il.append(new INVOKEINTERFACE(start,2));
-		il.append(new INVOKEINTERFACE(reset,1));
-
-		final int sngl = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-						  "getSingleNode",
-						  "("+NODE_ITERATOR_SIG+")"+
-						  NODE_ITERATOR_SIG);
-		il.append(new INVOKESTATIC(sngl));
-	    }
-	    else {
-		// create new CurrentNodeListIterator
-		il.append(new NEW(cpg.addClass(CURRENT_NODE_LIST_ITERATOR)));
-		il.append(DUP);
-		translatePredicates(classGen, methodGen); // recursive call
-		il.append(ICONST_1);
-		predicate.translate(classGen, methodGen);
-		il.append(methodGen.loadCurrentNode());
-		il.append(classGen.loadTranslet());
-		il.append(new INVOKESPECIAL(initCNLI));
-	    }
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FilterParentPath.java b/src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
deleted file mode 100644
index a855c1f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class FilterParentPath extends Expression {
-    private Expression _filterExpr;
-    private Expression _path;
-
-    public FilterParentPath(Expression filterExpr, Expression path) {
-	(_path = path).setParent(this);
-	(_filterExpr = filterExpr).setParent(this);
-    }
-		
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_filterExpr.setParser(parser);
-	_path.setParser(parser);
-    }
-    
-    public String toString() {
-	return "FilterParentPath(" + _filterExpr + ", " + _path + ')';
-    }
-
-    /**
-     * Type check a FilterParentPath. If the filter is not a node-set add a 
-     * cast to node-set only if it is of reference type. This type coercion is
-     * needed for expressions like $x/LINE where $x is a parameter reference.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type ftype = _filterExpr.typeCheck(stable);
-	if (ftype instanceof NodeSetType == false) {
-	    if (ftype instanceof ReferenceType)  {
-		_filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
-	    }
-	    /*
-	    else if (ftype instanceof ResultTreeType)  {
-		_filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
-	    }
-	    */
-	    else if (ftype instanceof NodeType)  {
-		_filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
-	    }
-	    else {
-		throw new TypeCheckError(this);
-	    }
-	}
-
-	// Wrap single node path in a node set
-	final Type ptype = _path.typeCheck(stable);
-	if (!(ptype instanceof NodeSetType)) {
-	    _path = new CastExpr(_path, Type.NodeSet);
-	}
-
-	return _type = Type.NodeSet;	
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	// Create new StepIterator
-	final int initSI = cpg.addMethodref(STEP_ITERATOR_CLASS,
-					    "<init>",
-					    "("
-					    +NODE_ITERATOR_SIG
-					    +NODE_ITERATOR_SIG
-					    +")V");
-	il.append(new NEW(cpg.addClass(STEP_ITERATOR_CLASS)));
-	il.append(DUP);
-
-	// Recursively compile 2 iterators
-	_filterExpr.translate(classGen, methodGen);
-	_path.translate(classGen, methodGen);
-
-	// Initialize StepIterator with iterators from the stack
-	il.append(new INVOKESPECIAL(initSI));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java b/src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java
deleted file mode 100644
index c20bfcc..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller 
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class FilteredAbsoluteLocationPath extends Expression {
-    private Expression _path;	// may be null 
-
-    public FilteredAbsoluteLocationPath() {
-	_path = null;
-    }
-
-    public FilteredAbsoluteLocationPath(Expression path) {
-	_path = path;
-	if (path != null) {
-	    _path.setParent(this);
-	}
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_path != null) {
-	    _path.setParser(parser);
-	}
-    }
-
-    public Expression getPath() {
-	return(_path);
-    }
-    
-    public String toString() {
-	return "FilteredAbsoluteLocationPath(" +
-	    (_path != null ? _path.toString() : "null") + ')';
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_path != null) {
-	    final Type ptype = _path.typeCheck(stable);
-	    if (ptype instanceof NodeType) {		// promote to node-set
-		_path = new CastExpr(_path, Type.NodeSet);
-	    }
-	}
-	return _type = Type.NodeSet;	
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	if (_path != null) {
-	    final int initDFI = cpg.addMethodref(DUP_FILTERED_ITERATOR,
-						"<init>",
-						"("
-						+ NODE_ITERATOR_SIG
-						+ ")V");
-	    // Create new Dup Filter Iterator
-	    il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR)));
-	    il.append(DUP);
-
-	    // Compile relative path iterator(s)
-	    _path.translate(classGen, methodGen);
-
-	    // Initialize Dup Filter Iterator with iterator from the stack
-	    il.append(new INVOKESPECIAL(initDFI));
-	}
-	else {
-	    final int git = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getIterator",
-						      "()"+NODE_ITERATOR_SIG);
-	    il.append(methodGen.loadDOM());
-	    il.append(new INVOKEINTERFACE(git, 1));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FloorCall.java b/src/org/apache/xalan/xsltc/compiler/FloorCall.java
deleted file mode 100644
index ad046df..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FloorCall.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class FloorCall extends FunctionCall {
-    public FloorCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	argument().translate(classGen, methodGen);
-	methodGen.getInstructionList()
-	    .append(new INVOKESTATIC(classGen.getConstantPool()
-				     .addMethodref(MATH_CLASS,
-						   "floor", "(D)D")));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FlowList.java b/src/org/apache/xalan/xsltc/compiler/FlowList.java
deleted file mode 100644
index 528311b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FlowList.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-
-public final class FlowList {
-    private Vector _elements;
-
-    public FlowList() {
-	_elements = null;
-    }
-
-    public FlowList(InstructionHandle bh) {
-	_elements = new Vector();
-	_elements.addElement(bh);
-    }
-
-    public FlowList(FlowList list) {
-	_elements = list._elements;
-    }
-
-    public FlowList add(InstructionHandle bh) {
-	if (_elements == null) {
-	    _elements = new Vector();
-	}
-	_elements.addElement(bh);
-	return this;
-    }
-
-    public FlowList append(FlowList right) {
-	if (_elements == null) {
-	    _elements = right._elements;
-	}
-	else {
-	    final Vector temp = right._elements;
-	    if (temp != null) {
-		final int n = temp.size();
-		for (int i = 0; i < n; i++) {
-		    _elements.addElement(temp.elementAt(i));
-		}
-	    }
-	}
-	return this;
-    }
-
-    /**
-     * Back patch a flow list. All instruction handles must be branch handles.
-     */
-    public void backPatch(InstructionHandle target) {
-	if (_elements != null) {
-	    final int n = _elements.size();
-	    for (int i = 0; i < n; i++) {
-		BranchHandle bh = (BranchHandle)_elements.elementAt(i);
-		bh.setTarget(target);
-	    }
-	    _elements.clear();		// avoid backpatching more than once
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ForEach.java b/src/org/apache/xalan/xsltc/compiler/ForEach.java
deleted file mode 100644
index 58807ba..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ForEach.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ForEach extends Instruction {
-
-    private Expression _select;
-    private Type       _type;
-
-    public void display(int indent) {
-	indent(indent);
-	Util.println("ForEach");
-	indent(indent + IndentIncrement);
-	Util.println("select " + _select.toString());
-	displayContents(indent + IndentIncrement);
-    }
-		
-    public void parseContents(Parser parser) {
-	_select = parser.parseExpression(this, "select", null);
-
-	parseChildren(parser);
-
-        // make sure required attribute(s) have been set
-        if (_select.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "select");
-	    return;
-        }
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_type = _select.typeCheck(stable);
-
-	if (_type instanceof ReferenceType || _type instanceof NodeType) {
-	    _select = new CastExpr(_select, Type.NodeSet);
-	    typeCheckContents(stable);
-	    return Type.Void;
-	}
-	if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
-	    typeCheckContents(stable);
-	    return Type.Void;
-	}
-	String msg = "Unsupported type for <xsl:for-each select='"+_type+"'/>";
-	throw new TypeCheckError(new ErrorMsg(msg));
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Save current node and current iterator on the stack
-	il.append(methodGen.loadCurrentNode());
-	il.append(methodGen.loadIterator());
-		
-	// Collect sort objects associated with this instruction
-	final Vector sortObjects = new Vector();
-	Enumeration children = elements();
-	while (children.hasMoreElements()) {
-	    final Object child = children.nextElement();
-	    if (child instanceof Sort) {
-		sortObjects.addElement(child);
-	    }
-	}
-
-	if ((_type != null) && (_type instanceof ResultTreeType)) {
-	    // Store existing DOM on stack - must be restored when loop is done
-	    il.append(methodGen.loadDOM());
-
-	    // <xsl:sort> cannot be applied to a result tree - issue warning
-	    if (sortObjects.size() > 0) {
-		ErrorMsg msg = new ErrorMsg(ErrorMsg.TREESORT_ERR);
-		getParser().reportError(WARNING, msg);
-	    }
-
-	    // Put the result tree on the stack (DOM)
-	    _select.translate(classGen, methodGen);
-	    // Get an iterator for the whole DOM - excluding the root node
-	    _type.translateTo(classGen, methodGen, Type.NodeSet);
-	    // Store the result tree as the default DOM
-	    il.append(SWAP);
-	    il.append(methodGen.storeDOM());
-	}
-	else {
-	    // Compile node iterator
-	    if (sortObjects.size() > 0) {
-		Sort.translateSortIterator(classGen, methodGen,
-					   _select, sortObjects);
-	    }
-	    else {
-		_select.translate(classGen, methodGen);
-		if (_select instanceof Step) {
-		    ((Step)_select).orderIterator(classGen, methodGen);
-		}
-	    }
-	    if (!(_type instanceof ReferenceType)) {
-		_select.startResetIterator(classGen, methodGen);
-	    }
-	}
-
-
-	// Overwrite current iterator
-	il.append(methodGen.storeIterator());
-
-	// Give local variables (if any) default values before starting loop
-	initializeVariables(classGen, methodGen);
-
-	final BranchHandle nextNode = il.append(new GOTO(null));
-	final InstructionHandle loop = il.append(NOP);
-
-	translateContents(classGen, methodGen);
-		    
-	nextNode.setTarget(il.append(methodGen.loadIterator()));
-	il.append(methodGen.nextNode());
-	il.append(DUP);
-	il.append(methodGen.storeCurrentNode());
-	il.append(new IFNE(loop));
-
-	// Restore current DOM (if result tree was used instead for this loop)
-	if ((_type != null) && (_type instanceof ResultTreeType)) {
-	    il.append(methodGen.storeDOM());	    
-	}
-
-	// Restore current node and current iterator from the stack
-	il.append(methodGen.storeIterator());
-	il.append(methodGen.storeCurrentNode());
-    }
-
-    /**
-     * The code that is generated by nested for-each loops can appear to some
-     * JVMs as if it is accessing un-initialized variables. We must add some
-     * code that pushes the default variable value on the stack and pops it
-     * into the variable slot. This is done by the Variable.initialize()
-     * method. The code that we compile for this loop looks like this:
-     *
-     *           initialize iterator
-     *           initialize variables <-- HERE!!!
-     *           goto   Iterate
-     *  Loop:    :
-     *           : (code for <xsl:for-each> contents)
-     *           :
-     *  Iterate: node = iterator.next();
-     *           if (node != END) goto Loop
-     */
-    public void initializeVariables(ClassGenerator classGen,
-				   MethodGenerator methodGen) {
-	final int n = elementCount();
-	for (int i = 0; i < n; i++) {
-	    final Object child = getContents().elementAt(i);
-	    if (child instanceof Variable) {
-		Variable var = (Variable)child;
-		var.initialize(classGen, methodGen);
-	    }
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java b/src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java
deleted file mode 100644
index 56379fe..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class FormatNumberCall extends FunctionCall {
-    private Expression _value;
-    private Expression _format;
-    private Expression _name;
-
-    public FormatNumberCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-	_value = argument(0);
-	_format = argument(1);
-	_name = argumentCount() == 3 ? argument(2) : null;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// The stylesheet element only adds code to instanciate the
-	// default DecimalFormat object if at least one format-number()
-	// call exists in the stylesheet. We must signal this call...
-	getStylesheet().numberFormattingUsed();
-
-	final Type tvalue = _value.typeCheck(stable);
-	if (tvalue instanceof RealType == false) {
-	    _value = new CastExpr(_value, Type.Real);
-	}
-	final Type tformat = _format.typeCheck(stable);
-	if (tformat instanceof StringType == false) {
-	    _format = new CastExpr(_format, Type.String);
-	}
-	if (argumentCount() == 3) {
-	    final Type tname = _format.typeCheck(stable);
-	    if (tname instanceof StringType == false) {
-		_name = new CastExpr(_name, Type.String);
-	    }
-	}
-	return _type = Type.String;
-    }
-    
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	_value.translate(classGen, methodGen);
-	_format.translate(classGen, methodGen);
-
-	final int fn3arg = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-					    "formatNumber",
-					    "(DLjava/lang/String;"+
-					    "Ljava/text/DecimalFormat;)"+
-					    "Ljava/lang/String;");
-	final int get = cpg.addMethodref(TRANSLET_CLASS,
-					 "getDecimalFormat",
-					 "(Ljava/lang/String;)"+
-					 "Ljava/text/DecimalFormat;");
-	
-	il.append(classGen.loadTranslet());
-	if (_name == null) {
-	    il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	}
-	else {
-	    _name.translate(classGen, methodGen);
-	}
-	il.append(new INVOKEVIRTUAL(get));
-	il.append(new INVOKESTATIC(fn3arg));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java b/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
deleted file mode 100644
index 97c6916..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.HashSet;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class FunctionAvailableCall extends FunctionCall {
-
-    public FunctionAvailableCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * Force the argument to this function to be a literal string.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (argument() instanceof LiteralExpr) {
-	    return _type = Type.Boolean;
-	}
-	throw new TypeCheckError(ErrorMsg.LITERALS_ERR, "function-available");
-    }
-
-    /**
-     * Returns the result that this function will return
-     */
-    public boolean getResult() {
-	final Parser parser = getParser();
-	final LiteralExpr arg = (LiteralExpr)argument();
-	return(parser.functionSupported(arg.getValue()));
-    }
-
-    /**
-     * Calls to 'function-available' are resolved at compile time since 
-     * the namespaces declared in the stylsheet are not available at run
-     * time. Consequently, arguments to this function must be literals.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final boolean result = getResult();
-	methodGen.getInstructionList().append(new PUSH(cpg, result));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/FunctionCall.java b/src/org/apache/xalan/xsltc/compiler/FunctionCall.java
deleted file mode 100644
index 29891a9..0000000
--- a/src/org/apache/xalan/xsltc/compiler/FunctionCall.java
+++ /dev/null
@@ -1,598 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.lang.reflect.*;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-class FunctionCall extends Expression {
-
-    private final static Vector _emptyArgs = new Vector(0);
-    private final static String _javaExtPrefix = TRANSLET_URI + "/java";
-    
-    private QName  _fname;
-    private final Vector _arguments;
-    
-    private String     _className;
-    private Method     _chosenMethod;
-    private MethodType _chosenMethodType;
-
-    // Encapsulates all unsupported external function calls
-    private boolean    unresolvedExternal;
-
-    // Legal conversions between internal and Java types.
-    private static final MultiHashtable _internal2Java = new MultiHashtable();
-
-    // Legal conversions between Java and internal types.
-    private static final Hashtable _java2Internal = new Hashtable();
-	
-    /**
-     * Defines 2 conversion tables:
-     * 1. From internal types to Java types and
-     * 2. From Java types to internal types.
-     * These two tables are used when calling external (Java) functions.
-     */
-    static {
-	try {
-	    final Class stringClass   = Class.forName("java.lang.String");
-	    final Class nodeClass     = Class.forName("org.w3c.dom.Node");
-	    final Class nodeListClass = Class.forName("org.w3c.dom.NodeList");
-
-	    // Possible conversions between internal and Java types
-	    _internal2Java.put(Type.Boolean, Boolean.TYPE);
-
-	    _internal2Java.put(Type.Int, Character.TYPE);
-	    _internal2Java.put(Type.Int, Byte.TYPE);
-	    _internal2Java.put(Type.Int, Short.TYPE);
-	    _internal2Java.put(Type.Int, Integer.TYPE);
-	    _internal2Java.put(Type.Int, Long.TYPE);
-	    _internal2Java.put(Type.Int, Float.TYPE);
-	    _internal2Java.put(Type.Int, Double.TYPE);
-
-	    _internal2Java.put(Type.Real, Character.TYPE);
-	    _internal2Java.put(Type.Real, Byte.TYPE);
-	    _internal2Java.put(Type.Real, Short.TYPE);
-	    _internal2Java.put(Type.Real, Integer.TYPE);
-	    _internal2Java.put(Type.Real, Long.TYPE);
-	    _internal2Java.put(Type.Real, Float.TYPE);
-	    _internal2Java.put(Type.Real, Double.TYPE);
-
-	    _internal2Java.put(Type.String, stringClass);
-
-	    _internal2Java.put(Type.Node, nodeClass);
-	    _internal2Java.put(Type.Node, nodeListClass);
-
-	    _internal2Java.put(Type.NodeSet, Integer.TYPE);
-	    _internal2Java.put(Type.NodeSet, nodeClass);
-	    _internal2Java.put(Type.NodeSet, nodeListClass);
-
-	    _internal2Java.put(Type.ResultTree, nodeClass);
-	    _internal2Java.put(Type.ResultTree, nodeListClass);
-
-	    // Possible conversions between Java and internal types
-	    _java2Internal.put(Boolean.TYPE, Type.Boolean);
-
-	    _java2Internal.put(Character.TYPE, Type.Real);
-	    _java2Internal.put(Byte.TYPE, Type.Real);
-	    _java2Internal.put(Short.TYPE, Type.Real);
-	    _java2Internal.put(Integer.TYPE, Type.Real);
-	    _java2Internal.put(Long.TYPE, Type.Real);
-	    _java2Internal.put(Float.TYPE, Type.Real);
-	    _java2Internal.put(Double.TYPE, Type.Real);
-
-	    _java2Internal.put(stringClass, Type.String);
-
-	    // Conversions from org.w3c.dom.Node/NodeList are not supported
-	}
-	catch (ClassNotFoundException e) {
-	    System.err.println(e);
-	    //System.exit(1);
-	}
-    }
-		
-    public FunctionCall(QName fname, Vector arguments) {
-	_fname = fname;
-	_arguments = arguments;
-    }
-
-    public FunctionCall(QName fname) {
-	this(fname, _emptyArgs);
-    }
-
-    public String getName() {
-	return(_fname.toString());
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_arguments != null) {
-	    final int n = _arguments.size();
-	    for (int i = 0; i < n; i++) {
-		final Expression exp = (Expression)_arguments.elementAt(i);
-		exp.setParser(parser);
-		exp.setParent(this);
-	    }
-	}
-    }
-
-    /**
-     * Type check a function call. Since different type conversions apply,
-     * type checking is different for standard and external (Java) functions.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-	final String namespace = _fname.getNamespace();
-	final String local = _fname.getLocalPart();
-
-	// XPath functions have no namespace
-	if (isStandard()) {
-	    return typeCheckStandard(stable);
-	}
-	// Handle extension functions (they all have a namespace)
-	else {
-	    final int len = _javaExtPrefix.length();
-	    if (namespace.equals(_javaExtPrefix)) {
-		final int pos = local.indexOf('.');
-		_className = local.substring(0, pos);
-		_fname = new QName(namespace, null, local.substring(pos+1));
-	    }
-	    else if (namespace.length() >= len &&
-		namespace.substring(0, len).equals(_javaExtPrefix)) {
-		_className = namespace.substring(len + 1);
-	    }
-	    else {
-		/*
-		 * Warn user if external function could not be resolved.
-		 * Warning will _NOT_ be issued is the call is properly
-		 * wrapped in an <xsl:if> or <xsl:when> element. For details
-		 * see If.parserContents() and When.parserContents()
-		 */
-		final Parser parser = getParser();
-		if (parser != null) {
-		    reportWarning(this ,parser, ErrorMsg.FUNRESOL_ERR,
-				  _fname.toString());
-		}
-		unresolvedExternal = true;
-		return _type = Type.Void;
-	    }
-	    return typeCheckExternal(stable);
-	}
-    }
-
-    /**
-     * Type check a call to a standard function. Insert CastExprs when needed.
-     * If as a result of the insertion of a CastExpr a type check error is 
-     * thrown, then catch it and re-throw it with a new "this".
-     */
-    public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError {
-
-	_fname.clearNamespace(); // HACK!!!
-
-	final int n = _arguments.size();
-	final Vector argsType = typeCheckArgs(stable);
-	final MethodType args = new MethodType(Type.Void, argsType);
-	final MethodType ptype =
-	    lookupPrimop(stable, _fname.getLocalPart(), args);
-
-	if (ptype != null) {
-	    for (int i = 0; i < n; i++) {
-		final Type argType = (Type) ptype.argsType().elementAt(i);
-		final Expression exp = (Expression)_arguments.elementAt(i);
-		if (!argType.identicalTo(exp.getType())) {
-		    try {
-			_arguments.setElementAt(new CastExpr(exp, argType), i);
-		    }
-		    catch (TypeCheckError e) {
-			throw new TypeCheckError(this);	// invalid conversion
-		    }
-		}
-	    }
-	    _chosenMethodType = ptype;
-	    return _type = ptype.resultType();
-	}
-	throw new TypeCheckError(this);
-    }
-
-    /**
-     * Type check a call to an external (Java) method.
-     * The method must be static an public, and a legal type conversion
-     * must exist for all its arguments and its return type.
-     * Every method of name <code>_fname</code> is inspected
-     * as a possible candidate.
-     */
-    public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError {
-	final Vector methods = findMethods();
-	
-	if (methods == null) {
-	    // Method not found in this class
-	    throw new TypeCheckError(ErrorMsg.METUNDEF_ERR, 
-				     _fname.getLocalPart());
-	}
-
-	final int nMethods = methods.size();
-	final int nArgs = _arguments.size();
-	final Vector argsType = typeCheckArgs(stable);
-
-	// Try all methods with the same name as this function
-	for (int j, i = 0; i < nMethods; i++) {
-
-	    // Check if all paramteters to this method can be converted
-	    final Method method = (Method)methods.elementAt(i);
-	    final Class[] paramTypes = method.getParameterTypes();
-	    for (j = 0; j < nArgs; j++) {
-		// Convert from internal (translet) type to external (Java) type
-		final Type intType = (Type)argsType.elementAt(j);
-		final Class extType = paramTypes[j];
-		if (!_internal2Java.maps(intType, extType)) break;
-	    }
-
-	    if (j == nArgs) {
-		// Check if the return type can be converted
-		final Class extType = method.getReturnType();
-		if (extType.getName().equals("void"))
-		    _type = Type.Void;
-		else
-		    _type = (Type)_java2Internal.get(extType);
-		// Use this method if all parameters & return type match
-		if (_type != null) {
-		    _chosenMethod = method;
-		    return _type;
-		}
-	    }
-	}
-
-	StringBuffer buf = new StringBuffer("Attempted to call method ");
-	buf.append(_className);
-	buf.append('.');
-	buf.append(_fname.getLocalPart());
-	buf.append('(');
-	for (int a=0; a<nArgs; a++) {
-	    final Type intType = (Type)argsType.elementAt(a);
-	    buf.append(intType.toString());
-	    if (a < (nArgs-1)) buf.append(", ");
-	}
-	buf.append(");");
-	getParser().reportError(Constants.WARNING,new ErrorMsg(buf.toString()));
-
-	throw new TypeCheckError(ErrorMsg.CANNOTCV_ERR, 
-				 _fname.getLocalPart(),
-				 _className);
-    }
-
-    /**
-     * Type check the actual arguments of this function call.
-     */
-    public Vector typeCheckArgs(SymbolTable stable) throws TypeCheckError {
-	final Vector result = new Vector();
-	final Enumeration e = _arguments.elements();	
-	while (e.hasMoreElements()) {
-	    final Expression exp = (Expression)e.nextElement();
-	    result.addElement(exp.typeCheck(stable));
-	}
-	return result;
-    }
-
-    protected final Expression argument(int i) {
-	return (Expression)_arguments.elementAt(i);
-    }
-
-    protected final Expression argument() {
-	return argument(0);
-    }
-    
-    protected final int argumentCount() {
-	return _arguments.size();
-    }
-
-    protected final void setArgument(int i, Expression exp) {
-	_arguments.setElementAt(exp, i);
-    }
-
-    /**
-     * Compile the function call and treat as an expression
-     * Update true/false-lists.
-     */
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-
-	Type type = Type.Boolean;
-	if (_chosenMethodType != null)
-	    type = _chosenMethodType.resultType();
-
-	final InstructionList il = methodGen.getInstructionList();
-	translate(classGen, methodGen);
-
-	if ((type instanceof BooleanType) || (type instanceof IntType)) {
-	    _falseList.add(il.append(new IFEQ(null)));
-	}
-    }
-
-
-    /**
-     * Translate a function call. The compiled code will leave the function's
-     * return value on the JVM's stack.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final int n = argumentCount();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	int index;
-
-	// Translate calls to methods in the BasisLibrary
-	if (isStandard()) {
-	    for (int i = 0; i < n; i++) {
-		final Expression exp = argument(i);
-		exp.translate(classGen, methodGen);
-		exp.startResetIterator(classGen, methodGen);
-	    }
-
-	    // append "F" to the function's name
-	    final String name = _fname.toString().replace('-', '_') + "F";
-	    String args = Constants.EMPTYSTRING;
-
-	    // Special precautions for some method calls
-	    if (name.equals("sumF")) {
-		args = DOM_INTF_SIG;
-		il.append(methodGen.loadDOM());
-	    }
-	    else if (name.equals("normalize_spaceF")) {
-		if (_chosenMethodType.toSignature(args).
-		    equals("()Ljava/lang/String;")) {
-		    args = "I"+DOM_INTF_SIG;
-		    il.append(methodGen.loadContextNode());
-		    il.append(methodGen.loadDOM());
-		}
-	    }
-
-	    // Invoke the method in the basis library
-	    index = cpg.addMethodref(BASIS_LIBRARY_CLASS, name,
-				     _chosenMethodType.toSignature(args));
-	    il.append(new INVOKESTATIC(index));
-	}
-	// Add call to BasisLibrary.unresolved_externalF() to generate
-	// run-time error message for unsupported external functions
-	else if (unresolvedExternal) {
-	    index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-				     "unresolved_externalF",
-				     "(Ljava/lang/String;)V");
-	    il.append(new PUSH(cpg, _fname.toString()));
-	    il.append(new INVOKESTATIC(index));
-	}
-	// Invoke function calls that are handled in separate classes
-	else {
-	    final String clazz = _chosenMethod.getDeclaringClass().getName();
-	    Class[] paramTypes = _chosenMethod.getParameterTypes();
-
-	    for (int i = 0; i < n; i++) {
-		final Expression exp = argument(i);
-		exp.translate(classGen, methodGen);
-		// Convert the argument to its Java type
-		exp.startResetIterator(classGen, methodGen);
-		exp._type.translateTo(classGen, methodGen, paramTypes[i]);
-	    }
-
-	    final StringBuffer buffer = new StringBuffer();
-	    buffer.append('(');
-	    for (int i = 0; i < paramTypes.length; i++) {
-		buffer.append(getSignature(paramTypes[i]));
-	    }
-	    buffer.append(')');
-	    buffer.append(getSignature(_chosenMethod.getReturnType()));
-
-	    index = cpg.addMethodref(clazz,
-				     _fname.getLocalPart(),
-				     buffer.toString());
-	    il.append(new INVOKESTATIC(index));
-
-	    // Convert the return type back to our internal type
-	    _type.translateFrom(classGen, methodGen,
-				_chosenMethod.getReturnType());
-	}
-    }
-
-    public String toString() {
-	return "funcall(" + _fname + ", " + _arguments + ')';
-    }
-
-    public boolean isStandard() {
-	final String namespace = _fname.getNamespace();
-	if ((namespace == null) || (namespace.equals(Constants.EMPTYSTRING)))
-	    return true;
-	else
-	    return false;
-    }
-
-    /**
-     * Returns a vector with all methods named <code>_fname</code>
-     * after stripping its namespace or <code>null</code>
-     * if no such methods exist.
-     */
-    private Vector findMethods() {
-	Vector result = null;
-	final String namespace = _fname.getNamespace();
-
-	if (namespace.startsWith(_javaExtPrefix)) {
-	    final int nArgs = _arguments.size();
-	    try {
-		final Class clazz = Class.forName(_className);
-		if (clazz == null) {
-		    final ErrorMsg msg =
-			new ErrorMsg(ErrorMsg.CLSUNDEF_ERR, _className);
-		    getParser().reportError(Constants.ERROR, msg);
-		}
-		else {
-		    final String methodName = _fname.getLocalPart();
-		    final Method[] methods = clazz.getDeclaredMethods();
-
-		    for (int i = 0; i < methods.length; i++) {
-			final int mods = methods[i].getModifiers();
-
-			// Is it public, static and same number of args ?
-			if (Modifier.isPublic(mods)
-			    && Modifier.isStatic(mods)
-			    && methods[i].getName().equals(methodName)
-			    && methods[i].getParameterTypes().length == nArgs)
-			    {
-				if (result == null) {
-				    result = new Vector();
-				}
-				result.addElement(methods[i]);
-			    }
-		    }
-		}
-	    }
-	    catch (ClassNotFoundException e) {
-		final ErrorMsg msg =
-		    new ErrorMsg(ErrorMsg.CLSUNDEF_ERR, _className);
-		getParser().reportError(Constants.ERROR, msg);
-	    }
-	}
-	return result;
-    }
-
-    /**
-     * Compute the JVM signature for the class.
-     */
-    static final String getSignature(Class clazz) {
-	if (clazz.isArray()) {
-	    final StringBuffer sb = new StringBuffer();
-	    Class cl = clazz;
-	    while (cl.isArray()) {
-		sb.append("[");
-		cl = cl.getComponentType();
-	    }
-	    sb.append(getSignature(cl));
-	    return sb.toString();
-	}
-	else if (clazz.isPrimitive()) {
-	    if (clazz == Integer.TYPE) {
-		return "I";
-	    }
-	    else if (clazz == Byte.TYPE) {
-		return "B";
-	    }
-	    else if (clazz == Long.TYPE) {
-		return "J";
-	    }
-	    else if (clazz == Float.TYPE) {
-		return "F";
-	    }
-	    else if (clazz == Double.TYPE) {
-		return "D";
-	    }
-	    else if (clazz == Short.TYPE) {
-		return "S";
-	    }
-	    else if (clazz == Character.TYPE) {
-		return "C";
-	    }
-	    else if (clazz == Boolean.TYPE) {
-		return "Z";
-	    }
-	    else if (clazz == Void.TYPE) {
-		return "V";
-	    }
-	    else {
-		throw new Error("unknown type in getSignature");
-	    }
-	}
-	else {
-	    return "L" + clazz.getName().replace('.', '/') + ';';
-	}
-    }
-
-    /**
-     * Compute the JVM method descriptor for the method.
-     */
-    static final String getSignature(Method meth) {
-	final StringBuffer sb = new StringBuffer();
-	sb.append('(');
-	final Class[] params = meth.getParameterTypes(); // avoid clone
-	for (int j = 0; j < params.length; j++) {
-	    sb.append(getSignature(params[j]));
-	}
-	return sb.append(')').append(getSignature(meth.getReturnType()))
-	    .toString();
-    }
-
-    /**
-     * Compute the JVM constructor descriptor for the constructor.
-     */
-    static final String getSignature(Constructor cons) {
-	final StringBuffer sb = new StringBuffer();
-	sb.append('(');
-	final Class[] params = cons.getParameterTypes(); // avoid clone
-	for (int j = 0; j < params.length; j++) {
-	    sb.append(getSignature(params[j]));
-	}
-	return sb.append(")V").toString();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/GenerateIdCall.java b/src/org/apache/xalan/xsltc/compiler/GenerateIdCall.java
deleted file mode 100644
index 296519a..0000000
--- a/src/org/apache/xalan/xsltc/compiler/GenerateIdCall.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class GenerateIdCall extends FunctionCall {
-    public GenerateIdCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	if (argumentCount() == 0) {
-	    il.append(new ILOAD(methodGen.getLocalIndex("current")));
-	}
-	else {			// one argument
-	    argument().translate(classGen, methodGen);
-	}
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
-						    "generate_idF",
-						    // reuse signature
-						    GET_NODE_NAME_SIG)));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java b/src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java
deleted file mode 100644
index fa0836d..0000000
--- a/src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-abstract class IdKeyPattern extends LocationPathPattern {
-
-    protected RelativePathPattern _left = null;;
-    private String _index = null;
-    private String _value = null;;
-
-    public IdKeyPattern(String index, String value) {
-	_index = index;
-	_value = value;
-    }
-
-    public String getIndexName() {
-	return(_index);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.NodeSet;
-    }
-    
-    public boolean isWildcard() {
-	return false;
-    }
-    
-    public void setLeft(RelativePathPattern left) {
-	_left = left;
-    }
-
-    public StepPattern getKernelPattern() {
-	return(null);
-    }
-    
-    public void reduceKernelPattern() { }
-
-    public String toString() {
-	return "id/keyPattern(" + _index + ", " + _value + ')';
-    }
-
-    /**
-     * This method is called when the constructor is compiled in
-     * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
-     */
-    public void translate(ClassGenerator classGen,
-			  MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Returns the KeyIndex object of a given name
-	final int getKeyIndex = cpg.addMethodref(TRANSLET_CLASS,
-						 "getKeyIndex",
-						 "(Ljava/lang/String;)"+
-						 KEY_INDEX_SIG);
-	
-	// Initialises a KeyIndex to return nodes with specific values
-	final int lookupId = cpg.addMethodref(KEY_INDEX_CLASS,
-					      "containsID",
-					      "(ILjava/lang/Object;)I");
-	final int lookupKey = cpg.addMethodref(KEY_INDEX_CLASS,
-					       "containsKey",
-					       "(ILjava/lang/Object;)I");
-
-	// Call getKeyIndex in AbstractTranslet with the name of the key
-	// to get the index for this key (which is also a node iterator).
-	il.append(classGen.loadTranslet());
-	il.append(new PUSH(cpg,_index));
-	il.append(new INVOKEVIRTUAL(getKeyIndex));
-	
-	// Now use the value in the second argument to determine what nodes
-	// the iterator should return.
-	il.append(SWAP);
-	il.append(new PUSH(cpg,_value));
-	if (this instanceof IdPattern)
-	    il.append(new INVOKEVIRTUAL(lookupId));
-	else
-	    il.append(new INVOKEVIRTUAL(lookupKey));
-
-	_trueList.add(il.append(new IFNE(null)));
-	_falseList.add(il.append(new GOTO(null)));
-    }
-
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/IdPattern.java b/src/org/apache/xalan/xsltc/compiler/IdPattern.java
deleted file mode 100644
index e150a76..0000000
--- a/src/org/apache/xalan/xsltc/compiler/IdPattern.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class IdPattern extends IdKeyPattern {
-
-    public IdPattern(String id) {
-	super("##id",id);
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/If.java b/src/org/apache/xalan/xsltc/compiler/If.java
deleted file mode 100644
index b87208e..0000000
--- a/src/org/apache/xalan/xsltc/compiler/If.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class If extends Instruction {
-
-    private Expression _test;
-    private boolean    _ignore = false;
-
-    /**
-     * Display the contents of this element
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("If");
-	indent(indent + IndentIncrement);
-	System.out.print("test ");
-	Util.println(_test.toString());
-	displayContents(indent + IndentIncrement);
-    }
-
-    /**
-     * Parse the "test" expression and contents of this element.
-     */
-    public void parseContents(Parser parser) {
-	// Parse the "test" expression
-	_test = parser.parseExpression(this, "test", null);
-
-        // Make sure required attribute(s) have been set
-        if (_test.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "test");
-	    return;
-        }
-
-	// We will ignore the contents of this <xsl:if> if we know that the
-	// test will always return 'false'.
-	if (_test instanceof ElementAvailableCall) {
-	    ElementAvailableCall call = (ElementAvailableCall)_test;
-	    _ignore = !call.getResult();
-	    return;
-	}
-	if (_test instanceof FunctionAvailableCall) {
-	    FunctionAvailableCall call = (FunctionAvailableCall)_test;
-	    _ignore = !call.getResult();
-	    return;
-	}
-
-	parseChildren(parser);
-    }
-
-    /**
-     * Type-check the "test" expression and contents of this element.
-     * The contents will be ignored if we know the test will always fail.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// Type-check the "test" expression
-	if (_test.typeCheck(stable) instanceof BooleanType == false) {
-	    _test = new CastExpr(_test, Type.Boolean);
-	}
-	// Type check the element contents
-	if (!_ignore) {
-	    typeCheckContents(stable);
-	}
-	return Type.Void;
-    }
-
-    /**
-     * Translate the "test" expression and contents of this element.
-     * The contents will be ignored if we know the test will always fail.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	_test.translateDesynthesized(classGen, methodGen);
-	// remember end of condition
-	final InstructionHandle truec = il.getEnd();
-	if (!_ignore) {
-	    translateContents(classGen, methodGen);
-	}
-	_test.backPatchFalseList(il.append(NOP));
-	_test.backPatchTrueList(truec.getNext());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/IllegalCharException.java b/src/org/apache/xalan/xsltc/compiler/IllegalCharException.java
deleted file mode 100644
index 40cee6f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/IllegalCharException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-class IllegalCharException extends Exception {
-    public IllegalCharException(String s) {
-	super(s);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Import.java b/src/org/apache/xalan/xsltc/compiler/Import.java
deleted file mode 100644
index 68d7f9e..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Import.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Gunnlaugur Briem <gthb@dimon.is>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Enumeration;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-import de.fub.bytecode.generic.*;
-
-final class Import extends TopLevelElement {
-
-    private Stylesheet _imported = null;
-
-    public Stylesheet getImportedStylesheet() {
-	return(_imported);
-    }
-
-    public void parseContents(final Parser parser) {
-	final Stylesheet context = parser.getCurrentStylesheet();
-	try {
-	    String docToLoad = getAttribute("href");
-	    if (context.checkForLoop(docToLoad)) {
-		final int errno = ErrorMsg.CIRCULAR_INC;
-		final ErrorMsg msg = new ErrorMsg(errno, docToLoad, this);
-		parser.reportError(Constants.FATAL, msg);
-		return;
-	    }
-
-	    final String currLoadedDoc = context.getSystemId();
-	    SourceLoader loader = context.getSourceLoader();
-	    InputSource input = null;
-
-	    if (loader != null) {
-		final XSLTC xsltc = parser.getXSLTC();
-		input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
-	    }
-	    else {
-		final URL url = new URL(new URL(currLoadedDoc), docToLoad);
-		docToLoad = url.toString();
-		input = new InputSource(docToLoad);
-	    }
-
-	    SyntaxTreeNode root = parser.parse(input);
-
-	    if (root == null) return;
-	    final Stylesheet _imported = parser.makeStylesheet(root);
-	    if (_imported == null) return;
-
-	    _imported.setSourceLoader(loader);
-	    _imported.setSystemId(docToLoad);
-	    _imported.setParentStylesheet(context);
-
-	    // precedence for the including stylesheet
-	    final int currPrecedence = parser.getCurrentImportPrecedence();
-	    final int nextPrecedence = parser.getNextImportPrecedence();
-	    _imported.setImportPrecedence(currPrecedence);
-	    context.setImportPrecedence(nextPrecedence);
-	    parser.setCurrentStylesheet(_imported);
-	    _imported.parseContents(parser);
-
-	    final Enumeration elements = _imported.elements();
-	    final Stylesheet topStylesheet = parser.getTopLevelStylesheet();
-	    while (elements.hasMoreElements()) {
-		final Object element = elements.nextElement();
-		if (element instanceof TopLevelElement) {
-		    topStylesheet.addElement((TopLevelElement)element);
-		}
-	    }
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	}
-	finally {
-	    parser.setCurrentStylesheet(context);
-	}
-    }
-    
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void;
-    }
-    
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	// do nothing
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Include.java b/src/org/apache/xalan/xsltc/compiler/Include.java
deleted file mode 100644
index c1966b1..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Include.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Gunnlaugur Briem <gthb@dimon.is>
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Enumeration;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-import de.fub.bytecode.generic.*;
-
-final class Include extends TopLevelElement {
-
-    private Stylesheet _included = null;
-
-    public Stylesheet getIncludedStylesheet() {
-	return(_included);
-    }
-
-    public void parseContents(final Parser parser) {
-	final Stylesheet context = parser.getCurrentStylesheet();
-	try {
-	    String docToLoad = getAttribute("href");
-	    if (context.checkForLoop(docToLoad)) {
-		final int errno = ErrorMsg.CIRCULAR_INC;
-		final ErrorMsg msg = new ErrorMsg(errno, docToLoad, this);
-		parser.reportError(Constants.FATAL, msg);
-		return;
-	    }
-
-	    final String currLoadedDoc = context.getSystemId();
-	    SourceLoader loader = context.getSourceLoader();
-	    InputSource input = null;
-
-	    if (loader != null) {
-		final XSLTC xsltc = parser.getXSLTC();
-		input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
-	    }
-	    else {
-		final URL url = new URL(new URL(currLoadedDoc), docToLoad);
-		docToLoad = url.toString();
-		input = new InputSource(docToLoad);
-	    }
-
-	    final SyntaxTreeNode root = parser.parse(input);
-	    if (root == null) return;
-	    final Stylesheet _included = parser.makeStylesheet(root);
-	    if (_included == null) return;
-
-	    _included.setSourceLoader(loader);
-	    _included.setSystemId(docToLoad);
-	    _included.setParentStylesheet(context);
-
-	    // An included stylesheet gets the same import precedence
-	    // as the stylesheet that included it.
-	    final int precedence = context.getImportPrecedence();
-	    _included.setImportPrecedence(precedence);
-
-	    parser.setCurrentStylesheet(_included);
-	    _included.parseContents(parser);
-
-	    final Enumeration elements = _included.elements();
-	    final Stylesheet topStylesheet = parser.getTopLevelStylesheet();
-	    while (elements.hasMoreElements()) {
-		final Object element = elements.nextElement();
-		if (element instanceof TopLevelElement) {
-		    topStylesheet.addElement((TopLevelElement)element);
-		}
-	    }
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	}
-	finally {
-	    parser.setCurrentStylesheet(context);
-	}
-    }
-    
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void;
-    }
-    
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	// do nothing
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Instruction.java b/src/org/apache/xalan/xsltc/compiler/Instruction.java
deleted file mode 100644
index 697c0ca..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Instruction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-abstract class Instruction extends SyntaxTreeNode {
-    /**
-     * Type check all the children of this node.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return typeCheckContents(stable);
-    }
-
-    /**
-     * Translate this node into JVM bytecodes.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	getParser().notYetImplemented("instruction: " + getClass());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/IntExpr.java b/src/org/apache/xalan/xsltc/compiler/IntExpr.java
deleted file mode 100644
index 0fb6933..0000000
--- a/src/org/apache/xalan/xsltc/compiler/IntExpr.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class IntExpr extends Expression {
-    private final int _value;
-
-    public IntExpr(int value) {
-        _value = value;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return _type = Type.Int;
-    }
-
-    public String toString() {
-	return "int-expr(" + _value + ')';
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-	il.append(new PUSH(cpg, _value));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Key.java b/src/org/apache/xalan/xsltc/compiler/Key.java
deleted file mode 100644
index 6d2bd17..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Key.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.dom.Axis;
-
-final class Key extends TopLevelElement {
-
-    private QName      _name;     // The name of this key (ie. index)
-    private Pattern    _match;    // The nodes to generate index keys from
-    private Expression _use;      // The nodes to include in the key
-    private Type       _useType;  // The data type of the key's contents
-
-    private final String USE_TYPE_ERR =
-	"The use-attribute of <key> must be node, node-set, string or number.";
-
-    /**
-     * Parse the <xsl:key> element and attributes
-     * @param parser A reference to the stylesheet parser
-     */
-    public void parseContents(Parser parser) {
-
-	// Get the required attributes and parser XPath expressions
-	_name = parser.getQName(getAttribute("name"));
-	_match = parser.parsePattern(this, "match", null);
-	_use = parser.parseExpression(this, "use", null);
-
-        // Make sure required attribute(s) have been set
-        if (_name == null) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "name");
-	    return;
-        }
-        if (_match.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "match");
-	    return;
-        }
-        if (_use.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "use");
-	    return;
-        }
-    }
-
-    /**
-     * Returns a String-representation of this key's name
-     * @return The key's name (from the <xsl:key> elements 'name' attribute).
-     */
-    public String getName() {
-	String name;
-	if (_name.getPrefix() == null)
-	    name = _name.getLocalPart();
-	else
-	    name = _name.getPrefix()+":"+_name.getLocalPart();
-	return(name);
-    }
-
-    /**
-     * Run type check on the "use" attribute and make sure it is something
-     * we can use to extract some value from nodes.
-     * @param stable The stylesheet parser's symbol table
-     * @return The data-type of this key (always void)
-     * @throws TypeCheckError If the use attribute does not represent a string,
-     *   a node-set or a number
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_match.typeCheck(stable);
-	_useType = _use.typeCheck(stable);
-
-	// Cast node values to string values
-	if (_useType instanceof NodeType) {
-	    _use = new CastExpr(_use, Type.String);
-	    _useType = Type.String;
-	}
-
-	// If the 'use' attribute is not a string, node-set or number
-	if (!(_useType instanceof StringType) &&
-	    !(_useType instanceof NodeSetType) &&
-	    !(_useType instanceof RealType)) {
-	    throw new TypeCheckError(new ErrorMsg(USE_TYPE_ERR));
-	}
-
-	return Type.Void;
-    }
-
-    /**
-     * This method is called if the "use" attribute of the key contains a
-     * node set. In this case we must traverse all nodes in the set and
-     * create one entry in this key's index for each node in the set.
-     * @param classGen The Java class generator
-     * @param methodGen The method generator
-     */
-    public void traverseNodeSet(ClassGenerator classGen,
-				MethodGenerator methodGen,
-				int buildKeyIndex) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// DOM.getNodeValue(nodeIndex) => String
-	final int getNodeValue = cpg.addInterfaceMethodref(DOM_INTF,
-							   "getNodeValue",
-							   "(I)"+STRING_SIG);
-
-	// This variable holds the id of the node we found with the "match"
-	// attribute of xsl:key. This is the id we store, with the value we
-	// get from the nodes we find here, in the index for this key.
-	final LocalVariableGen parentNode =
-	    methodGen.addLocalVariable("parentNode",
-				       Util.getJCRefType("I"),
-				       il.getEnd(), null);
-
-	// Get the 'parameter' from the stack and store it in a local var.
-	il.append(new ISTORE(parentNode.getIndex()));
-
-	// Save current node and current iterator on the stack
-	il.append(methodGen.loadCurrentNode());
-	il.append(methodGen.loadIterator());
-
-	// Overwrite current iterator with one that gives us only what we want
-	_use.translate(classGen, methodGen);
-	_use.startResetIterator(classGen, methodGen);
-	il.append(methodGen.storeIterator());
-
-	final BranchHandle nextNode = il.append(new GOTO(null));
-	final InstructionHandle loop = il.append(NOP);
-
-	// Prepare to call buildKeyIndex(String name, int node, String value);
-	il.append(classGen.loadTranslet());
-	il.append(new PUSH(cpg, getName()));
-	il.append(new ILOAD(parentNode.getIndex()));
-
-	// Now get the node value and feck it on the parameter stack
-	il.append(methodGen.loadDOM());
-	il.append(methodGen.loadCurrentNode());
-	il.append(new INVOKEINTERFACE(getNodeValue, 2));
-
-	// Finally do the call to add an entry in the index for this key.
-	il.append(new INVOKEVIRTUAL(buildKeyIndex));
-
-	nextNode.setTarget(il.append(methodGen.loadIterator()));
-	il.append(methodGen.nextNode());
-
-	il.append(DUP);
-	il.append(methodGen.storeCurrentNode());
-	il.append(new IFNE(loop)); // Go on to next matching node....
-
-	// Restore current node and current iterator from the stack
-	il.append(methodGen.storeIterator());
-	il.append(methodGen.storeCurrentNode());
-    }
-
-    /**
-     * Gather all nodes that match the expression in the attribute "match"
-     * and add one (or more) entries in this key's index.
-     * @param classGen The Java class generator
-     * @param methodGen The method generator
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final int current = methodGen.getLocalIndex("current");
-
-	// AbstractTranslet.buildKeyIndex(name,node_id,value) => void
-	final int key = cpg.addMethodref(TRANSLET_CLASS,
-					 "buildKeyIndex",
-					 "("+STRING_SIG+"I"+OBJECT_SIG+")V");
-
-	// DOM.getAxisIterator(root) => NodeIterator
-	final int git = cpg.addInterfaceMethodref(DOM_INTF,
-						  "getAxisIterator",
-						  "(I)"+NODE_ITERATOR_SIG);
-
-	il.append(methodGen.loadCurrentNode());
-	il.append(methodGen.loadIterator());
-
-	// Get an iterator for all nodes in the DOM
-	il.append(methodGen.loadDOM());	
-	il.append(new PUSH(cpg,Axis.DESCENDANT));
-	il.append(new INVOKEINTERFACE(git, 2));
-
-	// Reset the iterator to start with the root node
-	il.append(methodGen.loadCurrentNode());
-	il.append(methodGen.setStartNode());
-	il.append(methodGen.storeIterator());
-
-	// Loop for traversing all nodes in the DOM
-	final BranchHandle nextNode = il.append(new GOTO(null));
-	final InstructionHandle loop = il.append(NOP);
-
-	// Check if the current node matches the pattern in "match"
-	il.append(methodGen.loadCurrentNode());
-	_match.translate(classGen, methodGen);
-	_match.synthesize(classGen, methodGen); // Leaves 0 or 1 on stack
-	final BranchHandle skipNode = il.append(new IFEQ(null));
-	
-	// If this is just a single node we should convert that to a string
-	// and use that string as the value in the index for this key.
-	if (_useType instanceof RealType) {
-	    final int dbl = cpg.addMethodref(DOUBLE_CLASS,"<init>", "(D)V");
-
-	    il.append(classGen.loadTranslet());
-	    il.append(new PUSH(cpg, _name.toString()));
-	    il.append(methodGen.loadCurrentNode());
-	    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
-	    il.append(DUP);
-	    _use.translate(classGen,methodGen);
-	    il.append(new INVOKESPECIAL(dbl));
-	    il.append(new INVOKEVIRTUAL(key));
-
-	}
-	else if (_useType instanceof StringType) {
-	    il.append(classGen.loadTranslet());
-	    il.append(new PUSH(cpg, _name.toString()));
-	    il.append(methodGen.loadCurrentNode());
-	    _use.translate(classGen,methodGen);
-	    il.append(new INVOKEVIRTUAL(key));
-	}
-	// If this is a node-set we must go through each node in the set
-	// and create one entry in the key index for each node in the set.
-	else {
-	    // Pass current node as parameter (we're indexing on that node)
-	    il.append(methodGen.loadCurrentNode());
-	    traverseNodeSet(classGen,methodGen,key);
-	}
-	
-	// Get the next node from the iterator and do loop again...
-	final InstructionHandle skip = il.append(NOP);
-	
-	il.append(methodGen.loadIterator());
-	il.append(methodGen.nextNode());
-	il.append(DUP);
-	il.append(methodGen.storeCurrentNode());
-	il.append(new IFNE(loop));
-
-	// Restore current node and current iterator from the stack
-	il.append(methodGen.storeIterator());
-	il.append(methodGen.storeCurrentNode());
-	
-	nextNode.setTarget(skip);
-	skipNode.setTarget(skip);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/KeyCall.java b/src/org/apache/xalan/xsltc/compiler/KeyCall.java
deleted file mode 100644
index fd9a1f9..0000000
--- a/src/org/apache/xalan/xsltc/compiler/KeyCall.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class KeyCall extends FunctionCall {
-
-    private Expression _name;      // The name of this key
-    private Expression _value;     // The value to look up in the key/index
-    private Type       _valueType; // The value's data type
-
-    /**
-     * Get the parameters passed to function:
-     *   key(String name, String value)
-     *   key(String name, NodeSet value)
-     * The 'arguments' vector should contain two parameters for key() calls,
-     * one holding the key name and one holding the value(s) to look up. The
-     * vector has only one parameter for id() calls (the key name is always
-     * "##id" for id() calls).
-     *
-     * @param fname The function name (should be 'key' or 'id')
-     * @param arguments A vector containing the arguments the the function
-     */
-    public KeyCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-	switch(argumentCount()) {
-	case 1:
-	    _name = null;
-	    _value = argument(0);
-	    break;
-	case 2:
-	    _name = argument(0);
-	    _value = argument(1);
-	    break;
-	default:
-	    _name = _value = null;
-	    break;
-	}
-    }
-
-    /**
-     * Type check the parameters for the id() or key() function.
-     * The index name (for key() call only) must be a string or convertable
-     * to a string, and the lookup-value must be a string or a node-set.
-     * @param stable The parser's symbol table
-     * @throws TypeCheckError When the parameters have illegal type
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type returnType = super.typeCheck(stable);
-
-	// Run type check on the key name (first argument) - must be a string,
-	// and if it is not it must be converted to one using string() rules.
-	if (_name != null) {
-	    final Type nameType = _name.typeCheck(stable); 
-	    if (!(nameType instanceof StringType)) {
-		_name = new CastExpr(_name, Type.String);
-	    }
-	}
-
-	// Run type check on the value for this key. This value can be of
-	// any data type, so this should never cause any type-check errors.
-	// If the value is not a node-set then it should be converted to a
-	// string before the lookup is done. If the value is a node-set then
-	// this process (convert to string, then do lookup) should be applied
-	// to every node in the set, and the result from all lookups should
-	// be added to the resulting node-set.
-	_valueType = _value.typeCheck(stable);
-
-	if ((_valueType != Type.NodeSet) &&
-	    (_valueType != Type.ResultTree) &&
-	    (_valueType != Type.String) &&
-	    (_valueType != Type.Real) &&
-	    (_valueType != Type.Int)) {
-	    _value = new CastExpr(_value, Type.String);
-	}
-
-	return returnType;
-    }
-
-    /**
-     * This method is called when the constructor is compiled in
-     * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
-     * This method is a wrapper for the real translation method, which is
-     * the private method translateCall() below. All this method does is to
-     * wrap the KeyIndex that this function returns inside a duplicate filter.
-     * The duplicate filter is used both to eliminate duplicates and to
-     * cache the nodes in the index.
-     * @param classGen The Java class generator
-     * @param methodGen The method generator
-     */
-    public void translate(ClassGenerator classGen,
-			  MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Wrap the KeyIndex (iterator) inside a duplicate filter iterator
-	// to pre-read the indexed nodes and cache them.
-	final int dupInit = cpg.addMethodref(DUP_FILTERED_ITERATOR,
-					     "<init>",
-					     "("+NODE_ITERATOR_SIG+")V");
-	il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR)));
-	il.append(DUP);
-	translateCall(classGen, methodGen);
-	il.append(new INVOKESPECIAL(dupInit));
-    }
-
-    /**
-     * Translate the actual index lookup - leaves KeyIndex (iterator) on stack
-     * @param classGen The Java class generator
-     * @param methodGen The method generator
-     */
-    private void translateCall(ClassGenerator classGen,
-			      MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Returns the string value for a node in the DOM
-	final int getNodeValue = cpg.addInterfaceMethodref(DOM_INTF,
-							   "getNodeValue",
-							   "(I)"+STRING_SIG);
-
-	// Returns the KeyIndex object of a given name
-	final int getKeyIndex = cpg.addMethodref(TRANSLET_CLASS,
-						 "getKeyIndex",
-						 "(Ljava/lang/String;)"+
-						 KEY_INDEX_SIG);
-
-	// Initialises a KeyIndex to return nodes with specific values
-	final int lookupId = cpg.addMethodref(KEY_INDEX_CLASS,
-					      "lookupId",
-					      "(Ljava/lang/Object;)V");
-	final int lookupKey = cpg.addMethodref(KEY_INDEX_CLASS,
-					       "lookupKey",
-					       "(Ljava/lang/Object;)V");
-
-	// Merges the nodes in two KeyIndex objects
-	final int merge = cpg.addMethodref(KEY_INDEX_CLASS,
-					   "merge",
-					   "("+KEY_INDEX_SIG+")V");
-
-	// Constructor for KeyIndex class
-	final int indexConstructor = cpg.addMethodref(TRANSLET_CLASS,
-						      "createKeyIndex",
-						      "()"+KEY_INDEX_SIG);
-	
-	// This local variable holds the index/iterator we will return
-	final LocalVariableGen returnIndex =
-	    methodGen.addLocalVariable("returnIndex",
-				       Util.getJCRefType(KEY_INDEX_SIG),
-				       il.getEnd(), null);
-
-	// This local variable holds the index we're using for search
-	final LocalVariableGen searchIndex =
-	    methodGen.addLocalVariable("searchIndex",
-				       Util.getJCRefType(KEY_INDEX_SIG),
-				       il.getEnd(), null);
-
-	// If the second paramter is a node-set we need to go through each
-	// node in the set, convert each one to a string and do a look up in
-	// the named index, and then merge all the resulting node sets.
-	if (_valueType == Type.NodeSet || _valueType == Type.ResultTree) {
-	    // Save current node and current iterator on the stack
-	    il.append(methodGen.loadCurrentNode());
-	    il.append(methodGen.loadIterator());
-
-	    // Get new iterator from 2nd parameter node-set & store in variable
-	    _value.translate(classGen, methodGen);
-	    _value.startResetIterator(classGen, methodGen);
-	    il.append(methodGen.storeIterator());
-
-	    // Create the KeyIndex object (the iterator) we'll return
-	    il.append(classGen.loadTranslet());
-	    il.append(new INVOKEVIRTUAL(indexConstructor));
-	    il.append(new ASTORE(returnIndex.getIndex()));
-
-	    // Initialise the index specified in the first parameter of key()
-	    il.append(classGen.loadTranslet());
-	    if (_name == null) 
-		il.append(new PUSH(cpg,"##id"));
-	    else
-		_name.translate(classGen, methodGen);
-
-	    il.append(new INVOKEVIRTUAL(getKeyIndex));
-	    il.append(new ASTORE(searchIndex.getIndex()));
-
-	    // LOOP STARTS HERE
-
-	    // Now we're ready to start traversing the node-set given in
-	    // the key() function's second argument....
-	    final BranchHandle nextNode = il.append(new GOTO(null));
-	    final InstructionHandle loop = il.append(NOP);
-
-	    // Push returnIndex on stack to prepare for call to merge()
-	    il.append(new ALOAD(returnIndex.getIndex()));
-	    
-	    // Lookup index using the string value from the current node
-	    il.append(new ALOAD(searchIndex.getIndex()));
-	    il.append(DUP);
-	    il.append(methodGen.loadDOM());
-	    il.append(methodGen.loadCurrentNode());
-	    il.append(new INVOKEINTERFACE(getNodeValue, 2));
-	    if (_name == null)
-		il.append(new INVOKEVIRTUAL(lookupId));
-	    else
-		il.append(new INVOKEVIRTUAL(lookupKey));
-
-	    // Call to returnIndex.merge(searchIndex);
-	    il.append(new INVOKEVIRTUAL(merge));
-		
-	    // Go on with next node in the 2nd parameter node-set
-	    nextNode.setTarget(il.append(methodGen.loadIterator()));
-	    il.append(methodGen.nextNode());
-	    il.append(DUP);
-	    il.append(methodGen.storeCurrentNode());
-	    il.append(new IFNE(loop));
-
-	    // LOOP ENDS HERE
-
-	    // Restore current node and current iterator from the stack
-	    il.append(methodGen.storeIterator());
-	    il.append(methodGen.storeCurrentNode());
-
-	    // Return with the an iterator for all resulting nodes
-	    il.append(new ALOAD(returnIndex.getIndex()));
-	}
-	// If the second parameter is a single value we just lookup the named
-	// index and initialise the iterator to return nodes with this value.
-	else {
-	    // Call getKeyIndex in AbstractTranslet with the name of the key
-	    // to get the index for this key (which is also a node iterator).
-	    il.append(classGen.loadTranslet());
-	    if (_name == null)
-		il.append(new PUSH(cpg,"##id"));
-	    else
-		_name.translate(classGen, methodGen);
-	    il.append(new INVOKEVIRTUAL(getKeyIndex));
-
-	    // Now use the value in the second argument to determine what nodes
-	    // the iterator should return.
-	    il.append(DUP);
-
-	    if (_valueType == Type.Int || _valueType == Type.Real) {
-		final int dbl = cpg.addMethodref(DOUBLE_CLASS,"<init>", "(D)V");
-		il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
-		il.append(DUP);
-		_value.translate(classGen, methodGen);
-		if (_valueType == Type.Int)
-		    il.append(new I2D());
-		il.append(new INVOKESPECIAL(dbl));
-	    }
-	    else {
-		_value.translate(classGen, methodGen);
-	    }
-
-	    if (_name == null)
-		il.append(new INVOKEVIRTUAL(lookupId));
-	    else
-		il.append(new INVOKEVIRTUAL(lookupKey));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/KeyPattern.java b/src/org/apache/xalan/xsltc/compiler/KeyPattern.java
deleted file mode 100644
index 1562d5d..0000000
--- a/src/org/apache/xalan/xsltc/compiler/KeyPattern.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-final class KeyPattern extends IdKeyPattern {
-
-    public KeyPattern(String index, String value) {
-	super(index,value);
-    }    
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LangCall.java b/src/org/apache/xalan/xsltc/compiler/LangCall.java
deleted file mode 100644
index 08991b9..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LangCall.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class LangCall extends FunctionCall {
-    private Expression _lang;
-    private Type _langType;
-
-    /**
-     * Get the parameters passed to function:
-     *   lang(string)
-     */
-    public LangCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-	_lang = argument(0);
-    }
-
-    /**
-     *
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_langType = _lang.typeCheck(stable);
-	if (!(_langType instanceof StringType)) {
-	    _lang = new CastExpr(_lang, Type.String);
-	}
-	return Type.Boolean;
-    }
-
-    /**
-     *
-     */
-    public Type getType() {
-	return(Type.Boolean);
-    }
-
-    /**
-     * This method is called when the constructor is compiled in
-     * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
-     */
-    public void translate(ClassGenerator classGen,
-			  MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	final int tst = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-					 "testLanguage",
-					 "("+STRING_SIG+DOM_INTF_SIG+"I)Z");
-	_lang.translate(classGen,methodGen);
-	il.append(methodGen.loadDOM());
-	if (classGen instanceof FilterGenerator)
-	    il.append(new ILOAD(1));
-	else
-	    il.append(methodGen.loadContextNode());
-	il.append(new INVOKESTATIC(tst));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LastCall.java b/src/org/apache/xalan/xsltc/compiler/LastCall.java
deleted file mode 100644
index 0d9eb04..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LastCall.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.dom.Axis;
-
-final class LastCall extends FunctionCall {
-
-    private int _type = -1;
-
-    public LastCall(QName fname) {
-	super(fname);
-    }
-
-    public LastCall(QName fname, int type) {
-	this(fname);
-	_type = type;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final InstructionList il = methodGen.getInstructionList();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-
-	boolean lastChild = false;
-
-	// If we're a part of an pattern's predicate we want to know what
-	// type of node we want to be looking for (not just any).
-	if (getParent() instanceof Expression) {
-	    if (getParent().getParent() instanceof Predicate) {
-		Predicate pred = (Predicate)getParent().getParent();
-		_type = pred.getPosType();
-	    }
-	}
-
-	// If we're a part of a step-type expression we want the last of the
-	// current node's children and not the last in the current iterator.
-	if (getParent() instanceof Predicate) {
-	    _type = ((Predicate)getParent()).getPosType();
-	    if (getParent().getParent() instanceof Step) {
-		lastChild = true;
-	    }
-	}
-
-	if (methodGen instanceof CompareGenerator) {
-	    il.append(((CompareGenerator)methodGen).loadLastNode());
-	}
-	else if (classGen.isExternal()) {
-	    il.append(new ILOAD(LAST_INDEX));
-	}
-	else if (_type == -1) {
-	    final int last = cpg.addInterfaceMethodref(NODE_ITERATOR,
-						       "getLast", 
-						       "()I");
-	    final int git = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getTypedAxisIterator", 
-						      "(II)"+NODE_ITERATOR_SIG);
-	    final int start = cpg.addInterfaceMethodref(NODE_ITERATOR,
-							"setStartNode", 
-							"(I)"+
-							NODE_ITERATOR_SIG);
-	    if (lastChild) {
-		il.append(methodGen.loadDOM());
-		il.append(new PUSH(cpg, Axis.CHILD));
-		il.append(new PUSH(cpg, DOM.ELEMENT));
-		il.append(new INVOKEINTERFACE(git, 3));
-		il.append(methodGen.loadCurrentNode());
-		il.append(new INVOKEINTERFACE(start, 2));
-	    }
-	    else {
-		il.append(methodGen.loadIterator());
-	    }
-	    il.append(new INVOKEINTERFACE(last, 1));
-	}
-	else {
-	    // public int getTypedPosition(NodeIterator iterator, int type) {
-	    final int last = cpg.addInterfaceMethodref(DOM_INTF,
-						       "getTypedLast",
-						       "("+
-						       NODE_ITERATOR_SIG+
-						       "II)I");
-	    il.append(methodGen.loadDOM());
-	    il.append(methodGen.loadIterator());
-	    il.append(new PUSH(cpg, _type));
-	    il.append(methodGen.loadCurrentNode());
-	    il.append(new INVOKEINTERFACE(last, 4));
-
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java b/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java
deleted file mode 100644
index 70f22ae..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class LiteralAttribute extends Instruction {
-    private final String  _name;
-    private final AttributeValue _value;
-
-    public LiteralAttribute(String name, String value, Parser parser) {
-	_name = name;
-	_value = AttributeValue.create(this, value, parser);
-    }
-
-    public void display(int indent) {
-	indent(indent);
-	Util.println("LiteralAttribute name=" + _name + " value=" + _value);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_value.typeCheck(stable);
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    public boolean contextDependent() {
-	return _value.contextDependent();
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// push handler
-	il.append(methodGen.loadHandler());
-	// push attribute name - namespace prefix set by parent node
-	il.append(new PUSH(cpg, _name));
-	// push attribute value
-	_value.translate(classGen, methodGen);
-	// call attribute
-	il.append(methodGen.attribute());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LiteralElement.java b/src/org/apache/xalan/xsltc/compiler/LiteralElement.java
deleted file mode 100644
index 3e251ad..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LiteralElement.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class LiteralElement extends Instruction {
-    private String _name;
-    private Hashtable _accessedPrefixes = null;
-    private LiteralElement _parent;
-    private Vector _attributeElements = null;
-
-    private final static String XMLNS_STRING = "xmlns";
-
-    /**
-     * Returns the QName for this literal element
-     */
-    public QName getName() {
-	return _qname;
-    }
- 
-    /**
-     * Displays the contents of this literal element
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("LiteralElement name = " + _name);
-	displayContents(indent + IndentIncrement);
-    }
-
-    /**
-     * Returns the namespace URI for which a prefix is pointing to
-     */
-    public String accessedNamespace(String prefix) {
-	if (_accessedPrefixes == null)
-	    return(null);
-	else
-	    return((String)_accessedPrefixes.get(prefix));
-    }
-
-    /**
-     * Method used to keep track of what namespaces that are references by
-     * this literal element and its attributes. The output must contain a
-     * definition for each namespace, so we stuff them in a hashtable.
-     */
-    public void registerNamespace(String prefix, String uri,
-				  SymbolTable stable, boolean declared) {
-
-	// Check if the parent has a declaration for this namespace
-	if (_parent != null) {
-	    final String parentUri = _parent.accessedNamespace(prefix);
-	    if (parentUri == null) {
-		_parent.registerNamespace(prefix, uri, stable, declared);
-		return;
-	    }
-	    if (parentUri.equals(uri)) return;
-	}
-
-	// Check if we have any declared namesaces
-	if (_accessedPrefixes == null) {
-	    _accessedPrefixes = new Hashtable();
-	}
-	else {
-	    if (!declared) {
-		// Check if this node has a declaration for this namespace
-		final String old = (String)_accessedPrefixes.get(prefix);
-		if (old != null) {
-		    if (old.equals(uri))
-			return;
-		    else
-			prefix = stable.generateNamespacePrefix();
-		}
-	    }
-	}
-
-	if (!prefix.equals("xml")) {
-	    _accessedPrefixes.put(prefix,uri);
-	}
-    }
-
-    /**
-     * Translates the prefix of a QName according to the rules set in
-     * the attributes of xsl:stylesheet. Also registers a QName to assure
-     * that the output element contains the necessary namespace declarations.
-     */
-    private String translateQName(QName qname, SymbolTable stable) {
-	// Break up the QName and get prefix:localname strings
-	String localname = qname.getLocalPart();
-	String prefix = qname.getPrefix();
-
-	// Treat default namespace as "" and not null
-	if (prefix == null)
-	    prefix = Constants.EMPTYSTRING;
-	else if (prefix.equals(XMLNS_STRING))
-	    return(XMLNS_STRING);
-	
-	// Check if we must translate the prefix
-	final String alternative = stable.lookupPrefixAlias(prefix);
-	if (alternative != null) {
-	    stable.excludeNamespaces(prefix);
-	    prefix = alternative;
-	}
-
-	// Get the namespace this prefix refers to
-	String uri = lookupNamespace(prefix);
-	if (uri == null) return(localname);
-
-	// Register the namespace as accessed
-	registerNamespace(prefix, uri, stable, false);
-
-	// Construct the new name for the element (may be unchanged)
-	if (prefix != Constants.EMPTYSTRING)
-	    return(prefix+":"+localname);
-	else
-	    return(localname);
-    }
-
-    /**
-     * Add an attribute to this element
-     */
-    public void addAttribute(SyntaxTreeNode attribute) {
-	if (_attributeElements == null) {
-	    _attributeElements = new Vector(2);
-	}
-	_attributeElements.add(attribute);
-    }
-
-    /**
-     * Set the first attribute of this element
-     */
-    public void setFirstAttribute(SyntaxTreeNode attribute) {
-	if (_attributeElements == null) {
-	    _attributeElements = new Vector(2);
-	}
-	_attributeElements.insertElementAt(attribute,0);
-    }
-
-
-    /**
-     * Type-check the contents of this element. The element itself does not
-     * need any type checking as it leaves nothign on the JVM's stack.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// Type-check all attributes
-	if (_attributeElements != null) {
-	    final int count = _attributeElements.size();
-	    for (int i = 0; i < count; i++) {
-		SyntaxTreeNode node = 
-		    (SyntaxTreeNode)_attributeElements.elementAt(i);
-		node.typeCheck(stable);
-	    }
-	}
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    /**
-     * This method starts at a given node, traverses all namespace mappings,
-     * and assembles a list of all prefixes that (for the given node) maps
-     * to _ANY_ namespace URI. Used by literal result elements to determine
-     */
-    public Enumeration getNamespaceScope(SyntaxTreeNode node) {
-	Hashtable all = new Hashtable();
-	
-	while (node != null) {
-	    Hashtable mapping = node.getPrefixMapping();
-	    if (mapping != null) {
-		Enumeration prefixes = mapping.keys();
-		while (prefixes.hasMoreElements()) {
-		    String prefix = (String)prefixes.nextElement();
-		    if (!all.containsKey(prefix)) {
-			all.put(prefix, mapping.get(prefix));
-		    }
-		}
-	    }
-	    node = node.getParent();
-	}
-	return(all.keys());
-    }
-
-    /**
-     * Determines the final QName for the element and its attributes.
-     * Registers all namespaces that are used by the element/attributes
-     */
-    public void parseContents(Parser parser) {
-
-	final SymbolTable stable = parser.getSymbolTable();
-	stable.setCurrentNode(this);
-
-	// Find the closest literal element ancestor (if there is one)
-	SyntaxTreeNode _parent = getParent();
-	while ((_parent != null) && !(_parent instanceof LiteralElement))
-	    _parent = _parent.getParent();
-	if (!(_parent instanceof LiteralElement))
-	    _parent = null;
-
-	_name = translateQName(_qname, stable);
-
-	// Process all attributes and register all namespaces they use
-	final int count = _attributes.getLength();
-	for (int i = 0; i < count; i++) {
-
-	    final QName qname = parser.getQName(_attributes.getQName(i));
-	    final String uri = qname.getNamespace();
-	    final String val = _attributes.getValue(i);
-
-	    // Handle xsl:use-attribute-sets. Attribute sets are placed first
-	    // in the vector or attributes to make sure that later local
-	    // attributes can override an attributes in the set.
-	    if (qname == parser.getUseAttributeSets()) {
-		setFirstAttribute(new UseAttributeSets(val, parser));
-	    }
-	    // Handle xsl:extension-element-prefixes
-	    else if (qname == parser.getExtensionElementPrefixes()) {
-		stable.excludeNamespaces(val);
-	    }
-	    // Handle xsl:exclude-result-prefixes
-	    else if (qname == parser.getExcludeResultPrefixes()) {
-		stable.excludeNamespaces(val);
-	    }
-	    // Ignore all other attributes in XSL namespace
-	    else if ((uri != null) && (uri.equals(XSLT_URI))) {
-		
-	    }
-	    // Handle literal attributes (attributes not in XSL namespace)
-	    else {
-		final String name = translateQName(qname, stable);
-		LiteralAttribute attr = new LiteralAttribute(name, val, parser);
-		addAttribute(attr);
-		attr.setParent(this);
-		attr.parseContents(parser);
-	    }
-	}
-
-	// Register all namespaces that are in scope, except for those that
-	// are listed in the xsl:stylesheet element's *-prefixes attributes
-	final Enumeration include = getNamespaceScope(this);
-	while (include.hasMoreElements()) {
-	    final String prefix = (String)include.nextElement();
-	    if (!prefix.equals("xml")) {
-		final String uri = lookupNamespace(prefix);
-		if ((uri != null) && (!uri.equals(XSLT_URI))) {
-		    if (!stable.isExcludedNamespace(uri))
-			registerNamespace(prefix,uri,stable,true);
-		}
-	    }
-	}
-
-	parseChildren(parser);
-
-	// Process all attributes and register all namespaces they use
-	for (int i = 0; i < count; i++) {
-
-	    final QName qname = parser.getQName(_attributes.getQName(i));
-	    final String val = _attributes.getValue(i);
-
-	    // Handle xsl:extension-element-prefixes
-	    if (qname == parser.getExtensionElementPrefixes()) {
-		stable.unExcludeNamespaces(val);
-	    }
-	    // Handle xsl:exclude-result-prefixes
-	    else if (qname == parser.getExcludeResultPrefixes()) {
-		stable.unExcludeNamespaces(val);
-	    }
-	}
-    }
-
-    /**
-     * 
-     */
-    public boolean contextDependent() {
-	return dependentContents();
-    }
-
-    /**
-     * Compiles code that emits the literal element to the output handler,
-     * first the start tag, then namespace declaration, then attributes,
-     * then the element contents, and then the element end tag.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Compile code to emit element start tag
-	il.append(methodGen.loadHandler());
-	il.append(new PUSH(cpg, _name));
-	il.append(DUP2); // duplicate these 2 args for endElement
-	il.append(methodGen.startElement());
-
-	// Output all attributes
-	if (_attributeElements != null) {
-	    final int count = _attributeElements.size();
-	    for (int i = 0; i < count; i++) {
-		SyntaxTreeNode node = 
-		    (SyntaxTreeNode)_attributeElements.elementAt(i);
-		node.translate(classGen, methodGen);
-	    }
-	}
-
-	// Compile code to emit namespace attributes
-	if (_accessedPrefixes != null) {
-	    Enumeration e = _accessedPrefixes.keys();
-	    while (e.hasMoreElements()) {
-		final String prefix = (String)e.nextElement();
-		final String uri = (String)_accessedPrefixes.get(prefix);
-		if ((uri != Constants.EMPTYSTRING) ||
-		    (prefix == Constants.EMPTYSTRING)) {
-		    il.append(methodGen.loadHandler());
-		    il.append(new PUSH(cpg,prefix));
-		    il.append(new PUSH(cpg,uri));
-		    il.append(methodGen.namespace());
-		}
-	    }
-	}
-	
-	// Compile code to emit attributes and child elements
-	translateContents(classGen, methodGen);
-
-	// Compile code to emit element end tag
-	il.append(methodGen.endElement());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LiteralExpr.java b/src/org/apache/xalan/xsltc/compiler/LiteralExpr.java
deleted file mode 100644
index 436219d..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LiteralExpr.java
+++ /dev/null
@@ -1,113 +0,0 @@
-
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class LiteralExpr extends Expression {
-    private final String _value;
-    private final String _namespace;
-
-    public LiteralExpr(String value) {
-	_value = value;
-	_namespace = null;
-    }
-
-    public LiteralExpr(String value, String namespace) {
-	_value = value;
-	if (namespace.equals(Constants.EMPTYSTRING))
-	    _namespace = null;
-	else
-	    _namespace = namespace;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return _type = Type.String;
-    }
-
-    public String toString() {
-	return "literal-expr(" + _value + ')';
-    }
-
-    public boolean contextDependent() {
-	return false;
-    }
-
-    public String getValue() {
-	return _value;
-    }
-
-    public String getNamespace() {
-	return _namespace;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new PUSH(cpg, _value));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LocalNameCall.java b/src/org/apache/xalan/xsltc/compiler/LocalNameCall.java
deleted file mode 100644
index da52568..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LocalNameCall.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class LocalNameCall extends NameBase {
-
-    /**
-     * Handles calls with no parameter (current node is implicit parameter).
-     */
-    public LocalNameCall(QName fname) {
-	super(fname);
-    }
-
-    /**
-     * Handles calls with one parameter (either node or node-set).
-     */
-    public LocalNameCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * This method is called when the constructor is compiled in
-     * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
-     */
-    public void translate(ClassGenerator classGen,
-			  MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Returns the name of a node in the DOM
-	final int getNodeName = cpg.addInterfaceMethodref(DOM_INTF,
-							  "getNodeName",
-							  "(I)"+STRING_SIG);
-
-	final int getLocalName = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-						  "getLocalName",
-						  "(Ljava/lang/String;)"+
-						  "Ljava/lang/String;");
-	super.translate(classGen, methodGen);
-	il.append(new INVOKEINTERFACE(getNodeName, 2));
-	il.append(new INVOKESTATIC(getLocalName));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java b/src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java
deleted file mode 100644
index 0f40bfa..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-public abstract class LocationPathPattern extends Pattern {
-    private Template _template;
-    private int _importPrecedence;
-    private double _priority = Double.NaN;
-    private int _position = 0;
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void;		// TODO
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	// TODO: What does it mean to translate a Pattern ?
-    }
-	
-    public void setTemplate(final Template template) {
-	_template = template;
-	_priority = template.getPriority();
-	_importPrecedence = template.getImportPrecedence();
-	_position = template.getPosition();
-    }
-		
-    public Template getTemplate() {
-	return _template;
-    }
-		
-    public final double getPriority() {
-	return Double.isNaN(_priority) ? getDefaultPriority() : _priority;
-    }
-		
-    public double getDefaultPriority() {
-	return 0.5;
-    }
-
-    /**
-     * This method is used by the Mode class to prioritise patterns and
-     * template. This method is called for templates that are in the same
-     * mode and that match on the same core pattern. The rules used are:
-     *  o) first check precedence - highest precedence wins
-     *  o) then check priority - highest priority wins
-     *  o) then check the position - the template that occured last wins
-     */
-    public boolean noSmallerThan(LocationPathPattern other) {
-	if (_importPrecedence > other._importPrecedence) {
-	    return true;
-	}
-	else if (_importPrecedence == other._importPrecedence) {
-	    if (_priority > other._priority) {
-		return true;
-	    }
-	    else if (_priority == other._priority) {
-		if (_position > other._position) {
-		    return true;
-		}
-	    }
-	}
-	return false;
-    }
-    
-    /** return last pattern (matching the current node) */
-    public abstract StepPattern getKernelPattern();
-	
-    public abstract void reduceKernelPattern();
-		
-    public abstract boolean isWildcard();
-
-    public String toString() {
-	return "root()";
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/LogicalExpr.java b/src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
deleted file mode 100644
index 795c778..0000000
--- a/src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class LogicalExpr extends Expression {
-
-    public static final int OR  = 0;
-    public static final int AND = 1;
-	
-    private final int  _op;     // operator
-    private Expression _left;   // first operand
-    private Expression _right;  // second operand
-
-    private static final String[] Ops = { "or", "and" };
-
-    /**
-     * Creates a new logical expression - either OR or AND. Note that the
-     * left- and right-hand side expressions can also be logical expressions,
-     * thus creating logical trees representing structures such as
-     * (a and (b or c) and d), etc...
-     */
-    public LogicalExpr(int op, Expression left, Expression right) {
-	_op = op;
-	(_left = left).setParent(this);
-	(_right = right).setParent(this);
-    }
-
-    /**
-     * Returns this logical expression's operator - OR or AND represented
-     * by 0 and 1 respectively.
-     */
-    public int getOp() {
-	return(_op);
-    }
-
-    /**
-     * Override the SyntaxTreeNode.setParser() method to make sure that the
-     * parser is set for sub-expressions
-     */
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-	_right.setParser(parser);
-    }
-
-    /**
-     * Returns a string describing this expression
-     */
-    public String toString() {
-	return Ops[_op] + '(' + _left + ", " + _right + ')';
-    }
-
-    /**
-     * Type-check this expression, and possibly child expressions.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// Get the left and right operand types
-	Type tleft = _left.typeCheck(stable); 
-	Type tright = _right.typeCheck(stable);
-
-	// Check if the operator supports the two operand types
-	MethodType wantType = new MethodType(Type.Void, tleft, tright);
-	MethodType haveType = lookupPrimop(stable, Ops[_op], wantType);
-
-	// Yes, the operation is supported
-	if (haveType != null) {
-	    // Check if left-hand side operand must be type casted
-	    Type arg1 = (Type)haveType.argsType().elementAt(0);
-	    if (!arg1.identicalTo(tleft))
-		_left = new CastExpr(_left, arg1);
-	    // Check if right-hand side operand must be type casted
-	    Type arg2 = (Type) haveType.argsType().elementAt(1);
-	    if (!arg2.identicalTo(tright))
-		_right = new CastExpr(_right, arg1);
-	    // Return the result type for the operator we will use
-	    return _type = haveType.resultType();
-	}
-	throw new TypeCheckError(this);
-    }
-
-    /**
-     * Compile the expression - leave boolean expression on stack
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	translateDesynthesized(classGen, methodGen);
-	synthesize(classGen, methodGen);
-    }
-
-    /**
-     * Compile expression and update true/false-lists
-     */
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-
-	final InstructionList il = methodGen.getInstructionList();
-	final SyntaxTreeNode parent = getParent();
-
-	// Compile AND-expression
-	if (_op == AND) {
-
-	    // Translate left hand side - must be true
-	    _left.translateDesynthesized(classGen, methodGen);
-
-	    // Need this for chaining any OR-expression children
-	    InstructionHandle middle = il.append(NOP);
-
-	    // Translate left right side - must be true
-	    _right.translateDesynthesized(classGen, methodGen);
-
-	    // Need this for chaining any OR-expression children
-	    InstructionHandle after = il.append(NOP);
-
-	    // Append child expression false-lists to our false-list
-	    _falseList.append(_right._falseList.append(_left._falseList));
-
-	    // Special case for OR-expression as a left child of AND.
-	    // The true-list of OR must point to second clause of AND.
-	    if ((_left instanceof LogicalExpr) &&
-		(((LogicalExpr)_left).getOp() == OR)) {
-		((LogicalExpr)_left).backPatchTrueList(middle);
-	    }
-	    else {
-		_trueList.append(_left._trueList);
-	    }
-
-	    // Special case for OR-expression as a right child of AND
-	    // The true-list of OR must point to true-list of AND.
-	    if ((_right instanceof LogicalExpr) &&
-		(((LogicalExpr)_right).getOp() == OR)) {
-		((LogicalExpr)_right).backPatchTrueList(after);
-	    }
-	    else {
-		_trueList.append(_right._trueList);
-	    }
-
-	} 
-	// Compile OR-expression
-	else {
-	    // Translate left-hand side expression and produce true/false list
-	    _left.translateDesynthesized(classGen, methodGen);
-
-	    // This GOTO is used to skip over the code for the last test
-	    // in the case where the the first test succeeds
-	    InstructionHandle ih = il.append(new GOTO(null));
-
-	    // Translate right-hand side expression and produce true/false list
-	    _right.translateDesynthesized(classGen, methodGen);
-
-	    _left._trueList.backPatch(ih);
-	    _left._falseList.backPatch(ih.getNext());
-			
-	    _falseList.append(_right._falseList);
-	    _trueList.add(ih).append(_right._trueList);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Makefile.inc b/src/org/apache/xalan/xsltc/compiler/Makefile.inc
deleted file mode 100644
index ec8539b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Makefile.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-####################################################################
-#                                                                  #
-# Makefile.inc for XSLT compiler                                   #
-#                                                                  #
-####################################################################
-
-####################################################################
-# Useful macros                                                    #
-####################################################################
-
-JAVAC = javac
-#JAVAC_FLAGS = -g -d $(XSLT)/src/classes
-JAVAC_FLAGS = -sourcepath $(XSLT)/src
-JAVACC = javacc
-JAVACC_FLAGS = -static=FALSE 
-JAVACUP = javacup
-JAVACUP_FLAGS =
-JAVALEX = jlex
-JAVALEX_FLAGS =
-
-####################################################################
-#  Explicit rules                                                  #
-####################################################################
-
-.SUFFIXES: .java .class .jj .lex .cup
-
-.java.class:
-	$(JAVAC) $(JAVAC_FLAGS) $<
-
-.jj.java:
-	$(JAVACC) $(JAVACC_FLAGS) $<
-
-.cup.java:
-	$(JAVACUP) $(JAVACUP_FLAGS) $<
-
-.lex.java:
-	$(JAVALEX) $(JAVALEX_FLAGS) $<
-
diff --git a/src/org/apache/xalan/xsltc/compiler/Message.java b/src/org/apache/xalan/xsltc/compiler/Message.java
deleted file mode 100644
index 74a4b20..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Message.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.JavaClass;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Message extends Instruction {
-    private boolean _terminate = false;
-	
-    public void parseContents(Parser parser) {
-	String termstr = getAttribute("terminate");
-	if (termstr != null) {
-            _terminate = termstr.equals("yes");
-	}
-	parseChildren(parser);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	
-	// Save the current handler base on the stack
-	il.append(methodGen.loadHandler());
-	// Get the translet's StringValueHandler
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       "stringValueHandler",
-					       STRING_VALUE_HANDLER_SIG)));
-	il.append(DUP);
-	il.append(methodGen.storeHandler());
-
-	// Translate contents with substituted handler
-	translateContents(classGen, methodGen);
-
-	// Get string from all children from the handler
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
-						     "getValue",
-						     "()" + STRING_SIG)));
-	// Push the this pointer on the stack
-	il.append(classGen.loadTranslet());
-	il.append(SWAP);
-
-	// Send the resulting string to the message handling method
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-						     "displayMessage",
-						     "("+STRING_SIG+")V")));
-
-	// If 'terminate' attribute is set to 'yes': Instanciate a
-	// RunTimeException, but it on the stack and throw an exception
-	if (_terminate == true) {
-	    // Create a new instance of RunTimeException
-	    final int einit = cpg.addMethodref("java.lang.RuntimeException",
-					       "<init>",
-					       "(Ljava/lang/String;)V");
-	    il.append(new NEW(cpg.addClass("java.lang.RuntimeException")));
-	    il.append(DUP);
-	    il.append(new PUSH(cpg,"Termination forced by an " +
-			           "xsl:message instruction"));
-	    il.append(new INVOKESPECIAL(einit));
-	    il.append(ATHROW);
-	}
-
-	// Clean up: Restore/pop old handler base from stack
-	il.append(methodGen.storeHandler());
-    }
-    
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Mode.java b/src/org/apache/xalan/xsltc/compiler/Mode.java
deleted file mode 100644
index cf4dc1f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Mode.java
+++ /dev/null
@@ -1,898 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.DOM;
-
-/**
- * Mode gathers all the templates belonging to a given mode; it is responsible
- * for generating an appropriate applyTemplates + (mode name) function
- */
-final class Mode implements Constants {
-
-    private final QName      _name;       // The QName of this mode
-    private final Stylesheet _stylesheet; // The owning stylesheet
-    private final String     _methodName; // The method name for this mode
-    private final Vector     _templates;  // All templates in this mode
-
-    // Pattern/test sequence for pattern with node()-type kernel
-    private Vector    _nodeGroup = null;
-    private TestSeq   _nodeTestSeq = null;
-
-    // Pattern/test sequence for pattern with id() or key()-type kernel
-    private Vector    _idxGroup = null;
-    private TestSeq   _idxTestSeq = null;
-
-    // Pattern/test sequence for patterns with any other kernel type
-    private Vector[]  _patternGroups;
-    private TestSeq[] _testSeq;
-
-    private final Hashtable _neededTemplates = new Hashtable();
-    private final Hashtable _namedTemplates = new Hashtable();
-    private final Hashtable _templateIHs = new Hashtable();
-    private final Hashtable _templateILs = new Hashtable();
-    private LocationPathPattern _rootPattern = null;
-
-    // Variable index for the current node - used in code generation
-    private int _currentIndex;
-
-
-    /**
-     * Creates a new Mode
-     * @param name A textual representation of the mode's QName
-     * @param stylesheet The Stylesheet in which the mode occured
-     * @param suffix A suffix to append to the method name for this mode
-     *               (normally a sequence number - still in a String).
-     */
-    public Mode(QName name, Stylesheet stylesheet, String suffix) {
-	// Save global info
-	_name = name;
-	_stylesheet = stylesheet;
-	_methodName = APPLY_TEMPLATES + suffix;
-	// Initialise some data structures
-	_templates = new Vector();
-	_patternGroups = new Vector[32];
-    }
-
-    /**
-     * Returns the name of the method (_not_ function) that will be compiled
-     * for this mode. Normally takes the form 'applyTemplates()' or
-     * 'applyTemplates2()'.
-     * @return Method name for this mode
-     */
-    public String functionName() {
-	return _methodName;
-    }
-
-    /**
-     * Shortcut to get the class compiled for this mode (will be inlined).
-     */
-    private String getClassName() {
-	return _stylesheet.getClassName();
-    }
-
-    /**
-     * Add a template to this mode
-     * @param template The template to add
-     */
-    public void addTemplate(Template template) {
-	_templates.addElement(template);
-    }
-
-    /**
-     * Process all the test patterns in this mode
-     */
-    public void processPatterns(Hashtable keys) {
-	// Traverse all templates
-	final Enumeration templates = _templates.elements();
-	while (templates.hasMoreElements()) {
-	    // Get the next template
-	    final Template template = (Template)templates.nextElement();
-
-	    // Add this template to a table of named templates if it has a name.
-	    // If there are multiple templates with the same name, all but one
-	    // (the one with highest priority) will be disabled.
-	    if (template.isNamed() && !template.disabled())
-		_namedTemplates.put(template, this);
-
-	    // Add this template to a test sequence if it has a pattern
-	    final Pattern pattern = template.getPattern();
-	    if (pattern != null) flattenAlternative(pattern, template, keys);
-	}
-	prepareTestSequences();
-    }
-
-    /**
-     * This method will break up alternative patterns (ie. unions of patterns,
-     * such as match="A/B | C/B") and add the basic patterns to their
-     * respective pattern groups.
-     */
-    private void flattenAlternative(Pattern pattern,
-				    Template template,
-				    Hashtable keys) {
-	// Patterns on type id() and key() are special since they do not have
-	// any kernel node type (it can be anything as long as the node is in
-	// the id's or key's index).
-	if (pattern instanceof IdKeyPattern) {
-	    final IdKeyPattern idkey = (IdKeyPattern)pattern;
-	    idkey.setTemplate(template);
-	    if (_idxGroup == null) _idxGroup = new Vector();
-	    _idxGroup.add(pattern);
-	}
-	// Alternative patterns are broken up and re-processed recursively
-	else if (pattern instanceof AlternativePattern) {
-	    final AlternativePattern alt = (AlternativePattern)pattern;
-	    flattenAlternative(alt.getLeft(), template, keys);
-	    flattenAlternative(alt.getRight(), template, keys);
-	}
-	// Finally we have a pattern that can be added to a test sequence!
-	else if (pattern instanceof LocationPathPattern) {
-	    final LocationPathPattern lpp = (LocationPathPattern)pattern;
-	    lpp.setTemplate(template);
-	    addPatternToGroup(lpp);
-	}
-    }
-
-    /**
-     * Adds a pattern to a pattern group
-     */
-    private void addPattern(int kernelType, LocationPathPattern pattern) {
-
-	// Make sure the array of pattern groups is long enough
-	final int oldLength = _patternGroups.length;
-	if (kernelType >= oldLength) {
-	    Vector[] newGroups = new Vector[kernelType * 2];
-	    System.arraycopy(_patternGroups, 0, newGroups, 0, oldLength);
-	    _patternGroups = newGroups;
-	}
-	
-	// Find the vector to put this pattern into
-	Vector patterns;
-
-	// Use the vector for id()/key()/node() patterns if no kernel type
-	if (kernelType == -1)
-	    patterns = _nodeGroup;
-	else
-	    patterns = _patternGroups[kernelType];
-
-	// Create a new vector if needed and insert the very first pattern
-	if (patterns == null) {
-	    patterns = new Vector(2);
-	    patterns.addElement(pattern);
-	    if (kernelType == -1)
-		_nodeGroup = patterns;
-	    else
-		_patternGroups[kernelType] = patterns;
-	}
-	// Otherwise make sure patterns are ordered by precedence/priorities
-	else {
-	    boolean inserted = false;
-	    for (int i = 0; i < patterns.size(); i++) {
-		final LocationPathPattern lppToCompare =
-		    (LocationPathPattern)patterns.elementAt(i);
-		if (pattern.noSmallerThan(lppToCompare)) {
-		    inserted = true;
-		    patterns.insertElementAt(pattern, i);
-		    break;
-		}
-	    }
-	    if (inserted == false) {
-		patterns.addElement(pattern);
-	    }
-	}
-    }
-    
-    /**
-     * Group patterns by NodeTests of their last Step
-     * Keep them sorted by priority within group
-     */
-    private void addPatternToGroup(final LocationPathPattern lpp) {
-	// id() and key()-type patterns do not have a kernel type
-	if (lpp instanceof IdKeyPattern) {
-	    addPattern(-1, lpp);
-	}
-	// Otherwise get the kernel pattern from the LPP
-	else {
-	    // kernel pattern is the last (maybe only) Step
-	    final StepPattern kernel = lpp.getKernelPattern();
-	    if (kernel != null) {
-		addPattern(kernel.getNodeType(), lpp);
-	    }
-	    else if (_rootPattern == null ||
-		     lpp.noSmallerThan(_rootPattern)) {
-		_rootPattern = lpp;
-	    }
-	}
-    }
-
-    /**
-     * Build test sequences
-     */
-    private void prepareTestSequences() {
-	final Vector names = _stylesheet.getXSLTC().getNamesIndex();
-	_testSeq = new TestSeq[DOM.NTYPES + names.size()];
-	
-	final int n = _patternGroups.length;
-	for (int i = 0; i < n; i++) {
-	    final Vector patterns = _patternGroups[i];
-	    if (patterns != null) {
-		final TestSeq testSeq = new TestSeq(patterns, this);
-		testSeq.reduce();
-		_testSeq[i] = testSeq;
-		testSeq.findTemplates(_neededTemplates);
-	    }
-	}
-
-	if ((_nodeGroup != null) && (_nodeGroup.size() > 0)) {
-	    _nodeTestSeq = new TestSeq(_nodeGroup, this);
-	    _nodeTestSeq.reduce();
-	    _nodeTestSeq.findTemplates(_neededTemplates);
-	}
-
-	if ((_idxGroup != null) && (_idxGroup.size() > 0)) {
-	    _idxTestSeq = new TestSeq(_idxGroup, this);
-	    _idxTestSeq.reduce();
-	    _idxTestSeq.findTemplates(_neededTemplates);
-	}
-	
-	if (_rootPattern != null) {
-	    // doesn't matter what is 'put', only key matters
-	    _neededTemplates.put(_rootPattern.getTemplate(), this);
-	}
-    }
-
-    private void compileNamedTemplate(Template template,
-				      ClassGenerator classGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	String methodName = template.getName().toString();
-	methodName = methodName.replace('.', '$');
-	methodName = methodName.replace('-', '$');
-
-	final NamedMethodGenerator methodGen =
-	    new NamedMethodGenerator(ACC_PUBLIC,
-				     de.fub.bytecode.generic.Type.VOID,
-				     new de.fub.bytecode.generic.Type[] {
-					 Util.getJCRefType(DOM_INTF_SIG),
-					 Util.getJCRefType(NODE_ITERATOR_SIG),
-					 Util.getJCRefType(TRANSLET_OUTPUT_SIG),
-					 de.fub.bytecode.generic.Type.INT
-				     },
-				     new String[] {
-					 DOCUMENT_PNAME,
-					 ITERATOR_PNAME,
-					 TRANSLET_OUTPUT_PNAME,
-					 NODE_PNAME
-				     },
-				     methodName,
-				     getClassName(),
-				     il, cpg);
-	
-	il.append(template.compile(classGen, methodGen));
-	il.append(RETURN);
-	
-	methodGen.stripAttributes(true);
-	methodGen.setMaxLocals();
-	methodGen.setMaxStack();
-	methodGen.removeNOPs();
-	classGen.addMethod(methodGen.getMethod());
-    }
-
-    private void compileTemplates(ClassGenerator classGen,
-				  MethodGenerator methodGen,
-				  InstructionHandle next) {
-        Enumeration templates = _namedTemplates.keys();
-        while (templates.hasMoreElements()) {
-            final Template template = (Template)templates.nextElement();
-            compileNamedTemplate(template, classGen);
-        }
-
-	templates = _neededTemplates.keys();
-	while (templates.hasMoreElements()) {
-	    final Template template = (Template)templates.nextElement();
-	    if (template.hasContents()) {
-		// !!! TODO templates both named and matched
-		InstructionList til = template.compile(classGen, methodGen);
-		til.append(new GOTO_W(next));
-		_templateILs.put(template, til);
-		_templateIHs.put(template, til.getStart());
-	    }
-	    else {
-		// empty template
-		_templateIHs.put(template, next);
-	    }
-	}
-    }
-	
-    private void appendTemplateCode(InstructionList body) {
-	final Enumeration templates = _neededTemplates.keys();
-	while (templates.hasMoreElements()) {
-	    final Object iList =
-		_templateILs.get(templates.nextElement());
-	    if (iList != null) {
-		body.append((InstructionList)iList);
-	    }
-	}
-    }
-
-    private void appendTestSequences(InstructionList body) {
-	final int n = _testSeq.length;
-	for (int i = 0; i < n; i++) {
-	    final TestSeq testSeq = _testSeq[i];
-	    if (testSeq != null) {
-		InstructionList il = testSeq.getInstructionList();
-		if (il != null)
-		    body.append(il);
-		// else trivial TestSeq
-	    }
-	}
-    }
-
-    public static void compileGetChildren(ClassGenerator classGen,
-					  MethodGenerator methodGen,
-					  int node) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final int git = cpg.addInterfaceMethodref(DOM_INTF,
-						  GET_CHILDREN,
-						  GET_CHILDREN_SIG);
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(node));
-	il.append(new INVOKEINTERFACE(git, 2));
-    }
-
-    /**
-     * Compiles the default handling for DOM elements: traverse all children
-     */
-    private InstructionList compileDefaultRecursion(ClassGenerator classGen,
-						    MethodGenerator methodGen,
-						    InstructionHandle next) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	final String applyTemplatesSig = classGen.getApplyTemplatesSig();
-	final int git = cpg.addInterfaceMethodref(DOM_INTF,
-						  GET_CHILDREN,
-						  GET_CHILDREN_SIG);
-	final int applyTemplates = cpg.addMethodref(getClassName(),
-						    functionName(),
-						    applyTemplatesSig);
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadDOM());
-	
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(_currentIndex));
-	il.append(new INVOKEINTERFACE(git, 2));
-	il.append(methodGen.loadHandler());
-	il.append(new INVOKEVIRTUAL(applyTemplates));
-	il.append(new GOTO_W(next));
-	return il;
-    }
-
-    /**
-     * Compiles the default action for DOM text nodes and attribute nodes:
-     * output the node's text value
-     */
-    private InstructionList compileDefaultText(ClassGenerator classGen,
-					       MethodGenerator methodGen,
-					       InstructionHandle next) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-
-	final int chars = cpg.addInterfaceMethodref(DOM_INTF,
-						    CHARACTERS,
-						    CHARACTERS_SIG);
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(_currentIndex));
-	il.append(methodGen.loadHandler());
-	il.append(new INVOKEINTERFACE(chars, 3));
-	il.append(new GOTO_W(next));
-	return il;
-    }
-
-    private InstructionList compileNamespaces(ClassGenerator classGen,
-					      MethodGenerator methodGen,
-					      boolean[] isNamespace,
-					      boolean[] isAttribute,
-					      boolean attrFlag,
-					      InstructionHandle defaultTarget) {
-	final XSLTC xsltc = classGen.getParser().getXSLTC();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-
-	// Append switch() statement - namespace test dispatch loop
-	final Vector namespaces = xsltc.getNamespaceIndex();
-	final Vector names = xsltc.getNamesIndex();
-	final int namespaceCount = namespaces.size() + 1;
-	final int namesCount = names.size();
-
-	final InstructionList il = new InstructionList();
-	final int[] types = new int[namespaceCount];
-	final InstructionHandle[] targets = new InstructionHandle[types.length];
-
-	if (namespaceCount > 0) {
-	    boolean compiled = false;
-
-	    // Initialize targets for namespace() switch statement
-	    for (int i = 0; i < namespaceCount; i++) {
-		targets[i] = defaultTarget;
-		types[i] = i;
-	    }
-
-	    // Add test sequences for known namespace types
-	    for (int i = DOM.NTYPES; i < (DOM.NTYPES+namesCount); i++) {
-		if ((isNamespace[i]) && (isAttribute[i] == attrFlag)) {
-		    String name = (String)names.elementAt(i-DOM.NTYPES);
-		    String namespace = name.substring(0,name.lastIndexOf(':'));
-		    final int type = xsltc.registerNamespace(namespace);
-		    
-		    if ((i < _testSeq.length) &&
-			(_testSeq[i] != null)) {
-			targets[type] =
-			    (_testSeq[i]).compile(classGen,
-						       methodGen,
-						       defaultTarget);
-			compiled = true;
-		    }
-		}
-	    }
-
-	    // Return "null" if no test sequences were compiled
-	    if (!compiled) return(null);
-		
-	    // Append first code in applyTemplates() - get type of current node
-	    final int getNS = cpg.addInterfaceMethodref(DOM_INTF,
-							"getNamespaceType",
-							"(I)I");
-	    il.append(methodGen.loadDOM());
-	    il.append(new ILOAD(_currentIndex));
-	    il.append(new INVOKEINTERFACE(getNS, 2));
-	    il.append(new SWITCH(types, targets, defaultTarget));
-	    return(il);
-	}
-	else {
-	    return(null);
-	}
-    }
-
-    /**
-     * Auxillary method to determine if a qname describes an attribute/element
-     */
-    private static boolean isAttributeName(String qname) {
-	final int col = qname.indexOf(':') + 1;
-	if (qname.charAt(col) == '@')
-	    return(true);
-	else
-	    return(false);
-    }
-
-    private static boolean isNamespaceName(String qname) {
-	final int col = qname.lastIndexOf(':');
-	if ((col > -1) && (qname.charAt(qname.length()-1) == '*'))
-	    return(true);
-	else
-	    return(false);
-    }
-
-    /**
-     * Compiles the applyTemplates() method and adds it to the translet.
-     * This is the main dispatch method.
-     */
-    public void compileApplyTemplates(ClassGenerator classGen) {
-	final XSLTC xsltc = classGen.getParser().getXSLTC();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final Vector names      = xsltc.getNamesIndex();
-
-	// (*) Create the applyTemplates() method
-	final de.fub.bytecode.generic.Type[] argTypes =
-	    new de.fub.bytecode.generic.Type[3];
-	argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
-	argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
-	argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
-
-	final String[] argNames = new String[3];
-	argNames[0] = DOCUMENT_PNAME;
-	argNames[1] = ITERATOR_PNAME;
-	argNames[2] = TRANSLET_OUTPUT_PNAME;
-
-	final InstructionList mainIL = new InstructionList();
-	final MethodGenerator methodGen =
-	    new MethodGenerator(ACC_PUBLIC | ACC_FINAL, 
-				de.fub.bytecode.generic.Type.VOID,
-				argTypes, argNames, functionName(),
-				getClassName(), mainIL,
-				classGen.getConstantPool());
-	methodGen.addException("org.apache.xalan.xsltc.TransletException");
-
-	// (*) Create the local variablea
-	final LocalVariableGen current;
-	current = methodGen.addLocalVariable2("current",
-					      de.fub.bytecode.generic.Type.INT,
-					      mainIL.getEnd());
-	_currentIndex = current.getIndex();
-
-	// (*) Create the "body" instruction list that will eventually hold the
-	//     code for the entire method (other ILs will be appended).
-	final InstructionList body = new InstructionList();
-	body.append(NOP);
-
-	// (*) Create an instruction list that contains the default next-node
-	//     iteration
-	final InstructionList ilLoop = new InstructionList();
-	ilLoop.append(methodGen.loadIterator());
-	ilLoop.append(methodGen.nextNode());
-	ilLoop.append(DUP);
-	ilLoop.append(new ISTORE(_currentIndex));
-
-	// The body of this code can get very large - large than can be handled
-	// by a single IFNE(body.getStart()) instruction - need workaround:
-        final BranchHandle ifeq = ilLoop.append(new IFEQ(null));
-	final BranchHandle loop = ilLoop.append(new GOTO_W(null));
-	ifeq.setTarget(ilLoop.append(RETURN)); // applyTemplates() ends here!
-	final InstructionHandle ihLoop = ilLoop.getStart();
-
-	// (*) Compile default handling of elements (traverse children)
-	InstructionList ilRecurse =
-	    compileDefaultRecursion(classGen, methodGen, ihLoop);
-	InstructionHandle ihRecurse = ilRecurse.getStart();
-
-	// (*) Compile default handling of text/attribute nodes (output text)
-	InstructionList ilText =
-	    compileDefaultText(classGen, methodGen, ihLoop);
-	InstructionHandle ihText = ilText.getStart();
-
-	// Distinguish attribute/element/namespace tests for further processing
-	final int[] types = new int[DOM.NTYPES + names.size()];
-	for (int i = 0; i < types.length; i++) types[i] = i;
-
-	final boolean[] isAttribute = new boolean[types.length];
-	final boolean[] isNamespace = new boolean[types.length];
-	for (int i = 0; i < names.size(); i++) {
-	    final String name = (String)names.elementAt(i);
-	    isAttribute[i+DOM.NTYPES] = isAttributeName(name);
-	    isNamespace[i+DOM.NTYPES] = isNamespaceName(name);
-	}
-
-	// (*) Compile all templates - regardless of pattern type
-	compileTemplates(classGen, methodGen, ihLoop);
-
-	// (*) Handle template with explicit "*" pattern
-	final TestSeq elemTest = _testSeq[DOM.ELEMENT];
-	InstructionHandle ihElem = ihRecurse;
-	if (elemTest != null)
-	    ihElem = elemTest.compile(classGen, methodGen, ihRecurse);
-
-	// (*) Handle template with explicit "@*" pattern
-	final TestSeq attrTest = _testSeq[DOM.ATTRIBUTE];
-	InstructionHandle ihAttr = ihText;
-	if (attrTest != null)
-	    ihAttr = attrTest.compile(classGen, methodGen, ihText);
-
-	// Do tests for id() and key() patterns first
-	InstructionList ilKey = null;
-	if (_idxTestSeq != null) {
-	    loop.setTarget(_idxTestSeq.compile(classGen, methodGen, body.getStart()));
-	    ilKey = _idxTestSeq.getInstructionList();
-	}
-	else {
-	    loop.setTarget(body.getStart());
-	}
-
-	// (*) If there is a match on node() we need to replace ihElem
-	//     and ihText (default behaviour for elements & text).
-	if (_nodeTestSeq != null) {
-	    double nodePrio = -0.5; //_nodeTestSeq.getPriority();
-	    int    nodePos  = _nodeTestSeq.getPosition();
-	    double elemPrio = (0 - Double.MAX_VALUE);
-	    int    elemPos  = Integer.MIN_VALUE;
-	    if (elemTest != null) {
-		elemPrio = elemTest.getPriority();
-		elemPos  = elemTest.getPosition();
-	    }
-	    if ((elemPrio == Double.NaN) || (elemPrio < nodePrio) ||
-		((elemPrio == nodePrio) && (elemPos < nodePos))) {
-		ihElem = _nodeTestSeq.compile(classGen, methodGen, ihLoop);
-		ihText = ihElem;
-	    }
-	}
-
-	// (*) Handle templates with "ns:*" pattern
-	InstructionHandle elemNamespaceHandle = ihElem;
-	InstructionList nsElem = compileNamespaces(classGen, methodGen,
-						   isNamespace, isAttribute,
-						   false, ihElem);
-	if (nsElem != null) elemNamespaceHandle = nsElem.getStart();
-
-	// (*) Handle templates with "ns:@*" pattern
-	InstructionList nsAttr = compileNamespaces(classGen, methodGen,
-						   isNamespace, isAttribute,
-						   true, ihAttr);
-	InstructionHandle attrNamespaceHandle = ihAttr;
-	if (nsAttr != null) attrNamespaceHandle = nsAttr.getStart();
-
-	// (*) Handle templates with "ns:elem" or "ns:@attr" pattern
-	final InstructionHandle[] targets = new InstructionHandle[types.length];
-	for (int i = DOM.NTYPES; i < targets.length; i++) {
-	    final TestSeq testSeq = _testSeq[i];
-	    // Jump straight to namespace tests ?
-	    if (isNamespace[i]) {
-		if (isAttribute[i])
-		    targets[i] = attrNamespaceHandle;
-		else
-		    targets[i] = elemNamespaceHandle;
-	    }
-	    // Test first, then jump to namespace tests
-	    else if (testSeq != null) {
-		if (isAttribute[i])
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 attrNamespaceHandle);
-		else
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 elemNamespaceHandle);
-	    }
-	    else {
-		targets[i] = ihLoop;
-	    }
-	}
-
-	// Handle pattern with match on root node - default: traverse children
-	targets[DOM.ROOT] = _rootPattern != null
-	    ? getTemplateInstructionHandle(_rootPattern.getTemplate())
-	    : ihRecurse;
-	
-	// Handle any pattern with match on text nodes - default: output text
-	targets[DOM.TEXT] = _testSeq[DOM.TEXT] != null
-	    ? _testSeq[DOM.TEXT].compile(classGen, methodGen, ihText)
-	    : ihText;
-
-	// This DOM-type is not in use - default: process next node
-	targets[DOM.UNUSED] = ihLoop;
-
-	// Match unknown element in DOM - default: check for namespace match
-	targets[DOM.ELEMENT] = elemNamespaceHandle;
-
-	// Match unknown attribute in DOM - default: check for namespace match
-	targets[DOM.ATTRIBUTE] = attrNamespaceHandle;
-
-	// Match on processing instruction - default: process next node
-	targets[DOM.PROCESSING_INSTRUCTION] =
-	    _testSeq[DOM.PROCESSING_INSTRUCTION] != null
-	    ? _testSeq[DOM.PROCESSING_INSTRUCTION]
-	    .compile(classGen, methodGen, ihLoop)
-	    : ihLoop;
-	
-	// Match on comments - default: process next node
-	targets[DOM.COMMENT] = _testSeq[DOM.COMMENT] != null
-	    ? _testSeq[DOM.COMMENT].compile(classGen, methodGen, ihLoop)
-	    : ihLoop;
-
-	// Now compile test sequences for various match patterns:
-	for (int i = DOM.NTYPES; i < targets.length; i++) {
-	    final TestSeq testSeq = _testSeq[i];
-	    // Jump straight to namespace tests ?
-	    if ((testSeq == null) || (isNamespace[i])) {
-		if (isAttribute[i])
-		    targets[i] = attrNamespaceHandle;
-		else
-		    targets[i] = elemNamespaceHandle;
-	    }
-	    // Match on node type
-	    else {
-		if (isAttribute[i])
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 attrNamespaceHandle);
-		else
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 elemNamespaceHandle);
-	    }
-	}
-
-	if (ilKey != null) body.insert(ilKey);
-
-	// Append first code in applyTemplates() - get type of current node
-	final int getType = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getType", "(I)I");
-	body.append(methodGen.loadDOM());
-	body.append(new ILOAD(_currentIndex));
-	body.append(new INVOKEINTERFACE(getType, 2));
-
-	// Append switch() statement - main dispatch loop in applyTemplates()
-	InstructionHandle disp = body.append(new SWITCH(types, targets, ihLoop));
-
-	// Append all the "case:" statements
-	appendTestSequences(body);
-	// Append the actual template code
-	appendTemplateCode(body);
-
-	// Append NS:* node tests (if any)
-	if (nsElem != null) body.append(nsElem);
-	// Append NS:@* node tests (if any)
-	if (nsAttr != null) body.append(nsAttr);
-
-	// Append default action for element and root nodes
-	body.append(ilRecurse);
-	// Append default action for text and attribute nodes
-	body.append(ilText);
-
-	// putting together constituent instruction lists
-	mainIL.append(new GOTO_W(ihLoop));
-	mainIL.append(body);
-	// fall through to ilLoop
-	mainIL.append(ilLoop);
-
-	peepHoleOptimization(methodGen);
-	methodGen.stripAttributes(true);
-	
-	methodGen.setMaxLocals();
-	methodGen.setMaxStack();
-	methodGen.removeNOPs();
-	classGen.addMethod(methodGen.getMethod());
-    }
-
-    /**
-     * Peephole optimization: Remove sequences of [ALOAD, POP].
-     */
-    private void peepHoleOptimization(MethodGenerator methodGen) {
-	InstructionList il = methodGen.getInstructionList();
-	FindPattern find = new FindPattern(il);
-	InstructionHandle ih;
-	String pattern;
-
-	// Remove sequences of ALOAD, POP
-	pattern = "`ALOAD'`POP'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		if ((!match[0].hasTargeters()) && (!match[1].hasTargeters())) {
-		    il.delete(match[0], match[1]);
-		}
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[2]);
-	}
-
-	// Replace sequences of ILOAD_?, ALOAD_?, SWAP with ALOAD_?, ILOAD_?
-	pattern = "`ILOAD__'`ALOAD__'`SWAP'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		de.fub.bytecode.generic.Instruction iload;
-		de.fub.bytecode.generic.Instruction aload;
-		if ((!match[0].hasTargeters()) &&
-		    (!match[1].hasTargeters()) &&
-		    (!match[2].hasTargeters())) {
-		    iload = match[0].getInstruction();
-		    aload = match[1].getInstruction();
-		    il.insert(match[0], aload);
-		    il.insert(match[0], iload);
-		    il.delete(match[0], match[2]);
-		}
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[3]);
-	}
-
-	// Replaces sequences of ALOAD_1, ALOAD_1 with ALOAD_1, DUP
-	pattern = "`ALOAD_1'`ALOAD_1'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		de.fub.bytecode.generic.Instruction iload;
-		de.fub.bytecode.generic.Instruction aload;
-		if ((!match[0].hasTargeters()) && (!match[1].hasTargeters())) {
-		    il.insert(match[1], new DUP());
-		    il.delete(match[1]);
-		}
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[2]);
-	}
-
-	// Removes uncessecary GOTOs
-	/*
-	pattern = "`GOTO'`GOTO'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		de.fub.bytecode.generic.Instruction iload;
-		de.fub.bytecode.generic.Instruction aload;
-		InstructionTargeter tgtrs[] = match[1].getTargeters();
-		if (tgtrs != null) {
-		    InstructionHandle newTarget =
-			((BranchHandle)match[1]).getTarget();
-		    for (int i=0; i<tgtrs.length; i++)
-			tgtrs[i].updateTarget(match[1],newTarget);
-		}
-		il.delete(match[1]);
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[2]);
-	}
-	*/
-	
-	
-    }
-
-    public InstructionHandle getTemplateInstructionHandle(Template template) {
-	return (InstructionHandle)_templateIHs.get(template);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Mode.java.old b/src/org/apache/xalan/xsltc/compiler/Mode.java.old
deleted file mode 100644
index 1682ac1..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Mode.java.old
+++ /dev/null
@@ -1,792 +0,0 @@
-/*
- * @(#)$Id$
- *
- * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * This software is the proprietary information of Sun Microsystems, Inc.  
- * Use is subject to license terms.
- * 
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package com.sun.xslt.compiler;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import com.sun.xslt.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import com.sun.xslt.compiler.util.*;
-import com.sun.xslt.DOM;
-
-/**
- * Mode gathers all the templates belonging to a given mode; it is responsible
- * for generating an appropriate applyTemplates + (mode name) function
- */
-final class Mode implements Constants {
-    private final QName _name;
-    
-    // the owning stylesheet
-    private final Stylesheet _stylesheet;
-
-    private final String _functionName;
-    
-    // all the templates in this mode
-    private final Vector _templates = new Vector();
-    
-    // Patterns/test sequences for the stylesheet's templates
-    private Vector[]  _patternGroups = new Vector[32];
-    private TestSeq[] _code2TestSeq;
-    // Pattern/test sequence for pattern with 'node()' kernel
-    private Vector    _nodeGroup = null;
-    private TestSeq   _nodeTestSeq = null;
-
-    private int _currentIndex;
-
-    private final Hashtable _neededTemplates = new Hashtable();
-    private final Hashtable _namedTemplates = new Hashtable();
-    private final Hashtable _templateInstructionHandles = new Hashtable();
-    private final Hashtable _templateInstructionLists = new Hashtable();
-    private LocationPathPattern _explicitRootPattern = null;
-	
-    public Mode(QName name, Stylesheet stylesheet, String suffix) {
-	_name = name;
-	_stylesheet = stylesheet;
-	_functionName = APPLY_TEMPLATES + suffix;
-    }
-
-    public String functionName() {
-	return _functionName;
-    }
-
-    private String getClassName() {
-	return _stylesheet.getClassName();
-    }
-
-    public void addTemplate(Template template) {
-	_templates.addElement(template);
-	Util.println("added template, pattern: "+ template.getPattern());
-    }
-
-    public void processPatterns(Hashtable keys) {
-System.out.println("GTM> IN MODE: processPatterns(Hashtable keys)");
-	// Traverse all templates
-	final Enumeration templates = _templates.elements();
-	while (templates.hasMoreElements()) {
-	    final Template template = (Template)templates.nextElement();
-	    // Is this a named template?
-	    if (template.isNamed()) {
-		// Only process template with highest priority when there
-		// are multiple templates with the sanme name
-		if (!template.disabled()) {
-		    if (template.getPattern() == null) {
-		        _namedTemplates.put(template, this);
-		    } else {
-			// template that is both named and matched...
-		        //_neededTemplates.put(template, this);
-			processTemplatePattern(template,null);
-		    }
-		}
-	    } 
-	    else { 
-		processTemplatePattern(template,keys);
-	    }
-/*****************
-	    //GTM- bug fix 4433133, 
-	    //     include named templates here also 
-	    processTemplatePattern(template,keys); 
-********************/
-	}
-	prepareTestSequences();
-    }
-		
-    private void processTemplatePattern(Template template, Hashtable keys) {
-System.out.println("GTM> IN MODE: processTemplatePatterns(Template,Hashtable)");
-	final Pattern matchPattern = template.getPattern();
-	if (matchPattern != null)
-	    flattenAlternative(matchPattern, template, keys);
-    }
-		
-    private void flattenAlternative(Pattern pattern,
-				    Template template,
-				    Hashtable keys) {
-System.out.println("GTM> IN MODE: flattenAlternative(...)");
-	if (pattern instanceof IdKeyPattern) {
-System.out.println("GTM> pattern instanceof IdKeyPattern");
-	    /* TODO: Cannot handle this kind of pattern yet!!!
-
-	    IdKeyPattern idkey = (IdKeyPattern)pattern;
-	    StepPattern kernel = idkey.getKernelPattern();
-	    if (kernel == null) {
-		Key key = (Key)keys.get(idkey.getIndexName());
-		idkey.setKernelPattern(key.getKernelPattern());
-	    }
-	    */
-	}
-	else if (pattern instanceof AlternativePattern) {
-System.out.println("GTM> pattern instanceof AlternativePattern");
-	    final AlternativePattern alt = (AlternativePattern)pattern;
-	    flattenAlternative(alt.getLeft(), template, keys);
-	    flattenAlternative(alt.getRight(), template, keys);
-	}
-	else if (pattern instanceof LocationPathPattern) {
-System.out.println("GTM> pattern instanceof LocationPathPattern");
-	    final LocationPathPattern lpp = (LocationPathPattern)pattern;
-	    lpp.setTemplate(template);
-	    addPatternToGroup(lpp);
-	}
-	else
-	    Util.println("Bad pattern: " + pattern);
-    }
-    
-    private void addPattern(int code, LocationPathPattern pattern) {
-	if (code >= _patternGroups.length) {
-	    Vector[] newGroups = new Vector[code*2];
-	    System.arraycopy(_patternGroups, 0, newGroups, 0,
-			     _patternGroups.length);
-	    _patternGroups = newGroups;
-	}
-	
-	Vector patterns = code == -1
-	    ? _nodeGroup	// node()
-	    : _patternGroups[code];
-	
-	if (patterns == null) {
-	    patterns = new Vector(2);
-	    patterns.addElement(pattern);
-	}
-	else {	// keep patterns ordered by diminishing precedence/priorities
-	    boolean inserted = false;
-	    for (int i = 0; i < patterns.size(); i++) {
-		final LocationPathPattern lppToCompare =
-		    (LocationPathPattern)patterns.elementAt(i);
-		if (pattern.noSmallerThan(lppToCompare)) {
-		    inserted = true;
-		    patterns.insertElementAt(pattern, i);
-		    break;
-		}
-	    }
-	    if (inserted == false) {
-		patterns.addElement(pattern);
-	    }
-	}
-	if (code == -1) {
-	    _nodeGroup = patterns;
-	}
-	else {
-	    _patternGroups[code] = patterns;
-	}
-    }
-    
-    /**
-     * Group patterns by NodeTests of their last Step
-     * Keep them sorted by priority within group
-     */
-    private void addPatternToGroup(final LocationPathPattern lpp) {
-	// kernel pattern is the last (maybe only) Step
-	final StepPattern kernel = lpp.getKernelPattern();
-	if (kernel != null) {
-	    addPattern(kernel.getNodeType(), lpp);
-	}
-	else if (_explicitRootPattern == null ||
-		 lpp.noSmallerThan(_explicitRootPattern)) {
-	    _explicitRootPattern = lpp;
-	}
-    }
-
-    /**
-     * Build test sequences
-     */
-    private void prepareTestSequences() {
-	final Vector names = _stylesheet.getXSLTC().getNamesIndex();
-	_code2TestSeq = new TestSeq[DOM.NTYPES + names.size()];
-	
-	final int n = _patternGroups.length;
-	for (int i = 0; i < n; i++) {
-	    final Vector patterns = _patternGroups[i];
-	    if (patterns != null) {
-		final TestSeq testSeq = new TestSeq(patterns, this);
-		testSeq.reduce();
-		_code2TestSeq[i] = testSeq;
-		testSeq.findTemplates(_neededTemplates);
-	    }
-	}
-
-	if ((_nodeGroup != null) && (_nodeGroup.size() > 0)) {
-	    _nodeTestSeq = new TestSeq(_nodeGroup, this);
-	    _nodeTestSeq.reduce();
-	    _nodeTestSeq.findTemplates(_neededTemplates);
-	}
-	
-	if (_explicitRootPattern != null) {
-	    // doesn't matter what is 'put', only key matters
-	    _neededTemplates.put(_explicitRootPattern.getTemplate(), this);
-	}
-    }
-
-    private void compileNamedTemplate(Template template,
-				      ClassGenerator classGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	final String DOM_CLASS_SIG = classGen.getDOMClassSig();
-	final NamedMethodGenerator methodGen =
-	    new NamedMethodGenerator(ACC_PUBLIC,
-				     de.fub.bytecode.generic.Type.VOID,
-				     new de.fub.bytecode.generic.Type[] {
-					 Util.getJCRefType(DOM_CLASS_SIG),
-					 Util.getJCRefType(NODE_ITERATOR_SIG),
-					 Util.getJCRefType(TRANSLET_OUTPUT_SIG),
-					 de.fub.bytecode.generic.Type.INT
-				     },
-				     new String[] {
-					 DOCUMENT_PNAME,
-					 ITERATOR_PNAME,
-					 TRANSLET_OUTPUT_PNAME,
-					 NODE_PNAME
-				     },
-				     //!!! more name sophistication needed
-				     template.getName().toString(),
-				     getClassName(),
-				     il, cpg);
-	
-	il.append(template.compile(classGen, methodGen));
-	il.append(RETURN);
-	
-	methodGen.stripAttributes(true);
-	methodGen.setMaxLocals();
-	methodGen.setMaxStack();
-	methodGen.removeNOPs();
-	classGen.addMethod(methodGen.getMethod());
-    }
-
-    private void compileTemplates(ClassGenerator classGen,
-				  MethodGenerator methodGen,
-				  InstructionHandle next) {
-	Enumeration templates = _neededTemplates.keys();
-	while (templates.hasMoreElements()) {
-	    final Template template = (Template)templates.nextElement();
-	    if (template.hasContents()) {
-		// !!! TODO templates both named and matched
-		InstructionList til = template.compile(classGen, methodGen);
-		til.append(new GOTO(next));
-		_templateInstructionLists.put(template, til);
-		_templateInstructionHandles.put(template, til.getStart());
-	    }
-	    else {
-		// empty template
-		_templateInstructionHandles.put(template, next);
-	    }
-	}
-	templates = _namedTemplates.keys();
-	while (templates.hasMoreElements()) {
-	    final Template template = (Template)templates.nextElement();
-	    compileNamedTemplate(template, classGen);
-	}
-    }
-	
-    private void appendTemplateCode(InstructionList body) {
-	final Enumeration templates = _neededTemplates.keys();
-	while (templates.hasMoreElements()) {
-	    final Object iList =
-		_templateInstructionLists.get(templates.nextElement());
-	    if (iList != null) {
-		body.append((InstructionList)iList);
-	    }
-	}
-    }
-
-    private void appendTestSequences(InstructionList body) {
-	final int n = _code2TestSeq.length;
-	for (int i = 0; i < n; i++) {
-	    final TestSeq testSeq = _code2TestSeq[i];
-	    if (testSeq != null) {
-		InstructionList il = testSeq.getInstructionList();
-		if (il != null)
-		    body.append(il);
-		// else trivial TestSeq
-	    }
-	}
-    }
-
-    public static void compileGetChildren(ClassGenerator classGen,
-					  MethodGenerator methodGen,
-					  int node) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final String DOM_CLASS = classGen.getDOMClass();
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(node));
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOM_CLASS,
-						     GET_CHILDREN,
-						     GET_CHILDREN_SIG)));
-    }
-
-    /**
-     * Compiles the default handling for DOM elements: traverse all children
-     */
-    private InstructionList compileDefaultRecursion(ClassGenerator classGen,
-						    MethodGenerator methodGen,
-						    int node,
-						    InstructionHandle next) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	final String DOM_CLASS = classGen.getDOMClass();
-	final String applyTemplatesSig = classGen.getApplyTemplatesSig();
-	final int getChildren = cpg.addMethodref(DOM_CLASS,
-						 GET_CHILDREN,
-						 GET_CHILDREN_SIG);
-	final int applyTemplates = cpg.addMethodref(getClassName(),
-						    functionName(),
-						    applyTemplatesSig);
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadDOM());
-	
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(node));
-	il.append(new INVOKEVIRTUAL(getChildren));
-	il.append(methodGen.loadHandler());
-	il.append(new INVOKEVIRTUAL(applyTemplates));
-	il.append(new GOTO(next));
-	return il;
-    }
-
-    /**
-     * Compiles the default action for DOM text nodes and attribute nodes:
-     * output the node's text value
-     */
-    private InstructionList compileDefaultText(ClassGenerator classGen,
-					       MethodGenerator methodGen,
-					       int node,
-					       InstructionHandle next) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	final String DOM_CLASS = classGen.getDOMClass();
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(node));
-	il.append(methodGen.loadHandler());
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOM_CLASS,
-						     CHARACTERS,
-						     CHARACTERS_SIG)));
-	il.append(new GOTO(next));
-	return il;
-    }
-
-    private InstructionList compileNamespaces(ClassGenerator classGen,
-					      MethodGenerator methodGen,
-					      boolean[] isNamespace,
-					      boolean[] isAttribute,
-					      boolean attrFlag,
-					      InstructionHandle defaultTarget) {
-	final XSLTC xsltc = classGen.getParser().getXSLTC();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final String DOM_CLASS = classGen.getDOMClass();
-
-	// Append switch() statement - namespace test dispatch loop
-	final Vector namespaces = xsltc.getNamespaceIndex();
-	final Vector names = xsltc.getNamesIndex();
-	final int namespaceCount = namespaces.size() + 1;
-	final int namesCount = names.size();
-
-	final InstructionList il = new InstructionList();
-	final int[] types = new int[namespaceCount];
-	final InstructionHandle[] targets = new InstructionHandle[types.length];
-
-	if (namespaceCount > 0) {
-	    boolean compiled = false;
-
-	    // Initialize targets for namespace() switch statement
-	    for (int i = 0; i < namespaceCount; i++) {
-		targets[i] = defaultTarget;
-		types[i] = i;
-	    }
-
-	    // Add test sequences for known namespace types
-	    for (int i = DOM.NTYPES; i < (DOM.NTYPES+namesCount); i++) {
-		if ((isNamespace[i]) && (isAttribute[i] == attrFlag)) {
-		    String name = (String)names.elementAt(i-DOM.NTYPES);
-		    String namespace = name.substring(0,name.lastIndexOf(':'));
-		    final int type = xsltc.registerNamespace(namespace);
-		    
-		    if ((i < _code2TestSeq.length) &&
-			(_code2TestSeq[i] != null)) {
-			targets[type] =
-			    (_code2TestSeq[i]).compile(classGen,
-						       methodGen,
-						       defaultTarget);
-			compiled = true;
-		    }
-		}
-	    }
-
-	    // Return "null" if no test sequences were compiled
-	    if (!compiled) return(null);
-		
-	    // Append first code in applyTemplates() - get type of current node
-	    il.append(methodGen.loadDOM());
-	    il.append(new ILOAD(_currentIndex));
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOM_CLASS,
-							     "getNamespaceType",
-							     "(I)I")));
-	    il.append(new SWITCH(types, targets, defaultTarget));
-	    return(il);
-	}
-	else {
-	    return(null);
-	}
-    }
-
-    /**
-     * Auxillary method to determine if a qname describes an attribute/element
-     */
-    private static boolean isAttributeName(String qname) {
-	final int col = qname.indexOf(':') + 1;
-	if (qname.charAt(col) == '@')
-	    return(true);
-	else
-	    return(false);
-    }
-
-    private static boolean isNamespaceName(String qname) {
-	final int col = qname.lastIndexOf(':');
-	if ((col > -1) && (qname.charAt(qname.length()-1) == '*'))
-	    return(true);
-	else
-	    return(false);
-    }
-
-    /**
-     * Compiles the applyTemplates() method and adds it to the translet.
-     * This is the main dispatch method.
-     */
-    public void compileApplyTemplates(ClassGenerator classGen) {
-	final XSLTC xsltc = classGen.getParser().getXSLTC();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final Vector names      = xsltc.getNamesIndex();
-	final String DOM_CLASS = classGen.getDOMClass();
-
-	// (*) Create the applyTemplates() method
-	final de.fub.bytecode.generic.Type[] argTypes =
-	    new de.fub.bytecode.generic.Type[3];
-	argTypes[0] = Util.getJCRefType(classGen.getDOMClassSig());
-	argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
-	argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
-
-	final String[] argNames = new String[3];
-	argNames[0] = DOCUMENT_PNAME;
-	argNames[1] = ITERATOR_PNAME;
-	argNames[2] = TRANSLET_OUTPUT_PNAME;
-
-	final InstructionList mainIL = new InstructionList();
-	final MethodGenerator methodGen =
-	    new MethodGenerator(ACC_PUBLIC | ACC_FINAL, 
-				de.fub.bytecode.generic.Type.VOID,
-				argTypes, argNames, functionName(),
-				getClassName(), mainIL,
-				classGen.getConstantPool());
-	methodGen.addException("com.sun.xslt.TransletException");
-
-	// (*) Create the local variablea
-	final LocalVariableGen current;
-	current = methodGen.addLocalVariable2("current",
-					      de.fub.bytecode.generic.Type.INT,
-					      mainIL.getEnd());
-	_currentIndex = current.getIndex();
-
-	// (*) Create the "body" instruction list that will eventually hold the
-	//     code for the entire method (other ILs will be appended).
-	final InstructionList body = new InstructionList();
-	body.append(NOP);
-
-	// (*) Create an instruction list that contains the default next-node
-	//     iteration
-	final InstructionList ilLoop = new InstructionList();
-	ilLoop.append(methodGen.loadIterator());
-	ilLoop.append(methodGen.nextNode());
-	ilLoop.append(DUP);
-	ilLoop.append(new ISTORE(_currentIndex));
-	ilLoop.append(new IFNE(body.getStart()));
-	final InstructionHandle ihLoop = ilLoop.getStart();
-
-	// (*) Compile default handling of elements (traverse children)
-	InstructionList ilRecurse =
-	  compileDefaultRecursion(classGen, methodGen, _currentIndex, ihLoop);
-	InstructionHandle ihRecurse = ilRecurse.getStart();
-
-	// (*) Compile default handling of text/attribute nodes (output text)
-	InstructionList ilText = compileDefaultText(classGen, methodGen,
-						    _currentIndex, ihLoop);
-	InstructionHandle ihText = ilText.getStart();
-
-	// Distinguish attribute/element/namespace tests for further processing
-	final int[] types = new int[DOM.NTYPES + names.size()];
-	for (int i = 0; i < types.length; i++) types[i] = i;
-
-	final boolean[] isAttribute = new boolean[types.length];
-	final boolean[] isNamespace = new boolean[types.length];
-	for (int i = 0; i < names.size(); i++) {
-	    final String name = (String)names.elementAt(i);
-	    isAttribute[i+DOM.NTYPES] = isAttributeName(name);
-	    isNamespace[i+DOM.NTYPES] = isNamespaceName(name);
-	}
-
-	// (*) Compile all templates - regardless of pattern type
-	compileTemplates(classGen, methodGen, ihLoop);
-
-	// (*) Handle template with explicit "*" pattern
-	final TestSeq elemTest = _code2TestSeq[DOM.ELEMENT];
-	InstructionHandle ihElem = ihRecurse;
-	if (elemTest != null)
-	    ihElem = elemTest.compile(classGen, methodGen, ihRecurse);
-
-	// (*) Handle template with explicit "@*" pattern
-	final TestSeq attrTest = _code2TestSeq[DOM.ATTRIBUTE];
-	InstructionHandle ihAttr = ihText;
-	if (attrTest != null)
-	    ihAttr = attrTest.compile(classGen, methodGen, ihText);
-
-	// (*) If there is a match on node() we need to replace ihElem
-	//     and ihText (default behaviour for elements & text).
-	if (_nodeTestSeq != null) {
-	    double nodePrio = -0.5;// _nodeTestSeq.getPriority();
-	    int    nodePos  = _nodeTestSeq.getPosition();
-	    if ((elemTest == null) ||
-		(elemTest.getPriority() == Double.NaN) ||
-		(elemTest.getPriority() < nodePrio) ||
-		((elemTest.getPriority() == nodePrio) &&
-		 (elemTest.getPosition() < nodePos))) {
-		ihElem = _nodeTestSeq.compile(classGen, methodGen, ihLoop);
-		ihText = ihElem;
-	    }
-	}
-
-	// (*) Handle templates with "ns:*" pattern
-	InstructionHandle elemNamespaceHandle = ihElem;
-	InstructionList nsElem = compileNamespaces(classGen, methodGen,
-						   isNamespace, isAttribute,
-						   false, ihElem);
-	if (nsElem != null) elemNamespaceHandle = nsElem.getStart();
-
-	// (*) Handle templates with "ns:@*" pattern
-	InstructionList nsAttr = compileNamespaces(classGen, methodGen,
-						   isNamespace, isAttribute,
-						   true, ihAttr);
-	InstructionHandle attrNamespaceHandle = ihAttr;
-	if (nsAttr != null) attrNamespaceHandle = nsAttr.getStart();
-
-	// (*) Handle templates with "ns:elem" or "ns:@attr" pattern
-	final InstructionHandle[] targets = new InstructionHandle[types.length];
-	for (int i = DOM.NTYPES; i < targets.length; i++) {
-	    final TestSeq testSeq = _code2TestSeq[i];
-	    // Jump straight to namespace tests ?
-	    if (isNamespace[i]) {
-		if (isAttribute[i])
-		    targets[i] = attrNamespaceHandle;
-		else
-		    targets[i] = elemNamespaceHandle;
-	    }
-	    // Test first, then jump to namespace tests
-	    else if (testSeq != null) {
-		if (isAttribute[i])
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 attrNamespaceHandle);
-		else
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 elemNamespaceHandle);
-	    }
-	    else {
-		targets[i] = ihLoop;
-	    }
-	}
-
-	// Handle pattern with match on root node - default: traverse children
-	targets[DOM.ROOT] = _explicitRootPattern != null
-	    ? getTemplateInstructionHandle(_explicitRootPattern.getTemplate())
-	    : ihRecurse;
-	
-	// Handle any pattern with match on text nodes - default: output text
-	targets[DOM.TEXT] = _code2TestSeq[DOM.TEXT] != null
-	    ? _code2TestSeq[DOM.TEXT].compile(classGen, methodGen, ihLoop)
-	    : ihText;
-
-	// This DOM-type is not in use - default: process next node
-	targets[DOM.UNUSED] = ihLoop;
-
-	// Match unknown element in DOM - default: check for namespace match
-	targets[DOM.ELEMENT] = elemNamespaceHandle;
-
-	// Match unknown attribute in DOM - default: check for namespace match
-	targets[DOM.ATTRIBUTE] = attrNamespaceHandle;
-
-	// Match on processing instruction - default: process next node
-	targets[DOM.PROCESSING_INSTRUCTION] =
-	    _code2TestSeq[DOM.PROCESSING_INSTRUCTION] != null
-	    ? _code2TestSeq[DOM.PROCESSING_INSTRUCTION]
-	    .compile(classGen, methodGen, ihLoop)
-	    : ihLoop;
-	
-	// Match on comments - default: process next node
-	targets[DOM.COMMENT] = _code2TestSeq[DOM.COMMENT] != null
-	    ? _code2TestSeq[DOM.COMMENT].compile(classGen, methodGen, ihLoop)
-	    : ihLoop;
-
-	// Now compile test sequences for various match patterns:
-	for (int i = DOM.NTYPES; i < targets.length; i++) {
-	    final TestSeq testSeq = _code2TestSeq[i];
-	    // Jump straight to namespace tests ?
-	    if ((testSeq == null) || (isNamespace[i])) {
-		if (isAttribute[i])
-		    targets[i] = attrNamespaceHandle;
-		else
-		    targets[i] = elemNamespaceHandle;
-	    }
-	    // Match on node type
-	    else {
-		if (isAttribute[i])
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 attrNamespaceHandle);
-		else
-		    targets[i] = testSeq.compile(classGen, methodGen,
-						 elemNamespaceHandle);
-	    }
-	}
-
-	// Append first code in applyTemplates() - get type of current node
-	body.append(methodGen.loadDOM());
-	body.append(new ILOAD(_currentIndex));
-	body.append(new INVOKEVIRTUAL(cpg.addMethodref(DOM_CLASS,
-						       "getType", "(I)I")));
-	
-	// Append switch() statement - main dispatch loop in applyTemplates()
-	body.append(new SWITCH(types, targets, ihLoop));
-	// Append all the "case:" statements
-	appendTestSequences(body);
-	// Append the actual template code
-	appendTemplateCode(body);
-
-	// Append NS:* node tests (if any)
-	if (nsElem != null) body.append(nsElem);
-	// Append NS:@* node tests (if any)
-	if (nsAttr != null) body.append(nsAttr);
-
-	// Append default action for element and root nodes
-	body.append(ilRecurse);
-	// Append default action for text and attribute nodes
-	body.append(ilText);
-
-	// putting together constituent instruction lists
-	mainIL.append(new GOTO(ihLoop));
-	mainIL.append(body);
-	// fall through to ilLoop
-	mainIL.append(ilLoop);
-	mainIL.append(RETURN);
-
-	peepHoleOptimization(methodGen);
-	methodGen.stripAttributes(true);
-	
-	methodGen.setMaxLocals();
-	methodGen.setMaxStack();
-	methodGen.removeNOPs();
-	classGen.addMethod(methodGen.getMethod());
-    }
-
-    /**
-     * Peephole optimization: Remove sequences of [ALOAD, POP].
-     */
-    private void peepHoleOptimization(MethodGenerator methodGen) {
-	InstructionList il = methodGen.getInstructionList();
-	FindPattern find = new FindPattern(il);
-	InstructionHandle ih;
-	String pattern;
-
-	// Remove sequences of ALOAD, POP
-	pattern = "`ALOAD'`POP'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		if ((!match[0].hasTargeters()) && (!match[1].hasTargeters())) {
-		    il.delete(match[0], match[1]);
-		}
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[2]);
-	}
-
-	// Replace sequences of ILOAD_?, ALOAD_?, SWAP with ALOAD_?, ILOAD_?
-	pattern = "`ILOAD__'`ALOAD__'`SWAP'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		de.fub.bytecode.generic.Instruction iload;
-		de.fub.bytecode.generic.Instruction aload;
-		if ((!match[0].hasTargeters()) &&
-		    (!match[1].hasTargeters()) &&
-		    (!match[2].hasTargeters())) {
-		    iload = match[0].getInstruction();
-		    aload = match[1].getInstruction();
-		    il.insert(match[0], aload);
-		    il.insert(match[0], iload);
-		    il.delete(match[0], match[2]);
-		}
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[3]);
-	}
-
-	// Replaces sequences of ALOAD_1, ALOAD_1 with ALOAD_1, DUP
-	pattern = "`ALOAD_1'`ALOAD_1'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		de.fub.bytecode.generic.Instruction iload;
-		de.fub.bytecode.generic.Instruction aload;
-		if ((!match[0].hasTargeters()) && (!match[1].hasTargeters())) {
-		    il.insert(match[1], new DUP());
-		    il.delete(match[1]);
-		}
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[2]);
-	}
-
-	// Removes uncessecary GOTOs
-	pattern = "`GOTO'`GOTO'`Instruction'";
-	ih = find.search(pattern);
-	while (ih != null) {
-	    final InstructionHandle[] match = find.getMatch();
-	    try {
-		de.fub.bytecode.generic.Instruction iload;
-		de.fub.bytecode.generic.Instruction aload;
-		InstructionTargeter tgtrs[] = match[1].getTargeters();
-		if (tgtrs != null) {
-		    InstructionHandle newTarget =
-			((BranchHandle)match[1]).getTarget();
-		    for (int i=0; i<tgtrs.length; i++)
-			tgtrs[i].updateTarget(match[1],newTarget);
-		}
-		il.delete(match[1]);
-	    }
-	    catch (TargetLostException e) {
-		// TODO: move target down into the list
-	    }
-	    ih = find.search(pattern, match[2]);
-	}
-	
-	
-    }
-
-    public InstructionHandle getTemplateInstructionHandle(Template template) {
-	return (InstructionHandle)_templateInstructionHandles.get(template);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NameBase.java b/src/org/apache/xalan/xsltc/compiler/NameBase.java
deleted file mode 100644
index 1083a8b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NameBase.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-class NameBase extends FunctionCall {
-
-    private Expression _param = null;
-    private Type       _type = Type.Node;
-
-    /**
-     * Handles calls with no parameter (current node is implicit parameter).
-     */
-    public NameBase(QName fname) {
-	super(fname);
-    }
-
-    /**
-     * Handles calls with one parameter (either node or node-set).
-     */
-    public NameBase(QName fname, Vector arguments) {
-	super(fname, arguments);
-	_param = argument(0);
-    }
-
-
-    /**
-     * Check that we either have no parameters or one parameter that is
-     * either a node or a node-set.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-	// Check the argument type (if any)
-	switch(argumentCount()) {
-	case 0:
-	    _type = Type.Node;
-	    break;
-	case 1:
-	    _type = _param.typeCheck(stable);
-	    break;
-	default:
-	    throw new TypeCheckError(this);
-	}
-
-	// The argument has to be a node, a node-set or a node reference
-	if ((_type != Type.NodeSet) &&
-	    (_type != Type.Node) &&
-	    (_type != Type.Reference)) {
-	    throw new TypeCheckError(this);
-	}
-
-	return Type.String;
-    }
-
-    public Type getType() {
-	return Type.String;
-    }
-
-
-    /**
-     * Translate the code required for getting the node for which the
-     * QName, local-name or namespace URI should be extracted.
-     */
-    public void translate(ClassGenerator classGen,
-			  MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	il.append(methodGen.loadDOM());
-	
-	// Function was called with no parameters
-	if (argumentCount() == 0) {
-	    il.append(methodGen.loadCurrentNode());
-	}
-	// Function was called with node parameter
-	else if (_type == Type.Node) {
-	    _param.translate(classGen, methodGen);
-	}
-	else if (_type == Type.Reference) {
-	    _param.translate(classGen, methodGen);
-	    il.append(new INVOKESTATIC(cpg.addMethodref
-				       (BASIS_LIBRARY_CLASS,
-					"referenceToNodeSet",
-					"(Ljava/lang/Object;)" +
-					"Lorg/apache/xalan/xsltc/" +
-					"NodeIterator;")));
-	    il.append(methodGen.nextNode());
-	}
-	// Function was called with node-set parameter
-	else {
-	    _param.translate(classGen, methodGen);
-	    _param.startResetIterator(classGen, methodGen);
-	    il.append(methodGen.nextNode());
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NameCall.java b/src/org/apache/xalan/xsltc/compiler/NameCall.java
deleted file mode 100644
index e8becbe..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NameCall.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-final class NameCall extends NameBase {
-
-    /**
-     * Handles calls with no parameter (current node is implicit parameter).
-     */
-    public NameCall(QName fname) {
-	super(fname);
-    }
-
-    /**
-     * Handles calls with one parameter (either node or node-set).
-     */
-    public NameCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * Translate code that leaves a node's QName (as a String) on the stack
-     */ 
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	final int getName = cpg.addInterfaceMethodref(DOM_INTF,
-						      GET_NODE_NAME,
-						      GET_NODE_NAME_SIG);
-	super.translate(classGen, methodGen);
-	il.append(new INVOKEINTERFACE(getName, 2));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java b/src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java
deleted file mode 100644
index a88eec8..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class NamespaceAlias extends TopLevelElement {
-
-    private String sPrefix;
-    private String rPrefix;
-	
-    /*
-     * The namespace alias definitions given here have an impact only on
-     * literal elements and literal attributes.
-     */
-    public void parseContents(Parser parser) {
-	sPrefix = getAttribute("stylesheet-prefix");
-	rPrefix = getAttribute("result-prefix");
-	parser.getSymbolTable().addPrefixAlias(sPrefix,rPrefix);
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void;
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	// do nada
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NamespaceUriCall.java b/src/org/apache/xalan/xsltc/compiler/NamespaceUriCall.java
deleted file mode 100644
index fe48f9c..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NamespaceUriCall.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class NamespaceUriCall extends NameBase {
-
-    /**
-     * Handles calls with no parameter (current node is implicit parameter).
-     */
-    public NamespaceUriCall(QName fname) {
-	super(fname);
-    }
-
-    /**
-     * Handles calls with one parameter (either node or node-set).
-     */
-    public NamespaceUriCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * Translate code that leaves a node's namespace URI (as a String)
-     * on the stack
-     */
-    public void translate(ClassGenerator classGen,
-			  MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Returns the string value for a node in the DOM
-	final int getNamespace = cpg.addInterfaceMethodref(DOM_INTF,
-							   "getNamespaceName",
-							   "(I)"+STRING_SIG);
-	super.translate(classGen, methodGen);
-	il.append(new INVOKEINTERFACE(getNamespace, 2));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NodeTest.java b/src/org/apache/xalan/xsltc/compiler/NodeTest.java
deleted file mode 100644
index 392eb1c..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NodeTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.DOM;
-
-public interface NodeTest {
-    public static final int TEXT      = DOM.TEXT;
-    public static final int COMMENT   = DOM.COMMENT;
-    public static final int PI        = DOM.PROCESSING_INSTRUCTION;
-    public static final int ROOT      = DOM.ROOT;
-    public static final int ELEMENT   = DOM.ELEMENT;
-    public static final int ATTRIBUTE = DOM.ATTRIBUTE;
-    
-    // generalized type
-    public static final int GTYPE     = DOM.NTYPES;
-    
-    public static final int ANODE     = DOM.FIRST_TYPE - 1;
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NotCall.java b/src/org/apache/xalan/xsltc/compiler/NotCall.java
deleted file mode 100644
index 986ca70..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NotCall.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class NotCall extends FunctionCall {
-    public NotCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	argument().translate(classGen, methodGen);
-	il.append(ICONST_1);
-	il.append(IXOR);
-    }
-
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	final Expression exp = argument();
-	exp.translateDesynthesized(classGen, methodGen);
-	final BranchHandle gotoh = il.append(new GOTO(null));
-	_trueList = exp._falseList; 	// swap flow lists
-	_falseList = exp._trueList;
-	_falseList.add(gotoh);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Number.java b/src/org/apache/xalan/xsltc/compiler/Number.java
deleted file mode 100644
index 67fc907..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Number.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.classfile.JavaClass;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.Field;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Number extends Instruction {
-    private static final int LEVEL_SINGLE   = 0;
-    private static final int LEVEL_MULTIPLE = 1;
-    private static final int LEVEL_ANY      = 2;
-
-    private Pattern _from = null;
-    private Pattern _count = null;
-    private Expression _value = null;
-
-    private AttributeValueTemplate _lang = null;
-    private AttributeValueTemplate _format = null;
-    private AttributeValueTemplate _letterValue = null;
-    private AttributeValueTemplate _groupingSeparator = null;
-    private AttributeValueTemplate _groupingSize = null;
-
-    private int _level = LEVEL_SINGLE;
-    private boolean _formatNeeded = false;
-
-    static final private String[] ClassNames = { 
-	"org.apache.xalan.xsltc.dom.SingleNodeCounter",	  // LEVEL_SINGLE
-	"org.apache.xalan.xsltc.dom.MultipleNodeCounter", // LEVEL_MULTIPLE
-	"org.apache.xalan.xsltc.dom.AnyNodeCounter"	  // LEVEL_ANY
-    };
-
-    static final private String[] FieldNames = { 
-	"___single_node_counter",		   // LEVEL_SINGLE
-	"___multiple_node_counter",		   // LEVEL_MULTIPLE
-	"___any_node_counter"			   // LEVEL_ANY
-    };
-
-    public void parseContents(Parser parser) {
-	final int count = _attributes.getLength();
-
-	for (int i = 0; i < count; i++) {
-	    final String name = _attributes.getQName(i);
-	    final String value = _attributes.getValue(i);
-
-	    if (name.equals("value")) {
-		_value = parser.parseExpression(this, name, null);
-	    }
-	    else if (name.equals("count")) {
-		_count = parser.parsePattern(this, name, null);
-	    }
-	    else if (name.equals("from")) {
-		_from = parser.parsePattern(this, name, null);
-	    }
-	    else if (name.equals("level")) {
-		if (value.equals("single")) {
-		    _level = LEVEL_SINGLE;
-		}
-		else if (value.equals("multiple")) {
-		    _level = LEVEL_MULTIPLE;
-		}
-		else if (value.equals("any")) {
-		    _level = LEVEL_ANY;
-		}
-	    }
-	    else if (name.equals("format")) {
-		_format = new AttributeValueTemplate(value, parser);
-		_formatNeeded = true;
-	    }
-	    else if (name.equals("lang")) {
-		_lang = new AttributeValueTemplate(value, parser);
-		_formatNeeded = true;
-	    }
-	    else if (name.equals("letter-value")) {
-		_letterValue = new AttributeValueTemplate(value, parser);
-		_formatNeeded = true;
-	    }
-	    else if (name.equals("grouping-separator")) {
-		_groupingSeparator = new AttributeValueTemplate(value, parser);
-		_formatNeeded = true;
-	    }
-	    else if (name.equals("grouping-size")) {
-		_groupingSize = new AttributeValueTemplate(value, parser);
-		_formatNeeded = true;
-	    }
-	}
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_value != null) {
-	    Type tvalue = _value.typeCheck(stable);
-	    if (tvalue instanceof RealType == false) {
-		_value = new CastExpr(_value, Type.Real);
-	    }
-	}
-	if (_count != null) {
-	    _count.typeCheck(stable);
-	}
-	if (_from != null) {
-	    _from.typeCheck(stable);
-	}
-	if (_format != null) {
-	    _format.typeCheck(stable);
-	}
-	if (_lang != null) {
-	    _lang.typeCheck(stable);
-	}
-	if (_letterValue != null) {
-	    _letterValue.typeCheck(stable);
-	}
-	if (_groupingSeparator != null) {
-	    _groupingSeparator.typeCheck(stable);
-	}
-	if (_groupingSize != null) {
-	    _groupingSize.typeCheck(stable);
-	}
-	return Type.Void;
-    }
-
-    /**
-     * True if the has specified a value for this instance of number.
-     */
-    public boolean hasValue() {
-	return _value != null;
-    }
-
-    /**
-     * Returns <tt>true</tt> if this instance of number has neither
-     * a from nor a count pattern.
-     */
-    public boolean isDefault() {
-	return _from == null && _count == null;
-    }
-
-    private void compileDefault(ClassGenerator classGen,
-			        MethodGenerator methodGen) {
-	int index;
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-
-	int[] fieldIndexes = getXSLTC().getNumberFieldIndexes();
-
-	if (fieldIndexes[_level] == -1) {
-	    Field defaultNode = new Field(ACC_PRIVATE, 
-					  cpg.addUtf8(FieldNames[_level]),
-					  cpg.addUtf8(NODE_COUNTER_SIG),
-					  null, 
-					  cpg.getConstantPool());
-
-	    // Add a new private field to this class
-	    classGen.addField(defaultNode);
-
-	    // Get a reference to the newly added field
-	    fieldIndexes[_level] = cpg.addFieldref(classGen.getClassName(), 
-						   FieldNames[_level],
-						   NODE_COUNTER_SIG);
-	}
-
-	// Check if field is initialized (runtime)
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(fieldIndexes[_level]));
-	final BranchHandle ifBlock1 = il.append(new IFNONNULL(null));
-
-	// Create an instance of DefaultNodeCounter
-	index = cpg.addMethodref(ClassNames[_level],
-				 "getDefaultNodeCounter", 
-				 "(" + TRANSLET_INTF_SIG
-				 + DOM_INTF_SIG
-				 + NODE_ITERATOR_SIG 
-				 + ")" + NODE_COUNTER_SIG);
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadDOM());
-	il.append(methodGen.loadIterator());
-	il.append(new INVOKESTATIC(index));
-	il.append(DUP);
-
-	// Store the node counter in the field
-	il.append(classGen.loadTranslet());
-	il.append(SWAP);
-	il.append(new PUTFIELD(fieldIndexes[_level]));
-	final BranchHandle ifBlock2 = il.append(new GOTO(null));
-
-	// Backpatch conditionals
-	ifBlock1.setTarget(il.append(classGen.loadTranslet()));
-	il.append(new GETFIELD(fieldIndexes[_level]));
-	
-	ifBlock2.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Compiles a constructor for the class <tt>className</tt> that
-     * inherits from {Any,Single,Multiple}NodeCounter. This constructor
-     * simply calls the same constructor in the super class.
-     */
-    private void compileConstructor(ClassGenerator classGen,
-                                    String className) {
-	MethodGenerator cons;
-	final InstructionList il = new InstructionList();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-
-	cons = new MethodGenerator(ACC_PUBLIC,
-				   de.fub.bytecode.generic.Type.VOID, 
-				   new de.fub.bytecode.generic.Type[] {
-				       Util.getJCRefType(TRANSLET_INTF_SIG),
-				       Util.getJCRefType(DOM_INTF_SIG),
-				       Util.getJCRefType(NODE_ITERATOR_SIG)
-				   },
-				   new String[] {
-				       "dom",
-				       "translet",
-				       "iterator"
-				   },
-				   "<init>", className, il, cpg);
-
-	il.append(ALOAD_0);     // this
-	il.append(ALOAD_1);     // translet
-	il.append(ALOAD_2);     // DOM
-	il.append(new ALOAD(3));// iterator
-
-	int index = cpg.addMethodref(ClassNames[_level],
-				     "<init>", 
-				     "(" + TRANSLET_INTF_SIG
-				     + DOM_INTF_SIG
-				     + NODE_ITERATOR_SIG 
-				     + ")V");
-	il.append(new INVOKESPECIAL(index));
-	il.append(RETURN);
-	
-	cons.stripAttributes(true);
-	cons.setMaxLocals();
-	cons.setMaxStack();
-	classGen.addMethod(cons.getMethod());
-    }
-
-    /**
-     * This method compiles code that is common to matchesFrom() and
-     * matchesCount() in the auxillary class.
-     */
-    private void compileLocals(NodeCounterGenerator nodeCounterGen,
-			       MatchGenerator matchGen,
-			       InstructionList il) {
-
-	ConstantPoolGen cpg = nodeCounterGen.getConstantPool();
-	final String className = matchGen.getClassName();
-
-	LocalVariableGen local;
-	int field;
-
-	// Get NodeCounter._iterator and store locally
-	local = matchGen.addLocalVariable("iterator", 
-					  Util.getJCRefType(NODE_ITERATOR_SIG),
-					  null, null);
-	field = cpg.addFieldref(NODE_COUNTER, "_iterator",
-				ITERATOR_FIELD_SIG);
-	il.append(ALOAD_0); // 'this' pointer on stack
-	il.append(new GETFIELD(field));
-	il.append(new ASTORE(local.getIndex()));
-	matchGen.setIteratorIndex(local.getIndex());
-	
-	// Get NodeCounter._translet and store locally
-	local = matchGen.addLocalVariable("translet", 
-				  Util.getJCRefType("Lorg/apache/xalan/xsltc/Translet;"),
-				  null, null);
-	field = cpg.addFieldref(NODE_COUNTER, "_translet",
-				"Lorg/apache/xalan/xsltc/Translet;");
-	il.append(ALOAD_0); // 'this' pointer on stack
-	il.append(new GETFIELD(field));
-	il.append(new ASTORE(local.getIndex()));
-	nodeCounterGen.setTransletIndex(local.getIndex());
-
-	// Get NodeCounter._document and store locally
-	local = matchGen.addLocalVariable("document", 
-					  Util.getJCRefType(DOM_INTF_SIG),
-					  null, null);
-	field = cpg.addFieldref(className, "_document", DOM_INTF_SIG);
-	il.append(ALOAD_0); // 'this' pointer on stack
-	il.append(new GETFIELD(field));
-	// Make sure we have the correct DOM type on the stack!!!
-	il.append(new ASTORE(local.getIndex()));
-	matchGen.setDomIndex(local.getIndex());
-    }
-
-    private void compilePatterns(ClassGenerator classGen,
-				 MethodGenerator methodGen) {
-	//!!!  local variables?
-	int current;
-	int field;
-	LocalVariableGen local;
-	MatchGenerator matchGen;
-	NodeCounterGenerator nodeCounterGen;
-
-	final String className = getXSLTC().getHelperClassName();
-	nodeCounterGen = new NodeCounterGenerator(className,
-						  ClassNames[_level],
-						  toString(), 
-						  ACC_PUBLIC | ACC_SUPER,
-						  null,
-						  classGen.getStylesheet());
-	InstructionList il = null;
-	ConstantPoolGen cpg = nodeCounterGen.getConstantPool();
-
-	// Add a single constructor to the class
-	compileConstructor(nodeCounterGen, className);
-
-	/*
-	 * Compile method matchesFrom()
-	 */
-	if (_from != null) {
-	    il = new InstructionList();
-	    matchGen =
-		new MatchGenerator(ACC_PUBLIC | ACC_FINAL,
-				   de.fub.bytecode.generic.Type.BOOLEAN, 
-				   new de.fub.bytecode.generic.Type[] {
-				       de.fub.bytecode.generic.Type.INT,
-				   },
-				   new String[] {
-				       "node",
-				   },
-				   "matchesFrom", className, il, cpg);
-
-	    compileLocals(nodeCounterGen,matchGen,il);
-
-	    // Translate Pattern
-	    il.append(matchGen.loadContextNode());
-	    _from.translate(nodeCounterGen, matchGen);
-	    _from.synthesize(nodeCounterGen, matchGen);
-	    il.append(IRETURN);
-		    
-	    matchGen.stripAttributes(true);
-	    matchGen.setMaxLocals();
-	    matchGen.setMaxStack();
-	    matchGen.removeNOPs();
-	    nodeCounterGen.addMethod(matchGen.getMethod());
-	}
-
-	/*
-	 * Compile method matchesCount()
-	 */
-	if (_count != null) {
-	    il = new InstructionList();
-	    matchGen = new MatchGenerator(ACC_PUBLIC | ACC_FINAL,
-					  de.fub.bytecode.generic.Type.BOOLEAN, 
-					  new de.fub.bytecode.generic.Type[] {
-					      de.fub.bytecode.generic.Type.INT,
-					  },
-					  new String[] {
-					      "node",
-					  },
-					  "matchesCount", className, il, cpg);
-
-	    compileLocals(nodeCounterGen,matchGen,il);
-	    
-	    // Translate Pattern
-	    il.append(matchGen.loadContextNode());
-	    _count.translate(nodeCounterGen, matchGen);
-	    _count.synthesize(nodeCounterGen, matchGen);
-	    
-	    il.append(IRETURN);
-		    
-	    matchGen.stripAttributes(true);
-	    matchGen.setMaxLocals();
-	    matchGen.setMaxStack();
-	    matchGen.removeNOPs();
-	    nodeCounterGen.addMethod(matchGen.getMethod());
-	}
-	
-	getXSLTC().dumpClass(nodeCounterGen.getJavaClass());
-
-	// Push an instance of the newly created class
-	cpg = classGen.getConstantPool();
-	il = methodGen.getInstructionList();
-
-	final int index = cpg.addMethodref(className, "<init>", 
-					   "(" + TRANSLET_INTF_SIG
-					   + DOM_INTF_SIG 
-					   + NODE_ITERATOR_SIG
-					   + ")V");
-	il.append(new NEW(cpg.addClass(className)));
-	il.append(DUP);
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadDOM());
-	il.append(methodGen.loadIterator());
-	il.append(new INVOKESPECIAL(index));
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	int index;
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Push "this" for the call to characters()
-	il.append(classGen.loadTranslet());
-
-	if (hasValue()) {
-	    compileDefault(classGen, methodGen);
-	    _value.translate(classGen, methodGen);
-
-	    // Round the number to the nearest integer
-	    index = cpg.addMethodref(MATH_CLASS, "round", "(D)J");
-	    il.append(new INVOKESTATIC(index));
-	    il.append(new L2I());
-
-	    // Call setValue on the node counter
-	    index = cpg.addMethodref(NODE_COUNTER, 
-				     "setValue", 
-				     "(I)" + NODE_COUNTER_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-	}
-	else if (isDefault()) {
-	    compileDefault(classGen, methodGen);
-	}
-	else {
-	    compilePatterns(classGen, methodGen);
-	}
-
-	// Call setStartNode() 
-	if (!hasValue()) {
-	    il.append(methodGen.loadContextNode());
-	    index = cpg.addMethodref(NODE_COUNTER, 
-				     SET_START_NODE, 
-				     "(I)" + NODE_COUNTER_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-	}
-
-	// Call getCounter() with or without args
-	if (_formatNeeded) {
-	    if (_format != null) {
-		_format.translate(classGen, methodGen);
-	    }
-	    else {
-		il.append(new PUSH(cpg, "1"));
-	    }
-
-	    if (_lang != null) {
-		_lang.translate(classGen, methodGen);
-	    }
-	    else {
-		il.append(new PUSH(cpg, "en")); 	// TODO ??
-	    }
-
-	    if (_letterValue != null) {
-		_letterValue.translate(classGen, methodGen);
-	    }
-	    else {
-		il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	    }
-
-	    if (_groupingSeparator != null) {
-		_groupingSeparator.translate(classGen, methodGen);
-	    }
-	    else {
-		il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	    }
-
-	    if (_groupingSize != null) {
-		_groupingSize.translate(classGen, methodGen);
-	    }
-	    else {
-		il.append(new PUSH(cpg, "0"));
-	    }
-
-	    index = cpg.addMethodref(NODE_COUNTER, "getCounter", 
-				     "(" + STRING_SIG + STRING_SIG 
-				     + STRING_SIG + STRING_SIG 
-				     + STRING_SIG + ")" + STRING_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-	}
-	else {
-	    index = cpg.addMethodref(NODE_COUNTER, "setDefaultFormatting", 
-				     "()" + NODE_COUNTER_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-
-	    index = cpg.addMethodref(NODE_COUNTER, "getCounter", 
-				     "()" + STRING_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-	}
-
-	// Output the resulting string to the handler
-	il.append(methodGen.loadHandler());
-	index = cpg.addMethodref(TRANSLET_CLASS,
-				 CHARACTERSW,
-				 CHARACTERSW_SIG);
-	il.append(new INVOKEVIRTUAL(index));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/NumberCall.java b/src/org/apache/xalan/xsltc/compiler/NumberCall.java
deleted file mode 100644
index 62c3d41..0000000
--- a/src/org/apache/xalan/xsltc/compiler/NumberCall.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class NumberCall extends FunctionCall {
-
-    public NumberCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (argumentCount() > 0) {
-	    argument().typeCheck(stable);
-	}
-	return _type = Type.Real;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	Type targ;
-	
-	if (argumentCount() == 0) {
-	    il.append(methodGen.loadContextNode());
-	    targ = Type.Node;
-	}
-	else {
-	    final Expression arg = argument();
-	    arg.translate(classGen, methodGen);
-	    arg.startResetIterator(classGen, methodGen);
-	    targ = arg.getType();
-	}
-
-	if (!targ.identicalTo(Type.Real)) {
-	    targ.translateTo(classGen, methodGen, Type.Real);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Otherwise.java b/src/org/apache/xalan/xsltc/compiler/Otherwise.java
deleted file mode 100644
index 9439b34..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Otherwise.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Otherwise extends Instruction {
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Otherwise");
-	indent(indent + IndentIncrement);
-	displayContents(indent + IndentIncrement);
-    }
-	
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final Parser parser = getParser();
-	final ErrorMsg msg = 
-	    new ErrorMsg("'otherwise' must be used within a 'choose'.", 
-			 getLineNumber());
-	parser.reportError(Constants.ERROR, msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Output.java b/src/org/apache/xalan/xsltc/compiler/Output.java
deleted file mode 100644
index d96e557..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Output.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.JavaClass;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.runtime.TextOutput;
-
-final class Output extends TopLevelElement {
-
-    // These attributes are extracted from the xsl:output element. They also
-    // appear as fields (with the same type, only public) in the translet
-    private String  _version;
-    private String  _method;
-    private String  _encoding;
-    private boolean _omitHeader = false;
-    private String  _standalone;
-    private String  _doctypePublic;
-    private String  _doctypeSystem;
-    private String  _cdata;
-    private boolean _indent = false;
-    private String  _mediaType;
-
-    // Disables this output element (when other element has higher precedence)
-    private boolean _disabled = false;
-
-    // Some global constants
-    private final static String STRING_SIG = "Ljava/lang/String;";
-    private final static String ONE_DOT_ZERO_STRING = "1.0";
-    private final static String OUTPUT_VERSION_ERROR =
-	"Output XML document type should be 1.0";
-
-    /**
-     * Displays the contents of this element (for debugging)
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Output " + _method);
-    }
-
-    /**
-     * Disables this <xsl:output> element in case where there are some other
-     * <xsl:output> element (from a different imported/included stylesheet)
-     * with higher precedence.
-     */
-    public void disable() {
-	_disabled = true;
-    }
-
-    /**
-     * Scans the attribute list for the xsl:output instruction
-     */
-    public void parseContents(Parser parser) {
-
-	// Do nothing if other <xsl:output> element has higher precedence
-	if (_disabled) return;
-
-	String attrib = null;
-
-	// Get the output XML version - only version "1.0" should be used
-	_version = getAttribute("version");
-	if ((_version == null) || (_version.equals(Constants.EMPTYSTRING))) {
-	    _version = ONE_DOT_ZERO_STRING;
-	}
-	if (!_version.equals(ONE_DOT_ZERO_STRING)) {
-	    ErrorMsg msg = new ErrorMsg(OUTPUT_VERSION_ERROR);
-	    parser.reportError(Constants.WARNING, msg);
-	}
-
-	// Get the output method - "xml", "html", "text" or <qname>
-	_method = getAttribute("method");
-	if (_method.equals(Constants.EMPTYSTRING)) _method = null;
-	if (_method != null) _method = _method.toLowerCase();
-
-	// Get the output encoding - any value accepted here
-	_encoding = getAttribute("encoding");
-	if (_encoding.equals(Constants.EMPTYSTRING)) _encoding = null;
-
-	// Should the XML header be omitted - translate to true/false
-	attrib = getAttribute("omit-xml-declaration");
-	if ((attrib != null) && (attrib.equals("yes"))) _omitHeader = true;
-
-	// Add 'standalone' decaration to output - use text as is
-	_standalone = getAttribute("standalone");
-	if (_standalone.equals(Constants.EMPTYSTRING)) _standalone = null;
-
-	// Get system/public identifiers for output DOCTYPE declaration
-	_doctypeSystem = getAttribute("doctype-system");
-	if (_doctypeSystem.equals(Constants.EMPTYSTRING)) _doctypeSystem = null;
-	_doctypePublic = getAttribute("doctype-public");
-	if (_doctypePublic.equals(Constants.EMPTYSTRING)) _doctypePublic = null;
-
-	// Names the elements of whose text contents should be output as CDATA
-	_cdata = getAttribute("cdata-section-elements");
-	if ((_cdata != null) && (_cdata.equals(Constants.EMPTYSTRING)))
-	    _cdata = null;
-
-	// Get the indent setting - only has effect for xml and html output
-	attrib = getAttribute("indent");
-	if ((attrib != null) && (attrib.equals("yes"))) _indent = true;
-
-	// Get the MIME type for the output file - we don't do anythign with it,
-	// but our client may use it to specify a data transport type, etc.
-	_mediaType = getAttribute("media-type");
-	if (_mediaType.equals(Constants.EMPTYSTRING)) _mediaType = null;
-
-	// parseChildren(parser); - the element is always empty
-
-	parser.setOutput(this);
-    }
-
-    /**
-     * Compile code that passes the information in this <xsl:output> element
-     * to the appropriate fields in the translet
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	// Do nothing if other <xsl:output> element has higher precedence
-	if (_disabled) return;
-
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-
-	int field = 0;
-        il.append(classGen.loadTranslet());
-
-	// Only update _version field if set and different from default
-	if ((_version != null) && (!_version.equals(ONE_DOT_ZERO_STRING))) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_version", STRING_SIG);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _version));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Only update _method field if "method" attribute used
-	if (_method != null) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_method", STRING_SIG);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _method));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Only update if _encoding field is "encoding" attribute used
-	if (_encoding != null) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_encoding", STRING_SIG);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _encoding));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Only update if "omit-xml-declaration" used and set to 'yes'
-	if (_omitHeader) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_omitHeader", "Z");
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _omitHeader));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Add 'standalone' decaration to output - use text as is
-	if (_standalone != null) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_standalone", STRING_SIG);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _standalone));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Set system/public doctype only if both are set
-	field = cpg.addFieldref(TRANSLET_CLASS,"_doctypeSystem",STRING_SIG);
-	il.append(DUP);
-	il.append(new PUSH(cpg, _doctypeSystem));
-	il.append(new PUTFIELD(field));
-	field = cpg.addFieldref(TRANSLET_CLASS,"_doctypePublic",STRING_SIG);
-	il.append(DUP);
-	il.append(new PUSH(cpg, _doctypePublic));
-	il.append(new PUTFIELD(field));
-	
-	// Add 'medye-type' decaration to output - if used
-	if (_mediaType != null) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_mediaType", STRING_SIG);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _mediaType));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Compile code to set output indentation on/off
-	if (_indent ) {
-	    field = cpg.addFieldref(TRANSLET_CLASS, "_indent", "Z");
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, _indent));
-	    il.append(new PUTFIELD(field));
-	}
-
-	// Forward to the translet any elements that should be output as CDATA
-	if (_cdata != null) {
-	    int index = cpg.addMethodref(TRANSLET_CLASS,
-					 "addCdataElement",
-					 "(Ljava/lang/String;)V");
-	    StringTokenizer tokens = new StringTokenizer(_cdata);
-	    while (tokens.hasMoreTokens()) {
-		il.append(DUP);
-		il.append(new PUSH(cpg, tokens.nextToken()));
-		il.append(new INVOKEVIRTUAL(index));
-	    }
-	}
-	il.append(POP); // Cleanup - pop last translet reference off stack
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Param.java b/src/org/apache/xalan/xsltc/compiler/Param.java
deleted file mode 100644
index 9bdef7f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Param.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.Field;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Param extends VariableBase {
-
-    /**
-     * Display variable as single string
-     */
-    public String toString() {
-	return("param("+_name+")");
-    }
-
-    /**
-     * Display variable in a full AST dump
-     */
-    public void display(int indent) {
-	indent(indent);
-	System.out.println("param " + _name);
-	if (_select != null) {
-	    indent(indent + IndentIncrement);
-	    System.out.println("select " + _select.toString());
-	}
-	displayContents(indent + IndentIncrement);
-    }
-
-    /**
-     * Returns the parameter's type. This is needed by ParameterRef to
-     * determine the type of the parameter
-     */
-    public Type getType() {
-	return _type;
-    }
-
-    /**
-     * Parse the contents of the <xsl:param> element. This method must read
-     * the 'name' (required) and 'select' (optional) attributes.
-     */
-    public void parseContents(Parser parser) {
-	// Parse attributes name and select (if present)
-	final String name = getAttribute("name");
-
-	if (name.length() > 0) {
-	    setName(parser.getQName(name));
-	}
-        else {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "name");
-        }
-
-	// check whether variable/param of the same name is already in scope
-	if (parser.lookupVariable(_name) != null) {
-	    ErrorMsg msg = new ErrorMsg(ErrorMsg.VARREDEF_ERR, _name, this);
-	    parser.reportError(Constants.ERROR, msg);
-	}
-	
-	final String select = getAttribute("select");
-	if (select.length() > 0) {
-	    _select = parser.parseExpression(this, "select", null);
-	}
-
-	// Children must be parsed first -> static scoping
-	parseChildren(parser);
-
-	// Add a ref to this param to its enclosing construct
-	final SyntaxTreeNode parent = getParent();
-	if (parent instanceof Stylesheet) {
-	    _isLocal = false;
-	    ((Stylesheet)parent).addParam(this);
-	    //!! check for redef
-	    parser.getSymbolTable().addParam(this);
-	}
-	else if (parent instanceof Template) {
-	    _isLocal = true;
-	    ((Template)parent).hasParams(true);
-	}
-    }
-
-    /**
-     * Type-checks the parameter. The parameter type is determined by the
-     * 'select' expression (if present) or is a result tree if the parameter
-     * element has a body and no 'select' expression.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// Get the type from the select exrepssion...
-	if (_select != null) {
-	    _type = _select.typeCheck(stable); 
-	    if (_type instanceof ReferenceType == false) {
-		_select = new CastExpr(_select, Type.Reference);
-	    }
-	}
-	// ...or set the type to result tree
-	else if (hasContents()) {
-	    typeCheckContents(stable);
-	}
-	_type = Type.Reference;
-
-	// This element has no type (the parameter does, but the parameter
-	// element itself does not).
-	return Type.Void;
-    }
-
-    /**
-     * Compile the value of the parameter, which is either in an expression in
-     * a 'select' attribute, or in the parameter element's body
-     */
-    public void translateValue(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	// Compile expression is 'select' attribute if present
-	if (_select != null) {
-	    _select.translate(classGen, methodGen);
-	    _type.translateBox(classGen, methodGen);
-	    _select.startResetIterator(classGen, methodGen);
-	}
-	// If not, compile result tree from parameter body if present.
-	else if (hasContents()) {
-	    compileResultTree(classGen, methodGen);
-	}
-	// If neither are present then store empty string in parameter slot
-	else {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final InstructionList il = methodGen.getInstructionList();
-	    il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	}
-    }
-
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_compiled) return;
-	_compiled = true;
-
-	final String name = getVariable();
-	final String signature = _type.toSignature();
-	final String className = _type.getClassName();
-
-	if (isLocal()) {
-
-	    il.append(classGen.loadTranslet());
-	    il.append(new PUSH(cpg, name));
-	    translateValue(classGen, methodGen);
-	    il.append(new PUSH(cpg, true));
-
-	    // Call addParameter() from this class
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 ADD_PARAMETER,
-							 ADD_PARAMETER_SIG)));
-	    if (className != EMPTYSTRING) {
-		il.append(new CHECKCAST(cpg.addClass(className)));
-	    }
-
-	    _type.translateUnBox(classGen, methodGen);
-
-	    if (_refs.isEmpty()) { // nobody uses the value
-		il.append(_type.POP());
-		_local = null;
-	    }
-	    else {		// normal case
-		_local = methodGen.addLocalVariable2(name,
-						     _type.toJCType(),
-						     il.getEnd());
-		// Cache the result of addParameter() in a local variable
-		il.append(_type.STORE(_local.getIndex()));
-	    }
-	}
-	else {
-	    classGen.addField(new Field(ACC_PUBLIC, cpg.addUtf8(name),
-					cpg.addUtf8(signature),
-					null, cpg.getConstantPool()));
-	    il.append(classGen.loadTranslet());
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, name));
-	    translateValue(classGen, methodGen);
-	    il.append(new PUSH(cpg, true));
-
-	    // Call addParameter() from this class
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 ADD_PARAMETER,
-							 ADD_PARAMETER_SIG)));
-
-	    _type.translateUnBox(classGen, methodGen);
-
-	    // Cache the result of addParameter() in a field
-	    if (className != EMPTYSTRING) {
-		il.append(new CHECKCAST(cpg.addClass(className)));
-	    }
-	    il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),
-						   name, signature)));
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Param.java.orig b/src/org/apache/xalan/xsltc/compiler/Param.java.orig
deleted file mode 100644
index 4127e71..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Param.java.orig
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * @(#)$Id$
- *
- * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * This software is the proprietary information of Sun Microsystems, Inc.  
- * Use is subject to license terms.
- * 
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package com.sun.xslt.compiler;
-
-import java.util.Vector;
-import com.sun.xml.tree.ElementEx;
-import com.sun.xslt.compiler.util.Type;
-import com.sun.xslt.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.Field;
-import com.sun.xslt.compiler.util.*;
-
-final class Param extends TopLevelElement {
-    private QName      _name;
-    private boolean    _isLocal;	// true if the param is local
-    private Expression _select;
-    private Type       _type;
-    // a JavaClass construct to refer to a JVM var
-    private LocalVariableGen _local;
-    // cached JavaClass instruction to push the contents of this var
-    private Instruction _loadInstruction;
-    // references to this variable (when local)
-    private Vector     _refs = new Vector(2);
-    // to make sure parameter field is not added twice
-    private boolean    _compiled = false;
-
-    public void display(int indent) {
-	indent(indent);
-	System.out.println("param " + _name);
-	if (_select != null) {
-	    indent(indent + IndentIncrement);
-	    System.out.println("select " + _select.toString());
-	}
-	displayContents(indent + IndentIncrement);
-    }
-
-    public void addReference(ParameterRef pref) {
-System.out.println("GTM> In  Param.addReference, param ref = " + pref);
-	_refs.addElement(pref);
-    }
-
-    public void removeReference(ParameterRef pref) {
-	_refs.remove(pref);
-    }
-    
-    public void removeReference(ParameterRef pref, MethodGenerator methodGen) {
-System.out.println("GTM> In Param.removeReference, param ref = " + pref);
-System.out.println("GTM> In Param.removeReference, _refs = " + _refs);
-	_refs.remove(pref);
-	if (_refs.isEmpty()) {
-	    _local.setEnd(methodGen.getInstructionList().getEnd());
-	    methodGen.removeLocalVariable(_local);
-	    _refs = null;
-	    _local = null;
-	}
-    }
-
-    public Instruction loadInstruction() {
-	final Instruction instr = _loadInstruction;
-	return instr != null
-	    ? instr : (_loadInstruction = _type.LOAD(_local.getIndex()));
-    }
-    
-    public Type getType() {
-	return _type;
-    }
-
-    public boolean isLocal() {
-	return _isLocal;
-    }
-
-    public QName getName() {
-	return _name;
-    }
-
-    public void parseContents(ElementEx element, Parser parser) {
-	// Parse attributes name and select (if present)
-	final String name = element.getAttribute("name");
-
-	if (name.length() > 0) {
-	    _name = parser.getQName(name);
-	}
-        else {
-	    reportError(element, parser, ErrorMsg.NREQATTR_ERR, "name");
-        }
-
-	// check whether variable/param of the same name is already in scope
-	if (parser.lookupVariable(_name) != null) {
-	    ErrorMsg error = new ErrorMsg(ErrorMsg.VARREDEF_ERR, _name, this);
-	    parser.addError(error);
-	}
-	
-	final String select = element.getAttribute("select");
-	if (select.length() > 0) {
-	    _select = parser.parseExpression(this, element, "select");
-	}
-
-	// Children must be parsed first -> static scoping
-	parseChildren(element, parser);
-
-	// Add a ref to this param to its enclosing construct
-	final SyntaxTreeNode parent = getParent();
-	if (parent instanceof Stylesheet) {
-	    _isLocal = false;
-	    ((Stylesheet)parent).addParam(this);
-	    //!! check for redef
-	    parser.getSymbolTable().addParam(this);
-	}
-	else {
-	    _isLocal = true;
-	    parent.addParam(this);
-	}
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_select != null) {
-	    final Type tselect = _select.typeCheck(stable); 
-	    if (tselect instanceof ReferenceType == false) {
-		_select = new CastExpr(_select, Type.Reference);
-	    }
-	}
-	else {
-	    typeCheckContents(stable);
-	}
-	_type = Type.Reference;
-	return Type.Void;
-    }
-
-    public void compileResultTree(ClassGenerator classGen,
-				  MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Save the current handler base on the stack
-	il.append(methodGen.loadHandler());
-
-	// Create new instance of DOM class (with 64 nodes)
-	final int init = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
-	il.append(new NEW(cpg.addClass(DOM_IMPL)));
-	il.append(DUP);
-	il.append(DUP);
-	il.append(new PUSH(cpg, 64));
-	il.append(new INVOKESPECIAL(init));
-
-	// Overwrite old handler with DOM handler
-	final int getOutputDomBuilder =
-	    cpg.addMethodref(DOM_IMPL,
-			     "getOutputDomBuilder",
-			     "()" + TRANSLET_OUTPUT_SIG);
-	il.append(new INVOKEVIRTUAL(getOutputDomBuilder));
-	il.append(DUP);
-	il.append(methodGen.storeHandler());
-
-	// Call startDocument on the new handler
-	il.append(methodGen.startDocument());
-
-	// Instantiate result tree fragment
-	translateContents(classGen, methodGen);
-
-	// Call endDocument on the new handler
-	il.append(methodGen.loadHandler());
-	il.append(methodGen.endDocument());
-
-	// Restore old handler base from stack
-	il.append(SWAP);
-	il.append(methodGen.storeHandler());
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final String name = _name.getLocalPart(); // TODO: namespace ?
-
-	if (_compiled) return;
-	_compiled = true;
-
-	if (isLocal()) {
-	    il.append(classGen.loadTranslet());
-	    il.append(new PUSH(cpg, name));
-	    if (_select == null) {
-		if (hasContents()) {
-		    compileResultTree(classGen, methodGen);	
-		}
-		else {
-		    // If no select and no contents push the empty string
-		    il.append(new PUSH(cpg, ""));
-		}
-	    }
-	    else {
-		_select.translate(classGen, methodGen);
-		_select.startResetIterator(classGen, methodGen);
-	    }
-
-	    // Call addParameter() from this class
-	    final int addParameter = cpg.addMethodref(TRANSLET_CLASS,
-						      ADD_PARAMETER,
-						      ADD_PARAMETER_SIG);
-	    il.append(new INVOKEVIRTUAL(addParameter));
-
-	    if (_refs.isEmpty()) { // nobody uses the value
-		il.append(_type.POP());
-		_local = null;
-	    }
-	    else {		// normal case
-		_local = methodGen.addLocalVariable2(name, _type.toJCType(),
-						     il.getEnd());
-		// Cache the result of addParameter() in a local variable
-		il.append(_type.STORE(_local.getIndex()));
-	    }
-	}
-	else {
-	    String signature = _type.toSignature();
-	    if (signature.equals(DOM_IMPL_SIG))
-		signature = classGen.getDOMClassSig();
-	    classGen.addField(new Field(ACC_PUBLIC, cpg.addUtf8(name),
-					cpg.addUtf8(signature),
-					null, cpg.getConstantPool()));
-	    il.append(classGen.loadTranslet());
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, name));
-
-	    if (_select == null) {
-		if (hasContents()) {
-		    compileResultTree(classGen, methodGen);	
-		}
-		else {
-		    // If no select and no contents push the empty string
-		    il.append(new PUSH(cpg, ""));
-		}
-	    }
-	    else {
-		_select.translate(classGen, methodGen);
-		_select.startResetIterator(classGen, methodGen);
-	    }
-
-	    // Call addParameter() from this class
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 ADD_PARAMETER,
-							 ADD_PARAMETER_SIG)));
-	    // Cache the result of addParameter() in a field
-	    il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),
-						   name, signature)));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ParameterRef.java b/src/org/apache/xalan/xsltc/compiler/ParameterRef.java
deleted file mode 100644
index 1179198..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ParameterRef.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ParameterRef extends VariableRefBase {
-
-    public ParameterRef(Param param) {
-	super(param);
-    }
-
-    public String toString() {
-	return "parameter-ref(" + _variable.getName() + ')';
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-		
-	String name = _variable.getVariable();
-
-	if (_variable.isLocal()) {
-	    if (classGen.isExternal()) {
-		il.append(classGen.loadTranslet());
-		il.append(new PUSH(cpg, name));
-		final int index = cpg.addMethodref(TRANSLET_CLASS, 
-						   GET_PARAMETER,
-						   GET_PARAMETER_SIG);
-		il.append(new INVOKEVIRTUAL(index));
-		_type.translateUnBox(classGen, methodGen);
-	    }
-	    else {
-		il.append(_variable.loadInstruction());
-		_variable.removeReference(this);
-	    }
-	}
-	else {
-	    final String signature = _type.toSignature();
-	    final String className = classGen.getClassName();
-	    il.append(classGen.loadTranslet());
-	    // If inside a predicate we must cast this ref down
-	    if (classGen.isExternal()) {
-		il.append(new CHECKCAST(cpg.addClass(className)));
-	    }
-	    il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java b/src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java
deleted file mode 100644
index f422ead..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.dom.Axis;
-
-final class ParentLocationPath extends RelativeLocationPath {
-    private Expression _step;
-    private final RelativeLocationPath _path;
-    private Type stype;
-    private boolean _orderNodes = false;
-
-    public ParentLocationPath(RelativeLocationPath path, Expression step) {
-	_path = path;
-	_step = step;
-	_path.setParent(this);
-	_step.setParent(this);
-    }
-		
-    public void setAxis(int axis) {
-	_path.setAxis(axis);
-    }
-
-    public RelativeLocationPath getPath() {
-	return(_path);
-    }
-
-    public Expression getStep() {
-	return(_step);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_step.setParser(parser);
-	_path.setParser(parser);
-    }
-    
-    public String toString() {
-	return "ParentLocationPath(" + _path + ", " + _step + ')';
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	stype = _step.typeCheck(stable);
-	_path.typeCheck(stable);
-
-	if (descendantAxis() && _path.descendantAxis())
-	    _orderNodes = true;
-
-	return _type = Type.NodeSet;	
-    }
-
-    public boolean descendantAxis() {
-	if (_step instanceof Step) {
-	    return ((Step)_step).descendantAxis();
-	}
-	else if (_step instanceof ParentLocationPath) {
-	    return ((ParentLocationPath)_step).descendantAxis();
-	}
-	return(false);
-    }
-
-    /*
-    public void blockIteratorReset() {
-	if (_path instanceof RelativeLocationPath)
-	    ((RelativeLocationPath)_path).blockIteratorReset();
-	if (_step instanceof Step)
-	    ((Step)_step).blockIteratorReset();
-    }
-    */
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Create new StepIterator
-	final int initSI = cpg.addMethodref(STEP_ITERATOR_CLASS,
-					    "<init>",
-					    "("
-					    +NODE_ITERATOR_SIG
-					    +NODE_ITERATOR_SIG
-					    +")V");
-	il.append(new NEW(cpg.addClass(STEP_ITERATOR_CLASS)));
-	il.append(DUP);
-
-	// Compile path iterator
-	_path.translate(classGen, methodGen); // iterator on stack....
-	_step.translate(classGen, methodGen);
-
-
-	// Initialize StepIterator with iterators from the stack
-	il.append(new INVOKESPECIAL(initSI));
-
-	/*
-	 * If this pattern contains a sequence of descendant iterators we
-	 * run the risk of returning the same node several times. We put
-	 * a new iterator on top of the existing one to assure node order
-	 * and prevent returning a single node multiple times.
-	 */
-	if (_orderNodes) {
-	    final String params = "("+NODE_ITERATOR_SIG+"I)"+NODE_ITERATOR_SIG;
-	    final int order = cpg.addInterfaceMethodref(DOM_INTF,
-							"orderNodes",
-							params);
-	    il.append(methodGen.loadDOM());
-	    il.append(SWAP);
-	    il.append(methodGen.loadContextNode());
-	    il.append(new INVOKEINTERFACE(order, 3));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ParentPattern.java b/src/org/apache/xalan/xsltc/compiler/ParentPattern.java
deleted file mode 100644
index d6cb3b3..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ParentPattern.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ParentPattern extends RelativePathPattern {
-    private final Pattern _left;
-    private final RelativePathPattern _right;
-		
-    public ParentPattern(Pattern left, RelativePathPattern right) {
-	(_left = left).setParent(this);
-	(_right = right).setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-	_right.setParser(parser);
-    }
-    
-    public boolean isWildcard() {
-	return false;
-    }
-	
-    public StepPattern getKernelPattern() {
-	return _right.getKernelPattern();
-    }
-	
-    public void reduceKernelPattern() {
-	_right.reduceKernelPattern();
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_left.typeCheck(stable);
-	return _right.typeCheck(stable);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final LocalVariableGen local =
-	    methodGen.addLocalVariable2("ppt", 
-					Util.getJCRefType(NODE_SIG),
-					il.getEnd());
-	
-	final de.fub.bytecode.generic.Instruction loadLocal =
-	    new ILOAD(local.getIndex());
-	final de.fub.bytecode.generic.Instruction storeLocal =
-	    new ISTORE(local.getIndex());
-
-	if (_right.isWildcard()) {
-	    il.append(methodGen.loadDOM());
-	    il.append(SWAP);
-	}
-	else if (_right instanceof StepPattern) {
-	    //!!! check this
-
-	    il.append(DUP);
-	    il.append(storeLocal);
-	    
-	    _right.translate(classGen, methodGen);
-	    
-	    il.append(methodGen.loadDOM());
-	    local.setEnd(il.append(loadLocal));
-	}
-	else {
-	    _right.translate(classGen, methodGen);
-	}
-
-	final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
-							GET_PARENT,
-							GET_PARENT_SIG);
-	il.append(new INVOKEINTERFACE(getParent, 2));
-
-	final SyntaxTreeNode p = getParent();
-	if ((p == null) ||
-	    (p instanceof Instruction) ||
-	    (p instanceof TopLevelElement)) {
-	    _left.translate(classGen, methodGen);
-	}
-	else {
-	    il.append(DUP);
-	    il.append(storeLocal);
-	    
-	    _left.translate(classGen, methodGen);
-
-	    il.append(methodGen.loadDOM());
-	    local.setEnd(il.append(loadLocal));
-	}
-
-	methodGen.removeLocalVariable(local);
-	
-	_trueList.append(_right._trueList.append(_left._trueList));
-	_falseList.append(_right._falseList.append(_left._falseList));
-    }
-
-    public String toString() {
-	return "Parent(" + _left + ", " + _right + ')';
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Parser.java b/src/org/apache/xalan/xsltc/compiler/Parser.java
deleted file mode 100644
index 389f4c5..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Parser.java
+++ /dev/null
@@ -1,1175 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.io.*;
-import java.net.URL;
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.util.Stack;
-import java.net.MalformedURLException;
-
-import javax.xml.parsers.*;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import java_cup.runtime.Symbol;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.runtime.AttributeList;
-
-public class Parser implements Constants, ContentHandler {
-
-    private static final String XSL = "xsl";            // standard prefix
-    private static final String TRANSLET = "translet"; // extension prefix
-    
-    private XSLTC _xsltc;             // Reference to the compiler object.
-    private XPathParser _xpathParser; // Reference to the XPath parser.
-    private Vector _errors;           // Contains all compilation errors
-    private Vector _warnings;         // Contains all compilation errors
-
-    private Hashtable   _instructionClasses; // Maps instructions to classes
-    private Hashtable   _qNames;
-    private Hashtable   _namespaces;
-    private QName       _useAttributeSets;
-    private QName       _excludeResultPrefixes;
-    private QName       _extensionElementPrefixes;
-    private Hashtable   _variableScope;
-    private Stylesheet  _currentStylesheet;
-    private SymbolTable _symbolTable; // Maps QNames to syntax-tree nodes
-    private Output      _output = null;
-    private Template    _template;    // Reference to the template being parsed.
-
-    private boolean     _rootNamespaceDef = false; // Used for validity check
-
-    private SyntaxTreeNode _root = null;
-
-    private String _target;
-
-    private int _currentImportPrecedence = 1;
-
-    private final static String CLASS_NOT_FOUND =
-	"Internal XSLTC class not in classpath: ";
-    private final static String INTERNAL_ERROR =
-	"Unrecoverable XSLTC compilation error: ";
-    private final static String UNSUPPORTED_XSL_ERROR =
-	"Unsupported XSL element: ";
-    private final static String INVALID_EXT_ERROR =
-	"Invalid XSLTC extension: ";
-    private final static String UNSUPPORTED_EXT_ERROR =
-	"Unsupported XSLT extension: ";
-    private final static String TEXT_NODE_ERROR =
-	"Text data outside of top-level <xsl:stylesheet> element.";
-    private final static String MISSING_HREF_ERROR =
-	"Processing instruction <?xml-stylesheet ... ?> is missing href data.";
-    private final static String MISSING_XSLT_URI_ERROR =
-	"The input document is not a stylesheet "+
-	"(the XSL namespace is not declared in the root element).";
-
-    public Parser(XSLTC xsltc) {
-	_xsltc = xsltc;
-    }
-
-    public void init() {
-	_qNames              = new Hashtable(512);
-	_namespaces          = new Hashtable();
-	_instructionClasses  = new Hashtable();
-	_variableScope       = new Hashtable();
-	_template            = null;
-	_errors              = new Vector();
-	_warnings            = new Vector();
-	_symbolTable         = new SymbolTable();
-	_xpathParser         = new XPathParser(this);
-	_currentStylesheet   = null;
-	_currentImportPrecedence = 1;
-	
-	initStdClasses();
-	initExtClasses();
-	initSymbolTable();
-	
-	_useAttributeSets =
-	    getQName(XSLT_URI, XSL, "use-attribute-sets");
-	_excludeResultPrefixes =
-	    getQName(XSLT_URI, XSL, "exclude-result-prefixes");
-	_extensionElementPrefixes =
-	    getQName(XSLT_URI, XSL, "extension-element-prefixes");
-    }
-
-    public void setOutput(Output output) {
-	if (_output == null)
-	    _output = output;
-	else
-	    output.disable();
-    }
-
-    public void addVariable(Variable var) {
-	_variableScope.put(var.getName(), var);
-    }
-
-    public void addParameter(Param param) {
-	_variableScope.put(param.getName(), param);
-    }
-
-    public void removeVariable(QName name) {
-	_variableScope.remove(name);
-    }
-
-    public SyntaxTreeNode lookupVariable(QName name) {
-	return (SyntaxTreeNode)_variableScope.get(name);
-    }
-
-    public void setXSLTC(XSLTC xsltc) {
-	_xsltc = xsltc;
-    }
-
-    public XSLTC getXSLTC() {
-	return _xsltc;
-    }
-
-    public int getCurrentImportPrecedence() {
-	return _currentImportPrecedence;
-    }
-    
-    public int getNextImportPrecedence() {
-	return ++_currentImportPrecedence;
-    }
-
-    public void setCurrentStylesheet(Stylesheet stylesheet) {
-	_currentStylesheet = stylesheet;
-    }
-
-    public Stylesheet getCurrentStylesheet() {
-	return _currentStylesheet;
-    }
-    
-    public Stylesheet getTopLevelStylesheet() {
-	return _xsltc.getStylesheet();
-    }
-
-    public QName getQNameSafe(final String stringRep) {
-	// parse and retrieve namespace
-	final int colon = stringRep.lastIndexOf(':');
-	if (colon != -1) {
-	    final String prefix = stringRep.substring(0, colon);
-	    final String localname = stringRep.substring(colon + 1);
-	    String namespace = null;
-	    
-	    // Get the namespace uri from the symbol table
-	    if (prefix.equals("xmlns") == false) {
-		namespace = _symbolTable.lookupNamespace(prefix);
-		if (namespace == null) namespace = Constants.EMPTYSTRING;
-	    }
-	    return getQName(namespace, prefix, localname);
-	}
-	else {
-	    return getQName(_symbolTable.lookupNamespace(Constants.EMPTYSTRING), null, stringRep);
-	}
-    }
-    
-    public QName getQName(final String stringRep) {
-	// parse and retrieve namespace
-	final int colon = stringRep.lastIndexOf(':');
-	if (colon != -1) {
-	    final String prefix = stringRep.substring(0, colon);
-	    final String localname = stringRep.substring(colon + 1);
-	    String namespace = null;
-	    
-	    // Get the namespace uri from the symbol table
-	    if (prefix.equals("xmlns") == false) {
-		namespace = _symbolTable.lookupNamespace(prefix);
-		if (namespace == null) {
-		    reportError(Constants.ERROR,
-			new ErrorMsg(ErrorMsg.NSPUNDEF_ERR, prefix)); 
-		    Exception e = new Exception();
-		    e.printStackTrace();
-		}
-	    }
-	    return getQName(namespace, prefix, localname);
-	}
-	else {
-	    return getQName(_symbolTable.lookupNamespace(Constants.EMPTYSTRING), null, stringRep);
-	}
-    }
-
-    public QName getQName(String namespace, String prefix, String localname) {
-	if (namespace == null) {
-	    QName name = (QName)_qNames.get(localname);
-	    if (name == null) {
-		_qNames.put(localname,
-			    name = new QName(null, prefix, localname));
-	    }
-	    return name;
-	}
-	else {
-	    Dictionary space = (Dictionary)_namespaces.get(namespace);
-	    if (space == null) {
-		final QName name = new QName(namespace, prefix, localname);
-		_namespaces.put(namespace, space = new Hashtable());
-		space.put(localname, name);
-		return name;
-	    }
-	    else {
-		QName name = (QName)space.get(localname);
-		if (name == null) {
-		    name = new QName(namespace, prefix, localname);
-		    space.put(localname, name);
-		}
-		return name;
-	    }
-	}
-    }
-    
-    public QName getQName(String scope, String name) {
-	return getQName(scope + name);
-    }
-
-    public QName getQName(QName scope, QName name) {
-	return getQName(scope.toString() + name.toString());
-    }
-
-    public QName getUseAttributeSets() {
-	return _useAttributeSets;
-    }
-
-    public QName getExtensionElementPrefixes() {
-	return _extensionElementPrefixes;
-    }
-
-    public QName getExcludeResultPrefixes() {
-	return _excludeResultPrefixes;
-    }
-    
-    /**	
-     * Create an instance of the <code>Stylesheet</code> class,
-     * and then parse, typecheck and compile the instance.
-     * Must be called after <code>parse()</code>.
-     */
-    public Stylesheet makeStylesheet(SyntaxTreeNode element) 
-	throws CompilerException {
-	try {
-	    Stylesheet stylesheet;
-
-	    if (element instanceof Stylesheet) {
-		stylesheet = (Stylesheet)element;
-	    }
-	    else {
-		stylesheet = new Stylesheet();
-		stylesheet.setSimplified();
-		stylesheet.addElement(element);
-	    }
-	    stylesheet.setParser(this);
-	    return stylesheet;
-	}
-	catch (ClassCastException e) {
-	    throw new CompilerException("The input document does not "+
-					"contain an XSL stylesheet.");
-	}
-    }
-    
-    /**
-     * Instanciates a SAX2 parser and generate the AST from the input.
-     */
-    public void createAST(Stylesheet stylesheet) {
-	try {
-	    if (stylesheet != null) {
-		stylesheet.parseContents(this);
-		final int precedence = stylesheet.getImportPrecedence();
-		final Enumeration elements = stylesheet.elements();
-		while (elements.hasMoreElements()) {
-		    Object child = elements.nextElement();
-		    if (child instanceof Text) {
-			reportError(Constants.ERROR,
-			    new ErrorMsg(TEXT_NODE_ERROR));
-		    }
-		}
-		if (!errorsFound()) {
-		    stylesheet.typeCheck(_symbolTable);
-		}
-	    }
-	}
-	catch (TypeCheckError e) {
-	    reportError(Constants.ERROR, new ErrorMsg(e.toString()));
-	}
-    }
-
-    /**
-     * Parses a stylesheet and builds the internal abstract syntax tree
-     * @param reader A SAX2 SAXReader (parser)
-     * @param input A SAX2 InputSource can be passed to a SAX reader
-     * @return The root of the abstract syntax tree
-     */
-    public SyntaxTreeNode parse(XMLReader reader, InputSource input) {
-	try {
-	    // Parse the input document and build the abstract syntax tree
-	    reader.setContentHandler(this);
-	    reader.parse(input);
-	    // Find the start of the stylesheet within the tree
-	    return (SyntaxTreeNode)getStylesheet(_root);	
-	}
-	catch (IOException e) {
-	    reportError(Constants.ERROR,
-		new ErrorMsg(e.getMessage()));
-	}
-	catch (SAXException e) {
-	    reportError(Constants.ERROR, new ErrorMsg(e.getMessage()));
-	}
-	catch (CompilerException e) {
-	    reportError(Constants.ERROR, new ErrorMsg(e.getMessage()));
-	}
-	return null;
-    }
-
-    /**
-     * Parses a stylesheet and builds the internal abstract syntax tree
-     * @param input A SAX2 InputSource can be passed to a SAX reader
-     * @return The root of the abstract syntax tree
-     */
-    public SyntaxTreeNode parse(InputSource input) {
-	try {
-	    // Create a SAX parser and get the XMLReader object it uses
-	    final SAXParserFactory factory = SAXParserFactory.newInstance();
-	    try {
-		factory.setFeature(Constants.NAMESPACE_FEATURE,true);
-	    }
-	    catch (Exception e) {
-		factory.setNamespaceAware(true);
-	    }
-	    final SAXParser parser = factory.newSAXParser();
-	    final XMLReader reader = parser.getXMLReader();
-	    return(parse(reader, input));
-	}
-	catch (ParserConfigurationException e) {
-	    reportError(Constants.ERROR,
-		new ErrorMsg("JAXP parser not configured correctly"));
-	}
-	catch (SAXParseException e){
-	    reportError(Constants.ERROR,
-		new ErrorMsg(e.getMessage(),e.getLineNumber()));
-	}
-	catch (SAXException e) {
-	    reportError(Constants.ERROR, new ErrorMsg(e.getMessage()));
-	}
-	return null;
-    }
-
-    public SyntaxTreeNode getDocumentRoot() {
-	return _root;
-    }
-
-    private String _PImedia = null;
-    private String _PItitle = null;
-    private String _PIcharset = null;
-
-    /**
-     * Set the parameters to use to locate the correct <?xml-stylesheet ...?>
-     * processing instruction in the case where the input document is an
-     * XML document with one or more references to a stylesheet.
-     * @param media The media attribute to be matched. May be null, in which
-     * case the prefered templates will be used (i.e. alternate = no).
-     * @param title The value of the title attribute to match. May be null.
-     * @param charset The value of the charset attribute to match. May be null.
-     */
-    protected void setPIParameters(String media, String title, String charset) {
-	_PImedia = media;
-	_PItitle = title;
-	_PIcharset = charset;
-    }
-
-    /**
-     * Extracts the DOM for the stylesheet. In the case of an embedded
-     * stylesheet, it extracts the DOM subtree corresponding to the 
-     * embedded stylesheet that has an 'id' attribute whose value is the
-     * same as the value declared in the <?xml-stylesheet...?> processing 
-     * instruction (P.I.). In the xml-stylesheet P.I. the value is labeled
-     * as the 'href' data of the P.I. The extracted DOM representing the
-     * stylesheet is returned as an Element object.
-     */
-    private SyntaxTreeNode getStylesheet(SyntaxTreeNode root)
-	throws CompilerException {
-
-	// Assume that this is a pure XSL stylesheet if there is not
-	// <?xml-stylesheet ....?> processing instruction
-	if (_target == null) {
-	    if (!_rootNamespaceDef)
-		throw new CompilerException(MISSING_XSLT_URI_ERROR);
-	    return(root);
-	}
-
-	// Find the xsl:stylesheet or xsl:transform with this reference
-	if (_target.charAt(0) == '#') {
-	    SyntaxTreeNode element = findStylesheet(root, _target.substring(1));
-	    return(element);
-	}
-	else {
-	    return(loadExternalStylesheet(_target));
-	}
-    }
-
-    /**
-     * Find a Stylesheet element with a specific ID attribute value.
-     * This method is used to find a Stylesheet node that is referred
-     * in a <?xml-stylesheet ... ?> processing instruction.
-     */
-    private SyntaxTreeNode findStylesheet(SyntaxTreeNode root, String href) {
-
-	if (root == null) return null;
-
-	if (root instanceof Stylesheet) {
-	    String id = root.getAttribute("id");
-	    if (id.equals(href)) return root;
-	}
-	Vector children = root.getContents();
-	if (children != null) {
-	    final int count = children.size();
-	    for (int i = 0; i < count; i++) {
-		SyntaxTreeNode child = (SyntaxTreeNode)children.elementAt(i);
-		SyntaxTreeNode node = findStylesheet(child, href);
-		if (node != null) return node;
-	    }
-	}
-	return null;	
-    }
-
-    /**
-     * For embedded stylesheets: Load an external file with stylesheet
-     */
-    private SyntaxTreeNode loadExternalStylesheet(String location)
-	throws CompilerException {
-
-	InputSource source;
-
-	// Check if the location is URL or a local file
-	if ((new File(location)).exists())
-	    source = new InputSource("file:"+location);
-	else
-	    source = new InputSource(location);
-
-	SyntaxTreeNode external = (SyntaxTreeNode)parse(source);
-	return(external);
-    }
-
-    /**
-     * Initialize the _instructionClasses Hashtable, which maps XSL element
-     * names to Java classes in this package.
-     */
-    private void initStdClasses() {
-	initStdClass("template", "Template");
-	initStdClass("stylesheet", "Stylesheet");
-	initStdClass("transform", "Stylesheet");
-	initStdClass("text", "Text");
-	initStdClass("if", "If");
-	initStdClass("choose", "Choose");
-	initStdClass("when", "When");
-	initStdClass("otherwise", "Otherwise");
-	initStdClass("for-each", "ForEach");
-	initStdClass("message", "Message");
-	initStdClass("number", "Number");
-	initStdClass("comment", "Comment");
-	initStdClass("copy", "Copy");
-	initStdClass("copy-of", "CopyOf");
-	initStdClass("param", "Param");
-	initStdClass("with-param", "WithParam");
-	initStdClass("variable", "Variable");
-	initStdClass("output", "Output");
-	initStdClass("sort", "Sort");
-	initStdClass("key", "Key");
-	initStdClass("fallback", "Fallback");
-	initStdClass("attribute", "XslAttribute");
-	initStdClass("attribute-set", "AttributeSet");
-	initStdClass("value-of", "ValueOf");
-	initStdClass("element", "XslElement");
-	initStdClass("call-template", "CallTemplate");
-	initStdClass("apply-templates", "ApplyTemplates");
-	initStdClass("apply-imports", "ApplyImports");
-	initStdClass("decimal-format", "DecimalFormatting");
-	initStdClass("import", "Import");
-	initStdClass("include", "Include");
-	initStdClass("strip-space", "Whitespace");
-	initStdClass("preserve-space", "Whitespace");
-	initStdClass("processing-instruction", "ProcessingInstruction");
-	initStdClass("namespace-alias", "NamespaceAlias");
-    }
-    
-    private void initStdClass(String elementName, String className) {
-	_instructionClasses.put(getQName(XSLT_URI, XSL, elementName),
-				COMPILER_PACKAGE + '.' + className);
-    }
-
-    public boolean elementSupported(QName qname) {
-	return(_instructionClasses.get(qname) != null);
-    }
-
-    public boolean functionSupported(String fname) {
-	return(_symbolTable.lookupPrimop(fname) != null);
-    }
-
-    private void initExtClasses() {
-	initExtClass("output", "TransletOutput");
-    }
-
-    private void initExtClass(String elementName, String className) {
-	_instructionClasses.put(getQName(TRANSLET_URI, TRANSLET, elementName),
-				COMPILER_PACKAGE + '.' + className);
-    }
-
-    /**
-     * Add primops and base functions to the symbol table.
-     */
-    private void initSymbolTable() {
-	MethodType I_V  = new MethodType(Type.Int, Type.Void);
-	MethodType I_R  = new MethodType(Type.Int, Type.Real);
-	MethodType I_S  = new MethodType(Type.Int, Type.String);
-	MethodType I_D  = new MethodType(Type.Int, Type.NodeSet);
-	MethodType R_I  = new MethodType(Type.Real, Type.Int);
-	MethodType R_V  = new MethodType(Type.Real, Type.Void);
-	MethodType R_R  = new MethodType(Type.Real, Type.Real);
-	MethodType R_D  = new MethodType(Type.Real, Type.NodeSet);
-	MethodType R_O  = new MethodType(Type.Real, Type.Reference);
-	MethodType I_I  = new MethodType(Type.Int, Type.Int);
- 	MethodType D_O  = new MethodType(Type.NodeSet, Type.Reference);
-	MethodType D_V  = new MethodType(Type.NodeSet, Type.Void);
-	MethodType D_S  = new MethodType(Type.NodeSet, Type.String);
-	MethodType D_D  = new MethodType(Type.NodeSet, Type.NodeSet);
-	MethodType A_V  = new MethodType(Type.Node, Type.Void);
-	MethodType S_V  = new MethodType(Type.String, Type.Void);
-	MethodType S_S  = new MethodType(Type.String, Type.String);
-	MethodType S_A  = new MethodType(Type.String, Type.Node);
-	MethodType S_D  = new MethodType(Type.String, Type.NodeSet);
-	MethodType S_O  = new MethodType(Type.String, Type.Reference);
-	MethodType B_O  = new MethodType(Type.Boolean, Type.Reference);
-	MethodType B_V  = new MethodType(Type.Boolean, Type.Void);
-	MethodType B_B  = new MethodType(Type.Boolean, Type.Boolean);
-	MethodType B_S  = new MethodType(Type.Boolean, Type.String);
-	MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);
-	MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);
-	MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);
-	MethodType B_II = new MethodType(Type.Boolean, Type.Int, Type.Int);
-	MethodType S_SS = new MethodType(Type.String, Type.String, Type.String);
-	MethodType S_DS = new MethodType(Type.String, Type.Real, Type.String);
-	MethodType S_SR = new MethodType(Type.String, Type.String, Type.Real);
-
-	MethodType D_SS =
-	    new MethodType(Type.NodeSet, Type.String, Type.String);
-	MethodType D_SD = 
-	    new MethodType(Type.NodeSet, Type.String, Type.NodeSet);
-	MethodType B_BB =
-	    new MethodType(Type.Boolean, Type.Boolean, Type.Boolean);
-	MethodType B_SS =
-	    new MethodType(Type.Boolean, Type.String, Type.String);
-	MethodType S_SD =
-	    new MethodType(Type.String, Type.String, Type.NodeSet);
-	MethodType S_DSS =
-	    new MethodType(Type.String, Type.Real, Type.String, Type.String);
-	MethodType S_SRR =
-	    new MethodType(Type.String, Type.String, Type.Real, Type.Real);
-	MethodType S_SSS =
-	    new MethodType(Type.String, Type.String, Type.String, Type.String);
-
-	/*
-	 * Standard functions: implemented but not in this table concat().
-	 * When adding a new function make sure to uncomment
-	 * the corresponding line in <tt>FunctionAvailableCall</tt>.
-	 */
-
-	// The following functions are inlined
-
-	_symbolTable.addPrimop("current", A_V);
-	_symbolTable.addPrimop("last", I_V);
-	_symbolTable.addPrimop("position", I_V);
-	_symbolTable.addPrimop("true", B_V);
-	_symbolTable.addPrimop("false", B_V);
-	_symbolTable.addPrimop("not", B_B);
-	_symbolTable.addPrimop("name", S_V);
-	_symbolTable.addPrimop("name", S_A);
-	_symbolTable.addPrimop("generate-id", S_V);
-	_symbolTable.addPrimop("generate-id", S_A);
-	_symbolTable.addPrimop("ceiling", R_R);
-	_symbolTable.addPrimop("floor", R_R);
-	_symbolTable.addPrimop("round", I_R);
-	_symbolTable.addPrimop("contains", B_SS);
-	_symbolTable.addPrimop("number", R_O);
-	_symbolTable.addPrimop("number", R_V);
-	_symbolTable.addPrimop("boolean", B_O);
-	_symbolTable.addPrimop("string", S_O);
-	_symbolTable.addPrimop("string", S_V);
-	_symbolTable.addPrimop("translate", S_SSS);
-	_symbolTable.addPrimop("string-length", I_V);
-	_symbolTable.addPrimop("string-length", I_S);
-	_symbolTable.addPrimop("starts-with", B_SS);
-	_symbolTable.addPrimop("format-number", S_DS);
-	_symbolTable.addPrimop("format-number", S_DSS);
-	_symbolTable.addPrimop("unparsed-entity-uri", S_S);
-	_symbolTable.addPrimop("key", D_SS);
-	_symbolTable.addPrimop("key", D_SD);
-	_symbolTable.addPrimop("id", D_S);
-	_symbolTable.addPrimop("id", D_D);
-	_symbolTable.addPrimop("namespace-uri", S_V);
-	_symbolTable.addPrimop("function-available", B_S);
-	_symbolTable.addPrimop("element-available", B_S);
-	_symbolTable.addPrimop("document", D_S);
-	_symbolTable.addPrimop("document", D_V);
-
-	// The following functions are implemented in the basis library
-	_symbolTable.addPrimop("count", I_D);
-	_symbolTable.addPrimop("sum", R_D);
-	_symbolTable.addPrimop("local-name", S_V);
-	_symbolTable.addPrimop("local-name", S_D);
-	_symbolTable.addPrimop("namespace-uri", S_V);
-	_symbolTable.addPrimop("namespace-uri", S_D);
-	_symbolTable.addPrimop("substring", S_SR);
-	_symbolTable.addPrimop("substring", S_SRR);
-	_symbolTable.addPrimop("substring-after", S_SS);
-	_symbolTable.addPrimop("substring-before", S_SS);
-	_symbolTable.addPrimop("normalize-space", S_V);
-	_symbolTable.addPrimop("normalize-space", S_S);
-	_symbolTable.addPrimop("system-property", S_S);
-
-	// Operators +, -, *, /, % defined on real types.
-	_symbolTable.addPrimop("+", R_RR);	
-	_symbolTable.addPrimop("-", R_RR);	
-	_symbolTable.addPrimop("*", R_RR);	
-	_symbolTable.addPrimop("/", R_RR);	
-	_symbolTable.addPrimop("%", R_RR);	
-
-	// Operators +, -, * defined on integer types.
-	// Operators / and % are not  defined on integers (may cause exception)
-	_symbolTable.addPrimop("+", I_II);	
-	_symbolTable.addPrimop("-", I_II);	
-	_symbolTable.addPrimop("*", I_II);	
-
-	 // Operators <, <= >, >= defined on real types.
-	_symbolTable.addPrimop("<",  B_RR);	
-	_symbolTable.addPrimop("<=", B_RR);	
-	_symbolTable.addPrimop(">",  B_RR);	
-	_symbolTable.addPrimop(">=", B_RR);	
-
-	// Operators <, <= >, >= defined on int types.
-	_symbolTable.addPrimop("<",  B_II);	
-	_symbolTable.addPrimop("<=", B_II);	
-	_symbolTable.addPrimop(">",  B_II);	
-	_symbolTable.addPrimop(">=", B_II);	
-
-	// Operators <, <= >, >= defined on boolean types.
-	_symbolTable.addPrimop("<",  B_BB);	
-	_symbolTable.addPrimop("<=", B_BB);	
-	_symbolTable.addPrimop(">",  B_BB);	
-	_symbolTable.addPrimop(">=", B_BB);	
-
-	// Operators 'and' and 'or'.
-	_symbolTable.addPrimop("or", B_BB);	
-	_symbolTable.addPrimop("and", B_BB);	
-
-	// Unary minus.
-	_symbolTable.addPrimop("u-", R_R);	
-	_symbolTable.addPrimop("u-", I_I);	
-    }
-
-    public SymbolTable getSymbolTable() {
-	return _symbolTable;
-    }
-
-    public Template getTemplate() {
-	return _template;
-    }
-
-    public void setTemplate(Template template) {
-	_template = template;
-    }
-
-    private int _templateIndex = 0;
-
-    public int getTemplateIndex() {
-	return(_templateIndex++);
-    }
-
-    /**
-     * Creates a new node in the abstract syntax tree. This node can be
-     *  o) a supported XSLT 1.0 element
-     *  o) an unsupported XSLT element (post 1.0)
-     *  o) a supported XSLT extension
-     *  o) an unsupported XSLT extension
-     *  o) a literal result element (not an XSLT element and not an extension)
-     * Unsupported elements do not directly generate an error. We have to wait
-     * until we have received all child elements of an unsupported element to
-     * see if any <xsl:fallback> elements exist.
-     */
-    public SyntaxTreeNode makeInstance(String uri, String prefix, String local){
-	QName  qname = getQName(uri, prefix, local);
-	String className = (String)_instructionClasses.get(qname);
-	SyntaxTreeNode node = null;
-
-	if (className != null) {
-	    try {
-		final Class clazz = Class.forName(className);
-		node = (SyntaxTreeNode)clazz.newInstance();
-		node.setQName(qname);
-		node.setParser(this);
-		if (node instanceof Stylesheet) {
-		    _xsltc.setStylesheet((Stylesheet)node);
-		}
-	    }
-	    catch (ClassNotFoundException e) {
-		reportError(Constants.ERROR,
-		    new ErrorMsg(CLASS_NOT_FOUND+className));
-	    }
-	    catch (Exception e) {
-		reportError(Constants.ERROR,
-		    new ErrorMsg(INTERNAL_ERROR+e.getMessage()));
-	    }
-	}
-	else {
-	    if (uri != null) {
-		// Check if the element belongs in our namespace
-		if (uri.equals(XSLT_URI)) {
-		    node = new UnsupportedElement(uri, prefix, local);
-		    UnsupportedElement element = (UnsupportedElement)node;
-		    element.setErrorMessage(UNSUPPORTED_XSL_ERROR+local);
-		}
-		// Check if this is an XSLTC extension element
-		else if (uri.equals(TRANSLET_URI)) {
-		    node = new UnsupportedElement(uri, prefix, local);
-		    UnsupportedElement element = (UnsupportedElement)node;
-		    element.setErrorMessage(INVALID_EXT_ERROR+local);
-		}
-		// Check if this is an extension of some other XSLT processor
-		else {
-		    Stylesheet sheet = _xsltc.getStylesheet();
-		    if ((sheet != null) && (sheet.isExtension(uri))) {
-			if (sheet != (SyntaxTreeNode)_parentStack.peek()) {
-			    node = new UnsupportedElement(uri, prefix, local);
-			    UnsupportedElement elem = (UnsupportedElement)node;
-			    elem.setErrorMessage(UNSUPPORTED_EXT_ERROR+
-						 prefix+":"+local);
-			}
-		    }
-		}
-	    }
-	    if (node == null) node = new LiteralElement();
-	}
-	if ((node != null) && (node instanceof LiteralElement)) {
-	    ((LiteralElement)node).setQName(qname);
-	}
-	return(node);
-    }
-
-    /**
-     * Parse an XPath expression:
-     *  @parent - XSL element where the expression occured
-     *  @exp    - textual representation of the expression
-     */
-    public Expression parseExpression(SyntaxTreeNode parent, String exp) {
-	return (Expression)parseTopLevel(parent, "<EXPRESSION>"+exp, 0, null);
-    }
-
-    /**
-     * Parse an XPath expression:
-     *  @parent - XSL element where the expression occured
-     *  @attr   - name of this element's attribute to get expression from
-     *  @def    - default expression (if the attribute was not found)
-     */
-    public Expression parseExpression(SyntaxTreeNode parent,
-				      String attr, String def) {
-	// Get the textual representation of the expression (if any)
-        String exp = parent.getAttribute(attr);
-	// Use the default expression if none was found
-        if ((exp.length() == 0) && (def != null)) exp = def;
-	// Invoke the XPath parser
-        return (Expression)parseTopLevel(parent, "<EXPRESSION>"+exp, 0, exp);
-    }
-
-    /**
-     * Parse an XPath pattern:
-     *  @parent - XSL element where the pattern occured
-     *  @exp    - textual representation of the pattern
-     */
-    public Pattern parsePattern(SyntaxTreeNode parent, String pattern) {
-	return (Pattern)parseTopLevel(parent, "<PATTERN>"+pattern, 0, pattern);
-    }
-
-    /**
-     * Parse an XPath pattern:
-     *  @parent - XSL element where the pattern occured
-     *  @attr   - name of this element's attribute to get pattern from
-     *  @def    - default pattern (if the attribute was not found)
-     */
-    public Pattern parsePattern(SyntaxTreeNode parent,
-				String attr, String def) {
-	// Get the textual representation of the pattern (if any)
-        String pattern = parent.getAttribute(attr);
-	// Use the default pattern if none was found
-	if ((pattern.length() == 0) && (def != null)) pattern = def;
-	// Invoke the XPath parser
-        return (Pattern)parseTopLevel(parent, "<PATTERN>"+pattern, 0, pattern);
-    }
-
-    /**
-     * Parse an XPath expression or pattern using the generated XPathParser
-     * The method will return a Dummy node if the XPath parser fails.
-     */
-    private SyntaxTreeNode parseTopLevel(SyntaxTreeNode parent,
-					 String text, int line,
-					 String expression) {
-	try {
-	    _xpathParser.setScanner(new XPathLexer(new StringReader(text)));
-	    Symbol result = _xpathParser.parse(line);
-	    if (result != null) {
-		final SyntaxTreeNode node = (SyntaxTreeNode)result.value;
-		if (node != null) {
-		    node.setParser(this);
-		    node.setParent(parent);
-		    return node;
-		}
-	    } 
-	    reportError(Constants.ERROR,
-		new ErrorMsg(ErrorMsg.XPATHPAR_ERR, line, expression));
-	}
-	catch (ClassCastException e) {
-	    reportError(Constants.ERROR,
-			new ErrorMsg(ErrorMsg.XPATHPAR_ERR, line, expression));
-	}
-	catch (Exception e) {
-	    if (_xsltc.debug()) {
-		e.printStackTrace();
-	    }
-	    // Intentional fall through
-	}
-	// Return a dummy pattern (which is an expression)
-	SyntaxTreeNode.Dummy.setParser(this);
-        return SyntaxTreeNode.Dummy; 
-    }
-
-    /**
-     * Returns true if there were any errors during compilation
-     */
-    public boolean errorsFound() {
-	return _errors.size() > 0;
-    }
-
-
-    public void internalError() {
-	Exception e = new Exception();
-	e.printStackTrace();
-	reportError(Constants.INTERNAL,
-	    new ErrorMsg("Internal compiler error.\n"+
-                "Please report to xalan-dev@xml.apache.org\n"+
-                "(include stack trace)"));
-    }
-
-    public void notYetImplemented(String message) {
-	reportError(Constants.UNSUPPORTED, new ErrorMsg(message));
-    }
-
-
-    /**
-     * Prints all compile-time errors
-     */
-    public void printErrors() {
-	final int size = _errors.size();
-	if (size > 0) {
-	    System.err.println("Compile errors:");
-	    for (int i = 0; i < size; i++) {
-		System.err.println("  " + _errors.elementAt(i));
-	    }
-	}
-    }
-
-    /**
-     * Prints all compile-time warnings
-     */
-    public void printWarnings() {
-	final int size = _warnings.size();
-	if (size > 0) {
-	    System.err.println("Warning:");
-	    for (int i = 0; i < size; i++) {
-		System.err.println("  " + _warnings.elementAt(i));
-	    }
-	}
-    }
-
-    /**
-     * Common error/warning message handler
-     */
-    public void reportError(final int category, final ErrorMsg error) {
-	switch (category) {
-	case Constants.INTERNAL:
-	    // Unexpected internal errors, such as null-ptr exceptions, etc.
-	    // Immediately terminates compilation, no translet produced
-	    _errors.addElement(error);
-	    break;
-	case Constants.UNSUPPORTED:
-	    // XSLT elements that are not implemented and unsupported ext.
-	    // Immediately terminates compilation, no translet produced
-	    _errors.addElement(error);
-	    break;
-	case Constants.FATAL:
-	    // Fatal error in the stylesheet input (parsing or content)
-	    // Immediately terminates compilation, no translet produced
-	    _errors.addElement(error);
-	    break;
-	case Constants.ERROR:
-	    // Other error in the stylesheet input (parsing or content)
-	    // Does not terminate compilation, no translet produced
-	    _errors.addElement(error);
-	    break;
-	case Constants.WARNING:
-	    // Other error in the stylesheet input (content errors only)
-	    // Does not terminate compilation, a translet is produced
-	    _warnings.addElement(error);
-	    break;
-	}
-    }
-
-    public Vector getErrors() {
-	return _errors;
-    }
-
-    public Vector getWarnings() {
-	return _warnings;
-    }
-
-    /************************ SAX2 ContentHandler INTERFACE *****************/
-
-    private Stack _parentStack = null;
-    private Hashtable _prefixMapping = null;
-
-    /**
-     * SAX2: Receive notification of the beginning of a document.
-     */
-    public void startDocument() {
-	_root = null;
-	_target = null;
-	_prefixMapping = null;
-	_parentStack = new Stack();
-    }
-
-    /**
-     * SAX2: Receive notification of the end of a document.
-     */
-    public void endDocument() { }
-
-
-    /**
-     * SAX2: Begin the scope of a prefix-URI Namespace mapping.
-     *       This has to be passed on to the symbol table!
-     */
-    public void startPrefixMapping(String prefix, String uri) {
-	if (_prefixMapping == null) _prefixMapping = new Hashtable();
-	_prefixMapping.put(prefix, uri);
-    }
-
-    /**
-     * SAX2: End the scope of a prefix-URI Namespace mapping.
-     *       This has to be passed on to the symbol table!
-     */
-    public void endPrefixMapping(String prefix) { }
-
-    /**
-     * SAX2: Receive notification of the beginning of an element.
-     *       The parser may re-use the attribute list that we're passed so
-     *       we clone the attributes in our own Attributes implementation
-     */
-    public void startElement(String uri, String localname,
-			     String qname, Attributes attributes) 
-	throws SAXException {
-	final int col = qname.lastIndexOf(':');
-	final String prefix;
-	if (col == -1)
-	    prefix = null;
-	else
-	    prefix = qname.substring(0, col);
-
-	SyntaxTreeNode element = makeInstance(uri, prefix, localname);
-	if (element == null) {
-	    throw new SAXException("Error while parsing stylesheet.");
-	}
-
-	// If this is the root element of the XML document we need to make sure
-	// that it contains a definition of the XSL namespace URI
-	if (_root == null) {
-	    if ((_prefixMapping == null) ||
-		(_prefixMapping.containsValue(Constants.XSLT_URI) == false))
-		_rootNamespaceDef = false;
-	    else
-		_rootNamespaceDef = true;
-	    _root = element;
-	}
-	else {
-	    SyntaxTreeNode parent = (SyntaxTreeNode)_parentStack.peek();
-	    parent.addElement(element);
-	    element.setParent(parent);
-	}
-	element.setAttributes((Attributes)new AttributeList(attributes));
-	element.setPrefixMapping(_prefixMapping);
-	
-	if (element instanceof Stylesheet) {
-	    // Extension elements and excluded elements have to be
-	    // handled at this point in order to correctly generate
-	    // Fallback elements from <xsl:fallback>s.
-	    getSymbolTable().setCurrentNode(element);
-	    ((Stylesheet)element).excludeExtensionPrefixes(this);
-	}
-
-	_prefixMapping = null;
-	_parentStack.push(element);
-    }
-
-    /**
-     * SAX2: Receive notification of the end of an element.
-     */
-    public void endElement(String uri, String localname, String qname) {
-	_parentStack.pop();
-    }
-
-    /**
-     * SAX2: Receive notification of character data.
-     */
-    public void characters(char[] ch, int start, int length) {
-	String string = new String(ch, start, length);
-	SyntaxTreeNode parent = (SyntaxTreeNode)_parentStack.peek();
-
-	// If this text occurs within an <xsl:text> element we append it
-	// as-is to the existing text element
-	if (parent instanceof Text) {
-	    if (string.length() > 0) {
-		((Text)parent).setText(string);
-	    }
-	}
-	// Ignore text nodes that occur directly under <xsl:stylesheet>
-	else if (parent instanceof Stylesheet) {
-
-	}
-	// Add it as a regular text node otherwise
-	else {
-	    if (string.trim().length() > 0) {
-		parent.addElement(new Text(string));
-	    }
-	}
-    }
-
-    private String getTokenValue(String token) {
-	final int start = token.indexOf('"');
-	final int stop = token.lastIndexOf('"');
-	return token.substring(start+1, stop);
-    }
-
-    /**
-     * SAX2: Receive notification of a processing instruction.
-     *       These require special handling for stylesheet PIs.
-     */
-    public void processingInstruction(String name, String value) {
-	// We only handle the <?xml-stylesheet ...?> PI
-	if ((_target == null) && (name.equals("xml-stylesheet"))) {
-
-	    String href = null;    // URI of stylesheet found
-	    String media = null;   // Media of stylesheet found
-	    String title = null;   // Title of stylesheet found
-	    String charset = null; // Charset of stylesheet found
-
-	    // Get the attributes from the processing instruction
-	    StringTokenizer tokens = new StringTokenizer(value);
-	    while (tokens.hasMoreElements()) {
-		String token = (String)tokens.nextElement();
-		if (token.startsWith("href"))
-		    href = getTokenValue(token);
-		else if (token.startsWith("media"))
-		    media = getTokenValue(token);
-		else if (token.startsWith("title"))
-		    title = getTokenValue(token);
-		else if (token.startsWith("charset"))
-		    charset = getTokenValue(token);
-	    }
-
-	    // Set the target to this PI's href if the parameters are
-	    // null or match the corresponding attributes of this PI.
-	    if ( ((_PImedia == null) || (_PImedia.equals(media))) &&
-		 ((_PItitle == null) || (_PImedia.equals(title))) &&
-		 ((_PIcharset == null) || (_PImedia.equals(charset))) ) {
-		_target = href;
-	    }
-	}
-    }
-
-    /**
-     * IGNORED - all ignorable whitespace is ignored
-     */
-    public void ignorableWhitespace(char[] ch, int start, int length) { }
-
-    /**
-     * IGNORED - we do not have to do anything with skipped entities
-     */
-    public void skippedEntity(String name) { }
-
-    /**
-     * IGNORED - we already know what the origin of the document is
-     */
-    public void setDocumentLocator(Locator locator) { }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Pattern.java b/src/org/apache/xalan/xsltc/compiler/Pattern.java
deleted file mode 100644
index 0121ae7..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Pattern.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-public abstract class Pattern extends Expression {
-    /**
-     * Returns the type of a pattern, which is always a <code>NodeType</code>.
-     * A <code>NodeType</code> has a number of subtypes defined by 
-     * <code>NodeType._type</code> corresponding to each type of node.
-     */
-    public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError;
-
-    /**
-     * Translate this node into JVM bytecodes. Patterns are translated as
-     * boolean expressions with true/false lists. Before calling 
-     * <code>translate</code> on a pattern, make sure that the node being 
-     * matched is on top of the stack. After calling <code>translate</code>, 
-     * make sure to backpatch both true and false lists. True lists are the 
-     * default, in the sense that they always <em>"fall through"</em>. If this
-     * is not the intended semantics (e.g., see 
-     * {@link org.apache.xalan.xsltc.compiler.AlternativePattern#translate()})
-     * then a GOTO must be appended to the instruction list after calling
-     * <code>translate</code>. 
-     */
-    public abstract void translate(ClassGenerator classGen,
-				   MethodGenerator methodGen);
-
-    /**
-     * Returns the priority of this pattern (section 5.5 in the XSLT spec).
-     */
-    public abstract double getPriority();
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/PositionCall.java b/src/org/apache/xalan/xsltc/compiler/PositionCall.java
deleted file mode 100644
index 0b1335b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/PositionCall.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class PositionCall extends FunctionCall {
-
-    private int _type = -1;
-
-    public PositionCall(QName fname) {
-	super(fname);
-    }
-
-    public PositionCall(QName fname, int type) {
-	this(fname);
-	_type = type;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final InstructionList il = methodGen.getInstructionList();
-
-	// If we're a part of an expression's preficate we want to know what
-	// type of node we want to be looking for
-	if (getParent() instanceof Expression) {
-	    if (getParent().getParent() instanceof Predicate) {
-		Predicate pred = (Predicate)getParent().getParent();
-		_type = pred.getPosType();
-	    }
-	}
-
-
-	if (methodGen instanceof CompareGenerator) {
-	    il.append(((CompareGenerator)methodGen).loadCurrentNode());
-	}
-	else if (methodGen instanceof TestGenerator) {
-	    il.append(new ILOAD(POSITION_INDEX));
-	}
-	else if (_type == -1) {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final int getPosition = cpg.addInterfaceMethodref(NODE_ITERATOR,
-							      "getPosition", 
-							      "()I");
-	    il.append(methodGen.loadIterator());
-	    il.append(new INVOKEINTERFACE(getPosition, 1));
-	}
-	else {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    // public int getTypedPosition(NodeIterator iterator, int type) {
-	    final String params = "("+NODE_ITERATOR_SIG+"II)I";
-	    final int pos = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getTypedPosition",
-						      params);
-	    il.append(methodGen.loadDOM());
-	    il.append(methodGen.loadIterator());
-	    il.append(new PUSH(cpg, _type));
-	    il.append(methodGen.loadCurrentNode());
-	    il.append(new INVOKEINTERFACE(pos, 4));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Predicate.java b/src/org/apache/xalan/xsltc/compiler/Predicate.java
deleted file mode 100644
index 247aed1..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Predicate.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import de.fub.bytecode.classfile.JavaClass;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Predicate extends Expression {
-
-    private Expression _exp = null; // Expression to be compiled inside pred.
-    private String  _className;     // Name of filter to generate
-    private boolean _nthPositionFilter = false;
-    private boolean _nthDescendant = false;
-    private int     _ptype = -1;
-
-    public Predicate(Expression exp) {
-	(_exp = exp).setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_exp.setParser(parser);
-    }
-
-    public boolean isNthDescendant() {
-	return _nthDescendant;
-    }
-
-    public boolean isNthPositionFilter() {
-	return _nthPositionFilter;
-    }
-    
-    protected final boolean isClosureBoundary() {
-	return true;
-    }
-    
-    public int getPosType() {
-	if (_ptype == -1) {
-	    SyntaxTreeNode parent = getParent();
-	    if (parent instanceof StepPattern) {
-		_ptype = ((StepPattern)parent).getNodeType();
-	    }
-	    else if (parent instanceof AbsoluteLocationPath) {
-		AbsoluteLocationPath path = (AbsoluteLocationPath)parent;
-		Expression exp = path.getPath();
-		if (exp instanceof Step) {
-		    _ptype = ((Step)exp).getNodeType();
-		}
-	    }
-	    else if (parent instanceof VariableRefBase) {
-		final VariableRefBase ref = (VariableRefBase)parent;
-		final VariableBase var = ref.getVariable();
-		final Expression exp = var.getExpression();
-		if (exp instanceof Step) {
-		    _ptype = ((Step)exp).getNodeType();
-		}
-	    }
-	    else if (parent instanceof Step) {
-		_ptype = ((Step)parent).getNodeType();
-	    }
-	}
-	return _ptype;
-    }
-
-    public boolean parentIsPattern() {
-	return (getParent() instanceof Pattern);
-    }
-
-    public Expression getExpr() {
-	return _exp;
-    }
-
-    public String toString() {
-	if (isNthPositionFilter())
-	    return "pred([" + _exp + "],"+getPosType()+")";
-	else
-	    return "pred(" + _exp + ')';
-    }
-	
-    /**
-     * Type check a predicate expression. If the type of the expression is 
-     * number convert it to boolean by adding a comparison with position().
-     * Note that if the expression is a parameter, we cannot distinguish
-     * at compile time if its type is number or not. Hence, expressions of 
-     * reference type are always converted to booleans.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-	Type texp = _exp.typeCheck(stable);
-
-	// We need explicit type information for reference types - no good!
-	if (texp instanceof ReferenceType) {
-	    throw new TypeCheckError(this);
-	}
-
-	// A result tree fragment should not be cast directly to a number type,
-	// but rather to a boolean value, and then to a numer (0 or 1).
-	// Ref. section 11.2 of the XSLT 1.0 spec
-	if (texp instanceof ResultTreeType) {
-	    _exp = new CastExpr(_exp, Type.Boolean);
-	    _exp = new CastExpr(_exp, Type.Real);
-	    texp = _exp.typeCheck(stable);
-	}
-
-	// Numerical types will be converted to a position filter
-	if (texp instanceof NumberType) {
-
-	    // Cast any numerical types to an integer
-	    if (texp instanceof IntType == false) {
-		_exp = new CastExpr(_exp, Type.Int);
-	    }
-
-	    // Expand [last()] into [position() = last()]
-	    if ((_exp instanceof LastCall) ||
-		(getParent() instanceof Pattern) ||
-		(getParent() instanceof FilterExpr)) {
-		final QName position = getParser().getQName("position");
-		final PositionCall positionCall;
-		positionCall = new PositionCall(position, -1);
-		positionCall.setParser(getParser());
-		positionCall.setParent(this);
-		_exp = new EqualityExpr(EqualityExpr.EQ, positionCall, _exp);
-
-		if (_exp.typeCheck(stable) != Type.Boolean) {
-		    _exp = new CastExpr(_exp, Type.Boolean);
-		}
-		_nthPositionFilter = false;
-		return _type = Type.Boolean;
-	    }
-	    // Use NthPositionIterator to handle [position()] or [a]
-	    else {
-		SyntaxTreeNode parent = getParent();
-		if ((parent != null) && (parent instanceof Step)) {
-		    parent = parent.getParent();
-		    if ((parent != null) &&
-			(parent instanceof AbsoluteLocationPath)) {
-			// TODO: Special case for "//*[n]" pattern....
-			_nthDescendant = true;
-			return _type = Type.NodeSet;
-		    }
-		}
-		_nthPositionFilter = true;
-		return _type = Type.NodeSet;
-	    }
-	}
-	// All other types will be handled as boolean values
-	else if (texp instanceof BooleanType == false) {
-	    _exp = new CastExpr(_exp, Type.Boolean);
-	}
-
-	_nthPositionFilter = false;
-	return _type = Type.Boolean;
-    }
-	
-    /**
-     * Create a new "Filter" class implementing
-     * <code>CurrentNodeListFilter</code>. Allocate registers for local 
-     * variables and local parameters passed in the closure to test().
-     * Notice that local variables need to be "unboxed".
-     */
-    private void compileFilter(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	TestGenerator testGen;
-	LocalVariableGen local;
-	FilterGenerator filterGen;
-
-	_className = getXSLTC().getHelperClassName();
-	filterGen = new FilterGenerator(_className,
-					"java.lang.Object",
-					toString(), 
-					ACC_PUBLIC | ACC_SUPER,
-					new String[] {
-					    CURRENT_NODE_LIST_FILTER
-					},
-					classGen.getStylesheet());	
-
-	final InstructionList il = new InstructionList();
-	final ConstantPoolGen cpg = filterGen.getConstantPool();
-
-	testGen = new TestGenerator(ACC_PUBLIC | ACC_FINAL,
-				    de.fub.bytecode.generic.Type.BOOLEAN, 
-				    new de.fub.bytecode.generic.Type[] {
-					de.fub.bytecode.generic.Type.INT,
-					de.fub.bytecode.generic.Type.INT,
-					de.fub.bytecode.generic.Type.INT,
-					de.fub.bytecode.generic.Type.INT,
-					Util.getJCRefType(TRANSLET_SIG),
-					Util.getJCRefType(NODE_ITERATOR_SIG)
-				    },
-				    new String[] {
-					"node",
-					"position",
-					"last",
-					"current",
-					"translet",
-					"iterator"
-				    },
-				    "test", _className, il, cpg);
-		
-	// Store the dom in a local variable
-	local = testGen.addLocalVariable("document",
-					 Util.getJCRefType(DOM_INTF_SIG),
-					 null, null);
-	final String className = classGen.getClassName();
-	il.append(filterGen.loadTranslet());
-	il.append(new CHECKCAST(cpg.addClass(className)));
-	il.append(new GETFIELD(cpg.addFieldref(className,
-					       DOM_FIELD, DOM_INTF_SIG)));
-	il.append(new ASTORE(local.getIndex()));
-
-	// Store the dom index in the test generator
-	testGen.setDomIndex(local.getIndex());
-
-	_exp.translate(filterGen, testGen);
-	il.append(IRETURN);
-	
-	testGen.stripAttributes(true);
-	testGen.setMaxLocals();
-	testGen.setMaxStack();
-	testGen.removeNOPs();
-
-	filterGen.addEmptyConstructor(ACC_PUBLIC);
-	filterGen.addMethod(testGen.getMethod());
-		
-	getXSLTC().dumpClass(filterGen.getJavaClass());
-    }
-
-    /**
-     * Returns true if the predicate is a test for the existance of an
-     * element or attribute. All we have to do is to get the first node
-     * from the step, check if it is there, and then return true/false.
-     */
-    public boolean isBooleanTest() {
-	return (_exp instanceof BooleanExpr);
-    }
-
-    /**
-     * Method to see if we can optimise the predicate by using a specialised
-     * iterator for expressions like '/foo/bar[@attr = $var]', which are
-     * very common in many stylesheets
-     */
-    public boolean isNodeValueTest() {
-	if ((getStep() != null) && (getCompareValue() != null))
-	    return true;
-	else
-	    return false;
-    }
-
-    private Expression _value = null;
-    private Step _step = null;
-
-    /**
-     * Utility method for optimisation. See isNodeValueTest()
-     */
-    public Expression getCompareValue() {
-	if (_value != null) return _value;
-	if (_exp == null) return null;
-
-	if (_exp instanceof EqualityExpr) {
-	    EqualityExpr exp = (EqualityExpr)_exp;
-	    Expression left = exp.getLeft();
-	    Expression right = exp.getRight();
-
-	    Type tleft = left.getType();
-	    Type tright = right.getType();
-
-	    
-	    if (left instanceof CastExpr) left = ((CastExpr)left).getExpr();
-	    if (right instanceof CastExpr) right = ((CastExpr)right).getExpr();
-	    
-	    try {
-		if ((tleft == Type.String) && (!(left instanceof Step)))
-		    _value = exp.getLeft();
-		if (left instanceof VariableRefBase) 
-		    _value = new CastExpr(left, Type.String);
-		if (_value != null) return _value;
-	    }
-	    catch (TypeCheckError e) { }
-
-	    try {
-		if ((tright == Type.String) && (!(right instanceof Step)))
-		    _value = exp.getRight();
-		if (right instanceof VariableRefBase)
-		    _value = new CastExpr(right, Type.String);
-		if (_value != null) return _value;
-	    }
-	    catch (TypeCheckError e) { }
-
-	}
-	return null;
-    }
-
-    /**
-     * Utility method for optimisation. See isNodeValueTest()
-     */
-    public Step getStep() {
-	if (_step != null) return _step;
-	if (_exp == null) return null;
-
-	if (_exp instanceof EqualityExpr) {
-	    EqualityExpr exp = (EqualityExpr)_exp;
-	    Expression left = exp.getLeft();
-	    Expression right = exp.getRight();
-
-	    if (left instanceof CastExpr) left = ((CastExpr)left).getExpr();
-	    if (left instanceof Step) _step = (Step)left;
-	    
-	    if (right instanceof CastExpr) right = ((CastExpr)right).getExpr();
-	    if (right instanceof Step) _step = (Step)right;
-	}
-	//if ((_step != null) && (_step.isAbbreviatedDot())) _step = null;
-	return _step;
-    }
-
-    /**
-     * Translate a predicate expression. This translation pushes
-     * two references on the stack: a reference to a newly created
-     * filter object and a reference to the predicate's closure.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_nthPositionFilter || _nthDescendant) {
-	    _exp.translate(classGen, methodGen);
-	}
-	else if (isNodeValueTest() && (getParent() instanceof Step)) {
-	    _value.translate(classGen, methodGen);
-	    il.append(new PUSH(cpg, ((EqualityExpr)_exp).getOp()));
-	}
-	else {
-	    compileFilter(classGen, methodGen);
-	    il.append(new NEW(cpg.addClass(_className)));
-	    il.append(DUP);
-	    il.append(new INVOKESPECIAL(cpg.addMethodref(_className,
-							 "<init>", "()V")));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java b/src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java
deleted file mode 100644
index 93561ae..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ProcessingInstruction extends Instruction {
-
-    private AttributeValue _name; // name treated as AVT (7.1.3)
-    
-    public void parseContents(Parser parser) {
-	final String name  = getAttribute("name");
-	_name = AttributeValue.create(this, name, parser);
-	if (name.equals("xml")) {
-	    reportError(this, parser, ErrorMsg.ILLEG_PI_ERR, "xml");
-	}
-	parseChildren(parser);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_name.typeCheck(stable);
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Save the current handler base on the stack
-	il.append(methodGen.loadHandler());
-	il.append(DUP);		// first arg to "attributes" call
-	
-	// push attribute name
-	_name.translate(classGen, methodGen);// 2nd arg
-
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       "stringValueHandler",
-					       STRING_VALUE_HANDLER_SIG)));
-	il.append(DUP);
-	il.append(methodGen.storeHandler());
-
-	// translate contents with substituted handler
-	translateContents(classGen, methodGen);
-
-	// get String out of the handler
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
-						     "getValue",
-						     "()" + STRING_SIG)));
-	// call "processingInstruction"
-	final int processingInstruction =
-	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-				      "processingInstruction", 
-				      "("
-				      + STRING_SIG
-				      + STRING_SIG
-				      + ")V");
-	il.append(new INVOKEINTERFACE(processingInstruction, 3));
-	// Restore old handler base from stack
-	il.append(methodGen.storeHandler());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/QName.java b/src/org/apache/xalan/xsltc/compiler/QName.java
deleted file mode 100644
index 6eace10..0000000
--- a/src/org/apache/xalan/xsltc/compiler/QName.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-final class QName {
-    private final String _localname;
-    private String _prefix;
-    private String _namespace;
-    private String _stringRep;
-    private int    _hashCode;
-
-    public QName(String namespace, String prefix, String localname) {
-	_namespace = namespace;
-	_prefix    = prefix;
-	_localname = localname;
-	if ((namespace != null) && (!namespace.equals(Constants.EMPTYSTRING))) {
-	    _stringRep = namespace+':'+localname;
-	}
-	else {
-	    _stringRep = localname;
-	}
-
-	_hashCode  = _stringRep.hashCode() + 19; // cached for speed
-    }
-
-    public void clearDefaultNamespace() {
-	if ((_prefix == null) || (_prefix.equals(Constants.EMPTYSTRING))) {
-	    _namespace = null;
-	    _stringRep = _localname;
-	    _hashCode  = _stringRep.hashCode() + 19; // cached for speed
-	}
-    }
-
-    public void clearNamespace() {
-	_namespace = Constants.EMPTYSTRING;
-    }
-
-    public String toString() {
-	return _stringRep;
-    }
-
-    public String getStringRep() {
-	return _stringRep;
-    }
-
-    public boolean equals(Object other) {
-	return this == other;
-    }
-
-    public String getLocalPart() {
-	return _localname;
-    }
-
-    public String getNamespace() {
-	return _namespace;
-    }
-
-    public String getPrefix() {
-	return _prefix;
-    }
-
-    public int hashCode() {
-	return _hashCode;
-    }
-
-    public String dump() {
-	return(new String("QName: "+_namespace+"("+_prefix+"):"+_localname));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/RealExpr.java b/src/org/apache/xalan/xsltc/compiler/RealExpr.java
deleted file mode 100644
index 8f1de00..0000000
--- a/src/org/apache/xalan/xsltc/compiler/RealExpr.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class RealExpr extends Expression {
-    private double _value;
-
-    public RealExpr(double value) {
-	_value = value;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return _type = Type.Real;
-    }
-
-    public String toString() {
-	return "real-expr(" + _value + ')';
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-	il.append(new PUSH(cpg, _value));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/RelationalExpr.java b/src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
deleted file mode 100644
index 451d7dd..0000000
--- a/src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import org.apache.xalan.xsltc.runtime.Operators;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class RelationalExpr extends Expression implements Operators {
-    private int _op;
-    private Expression _left, _right;
-		
-    public RelationalExpr(int op, Expression left, Expression right) {
-	_op = op;
-	(_left = left).setParent(this);
-	(_right = right).setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-	_right.setParser(parser);
-    }
-    
-    public boolean hasReferenceArgs() {
-	return _left.getType() instanceof ReferenceType ||
-	    _right.getType() instanceof ReferenceType;
-    }
-
-    public boolean hasNodeArgs() {
-	return _left.getType() instanceof NodeType ||
-	    _right.getType() instanceof NodeType;
-    }
-
-    public boolean hasNodeSetArgs() {
-	return _left.getType() instanceof NodeSetType ||
-	    _right.getType() instanceof NodeSetType;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	Type tleft = _left.typeCheck(stable); 
-	Type tright = _right.typeCheck(stable);
-
-	//bug fix # 2838, cast to reals if both are result tree fragments
-	if (tleft instanceof ResultTreeType &&
-	    tright instanceof ResultTreeType ) {
-	    _right = new CastExpr(_right, Type.Real);
-	    _left = new CastExpr(_left, Type.Real);
-	}
-
-	// If one is of reference type, then convert the other too
-	if (hasReferenceArgs()) {
-	    if (tleft instanceof ReferenceType) {
-		_right = new CastExpr(_right, Type.Reference);
-	    }
-	    if (tright instanceof ReferenceType) {
-		_left = new CastExpr(_left, Type.Reference);
-	    }
-	    return _type = Type.Boolean;
-	}
-
-	if (hasNodeSetArgs()) {
-	    // Ensure that the node-set is the left argument
-	    if (tright instanceof NodeSetType) {
-		final Expression temp = _right; _right = _left; _left = temp;
-		_op = (_op == Operators.GT) ? Operators.LT :
-		    (_op == Operators.LT) ? Operators.GT :
-		    (_op == Operators.GE) ? Operators.LE : Operators.GE;
-		tright = _right.getType();
-	    }
-
-	    // Promote nodes to node sets
-	    if (tright instanceof NodeType) {
-		_right = new CastExpr(_right, Type.NodeSet);
-	    }
-
-	    // Promote integer to doubles to have fewer compares
-	    if (tright instanceof IntType) {
-		_right = new CastExpr(_right, Type.Real);
-	    }
-	    return _type = Type.Boolean;
-	}
-
-	// In the node-boolean case, convert node to boolean first
-	if (hasNodeArgs()) {
-	    if (tleft instanceof BooleanType) {
-		_right = new CastExpr(_right, Type.Boolean);
-		tright = Type.Boolean;
-	    }
-	    if (tright instanceof BooleanType) {
-		_left = new CastExpr(_left, Type.Boolean);
-		tleft = Type.Boolean;
-	    }
-	}
-
-	// Lookup the table of primops to find the best match
-	MethodType ptype = lookupPrimop(stable, Operators.names[_op],
-					new MethodType(Type.Void, 
-						       tleft, tright)); 
-
-	if (ptype != null) {
-	    Type arg1 = (Type) ptype.argsType().elementAt(0);
-	    if (!arg1.identicalTo(tleft)) {
-		_left = new CastExpr(_left, arg1);
-	    }
-	    Type arg2 = (Type) ptype.argsType().elementAt(1);
-	    if (!arg2.identicalTo(tright)) {
-		_right = new CastExpr(_right, arg1);				
-	    }
-	    return _type = ptype.resultType();
-	}
-	throw new TypeCheckError(this);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	if (hasNodeSetArgs() || hasReferenceArgs()) {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final InstructionList il = methodGen.getInstructionList();
-
-	    // Call compare() from the BasisLibrary
-	    _left.translate(classGen, methodGen);
-	    _left.startResetIterator(classGen, methodGen);
-	    _right.translate(classGen, methodGen);
-	    _right.startResetIterator(classGen, methodGen);
-
-	    il.append(new PUSH(cpg, _op));
-	    il.append(methodGen.loadContextNode());
-	    il.append(methodGen.loadDOM());
-
-	    int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "compare",
-					 "("
-					 + _left.getType().toSignature() 
-					 + _right.getType().toSignature()
-					 + "I"
-					 + NODE_SIG
-					 + DOM_INTF_SIG
-					 + ")Z");
-	    il.append(new INVOKESTATIC(index));
-	}
-	else {
-	    translateDesynthesized(classGen, methodGen);
-	    synthesize(classGen, methodGen);
-	}
-    }
-
-    public void translateDesynthesized(ClassGenerator classGen,
-				       MethodGenerator methodGen) {
-	if (hasNodeSetArgs() || hasReferenceArgs()) {
-	    translate(classGen, methodGen);
-	    desynthesize(classGen, methodGen);
-	}
-	else {
-	    BranchInstruction bi = null;
-	    final InstructionList il = methodGen.getInstructionList();
-
-	    _left.translate(classGen, methodGen);
-	    _right.translate(classGen, methodGen);
-
-	    // TODO: optimize if one of the args is 0
-
-	    boolean tozero = false;
-	    Type tleft = _left.getType(); 
-
-	    if (tleft instanceof RealType) {
-		il.append(tleft.CMP(_op == LT || _op == LE));
-		tleft = Type.Int;
-		tozero = true;
-	    }
-
-	    switch (_op) {
-	    case LT:
-		bi = tleft.GE(tozero);	
-		break;
-		
-	    case GT:
-		bi = tleft.LE(tozero);
-		break;
-		
-	    case LE:
-		bi = tleft.GT(tozero);
-		break;
-		
-	    case GE:
-		bi = tleft.LT(tozero);
-		break;
-		
-	    default:
-		final ErrorMsg msg = 
-		    new ErrorMsg("Unknown operator for relational expression");
-		getParser().reportError(Constants.FATAL, msg);
-	    }
-
-	    _falseList.add(il.append(bi));		// must be backpatched
-	}
-    }
-
-    public String toString() {
-	return Operators.names[_op] + '(' + _left + ", " + _right + ')';
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/RelativeLocationPath.java b/src/org/apache/xalan/xsltc/compiler/RelativeLocationPath.java
deleted file mode 100644
index 787fa1c..0000000
--- a/src/org/apache/xalan/xsltc/compiler/RelativeLocationPath.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-abstract class RelativeLocationPath extends Expression {
-    public abstract void setAxis(int axis);
-    public abstract boolean descendantAxis();
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/RelativePathPattern.java b/src/org/apache/xalan/xsltc/compiler/RelativePathPattern.java
deleted file mode 100644
index a548e08..0000000
--- a/src/org/apache/xalan/xsltc/compiler/RelativePathPattern.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-abstract class RelativePathPattern extends LocationPathPattern {}
diff --git a/src/org/apache/xalan/xsltc/compiler/RoundCall.java b/src/org/apache/xalan/xsltc/compiler/RoundCall.java
deleted file mode 100644
index cfcd472..0000000
--- a/src/org/apache/xalan/xsltc/compiler/RoundCall.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class RoundCall extends FunctionCall {
-    public RoundCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	argument().translate(classGen, methodGen);
-	il.append(new INVOKESTATIC(cpg.addMethodref(MATH_CLASS,
-						    "round", "(D)J")));
-	il.append(L2I);		// no long type :-(
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java b/src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java
deleted file mode 100644
index c962fd2..0000000
--- a/src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.*;
-import de.fub.bytecode.generic.*;
-
-final class SimpleAttributeValue extends AttributeValue {
-    private String _value;
-		
-    public SimpleAttributeValue(String value) {
-	_value = value;
-    }
-		
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return _type = Type.String;
-    }
-    
-    public String toString() {
-	return _value;
-    }
-	
-    public boolean contextDependent() {
-	return false;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new PUSH(cpg, _value));
-	display(0);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Sort.java b/src/org/apache/xalan/xsltc/compiler/Sort.java
deleted file mode 100644
index 3ca53bb..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Sort.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.StringTokenizer;
-import java.util.NoSuchElementException;
-import java.text.Collator;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-
-import de.fub.bytecode.classfile.JavaClass;
-import de.fub.bytecode.classfile.Field;
-import de.fub.bytecode.classfile.Method;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.Constants;
-
-import org.apache.xalan.xsltc.dom.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-
-final class Sort extends Instruction {
-
-    private Expression     _select;
-    private AttributeValue _order;
-    private AttributeValue _caseOrder;
-    private AttributeValue _dataType;
-
-    public  String         _lang;
-    public  String         _country;
-
-    private final static String EMPTYSTRING = 
-	org.apache.xalan.xsltc.compiler.Constants.EMPTYSTRING;
-
-    /**
-     * Parse the attributes of the xsl:sort element
-     */
-    public void parseContents(Parser parser) {
-	// Parse the select expression (node string value if no expression)
-	_select = parser.parseExpression(this, "select", "string(.)");
-
-	// Get the sort order; default is 'ascending'
-	String val = getAttribute("order");
-	_order = AttributeValue
-	    .create(this, val.length() > 0 ? val : "ascending", parser);
-
-	// Get the case order; default is language dependant
-	val = getAttribute("case-order");
-	_caseOrder = AttributeValue
-	    .create(this, val.length() > 0 ? val : "upper-first", parser);
-
-	// Get the sort data type; default is text
-	val = getAttribute("data-type");
-	_dataType = AttributeValue
-	    .create(this, val.length() > 0 ? val : "text", parser);
-
-	// Get the language whose sort rules we will use; default is env.dep.
-	if ((val = getAttribute("lang")) != null) {
-	    try {
-		StringTokenizer st = new StringTokenizer(val,"-",false);
-		_lang = st.nextToken();
-		_country = st.nextToken();
-	    }
-	    catch (NoSuchElementException e) { // ignore
-	    }
-	}
-    }
-    
-    /**
-     * Run type checks on the attributes; expression must return a string
-     * which we will use as a sort key
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type tselect = _select.typeCheck(stable);
-	if (tselect instanceof StringType == false) {
-	    _select = new CastExpr(_select, Type.String);
-	}
-	_order.typeCheck(stable);
-	_caseOrder.typeCheck(stable);
-	_dataType.typeCheck(stable);
-	return Type.Void;
-    }
-
-    /**
-     * These two methods are needed in the static methods that compile the
-     * overloaded NodeSortRecord.compareType() and NodeSortRecord.sortOrder()
-     */
-    public String getSortType() {
-	return _dataType.toString();
-    }
-    
-    public String getSortOrder() {
-	return _order.toString();
-    }
-    
-    /**
-     * This method compiles code for the select expression for this
-     * xsl:sort element. The method is called from the static code-generating
-     * methods in this class.
-     */
-    public void translateSelect(ClassGenerator classGen,
-				MethodGenerator methodGen) {
-	_select.translate(classGen,methodGen);
-    }
-
-    /**
-     * This method should not produce any code
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	// empty
-    }
-
-    /**
-     * Compiles code that instantiates a SortingIterator object.
-     * This object's constructor needs referencdes to the current iterator
-     * and a node sort record producing objects as its parameters.
-     */
-    public static void translateSortIterator(ClassGenerator classGen,
-					     MethodGenerator methodGen,
-					     Expression nodeSet,
-					     Vector sortObjects) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// SortingIterator.SortingIterator(NodeIterator,NodeSortRecordFactory);
-	final int init = cpg.addMethodref(SORT_ITERATOR, "<init>",
-					  "("
-					  + NODE_ITERATOR_SIG
-					  + NODE_SORT_FACTORY_SIG
-					  + ")V");	
-
-	final int setStartNode = cpg.addInterfaceMethodref(NODE_ITERATOR,
-							   SET_START_NODE,
-							   "(I)"+
-							   NODE_ITERATOR_SIG);
-	
-	il.append(new NEW(cpg.addClass(SORT_ITERATOR)));
-	il.append(DUP);
-
-	// Get the current node iterator
-	if (nodeSet == null) {	// apply-templates default
-	    Mode.compileGetChildren(classGen, methodGen,
-				    methodGen.getLocalIndex("current"));
-	}
-	else {
-	    nodeSet.translate(classGen, methodGen);
-	    il.append(new PUSH(cpg,methodGen.getLocalIndex("current")));
-	    il.append(new INVOKEINTERFACE(setStartNode,2));
-	}
-	
-	// Compile the code for the NodeSortRecord producing class and pass
-	// that as the last argument to the SortingIterator constructor.
-	compileSortRecordFactory(sortObjects, classGen, methodGen);
-	il.append(new INVOKESPECIAL(init));
-    }
-
-
-    /**
-     * Compiles code that instantiates a NodeSortRecordFactory object which
-     * will produce NodeSortRecord objects of a specific type.
-     */
-    public static void compileSortRecordFactory(Vector sortObjects,
-						ClassGenerator classGen,
-						MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	
-	// NodeSortRecordFactory.NodeSortRecordFactory(dom,class,levels,trlet);
-	final String initParams =
-	    "("+DOM_INTF_SIG+STRING_SIG+ TRANSLET_INTF_SIG+")V";
-	final int init = cpg.addMethodref(NODE_SORT_FACTORY,
-					  "<init>", initParams);
-
-	// Compile the object that will encapsulate each sort object (node).
-	// NodeSortRecordFactory needs the name of the new class.
-	String className = compileSortRecord(sortObjects, classGen, methodGen);
-
-	// The constructor for the NodeSortRecord generating class takes no
-	// parameters so we must to pass initialization params to other methods
-	il.append(new NEW(cpg.addClass(NODE_SORT_FACTORY)));
-	il.append(DUP);
-	il.append(methodGen.loadDOM());
-	il.append(new PUSH(cpg, className));
-	il.append(classGen.loadTranslet());
-	il.append(new INVOKESPECIAL(init));
-    }
-
-    /**
-     * Create a new auxillary class extending NodeSortRecord.
-     */
-    private static String compileSortRecord(Vector sortObjects,
-					    ClassGenerator classGen,
-					    MethodGenerator methodGen) {
-	final XSLTC  xsltc = ((Sort)sortObjects.firstElement()).getXSLTC();
-	final String className = xsltc.getHelperClassName();
-
-	// This generates a new class for handling this specific sort
-	final NodeSortRecordGenerator sortRecord =
-	    new NodeSortRecordGenerator(className,
-					NODE_SORT_RECORD,
-					"sort$0.java",
-					ACC_PUBLIC | ACC_SUPER | ACC_FINAL,
-					new String[] {},
-					classGen.getStylesheet());
-	
-	final ConstantPoolGen cpg = sortRecord.getConstantPool();	
-	
-	Method clinit = compileClassInit(sortObjects, sortRecord,
-					 cpg, className);
-	Method extract = compileExtract(sortObjects, sortRecord,
-					cpg, className);
-	sortRecord.addMethod(clinit);
-	sortRecord.addEmptyConstructor(ACC_PUBLIC);
-	sortRecord.addMethod(extract);
-
-	// Overload NodeSortRecord.getCollator() only if needed
-	for (int i = 0; i < sortObjects.size(); i++) {
-	    if (((Sort)(sortObjects.elementAt(i)))._lang != null) {
-		sortRecord.addMethod(compileGetCollator(sortObjects,
-							sortRecord,
-							cpg,
-							className));
-		i = sortObjects.size();
-	    }
-	}
-	
-	xsltc.dumpClass(sortRecord.getJavaClass());
-	return className;
-    }
-
-    /**
-     * Create a class constructor for the new class. All this constructor does
-     * is to initialize a couple of tables that contain information on sort
-     * order and sort type. These static tables cannot be in the parent class.
-     */
-    private static Method compileClassInit(Vector sortObjects,
-					   NodeSortRecordGenerator sortRecord,
-					   ConstantPoolGen cpg,
-					   String className) {
-	// Class initializer - void NodeSortRecord.<clinit>();
-	final InstructionList il = new InstructionList();
-	final CompareGenerator classInit =
-	    new CompareGenerator(ACC_PUBLIC | ACC_FINAL,
-				 de.fub.bytecode.generic.Type.VOID, 
-				 new de.fub.bytecode.generic.Type[] { },
-				 new String[] { },
-				 "<clinit>", className, il, cpg);
-
-	final int initLocale =  cpg.addMethodref("java/util/Locale",
-						 "<init>",
-						 "(Ljava/lang/String;"+
-						 "Ljava/lang/String;)V");
-	
-	final int getCollator = cpg.addMethodref(COLLATOR_CLASS,
-						 "getInstance",
-						 "(Ljava/util/Locale;)"+
-						 COLLATOR_SIG);
-
-	final int setStrength = cpg.addMethodref(COLLATOR_CLASS,
-						 "setStrength", "(I)V");
-
-	final int levels = sortObjects.size();
-
-	final int levelsField = cpg.addFieldref(className, "_levels", "I");
-	il.append(new PUSH(cpg, levels));
-	il.append(new PUTSTATIC(levelsField));
-
-	// Compile code that initializes the static _compareType array
-	final int ctype = cpg.addFieldref(className, "_compareType", "[I");
-	il.append(new PUSH(cpg,levels));
-	il.append(new NEWARRAY(de.fub.bytecode.Constants.T_INT));
-	for (int level = 0; level < levels; level++) {
-	    final Sort sort = (Sort)sortObjects.elementAt(level);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, level));
-	    il.append(new PUSH(cpg, sort.getSortType().equals("number")
-			       ? NodeSortRecord.COMPARE_NUMERIC
-			       : NodeSortRecord.COMPARE_STRING));
-	    il.append(IASTORE);
-	}
-	il.append(new PUTSTATIC(ctype));
-	
-	// Compile code that initializes the static _sortOrder
-	final int corder = cpg.addFieldref(className, "_sortOrder", "[I");
-	il.append(new PUSH(cpg, levels));
-	il.append(new NEWARRAY(de.fub.bytecode.Constants.T_INT));
-	for (int level = 0; level < levels; level++) {
-	    final Sort sort = (Sort)sortObjects.elementAt(level);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, level));
-	    il.append(new PUSH(cpg, sort.getSortOrder().equals("descending")
-			       ? NodeSortRecord.COMPARE_DESCENDING
-			       : NodeSortRecord.COMPARE_ASCENDING));
-	    il.append(IASTORE);
-	}
-	il.append(new PUTSTATIC(corder));
-
-	// Compile code that initializes the locale
-	String language = null;
-	String country = null;
-	Sort sort = (Sort)sortObjects.elementAt(0);
-
-	for (int level = 0; level < levels; level++) {
-	    if (language == null && sort._lang != null)
-		language = sort._lang;
-	    if (country == null && sort._country != null)
-		country = sort._country;
-	}
-
-	// Get index to private static reference in NodeSortRecrd
-	final int collator =
-	    cpg.addFieldref(className, "_collator", COLLATOR_SIG);
-
-	if (language != null) {
-	    // Create new Locale object on stack
-	    il.append(new NEW(cpg.addClass("java/util/Locale")));
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, language));
-	    il.append(new PUSH(cpg, (country != null ? country : EMPTYSTRING)));
-	    il.append(new INVOKESPECIAL(initLocale));
-	    
-	    // Use that Locale object to get the required Collator object
-	    il.append(new INVOKESTATIC(getCollator));
-	    il.append(new PUTSTATIC(collator));
-	}
-
-	il.append(new GETSTATIC(collator));
-	il.append(new ICONST(Collator.TERTIARY));
-	il.append(new INVOKEVIRTUAL(setStrength));
-
-	il.append(RETURN);
-
-	classInit.stripAttributes(true);
-	classInit.setMaxLocals();
-	classInit.setMaxStack();
-	classInit.removeNOPs();
-
-	return classInit.getMethod();
-    }
-
-
-    /**
-     * Compiles a method that overloads NodeSortRecord.extractValueFromDOM()
-     */
-    private static Method compileExtract(Vector sortObjects,
-					 NodeSortRecordGenerator sortRecord,
-					 ConstantPoolGen cpg,
-					 String className) {
-	final InstructionList il = new InstructionList();
-	
-	// String NodeSortRecord.extractValueFromDOM(dom,node,level);
-	final CompareGenerator extractMethod =
-	    new CompareGenerator(ACC_PUBLIC | ACC_FINAL,
-				 de.fub.bytecode.generic.Type.STRING, 
-				 new de.fub.bytecode.generic.Type[] {
-		                     Util.getJCRefType(DOM_INTF_SIG),
-				     de.fub.bytecode.generic.Type.INT,
-				     de.fub.bytecode.generic.Type.INT,
-				     Util.getJCRefType(TRANSLET_SIG),
-				     de.fub.bytecode.generic.Type.INT
-				 },
-				 new String[] { "dom",
-						"current",
-						"level",
-						"translet",
-						"last"
-				 },
-				 "extractValueFromDOM", className, il, cpg);
-
-	// Values needed for the switch statement
-	final int levels = sortObjects.size();
-	final int match[] = new int[levels];
-	final InstructionHandle target[] = new InstructionHandle[levels];
-	InstructionHandle tblswitch = null;
-
-	// Compile switch statement only if the key has multiple levels
-	if (levels > 1) {
-	    // Put the parameter to the swtich statement on the stack
-	    il.append(new ILOAD(extractMethod.getLocalIndex("level")));
-	    // Append the switch statement here later on
-	    tblswitch = il.append(new NOP());
-	}
-
-	// Append all the cases for the switch statment
-	for (int level = 0; level < levels; level++) {
-	    match[level] = level;
-	    final Sort sort = (Sort)sortObjects.elementAt(level);
-	    target[level] = il.append(NOP);
-	    sort.translateSelect(sortRecord, extractMethod);
-	    il.append(ARETURN);
-	}
-	
-	// Compile def. target for switch statement if key has multiple levels
-	if (levels > 1) {
-	    // Append the default target - it will _NEVER_ be reached
-	    InstructionHandle defaultTarget =
-		il.append(new PUSH(cpg, EMPTYSTRING));
-	    il.insert(tblswitch,new TABLESWITCH(match, target, defaultTarget));
-	    il.append(ARETURN);
-	}
-
-	extractMethod.stripAttributes(true);
-	extractMethod.setMaxLocals();
-	extractMethod.setMaxStack();
-	extractMethod.removeNOPs();
-
-	return extractMethod.getMethod();
-    }
-
-    /**
-     * Compiles a method that overloads NodeSortRecord.getCollator()
-     * This method is only compiled if the "lang" attribute is used.
-     */
-    private static Method compileGetCollator(Vector sortObjects,
-					     NodeSortRecordGenerator sortRecord,
-					     ConstantPoolGen cpg,
-					     String className) {
-	final InstructionList il = new InstructionList();
-	// Collator NodeSortRecord.getCollator();
-	final MethodGenerator getCollator =
-	    new MethodGenerator(ACC_PUBLIC | ACC_FINAL,
-				Util.getJCRefType(COLLATOR_SIG),
-				new de.fub.bytecode.generic.Type[] {},
-				new String[] { },
-				"getCollator", className, il, cpg);
-
-	// Get index to private static reference in NodeSortRecrd
-	final int collator =
-	    cpg.addFieldref(className, "collator", COLLATOR_SIG);
-	// Feck the Collator object on the stack and return it
-	il.append(new GETSTATIC(collator));
-	il.append(ARETURN);
-
-	getCollator.stripAttributes(true);
-	getCollator.setMaxLocals();
-	getCollator.setMaxStack();
-	getCollator.removeNOPs();
-
-	return getCollator.getMethod();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/SourceLoader.java b/src/org/apache/xalan/xsltc/compiler/SourceLoader.java
deleted file mode 100644
index 254f31f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/SourceLoader.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other makterials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.xml.sax.InputSource;
-
-public interface SourceLoader {
-
-    /**
-     * This interface is used to plug external document loaders into XSLTC
-     * (used with the <xsl:include> and <xsl:import> elements.
-     *
-     * @param href The URI of the document to load
-     * @param context The URI of the currently loaded document
-     * @param xsltc The compiler that resuests the document
-     * @return An InputSource with the loaded document
-     */
-    public InputSource loadSource(String href, String context, XSLTC xsltc);
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/StartsWithCall.java b/src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
deleted file mode 100644
index 03376ba..0000000
--- a/src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class StartsWithCall extends FunctionCall {
-
-    private Expression _base = null;
-    private Expression _token = null;
-
-    /**
-     * Create a starts-with() call - two arguments, both strings
-     */
-    public StartsWithCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    /**
-     * Type check the two parameters for this function
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-	// Check that the function was passed exactly two arguments
-	if (argumentCount() != 2) {
-	    throw new TypeCheckError(ErrorMsg.FUNRESOL_ERR, getName());
-	}
-
-	// The first argument must be a String, or cast to a String
-	_base = argument(0);
-	Type baseType = _base.typeCheck(stable);	
-	if (baseType != Type.String)
-	    _base = new CastExpr(_base, Type.String);
-
-	// The second argument must also be a String, or cast to a String
-	_token = argument(1);
-	Type tokenType = _token.typeCheck(stable);	
-	if (tokenType != Type.String)
-	    _token = new CastExpr(_token, Type.String);
-
-	return _type = Type.Boolean;
-    }
-
-    /**
-     * Compile the expression - leave boolean expression on stack
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	_base.translate(classGen, methodGen);
-	_token.translate(classGen, methodGen);
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
-						     "startsWith", 
-						     "("+STRING_SIG+")Z")));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Step.java b/src/org/apache/xalan/xsltc/compiler/Step.java
deleted file mode 100644
index e243231..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Step.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.dom.Axis;
-import org.apache.xalan.xsltc.DOM;
-
-final class Step extends RelativeLocationPath {
-
-    // This step's axis as defined in class Axis.
-    private int _axis;
-
-    // A vector of predicates (filters) defined on this step.
-    private final Vector _predicates; 	// may be null
-
-    // Type of the node test.
-    private final int _nodeType;
-
-    private boolean _hadPredicates = false;
-
-    /**
-     * Constructor
-     */
-    public Step(int axis, int nodeType, Vector predicates) {
-	_axis = axis;
-	_nodeType = nodeType;
-	_predicates = predicates;
-    }
-
-
-    /**
-     * Set the parser for this element and all child predicates
-     */
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_predicates != null) {
-	    final int n = _predicates.size();
-	    for (int i = 0; i < n; i++) {
-		final Predicate exp = (Predicate)_predicates.elementAt(i);
-		exp.setParser(parser);
-		exp.setParent(this);
-	    }
-	}
-    }
-
-    
-    /**
-     * Define the axis (defined in Axis class) for this step
-     */
-    public int getAxis() {
-	return _axis;
-    }
-
-	
-    /**
-     * Get the axis (defined in Axis class) for this step
-     */
-    public void setAxis(int axis) {
-	_axis = axis;
-    }
-
-    public boolean descendantAxis() {
-	if ((_axis == Axis.DESCENDANT) || (_axis == Axis.DESCENDANTORSELF))
-	    return(true);
-	else
-	    return(false);
-    }
-
-    public boolean isSelf() {
-	return (_axis == Axis.SELF);
-    }
-	
-    /**
-     * Returns the node-type for this step
-     */
-    public int getNodeType() {
-	return _nodeType;
-    }
-
-
-    /**
-     * Returns the vector containing all predicates for this step.
-     */
-    public Vector getPredicates() {
-	return _predicates;
-    }
-
-
-    /**
-     *
-     */
-    protected void setParent(SyntaxTreeNode node) {
-	_parent = node;
-    }
-
-    /**
-     * Returns 'true' if this step has a parent pattern
-     */
-    public boolean hasParent() {
-	SyntaxTreeNode parent = getParent();
-	if ((parent instanceof ParentPattern) ||
-	    (parent instanceof ParentLocationPath) ||
-	    (parent instanceof UnionPathExpr) ||
-	    (parent instanceof FilterParentPath))
-	    return(true);
-	else
-	    return(false);
-    }
-
-    
-    /**
-     * Returns 'true' if this step has any predicates
-     */
-    public boolean hasPredicates() {
-	return _predicates != null && _predicates.size() > 0;
-    }
-
-
-    /**
-     * True if this step is the abbreviated step '.'
-     */
-    public boolean isAbbreviatedDot() {
-	return _nodeType == NodeTest.ANODE && _axis == Axis.SELF;
-    }
-
-
-    /**
-     * True if this step is the abbreviated step '..'
-     */
-    public boolean isAbbreviatedDDot() {
-	return _nodeType == NodeTest.ANODE && _axis == Axis.PARENT;
-    }
-
-    /**
-     * Type check this step. The abbreviated steps '.' and '@attr' are
-     * assigned type node if they have no predicates. All other steps 
-     * have type node-set.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	_hadPredicates = hasPredicates();
-
-	if (isAbbreviatedDot()) {
-	    _type = Type.Node;
-	}
-	else if (isAbbreviatedDDot()) {
-	    _type = Type.NodeSet;
-	}
-	else {
-	    // Special case for '@attr' with no parent or predicates
-	    if (_axis == Axis.ATTRIBUTE
-		&& _nodeType != NodeTest.ATTRIBUTE
-		&& !hasParent()
-		&& !hasPredicates()) {
-		_type = Type.Node;
-	    }
-	    else {
-		_type = Type.NodeSet;
-	    }
-	}
-	if (_predicates != null) {
-	    final int n = _predicates.size();
-	    for (int i = 0; i < n; i++) {
-		final Expression pred = (Expression)_predicates.elementAt(i);
-		pred.typeCheck(stable);
-	    }
-	}
-	return _type;
-    }
-
-    /**
-     * Translate a step by pushing the appropriate iterator onto the stack.
-     * The abbreviated steps '.' and '@attr' do not create new iterators
-     * if they are not part of a LocationPath and have no filters.
-     * In these cases a node index instead of an iterator is pushed
-     * onto the stack.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (hasPredicates()) {
-	    translatePredicates(classGen, methodGen);
-	}
-	else {
-	    // If it is an attribute but not '@*' or '@attr' with a parent
-	    if ((_axis == Axis.ATTRIBUTE) &&
-		(_nodeType != NodeTest.ATTRIBUTE) && (!hasParent())) {
-		int node = cpg.addInterfaceMethodref(DOM_INTF,
-						     "getAttributeNode",
-						     "(II)I");
-		int iter = cpg.addInterfaceMethodref(DOM_INTF,
-						     "getTypedAxisIterator",
-						     "(II)"+NODE_ITERATOR_SIG);
-		if (_type instanceof NodeType) {
-		    il.append(methodGen.loadDOM());
-		    il.append(new PUSH(cpg, _nodeType));
-		    il.append(methodGen.loadContextNode());
-		    il.append(new INVOKEINTERFACE(node, 3));
-		}
-		// If it is the case '@attr[P_1]...[P_k]'
-		else if (_type instanceof NodeSetType) {
-		    il.append(methodGen.loadDOM());
-		    il.append(new PUSH(cpg, Axis.ATTRIBUTE));
-		    il.append(new PUSH(cpg, _nodeType));
-		    il.append(new INVOKEINTERFACE(iter, 3));
-		}
-		return;
-	    }
-
-	    // Special case for '.'
-	    if (_type == Type.Node) {
-		il.append(methodGen.loadContextNode());
-		return;
-	    }
-
-	    // "ELEMENT" or "*" or "@*" or ".." or "@attr" with a parent.
-	    switch (_nodeType) {
-	    case NodeTest.ATTRIBUTE:
-		_axis = Axis.ATTRIBUTE;
-	    case NodeTest.ANODE:
-		// DOM.getAxisIterator(int axis);
-		int git = cpg.addInterfaceMethodref(DOM_INTF,
-						    "getAxisIterator",
-						    "(I)"+NODE_ITERATOR_SIG);
-		il.append(methodGen.loadDOM());
-		il.append(new PUSH(cpg, _axis));
-		il.append(new INVOKEINTERFACE(git, 2));
-		break;
-	    default:
-		final XSLTC xsltc = getParser().getXSLTC();
-		final Vector ni = xsltc.getNamesIndex();
-		String name = null;
-		int star = 0;
-		
-		if (_nodeType >= DOM.NTYPES) {
-		    name = (String)ni.elementAt(_nodeType-DOM.NTYPES);
-		    star = name.lastIndexOf('*');
-		}
-		
-		if (star > 1) {
-		    final String namespace;
-		    if (_axis == Axis.ATTRIBUTE)
-			namespace = name.substring(0,star-2);
-		    else
-			namespace = name.substring(0,star-1);
-
-		    final int nsType = xsltc.registerNamespace(namespace);
-		    final int ns = cpg.addInterfaceMethodref(DOM_INTF,
-						    "getNamespaceAxisIterator",
-						    "(II)"+NODE_ITERATOR_SIG);
-		    il.append(methodGen.loadDOM());
-		    il.append(new PUSH(cpg, _axis));
-		    il.append(new PUSH(cpg, nsType));
-		    il.append(new INVOKEINTERFACE(ns, 3));
-		    break;
-		}
-	    case NodeTest.ELEMENT:
-		// DOM.getTypedAxisIterator(int axis, int type);
-		final int ty = cpg.addInterfaceMethodref(DOM_INTF,
-						"getTypedAxisIterator",
-						"(II)"+NODE_ITERATOR_SIG);
-		// Get the typed iterator we're after
-		il.append(methodGen.loadDOM());
-		il.append(new PUSH(cpg, _axis));
-		il.append(new PUSH(cpg, _nodeType));
-		il.append(new INVOKEINTERFACE(ty, 3));
-		    
-		// Now, for reverse iterators we may need to re-arrange the
-		// node ordering (ancestor-type iterators).
-		if (!(getParent() instanceof ForEach)) {
-		    if ((!hasParent()) && (!_hadPredicates))
-			orderIterator(classGen, methodGen);
-		}
-		break;
-	    }
-	}
-    }
-
-
-    /**
-     * Translate a sequence of predicates. Each predicate is translated
-     * by constructing an instance of <code>CurrentNodeListIterator</code>
-     * which is initialized from another iterator (recursive call),
-     * a filter and a closure (call to translate on the predicate) and "this". 
-     */
-    public void translatePredicates(ClassGenerator classGen,
-				    MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_predicates.size() == 0) {
-	    translate(classGen, methodGen);
-	}
-	else {
-	    final Predicate predicate = (Predicate)_predicates.lastElement();
-	    _predicates.remove(predicate);
-
-	    // Special case for predicates that can use the NodeValueIterator
-	    // instead of an auxiliary class. Certain path/predicates pairs
-	    // are translated into a base path, on top of which we place a
-	    // node value iterator that tests for the desired value:
-	    //   foo[@attr = 'str']  ->  foo/@attr + test(value='str')
-	    //   foo[bar = 'str']    ->  foo/bar + test(value='str')
-	    //   foo/bar[. = 'str']  ->  foo/bar + test(value='str')
-	    if (predicate.isNodeValueTest()) {
-		Step step = predicate.getStep();
-
-		il.append(methodGen.loadDOM());
-		// If the predicate's Step is simply '.' we translate this Step
-		// and place the node test on top of the resulting iterator
-		if (step.isAbbreviatedDot()) {
-		    translate(classGen, methodGen);
-		}
-		// Otherwise we create a parent location path with this Step and
-		// the predicates Step, and place the node test on top of that
-		else {
-		    ParentLocationPath path = new ParentLocationPath(this,step);
-		    try {
-			path.typeCheck(getParser().getSymbolTable());
-		    }
-		    catch (TypeCheckError e) { }
-		    path.translate(classGen, methodGen);
-		}
-		predicate.translate(classGen, methodGen);
-		int iter = cpg.addInterfaceMethodref(DOM_INTF,
-					     GET_NODE_VALUE_ITERATOR,
-					     GET_NODE_VALUE_ITERATOR_SIG);
-		il.append(new INVOKEINTERFACE(iter, 4));
-	    }
-	    // Handle '//*[n]' expression
-	    else if (predicate.isNthDescendant()) {
-		il.append(methodGen.loadDOM());
-		il.append(methodGen.loadContextNode());
-		predicate.translate(classGen, methodGen);
-		int iter = cpg.addInterfaceMethodref(DOM_INTF,
-						     "getNthDescendant",
-						     "(II)"+NODE_ITERATOR_SIG);
-		il.append(new INVOKEINTERFACE(iter, 3));
-	    }
-	    // Handle 'elem[n]' expression
-	    else if (predicate.isNthPositionFilter()) {
-		final int initNI =
-		    cpg.addMethodref(NTH_ITERATOR_CLASS,
-				     "<init>",
-				     "(" + NODE_ITERATOR_SIG + "I)V");
-		il.append(new NEW(cpg.addClass(NTH_ITERATOR_CLASS)));
-		il.append(DUP);
-		translatePredicates(classGen, methodGen); // recursive call
-		predicate.translate(classGen, methodGen);
-		il.append(new INVOKESPECIAL(initNI));
-	    }
-	    else {
-		final int init = cpg.addMethodref(CURRENT_NODE_LIST_ITERATOR,
-						  "<init>",
-						  "("
-						  + NODE_ITERATOR_SIG
-						  + CURRENT_NODE_LIST_FILTER_SIG
-						  + NODE_SIG
-						  + TRANSLET_SIG
-						  + ")V");
-		// create new CurrentNodeListIterator
-		il.append(new NEW(cpg.addClass(CURRENT_NODE_LIST_ITERATOR)));
-		il.append(DUP);
-		translatePredicates(classGen, methodGen); // recursive call
-		predicate.translate(classGen, methodGen);
-		
-		il.append(methodGen.loadCurrentNode());
-		il.append(classGen.loadTranslet());
-		if (classGen.isExternal()) {
-		    final String className = classGen.getClassName();
-		    il.append(new CHECKCAST(cpg.addClass(className)));
-		}
-		il.append(new INVOKESPECIAL(init));
-	    }
-	}
-    }
-
-
-    /*
-     * Order nodes for iterators with reverse axis
-     *
-     * Should be done for preceding and preceding-sibling axis as well,
-     * but our iterators for those axis are not reverse (as they should)
-     */
-    public void orderIterator(ClassGenerator classGen,
-			      MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if ((_axis == Axis.ANCESTOR) || (_axis == Axis.ANCESTORORSELF)) {
-	    final int init = cpg.addMethodref(REVERSE_ITERATOR, "<init>",
-					      "("+NODE_ITERATOR_SIG+")V");
-
-	    il.append(new NEW(cpg.addClass(REVERSE_ITERATOR)));
-	    il.append(DUP_X1);
-	    il.append(SWAP);
-	    il.append(new INVOKESPECIAL(init));
-	}
-    }
-
-
-    /**
-     * Returns a string representation of this step.
-     */
-    public String toString() {
-	final StringBuffer buffer = new StringBuffer("step(\"");
-	buffer.append(Axis.names[_axis]).append("\", ").append(_nodeType);
-	if (_predicates != null) {
-	    final int n = _predicates.size();
-	    for (int i = 0; i < n; i++) {
-		final Predicate pred = (Predicate)_predicates.elementAt(i);
-		buffer.append(", ").append(pred.toString());
-	    }
-	}
-	return buffer.append(')').toString();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/StepPattern.java b/src/org/apache/xalan/xsltc/compiler/StepPattern.java
deleted file mode 100644
index 085f1a3..0000000
--- a/src/org/apache/xalan/xsltc/compiler/StepPattern.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.dom.Axis;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.Field;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class StepPattern extends RelativePathPattern {
-
-    private static final int NO_CONTEXT = 0;
-    private static final int SIMPLE_CONTEXT = 1;
-    private static final int GENERAL_CONTEXT = 2;
-
-    private final int    _axis;
-    private final Vector _predicates;
-    private final int    _nodeType;
-
-    private Step    _step = null;
-    private boolean _isEpsilon = false;
-    private int     _contextCase;
-
-    public StepPattern(int axis, int nodeType, Vector predicates) {
-	_axis = axis;
-	_nodeType = nodeType;
-	_predicates = predicates;
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	if (_predicates != null) {
-	    final int n = _predicates.size();
-	    for (int i = 0; i < n; i++) {
-		final Predicate exp = (Predicate)_predicates.elementAt(i);
-		exp.setParser(parser);
-		exp.setParent(this);
-	    }
-	}
-    }
-
-    public int getNodeType() {
-	return _nodeType;
-    }
-    
-    public StepPattern getKernelPattern() {
-	return this;
-    }
-	
-    public boolean isWildcard() {
-	return _isEpsilon && hasPredicates() == false;
-    }
-    
-    public boolean hasPredicates() {
-	return _predicates != null && _predicates.size() > 0;
-    }
-
-    public double getDefaultPriority() {
-	if (hasPredicates()) {
-	    return 0.5;
-	}
-	else {
-	    switch(_nodeType) {
-	    case -1:
-		return(-0.25);
-	    case 0:
-		return(0.0);
-	    default:
-		if (_nodeType >= NodeTest.GTYPE)
-		    return(0.0);
-		else
-		    return(-0.5);
-	    }
-	}
-    }
-    
-    public void reduceKernelPattern() {
-	_isEpsilon = true;
-    }
-	
-    public String toString() {
-	final StringBuffer buffer = new StringBuffer("stepPattern(\"");
-	buffer.append(Axis.names[_axis])
-	    .append("\", ")
-	    .append(_isEpsilon ? "epsilon" : Integer.toString(_nodeType));
-	if (_predicates != null)
-	    buffer.append(", ").append(_predicates.toString());
-	return buffer.append(')').toString();
-    }
-    
-    private int analyzeCases() {
-	boolean noContext = true;
-	final int n = _predicates.size();
-	for (int i = 0; i < n && noContext; i++) {
-	    final Predicate exp = (Predicate)_predicates.elementAt(i);
-	    if (exp.isNthPositionFilter())
-		noContext = false;
-	}
-
-	if (noContext) {
-	    return NO_CONTEXT;
-	}
-	else if (n == 1) {
-	    return SIMPLE_CONTEXT;
-	}
-	return GENERAL_CONTEXT;
-    }
-
-    private String getNextFieldName() {
-	return  "__step_pattern_iter_" + getXSLTC().nextStepPatternSerial();
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (hasPredicates()) {
-	    // Type check all the predicates (e -> position() = e)
-	    final int n = _predicates.size();
-	    for (int i = 0; i < n; i++) {
-		final Predicate pred = (Predicate)_predicates.elementAt(i);
-		pred.typeCheck(stable);
-	    }
-
-	    // Analyze context cases
-	    _contextCase = analyzeCases();
-
-	    // Create an instance of Step to do the translation
-	    if (_contextCase == SIMPLE_CONTEXT) {
-		_step = new Step(_axis, _nodeType, null);
-		_step.typeCheck(stable);
-	    }
-	    else if (_contextCase == GENERAL_CONTEXT) {
-		_step = new Step(_axis, _nodeType, _predicates);
-		_step.typeCheck(stable);
-	    }
-	}
-	return _axis == Axis.CHILD ? Type.Element : Type.Attribute;
-    }
-
-    private void translateKernel(ClassGenerator classGen, 
-				 MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	
-	// context node is on the stack
-	final int getType = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getType", "(I)I");
-	il.append(methodGen.loadDOM());
-	il.append(SWAP);
-	il.append(new INVOKEINTERFACE(getType, 2));
-	il.append(new PUSH(cpg, _nodeType));
-	
-	// Need to allow for long jumps here - don't know if 100% correct
-	//_falseList.add(il.append(new IF_ICMPNE(null)));
-	final BranchHandle icmp = il.append(new IF_ICMPEQ(null));
-	_falseList.add(il.append(new GOTO_W(null)));
-	icmp.setTarget(il.append(NOP));
-    }
-
-    private void translateNoContext(ClassGenerator classGen, 
-				    MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Push current node on the stack
-	il.append(methodGen.loadCurrentNode());
-	il.append(SWAP);
-
-	// Overwrite current node with matching node
-	il.append(methodGen.storeCurrentNode());
-
-	// If pattern not reduced then check kernel
-	if (!_isEpsilon) {
-	    il.append(methodGen.loadCurrentNode());
-	    translateKernel(classGen, methodGen);
-	}
-
-	// Compile the expressions within the predicates
-	final int n = _predicates.size();
-	for (int i = 0; i < n; i++) {
-	    final Predicate pred = (Predicate)_predicates.elementAt(i);
-	    final Expression exp = pred.getExpr();
-	    exp.translateDesynthesized(classGen, methodGen);
-	    _trueList.append(exp._trueList);
-	    _falseList.append(exp._falseList);
-	}
-
-	// Backpatch true list and restore current iterator/node
-	InstructionHandle restore;
-	restore = il.append(methodGen.storeCurrentNode());
-	backPatchTrueList(restore);
-	BranchHandle skipFalse = il.append(new GOTO(null));
-
-	// Backpatch false list and restore current iterator/node
-	restore = il.append(methodGen.storeCurrentNode());
-	backPatchFalseList(restore);
-	_falseList.add(il.append(new GOTO(null)));
-
-	// True list falls through
-	skipFalse.setTarget(il.append(NOP));
-    }
-
-    private void translateSimpleContext(ClassGenerator classGen, 
-					MethodGenerator methodGen) {
-	int index;
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Store matching node into a local variable
-	LocalVariableGen match;
-	match = methodGen.addLocalVariable("step_pattern_tmp1", 
-					   Util.getJCRefType(NODE_SIG),
-					   il.getEnd(), null);
-	il.append(new ISTORE(match.getIndex()));
-
-	// If pattern not reduced then check kernel
-	if (!_isEpsilon) {
-	    il.append(new ILOAD(match.getIndex()));
- 	    translateKernel(classGen, methodGen);
-	}
-
-	// Push current iterator and current node on the stack
-	il.append(methodGen.loadCurrentNode());
-	il.append(methodGen.loadIterator());
-
-	// Create a new matching iterator using the matching node
-	index = cpg.addMethodref(MATCHING_ITERATOR, "<init>", 
-				 "(I" + NODE_ITERATOR_SIG + ")V");
-	il.append(new NEW(cpg.addClass(MATCHING_ITERATOR)));
-	il.append(DUP);
-	il.append(new ILOAD(match.getIndex()));
-	_step.translate(classGen, methodGen);
-	il.append(new INVOKESPECIAL(index));
-
-	// Get the parent of the matching node
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(match.getIndex()));
-	index = cpg.addInterfaceMethodref(DOM_INTF, GET_PARENT, GET_PARENT_SIG);
-	il.append(new INVOKEINTERFACE(index, 2));
-
-	// Start the iterator with the parent 
-	il.append(methodGen.setStartNode());
-
-	// Overwrite current iterator and current node
-	il.append(methodGen.storeIterator());
-	il.append(new ILOAD(match.getIndex()));
-	il.append(methodGen.storeCurrentNode());
-
-	// Translate the expression of the predicate 
-	final Predicate pred = (Predicate) _predicates.elementAt(0);
-	final Expression exp = pred.getExpr();
-	exp.translateDesynthesized(classGen, methodGen);
-
-	// Backpatch true list and restore current iterator/node
-	InstructionHandle restore;
-	restore = il.append(methodGen.storeIterator());
-	il.append(methodGen.storeCurrentNode());
-	exp.backPatchTrueList(restore);
-	BranchHandle skipFalse = il.append(new GOTO(null));
-
-	// Backpatch false list and restore current iterator/node
-	restore = il.append(methodGen.storeIterator());
-	il.append(methodGen.storeCurrentNode());
-	exp.backPatchFalseList(restore);
-	_falseList.add(il.append(new GOTO(null)));
-
-	// True list falls through
-	skipFalse.setTarget(il.append(NOP));
-    }
-
-    private void translateGeneralContext(ClassGenerator classGen, 
-					 MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	int iteratorIndex = 0;
-	BranchHandle ifBlock = null;
-	LocalVariableGen iter, node, node2;
-	final String iteratorName = getNextFieldName();
-
-	// Store node on the stack into a local variable
-	node = methodGen.addLocalVariable("step_pattern_tmp1", 
-					  Util.getJCRefType(NODE_SIG),
-					  il.getEnd(), null);
-	il.append(new ISTORE(node.getIndex()));
-
-	// Create a new local to store the iterator
-	iter = methodGen.addLocalVariable("step_pattern_tmp2", 
-					  Util.getJCRefType(NODE_ITERATOR_SIG),
-					  il.getEnd(), null);
-
-	// Add a new private field if this is the main class
-	if (!classGen.isExternal()) {
-	    final Field iterator =
-		new Field(ACC_PRIVATE, 
-			  cpg.addUtf8(iteratorName),
-			  cpg.addUtf8(NODE_ITERATOR_SIG),
-			  null, cpg.getConstantPool());
-	    classGen.addField(iterator);
-	    iteratorIndex = cpg.addFieldref(classGen.getClassName(), 
-					    iteratorName,
-					    NODE_ITERATOR_SIG);
-
-	    il.append(classGen.loadTranslet());
-	    il.append(new GETFIELD(iteratorIndex));
-	    il.append(DUP);
-	    il.append(new ASTORE(iter.getIndex()));
-	    ifBlock = il.append(new IFNONNULL(null));
-	    il.append(classGen.loadTranslet());
-	}	
-
-	// Compile the step created at type checking time
-	_step.translate(classGen, methodGen);
-	il.append(new ASTORE(iter.getIndex()));
-
-	// If in the main class update the field too
-	if (!classGen.isExternal()) {
-	    il.append(new ALOAD(iter.getIndex()));
-	    il.append(new PUTFIELD(iteratorIndex));
-	    ifBlock.setTarget(il.append(NOP));
-	}
-
-	// Get the parent of the node on the stack
-	il.append(methodGen.loadDOM());
-	il.append(new ILOAD(node.getIndex()));
-	int index = cpg.addInterfaceMethodref(DOM_INTF,
-					      GET_PARENT, GET_PARENT_SIG);
-	il.append(new INVOKEINTERFACE(index, 2));
-
-	// Initialize the iterator with the parent
-	il.append(new ALOAD(iter.getIndex()));
-	il.append(SWAP);
-	il.append(methodGen.setStartNode());
-
-	/* 
-	 * Inline loop:
-	 *
-	 * int node2;
-	 * while ((node2 = iter.next()) != NodeIterator.END 
-	 *		  && node2 < node);
-	 * return node2 == node; 
-	 */
-	BranchHandle skipNext;
-	InstructionHandle begin, next;
-	node2 = methodGen.addLocalVariable("step_pattern_tmp3", 
-					   Util.getJCRefType(NODE_SIG),
-					   il.getEnd(), null);
-
-	skipNext = il.append(new GOTO(null));
-	next = il.append(new ALOAD(iter.getIndex()));
-	begin = il.append(methodGen.nextNode());
-	il.append(DUP);
-	il.append(new ISTORE(node2.getIndex()));
-	_falseList.add(il.append(new IFEQ(null)));	// NodeIterator.END
-
-	il.append(new ILOAD(node2.getIndex()));
-	il.append(new ILOAD(node.getIndex()));
-	il.append(new IF_ICMPLT(next));
-
-	il.append(new ILOAD(node2.getIndex()));
-	il.append(new ILOAD(node.getIndex()));
-	_falseList.add(il.append(new IF_ICMPNE(null)));
-
-	skipNext.setTarget(begin);
-    }
-	
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (hasPredicates()) {
-	    switch (_contextCase) {
-	    case NO_CONTEXT:
-		translateNoContext(classGen, methodGen);
-		break;
-		
-	    case SIMPLE_CONTEXT:
-		translateSimpleContext(classGen, methodGen);
-		break;
-		
-	    default:
-		translateGeneralContext(classGen, methodGen);
-		break;
-	    }
-	}
-	else if (isWildcard()) {
-	    il.append(POP); 	// true list falls through
-	}
-	else {
-	    translateKernel(classGen, methodGen);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/StringCall.java b/src/org/apache/xalan/xsltc/compiler/StringCall.java
deleted file mode 100644
index d2ac45f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/StringCall.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class StringCall extends FunctionCall {
-    public StringCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final int argc = argumentCount();
-	if (argc > 1) {
-	    final String errmsg =
-		"The string() function cannot take more than one parameter";
-	    throw new TypeCheckError(new ErrorMsg(errmsg));
-	}
-
-	if (argc > 0) {
-	    argument().typeCheck(stable);
-	}
-	return _type = Type.String;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final InstructionList il = methodGen.getInstructionList();
-	Type targ;
-
-	if (argumentCount() == 0) {
-	    il.append(methodGen.loadContextNode());
-	    targ = Type.Node;
-	}
-	else {
-	    final Expression arg = argument();
-	    arg.translate(classGen, methodGen);
-	    arg.startResetIterator(classGen, methodGen);
-	    targ = arg.getType();
-	}
-
-	if (!targ.identicalTo(Type.String)) {
-	    targ.translateTo(classGen, methodGen, Type.String);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/StringLengthCall.java b/src/org/apache/xalan/xsltc/compiler/StringLengthCall.java
deleted file mode 100644
index 91180aa..0000000
--- a/src/org/apache/xalan/xsltc/compiler/StringLengthCall.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class StringLengthCall extends FunctionCall {
-    public StringLengthCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	if (argumentCount() > 0) {
-	    argument().translate(classGen, methodGen);
-	}
-	else {
-	    il.append(methodGen.loadContextNode());
-	    Type.Node.translateTo(classGen, methodGen, Type.String);
-	}
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
-						     "length", "()I")));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Stylesheet.java b/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
deleted file mode 100644
index 93950d7..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other makterials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.net.URL;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.JavaClass;
-
-import org.apache.xalan.xsltc.compiler.util.MethodGenerator;
-import org.apache.xalan.xsltc.compiler.util.ClassGenerator;
-import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
-import org.apache.xalan.xsltc.compiler.util.ErrorMsg;
-import org.apache.xalan.xsltc.compiler.util.Util;
-
-import org.apache.xalan.xsltc.DOM;
-
-public final class Stylesheet extends SyntaxTreeNode {
-
-    private String       _version;
-    private QName        _name;
-    private String       _systemId;
-    private Stylesheet   _parentStylesheet;
-	
-    // Contains global variables and parameters defined in the stylesheet
-    private final Vector _globals = new Vector();
-
-    // Used to cache the result returned by <code>hasLocalParams()</code>.
-    private Boolean _hasLocalParams = null;
-
-    //  The name of the class being generated.
-    private String _className;
-    
-    // Contains all templates dedined in this stylesheet
-    private final Vector _templates = new Vector();
-
-    private int _nextModeSerial = 1;
-    private final Hashtable _modes = new Hashtable();
-    private final Hashtable _extensions = new Hashtable();
-
-    private int _importPrecedence = 1;
-    private Mode _defaultMode;
-    private boolean _multiDocument = false;
-
-    // All named key elements (needed by Key/IdPattern)
-    private Hashtable _keys = new Hashtable();
-
-    private boolean _numberFormattingUsed = false;
-
-    private boolean _simplified = false;
-
-    private SourceLoader _loader = null;
-
-
-    public boolean isSimplified() {
-	return(_simplified);
-    }
-
-    public void setSimplified() {
-	_simplified = true;
-    }
-    
-    public void setMultiDocument(boolean flag) {	
-	_multiDocument = flag;
-    }
-
-    public boolean isMultiDOM() {
-	return _multiDocument;
-    }
-
-    public boolean isImported() {
-	final SyntaxTreeNode parent = getParent();
-	return ((parent != null) && (parent instanceof Import));
-    }
-
-    public boolean isIncluded() {
-	final SyntaxTreeNode parent = getParent();
-	return ((parent != null) && (parent instanceof Include));
-    }
-
-    public void numberFormattingUsed() {
-	_numberFormattingUsed = true;
-    }
-
-    public void setImportPrecedence(final int precedence) {
-	_importPrecedence = precedence;
-
-	final Enumeration elements = elements();
-	while (elements.hasMoreElements()) {
-	    final TopLevelElement child =
-		(TopLevelElement)elements.nextElement();
-	    if (child instanceof Include) {
-		Stylesheet included = ((Include)child).getIncludedStylesheet();
-		if (included != null) {
-		    included.setImportPrecedence(precedence);
-		}
-	    }
-	}
-
-    }
-    
-    public int getImportPrecedence() {
-	return _importPrecedence;
-    }
-
-    public boolean checkForLoop(String systemId) {
-	// Return true if this stylesheet includes/imports itself
-	if (_systemId.equals(systemId))
-	    return true;
-	// Then check with any stylesheets that included/imported this one
-	if (_parentStylesheet != null) 
-	    return _parentStylesheet.checkForLoop(systemId);
-	// Otherwise OK
-	return false;
-    }
-    
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_name = makeStylesheetName("__stylesheet_");
-    }
-    
-    public void setParentStylesheet(Stylesheet parent) {
-	_parentStylesheet = parent;
-    }
-    
-    public Stylesheet getParentStylesheet() {
-	return _parentStylesheet;
-    }
-
-    public void setSystemId(String systemId) {
-	_systemId = systemId;
-    }
-    
-    public String getSystemId() {
-	return _systemId;
-    }
-
-    public void setSourceLoader(SourceLoader loader) {
-	_loader = loader;
-    }
-    
-    public SourceLoader getSourceLoader() {
-	return _loader;
-    }
-
-    private QName makeStylesheetName(String prefix) {
-	return getParser().getQName(prefix+getXSLTC().nextStylesheetSerial());
-    }
-
-    /**
-     * Returns true if this stylesheet has global vars or params.
-     */
-    public boolean hasGlobals() {
-	return _globals.size() > 0;
-    }
-
-    /**
-     * Returns true if at least one template in the stylesheet has params
-     * defined. Uses the variable <code>_hasLocalParams</code> to cache the
-     * result.
-     */
-    public boolean hasLocalParams() {
-	if (_hasLocalParams == null) {
-	    final int n = _templates.size();
-	    for (int i = 0; i < n; i++) {
-		final Template template = (Template)_templates.elementAt(i);
-		if (template.hasParams()) {
-		    _hasLocalParams = new Boolean(true);
-		    return true;
-		}
-	    }
-	    _hasLocalParams = new Boolean(false);
-	    return false;
-	}
-	else {
-	    return _hasLocalParams.booleanValue();
-	}
-    }
-
-    /**
-     * Store extension URIs
-     */
-    private void extensionURI(String prefixes, SymbolTable stable) {
-	if (prefixes != null) {
-	    StringTokenizer tokens = new StringTokenizer(prefixes);
-	    while (tokens.hasMoreTokens()) {
-		final String prefix = tokens.nextToken();
-		final String uri = lookupNamespace(prefix);
-		if (uri != null) {
-		    _extensions.put(uri, prefix);
-		}
-	    }
-	}
-    }
-
-    public boolean isExtension(String uri) {
-	return (_extensions.get(uri) != null);
-    }
-
-    public void excludeExtensionPrefixes(Parser parser) {
-	final SymbolTable stable = parser.getSymbolTable();
-    	final String excludePrefixes = getAttribute("exclude-result-prefixes");
-	final String extensionPrefixes = 
-	    getAttribute("extension-element-prefixes");
-	stable.excludeNamespaces(excludePrefixes);
-	stable.excludeNamespaces(extensionPrefixes);
-	extensionURI(extensionPrefixes, stable);
-    }
-
-    /**
-     * Parse the version and uri fields of the stylesheet and add an
-     * entry to the symbol table mapping the name <tt>__stylesheet_</tt>
-     * to an instance of this class.
-     */
-    public void parseContents(Parser parser) {
-	final SymbolTable stable = parser.getSymbolTable();
-
-	_version = getAttribute("version");
-
-	addPrefixMapping("xml", "xml"); // Make sure 'xml' maps to 'xml'
-
-	// Report and error if more than one stylesheet defined
-	final Stylesheet sheet = stable.addStylesheet(_name, this);
-	if (sheet != null) {
-	    // Error: more that one stylesheet defined
-	    final ErrorMsg msg = new ErrorMsg(ErrorMsg.STLREDEF_ERR, this);
-	    parser.reportError(Constants.ERROR, msg);
-	}
-
-	// If this is a simplified stylesheet we must create a template that
-	// grabs the root node of the input doc ( <xsl:template match="/"/> ).
-	// This template needs the current element (the one passed to this
-	// method) as its only child, so the Template class has a special
-	// method that handles this (parseSimplified()).
-	if (_simplified) {
-	    stable.excludeURI(XSLT_URI);
-	    Template template = new Template();
-	    template.parseSimplified(this, parser);
-	}
-	// Parse the children of this node
-	else {
-	    parseOwnChildren(parser);
-	}
-    }
-
-    /**
-     * Parse all the children of <tt>element</tt>.
-     * XSLT commands are recognized by the XSLT namespace
-     */
-    public final void parseOwnChildren(Parser parser) {
-
-	final Vector contents = getContents();
-	final int count = contents.size();
-
-	// We have to scan the stylesheet element's top-level elements for
-	// variables and/or parameters before we parse the other elements...
-	for (int i=0; i<count; i++) {
-	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
-	    if (child instanceof VariableBase) {
-		parser.getSymbolTable().setCurrentNode(child);
-		child.parseContents(parser);
-	    }
-	}
-
-	// Now go through all the other top-level elements...
-	for (int i=0; i<count; i++) {
-	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
-	    if (!(child instanceof VariableBase)) {
-		parser.getSymbolTable().setCurrentNode(child);
-		child.parseContents(parser);
-	    }
-	}
-    }
-
-    public void processModes() {
-	if (_defaultMode == null)
-	    _defaultMode = new Mode(null, this, Constants.EMPTYSTRING);
-	_defaultMode.processPatterns(_keys);
-	final Enumeration modes = _modes.elements();
-	while (modes.hasMoreElements()) {
-	    final Mode mode = (Mode)modes.nextElement();
-	    mode.processPatterns(_keys);
-	}
-    }
-	
-    private void compileModes(ClassGenerator classGen) {
-	_defaultMode.compileApplyTemplates(classGen);
-	final Enumeration modes = _modes.elements();
-	while (modes.hasMoreElements()) {
-	    final Mode mode = (Mode)modes.nextElement();
-	    mode.compileApplyTemplates(classGen);
-	}
-    }
-
-    public Mode getMode(QName modeName) {
-	if (modeName == null) {
-	    if (_defaultMode == null) {
-		_defaultMode = new Mode(null, this, Constants.EMPTYSTRING);
-	    }
-	    return _defaultMode;
-	}
-	else {
-	    Mode mode = (Mode)_modes.get(modeName);
-	    if (mode == null) {
-		final String suffix = Integer.toString(_nextModeSerial++);
-		_modes.put(modeName, mode = new Mode(modeName, this, suffix));
-	    }
-	    return mode;
-	}
-    }
-
-    /**
-     * Type check all the children of this node.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return typeCheckContents(stable);
-    }
-
-    /**
-     * Translate the stylesheet into JVM bytecodes. 
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	translate();
-    }
-
-    private void addDOMField(ClassGenerator classGen) {
-	final FieldGen fgen = new FieldGen(ACC_PUBLIC,
-					   Util.getJCRefType(DOM_INTF_SIG),
-					   DOM_FIELD,
-					   classGen.getConstantPool());
-	classGen.addField(fgen.getField());
-    }
-
-    /**
-     * Translate the stylesheet into JVM bytecodes. 
-     */
-    public void translate() {
-	Output lastOutputElement = null;
-	_className = getXSLTC().getClassName();
-
-	// Define a new class by extending TRANSLET_CLASS
-	final ClassGenerator classGen =
-	    new ClassGenerator(_className,
-			       TRANSLET_CLASS,
-			       Constants.EMPTYSTRING,
-			       ACC_PUBLIC | ACC_SUPER,
-			       null, this);
-	
-	addDOMField(classGen);
-
-	// Compile transform() to initialize parameters, globals & output
-	// and run the transformation
-	compileTransform(classGen);
-
-	// Translate all non-template elements and filter out all templates
-	final Enumeration elements = elements();
-	while (elements.hasMoreElements()) {
-	    Object element = elements.nextElement();
-	    // xsl:template
-	    if (element instanceof Template) {
-		// Separate templates by modes
-		final Template template = (Template)element;
-		_templates.addElement(template);
-		getMode(template.getModeName()).addTemplate(template);
-	    }
-	    // xsl:attribute-set
-	    else if (element instanceof AttributeSet) {
-		((AttributeSet)element).translate(classGen, null);
-	    }
-	    else if (element instanceof Output) {
-		// save the element for later to pass to compileConstructor 
-		lastOutputElement = (Output)element;
-	    }
-	    else {
-		// Global variables and parameters are handled elsewhere.
-		// Other top-level non-template elements are ignored. Literal
-		// elements outside of templates will never be output.
-	    }
-	}
-
-	processModes();
-	compileModes(classGen);
-
-	compileConstructor(classGen, lastOutputElement);
-
-	if (!getParser().errorsFound()) {
-	    getXSLTC().dumpClass(classGen.getJavaClass());
-	}
-    }
-
-    /**
-     * Compile the translet's constructor
-     */
-    private void compileConstructor(ClassGenerator classGen, Output output) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-
-	final MethodGenerator constructor =
-	    new MethodGenerator(ACC_PUBLIC,
-				de.fub.bytecode.generic.Type.VOID, 
-				null, null, "<init>", 
-				_className, il, cpg);
-
-	// Call the constructor in the AbstractTranslet superclass
-	il.append(classGen.loadTranslet());
-	il.append(new INVOKESPECIAL(cpg.addMethodref(TRANSLET_CLASS,
-						     "<init>", "()V")));
-
-	// Put the names array into the translet - used for dom/translet mapping
-	final Vector names = getXSLTC().getNamesIndex();
-	il.append(classGen.loadTranslet());
-	il.append(new PUSH(cpg, names.size()));
-	il.append(new ANEWARRAY(cpg.addClass(STRING)));		
-
-	for (int i = 0; i < names.size(); i++) {
-	    final String name = (String)names.elementAt(i);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, i));
-	    il.append(new PUSH(cpg, name));
-	    il.append(AASTORE);
-	}
-	il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       NAMES_INDEX,
-					       NAMES_INDEX_SIG)));
-
-	// Put the namespace names array into the translet
-	final Vector namespaces = getXSLTC().getNamespaceIndex();
-	il.append(classGen.loadTranslet());
-	il.append(new PUSH(cpg, namespaces.size()));
-	il.append(new ANEWARRAY(cpg.addClass(STRING)));		
-
-	for (int i = 0; i < namespaces.size(); i++) {
-	    final String ns = (String)namespaces.elementAt(i);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, i));
-	    il.append(new PUSH(cpg, ns));
-	    il.append(AASTORE);
-	}
-	il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       NAMESPACE_INDEX,
-					       NAMESPACE_INDEX_SIG)));
-
-	// Compile in code to set the output configuration from <xsl:output>
-	if (output != null) {
-	    // Set all the output settings files in the translet
-	    output.translate(classGen, constructor);
-	}
-
-	// Compile default decimal formatting symbols.
-	// This is an implicit, nameless xsl:decimal-format top-level element.
-	if (_numberFormattingUsed)
-	    DecimalFormatting.translateDefaultDFS(classGen, constructor);
-
-	il.append(RETURN);
-
-	constructor.stripAttributes(true);
-	constructor.setMaxLocals();
-	constructor.setMaxStack();
-	classGen.addMethod(constructor.getMethod());
-    }
-
-    /**
-     * Compile a topLevel() method into the output class. This method is 
-     * called from transform() to handle all non-template top-level elemtents.
-     * Returns the signature of the topLevel() method.
-     */
-    private String compileTopLevel(ClassGenerator classGen,
-				   Enumeration elements) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-
-	final de.fub.bytecode.generic.Type[] argTypes = {
-	    Util.getJCRefType(DOM_INTF_SIG),
-	    Util.getJCRefType(NODE_ITERATOR_SIG),
-	    Util.getJCRefType(TRANSLET_OUTPUT_SIG)
-	};
-
-	final String[] argNames = {
-	    DOCUMENT_PNAME, ITERATOR_PNAME, TRANSLET_OUTPUT_PNAME
-	};
-
-	final InstructionList il = new InstructionList();
-
-	final MethodGenerator toplevel =
-	    new MethodGenerator(ACC_PUBLIC,
-				de.fub.bytecode.generic.Type.VOID,
-				argTypes, argNames,
-				"topLevel", _className, il,
-				classGen.getConstantPool());
-
-	toplevel.addException("org.apache.xalan.xsltc.TransletException");
-
-	// Define and initialize 'current' variable with the root node
-	final LocalVariableGen current = 
-	    toplevel.addLocalVariable("current",
-				    de.fub.bytecode.generic.Type.INT,
-				    il.getEnd(), null);
-
-	final int setFilter = cpg.addInterfaceMethodref(DOM_INTF,
-			       "setFilter",
-			       "(Lorg/apache/xalan/xsltc/StripFilter;)V");
-
-	il.append(new PUSH(cpg, DOM.ROOTNODE));
-	il.append(new ISTORE(current.getIndex()));
-
-	// Initialize global variables and parameterns
-	final int m = _globals.size();
-	for (int i = 0; i < m; i++) {
-	    TopLevelElement elem = (TopLevelElement)_globals.elementAt(i);
-	    elem.translate(classGen, toplevel);
-	}
-
-	Vector whitespaceRules = new Vector();
-
-	// Compile code for other top-level elements
-	while (elements.hasMoreElements()) {
-	    final Object element = elements.nextElement();
-	    /*
-	    // xsl:output
-	    if (element instanceof Output) {
-		((Output)element).translate(classGen, toplevel);
-	    }
-	    // xsl:key
-	    else if (element instanceof Key) {
-		final Key key = (Key)element;
-		key.translate(classGen, toplevel);
-		_keys.put(key.getName(),key);
-	    }
-	    */
-	    // xsl:decimal-format
-	    if (element instanceof DecimalFormatting) {
-		((DecimalFormatting)element).translate(classGen,toplevel);
-	    }
-	    // xsl:strip/preserve-space
-	    else if (element instanceof Whitespace) {
-		whitespaceRules.addAll(((Whitespace)element).getRules());
-	    }
-	    // xsl:variable or xsl:param
-	    else if (element instanceof VariableBase) {
-		((VariableBase)element).translate(classGen,toplevel);
-	    }
-	}
-
-	if (whitespaceRules.size() > 0) {
-	    Whitespace.translateRules(whitespaceRules,classGen);
-	}
-
-	if (classGen.containsMethod(STRIP_SPACE, STRIP_SPACE_PARAMS) != null) {
-	    il.append(toplevel.loadDOM());
-	    il.append(classGen.loadTranslet());
-	    il.append(new INVOKEINTERFACE(setFilter, 2));
-	}
-
-	il.append(RETURN);
-
-	// Compute max locals + stack and add method to class
-	toplevel.stripAttributes(true);
-	toplevel.setMaxLocals();
-	toplevel.setMaxStack();
-	toplevel.removeNOPs();
-
-	classGen.addMethod(toplevel.getMethod());
-	
-	return("("+DOM_INTF_SIG+NODE_ITERATOR_SIG+TRANSLET_OUTPUT_SIG+")V");
-    }
-
-
-    /**
-     * Compile a buildKeys() method into the output class. This method is 
-     * called from transform() to handle build all indexes needed by key().
-     */
-    private String compileBuildKeys(ClassGenerator classGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-
-	final de.fub.bytecode.generic.Type[] argTypes = {
-	    Util.getJCRefType(DOM_INTF_SIG),
-	    Util.getJCRefType(NODE_ITERATOR_SIG),
-	    Util.getJCRefType(TRANSLET_OUTPUT_SIG),
-	    de.fub.bytecode.generic.Type.INT
-	};
-
-	final String[] argNames = {
-	    DOCUMENT_PNAME, ITERATOR_PNAME, TRANSLET_OUTPUT_PNAME, "current"
-	};
-
-	final InstructionList il = new InstructionList();
-
-	final MethodGenerator buildKeys =
-	    new MethodGenerator(ACC_PUBLIC,
-				de.fub.bytecode.generic.Type.VOID,
-				argTypes, argNames,
-				"buildKeys", _className, il,
-				classGen.getConstantPool());
-
-	final int domField = cpg.addFieldref(getClassName(),
-					     DOM_FIELD,
-					     DOM_INTF_SIG);
-
-	buildKeys.addException("org.apache.xalan.xsltc.TransletException");
-
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(domField));  // The DOM reference
-	il.append(new ASTORE(1));
-	
-	final Enumeration elements = elements();
-	// Compile code for other top-level elements
-	while (elements.hasMoreElements()) {
-	    // xsl:key
-	    final Object element = elements.nextElement();
-	    if (element instanceof Key) {
-		final Key key = (Key)element;
-		key.translate(classGen, buildKeys);
-		_keys.put(key.getName(),key);
-	    }
-	}
-	
-	il.append(RETURN);
-	
-	// Compute max locals + stack and add method to class
-	buildKeys.stripAttributes(true);
-	buildKeys.setMaxLocals();
-	buildKeys.setMaxStack();
-	buildKeys.removeNOPs();
-
-	classGen.addMethod(buildKeys.getMethod());
-	
-	return("("+DOM_INTF_SIG+NODE_ITERATOR_SIG+TRANSLET_OUTPUT_SIG+"I)V");
-    }
-
-    /**
-     * Compile transform() into the output class. This method is used to 
-     * initialize global variables and global parameters. The current node
-     * is set to be the document's root node.
-     */
-    private void compileTransform(ClassGenerator classGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-
-	/* 
-	 * Define the the method transform with the following signature:
-	 * void transform(DOM, NodeIterator, HandlerBase)
-	 */
-	final de.fub.bytecode.generic.Type[] argTypes = 
-	    new de.fub.bytecode.generic.Type[3];
-	argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
-	argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
-	argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
-
-	final String[] argNames = new String[3];
-	argNames[0] = DOCUMENT_PNAME;
-	argNames[1] = ITERATOR_PNAME;
-	argNames[2] = TRANSLET_OUTPUT_PNAME;
-
-	final InstructionList il = new InstructionList();
-	final MethodGenerator transf =
-	    new MethodGenerator(ACC_PUBLIC,
-				de.fub.bytecode.generic.Type.VOID,
-				argTypes, argNames,
-				"transform",
-				_className,
-				il,
-				classGen.getConstantPool());
-	transf.addException("org.apache.xalan.xsltc.TransletException");
-
-	// Define and initialize current with the root node
-	final LocalVariableGen current = 
-	    transf.addLocalVariable("current",
-				    de.fub.bytecode.generic.Type.INT,
-				    il.getEnd(), null);
-	final String applyTemplatesSig = classGen.getApplyTemplatesSig();
-	final int applyTemplates = cpg.addMethodref(getClassName(),
-						    "applyTemplates",
-						    applyTemplatesSig);
-	final int domField = cpg.addFieldref(getClassName(),
-					     DOM_FIELD,
-					     DOM_INTF_SIG);
-
-	// push translet for PUTFIELD
-	il.append(classGen.loadTranslet());
-	// prepare appropriate DOM implementation
-	
-	if (isMultiDOM()) {
-	    il.append(new NEW(cpg.addClass(MULTI_DOM_CLASS)));
-	    il.append(DUP);
-	}
-	
-	il.append(classGen.loadTranslet());
-	il.append(transf.loadDOM());
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-						     "makeDOMAdapter",
-						     "("+DOM_INTF_SIG+")"+
-						     DOM_ADAPTER_SIG)));
-	// DOMAdapter is on the stack
-
-	if (isMultiDOM()) {
-	    final int init = cpg.addMethodref(MULTI_DOM_CLASS,
-					      "<init>",
-					      "("+DOM_INTF_SIG+")V");
-	    il.append(new INVOKESPECIAL(init));
-	    // MultiDOM is on the stack
-	}
-	
-	//store to _dom variable
-	il.append(new PUTFIELD(domField));
-
-	// continue with globals initialization
-	il.append(new PUSH(cpg, DOM.ROOTNODE));
-	il.append(new ISTORE(current.getIndex()));
-
-	// Transfer the output settings to the output post-processor
-	il.append(classGen.loadTranslet());
-	il.append(transf.loadHandler());
-	final int index = cpg.addMethodref(TRANSLET_CLASS,
-					   "transferOutputSettings",
-					   "("+OUTPUT_HANDLER_SIG+")V");
-	il.append(new INVOKEVIRTUAL(index));
-
-	// Look for top-level elements that need handling
-	final Enumeration toplevel = elements();
-	if ((_globals.size() > 0) || (toplevel.hasMoreElements())) {
-	    // Compile method for handling top-level elements
-	    final String topLevelSig = compileTopLevel(classGen, toplevel);
-	    // Get a reference to that method
-	    final int topLevelIdx = cpg.addMethodref(getClassName(),
-						     "topLevel",
-						     topLevelSig);
-	    // Push all parameters on the stack and call topLevel()
-	    il.append(classGen.loadTranslet()); // The 'this' pointer
-	    il.append(classGen.loadTranslet());
-	    il.append(new GETFIELD(domField));  // The DOM reference
-	    il.append(transf.loadIterator());
-	    il.append(transf.loadHandler());    // The output handler
-	    il.append(new INVOKEVIRTUAL(topLevelIdx));
-	}
-	
-	final String keySig = compileBuildKeys(classGen);
-	final int    keyIdx = cpg.addMethodref(getClassName(),
-					       "buildKeys", keySig);
-	il.append(classGen.loadTranslet());     // The 'this' pointer
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(domField));      // The DOM reference
-	il.append(transf.loadIterator());       // Not really used, but...
-	il.append(transf.loadHandler());        // The output handler
-	il.append(new PUSH(cpg, DOM.ROOTNODE)); // Start with the root node
-	il.append(new INVOKEVIRTUAL(keyIdx));
-
-	// start document
-	il.append(transf.loadHandler());
-	il.append(transf.startDocument());
-
-	// push first arg for applyTemplates
-	il.append(classGen.loadTranslet());
-	// push translet for GETFIELD to get DOM arg
-	il.append(classGen.loadTranslet());
-	il.append(new GETFIELD(domField));
-	// push remaining 2 args
-	il.append(transf.loadIterator());
-	il.append(transf.loadHandler());
-	il.append(new INVOKEVIRTUAL(applyTemplates));
-	// endDocument
-	il.append(transf.loadHandler());
-	il.append(transf.endDocument());
-
-	il.append(RETURN);
-
-	// Compute max locals + stack and add method to class
-	transf.stripAttributes(true);
-	transf.setMaxLocals();
-	transf.setMaxStack();
-	transf.removeNOPs();
-
-	classGen.addMethod(transf.getMethod());
-    }
-
-    /**
-     * Peephole optimization: Remove sequences of [ALOAD, POP].
-     */
-    private void peepHoleOptimization(MethodGenerator methodGen) {
-	final String pat = "`ALOAD'`POP'`Instruction'";
-	final InstructionList il = methodGen.getInstructionList();
-	final FindPattern find = new FindPattern(il);
-
-	InstructionHandle ih = find.search(pat);
-	while (ih != null) {
-	    InstructionHandle[] match = find.getMatch();
-	    try {
-		il.delete(match[0], match[1]);
-	    }
-	    catch (TargetLostException e) {
-				// TODO: move target down into the list
-	    }
-	    ih = find.search(pat, match[2]);
-	}
-    }
-
-    public int addParam(Param param) {
-	_globals.addElement(param);
-	return _globals.size() - 1;
-    }
-
-    public int addVariable(Variable global) {
-	_globals.addElement(global);
-	return _globals.size() - 1;
-    }
-
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Stylesheet");
-	displayContents(indent + IndentIncrement);
-    }
-
-    // do we need this wrapper ?????
-    public String getNamespace(String prefix) {
-	return lookupNamespace(prefix);
-    }
-
-    public String getClassName() {
-	return _className;
-    }
-
-    public Vector getTemplates() {
-	return _templates;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/SymbolTable.java b/src/org/apache/xalan/xsltc/compiler/SymbolTable.java
deleted file mode 100644
index 0bbc0f6..0000000
--- a/src/org/apache/xalan/xsltc/compiler/SymbolTable.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class SymbolTable {
-    private final Hashtable _templates   = new Hashtable();
-    private final Hashtable _stylesheets = new Hashtable();
-    private final Hashtable _primops     = new Hashtable();
-    private final Hashtable _variables   = new Hashtable();
-    private final Hashtable _atsets      = new Hashtable();
-    private final Hashtable _namespaces  = new Hashtable();
-    private final Hashtable _prefixes    = new Hashtable();
-    private final Hashtable _aliases     = new Hashtable();
-    private final Hashtable _excludedURI = new Hashtable();
-
-    private int nsCounter = 0;
-
-    public Stylesheet addStylesheet(QName name, Stylesheet node) {
-	return (Stylesheet)_stylesheets.put(name, node);
-    }
-	
-    public Stylesheet lookupStylesheet(QName name) {
-	return (Stylesheet)_stylesheets.get(name);
-    }
-
-    public Template addTemplate(Template template) {
-	final QName name = template.getName();
-	name.clearDefaultNamespace();
-	return (Template)_templates.put(name, template);
-    }
-	
-    public Template lookupTemplate(QName name) {
-	name.clearDefaultNamespace();
-	return (Template)_templates.get(name);
-    }
-
-    public Variable addVariable(Variable variable) {
-	final String name = variable.getName().getStringRep();
-	return (Variable)_variables.put(name, variable);
-    }
-	
-    public Param addParam(Param parameter) {
-	final String name = parameter.getName().getStringRep();
-	return (Param)_variables.put(name, parameter);
-    }
-	
-    public Variable lookupVariable(QName qname) {
-	final String name = qname.getStringRep();
-	final Object obj = _variables.get(name);
-	return obj instanceof Variable ? (Variable)obj : null;
-    }
-
-    public Param lookupParam(QName qname) {
-	final String name = qname.getStringRep();
-	final Object obj = _variables.get(name);
-	return obj instanceof Param ? (Param)obj : null;
-    }
-	
-    public SyntaxTreeNode lookupName(QName qname) {
-	final String name = qname.getStringRep();
-	return (SyntaxTreeNode)_variables.get(name);
-    }
-
-    public AttributeSet addAttributeSet(AttributeSet atts) {
-	return (AttributeSet)_atsets.put(atts.getName(), atts);
-    }
-
-    public AttributeSet lookupAttributeSet(QName name) {
-	return (AttributeSet)_atsets.get(name);
-    }
-
-    /**
-     * Add a primitive operator or function to the symbol table. To avoid
-     * name clashes with user-defined names, the prefix <tt>PrimopPrefix</tt>
-     * is prepended.
-     */
-    public void addPrimop(String name, MethodType mtype) {
-	Vector methods = (Vector)_primops.get(name);
-	if (methods == null) {
-	    _primops.put(name, methods = new Vector());
-	}
-	methods.addElement(mtype);
-    }
-	
-    /**
-     * Lookup a primitive operator or function in the symbol table by
-     * prepending the prefix <tt>PrimopPrefix</tt>.
-     */
-    public Vector lookupPrimop(String name) {
-	return (Vector)_primops.get(name);
-    }
-
-    /**
-     * This is used for xsl:attribute elements that have a "namespace"
-     * attribute that is currently not defined using xmlns:
-     */
-    public String generateNamespacePrefix() {
-	final String prefix = new String("ns"+(nsCounter++));
-	return(prefix);
-    }
-
-    /**
-     * Use a namespace prefix to lookup a namespace URI
-     */
-    private SyntaxTreeNode _current = null;
-    public void setCurrentNode(SyntaxTreeNode node) {
-	_current = node;
-    }
-
-    public String lookupNamespace(String prefix) {
-	if (_current != null)
-	    return(_current.lookupNamespace(prefix));
-	else
-	    return(Constants.EMPTYSTRING);
-    }
-
-    /**
-     * Adds an alias for a namespace prefix
-     */ 
-    public void addPrefixAlias(String prefix, String alias) {
-	_aliases.put(prefix,alias);
-    }
-
-    /**
-     * Retrieves any alias for a given namespace prefix
-     */ 
-    public String lookupPrefixAlias(String prefix) {
-	return (String)_aliases.get(prefix);
-    }
-
-    /**
-     *
-     */
-    public void excludeURI(String uri) {
-	if (uri == null) return;
-	Integer refcnt = (Integer)_excludedURI.get(uri);
-	if (refcnt == null)
-	    refcnt = new Integer(1);
-	else
-	    refcnt = new Integer(refcnt.intValue() + 1);
-	_excludedURI.put(uri,refcnt);
-    }
-
-    /**
-     *
-     */
-    public void excludeNamespaces(String prefixes) {
-	if (prefixes != null) {
-	    StringTokenizer tokens = new StringTokenizer(prefixes);
-	    while (tokens.hasMoreTokens()) {
-		final String prefix = tokens.nextToken();
-		final String uri;
-		if (prefix.equals("#default"))
-		    uri = lookupNamespace(Constants.EMPTYSTRING);
-		else
-		    uri = lookupNamespace(prefix);
-		if (uri != null) excludeURI(uri);
-	    }
-	}
-    }
-
-    /**
-     *
-     */
-    public boolean isExcludedNamespace(String uri) {
-	if (uri == null) return false;
-	final Integer refcnt = (Integer)_excludedURI.get(uri);
-	if (refcnt == null) return false;
-	if (refcnt.intValue() > 0) return true;
-	return false;
-    }
-
-    /**
-     *
-     */
-    public void unExcludeNamespaces(String prefixes) {
-	if (prefixes != null) {
-	    StringTokenizer tokens = new StringTokenizer(prefixes);
-	    while (tokens.hasMoreTokens()) {
-		final String prefix = tokens.nextToken();
-		final String uri;
-		if (prefix.equals("#default"))
-		    uri = lookupNamespace(Constants.EMPTYSTRING);
-		else
-		    uri = lookupNamespace(prefix);
-		Integer refcnt = (Integer)_excludedURI.get(uri);
-		if (refcnt != null)
-		    _excludedURI.put(uri, new Integer(refcnt.intValue() - 1));
-	    }
-	}	
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java b/src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java
deleted file mode 100644
index 4054767..0000000
--- a/src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.net.URL;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-
-public abstract class SyntaxTreeNode implements Constants {
-
-    // Reference to the AST parser
-    private Parser _parser;
-
-    // This node's line number in the input file (not obtainable!!!!)
-    private final int _line;
-
-    // Reference to this node's parent node
-    protected SyntaxTreeNode _parent;
-    // Contains all child nodes of this node
-    private final Vector   _contents = new Vector(2);
-
-    // The QName of this element (contains uri, prefix and localname)
-    protected QName      _qname;
-    // The attributes (if any) of this element
-    protected Attributes _attributes = null;
-    // The namespace declarations (if any) of this element
-    private   Hashtable _prefixMapping = null;
-
-    // Sentinel
-    public static final SyntaxTreeNode Dummy = new AbsolutePathPattern(null);
-
-    // These two are used for indenting nodes in the AST (debug output)
-    private static final char[] _spaces = 
-	"                                                       ".toCharArray();
-    protected static final int IndentIncrement = 4;
-
-    public SyntaxTreeNode() {
-	_line = 0;
-	_qname = null;
-    }
-
-    public SyntaxTreeNode(int line) {
-	_line = line;
-	_qname = null;
-    }
-
-    public SyntaxTreeNode(String uri, String prefix, String localname) {
-	_line = 0;
-	setQName(uri, prefix, localname);
-    }
-
-    public void setQName(QName qname) {
-	_qname = qname;
-    }
-
-    public void setQName(String uri, String prefix, String localname) {
-	_qname = new QName(uri, prefix, localname);
-    }
-
-    public QName getQName() {
-	return(_qname);
-    }
-
-    public void setAttributes(Attributes attributes) {
-	_attributes = attributes;
-    }
-
-    public String getAttribute(String qname) {
-	if (_attributes == null)
-	    return(Constants.EMPTYSTRING);
-	final String value = _attributes.getValue(qname);
-	if (value == null)
-	    return(Constants.EMPTYSTRING);
-	else
-	    return(value);
-    }
-
-    public Attributes getAttributes() {
-	return(_attributes);
-    }
-
-    public void setPrefixMapping(Hashtable mapping) {
-	_prefixMapping = mapping;
-    }
-
-    public Hashtable getPrefixMapping() {
-	return _prefixMapping;
-    }
-
-    public void addPrefixMapping(String prefix, String uri) {
-	if (_prefixMapping == null)
-	    _prefixMapping = new Hashtable();
-	_prefixMapping.put(prefix, uri);
-    }
-
-    public String lookupNamespace(String prefix) {
-	// Initialise the output (default is 'null' for undefined)
-	String uri = null;
-
-	// First look up the prefix/uri mapping in our own hashtable...
-	if (_prefixMapping != null)
-	    uri = (String)_prefixMapping.get(prefix);
-	// ... but if we can't find it there we ask our parent for the mapping
-	if ((uri == null) && (_parent != null)) {
-	    uri = _parent.lookupNamespace(prefix);
-	    if ((prefix == Constants.EMPTYSTRING) && (uri == null))
-		uri = Constants.EMPTYSTRING;
-	}
-	// ... and then we return whatever URI we've got.
-	return(uri);
-    }
-
-    public String lookupPrefix(String uri) {
-	// Initialise the output (default is 'null' for undefined)
-	String prefix = null;
-
-	// First look up the prefix/uri mapping in our own hashtable...
-	if ((_prefixMapping != null) &&
-	    (_prefixMapping.contains(uri))) {
-	    Enumeration prefixes = _prefixMapping.keys();
-	    while (prefixes.hasMoreElements()) {
-		prefix = (String)prefixes.nextElement();
-		String mapsTo = (String)_prefixMapping.get(prefix);
-		if (mapsTo.equals(uri)) return(prefix);
-	    }
-	}
-	// ... but if we can't find it there we ask our parent for the mapping
-	else if (_parent != null) {
-	    prefix = _parent.lookupPrefix(uri);
-	    if ((uri == Constants.EMPTYSTRING) && (prefix == null))
-		prefix = Constants.EMPTYSTRING;
-	}
-	return(prefix);
-    }
-
-    public void setParser(Parser parser) {
-	_parser = parser;
-    }
-
-    protected void setParent(SyntaxTreeNode parent) {
-	if (_parent == null)
-	    _parent = parent;
-    }
-    
-    public final SyntaxTreeNode getParent() {
-	return _parent;
-    }
-
-    public Stylesheet getStylesheet() {
-	SyntaxTreeNode parent = this;
-	while (parent != null) {
-	    if (parent instanceof Stylesheet)
-		return((Stylesheet)parent);
-	    parent = parent.getParent();
-	}
-	return((Stylesheet)parent);
-    }
-
-    public int getImportPrecedence() {
-	return getStylesheet().getImportPrecedence();
-    }
-
-    protected Template getTemplate() {
-	SyntaxTreeNode parent = this;
-	while ((parent != null) && (!(parent instanceof Template)))
-	    parent = parent.getParent();
-	return((Template)parent);
-    }
-
-    public final boolean isDummy() {
-        return this == Dummy;
-    }
-
-    public final Parser getParser() {
-	return _parser;
-    }
-
-    public final XSLTC getXSLTC() {
-	return _parser.getXSLTC();
-    }
-
-    public final SymbolTable getSymbolTable() {
-	if (_parser != null)
-	    return _parser.getSymbolTable();
-	else
-	    return null;
-    }
-
-    /**
-     * To be overridden in nodes implemented by code outside of applyTemplates
-     * eg. in Predicates
-     */
-    protected boolean isClosureBoundary() {
-	return false;
-    }
-
-    /**
-     * This method is normally overriden by subclasses.
-     * By default, it parses all the children of <tt>element</tt>.
-     */
-    public void parseContents(Parser parser) {
-	parseChildren(parser);
-    }
-
-    /**
-     * Parse all the children of <tt>element</tt>.
-     * XSLT commands are recognized by the XSLT namespace
-     */
-    public final void parseChildren(Parser parser) {
-
-	Vector locals = null;	// only create when needed
-	
-	final int count = _contents.size();
-	for (int i=0; i<count; i++) {
-	    SyntaxTreeNode child = (SyntaxTreeNode)_contents.elementAt(i);
-	    parser.getSymbolTable().setCurrentNode(child);
-	    child.parseContents(parser);
-	    // if variable or parameter, add it to scope
-	    final QName varOrParamName = updateScope(parser, child);
-	    if (varOrParamName != null) {
-		if (locals == null) {
-		    locals = new Vector(2);
-		}
-		locals.addElement(varOrParamName);
-	    }
-	}
-
-	parser.getSymbolTable().setCurrentNode(this);
-
-	// after the last element, remove any locals from scope
-	if (locals != null) {
-	    final int nLocals = locals.size();
-	    for (int i = 0; i < nLocals; i++) {
-		parser.removeVariable((QName)locals.elementAt(i));
-	    }
-	}
-    }
-   
-    /**
-     * Add a node to the current scope and return name of a variable or
-     * parameter if the node represents a variable or a parameter.
-     */
-    protected QName updateScope(Parser parser, SyntaxTreeNode node) {
-	if (node instanceof Variable) {
-	    final Variable var = (Variable)node;
-	    parser.addVariable(var);
-	    return var.getName();
-	}
-	else if (node instanceof Param) {
-	    final Param param = (Param)node;
-	    parser.addParameter(param);
-	    return param.getName();
-	}
-	else {
-	    return null;
-	}
-    }
-
-    /**
-     * Type check the children of this node. The type check phase may add
-     * coercions (CastExpr) to the AST.
-     */
-    public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError;
-
-    /**
-     * Call typeCheck() on every children of this node.
-     */
-    public Type typeCheckContents(SymbolTable stable) throws TypeCheckError {
-	final int n = elementCount();
-	for (int i = 0; i < n; i++) {
-	    SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
-	    item.typeCheck(stable);
-	}
-	return Type.Void;
-    }
-
-    /**
-     * Translate this node into JVM bytecodes.
-     */
-    public abstract void translate(ClassGenerator classGen,
-				   MethodGenerator methodGen);
-
-    /**
-     * Call translate() on every children of this node.
-     */
-    public void translateContents(ClassGenerator classGen,
-				  MethodGenerator methodGen) {
-	final int n = elementCount();
-	for (int i = 0; i < n; i++) {
-	    final SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
-	    item.translate(classGen, methodGen);
-	}
-
-	/**
-	 * After translation, unmap any registers for any variables/parameters
-	 * that were declared in this scope. Performing this unmapping in the
-	 * same AST scope as the declaration deals with the problems of
-	 * references falling out-of-scope inside the for-each element.
-	 * (the cause of which being 'lazy' register allocation for references)
-	 */
-	for (int i = 0; i < n; i++) {
-	    if( _contents.elementAt(i) instanceof VariableBase) {
-		final VariableBase var = (VariableBase)_contents.elementAt(i);
-		var.unmapRegister(methodGen);
-	    }
-	}
-    }
-
-    /**
-     * Utility method used by parameters and variables to store result trees
-     */
-    public void compileResultTree(ClassGenerator classGen,
-				  MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Save the current handler base on the stack
-	il.append(methodGen.loadHandler());
-
-	final String DOM_CLASS = classGen.getDOMClass();
-
-	// Create new instance of DOM class (with 64 nodes)
-	int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
-	il.append(new NEW(cpg.addClass(DOM_IMPL)));
-	il.append(DUP);
-	il.append(DUP);
-	il.append(new PUSH(cpg, 64));
-	il.append(new INVOKESPECIAL(index));
-
-	// Overwrite old handler with DOM handler
-	index = cpg.addMethodref(DOM_IMPL,
-				 "getOutputDomBuilder",
-				 "()" + TRANSLET_OUTPUT_SIG);
-
-	il.append(new INVOKEVIRTUAL(index));
-	il.append(DUP);
-	il.append(methodGen.storeHandler());
-
-	// Call startDocument on the new handler
-	il.append(methodGen.startDocument());
-
-	// Instantiate result tree fragment
-	translateContents(classGen, methodGen);
-
-	// Call endDocument on the new handler
-	il.append(methodGen.loadHandler());
-	il.append(methodGen.endDocument());
-
-	// Check if we need to wrap the DOMImpl object in a DOMAdapter object
-	if (!DOM_CLASS.equals(DOM_IMPL_CLASS)) {
-	    // new org.apache.xalan.xsltc.dom.DOMAdapter(DOMImpl,String[]);
-	    index = cpg.addMethodref(DOM_ADAPTER_CLASS,
-				     "<init>",
-				     "("+DOM_IMPL_SIG+
-				     "["+STRING_SIG+
-				     "["+STRING_SIG+")V");
-	    il.append(new NEW(cpg.addClass(DOM_ADAPTER_CLASS)));
-	    il.append(new DUP_X1());
-	    il.append(SWAP);
-	    // Give the DOM adapter an empty type mapping to start with.
-	    // Type mapping is expensive and will only be done when casting
-	    // a result tree fragment to a node-set.
-	    il.append(new ICONST(0));
-	    il.append(new ANEWARRAY(cpg.addClass(STRING)));
-	    il.append(DUP);
-	    il.append(new INVOKESPECIAL(index)); // leave DOMAdapter on stack
-	    
-	    // Must we wrap the DOMAdapter object in a MultiDOM object?
-	    /* Not needed with new design using DOM interface instead of
-	       referencing DOM classes directly
-	    if (DOM_CLASS.equals(MULTI_DOM_CLASS)) {
-		// new org.apache.xalan.xsltc.dom.MultiDOM(DOMAdapter);
-		index = cpg.addMethodref(MULTI_DOM_CLASS, "<init>",
-					 "("+DOM_INTF_SIG+")V");
-		il.append(new NEW(cpg.addClass(MULTI_DOM_CLASS)));
-		il.append(new DUP_X1());
-		il.append(SWAP);
-		il.append(new INVOKESPECIAL(index)); // leave MultiDOM on stack
-	    }
-	    */
-	}
-
-	// Restore old handler base from stack
-	il.append(SWAP);
-	il.append(methodGen.storeHandler());
-    }
-
-    /**
-     * Returns true if this expression/instruction depends on the context. By 
-     * default, every expression/instruction depends on the context unless it 
-     * overrides this method. Currently used to determine if result trees are 
-     * compiled using procedures or little DOMs.
-     */
-    public boolean contextDependent() {
-	return true;
-    }
-
-    /**
-     * Return true if any of the expressions/instructions in the contents of
-     * this node is context dependent.
-     */
-    public boolean dependentContents() {
-	final int n = elementCount();
-	for (int i = 0; i < n; i++) {
-	    final SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
-	    if (item.contextDependent()) {
-		return true;
-	    }
-	}
-	return false;
-    }
-
-    public final void addElement(SyntaxTreeNode element) {
-	_contents.addElement(element);
-	element.setParent(this);
-    }
-
-    public final void setFirstElement(SyntaxTreeNode element) {
-	_contents.insertElementAt(element,0);
-	element.setParent(this);
-    }
-
-    public final void removeElement(SyntaxTreeNode element) {
-	_contents.remove(element);
-	element.setParent(null);
-    }
-
-    public final Vector getContents() {
-	return _contents;
-    }
-
-    public final boolean hasContents() {
-	return elementCount() > 0;
-    }
-
-    public final int elementCount() {
-	return _contents.size();
-    }
-	
-    public final Enumeration elements() {
-	return _contents.elements();
-    }
-
-    public final Object elementAt(int i) {
-	return _contents.elementAt(i);
-    }
-
-    public void display(int indent) {
-	displayContents(indent);
-    }
-
-    protected void displayContents(int indent) {
-	final int n = elementCount();
-	for (int i = 0; i < n; i++) {
-	    SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
-	    item.display(indent);
-	}
-    }
-
-    protected final void indent(int indent) {
-	System.out.print(new String(_spaces, 0, indent));
-    }
-
-    public final int getLineNumber() {
-	return _line;
-    }
-
-    protected void reportError(SyntaxTreeNode element, Parser parser,
-			       int errorCode, String message) {
-	final ErrorMsg error = new ErrorMsg(errorCode, message, this);
-        parser.reportError(Constants.ERROR, error);
-    }
-
-    protected  void reportWarning(SyntaxTreeNode element, Parser parser,
-				  int errorCode, String message) {
-	final ErrorMsg error = new ErrorMsg(errorCode, message, this);
-        parser.reportError(Constants.WARNING, error);
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Template.java b/src/org/apache/xalan/xsltc/compiler/Template.java
deleted file mode 100644
index 1e88a09..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Template.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.JavaClass;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-public final class Template extends TopLevelElement {
-
-    private QName   _name;     // The name of the template (if any)
-    private QName   _mode;     // Mode in which this template is instantiated.
-    private Pattern _pattern;  // Matching pattern defined for this template.
-    private double  _priority; // Matching priority of this template.
-    private int     _position; // Position within stylesheet (prio. resolution)
-    private boolean _disabled = false;
-    private boolean _compiled = false;//make sure it is compiled only once
-
-    /**
-     * Set to <tt>true</tt> by the XPath parser if this template
-     * needs to create a variable frame. Variable frames are needed
-     * when certain parts of a template are compiled in external
-     * classes (e.g., predicates, xsl:number, xsl:sort).
-     */
-    private boolean _hasVariableFrame;
-    private boolean _hasParams = false;
-    private boolean _simplified = false;
-
-    public boolean hasParams() {
-	return _hasParams;
-    }
-
-    public void hasParams(boolean hasParams) {
-	_hasParams = hasParams;
-    }
-
-    public boolean isSimplified() {
-	return(_simplified);
-    }
-
-    public void setSimplified() {
-	_simplified = true;
-    }
-
-    public void disable() {
-	_disabled = true;
-    }
-
-    public boolean disabled() {
-	return(_disabled);
-    }
-
-    public double getPriority() {
-	return _priority;
-    }
-
-    public int getPosition() {
-	return(_position);
-    }
-
-    public boolean isNamed() {
-	return _name != null;
-    }
-
-    public Pattern getPattern() {
-	return _pattern;
-    }
-
-    public QName getName() {
-	return _name;
-    }
-
-    public QName getModeName() {
-	return _mode;
-    }
-
-    private Hashtable _variables;
-    private int _nextIndex;
-
-    public int allocateIndex(QName varName) {
-	if (_variables == null) { // first time
-	    _hasVariableFrame = true;
-	    (_variables = new Hashtable()).put(varName, new Integer(0));
-	    _nextIndex = 1;
-	    return 0;
-	}
-	else {
-	    Integer index = (Integer)_variables.get(varName);
-	    if (index == null) {
-		_variables.put(varName, index = new Integer(_nextIndex++));
-	    }
-	    return index.intValue();
-	}
-    }
-
-    private final int localVariablesCount() {
-	return _variables == null ? 0 : _variables.size();
-    }
-    
-    public void display(int indent) {
-	Util.println('\n');
-	indent(indent);
-	if (_name != null) {
-	    indent(indent);
-	    Util.println("name = " + _name);
-	}
-	else if (_pattern != null) {
-	    indent(indent);
-	    Util.println("match = " + _pattern.toString());
-	}
-	if (_mode != null) {
-	    indent(indent);
-	    Util.println("mode = " + _mode);
-	}
-	displayContents(indent + IndentIncrement);
-    }
-
-    private boolean resolveNamedTemplates(Template other, Parser parser) {
-
-	if (other == null) return true;
-
-	SymbolTable stable = parser.getSymbolTable();
-
-	final int us = this.getImportPrecedence();
-	final int them = other.getImportPrecedence();
-
-	if (us > them) {
-	    other.disable();
-	    return true;
-	}
-	else if (us < them) {
-	    stable.addTemplate(other);
-	    this.disable();
-	    return true;
-	}
-	else {
-	    return false;
-	}
-    }
-
-    private Stylesheet _stylesheet = null;
-
-    public Stylesheet getStylesheet() {
-	return _stylesheet;
-    }
-
-    public void parseContents(Parser parser) {
-
-	final String name     = getAttribute("name");
-	final String mode     = getAttribute("mode");
-	final String match    = getAttribute("match");
-	final String priority = getAttribute("priority");
-
-	_stylesheet = super.getStylesheet();
-
-	if (name.length() > 0) {
-	    _name = parser.getQName(name);
-	}
-	
-	if (mode.length() > 0) {
-	    _mode = parser.getQName(mode);
-	}
-	
-	if (match.length() > 0) {
-	    _pattern = parser.parsePattern(this, "match", null);
-	}
-
-	if (priority.length() > 0) {
-	    _priority = Double.parseDouble(priority);
-	}
-	else {
-	    if (_pattern != null)
-		_priority = _pattern.getPriority();
-	    else
-		_priority = Double.NaN;
-	}
-
-	_position = parser.getTemplateIndex();
-
-	// Add the (named) template to the symbol table
-	if (_name != null) {
-	    Template other = parser.getSymbolTable().addTemplate(this);
-	    if (!resolveNamedTemplates(other, parser)) {
-		parser.reportError( Constants.ERROR,
-		    new ErrorMsg(ErrorMsg.TMPREDEF_ERR,_name,this));
-	    }
-	}
-
-	parser.setTemplate(this);	// set current template
-	parseChildren(parser);
-	parser.setTemplate(null);	// clear template
-    }
-
-    /**
-     * When the parser realises that it is dealign with a simplified stylesheet
-     * it will create an empty Stylesheet object with the root element of the
-     * stylesheet (a LiteralElement object) as its only child. The Stylesheet
-     * object will then create this Template object and invoke this method to
-     * force some specific behaviour. What we need to do is:
-     *  o) create a pattern matching on the root node
-     *  o) add the LRE root node (the only child of the Stylesheet) as our
-     *     only child node
-     *  o) set the empty Stylesheet as our parent
-     *  o) set this template as the Stylesheet's only child
-     */
-    public void parseSimplified(Stylesheet stylesheet, Parser parser) {
-
-	_stylesheet = stylesheet;
-	setParent(stylesheet);
-
-	_name = null;
-	_mode = null;
-	_priority = Double.NaN;
-	_pattern = parser.parsePattern(this, "/");
-
-	final Vector contents = _stylesheet.getContents();
-	final SyntaxTreeNode root = (SyntaxTreeNode)contents.elementAt(0);
-
-	if (root instanceof LiteralElement) {
-	    addElement(root);
-	    root.setParent(this);
-	    contents.set(0, this);
-	    parser.setTemplate(this);
-	    root.parseContents(parser);
-	    parser.setTemplate(null);
-	}
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_pattern != null) {
-	    _pattern.typeCheck(stable);
-	}
-
-	return typeCheckContents(stable);
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_disabled) return;
-	// bug fix #4433133, add a call to named template from applyTemplates 
-	String className = classGen.getClassName();
-
-	if (_compiled && isNamed()){
-
-	    String methodName = _name.toString();
-	    methodName = methodName.replace('.', '$');
-	    methodName = methodName.replace('-', '$');
-
-	    il.append(classGen.loadTranslet());
-	    il.append(methodGen.loadDOM());
-	    il.append(methodGen.loadIterator());
-	    il.append(methodGen.loadHandler()); 
-	    il.append(methodGen.loadCurrentNode()); 
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
-							 methodName,
-							 "("
-							 + DOM_INTF_SIG
-							 + NODE_ITERATOR_SIG
-							 + TRANSLET_OUTPUT_SIG
-							 + "I)V")));
-	    return;
-	}
-
-	_compiled = true; 
-	
-	if (_hasVariableFrame) {
-	    il.append(classGen.loadTranslet());
-	    il.append(new PUSH(cpg, localVariablesCount()));
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 PUSH_VAR_FRAME,
-							 PUSH_VAR_FRAME_SIG)));
-	}
-	
-	final InstructionHandle start = il.getEnd();
-	translateContents(classGen, methodGen);
-	final InstructionHandle end = il.getEnd();
-	il.setPositions(true);
-	
-	if (_hasVariableFrame) {
-	    il.append(classGen.loadTranslet());
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS, 
-							 POP_VAR_FRAME,
-							 POP_VAR_FRAME_SIG)));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/TestSeq.java b/src/org/apache/xalan/xsltc/compiler/TestSeq.java
deleted file mode 100644
index 8f258cc..0000000
--- a/src/org/apache/xalan/xsltc/compiler/TestSeq.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Morten Jorgensen <morten.jorgensen@sun.com>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class TestSeq {
-
-    /*
-     * A test sequence is a sequence of patterns that
-     *
-     *  (1) occured in templates in the same mode
-     *  (2) share the same kernel node type (such as A/B and C/C/B).
-     *
-     * A test sequence may have a default template, which will be run if
-     * none of the patterns do not match. This template is always a template
-     * that matches solely on the shared kernel node type.
-     */
-    private Vector   _patterns = null; // all patterns
-    private Mode     _mode     = null; // the shared mode
-    private Template _default  = null; // the default template
-
-    private InstructionList _instructionList;
-
-    /**
-     * Creates a new test sequence, given a set of patterns and a mode.
-     */
-    public TestSeq(Vector patterns, Mode mode) {
-	_patterns = patterns;
-	_mode = mode;
-    }
-
-    /**
-     * The priority is only calculated if the test sequence has a default
-     * template. This is bad, bad, bad. We should get the priority from the
-     * other templates that make up the test sequence.
-     */
-    public double getPriority() {
-	double prio = (0 - Double.MAX_VALUE);
-	final int count = _patterns.size();
-	for (int i = 0; i < count; i++) {
-	    final Pattern pattern = (Pattern)_patterns.elementAt(i);
-	    final Template template = pattern.getTemplate();
-	    final double tp = template.getPriority();
-	    if (tp > prio) prio = tp;
-	}
-	if (_default != null) {
-	    final double tp = _default.getPriority();
-	    if (tp > prio) prio = tp;
-	}
-	return prio;
-    }
-
-    /**
-     * This method should return the last position of any template included
-     * in this test sequence.
-     */
-    public int getPosition() {
-	int pos = Integer.MIN_VALUE;
-	final int count = _patterns.size();
-	for (int i = 0; i < count; i++) {
-	    final Pattern pattern = (Pattern)_patterns.elementAt(i);
-	    final Template template = pattern.getTemplate();
-	    final int tp = template.getPosition();
-	    if (tp > pos) pos = tp;
-	}
-	if (_default != null) {
-	    final int tp = _default.getPosition();
-	    if (tp > pos) pos = tp;
-	}
-	return pos;
-    }
-	
-    /**
-     * Reduce the patterns in this test sequence to exclude the shared
-     * kernel node type. After the switch() in the translet's applyTemplates()
-     * we already know that we have a hit for the kernel node type, we only
-     * have the check the rest of the pattens.
-     */
-    public void reduce() {
-	final Vector newPatterns = new Vector();
-	final int count = _patterns.size();
-
-	// Traverse the existing set of patterns (they are in prioritised order)
-	for (int i = 0; i < count; i++) {
-	    final LocationPathPattern pattern =
-		(LocationPathPattern)_patterns.elementAt(i);
-	    // Reduce this pattern (get rid of kernel node type)
-	    pattern.reduceKernelPattern();
-			
-	    // Add this pattern to the new vector of patterns.
-	    if (!pattern.isWildcard()) {
-		newPatterns.addElement(pattern);
-	    }
-	    // Set template as default if its pattern matches purely on kernel
-	    else {
-		_default = pattern.getTemplate();
-		// Following patterns can be ignored since default has priority
-		break;
-	    }
-	}
-	_patterns = newPatterns;
-    }
-
-    /**
-     * Returns, by reference, the templates that are included in this test
-     * sequence. Remember that a single template can occur in several test
-     * sequences if its pattern is a union (ex. match="A/B | A/C").
-     */
-    public void findTemplates(Dictionary templates) {
-	if (_default != null)
-	    templates.put(_default, this);
-	for (int i = 0; i < _patterns.size(); i++) {
-	    final LocationPathPattern pattern =
-		(LocationPathPattern)_patterns.elementAt(i);
-	    templates.put(pattern.getTemplate(), this);
-	}
-    }
-
-    /**
-     * Get the instruction handle to a template's code. This is used when
-     * a single template occurs in several test sequences; that is, if its
-     * pattern is a union of patterns (ex. match="A/B | A/C").
-     */
-    private InstructionHandle getTemplateHandle(Template template) {
-	return (InstructionHandle)_mode.getTemplateInstructionHandle(template);
-    }
-
-    /**
-     * Returns pattern n in this test sequence
-     */
-    private LocationPathPattern getPattern(int n) {
-	return (LocationPathPattern)_patterns.elementAt(n);
-    }
-
-    /**
-     * Copile the code for this test sequence. The code will first test for
-     * the pattern with the highest priority, then go on to the next ones,
-     * until it hits or finds the default template.
-     */
-    public InstructionHandle compile(ClassGenerator classGen,
-				     MethodGenerator methodGen,
-				     InstructionHandle continuation) {
-
-	final int count = _patterns.size();
-
-	// EZ DC if there is only one (default) pattern
-	if (count == 0) getTemplateHandle(_default);
-
-	// The 'fail' instruction handle represents a branch to go to when
-	// test fails. It is updated in each iteration, so that the tests
-	// are linked together in the  if-elseif-elseif-else fashion.
-	InstructionHandle fail;
-
-	// Initialize 'fail' to either the code for the default template
-	if (_default != null)
-	    fail = getTemplateHandle(_default);
-	// ..or if that does not exist, to a location set by the caller.
-	else
-	    fail = continuation;
-
-	for (int n = (count - 1); n >= 0; n--) {
-	    final LocationPathPattern pattern = getPattern(n);
-	    final Template template = pattern.getTemplate();
-	    final InstructionList il = new InstructionList();
-
-	    // Patterns expect current node on top of stack
-	    il.append(methodGen.loadCurrentNode());
-	    // Apply the test-code compiled for the pattern
-	    il.append(pattern.compile(classGen, methodGen));
-
-	    // On success branch to the template code
-	    final InstructionHandle gtmpl = getTemplateHandle(template);
-	    final InstructionHandle success = il.append(new GOTO_W(gtmpl));
-	    pattern.backPatchTrueList(success);
-	    pattern.backPatchFalseList(fail);
-
-	    // We're working backwards here. The next pattern's 'fail' target
-	    // is this pattern's first instruction
-	    fail = il.getStart();
-
-	    // Append existing instruction list to the end of this one
-	    if (_instructionList != null) il.append(_instructionList);
-
-	    // Set current instruction list to be this one.
-	    _instructionList = il;
-	}
-	return fail;
-    }
-
-    /**
-     * Returns the instruction list for this test sequence
-     */
-    public InstructionList getInstructionList() {
-	return _instructionList;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Text.java b/src/org/apache/xalan/xsltc/compiler/Text.java
deleted file mode 100644
index 5358dff..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Text.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Text extends Instruction {
-    private String _text;
-    private boolean _escaping = true;
-
-    public Text() {}
-
-    public Text(String text) {
-	_text = text;
-    }
-
-    public String getText() {
-	return _text;
-    }
-
-    public void setText(String text) {
-	if (_text == null)
-	    _text = text;
-	else
-	    _text = _text + text; // compliation phase, so OK (well, maybe not)
-    }
-
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Text");
-	indent(indent + IndentIncrement);
-	Util.println(_text);
-    }
-		
-    public void parseContents(Parser parser) {
-        final String str = getAttribute("disable-output-escaping");
-	if ((str != null) && (str.equals("yes"))) {
-	    _escaping = false;
-	}
-	parseChildren(parser);
-    }
-	
-    public boolean contextDependent() {
-	return false;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_text != null && _text.length() > 0) {
-	    // Turn off character escaping if so is wanted.
-	    final int esc = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
-						      "setEscaping", "(Z)Z");
-	    // set escaping value in output handler 
-	    if (_escaping) {
-		il.append(methodGen.loadHandler());
-		il.append(new PUSH(cpg,true));
-		il.append(new INVOKEINTERFACE(esc, 2));
-	    } else {
-		il.append(methodGen.loadHandler());
-		il.append(new PUSH(cpg, false));
-		il.append(new INVOKEINTERFACE(esc, 2));
-	    }
-
-	    il.append(classGen.loadTranslet());
-	    il.append(new PUSH(cpg, _text));
-	    il.append(methodGen.loadHandler());
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							 CHARACTERSW,
-							 CHARACTERSW_SIG)));
-
-	    // Restore character escaping setting to whatever it was.
-	    // Note: setEscaping(bool) returns the original (old) value
-	    il.append(methodGen.loadHandler());
-	    il.append(SWAP);
-	    il.append(new INVOKEINTERFACE(esc, 2));
-	    il.append(POP);
-	}
-	translateContents(classGen, methodGen);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/TopLevelElement.java b/src/org/apache/xalan/xsltc/compiler/TopLevelElement.java
deleted file mode 100644
index 20eb58a..0000000
--- a/src/org/apache/xalan/xsltc/compiler/TopLevelElement.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Enumeration;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-class TopLevelElement extends SyntaxTreeNode {
-
-    /**
-     * Type check all the children of this node.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return typeCheckContents(stable);
-    }
-
-    /**
-     * Translate this node into JVM bytecodes.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	getParser().notYetImplemented("top-level-element: " + getClass());
-    }
-	
-    /**
-     * Translate this node into a fresh instruction list.
-     * The original instruction list is saved and restored.
-     */
-    public InstructionList compile(ClassGenerator classGen,
-				   MethodGenerator methodGen) {
-	final InstructionList result, save = methodGen.getInstructionList();
-	methodGen.setInstructionList(result = new InstructionList());
-	translate(classGen, methodGen);
-	methodGen.setInstructionList(save);
-	return result;
-    }
-
-    public void display(int indent) {
-	indent(indent);
-	Util.println("TopLevelElement");
-	displayContents(indent + IndentIncrement);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/TransletOutput.java b/src/org/apache/xalan/xsltc/compiler/TransletOutput.java
deleted file mode 100644
index d5e99d9..0000000
--- a/src/org/apache/xalan/xsltc/compiler/TransletOutput.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class TransletOutput extends Instruction {
-
-    private Expression _filename;
-
-    private final static String MISSING_FILE_ATTR =
-	"The <xsltc:output> element requires a 'file' attribute.";
-
-    /**
-     * Displays the contents of this <xsltc:output> element.
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("TransletOutput: " + _filename);
-    }
-		
-    /**
-     * Parse the contents of this <xsltc:output> element. The only attribute
-     * we recognise is the 'file' attribute that contains teh output filename.
-     */
-    public void parseContents(Parser parser) {
-	// Get the output filename from the 'file' attribute
-	String filename = getAttribute("file");
-
-	// Verify that the filename is in fact set
-	if ((filename == null) || (filename.equals(EMPTYSTRING))) {
-	    final ErrorMsg msg = new ErrorMsg(MISSING_FILE_ATTR);
-	    parser.reportError(Constants.ERROR, msg);
-	}
-
-	// Save filename as an attribute value template
-	_filename = AttributeValue.create(this, filename, parser);
-	parseChildren(parser);
-    }
-    
-    /**
-     * Type checks the 'file' attribute (must be able to convert it to a str).
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type type = _filename.typeCheck(stable);
-	if (type instanceof StringType == false) {
-	    _filename = new CastExpr(_filename, Type.String);
-	}
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-    
-    /**
-     * Compile code that opens the give file for output, dumps the contents of
-     * the element to the file, then closes the file.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Save the current output handler on the stack
-	il.append(methodGen.loadHandler());
-	
-	final int open =  cpg.addMethodref(TRANSLET_CLASS,
-					   "openOutputHandler",
-					   "("+STRING_SIG+")"+
-					   TRANSLET_OUTPUT_SIG);
-
-	final int close =  cpg.addMethodref(TRANSLET_CLASS,
-					    "closeOutputHandler",
-					    "("+TRANSLET_OUTPUT_SIG+")V");
-
-	// Create the new output handler (leave it on stack)
-	il.append(classGen.loadTranslet());
-	_filename.translate(classGen, methodGen);
-	il.append(new INVOKEVIRTUAL(open));
-
-	// Overwrite current handler
-	il.append(methodGen.storeHandler());
-	
-	// Translate contents with substituted handler
-	translateContents(classGen, methodGen);
-
-	// Close the output handler (close file)
-	il.append(classGen.loadTranslet());
-	il.append(methodGen.loadHandler());
-	il.append(new INVOKEVIRTUAL(close));
-
-	// Restore old output handler from stack
-	il.append(methodGen.storeHandler());
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java b/src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
deleted file mode 100644
index aef2c78..0000000
--- a/src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class UnaryOpExpr extends Expression {
-    private Expression _left;
-	
-    public UnaryOpExpr(Expression left) {
-	(_left = left).setParent(this);
-    }
-
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	_left.setParser(parser);
-    }
-    
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type tleft = _left.typeCheck(stable); 
-	final MethodType ptype = lookupPrimop(stable, "u-",
-					      new MethodType(Type.Void,
-							     tleft)); 
-	
-	if (ptype != null) {
-	    final Type arg1 = (Type) ptype.argsType().elementAt(0);
-	    if (!arg1.identicalTo(tleft)) {
-		_left = new CastExpr(_left, arg1);
-	    }
-	    return _type = ptype.resultType();
-	}
-
-	throw new TypeCheckError(this);
-    }
-
-    public String toString() {
-	return "u-" + '(' + _left + ')';
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	InstructionList il = methodGen.getInstructionList();
-	_left.translate(classGen, methodGen);
-	il.append(_type.NEG());
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java b/src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java
deleted file mode 100644
index cbd2d33..0000000
--- a/src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.dom.Axis;
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class UnionPathExpr extends Expression {
-    private final Expression _pathExpr;
-    private final Expression _rest;
-
-    // linearization for top level UnionPathExprs
-    private Expression[] _components;
-    
-    public UnionPathExpr(Expression pathExpr, Expression rest) {
-	_pathExpr = pathExpr;
-	_rest     = rest;
-    }
-    
-    public void setParser(Parser parser) {
-	super.setParser(parser);
-	// find all expressions in this Union
-	final Vector components = new Vector();
-	flatten(components);
-	final int size = components.size();
-	_components = (Expression[])components.toArray(new Expression[size]);
-	for (int i = 0; i < size; i++) {
-	    _components[i].setParser(parser);
-	    _components[i].setParent(this);
-	    if (_components[i] instanceof Step) {
-		Step step = (Step)_components[i];
-		if ((step.getAxis() == Axis.ATTRIBUTE) ||
-		    (step.getNodeType() == DOM.ATTRIBUTE)) {
-		    _components[i] = _components[0];
-		    _components[0] = step;
-		}
-	    }
-	}
-    }
-    
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final int length = _components.length;
-	for (int i = 0; i < length; i++) {
-	    if (_components[i].typeCheck(stable) != Type.NodeSet) {
-		_components[i] = new CastExpr(_components[i], Type.NodeSet);
-	    }
-	}
-	return _type = Type.NodeSet;	
-    }
-
-    public String toString() {
-	return "union(" + _pathExpr + ", " + _rest + ')';
-    }
-	
-    private void flatten(Vector components) {
-	components.addElement(_pathExpr);
-	if (_rest != null) {
-	    if (_rest instanceof UnionPathExpr) {
-		((UnionPathExpr)_rest).flatten(components);
-	    }
-	    else {
-		components.addElement(_rest);
-	    }
-	}
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final Instruction addIterator =
-	    new INVOKEVIRTUAL(cpg.addMethodref(UNION_ITERATOR_CLASS,
-					       ADD_ITERATOR,
-					       ADD_ITERATOR_SIG));
-	// create new UnionIterator
-	il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
-	il.append(DUP);
-	il.append(methodGen.loadDOM());
-	il.append(new INVOKESPECIAL(cpg.addMethodref(UNION_ITERATOR_CLASS,
-						     "<init>",
-						     "("
-						     + DOM_INTF_SIG
-						     + ")V")));
-	// UnionIterator is on the stack
-	final int length = _components.length;
-	for (int i = 0; i < length; i++) {
-	    _components[i].translate(classGen, methodGen);
-	    il.append(addIterator);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java b/src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java
deleted file mode 100644
index 4208a9c..0000000
--- a/src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class UnparsedEntityUriCall extends FunctionCall {
-    private Expression _entity;
-
-    public UnparsedEntityUriCall(QName fname, Vector arguments) {
-	super(fname, arguments);
-	_entity = argument();
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	final Type entity = _entity.typeCheck(stable);
-	if (entity instanceof StringType == false) {
-	    _entity = new CastExpr(_entity, Type.String);
-	}
-	return _type = Type.String;
-    }
-    
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	// Feck the this pointer on the stack...
-	il.append(classGen.loadTranslet());
-	// ...then the entity name...
-	_entity.translate(classGen, methodGen);
-	// ...to get the value from the hashtable in AbstractTranslet.
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-						     "getUnparsedEntity",
-						     "(Ljava/lang/String;)"+
-						     "Ljava/lang/String;")));
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java b/src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java
deleted file mode 100644
index b457650..0000000
--- a/src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import javax.xml.parsers.*;
-
-import org.xml.sax.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class UnsupportedElement extends SyntaxTreeNode {
-
-    private Fallback _fallback = null;
-    private String _message = null;
-
-    /**
-     * Basic consutrcor - stores element uri/prefix/localname
-     */
-    public UnsupportedElement(String uri, String prefix, String local) {
-	super(uri, prefix, local);
-    }
-
-    /**
-     * There are different categories of unsupported elements (believe it
-     * or not): there are elements within the XSLT namespace (these would
-     * be elements that are not yet implemented), there are extensions of
-     * other XSLT processors and there are unrecognised extension elements
-     * of this XSLT processor. The error message passed to this method
-     * should describe the unsupported element itself and what category
-     * the element belongs in.
-     */
-    public void setErrorMessage(String message) {
-	_message = message;
-    }
-
-    /**
-     * Displays the contents of this element
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Unsupported element = " + _qname.getNamespace() +
-		     ":" + _qname.getLocalPart());
-	displayContents(indent + IndentIncrement);
-    }
-
-
-    /**
-     * Scan all descendants and find the first xsl:fallback element (if any)
-     */
-    private SyntaxTreeNode findFallback(SyntaxTreeNode root) {
-
-	// First check if this element exists at all
-	if (root == null) return null;
-
-	// Then check if the element is an xsl:fallback element
-	if (root instanceof Fallback) return((Fallback)root);
-
-	// Then traverse all child elements
-	Vector children = root.getContents();
-	if (children != null) {
-	    final int count = children.size();
-	    for (int i = 0; i < count; i++) {
-		SyntaxTreeNode child = (SyntaxTreeNode)children.elementAt(i);
-		SyntaxTreeNode node = findFallback(child);
-		if (node != null) return node;
-	    }
-	}
-	return null;
-    }
-
-    /**
-     * Find any fallback in the descendant nodes; then activate & parse it
-     */
-    public void parseContents(Parser parser) {
-	_fallback = (Fallback)findFallback(this);
-	if (_fallback != null) {
-	    _fallback.activate();
-	    _fallback.parseContents(parser);
-	}
-    }
-
-    /**
-     * Run type check on the fallback element (if any).
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_fallback == null) {
-	    throw new TypeCheckError(new ErrorMsg(_message));
-	}
-	return(_fallback.typeCheck(stable));
-    }
-
-    /**
-     * Translate the fallback element (if any). The stylesheet should never
-     * be compiled if an unsupported element does not have a fallback element,
-     * so this method should never be called unless _fallback != null
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	if (_fallback != null) _fallback.translate(classGen, methodGen);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java b/src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java
deleted file mode 100644
index 9ce6bae..0000000
--- a/src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Iterator;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class UseAttributeSets extends Instruction {
-
-    // Only error that can occur:
-    private final static String ATTR_SET_NOT_FOUND =
-	"Attempting to use non-existing attribute set: ";
-
-    // Contains the names of all references attribute sets
-    private final Vector _sets = new Vector(2);
-
-    /**
-     * Constructur - define initial attribute sets to use
-     */
-    public UseAttributeSets(String setNames, Parser parser) {
-	setParser(parser);
-	addAttributeSets(setNames);
-    }
-
-    /**
-     * This method is made public to enable an AttributeSet object to merge
-     * itself with another AttributeSet (including any other AttributeSets
-     * the two may inherit from).
-     */
-    public void addAttributeSets(String setNames) {
-	if ((setNames != null) && (!setNames.equals(Constants.EMPTYSTRING))) {
-	    final StringTokenizer tokens = new StringTokenizer(setNames);
-	    while (tokens.hasMoreTokens()) {
-		final QName qname = getParser().getQName(tokens.nextToken());
-		_sets.add(qname);
-	    }
-	}
-    }
-
-    /**
-     * Do nada.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void;
-    }
-
-    /**
-     * Generate a call to the method compiled for this attribute set
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final SymbolTable symbolTable = getParser().getSymbolTable();
-
-	// Go through each attribute set and generate a method call
-	for (int i=0; i<_sets.size(); i++) {
-	    // Get the attribute set name
-	    final QName name = (QName)_sets.elementAt(i);
-	    // Get the AttributeSet reference from the symbol table
-	    final AttributeSet attrs = symbolTable.lookupAttributeSet(name);
-	    // Compile the call to the set's method if the set exists
-	    if (attrs != null) {
-		final String methodName = attrs.getMethodName();
-		il.append(classGen.loadTranslet());
-		il.append(methodGen.loadHandler());
-		il.append(methodGen.loadIterator());
-		final int method = cpg.addMethodref(classGen.getClassName(),
-						    methodName, ATTR_SET_SIG);
-		il.append(new INVOKESPECIAL(method));
-	    }
-	    // Generate an error if the attribute set does not exist
-	    else {
-		final ErrorMsg msg =  new ErrorMsg(ATTR_SET_NOT_FOUND+name,
-						   getLineNumber());
-		getParser().reportError(Constants.ERROR, msg);
-	    }
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/ValueOf.java b/src/org/apache/xalan/xsltc/compiler/ValueOf.java
deleted file mode 100644
index 070588a..0000000
--- a/src/org/apache/xalan/xsltc/compiler/ValueOf.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import de.fub.bytecode.generic.*;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class ValueOf extends Instruction {
-    private Expression _select;
-    private boolean _escaping = true;
-	
-    public void display(int indent) {
-	indent(indent);
-	Util.println("ValueOf");
-	indent(indent + IndentIncrement);
-	Util.println("select " + _select.toString());
-    }
-		
-    public void parseContents(Parser parser) {
-	_select = parser.parseExpression(this, "select", null);
-
-        // make sure required attribute(s) have been set
-        if (_select.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "select");
-	    return;
-        }
-        final String str = getAttribute("disable-output-escaping");
-	if ((str != null) && (str.equals("yes"))) _escaping = false;
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	Type type = _select.typeCheck(stable);
-	if ((type != null) && (type.identicalTo(Type.String) == false))
-	    _select = new CastExpr(_select, Type.String);
-	return Type.Void;
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final int setEscaping = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
-							  "setEscaping","(Z)Z");
-	final int characters = cpg.addMethodref(TRANSLET_CLASS,
-						CHARACTERSW,
-						CHARACTERSW_SIG);
-
-	// Turn off character escaping if so is wanted.
-	if (!_escaping) {
-	    il.append(methodGen.loadHandler());
-	    il.append(new PUSH(cpg,false));
-	    il.append(new INVOKEINTERFACE(setEscaping,2));
-	}
-
-	// Translate the contents.
-	il.append(classGen.loadTranslet());
-	_select.translate(classGen, methodGen);	
-	il.append(methodGen.loadHandler());
-	il.append(new INVOKEVIRTUAL(characters));
-
-	// Restore character escaping setting to whatever it was.
-	if (!_escaping) {
-	    il.append(methodGen.loadHandler());
-	    il.append(SWAP);
-	    il.append(new INVOKEINTERFACE(setEscaping,2));
-	    il.append(POP);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Variable.java b/src/org/apache/xalan/xsltc/compiler/Variable.java
deleted file mode 100644
index e18ac58..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Variable.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.Field;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.dom.Axis;
-
-final class Variable extends VariableBase {
-
-    // Index of this variable in the variable stack relative to base ptr
-    private int _stackIndex = -1;
-
-    private boolean _escapes; // 'true' if the variable's value can change
-
-    /**
-     * This method returns 'true' if the variable value can change over time,
-     * such as with varibles inside a for-each loop.
-     */
-    public void setEscapes() {
-	_escapes = true;
-	if (_stackIndex == -1) { // unassigned
-	    Template template = getTemplate();
-	    if (template != null) {
-		_stackIndex = template.allocateIndex(_name);
-	    }
-	}
-    }
-
-    /**
-     *
-     */
-    public int getStackIndex() {
-	return _stackIndex;
-    }
-
-    /**
-     * Parse the contents of the variable
-     */
-    public void parseContents(Parser parser) {
-	// parse attributes name and select (if present)
-	final String name = getAttribute("name");
-	if (name.length() > 0) {
-	    setName(parser.getQName(name));
-	}
-        else {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "name");
-	}
-
-	// check whether variable/param of the same name is already in scope
-	if (parser.lookupVariable(_name) != null) {
-	    reportError(this, parser, ErrorMsg.VARREDEF_ERR, _name.toString());
-	}
-
-	final String select = getAttribute("select");
-	if (select.length() > 0) {
-	    _select = parser.parseExpression(this, "select", null);
-	}
-
-	// Children must be parsed first -> static scoping
-	parseChildren(parser);
-
-	// Add a ref to this var to its enclosing construct
-	SyntaxTreeNode parent = getParent();
-	if (parent instanceof Stylesheet) {
-	    // Mark this as a global variable
-	    _isLocal = false;
-	    // Check if a global variable with this name already exists...
-	    Variable var = parser.getSymbolTable().lookupVariable(_name);
-	    // ...and if it does we need to check import precedence
-	    if (var != null) {
-		final int us = this.getImportPrecedence();
-		final int them = var.getImportPrecedence();
-		// It is an error if the two have the same import precedence
-		if (us == them) {
-		    reportError(this, parser, ErrorMsg.VARREDEF_ERR,
-				_name.toString());
-		}
-		// Ignore this if previous definition has higher precedence
-		else if (them > us) {
-		    return;
-		}
-		// Add this variable if we have higher precedence
-	    }
-	    ((Stylesheet)parent).addVariable(this);
-	    parser.getSymbolTable().addVariable(this);
-	}
-	else {
-	    _isLocal = true;
-	}
-    }
-
-    /**
-     * Runs a type check on either the variable element body or the
-     * expression in the 'select' attribute
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// Type check the 'select' expression if present
-	if (_select != null) {
-	    _type = _select.typeCheck(stable);
-	}
-	// Type check the element contents otherwise
-	else if (hasContents()) {
-	    typeCheckContents(stable);
-	    _type = Type.ResultTree;
-	}
-	else {
-	    _type = Type.Reference;
-	}
-	// The return type is void as the variable element does not leave
-	// anything on the JVM's stack. The '_type' global will be returned
-	// by the references to this variable, and not by the variable itself.
-	return Type.Void;
-    }
-
-    /**
-     * This method is part of a little trick that is needed to use local
-     * variables inside nested for-each loops. See the initializeVariables()
-     * method in the ForEach class for an explanation
-     */
-    public void initialize(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// This is only done for local variables that are actually used
-	if (isLocal() && !_refs.isEmpty()) {
-	    // Create a variable slot if none is allocated
-	    if (_local == null) {
-		_local = methodGen.addLocalVariable2(_name.getLocalPart(),
-						     _type.toJCType(),
-						     il.getEnd());
-	    }
-	    // Push the default value on the JVM's stack
-	    if ((_type instanceof IntType) ||
-		(_type instanceof NodeType) ||
-		(_type instanceof BooleanType))
-		il.append(new ICONST(0)); // 0 for node-id, integer and boolean
-	    else if (_type instanceof RealType)
-		il.append(new DCONST(0)); // 0.0 for floating point numbers
-	    else
-		il.append(new ACONST_NULL()); // and 'null' for anything else
-	    il.append(_type.STORE(_local.getIndex()));
-	}
-    }
-
-    /**
-     * Compile the value of the variable, which is either in an expression in
-     * a 'select' attribute, or in the variable elements body
-     */
-    public void translateValue(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	// Compile expression is 'select' attribute if present
-	if (_select != null) {
-	    _select.translate(classGen, methodGen);
-	    _select.startResetIterator(classGen, methodGen);
-	}
-	// If not, compile result tree from parameter body if present.
-	else if (hasContents()) {
-	    compileResultTree(classGen, methodGen);
-	}
-	// If neither are present then store empty string in variable
-	else {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final InstructionList il = methodGen.getInstructionList();
-	    il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	}
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	final String name = getVariable();
-
-	// Make sure that a variable instance is only compiled once
-	if (_compiled) return;
-	_compiled = true;
-
-	if (isLocal()) {
-	    // Push args to call addVariable()
-	    if (_escapes) {
-		il.append(classGen.loadTranslet());
-		il.append(new PUSH(cpg, _stackIndex));
-	    }
-
-	    // Compile variable value computation
-	    translateValue(classGen, methodGen);
-
-	    // Dup value only when needed
-	    if (_escapes) {
-		il.append(_type.DUP());
-	    }
-
-	    // Add a new local variable and store value
-	    if (_refs.isEmpty()) { // Remove it if nobody uses the value
-		il.append(_type.POP());
-		_local = null;
-	    }
-	    else {		   // Store in local var slot if referenced
-		if (_local == null) mapRegister(methodGen);
-		il.append(_type.STORE(_local.getIndex()));
-	    }
-
-	    // Store boxed value into the template's variable stack
-	    if (_escapes) {
-		_type.translateBox(classGen, methodGen);
-		il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-							     ADD_VARIABLE,
-							     ADD_VARIABLE_SIG)));
-	    }
-	}
-	else {
-	    String signature = _type.toSignature();
-
-	    // Global variables are store in class fields
-	    if (classGen.containsField(name) == null) {
-		classGen.addField(new Field(ACC_PUBLIC, 
-					    cpg.addUtf8(name),
-					    cpg.addUtf8(signature),
-					    null, cpg.getConstantPool()));
-
-		// Push a reference to "this" for putfield
-		il.append(classGen.loadTranslet());
-		// Compile variable value computation
-		translateValue(classGen, methodGen);
-		// Store the variable in the allocated field
-		il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),
-						       name, signature)));
-	    }
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/VariableBase.java b/src/org/apache/xalan/xsltc/compiler/VariableBase.java
deleted file mode 100644
index 628f9b5..0000000
--- a/src/org/apache/xalan/xsltc/compiler/VariableBase.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.Instruction;
-import de.fub.bytecode.generic.*;
-import de.fub.bytecode.classfile.Field;
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.dom.Axis;
-
-class VariableBase extends TopLevelElement {
-
-    protected QName       _name;            // The name of the variable.
-    protected String      _variable;        // The real name of the variable.
-    protected Type        _type;            // The type of this variable.
-    protected boolean     _isLocal;         // True if the variable is local.
-    protected LocalVariableGen _local;      // Reference to JVM variable
-    protected Instruction _loadInstruction; // Instruction to load JVM variable
-    protected Expression  _select;          // Reference to variable expression
-    protected int         _stackIndex = -1; // Stack index relative to base ptr.
-
-    // References to this variable (when local)
-    protected Vector      _refs = new Vector(2); 
-
-    // Used to make sure parameter field is not added twice
-    protected boolean    _compiled = false;
-
-    /**
-     * Add a reference to this variable. Called by VariableRef when an
-     * expression contains a reference to this variable.
-     */
-    public void addReference(VariableRefBase vref) {
-	_refs.addElement(vref);
-    }
-
-    /**
-     * Remove a reference to this variable. Called by VariableRef when this
-     * variable goes out of scope.
-     */
-    public void removeReference(VariableRefBase vref) {
-	_refs.remove(vref);
-    }
-
-    /**
-     * Map this variable to a register
-     */
-    public void mapRegister(MethodGenerator methodGen) {
-        if (_local == null) {
-            final InstructionList il = methodGen.getInstructionList();
-	    final String name = _name.getLocalPart(); // TODO: namespace ?
-	    final de.fub.bytecode.generic.Type varType = _type.toJCType();
-            _local = methodGen.addLocalVariable2(name, varType, il.getEnd());
-        }
-    }
-
-    /**
-     * Remove the mapping of this variable to a register.
-     * Called when we leave the AST scope of the variable's declaration
-     */
-    public void unmapRegister(MethodGenerator methodGen) {
-	if (_refs.isEmpty() && (_local != null)) {
-	    _local.setEnd(methodGen.getInstructionList().getEnd());
-	    methodGen.removeLocalVariable(_local);
-	    _refs = null;
-	    _local = null;
-	}
-    }
-
-    /**
-     * Returns a handle to the instruction for loading the value of this
-     * variable onto the JVM stack.
-     */
-    public Instruction loadInstruction() {
-	final Instruction instr = _loadInstruction;
-	if (_loadInstruction == null) 
-	    _loadInstruction = _type.LOAD(_local.getIndex());
-	return _loadInstruction;
-    }
-
-    /**
-     * Returns the expression from this variable's select attribute (if any)
-     */
-    public Expression getExpression() {
-	return(_select);
-    }
-
-    /**
-     * Display variable as single string
-     */
-    public String toString() {
-	return("variable("+_name+")");
-    }
-
-    /**
-     * Display variable in a full AST dump
-     */
-    public void display(int indent) {
-	indent(indent);
-	System.out.println("Variable " + _name);
-	if (_select != null) { 
-	    indent(indent + IndentIncrement);
-	    System.out.println("select " + _select.toString());
-	}
-	displayContents(indent + IndentIncrement);
-    }
-
-    /**
-     * Returns the type of the variable
-     */
-    public Type getType() {
-	return _type;
-    }
-
-    /**
-     * Returns the name of the variable or parameter as it will occur in the
-     * compiled translet.
-     */
-    public QName getName() {
-	return _name;
-    }
-
-    /**
-     * Returns the name of the variable or parameter as it occured in the
-     * stylesheet.
-     */
-    public String getVariable() {
-	return _variable;
-    }
-
-    private static String replace(String base, char c, String str) {
-	final int len = base.length() - 1;
-	int pos;
-	while ((pos = base.indexOf(c)) > -1) {
-	    if (pos == 0) {
-		final String after = base.substring(1);
-		base = str + after;
-	    }
-	    else if (pos == len) {
-		final String before = base.substring(0, pos);
-		base = before + str;
-	    }
-	    else {
-		final String before = base.substring(0, pos);
-		final String after = base.substring(pos+1);
-		base = before + str + after;
-	    }
-	}
-	return base;
-    }
-
-    /**
-     * Set the name of the variable or paremeter. Escape all special chars.
-     */
-    public void setName(QName name) {
-	_name = name;
-	_name.clearDefaultNamespace();
-
-	String prefix = name.getPrefix();
-	String local = name.getLocalPart();
-	local = replace(local, '.', "$dot$");
-	local = replace(local, '-', "$dash$");
-	_variable = local;
-    }
-
-    /**
-     * Returns the true if the variable is local
-     */
-    public boolean isLocal() {
-	return _isLocal;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/VariableRef.java b/src/org/apache/xalan/xsltc/compiler/VariableRef.java
deleted file mode 100644
index ee672b7..0000000
--- a/src/org/apache/xalan/xsltc/compiler/VariableRef.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class VariableRef extends VariableRefBase {
-
-    private boolean _escaped;
-	
-    public VariableRef(Variable variable) {
-	super(variable);
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if ( (_variable.isLocal()) && (_escaped = isEscaped()) )
-	    ((Variable)_variable).setEscapes();
-	return super.typeCheck(stable);
-    }
-
-    private boolean isEscaped() {
-	final SyntaxTreeNode limit = _variable.getParent();
-	SyntaxTreeNode parent = getParent();
-	do {
-	    if (parent.isClosureBoundary()) {
-		return true;
-	    }
-	    else {
-		parent = parent.getParent();
-	    }
-	}
-	while (parent != limit);
-	return limit.isClosureBoundary();
-    }
-
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-		
-	String name = _variable.getVariable();
-
-	if (_type.implementedAsMethod()) {
-	    // Fall-through for variables that are implemented as methods
-	    return;
-	}
-
-	if (_variable.isLocal()) {
-	    if (classGen.isExternal() || _escaped) {
-		il.append(classGen.loadTranslet());
-		final int sindex = ((Variable)_variable).getStackIndex();
-		il.append(new PUSH(cpg, sindex));
-		final int getVar = cpg.addMethodref(TRANSLET_CLASS, 
-						    GET_VARIABLE,
-						    GET_VARIABLE_SIG);
-		il.append(new INVOKEVIRTUAL(getVar));
-		_type.translateUnBox(classGen, methodGen);
-	    }
-	    else {
-		il.append(_variable.loadInstruction());
-		_variable.removeReference(this);
-	    }
-	}
-	else {
-	    final String signature = _type.toSignature();
-	    final String className = classGen.getClassName();
-	    il.append(classGen.loadTranslet());
-	    // If inside a predicate we must cast this ref down
-	    if (classGen.isExternal()) {
-		il.append(new CHECKCAST(cpg.addClass(className)));
-	    }
-	    il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java b/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
deleted file mode 100644
index f232f7f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-class VariableRefBase extends Expression {
-
-    protected final VariableBase _variable; // Reference to the associated var.
-
-    /**
-     * Created a new variable or parameter reference. Note that this base-
-     * class is not here mostly because variable and parameter references share
-     * a lot of functionality. The base class is needed more for having a
-     * single class to run 'if (instanceof)' on in the compiler code. The same
-     * holds for the variable base class.
-     * @param variable The referenced variable
-     */
-    public VariableRefBase(VariableBase variable) {
-	_variable = variable;
-	variable.addReference(this);
-    }
-
-    /**
-     * Returns a reference to the associated variable
-     * @return The referenced variable
-     */
-    public VariableBase getVariable() {
-	return(_variable);
-    }
-
-    /**
-     * Returns a string representation of this variable reference on the
-     * format 'variable-ref(<var-name>)'.
-     * @return Variable reference description
-     */
-    public String toString() {
-	return "variable-ref(" + _variable.getName() + ')';
-    }
-
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
-        // Attempt to get the cached variable type
-        _type = _variable.getType();
-
-        // If that does not work we must force a type-check (this is normally
-        // only needed for globals in included/imported stylesheets
-        if (_type == null) {
-            _variable.typeCheck(stable);
-            _type = _variable.getType();
-        }
-
-        // Return the type of the referenced variable
-        return _type;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/When.java b/src/org/apache/xalan/xsltc/compiler/When.java
deleted file mode 100644
index 429c338..0000000
--- a/src/org/apache/xalan/xsltc/compiler/When.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class When extends Instruction {
-
-    private static final String NO_CHOOSE_ERROR =
-	"Instruction 'when' must be used within a 'choose'.";
-	
-    private Expression _test;
-    private boolean _ignore = false;
-
-    public void display(int indent) {
-	indent(indent);
-	Util.println("When");
-	indent(indent + IndentIncrement);
-	System.out.print("test ");
-	Util.println(_test.toString());
-	displayContents(indent + IndentIncrement);
-    }
-		
-    public Expression getTest() {
-	return _test;
-    }
-
-    public boolean ignore() {
-	return(_ignore);
-    }
-
-    public void parseContents(Parser parser) {
-	_test = parser.parseExpression(this, "test", null);
-	if (_test instanceof ElementAvailableCall) {
-	    ElementAvailableCall call = (ElementAvailableCall)_test;
-	    _ignore = !call.getResult();
-	}
-	if (_test instanceof FunctionAvailableCall) {
-	    FunctionAvailableCall call = (FunctionAvailableCall)_test;
-	    _ignore = !call.getResult();
-	}
-
-	parseChildren(parser);
-
-	// Make sure required attribute(s) have been set
-	if (_test.isDummy()) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "test");
-	}
-    }
-
-    /**
-     * Type-check this when element. The test should always be type checked,
-     * while we do not bother with the contents if we know the test fails.
-     * This is important in cases where the "test" expression tests for
-     * the support of a non-available element, and the <xsl:when> body contains
-     * this non-available element.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	// Type-check the test expression
-	if (_test.typeCheck(stable) instanceof BooleanType == false) {
-	    _test = new CastExpr(_test, Type.Boolean);
-	}
-	// Type-check the contents (if necessary)
-	if (!_ignore) {
-	    typeCheckContents(stable);
-	}
-
-	return Type.Void;
-    }
-
-    /**
-     * This method should never be called. An Otherwise object will explicitly
-     * translate the "test" expression and and contents of this element.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ErrorMsg msg = new ErrorMsg(NO_CHOOSE_ERROR, getLineNumber());
-	getParser().reportError(Constants.ERROR, msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/Whitespace.java b/src/org/apache/xalan/xsltc/compiler/Whitespace.java
deleted file mode 100644
index a5c8759..0000000
--- a/src/org/apache/xalan/xsltc/compiler/Whitespace.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-
-import de.fub.bytecode.classfile.JavaClass;
-import de.fub.bytecode.classfile.Field;
-import de.fub.bytecode.classfile.Method;
-import de.fub.bytecode.generic.*;
-
-import org.apache.xalan.xsltc.dom.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class Whitespace extends TopLevelElement {
-    // Three possible actions for the translet:
-    public static final int USE_PREDICATE  = 0;
-    public static final int STRIP_SPACE    = 1;
-    public static final int PRESERVE_SPACE = 2;
-
-    // The 3 different categories of strip/preserve rules (order important)
-    public static final int RULE_NONE      = 0; 
-    public static final int RULE_ELEMENT   = 1; // priority 0
-    public static final int RULE_NAMESPACE = 2; // priority -1/4
-    public static final int RULE_ALL       = 3; // priority -1/2
-
-    private String _elementList;
-    private int    _action;
-    private int    _importPrecedence;
-
-    /**
-     * Auxillary class for encapsulating a single strip/preserve rule
-     */
-    private final static class WhitespaceRule {
-	private final int _action;
-	private String _namespace; // Should be replaced by NS type (int)
-	private String _element;   // Should be replaced by node type (int)
-	private int    _type;
-	private int    _priority;
-	
-	/**
-	 * Strip/preserve rule constructor
-	 */
-	public WhitespaceRule(int action, String element, int precedence) {
- 	    // Determine the action (strip or preserve) for this rule
-	    _action = action;
-
-	    // Get the namespace and element name for this rule
-	    final int colon = element.indexOf(':');
-	    if (colon >= 0) {
-		_namespace = element.substring(0,colon);
-		_element = element.substring(colon+1,element.length());
-	    }
-	    else {
-		_namespace = Constants.EMPTYSTRING;
-		_element = element;
-	    }
-
-	    // Determine the initial priority for this rule
-	    _priority = precedence << 2;
-
-	    // Get the strip/preserve type; either "NS:EL", "NS:*" or "*"
-	    if (_element.equals("*")) {
-		if (_namespace == Constants.EMPTYSTRING) {
-		    _type = RULE_ALL;       // Strip/preserve _all_ elements
-		    _priority += 2;         // Lowest priority
-		}
-		else {
-		    _type = RULE_NAMESPACE; // Strip/reserve elements within NS
-		    _priority += 1;         // Medium priority
-		}
-	    }
-	    else {
-		_type = RULE_ELEMENT;       // Strip/preserve single element
-	    }
-	}
-
-	/**
-	 * For sorting rules depending on priority
-	 */
-	public int compareTo(WhitespaceRule other) {
-	    return _priority < other._priority
-		? -1
-		: _priority > other._priority ? 1 : 0;
-	}
-
-	public int getAction() { return _action; }
-	public int getStrength() { return _type; }
-	public int getPriority() { return _priority; }
-	public String getElement() { return _element; }
-	public String getNamespace() { return _namespace; }
-    }
-
-    /**
-     * Parse the attributes of the xsl:strip/preserve-space element.
-     * The element should have not contents (ignored if any).
-     */
-    public void parseContents(Parser parser) {
-	// Determine if this is an xsl:strip- or preserve-space element
-	_action = _qname.getLocalPart().endsWith("strip-space") 
-	    ? STRIP_SPACE : PRESERVE_SPACE;
-
-	// Determine the import precedence
-	_importPrecedence = parser.getCurrentImportPrecedence();
-
-	// Get the list of elements to strip/preserve
-	_elementList = getAttribute("elements");
-	if (_elementList == null || _elementList.length() == 0) {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "elements");
-	    return;
-	}
-
-	final SymbolTable stable = parser.getSymbolTable();
-	StringTokenizer list = new StringTokenizer(_elementList);
-	StringBuffer elements = new StringBuffer(Constants.EMPTYSTRING);
-
-	while (list.hasMoreElements()) {
-	    String token = list.nextToken();
-	    String prefix;
-	    String namespace;
-	    int col;
-
-	    if ((col = token.indexOf(':')) != -1) {
-		prefix  = token.substring(0,col);
-	    }
-	    else {
-		prefix = Constants.EMPTYSTRING;
-	    }
-
-	    namespace = lookupNamespace(prefix);
-	    if (namespace != null)
-		elements.append(namespace+":"+
-				token.substring(col+1,token.length()));
-	    else
-		elements.append(token);
-
-	    if (list.hasMoreElements())
-		elements.append(" ");
-	}
-	_elementList = elements.toString();
-    }
-
-
-    /**
-     * De-tokenize the elements listed in the 'elements' attribute and
-     * instanciate a set of strip/preserve rules.
-     */
-    public Vector getRules() {
-	final Vector rules = new Vector();
-	// Go through each element and instanciate strip/preserve-object
-	final StringTokenizer list = new StringTokenizer(_elementList);
-	while (list.hasMoreElements()) {
-	    rules.add(new WhitespaceRule(_action,
-					 list.nextToken(),
-					 _importPrecedence));
-	}
-	return rules;
-    }
-    
-    
-    /**
-     * Scans through the rules vector and looks for a rule of higher
-     * priority that contradicts the current rule.
-     */
-    private static WhitespaceRule findContradictingRule(Vector rules,
-							WhitespaceRule rule) {
-	for (int i = 0; i < rules.size(); i++) {
-	    // Get the next rule in the prioritized list
-	    WhitespaceRule currentRule = (WhitespaceRule)rules.elementAt(i);
-	    // We only consider rules with higher priority
-	    if (currentRule == rule) {
-		return null;
-	    }
-	    
-	    /*
-	     * See if there is a contradicting rule with higher priority.
-	     * If the rules has the same action then this rule is redundant,
-	     * if they have different action then this rule will never win.
-	     */
-	    switch (currentRule.getStrength()) {
-	    case RULE_ALL:
-		return currentRule;
-		
-	    case RULE_ELEMENT:
-		if (!rule.getElement().equals(currentRule.getElement())) {
-		    break;
-		}
-		// intentional fall-through
-	    case RULE_NAMESPACE:
-		if (rule.getNamespace().equals(currentRule.getNamespace())) {
-		    return currentRule;
-		}
-		break;
-	    }
-	}
-	return null;
-    }
-
-
-    /**
-     * Orders a set or rules by priority, removes redundant rules and rules
-     * that are shadowed by stronger, contradicting rules.
-     */
-    private static int prioritizeRules(Vector rules) {
-	WhitespaceRule currentRule;
-	int defaultAction = PRESERVE_SPACE;
-
-	// Sort all rules with regard to priority
-	quicksort(rules, 0, rules.size()-1);
-
-	// Check if there are any "xsl:strip-space" elements at all.
-	// If there are no xsl:strip elements we can ignore all xsl:preserve
-	// elements and signal that all whitespaces should be preserved
-	boolean strip = false;
-	for (int i = 0; i < rules.size(); i++) {
-	    currentRule = (WhitespaceRule)rules.elementAt(i);
-	    if (currentRule.getAction() == STRIP_SPACE) {
-		strip = true;
-	    }
-	}
-	// Return with default action: PRESERVE_SPACE
-	if (!strip) {
-	    rules.removeAllElements();
-	    return PRESERVE_SPACE;
-	}
-
-	// Remove all rules that are contradicted by rules with higher priority
-	for (int idx = 0; idx < rules.size(); ) {
-	    currentRule = (WhitespaceRule)rules.elementAt(idx);
-	
-	    // Remove this single rule if it has no purpose
-	    if (findContradictingRule(rules,currentRule) != null) {
-		rules.remove(idx);
-	    }
-	    else {
-		// Remove all following rules if this one overrides all
-		if (currentRule.getStrength() == RULE_ALL) {
-		    defaultAction = currentRule.getAction();
-		    for (int i = idx; i < rules.size(); i++) {
-			rules.removeElementAt(i);
-		    }
-		}
-		// Skip to next rule (there might not be any)...
-		idx++;
-	    }
-	}
-
-	// The rules vector could be empty if first rule has strength RULE_ALL
-	if (rules.size() == 0) {
-	    return defaultAction;
-	}
-
-	// Now work backwards and strip away all rules that have the same
-	// action as the default rule (no reason the check them at the end).
-	do {
-	    currentRule = (WhitespaceRule)rules.lastElement();
-	    if (currentRule.getAction() == defaultAction) {
-		rules.removeElementAt(rules.size() - 1);
-	    }
-	    else {
-		break;
-	    }
-	} while (rules.size() > 0);
-	
-	// Signal that whitespace detection predicate must be used.
-	return defaultAction;
-    }
-
-    public static void compileStripSpace(BranchHandle strip[], 
-					 int sCount,
-					 InstructionList il) {
-	final InstructionHandle target = il.append(ICONST_1);
-	il.append(IRETURN);
-	for (int i = 0; i < sCount; i++) {
-	    strip[i].setTarget(target);
-	}
-    }
-
-    public static void compilePreserveSpace(BranchHandle preserve[], 
-					    int pCount,
-					    InstructionList il) {
-	final InstructionHandle target = il.append(ICONST_0);
-	il.append(IRETURN);
-	for (int i = 0; i < pCount; i++) {
-	    preserve[i].setTarget(target);
-	}
-    }
-
-    /*
-    private static void compileDebug(ClassGenerator classGen,
-				     InstructionList il) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final int prt = cpg.addMethodref("java/lang/System/out",
-					 "println",
-					 "(Ljava/lang/String;)V");
-	il.append(DUP);
-	il.append(new INVOKESTATIC(prt));
-    }
-    */
-
-    /**
-     * Compiles the predicate method
-     */
-    private static void compilePredicate(Vector rules,
-					 int defaultAction,
-					 ClassGenerator classGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	final XSLTC xsltc = classGen.getParser().getXSLTC();
-
-	// private boolean Translet.stripSpace(int type) - cannot be static
-	final MethodGenerator stripSpace =
-	    new MethodGenerator(ACC_PUBLIC | ACC_FINAL ,
-			de.fub.bytecode.generic.Type.BOOLEAN, 
-			new de.fub.bytecode.generic.Type[] {
-			    Util.getJCRefType(DOM_INTF_SIG),
-			    de.fub.bytecode.generic.Type.INT,
-			    de.fub.bytecode.generic.Type.INT
-			},
-			new String[] { "dom","node","type" },
-			"stripSpace",classGen.getClassName(),il,cpg);
-
-	classGen.addInterface("org/apache/xalan/xsltc/StripFilter");
-
-	final int paramDom = stripSpace.getLocalIndex("dom");
-	final int paramCurrent = stripSpace.getLocalIndex("node");
-	final int paramType = stripSpace.getLocalIndex("type");
-
-	BranchHandle strip[] = new BranchHandle[rules.size()];
-	BranchHandle preserve[] = new BranchHandle[rules.size()];
-	int sCount = 0;
-	int pCount = 0;
-
-	// Traverse all strip/preserve rules
-	for (int i = 0; i<rules.size(); i++) {
-	    // Get the next rule in the prioritised list
-	    WhitespaceRule rule = (WhitespaceRule)rules.elementAt(i);
-
-	    // Returns the namespace for a node in the DOM
-	    final int gns = cpg.addInterfaceMethodref(DOM_INTF,
-						      "getNamespaceName",
-						      "(I)Ljava/lang/String;");
-
-	    final int strcmp = cpg.addMethodref("java/lang/String",
-						"compareTo",
-						"(Ljava/lang/String;)I");
-
-	    // Handle elements="ns:*" type rule
-	    if (rule.getStrength() == RULE_NAMESPACE) {
-		il.append(new ALOAD(paramDom));
-		il.append(new ILOAD(paramCurrent));
-		il.append(new INVOKEINTERFACE(gns,2));
-		il.append(new PUSH(cpg, rule.getNamespace()));
-		il.append(new INVOKEVIRTUAL(strcmp));
-		il.append(ICONST_0);
-
-		if (rule.getAction() == STRIP_SPACE) {
-		    strip[sCount++] = il.append(new IF_ICMPEQ(null));
-		}
-		else {
-		    preserve[pCount++] = il.append(new IF_ICMPEQ(null));
-		}
-	    }
-	    // Handle elements="ns:el" type rule
-	    else if (rule.getStrength() == RULE_ELEMENT) {
-		// Create the QName for the element
-		final Parser parser = classGen.getParser();
-		QName qname;
-		if (rule.getNamespace() != Constants.EMPTYSTRING )
-		    qname = parser.getQName(rule.getNamespace(), null,
-					    rule.getElement());
-		else
-		    qname = parser.getQName(rule.getElement());
-
-		// Register the element.
-		final int elementType = xsltc.registerElement(qname);
-		il.append(new ILOAD(paramType));
-		il.append(new PUSH(cpg, elementType));
-
-		// Compare current node type with wanted element type
-		if (rule.getAction() == STRIP_SPACE)
-		    strip[sCount++] = il.append(new IF_ICMPEQ(null));
-		else
-		    preserve[pCount++] = il.append(new IF_ICMPEQ(null));
-	    }
-	}
-
-	if (defaultAction == STRIP_SPACE) {
-	    compileStripSpace(strip, sCount, il);
-	    compilePreserveSpace(preserve, pCount, il);
-	}
-	else {
-	    compilePreserveSpace(preserve, pCount, il);
-	    compileStripSpace(strip, sCount, il);
-	}
-
-	stripSpace.stripAttributes(true);
-	stripSpace.setMaxLocals();
-	stripSpace.setMaxStack();
-	stripSpace.removeNOPs();
-
-	classGen.addMethod(stripSpace.getMethod());
-    }
-
-    /**
-     * Compiles the predicate method
-     */
-    private static void compileDefault(int defaultAction,
-				       ClassGenerator classGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = new InstructionList();
-	final XSLTC xsltc = classGen.getParser().getXSLTC();
-
-	// private boolean Translet.stripSpace(int type) - cannot be static
-	final MethodGenerator stripSpace =
-	    new MethodGenerator(ACC_PUBLIC | ACC_FINAL ,
-			de.fub.bytecode.generic.Type.BOOLEAN, 
-			new de.fub.bytecode.generic.Type[] {
-			    Util.getJCRefType(DOM_INTF_SIG),
-			    de.fub.bytecode.generic.Type.INT,
-			    de.fub.bytecode.generic.Type.INT
-			},
-			new String[] { "dom","node","type" },
-			"stripSpace",classGen.getClassName(),il,cpg);
-
-	classGen.addInterface("org/apache/xalan/xsltc/StripFilter");
-
-	if (defaultAction == STRIP_SPACE)
-	    il.append(ICONST_1);
-	else
-	    il.append(ICONST_0);
-	il.append(IRETURN);
-
-	stripSpace.stripAttributes(true);
-	stripSpace.setMaxLocals();
-	stripSpace.setMaxStack();
-	stripSpace.removeNOPs();
-
-	classGen.addMethod(stripSpace.getMethod());
-    }
-
-
-    /**
-     * Takes a vector of WhitespaceRule objects and generates a predicate
-     * method. This method returns the translets default action for handling
-     * whitespace text-nodes:
-     *    - USE_PREDICATE  (run the method generated by this method)
-     *    - STRIP_SPACE    (always strip whitespace text-nodes)
-     *    - PRESERVE_SPACE (always preserve whitespace text-nodes)
-     */
-    public static int translateRules(Vector rules,
-				     ClassGenerator classGen) {
-	// Get the core rules in prioritized order
-	final int defaultAction = prioritizeRules(rules);
-	// The rules vector may be empty after prioritising
-	if (rules.size() == 0) {
-	    compileDefault(defaultAction,classGen);
-	    return defaultAction;
-	}
-	// Now - create a predicate method and sequence through rules...
-	compilePredicate(rules, defaultAction, classGen);
-	// Return with the translets required action (
-	return USE_PREDICATE;
-    }
-
-    /**
-     * Sorts a range of rules with regard to PRIORITY only
-     */
-    private static void quicksort(Vector rules, int p, int r) {
-	while (p < r) {
-	    final int q = partition(rules, p, r);
-	    quicksort(rules, p, q);
-	    p = q + 1;
-	}
-    }
-    
-    /**
-     * Used with quicksort method above
-     */
-    private static int partition(Vector rules, int p, int r) {
-	final WhitespaceRule x = (WhitespaceRule)rules.elementAt((p+r) >>> 1);
-	int i = p - 1, j = r + 1;
-	while (true) {
-	    while (x.compareTo((WhitespaceRule)rules.elementAt(--j)) < 0) {
-	    }
-	    while (x.compareTo((WhitespaceRule)rules.elementAt(++i)) > 0) {
-	    }
-	    if (i < j) {
-		final WhitespaceRule tmp = (WhitespaceRule)rules.elementAt(i);
-		rules.setElementAt(rules.elementAt(j), i);
-		rules.setElementAt(tmp, j);
-	    }
-	    else {
-		return j;
-	    }
-	}
-    }
-    
-    /**
-     * Type-check contents/attributes - nothing to do...
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	return Type.Void; // We don't return anything.
-    }
-
-    /**
-     * This method should not produce any code
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/WithParam.java b/src/org/apache/xalan/xsltc/compiler/WithParam.java
deleted file mode 100644
index 0cb4fe2..0000000
--- a/src/org/apache/xalan/xsltc/compiler/WithParam.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author John Howard <JohnH@schemasoft.com>
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import org.apache.xalan.xsltc.compiler.util.ReferenceType;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class WithParam extends Instruction {
-
-    private QName _name;
-    private Expression _select;
-
-    /**
-     * Displays the contents of this element
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("with-param " + _name);
-	if (_select != null) {
-	    indent(indent + IndentIncrement);
-	    Util.println("select " + _select.toString());
-	}
-	displayContents(indent + IndentIncrement);
-    }
-
-    /**
-     * The contents of a <xsl:with-param> elements are either in the element's
-     * 'select' attribute (this has precedence) or in the element body.
-     */
-    public void parseContents(Parser parser) {
-	final String name = getAttribute("name");
-	if (name.length() > 0) {
-	    _name = parser.getQName(name);
-	}
-        else {
-	    reportError(this, parser, ErrorMsg.NREQATTR_ERR, "name");
-        }
-	
-	final String select = getAttribute("select");
-	if (select.length() > 0) {
-	    _select = parser.parseExpression(this, "select", null);
-	}
-	
-	parseChildren(parser);
-    }
-
-    /**
-     * Type-check either the select attribute or the element body, depending
-     * on which is in use.
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_select != null) {
-	    final Type tselect = _select.typeCheck(stable);
-	    if (tselect instanceof ReferenceType == false) {
-		_select = new CastExpr(_select, Type.Reference);
-	    }
-	}
-	else {
-	    typeCheckContents(stable);
-	}
-	return Type.Void;
-    }
-
-    /**
-     * Compile the value of the parameter, which is either in an expression in
-     * a 'select' attribute, or in the with-param element's body
-     */
-    public void translateValue(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	// Compile expression is 'select' attribute if present
-	if (_select != null) {
-	    _select.translate(classGen, methodGen);
-	    _select.startResetIterator(classGen, methodGen);
-	}
-	// If not, compile result tree from parameter body if present.
-	else if (hasContents()) {
-	    compileResultTree(classGen, methodGen);
-	}
-	// If neither are present then store empty string in parameter slot
-	else {
-	    final ConstantPoolGen cpg = classGen.getConstantPool();
-	    final InstructionList il = methodGen.getInstructionList();
-	    il.append(new PUSH(cpg, Constants.EMPTYSTRING));
-	}
-    }
-
-    /**
-     * This code generates a sequence of bytecodes that call the
-     * addParameter() method in AbstractTranslet. The method call will add
-     * (or update) the parameter frame with the new parameter value.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Make name acceptable for use as field name in class
-	// TODO: convert to escape sequence like $dot$ and $dash$
-	String name = _name.getLocalPart(); // TODO: namespace ?
-	name = name.replace('.', '_');
-	name = name.replace('-', '_');
-
-	// Load reference to the translet (method is in AbstractTranslet)
-	il.append(classGen.loadTranslet());
-
-	// Load the name of the parameter
-	il.append(new PUSH(cpg, name)); // TODO: namespace ?
-	// Generete the value of the parameter (use value in 'select' by def.)
-	translateValue(classGen, methodGen);
-	// Mark this parameter value is not being the default value
-	il.append(new PUSH(cpg, false));
-	// Pass the parameter to the template
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
-						     ADD_PARAMETER,
-						     ADD_PARAMETER_SIG)));
-	il.append(POP); // cleanup stack
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/XSLTC.java b/src/org/apache/xalan/xsltc/compiler/XSLTC.java
deleted file mode 100644
index b80827f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/XSLTC.java
+++ /dev/null
@@ -1,833 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.io.*;
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.util.Date;
-import java.util.Map;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.jar.*;
-
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-
-import org.apache.xalan.xsltc.compiler.util.*;
-import org.apache.xalan.xsltc.cmdline.getopt.*;
-import org.apache.xalan.xsltc.DOM;
-import de.fub.bytecode.classfile.JavaClass;
-
-public final class XSLTC {
-
-    // A reference to the main stylesheet parser object.
-    private Parser _parser;
-
-    // A reference to an external XMLReader (SAX parser) passed to us
-    private XMLReader _reader = null;
-
-    // A reference to an external SourceLoader (for use with include/import)
-    private SourceLoader _loader = null;
-    
-    // A reference to the stylesheet being compiled.
-    private Stylesheet _stylesheet = null;
-
-    // Counters used by various classes to generate unique names.
-    // private int _variableSerial     = 1;
-    private int _modeSerial         = 1;
-    private int _stylesheetSerial   = 1;
-    private int _stepPatternSerial  = 1;
-    private int _helperClassSerial  = 0;
-    private int _attributeSetSerial = 0;
-    
-    private int[] _numberFieldIndexes;
-    
-    // Name index tables
-    private int       _nextGType;  // Next available element type
-    private Vector    _namesIndex; // Index of all registered QNames
-    private Hashtable _elements;   // Hashtable of all registered elements
-    private Hashtable _attributes; // Hashtable of all registered attributes
-
-    // Namespace index tables
-    private int       _nextNSType; // Next available namespace type
-    private Vector    _namespaceIndex; // Index of all registered namespaces
-    private Hashtable _namespaces; // Hashtable of all registered namespaces
-
-    // These define the various methods for outputting the translet
-    public static final int FILE_OUTPUT        = 0;
-    public static final int JAR_OUTPUT         = 1;
-    public static final int BYTEARRAY_OUTPUT   = 2;
-    public static final int CLASSLOADER_OUTPUT = 3;
-
-    // Compiler options (passed from command line or XSLTC client)
-    private boolean _debug = false;      // -x
-    private String  _jarFileName = null; // -j <jar-file-name>
-    private String  _className = null;   // -o <class-name>
-    private String  _packageName = null; // -p <package-name>
-    private File    _destDir = null;     // -d <directory-name>
-    private int     _outputType = FILE_OUTPUT; // by default
-
-    private Vector  _classes;
-    private boolean _multiDocument = false;
-
-    /**
-     * XSLTC compiler constructor
-     */
-    public XSLTC() {
-	_parser = new Parser(this);
-    }
-
-    /**
-     * Only for user by the internal TrAX implementation.
-     */
-    public void setParser(Parser parser) {
-	_parser = parser;
-    }
-
-    /**
-     * Only for user by the internal TrAX implementation.
-     */
-    public void setOutputType(int type) {
-	_outputType = type;
-    }
-
-    /**
-     * Initializes the compiler to compile a new stylesheet
-     */
-    public void init() {
-	reset();
-	_reader = null;
-	_classes = new Vector();
-    }
-    
-    /**
-     * Initializes the compiler to produce a new translet
-     */
-    private void reset() {
-	_nextGType      = DOM.NTYPES;
-	_elements       = new Hashtable();
-	_attributes     = new Hashtable();
-	_namespaces     = new Hashtable();
-	_namespaces.put("",new Integer(_nextNSType));
-	_namesIndex     = new Vector(128);
-	_namespaceIndex = new Vector(32);
-	_parser.init();
-	//_variableSerial     = 1;
-	_modeSerial         = 1;
-	_stylesheetSerial   = 1;
-	_stepPatternSerial  = 1;
-	_helperClassSerial  = 0;
-	_attributeSetSerial = 0;
-	_multiDocument      = false;
-	_numberFieldIndexes = new int[] {
-	    -1, 	// LEVEL_SINGLE
-	    -1, 	// LEVEL_MULTIPLE
-	    -1		// LEVEL_ANY
-	};
-    }
-
-    /**
-     * Defines an external SourceLoader to provide the compiler with documents
-     * referenced in xsl:include/import
-     * @param loader The SourceLoader to use for include/import
-     */    
-    public void setSourceLoader(SourceLoader loader) {
-	_loader = loader;
-    }
-
-    /**
-     * Set the parameters to use to locate the correct <?xml-stylesheet ...?>
-     * processing instruction in the case where the input document to the
-     * compiler (and parser) is an XML document.
-     * @param media The media attribute to be matched. May be null, in which
-     * case the prefered templates will be used (i.e. alternate = no).
-     * @param title The value of the title attribute to match. May be null.
-     * @param charset The value of the charset attribute to match. May be null.
-     */
-    public void setPIParameters(String media, String title, String charset) {
-	_parser.setPIParameters(media, title, charset);
-    }
-    
-    /**
-     * Compiles an XSL stylesheet pointed to by a URL
-     * @param url An URL containing the input XSL stylesheet
-     */
-    public boolean compile(URL url) {
-	try {
-	    // Open input stream from URL and wrap inside InputSource
-	    final InputStream stream = url.openStream();
-	    final InputSource input = new InputSource(stream);
-	    input.setSystemId(url.toString());
-	    return compile(input, _className);
-	}
-	catch (IOException e) {
-	    _parser.reportError(Constants.FATAL, new ErrorMsg(e.getMessage()));
-	    return false;
-	}
-    }
-
-    /**
-     * Compiles an XSL stylesheet pointed to by a URL
-     * @param url An URL containing the input XSL stylesheet
-     * @param name The name to assign to the translet class
-     */
-    public boolean compile(URL url, String name) {
-	try {
-	    // Open input stream from URL and wrap inside InputSource
-	    final InputStream stream = url.openStream();
-	    final InputSource input = new InputSource(stream);
-	    input.setSystemId(url.toString());
-	    return compile(input, name);
-	}
-	catch (IOException e) {
-	    _parser.reportError(Constants.FATAL, new ErrorMsg(e.getMessage()));
-	    return false;
-	}
-    }
-
-    /**
-     * Compiles an XSL stylesheet passed in through an InputStream
-     * @param input An InputStream that will pass in the stylesheet contents
-     * @param name The name of the translet class to generate
-     * @return 'true' if the compilation was successful
-     */
-    public boolean compile(InputStream stream, String name) {
-	final InputSource input = new InputSource(stream);
-	input.setSystemId(name); // We have nothing else!!!
-	return compile(input, name);
-    }
-
-    /**
-     * Compiles an XSL stylesheet passed in through an InputStream
-     * @param input An InputSource that will pass in the stylesheet contents
-     * @param name The name of the translet class to generate - can be null
-     * @return 'true' if the compilation was successful
-     */
-    public boolean compile(InputSource input, String name) {
-	try {
-	    // Reset globals in case we're called by compile(Vector v);
-	    reset();
-
-	    // The systemId may not be set, so we'll have to check the URL
-	    String systemId = null; 
-	    if (input != null) {
-	        systemId = input.getSystemId();
-	    }
-
-	    // Set the translet class name if not already set
-	    if (_className == null) {
-		if (name != null)
-		    setClassName(name);
-		else if (systemId != null)
-		    setClassName(Util.baseName(systemId));
-		else
-		    setClassName("GregorSamsa"); // default translet name
-	    }
-
-	    // Get the root node of the abstract syntax tree
-	    SyntaxTreeNode element = null;
-	    if (_reader == null) {
-		element = _parser.parse(input);
-	    }
-	    else {
-		element = _parser.parse(_reader, input);
-	    }
-
-	    // Compile the translet - this is where the work is done!
-	    if ((!_parser.errorsFound()) && (element != null)) {
-		// Create a Stylesheet element from the root node
-		_stylesheet = _parser.makeStylesheet(element);
-		_stylesheet.setSourceLoader(_loader);
-		_stylesheet.setSystemId(systemId);
-		_stylesheet.setParentStylesheet(null);
-		_parser.setCurrentStylesheet(_stylesheet);
-		// Create AST under the Stylesheet element (parse & type-check)
-		_parser.createAST(_stylesheet);
-	    }
-	    // Generate the bytecodes and output the translet class(es)
-	    if ((!_parser.errorsFound()) && (_stylesheet != null)) {
-		_stylesheet.setMultiDocument(_multiDocument);
-		_stylesheet.translate();
-	    }
-	}
-	catch (Exception e) {
-	    if (_debug) e.printStackTrace();
-	    _parser.reportError(Constants.FATAL, new ErrorMsg(e.getMessage()));
-	}
-	finally {
-	    _reader = null; // reset this here to be sure it is not re-used
-	    return !_parser.errorsFound();
-	}
-    }
-
-    /**
-     * Compiles a set of stylesheets pointed to by a Vector of URLs
-     * @param stylesheets A Vector containing URLs pointing to the stylesheets
-     * @return 'true' if the compilation was successful
-     */
-    public boolean compile(Vector stylesheets) {
-	// Get the number of stylesheets (ie. URLs) in the vector
-	final int count = stylesheets.size();
-	
-	// Return straight away if the vector is empty
-	if (count == 0) return true;
-
-	// Special handling needed if the URL count is one, becuase the
-	// _className global must not be reset if it was set explicitly
-	if (count == 1) {
-	    final Object url = stylesheets.firstElement();
-	    if (url instanceof URL)
-		return compile((URL)url);
-	    else
-		return false;
-	}
-	else {
-	    // Traverse all elements in the vector and compile
-	    final Enumeration urls = stylesheets.elements();
-	    while (urls.hasMoreElements()) {
-		_className = null; // reset, so that new name will be computed 
-		final Object url = urls.nextElement();
-		if (url instanceof URL) {
-		    if (!compile((URL)url)) return false;
-		}
-	    }
-	}
-	return true;
-    }
-
-    /**
-     * Returns an array of bytecode arrays generated by a compilation.
-     * @return JVM bytecodes that represent translet class definition
-     */
-    public byte[][] getBytecodes() {
-	final int count = _classes.size();
-	final byte[][] result = new byte[count][1];
-	for (int i = 0; i < count; i++)
-	    result[i] = (byte[])_classes.elementAt(i);
-	return result;
-    }
-
-    /**
-     * Compiles a stylesheet pointed to by a URL. The result is put in a
-     * set of byte arrays. One byte array for each generated class.
-     * @param name The name of the translet class to generate
-     * @param input An InputSource that will pass in the stylesheet contents
-     * @return JVM bytecodes that represent translet class definition
-     */
-    public byte[][] compile(String name, InputSource input) {
-	_outputType = BYTEARRAY_OUTPUT;
-	if (compile(input, name))
-	    return getBytecodes();
-	else
-	    return null;
-    }
-
-    /**
-     * Set the XMLReader to use for parsing the next input stylesheet
-     * @param reader XMLReader (SAX2 parser) to use
-     */
-    public void setXMLReader(XMLReader reader) {
-	_reader = reader;
-    }
-
-    /**
-     * Get a Vector containing all compile error messages
-     * @return A Vector containing all compile error messages
-     */
-    public Vector getErrors() {
-	return _parser.getErrors();
-    }
-
-    /**
-     * Get a Vector containing all compile warning messages
-     * @return A Vector containing all compile error messages
-     */
-    public Vector getWarnings() {
-	return _parser.getWarnings();
-    }
-
-    /**
-     * Print all compile error messages to standard output
-     */
-    public void printErrors() {
-	_parser.printErrors();
-    }
-
-    /**
-     * Print all compile warning messages to standard output
-     */
-    public void printWarnings() {
-	_parser.printWarnings();
-    }
-
-
-    /**
-     * This method is called by the XPathParser when it encounters a call
-     * to the document() function. Affects the DOM used by the translet.
-     */
-    protected void setMultiDocument(boolean flag) {
-	_multiDocument = flag;
-    }
-
-    public boolean isMultiDocument() {
-	return _multiDocument;
-    }
-
-    /**
-     * Set the class name for the generated translet. This class name is
-     * overridden if multiple stylesheets are compiled in one go using the
-     * compile(Vector urls) method.
-     * @param className The name to assign to the translet class
-     */
-    public void setClassName(String className) {
-	final String base  = Util.baseName(className);
-	final String noext = Util.noExtName(base); 
-	final String name  = Util.toJavaName(noext);
-	if (_packageName == null)
-	    _className = name;
-	else
-	    _className = _packageName + '.' + name;
-    }
-    
-    /**
-     * Get the class name for the generated translet.
-     */
-    public String getClassName() {
-	return _className;
-    }
-
-    /**
-     * Convert for Java class name of local system file name.
-     * (Replace '.' with '/' on UNIX and replace '.' by '\' on Windows/DOS.)
-     */
-    private String classFileName(final String className) {
-	return className.replace('.', File.separatorChar) + ".class";
-    }
-    
-    /**
-     * Generate an output File object to send the translet to
-     */
-    private File getOutputFile(String className) {
-	if (_destDir != null)
-	    return new File(_destDir, classFileName(className));
-	else
-	    return new File(classFileName(className));
-    }
-
-    /**
-     * Set the destination directory for the translet.
-     * The current working directory will be used by default.
-     */
-    public boolean setDestDirectory(String dstDirName) {
-	final File dir = new File(dstDirName);
-	if (dir.exists() || dir.mkdirs()) {
-	    _destDir = dir;
-	    return true;
-	}
-	else {
-	    _destDir = null;
-	    return false;
-	}
-    }
-
-    /**
-     * Set an optional package name for the translet and auxiliary classes
-     */
-    public void setPackageName(String packageName) {
-	_packageName = packageName;
-    }
-
-    /**
-     * Set the name of an optional JAR-file to dump the translet and
-     * auxiliary classes to
-     */
-    public void setJarFileName(String jarFileName) {
-	final String JAR_EXT = ".jar";
-	if (jarFileName.endsWith(JAR_EXT))
-	    _jarFileName = jarFileName;
-	else
-	    _jarFileName = jarFileName + JAR_EXT;
-	_outputType = JAR_OUTPUT;
-    }
-
-    public String getJarFileName() {
-	return _jarFileName;
-    }
-
-    /**
-     *
-     */
-    public Stylesheet getStylesheet() {
-	return _stylesheet;
-    }
-
-    /**
-     *
-     */
-    public void setStylesheet(Stylesheet stylesheet) {
-	if (_stylesheet == null)
-	    _stylesheet = stylesheet;
-    }
-   
-    /**
-     * Registers an attribute and gives it a type so that it can be mapped to
-     * DOM attribute types at run-time.
-     */
-    public int registerAttribute(QName name) {
-	Integer code = (Integer)_attributes.get(name);
-	if (code == null) {
-	    _attributes.put(name, code = new Integer(_nextGType++));
-	    final String uri = name.getNamespace();
-	    final String local = "@"+name.getLocalPart();
-	    if ((uri != null) && (!uri.equals("")))
-		_namesIndex.addElement(uri+":"+local);
-	    else
-		_namesIndex.addElement(local);
-	    if (name.getLocalPart().equals("*")) {
-		registerNamespace(name.getNamespace());
-	    }
-	}
-	return code.intValue();
-    }
-
-    /**
-     * Registers an element and gives it a type so that it can be mapped to
-     * DOM element types at run-time.
-     */
-    public int registerElement(QName name) {
-	// Register element (full QName)
-	Integer code = (Integer)_elements.get(name.toString());
-	if (code == null) {
-	    _elements.put(name.toString(), code = new Integer(_nextGType++));
-	    _namesIndex.addElement(name.toString());
-	}
-	if (name.getLocalPart().equals("*")) {
-	    registerNamespace(name.getNamespace());
-	}
-	return code.intValue();
-    }
-
-    /**
-     * Registers a namespace and gives it a type so that it can be mapped to
-     * DOM namespace types at run-time.
-     */
-    public int registerNamespace(String namespaceURI) {
-	Integer code = (Integer)_namespaces.get(namespaceURI);
-	if (code == null) {
-	    code = new Integer(_nextNSType++);
-	    _namespaces.put(namespaceURI,code);
-	    _namespaceIndex.addElement(namespaceURI);
-	}
-	return code.intValue();
-    }
-    
-    /*
-    public int nextVariableSerial() {
-	return _variableSerial++;
-    }
-    */
-
-    public int nextModeSerial() {
-	return _modeSerial++;
-    }
-
-    public int nextStylesheetSerial() {
-	return _stylesheetSerial++;
-    }
-
-    public int nextStepPatternSerial() {
-	return _stepPatternSerial++;
-    }
-
-    public int[] getNumberFieldIndexes() {
-	return _numberFieldIndexes;
-    }
-
-    public int nextHelperClassSerial() {
-	return _helperClassSerial++;
-    }
-    
-    public int nextAttributeSetSerial() {
-	return _attributeSetSerial++;
-    }
-
-    public Vector getNamesIndex() {
-	return _namesIndex;
-    }
-
-    public Vector getNamespaceIndex() {
-	return _namespaceIndex;
-    }
-    
-    /**
-     * Returns a unique name for every helper class needed to
-     * execute a translet.
-     */
-    public String getHelperClassName() {
-	return getClassName() + '$' + _helperClassSerial++;
-    }
-   
-    public void dumpClass(JavaClass clazz) {
-	try {
-	    switch (_outputType) {
-	    case FILE_OUTPUT:
-		clazz.dump(getOutputFile(clazz.getClassName()));
-		break;
-	    case JAR_OUTPUT:
-		_classes.addElement(clazz);	 
-		break;
-	    case BYTEARRAY_OUTPUT:
-	    case CLASSLOADER_OUTPUT:
-		ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
-		clazz.dump(out);
-		_classes.addElement(out.toByteArray());
-		break;
-	    }
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	}
-    }
-
-    /**
-     * File separators are converted to forward slashes for ZIP files.
-     */
-    private String entryName(File f) throws IOException {
-	return f.getName().replace(File.separatorChar, '/');
-    }
-    
-    /**
-     * Generate output JAR-file and packages
-     */
-    public void outputToJar() throws IOException {
-	// create the manifest
-	final Manifest manifest = new Manifest();
-	final java.util.jar.Attributes atrs = manifest.getMainAttributes();
-	atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.0");
-
-	final Map map = manifest.getEntries();
-	// create manifest
-	Enumeration classes = _classes.elements();
-	final String now = (new Date()).toString();
-	final java.util.jar.Attributes.Name dateAttr = 
-	    new java.util.jar.Attributes.Name("Date");
-	while (classes.hasMoreElements()) {
-	    final JavaClass clazz = (JavaClass)classes.nextElement();
-	    final java.util.jar.Attributes attr = new java.util.jar.Attributes();
-	    attr.put(dateAttr, now);
-	    map.put(classFileName(clazz.getClassName()), attr);
-	}
-
-	final File jarFile = new File(_destDir, _jarFileName);
-	final JarOutputStream jos =
-	    new JarOutputStream(new FileOutputStream(jarFile), manifest);
-	classes = _classes.elements();
-	while (classes.hasMoreElements()) {
-	    final JavaClass cl = (JavaClass)classes.nextElement();
-	    jos.putNextEntry(new JarEntry(classFileName(cl.getClassName())));
-	    final ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
-	    cl.dump(out);	// dump() closes it's output stream
-	    out.writeTo(jos);
-	}
-	jos.close();
-    }
-
-    /**
-     * Turn debugging messages on/off
-     */
-    public void setDebug(boolean debug) {
-	_debug = debug;
-    }
-
-    /**
-     * Get current debugging message setting
-     */
-    public boolean debug() {
-	return _debug;
-    }
-        
-    /** 
-     * This method implements the command line compiler. See the USAGE_STRING
-     * constant for a description. It may make sense to move the command-line
-     * handling to a separate package (ie. make one xsltc.cmdline.Compiler
-     * class that contains this main() method and one xsltc.cmdline.Transform
-     * class that contains the DefaultRun stuff).
-     */
-    public static void main(String[] args) {
-	try {
-	    boolean inputIsURL = false;
-
-	    final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhs");
-	    if (args.length < 1) {
-		printUsage();
-		return;
-	    }
-
-	    final XSLTC xsltc = new XSLTC();
-	    xsltc.init();
-
-	    int c;
-	    while ((c = getopt.getNextOption()) != -1) {
-		switch(c) {
-		case 'o':
-		    xsltc.setClassName(getopt.getOptionArg());
-		    break;
-		case 'd':
-		    xsltc.setDestDirectory(getopt.getOptionArg());
-		    break;
-		case 'p':
-		    xsltc.setPackageName(getopt.getOptionArg());
-		    break;
-		case 'j':  
-		    xsltc.setJarFileName(getopt.getOptionArg());
-		    break;
-		case 'x':
-		    xsltc.setDebug(true);
-		    break;
-		case 'u':
-		    inputIsURL = true;
-		    break;
-		case 's':
-		    allowSystemExit = false;
-		    break;
-		case 'h':
-		default:
-		    printUsage();
-		    break; 
-		}
-	    }
-
-	    // Generate a vector containg URLs for all stylesheets specified
-	    final String[] stylesheetNames = getopt.getCmdArgs();
-	    final Vector   stylesheetVector = new Vector();
-	    for (int i = 0; i < stylesheetNames.length; i++) {
-		final String stylesheetName = stylesheetNames[i];
-		final URL    stylesheetURL;
-		if (inputIsURL) {
-		    stylesheetVector.addElement(new URL(stylesheetName));
-		}
-		else {
-		    stylesheetVector.addElement((new File(stylesheetName)).toURL());
-		}
-
-	    }
-
-	    // Compile the stylesheet and output class/jar file(s)
-	    if (xsltc.compile(stylesheetVector)) {
-		if (xsltc.getJarFileName() != null) xsltc.outputToJar();
-	    }
-	    else {
-		Util.println("compilation failed");
-		doSystemExit(1); return;
-	    }
-	}
-	catch (GetOptsException ex) {
-	    System.err.println(ex);
-	    printUsage();
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	    doSystemExit(1);
-	}
-    }
-
-    /** If we should call System.exit or not */
-    protected static boolean allowSystemExit = true;
-
-    /** Worker method to call System.exit or not */
-    protected static void doSystemExit(int retVal) {
-        if (allowSystemExit)
-            System.exit(retVal);
-    }
-
-    private final static String USAGE_STRING =
-	"Usage:\n" + 
-	"   xsltc [-o <output>] [-d <directory>] [-j <jarfile>]\n"+
-	"         [-p <package name>] [-x] [-s] [-u] <stylesheet>... \n\n"+
-	"   Where <output> is the name to give the the generated translet.\n"+
-	"         <stylesheet> is one or more stylesheet file names, or if,\n"+
-	"         the -u options is specified, one or more stylesheet URLs.\n"+
-	"         <directory> is the output directory.\n"+
-	"         <jarfile> is the name of a JAR-file to put all generated classes in.\n"+
-	"         <package-name> is a package name to prefix all class names with.\n\n"+
-	"   Notes:\n"+
-	"         The -o option is ignored when multiple stylesheets are specified.\n"+
-	"         The -x option switched on debug messages.\n"+
-	"         The -s option prevents the compiler from exiting\n";
-    
-    public static void printUsage() {
-	System.err.println(USAGE_STRING);
-	doSystemExit(1);
-	return;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/XslAttribute.java b/src/org/apache/xalan/xsltc/compiler/XslAttribute.java
deleted file mode 100644
index 779fb38..0000000
--- a/src/org/apache/xalan/xsltc/compiler/XslAttribute.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Gunnlaugur Briem <gthb@dimon.is>
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class XslAttribute extends Instruction {
-
-    // Error messages:
-    private final static String ILLEGAL_ATTRIBUTE_NAME =
-	"Illegal attribute name: 'xmlns'";
-
-    // Attribute contents
-    private AttributeValue _name; // name treated as AVT (7.1.3)
-    private AttributeValueTemplate _namespace = null;
-    private String _prefix;
-    private boolean _ignore = false;
-
-    /**
-     * Returns the name of the attribute
-     */
-    public AttributeValue getName() {
-	return _name;
-    }
-
-    /**
-     * Displays the contents of the attribute
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Attribute " + _name);
-	displayContents(indent + IndentIncrement);
-    }
-		
-    /**
-     * Parses the attribute's contents. Special care taken for namespaces.
-     */
-    public void parseContents(Parser parser) {
-
-	final SymbolTable stable = parser.getSymbolTable();
-	String namespace = getAttribute("namespace");
-	String name = getAttribute("name");
-	QName qname = parser.getQName(name);
-	final String prefix = qname.getPrefix();
-	boolean generated = false;
-
-	if ((prefix != null) && (prefix.equals("xmlns"))) {
-	    reportError(this, parser, ErrorMsg.ILL_ATTR_ERR, name);
-	    return;
-	}
-
-	// Ignore attribute if preceeded by some other type of element
-	final SyntaxTreeNode parent = getParent();
-	final Vector siblings = parent.getContents();
-	for (int i = 0; i < parent.elementCount(); i++) {
-	    SyntaxTreeNode item = (SyntaxTreeNode)siblings.elementAt(i);
-	    if (item == this) break;
-	    // These three objects result in one or more attribute output
-	    if (item instanceof XslAttribute) continue;
-	    if (item instanceof UseAttributeSets) continue;
-	    if (item instanceof LiteralAttribute) continue;
-	    // These objects _can_ result in one or more attribute
-	    // The output handler will generate an error if not (at runtime)
-	    if (item instanceof If) continue;
-	    if (item instanceof Choose) continue;
-	    if (item instanceof CopyOf) continue;  // bug fix 3320, g. briem
-	    _ignore = true;
-	    reportWarning(this, parser, ErrorMsg.ATTROUTS_ERR, name);
-	    return;
-	}
-
-	// Get namespace from namespace attribute?
-	if ((namespace != null) && (namespace != Constants.EMPTYSTRING)) {
-	    // Prefix could be in symbol table
-	    _prefix = lookupPrefix(namespace);
-	    _namespace = new AttributeValueTemplate(namespace, parser);
-	}
-	// Get namespace from prefix in name attribute?
-	else if ((prefix != null) && (prefix != Constants.EMPTYSTRING)) {
-	    _prefix = prefix;
-	    namespace = lookupNamespace(prefix);
-	    if (namespace != null)
-		_namespace = new AttributeValueTemplate(namespace, parser);
-	}
-	
-	// Common handling for namespaces:
-	if (_namespace != null) {
-
-	    // Generate prefix if we have none
-	    if (_prefix == null) {
-		if (prefix != null) {
-		    _prefix = prefix;
-		}
-		else {
-		    _prefix = stable.generateNamespacePrefix();
-		    generated = true;
-		}
-	    }
-
-	    if (_prefix == Constants.EMPTYSTRING) {
-		name = qname.getLocalPart();
-	    }
-	    else {
-		name = _prefix+":"+qname.getLocalPart();
-		// PROBLEM:
-		// The namespace URI must be passed to the parent element,
-		// but we don't yet know what the actual URI is (as we only
-		// know it as an attribute value template). New design needed.
-		if ((parent instanceof LiteralElement) && (!generated)) {
-		    ((LiteralElement)parent).registerNamespace(_prefix,
-							       namespace,
-							       stable,false);
-		}
-	    }
-	}
-
-	if (name.equals("xmlns")) {
-	    final ErrorMsg msg = 
-		new ErrorMsg(ILLEGAL_ATTRIBUTE_NAME, getLineNumber());
-	    parser.reportError(Constants.ERROR, msg);
-	    return;
-	}
-
-	if (parent instanceof LiteralElement) {
-	    ((LiteralElement)parent).addAttribute(this);
-	}
-
-	_name = AttributeValue.create(this, name, parser);
-	parseChildren(parser);
-    }
-	
-    /**
-     *
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (_ignore) return(Type.Void);
-	_name.typeCheck(stable);
-	if (_namespace != null)
-	    _namespace.typeCheck(stable);
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    /**
-     *
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_ignore) return;
-	_ignore = true;
-
-	// Compile code that emits any needed namespace declaration
-	if (_namespace != null) {
-	    // public void attribute(final String name, final String value)
-	    il.append(methodGen.loadHandler());
-	    il.append(new PUSH(cpg,_prefix));
-	    _namespace.translate(classGen,methodGen);
-	    il.append(methodGen.namespace());
-	}
-
-	// Save the current handler base on the stack
-	il.append(methodGen.loadHandler());
-	il.append(DUP);		// first arg to "attributes" call
-	
-	// Push attribute name
-	_name.translate(classGen, methodGen);// 2nd arg
-
-	// Push attribute value - shortcut for literal strings
-	if ((elementCount() == 1) && (elementAt(0) instanceof Text)) {
-	    il.append(new PUSH(cpg, ((Text)elementAt(0)).getText()));
-	}
-	else {
-	    il.append(classGen.loadTranslet());
-	    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
-						   "stringValueHandler",
-						   STRING_VALUE_HANDLER_SIG)));
-	    il.append(DUP);
-	    il.append(methodGen.storeHandler());
-	    // translate contents with substituted handler
-	    translateContents(classGen, methodGen);
-	    // get String out of the handler
-	    il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
-							 "getValue",
-							 "()" + STRING_SIG)));
-	}
-
-	// call "attribute"
-	il.append(methodGen.attribute());
-	// Restore old handler base from stack
-	il.append(methodGen.storeHandler());
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/XslElement.java b/src/org/apache/xalan/xsltc/compiler/XslElement.java
deleted file mode 100644
index 5d1a227..0000000
--- a/src/org/apache/xalan/xsltc/compiler/XslElement.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-final class XslElement extends Instruction {
-
-    private AttributeValue _name; // name treated as AVT (7.1.3)
-    private AttributeValueTemplate _namespace = null;
-    private String  _prefix;
-    private boolean _ignore = false;
-
-    /**
-     * Displays the contents of the element
-     */
-    public void display(int indent) {
-	indent(indent);
-	Util.println("Element " + _name);
-	displayContents(indent + IndentIncrement);
-    }
-
-    /**
-     * Parses the element's contents. Special care taken for namespaces.
-     * TODO: The namespace attribute that specifies the namespace to use
-     * for the element is an attribute value template and not a string
-     * constant. This means that we do not know what namespace is used
-     * before runtime. This causes a problem with the way output namespaces
-     * are handled at compile-time. We use a shortcut in this method to get
-     * around the problem by treating the namaspace attribute as a constant.
-     *          (Yes, I know this is a hack, bad, bad, bad.)
-     */
-    public void parseContents(Parser parser) {
-
-	final SymbolTable stable = parser.getSymbolTable();
-
-	// Get the "name" attribute of the <xsl:element> element
-	String name = getAttribute("name");
-	if ((name == null) || (name.equals(EMPTYSTRING))) {
-	    final ErrorMsg msg = new ErrorMsg("You can't call an element \"\"");
-	    parser.reportError(WARNING, msg);
-	    _ignore = true; // Ignore the element if the QName is invalid
-	    return;
-	}
-
-	// Try to construct a QName and then get the prefix and local part
-	QName  qname  = parser.getQNameSafe(name);
-	String prefix = qname.getPrefix();
-	String local  = qname.getLocalPart();
-
-	// First try to get the namespace URI from the "namespace" attribute
-	String namespace = getAttribute("namespace");
-
-	// Then try to get it from the "name" attribute QName prefix
-	if ((namespace == null) || (namespace.equals(EMPTYSTRING))) {
-
-	    // We are supposed to use the default namespace URI if the QName
-	    // from the "name" attribute is not prefixed, so check that first
-	    if (prefix == null) prefix = EMPTYSTRING;
-	    // Then look up the URI that is in scope for the prefix
-	    namespace = lookupNamespace(prefix); 
-
-	    // Signal error if the prefix does not map to any namespace URI 
-	    if (namespace == null) {
-		final ErrorMsg msg = new ErrorMsg(ErrorMsg.NSPUNDEF_ERR,prefix);
-		parser.reportError(WARNING, msg);
-		parseChildren(parser);
-		_ignore = true; // Ignore the element if prefix is undeclared
-		return;
-	    }
-	    _namespace = new AttributeValueTemplate(namespace, parser);
-	    _prefix = prefix;
-	}
-	// Check if this element belongs in a specific namespace
-	else if (namespace != EMPTYSTRING) {
-	    // Get the namespace requested by the xsl:element
-	    _namespace = new AttributeValueTemplate(namespace, parser);
-	    // Get the current prefix for that namespace (if any)
-	    _prefix = lookupPrefix(namespace);
-	    // Is it the default namespace?
-	    if ((_prefix = prefix) == null) _prefix = EMPTYSTRING;
-
-	    // Construct final element QName
-	    if (_prefix == EMPTYSTRING)
-		name = qname.getLocalPart();
-	    else
-		name = _prefix+":"+qname.getLocalPart();
-	}
-
-	_name = AttributeValue.create(this, name, parser);
-
-	// Next check that the local part of the QName is legal (no whitespace)
-	if ((_name instanceof SimpleAttributeValue) &&
-	    (local.indexOf(' ') > -1)) {
-	    final String errmsg = "You can't call an element \""+local+"\"";
-	    parser.reportError(WARNING, new ErrorMsg(errmsg));
-	    parseChildren(parser);
-	    _ignore = true; // Ignore the element if the local part is invalid
-	    return;
-	}
-
-	// Handle the 'use-attribute-sets' attribute
-	final String useSets = getAttribute("use-attribute-sets");
-	if (useSets.length() > 0) {
-	    setFirstElement(new UseAttributeSets(useSets, parser));
-	}
-
-	parseChildren(parser);
-    }
-
-    /**
-     * Run type check on element name & contents
-     */
-    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-	if (!_ignore) {
-	    _name.typeCheck(stable);
-	    if (_namespace != null)
-		_namespace.typeCheck(stable);
-	}
-	typeCheckContents(stable);
-	return Type.Void;
-    }
-
-    /**
-     * Compiles code that emits the element with the necessary namespace
-     * definitions. The element itself is ignored if the element definition
-     * was in any way erronous, but the child nodes are still processed.
-     * See the overriden translateContents() method as well.
-     */
-    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Ignore this element if not correctly declared
-	if (!_ignore) {
-	    // Compile code that emits the element start tag
-	    il.append(methodGen.loadHandler());
-	    _name.translate(classGen, methodGen);
-	    il.append(DUP2);	// duplicate these 2 args for endElement
-	    il.append(methodGen.startElement());
-
-	    // Compile code that emits any needed namespace declaration
-	    if (_namespace != null) {
-		// public void attribute(final String name, final String value)
-		il.append(methodGen.loadHandler());
-		il.append(new PUSH(cpg, _prefix));
-		_namespace.translate(classGen,methodGen);
-		il.append(methodGen.namespace());
-	    }
-	}
-
-	// Compile code that emits the element attributes and contents
-	translateContents(classGen, methodGen);
-
-	// Ignore this element if not correctly declared
-	if (!_ignore) {
-	    // Compile code that emits the element end tag
-	    il.append(methodGen.endElement());
-	}
-    }
-
-    /**
-     * Override this method to make sure that xsl:attributes are not
-     * copied to output if this xsl:element is to be ignored
-     */
-    public void translateContents(ClassGenerator classGen,
-				  MethodGenerator methodGen) {
-	final int n = elementCount();
-	for (int i = 0; i < n; i++) {
-	    final SyntaxTreeNode item =
-		(SyntaxTreeNode)getContents().elementAt(i);
-	    if ((_ignore) && (item instanceof XslAttribute)) continue;
-	    item.translate(classGen, methodGen);
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/header.txt b/src/org/apache/xalan/xsltc/compiler/header.txt
deleted file mode 100644
index 18e1ef6..0000000
--- a/src/org/apache/xalan/xsltc/compiler/header.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * @(#)$Id$
- *
- * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * This software is the proprietary information of Sun Microsystems, Inc.  
- * Use is subject to license terms.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * 
- */
-
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/AttributeSetMethodGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/AttributeSetMethodGenerator.java
deleted file mode 100644
index f45cec4..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/AttributeSetMethodGenerator.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.Template;
-
-public final class AttributeSetMethodGenerator extends MethodGenerator {
-    private static int HANDLER_INDEX = 1;
-    private static int ITERATOR_INDEX = 2;
-
-    private static final de.fub.bytecode.generic.Type[] argTypes =
-	new de.fub.bytecode.generic.Type[2];
-    private static final String[] argNames = new String[2];
-    
-    static {
-	argTypes[0] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
-	argNames[0] = TRANSLET_OUTPUT_PNAME;
-	argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
-	argNames[1] = ITERATOR_PNAME;
-    }
-
-    private final Instruction _astoreHandler;
-    private final Instruction _aloadHandler;
-    private final Instruction _astoreIterator;
-    private final Instruction _aloadIterator;
-    
-    public AttributeSetMethodGenerator(String methodName, ClassGen classGen) {
-	super(de.fub.bytecode.Constants.ACC_PRIVATE,
-	      de.fub.bytecode.generic.Type.VOID,
-	      argTypes, argNames, methodName, 
-	      classGen.getClassName(),
-	      new InstructionList(),
-	      classGen.getConstantPool());
-	
-	_astoreHandler  = new ASTORE(HANDLER_INDEX);
-	_aloadHandler   = new ALOAD(HANDLER_INDEX);
-	_astoreIterator = new ASTORE(ITERATOR_INDEX);
-	_aloadIterator  = new ALOAD(ITERATOR_INDEX);
-    }
-
-    public Instruction storeIterator() {
-	return _astoreIterator;
-    }
-    
-    public Instruction loadIterator() {
-	return _aloadIterator;
-    }
-
-    public int getIteratorIndex() {
-	return ITERATOR_INDEX;
-    }
-
-    public Instruction storeHandler() {
-	return _astoreHandler;
-    }
-
-    public Instruction loadHandler() {
-	return _aloadHandler;
-    }
-
-    public int getLocalIndex(String name) {
-	return INVALID_INDEX;	// not available
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/BooleanType.java b/src/org/apache/xalan/xsltc/compiler/util/BooleanType.java
deleted file mode 100644
index 686eb59..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/BooleanType.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-
-public final class BooleanType extends Type {
-    protected BooleanType() {}
-
-    public String toString() {
-	return "boolean";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return "Z";
-    }
-
-    public boolean isSimple() {
-	return true;
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return de.fub.bytecode.generic.Type.BOOLEAN;
-    }
-
-    /**
-     * Translates a real into an object of internal type <code>type</code>. The
-     * translation to int is undefined since booleans are always converted to
-     * reals in arithmetic expressions.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType) type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType) type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Expects a boolean on the stack and pushes a string. If the value on the
-     * stack is zero, then the string 'false' is pushed. Otherwise, the string
-     * 'true' is pushed.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final BranchHandle falsec = il.append(new IFEQ(null));
-	il.append(new PUSH(cpg, "true"));
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsec.setTarget(il.append(new PUSH(cpg, "false")));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Expects a boolean on the stack and pushes a real. The value "true" is
-     * converted to 1.0 and the value "false" to 0.0.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	methodGen.getInstructionList().append(I2D);
-    }
-
-    /**
-     * Expects a boolean on the stack and pushes a boxed boolean.
-     * Boxed booleans are represented by an instance of
-     * <code>java.lang.Boolean</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
-	il.append(DUP_X1);
-	il.append(SWAP);
-	il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
-						     "<init>",
-						     "(Z)V")));
-    }
-
-    /**
-     * Translates an internal boolean into an external (Java) boolean.
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	if (clazz == java.lang.Boolean.TYPE) {
-	    methodGen.getInstructionList().append(NOP);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Translates an external (Java) boolean into internal boolean.
-     */
-    public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, 
-			      Class clazz) {
-	translateTo(classGen, methodGen, clazz);
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS)));
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS,
-						     BOOLEAN_VALUE, 
-						     BOOLEAN_VALUE_SIG)));
-    }
-
-    public Instruction LOAD(int slot) {
-	return new ILOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ISTORE(slot);
-    }
-
-    public BranchInstruction GT(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFGT(null) : 
-	    (BranchInstruction) new IF_ICMPGT(null);
-    }
-
-    public BranchInstruction GE(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFGE(null) : 
-	    (BranchInstruction) new IF_ICMPGE(null);
-    }
-
-    public BranchInstruction LT(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFLT(null) : 
-	    (BranchInstruction) new IF_ICMPLT(null);
-    }
-
-    public BranchInstruction LE(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFLE(null) : 
-	    (BranchInstruction) new IF_ICMPLE(null);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/ClassGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/ClassGenerator.java
deleted file mode 100644
index 0ceca70..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/ClassGenerator.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.Constants;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Stylesheet;
-
-/**
- * The class that implements any class that inherits from 
- * <tt>AbstractTranslet</tt>, i.e. any translet. Methods in this 
- * class may be of the following kinds: 
- *
- * 1. Main method: applyTemplates, implemented by intances of 
- * <tt>MethodGenerator</tt>.
- *
- * 2. Named methods: for named templates, implemented by instances 
- * of <tt>NamedMethodGenerator</tt>.
- *
- * 3. Rt methods: for result tree fragments, implemented by 
- * instances of <tt>RtMethodGenerator</tt>.
- */
-public class ClassGenerator extends ClassGen {
-    protected static int TRANSLET_INDEX = 0;
-    protected static int INVALID_INDEX  = -1;
-
-    private Stylesheet _stylesheet;
-    private final Parser _parser;		// --> can be moved to XSLT
-    // a  single instance cached here
-    private final Instruction _aloadTranslet;
-    private final String _domClass;
-    private final String _domClassSig;
-    private final String _applyTemplatesSig;
-
-    public ClassGenerator(String class_name, String super_class_name,
-			  String file_name,
-			  int access_flags, String[] interfaces,
-			  Stylesheet stylesheet) {
-	super(class_name, super_class_name, file_name,
-	      access_flags, interfaces);
-	_stylesheet = stylesheet;
-	_parser = stylesheet.getParser();
-	_aloadTranslet = new ALOAD(TRANSLET_INDEX);
-	
-	if (stylesheet.isMultiDOM()) {
-	    _domClass = "org.apache.xalan.xsltc.dom.MultiDOM";
-	    _domClassSig = "Lorg/apache/xalan/xsltc/dom/MultiDOM;";
-	}
-	else {
-	    _domClass = "org.apache.xalan.xsltc.dom.DOMAdapter";
-	    _domClassSig = "Lorg/apache/xalan/xsltc/dom/DOMAdapter;";
-	}
-	_applyTemplatesSig = "(" 
-	    + Constants.DOM_INTF_SIG
-	    + Constants.NODE_ITERATOR_SIG
-	    + Constants.TRANSLET_OUTPUT_SIG
-	    + ")V"; 
-    }
-
-    public final Parser getParser() {
-	return _parser;
-    }
-
-    public final Stylesheet getStylesheet() {
-	return _stylesheet;
-    }
-
-    /**
-     * Pretend this is the stylesheet class. Useful when compiling 
-     * references to global variables inside a predicate.
-     */
-    public final String getClassName() {
-	return _stylesheet.getClassName();
-    }
-
-    public Instruction loadTranslet() {
-	return _aloadTranslet;
-    }
-
-    public final String getDOMClass() {
-	return _domClass;
-    }
-
-    public final String getDOMClassSig() {
-	return _domClassSig;
-    }
-
-    public final String getApplyTemplatesSig() {
-	return _applyTemplatesSig;
-    }
-
-    /**
-     * Returns <tt>true</tt> or <tt>false</tt> depending on whether
-     * this class inherits from <tt>AbstractTranslet</tt> or not.
-     */
-    public boolean isExternal() {
-	return false;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/CompareGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/CompareGenerator.java
deleted file mode 100644
index eded6e0..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/CompareGenerator.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-
-import org.apache.xalan.xsltc.compiler.Constants;
-import org.apache.xalan.xsltc.compiler.Template;
-
-public final class CompareGenerator extends MethodGenerator {
-
-    private static int DOM_INDEX      = 1;
-    private static int CURRENT_INDEX  = 2;
-    private static int LEVEL_INDEX    = 3;
-    private static int TRANSLET_INDEX = 4;
-    private static int LAST_INDEX     = 5;
-    private int ITERATOR_INDEX = 6;
-
-    private final Instruction _iloadCurrent;
-    private final Instruction _istoreCurrent;
-    private final Instruction _aloadDom;
-    private final Instruction _iloadLast;
-    private final Instruction _aloadIterator;
-    private final Instruction _astoreIterator;
-
-    public CompareGenerator(int access_flags, Type return_type,
-			    Type[] arg_types, String[] arg_names,
-			    String method_name, String class_name,
-			    InstructionList il, ConstantPoolGen cp) {
-	super(access_flags, return_type, arg_types, arg_names, method_name, 
-	      class_name, il, cp);
-	
-	_iloadCurrent = new ILOAD(CURRENT_INDEX);
-	_istoreCurrent = new ISTORE(CURRENT_INDEX);
-	_aloadDom = new ALOAD(DOM_INDEX);
-	_iloadLast = new ILOAD(LAST_INDEX);
-
-	LocalVariableGen iterator =
-	    addLocalVariable("iterator",
-			     Util.getJCRefType(Constants.NODE_ITERATOR_SIG),
-			     null, null);
-	ITERATOR_INDEX = iterator.getIndex();
-	_aloadIterator = new ALOAD(ITERATOR_INDEX);
-	_astoreIterator = new ASTORE(ITERATOR_INDEX);
-	il.append(new ACONST_NULL());
-	il.append(storeIterator());
-    }
-
-    public Instruction loadLastNode() {
-	return _iloadLast;
-    }
-
-    public Instruction loadCurrentNode() {
-	return _iloadCurrent;
-    }
-
-    public Instruction storeCurrentNode() {
-	return _istoreCurrent;
-    }
-
-    public Instruction loadDOM() {
-	return _aloadDom;
-    }
-
-    public int getHandlerIndex() {
-	return INVALID_INDEX;		// not available
-    }
-
-    public int getIteratorIndex() {
-	return INVALID_INDEX;
-    }
-
-    public Instruction storeIterator() {
-	return _astoreIterator;
-    }
-    
-    public Instruction loadIterator() {
-	return _aloadIterator;
-    }
-
-    //??? may not be used anymore
-    public int getLocalIndex(String name) {
-	if (name.equals("current")) {
-	    return CURRENT_INDEX;
-	}
-	return super.getLocalIndex(name);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java b/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
deleted file mode 100644
index a7d13d2..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.SyntaxTreeNode;
-
-import java.net.URL;
-import java.text.MessageFormat;
-
-public final class ErrorMsg {
-    private int _code;
-    private int _line;
-    private String _message = null;
-    private String _url = null;
-    Object[] _params = null;
-	
-    public static final int STLREDEF_ERR = 0;
-    public static final int TMPREDEF_ERR = 1;
-    public static final int VARREDEF_ERR = 2;
-    public static final int VARUNDEF_ERR = 3;
-    public static final int CLSUNDEF_ERR = 4;
-    public static final int METUNDEF_ERR = 5;
-    public static final int TMPUNDEF_ERR = 6;
-    public static final int CANNOTCV_ERR = 7;
-    public static final int FILENOTF_ERR = 8;
-    public static final int INVALURI_ERR = 9;
-    public static final int FILECANT_ERR = 10;
-    public static final int STYORTRA_ERR = 11;
-    public static final int NSPUNDEF_ERR = 12;
-    public static final int FUNRESOL_ERR = 13;
-    public static final int LITERALS_ERR = 14;
-    public static final int XPATHPAR_ERR = 15;
-    public static final int NREQATTR_ERR = 16;
-    public static final int FUNC_USE_ERR = 17;
-    public static final int ILLEG_PI_ERR = 18;
-    public static final int ATTROUTS_ERR = 19;
-    public static final int ILL_ATTR_ERR = 20;
-    public static final int CIRCULAR_INC = 21;
-    public static final int TREESORT_ERR = 22;
-
-    static final String messages_d[] = { 
-	"More than one stylesheet defined in the same file.",
-	"Template ''{0}'' already defined in this stylesheet.",
-	"Variable ''{0}'' is multiply defined in the same scope.",
-	"Variable or parameter ''{0}'' is undefined.",
-	"Cannot find external class ''{0}''.",
-	"Cannot find external method ''{0}'' (It must be static and public).",
-	"Template ''{0}'' not defined in this stylesheet.",
-	"Cannot convert argument/return type in call to Method ''{0}'' of class ''{1}''.",
-	"File or URI ''{0}'' not found.",
-	"Invalid URI ''{0}''.",
-	"Cannot open file ''{0}''.",
-	"'stylesheet' or 'transform' element expected.",
-	"Element prefix ''{0}'' is undeclared.",
-	"Unable to resolve call to function ''{0}''.",
-	"Argument to ''{0}'' must be a literal string.",
-	"Error parsing XPath expression ''{0}''.",
-	"Required attribute ''{0}'' is missing.",
-	"Illegal use of function ''{0}''.",
-	"Illegal name ''{0}'' for processing instruction.",
-	"Attribute ''{0}'' outside of element.",
-	"Illegal attribute name ''{0}''.",
-	"Circular import/include. Stylesheet ''{0}'' already loaded.",
-	"Applying <xsl:sort> to a result tree is not supported (<xsl:sort> "+
-	"elements are ignored). You can, and should, sort the nodes when "+
-	"creating the result tree."
-    };
-
-    public ErrorMsg(int code) {
-	_code = code;
-	_line = 0;
-    }
-	
-    public ErrorMsg(String message) {
-	_code = -1;
-	_message = message;
-	_line = 0;
-    }
-
-    public ErrorMsg(String message, int line) {
-	_code = -1;
-	_message = message;
-	_line = line;
-    }
-
-    public ErrorMsg(int code, int line, Object param) {
-	_code = code;
-	_line = line;
-	_params = new Object[] { param };
-    }
-
-    public ErrorMsg(int code, Object param) {
-	this(code);
-	_params = new Object[1];
-	_params[0] = param;
-    }
-
-    public ErrorMsg(int code, Object param1, Object param2) {
-	this(code);
-	_params = new Object[2];
-	_params[0] = param1;
-	_params[1] = param2;
-    }
-
-    public ErrorMsg(int code, SyntaxTreeNode node) {
-	_code = code;
-	_url  = getFileName(node);
-	_line = node.getLineNumber();
-    }
-
-    public ErrorMsg(int code, Object param1, SyntaxTreeNode node) {
-	_code = code;
-	_url  = getFileName(node);
-	_line = node.getLineNumber();
-	_params = new Object[1];
-	_params[0] = param1;
-    }
-
-    public ErrorMsg(int code, Object param1, Object param2,
-		    SyntaxTreeNode node) {
-	_code = code;
-	_url  = getFileName(node);
-	_line = node.getLineNumber();
-	_params = new Object[2];
-	_params[0] = param1;
-	_params[1] = param2;
-    }
-
-    private String getFileName(SyntaxTreeNode node) {
-	return node.getStylesheet().getSystemId();
-    }
-
-    private String formatLine() {
-	StringBuffer result = new StringBuffer();
-	if (_url != null) {
-	    result.append(_url);
-	    result.append(": ");
-	}
-	if (_line > 0) {
-	    result.append("Line ");
-	    result.append(Integer.toString(_line));
-	    result.append(": ");
-	}
-	return result.toString();
-    }
-	
-    /**
-     * This version of toString() uses the _params instance variable
-     * to format the message. If the <code>_code</code> is negative
-     * the use _message as the error string.
-     */
-    public String toString() {
-	String suffix = (_params == null) ? 
-	    (_code >= 0 ? new String(messages_d[_code]) : _message)
-	    : MessageFormat.format(messages_d[_code], _params);
-	return formatLine() + suffix;
-    }
-	
-    public String toString(Object obj) {
-	Object params[] = new Object[1];
-	params[0] = obj.toString();
-	String suffix = MessageFormat.format(messages_d[_code], params);
-	return formatLine() + suffix;
-    }
-	
-    public String toString(Object obj0, Object obj1) {
-	Object params[] = new Object[2];
-	params[0] = obj0.toString();
-	params[1] = obj1.toString();
-	String suffix = MessageFormat.format(messages_d[_code], params);
-	return formatLine() + suffix;
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/FilterGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/FilterGenerator.java
deleted file mode 100644
index 66c8539..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/FilterGenerator.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Stylesheet;
-
-/**
- * This class implements auxliary classes needed to compile 
- * filters (predicates). These classes defined a single method
- * of type <tt>TestGenerator</tt>.
- */
-public final class FilterGenerator extends ClassGenerator {
-    private static int TRANSLET_INDEX = 5;   // translet
-    private final Instruction _aloadTranslet;
-
-    public FilterGenerator(String className, String superClassName,
-			   String fileName,
-			   int accessFlags, String[] interfaces,
-			   Stylesheet stylesheet) {
-	super(className, superClassName, fileName,
-	      accessFlags, interfaces, stylesheet);
-	
-	_aloadTranslet = new ALOAD(TRANSLET_INDEX);
-    }
-
-    /**
-     * The index of the translet pointer within the execution of
-     * the test method.
-     */
-    public final Instruction loadTranslet() {
-	return _aloadTranslet;
-    }
-    
-    /**
-     * Returns <tt>true</tt> since this class is external to the
-     * translet.
-     */
-    public boolean isExternal() {
-	return true;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/IntType.java b/src/org/apache/xalan/xsltc/compiler/util/IntType.java
deleted file mode 100644
index bf1d23b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/IntType.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public final class IntType extends NumberType {
-    protected IntType() {}
-
-    public String toString() {
-	return "int";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return "I";
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return de.fub.bytecode.generic.Type.INT;
-    }
-
-    /**
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#distanceTo
-     */
-    public int distanceTo(Type type) {
-	if (type == this) {
-	    return 0;
-	}
-	else if (type == Type.Real) {
-	    return 1;
-	}
-	else
-	    return Integer.MAX_VALUE;
-    }
-    
-    /**
-     * Translates an integer into an object of internal type <code>type</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    final Type type) {
-	if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType) type);
-	}
-	else if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType) type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType) type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Expects an integer on the stack and pushes a real.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	methodGen.getInstructionList().append(I2D);
-    }
-
-    /**
-     * Expects an integer on the stack and pushes its string value by calling
-     * <code>Integer.toString(int i)</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new INVOKESTATIC(cpg.addMethodref(INTEGER_CLASS,
-						    "toString",
-						    "(I)" + STRING_SIG)));
-    }
-
-    /**
-     * Expects an integer on the stack and pushes a 0 if its value is 0 and
-     * a 1 otherwise.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	final BranchHandle falsec = il.append(new IFEQ(null));
-	il.append(ICONST_1);
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsec.setTarget(il.append(ICONST_0));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Expects an integer on the stack and translates it to a non-synthesized
-     * boolean. It does not push a 0 or a 1 but instead returns branchhandle 
-     * list to be appended to the false list.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	return new FlowList(il.append(new IFEQ(null)));
-    }
-
-    /**
-     * Expects an integer on the stack and pushes a boxed integer.
-     * Boxed integers are represented by an instance of
-     * <code>java.lang.Integer</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
-	il.append(DUP_X1);
-	il.append(SWAP);
-	il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
-						     "<init>", "(I)V")));
-    }
-
-
-    /**
-     * Translates an integer into the Java type denoted by <code>clazz</code>. 
-     * Expects an integer on the stack and pushes a number of the appropriate
-     * type after coercion.
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	final InstructionList il = methodGen.getInstructionList();
-	if (clazz == Character.TYPE) {
-	    il.append(I2C);
-	}
-	else if (clazz == Byte.TYPE) {
-	    il.append(I2B);
-	}
-	else if (clazz == Short.TYPE) {
-	    il.append(I2S);
-	}
-	else if (clazz == Integer.TYPE) {
-	    il.append(NOP);
-	}
-	else if (clazz == Long.TYPE) {
-	    il.append(I2L);
-	}
-	else if (clazz == Float.TYPE) {
-	    il.append(I2F);
-	}
-	else if (clazz == Double.TYPE) {
-	    il.append(I2D);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new CHECKCAST(cpg.addClass(INTEGER_CLASS)));
-	final int index = cpg.addMethodref(INTEGER_CLASS,
-					   INT_VALUE, 
-					   INT_VALUE_SIG);
-	il.append(new INVOKEVIRTUAL(index));
-    }
-
-    public Instruction ADD() {
-	return InstructionConstants.IADD;
-    }
-
-    public Instruction SUB() {
-	return InstructionConstants.ISUB;
-    }
-
-    public Instruction MUL() {
-	return InstructionConstants.IMUL;
-    }
-
-    public Instruction DIV() {
-	return InstructionConstants.IDIV;
-    }
-
-    public Instruction REM() {
-	return InstructionConstants.IREM;
-    }
-
-    public Instruction NEG() {
-	return InstructionConstants.INEG;
-    }
-
-    public Instruction LOAD(int slot) {
-	return new ILOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ISTORE(slot);
-    }
-
-    public BranchInstruction GT(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFGT(null) : 
-	    (BranchInstruction) new IF_ICMPGT(null);
-    }
-
-    public BranchInstruction GE(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFGE(null) : 
-	    (BranchInstruction) new IF_ICMPGE(null);
-    }
-
-    public BranchInstruction LT(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFLT(null) : 
-	    (BranchInstruction) new IF_ICMPLT(null);
-    }
-
-    public BranchInstruction LE(boolean tozero) {
-	return tozero ? (BranchInstruction) new IFLE(null) : 
-	    (BranchInstruction) new IF_ICMPLE(null);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/MatchGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/MatchGenerator.java
deleted file mode 100644
index ec77c64..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/MatchGenerator.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Template;
-
-public final class MatchGenerator extends MethodGenerator {
-    private static int CURRENT_INDEX = 1;
-
-    private int _iteratorIndex = INVALID_INDEX;
-
-    private final Instruction _iloadCurrent;
-    private final Instruction _istoreCurrent;
-    private Instruction _aloadDom;
-    
-    public MatchGenerator(int access_flags, Type return_type, 
-			  Type[] arg_types, String[] arg_names, 
-			  String method_name, String class_name,
-			  InstructionList il, ConstantPoolGen cp) {
-	super(access_flags, return_type, arg_types, arg_names, method_name, 
-	      class_name, il, cp);
-	
-	_iloadCurrent = new ILOAD(CURRENT_INDEX);
-	_istoreCurrent = new ISTORE(CURRENT_INDEX);
-    }
-
-    public Instruction loadCurrentNode() {
-	return _iloadCurrent;
-    }
-
-    public Instruction storeCurrentNode() {
-	return _istoreCurrent;
-    }
-    
-    public int getHandlerIndex() {
-	return INVALID_INDEX;		// not available
-    }
-
-    /**
-     * Get index of the register where the DOM is stored.
-     */
-    public Instruction loadDOM() {
-	return _aloadDom;
-    }
-
-    /**
-     * Set index where the reference to the DOM is stored.
-     */
-    public void setDomIndex(int domIndex) {
-	_aloadDom = new ALOAD(domIndex);
-    }
-
-    /**
-     * Get index of the register where the current iterator is stored.
-     */
-    public int getIteratorIndex() {
-	return _iteratorIndex;
-    }
-
-    /**
-     * Set index of the register where the current iterator is stored.
-     */
-    public void setIteratorIndex(int iteratorIndex) {
-	_iteratorIndex = iteratorIndex;
-    }
-
-    public int getLocalIndex(String name) {
-	if (name.equals("current")) {
-	    return CURRENT_INDEX;
-	}
-	return super.getLocalIndex(name);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
deleted file mode 100644
index ca3d793..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Template;
-
-public class MethodGenerator extends MethodGen
-    implements org.apache.xalan.xsltc.compiler.Constants {
-    protected static final int INVALID_INDEX   = -1;
-    
-    private static final String START_ELEMENT_SIG   
-	= "(" + STRING_SIG + ")V";
-    private static final String END_ELEMENT_SIG     
-	= START_ELEMENT_SIG;
-    
-    private InstructionList _mapTypeSub;
-	
-    private static final int DOM_INDEX       = 1;
-    private static final int ITERATOR_INDEX  = 2;
-    private static final int HANDLER_INDEX   = 3;
-
-    private Instruction       _iloadCurrent;
-    private Instruction       _istoreCurrent;
-    private final Instruction _astoreHandler;
-    private final Instruction _aloadHandler;
-    private final Instruction _astoreIterator;
-    private final Instruction _aloadIterator;
-    private final Instruction _aloadDom;
-    private final Instruction _astoreDom;
-    
-    private final Instruction _startElement;
-    private final Instruction _endElement;
-    private final Instruction _startDocument;
-    private final Instruction _endDocument;
-    private final Instruction _attribute;
-    private final Instruction _namespace;
-
-    private final Instruction _setStartNode;
-    private final Instruction _nextNode;
-
-    private SlotAllocator _slotAllocator;
-    
-    public MethodGenerator(int access_flags, Type return_type,
-			   Type[] arg_types, String[] arg_names,
-			   String method_name, String class_name,
-			   InstructionList il, ConstantPoolGen cpg) {
-	super(access_flags, return_type, arg_types, arg_names, method_name, 
-	      class_name, il, cpg);
-	
-	_astoreHandler  = new ASTORE(HANDLER_INDEX);
-	_aloadHandler   = new ALOAD(HANDLER_INDEX);
-	_astoreIterator = new ASTORE(ITERATOR_INDEX);
-	_aloadIterator  = new ALOAD(ITERATOR_INDEX);
-	_aloadDom       = new ALOAD(DOM_INDEX);
-	_astoreDom      = new ASTORE(DOM_INDEX);
-	
-	final int startElement =
-	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-				      "startElement",
-				      START_ELEMENT_SIG);
-	_startElement = new INVOKEINTERFACE(startElement, 2);
-	
-	final int endElement =
-	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-				      "endElement",
-				      END_ELEMENT_SIG);
-	_endElement = new INVOKEINTERFACE(endElement, 2);
-
-	final int attribute =
-	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-				      "attribute", 
-				      "("
-				      + STRING_SIG
-				      + STRING_SIG
-				      + ")V");
-	_attribute = new INVOKEINTERFACE(attribute, 3);
-
-	final int namespace =
-	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-				      "namespace", 
-				      "("
-				      + STRING_SIG
-				      + STRING_SIG
-				      + ")V");
-	_namespace = new INVOKEINTERFACE(namespace, 3);
-	
-	int index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-					      "startDocument",
-					      "()V");
-	_startDocument = new INVOKEINTERFACE(index, 1);
-	
-	index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
-					  "endDocument",
-					  "()V");
-	_endDocument = new INVOKEINTERFACE(index, 1);
-	
-	
-	index = cpg.addInterfaceMethodref(NODE_ITERATOR,
-					  SET_START_NODE,
-					  SET_START_NODE_SIG);
-	_setStartNode = new INVOKEINTERFACE(index, 2);
-	
-	index = cpg.addInterfaceMethodref(NODE_ITERATOR, NEXT, NEXT_SIG);
-	_nextNode = new INVOKEINTERFACE(index, 1);
-	
-	_slotAllocator = new SlotAllocator();
-	_slotAllocator.initialize(getLocalVariables());
-    }
-
-    public LocalVariableGen addLocalVariable(String name, Type type,
-					     InstructionHandle start,
-					     InstructionHandle end) {
-	
-	return super.addLocalVariable(name, type, start, end);
-    }
-    
-    public LocalVariableGen addLocalVariable2(String name, Type type,
-					      InstructionHandle start) {
-	return super.addLocalVariable(name, type,
-				      _slotAllocator.allocateSlot(type),
-				      start, null);
-    }
-
-    public void removeLocalVariable(LocalVariableGen lvg) {
-	_slotAllocator.releaseSlot(lvg);
-	super.removeLocalVariable(lvg);
-    }
-
-    public Instruction loadDOM() {
-	return _aloadDom;
-    }
-
-    public Instruction storeDOM() {
-	return _astoreDom;
-    }
-    
-    public Instruction storeHandler() {
-	return _astoreHandler;
-    }
-
-    public Instruction loadHandler() {
-	return _aloadHandler;
-    }
-
-    public Instruction storeIterator() {
-	return _astoreIterator;
-    }
-    
-    public Instruction loadIterator() {
-	return _aloadIterator;
-    }
-    
-    public final Instruction setStartNode() {
-	return _setStartNode;
-    }
-    
-    public final Instruction nextNode() {
-	return _nextNode;
-    }
-    
-    public final Instruction startElement() {
-	return _startElement;
-    }
-
-    public final Instruction endElement() {
-	return _endElement;
-    }
-
-    public final Instruction startDocument() {
-	return _startDocument;
-    }
-
-    public final Instruction endDocument() {
-	return _endDocument;
-    }
-
-    public final Instruction attribute() {
-	return _attribute;
-    }
-
-    public final Instruction namespace() {
-	return _namespace;
-    }
-
-    public Instruction loadCurrentNode() {
-	return _iloadCurrent != null
-	    ? _iloadCurrent
-	    : (_iloadCurrent = new ILOAD(getLocalIndex("current")));
-    }
-
-    public Instruction storeCurrentNode() {
-	return _istoreCurrent != null
-	    ? _istoreCurrent
-	    : (_istoreCurrent = new ISTORE(getLocalIndex("current")));
-    }
-
-    /** by default context node is the same as current node. MK437 */
-    public Instruction loadContextNode() {
-	return loadCurrentNode();
-    }
-
-    public Instruction storeContextNode() {
-	return storeCurrentNode();
-    }
-
-    public int getLocalIndex(String name) {
-	return getLocalVariable(name).getIndex();
-    }
-
-    public LocalVariableGen getLocalVariable(String name) {
-	final LocalVariableGen[] vars = getLocalVariables();
-	for (int i = 0; i < vars.length; i++)
-	    if (vars[i].getName().equals(name))
-		return vars[i];
-	return null;	
-    }
-
-    public void setMaxLocals() {
-	
-	// Get the current number of local variable slots
-	int maxLocals = super.getMaxLocals();
-	int prevLocals = maxLocals;
-
-	// Get numer of actual variables
-	final LocalVariableGen[] localVars = super.getLocalVariables();
-	if (localVars != null) {
-	    if (localVars.length > maxLocals)
-		maxLocals = localVars.length;
-	}
-
-	// We want at least 5 local variable slots (for parameters)
-	if (maxLocals < 5) maxLocals = 5;
-
-	super.setMaxLocals(maxLocals);
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/MethodType.java b/src/org/apache/xalan/xsltc/compiler/util/MethodType.java
deleted file mode 100644
index 52e25ef..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/MethodType.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import java.util.Vector;
-
-public final class MethodType extends Type {
-    private final Type _resultType;	
-    private final Vector _argsType;
-	
-    public MethodType(Type resultType) {
-	_argsType = null;
-	_resultType = resultType;
-    }
-
-    public MethodType(Type resultType, Type arg1) {
-	if (arg1 != Type.Void) {
-	    _argsType = new Vector();
-	    _argsType.addElement(arg1);
-	}
-	else {
-	    _argsType = null;
-	}
-	_resultType = resultType;
-    }
-
-    public MethodType(Type resultType, Type arg1, Type arg2) {
-	_argsType = new Vector(2);
-	_argsType.addElement(arg1);
-	_argsType.addElement(arg2);
-	_resultType = resultType;
-    }
-
-    public MethodType(Type resultType, Type arg1, Type arg2, Type arg3) {
-	_argsType = new Vector(3);
-	_argsType.addElement(arg1);
-	_argsType.addElement(arg2);
-	_argsType.addElement(arg3);
-	_resultType = resultType;
-    }
-
-    public MethodType(Type resultType, Vector argsType) {
-	_resultType = resultType;
-	_argsType = argsType.size() > 0 ? argsType : null;
-    }
-
-    public String toString() {
-	StringBuffer result = new StringBuffer("method{");
-	if (_argsType != null) {
-	    final int count = _argsType.size();
-	    for (int i=0; i<count; i++) {
-		result.append(_argsType.elementAt(i));
-		if (i != (count-1)) result.append(',');
-	    }
-	}
-	else {
-	    result.append("void");
-	}
-	result.append('}');
-	return result.toString();
-    }
-
-    public String toSignature() {
-	return toSignature("");
-    }
-
-    /**
-     * Returns the signature of this method that results by adding
-     * <code>lastArgSig</code> to the end of the argument list.
-     */
-    public String toSignature(String lastArgSig) {
-	final StringBuffer buffer = new StringBuffer();
-	buffer.append('(');
-	if (_argsType != null) {
-	    final int n = _argsType.size();
-	    for (int i = 0; i < n; i++) {
-		buffer.append(((Type)_argsType.elementAt(i)).toSignature());
-	    }
-	}
-	return buffer
-	    .append(lastArgSig)
-	    .append(')')
-	    .append(_resultType.toSignature())
-	    .toString();
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return null;	// should never be called
-    }
-
-    public boolean identicalTo(Type other) {
-	boolean result = false;
-	if (other instanceof MethodType) {
-	    final MethodType temp = (MethodType) other;
-	    if (_resultType.identicalTo(temp._resultType)) {
-		final int len = argsCount();
-		result = len == temp.argsCount();
-		for (int i = 0; i < len && result; i++) {
-		    final Type arg1 = (Type)_argsType.elementAt(i);
-		    final Type arg2 = (Type)temp._argsType.elementAt(i);
-		    result = arg1.identicalTo(arg2);
-		}
-	    }
-	}
-	return result;	
-    }
-	
-    public int distanceTo(Type other) {
-	int result = Integer.MAX_VALUE;
-	if (other instanceof MethodType) {
-	    final MethodType mtype = (MethodType) other;
-	    if (_argsType != null) {
-		final int len = _argsType.size();
-		if (len == mtype._argsType.size()) {
-		    result = 0;
-		    for (int i = 0; i < len; i++) {
-			Type arg1 = (Type) _argsType.elementAt(i);
-			Type arg2 = (Type) mtype._argsType.elementAt(i);
-			final int temp = arg1.distanceTo(arg2);
-			if (temp == Integer.MAX_VALUE) {
-			    result = temp;  // return MAX_VALUE
-			    break;
-			}
-			else {
-			    result += arg1.distanceTo(arg2);
-			}
-		    }
-		}
-	    }
-	    else if (mtype._argsType == null) {
-		result = 0;   // both methods have no args
-	    }
-	}
-	return result;
-    }
-		
-    public Type resultType() {
-	return _resultType;
-    }
-		
-    public Vector argsType() {
-	return _argsType;
-    }
-
-    public int argsCount() {
-	return _argsType == null ? 0 : _argsType.size();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/MultiHashtable.java b/src/org/apache/xalan/xsltc/compiler/util/MultiHashtable.java
deleted file mode 100644
index 750382d..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/MultiHashtable.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import java.util.Vector;
-import java.util.Hashtable;
-
-public final class MultiHashtable extends Hashtable {
-    public Object put(Object key, Object value) {
-	Vector vector = (Vector)get(key);
-	if (vector == null)
-	    super.put(key, vector = new Vector());
-	vector.add(value);
-	return vector;
-    }
-	
-    public boolean maps(Object from, Object to) {
-	if (from == null) return false;
-	final Vector vector = (Vector) get(from);
-	if (vector != null) {
-	    final int n = vector.size();
-	    for (int i = 0; i < n; i++) {
-		if (vector.elementAt(i).equals(to)) {
-		    return true;
-		}
-	    }
-	}
-	return false;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/NamedMethodGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/NamedMethodGenerator.java
deleted file mode 100644
index 57cd703..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/NamedMethodGenerator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.Template;
-
-/**
- * This class is used for named templates. Named template methods have access
- * to the DOM, the current iterator, the handler and the current node.
- */
-public final class NamedMethodGenerator extends MethodGenerator {
-    protected static int CURRENT_INDEX  = 4;
-
-    public NamedMethodGenerator(int access_flags, Type return_type,
-				Type[] arg_types, String[] arg_names,
-				String method_name, String class_name,
-				InstructionList il, ConstantPoolGen cp) {
-	super(access_flags, return_type, arg_types, arg_names, method_name, 
-	      class_name, il, cp);
-    }
-
-    public int getLocalIndex(String name) {
-	if (name.equals("current")) {
-	    return CURRENT_INDEX;
-	}
-	return super.getLocalIndex(name);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/NodeCounterGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/NodeCounterGenerator.java
deleted file mode 100644
index 6cd9ec2..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/NodeCounterGenerator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Stylesheet;
-
-/**
- * This class implements auxiliary classes needed to compile 
- * patterns in <tt>xsl:number</tt>. These classes inherit from
- * {Any,Single,Multiple}NodeCounter and override the 
- * <tt>matchFrom</tt> and <tt>matchCount</tt> methods.
- */
-public final class NodeCounterGenerator extends ClassGenerator {
-    private Instruction _aloadTranslet;
-
-    public NodeCounterGenerator(String className, 
-				String superClassName,
-			        String fileName,
-			        int accessFlags, 
-				String[] interfaces,
-			        Stylesheet stylesheet) {
-	super(className, superClassName, fileName,
-	      accessFlags, interfaces, stylesheet);
-    }
-
-    /**
-     * Set the index of the register where "this" (the pointer to
-     * the translet) is stored.
-     */
-    public void setTransletIndex(int index) {
-	_aloadTranslet = new ALOAD(index);
-    }
-
-    /**
-     * The index of the translet pointer within the execution of
-     * matchFrom or matchCount.
-     * Overridden from ClassGenerator.
-     */
-    public Instruction aloadTranslet() {
-	return _aloadTranslet;
-    }
-    
-    /**
-     * Returns <tt>true</tt> since this class is external to the
-     * translet.
-     */
-    public boolean isExternal() {
-	return true;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java b/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java
deleted file mode 100644
index 51ba94f..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public final class NodeSetType extends Type {
-    protected NodeSetType() {}
-
-    public String toString() {
-	return "node-set";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return NODE_ITERATOR_SIG;
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return new de.fub.bytecode.generic.ObjectType(NODE_ITERATOR);
-    }
-
-    /**
-     * Translates a node-set into an object of internal type
-     * <code>type</code>. The translation to int is undefined
-     * since node-sets are always converted to
-     * reals in arithmetic expressions.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType) type);
-	}
-	else if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType) type);
-	}
-	else if (type == Type.Node) {
-	    translateTo(classGen, methodGen, (NodeType) type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType) type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Translates a node-set into a synthesized boolean.
-     * The boolean value of a node-set is "true" if non-empty
-     * and "false" otherwise. Notice that the 
-     * function getFirstNode() is called in translateToDesynthesized().
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
-	il.append(ICONST_1);
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsel.backPatch(il.append(ICONST_0));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Translates a node-set into a string. The string value of a node-set is
-     * value of its first element.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	getFirstNode(classGen, methodGen);
-	il.append(DUP);
-	final BranchHandle falsec = il.append(new IFEQ(null));
-	Type.Node.translateTo(classGen, methodGen, type);
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsec.setTarget(il.append(POP));
-	il.append(new PUSH(classGen.getConstantPool(), ""));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Expects a node-set on the stack and pushes a real.
-     * First the node-set is converted to string, and from string to real.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	translateTo(classGen, methodGen, Type.String);
-	Type.String.translateTo(classGen, methodGen, Type.Real);	
-    }
-
-    /**
-     * Expects a node-set on the stack and pushes a node.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    NodeType type) {
-	getFirstNode(classGen, methodGen);
-    }
-
-    /**
-     * Translates a node-set into a non-synthesized boolean. It does not 
-     * push a 0 or a 1 but instead returns branchhandle list to be appended 
-     * to the false list.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	getFirstNode(classGen, methodGen);
-	return new FlowList(il.append(new IFEQ(null)));
-    }
-
-    /**
-     * Expects a node-set on the stack and pushes a boxed node-set.
-     * Node sets are already boxed so the translation is just a NOP.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	methodGen.getInstructionList().append(NOP);
-    }
-
-    /**
-     * Translates a node-set into the Java type denoted by <code>clazz</code>. 
-     * Expects a node-set on the stack and pushes an object of the appropriate
-     * type after coercion.
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	final String className = clazz.getName();
-
-	il.append(methodGen.loadDOM());
-	il.append(SWAP);
-
-	if (className.equals("org.w3c.dom.Node")) {
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  MAKE_NODE,
-						  MAKE_NODE_SIG2);
-	    il.append(new INVOKEINTERFACE(index, 2));
-	}
-	else if (className.equals("org.w3c.dom.NodeList")) {
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  MAKE_NODE_LIST,
-						  MAKE_NODE_LIST_SIG2);
-	    il.append(new INVOKEINTERFACE(index, 2));
-	}
-	else if (className.equals("int")) {
-	    int next = cpg.addInterfaceMethodref(NODE_ITERATOR,
-						  "next", "()I");
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  GET_NODE_VALUE,
-						  "(I)"+STRING_SIG);
-	    int str = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-					STRING_TO_INT,
-					STRING_TO_INT_SIG);
-
-	    // Get next node from the iterator
-	    il.append(new INVOKEINTERFACE(next, 1));
-	    // Get the node's string value (from the DOM)
-	    il.append(new INVOKEINTERFACE(index, 2));
-	    // Create a new Integer object from the string value
-	    il.append(new INVOKESTATIC(str));
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-    
-    /**
-     * Some type conversions require gettting the first node from the node-set.
-     * This function is defined to avoid code repetition.
-     */
-    private void getFirstNode(ClassGenerator classGen, MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new INVOKEINTERFACE(cpg.addInterfaceMethodref(NODE_ITERATOR,
-								NEXT,
-								NEXT_SIG), 1));
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	methodGen.getInstructionList().append(NOP);
-    }
-
-    /**
-     * Returns the class name of an internal type's external representation.
-     */
-    public String getClassName() {
-	return(NODE_ITERATOR);
-    }
-
-
-    public Instruction LOAD(int slot) {
-	return new ALOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ASTORE(slot);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/NodeSortRecordGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/NodeSortRecordGenerator.java
deleted file mode 100644
index e8821fe..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/NodeSortRecordGenerator.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.util.*;
-
-import org.apache.xalan.xsltc.compiler.Stylesheet;
-
-/**
- *
- */
-public final class NodeSortRecordGenerator extends ClassGenerator {
-    private static final int TRANSLET_INDEX = 4;   // translet
-    private final Instruction _aloadTranslet;
-
-    public NodeSortRecordGenerator(String className, String superClassName,
-				   String fileName,
-				   int accessFlags, String[] interfaces,
-				   Stylesheet stylesheet) {
-	super(className, superClassName, fileName,
-	      accessFlags, interfaces, stylesheet);
-	_aloadTranslet = new ALOAD(TRANSLET_INDEX);
-    }
-    
-    /**
-     * The index of the translet pointer within the execution of
-     * the test method.
-     */
-    public Instruction loadTranslet() {
-	return _aloadTranslet;
-    }
-
-    /**
-     * Returns <tt>true</tt> since this class is external to the
-     * translet.
-     */
-    public boolean isExternal() {
-	return true;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/NodeType.java b/src/org/apache/xalan/xsltc/compiler/util/NodeType.java
deleted file mode 100644
index 436da8c..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/NodeType.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.NodeTest;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public final class NodeType extends Type {
-    private final int _type;
-
-    protected NodeType() {
-	this(NodeTest.ANODE);
-    }
-
-    protected NodeType(int type) {
-	_type = type;
-    }
-
-    public int getType() {
-	return _type;
-    }
-
-    public String toString() {
-	return "node-type";
-    }
-
-    public boolean identicalTo(Type other) {
-	return other instanceof NodeType;
-    }
-
-    public int hashCode() {
-	return _type;
-    }
-
-    public String toSignature() {
-	return "I";
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return de.fub.bytecode.generic.Type.INT;
-    }
-
-    /**
-     * Translates a node into an object of internal type <code>type</code>.
-     * The translation to int is undefined since nodes are always converted
-     * to reals in arithmetic expressions.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType) type);
-	}
-	else if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType) type);
-	}
-	else if (type == Type.NodeSet) {
-	    translateTo(classGen, methodGen, (NodeSetType) type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType) type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Expects a node on the stack and pushes its string value. 
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	switch (_type) {
-	case NodeTest.ROOT:
-	case NodeTest.ELEMENT:
-	    il.append(methodGen.loadDOM());
-	    il.append(SWAP); // dom ref must be below node index
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  GET_ELEMENT_VALUE,
-						  GET_ELEMENT_VALUE_SIG);
-	    il.append(new INVOKEINTERFACE(index, 2));
-	    break;
-
-	case NodeTest.ANODE:
-	case NodeTest.COMMENT:
-	case NodeTest.ATTRIBUTE:
-	case NodeTest.PI:
-	    il.append(methodGen.loadDOM());
-	    il.append(SWAP); // dom ref must be below node index
-	    index = cpg.addInterfaceMethodref(DOM_INTF,
-					      GET_NODE_VALUE,
-					      GET_NODE_VALUE_SIG);
-	    il.append(new INVOKEINTERFACE(index, 2));
-	    break;
-	    
-	default:
-	    classGen.getParser().internalError();
-	    break;
-	}
-    }
-
-    /**
-     * Translates a node into a synthesized boolean.
-     * If the expression is "@attr", 
-     * then "true" is pushed iff "attr" is an attribute of the current node.
-     * If the expression is ".", the result is always "true".	
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
-	il.append(ICONST_1);
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsel.backPatch(il.append(ICONST_0));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Expects a node on the stack and pushes a real.
-     * First the node is converted to string, and from string to real.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	translateTo(classGen, methodGen, Type.String);
-	Type.String.translateTo(classGen, methodGen, Type.Real);	
-    }
-
-    /**
-     * Expects a node on the stack and pushes a singleton node-set. Singleton
-     * iterators are already started after construction.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    NodeSetType type) {
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-
-	// Create a new instance of SingletonIterator
-	il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
-	il.append(DUP_X1);
-	il.append(SWAP);
-	final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
-					  "(" + NODE_SIG +")V");
-	il.append(new INVOKESPECIAL(init));
-    }
-
-    /**
-     * Translates a node into a non-synthesized boolean. It does not push a 
-     * 0 or a 1 but instead returns branchhandle list to be appended to the 
-     * false list.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	return new FlowList(il.append(new IFEQ(null)));
-    }
-
-    /**
-     * Expects a node on the stack and pushes a boxed node. Boxed nodes
-     * are represented by an instance of <code>org.apache.xalan.xsltc.dom.Node</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
-	il.append(DUP_X1);
-	il.append(SWAP);
-	il.append(new PUSH(cpg, _type));
-	il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
-						     "<init>", "(II)V")));
-    }
-
-    /**
-     * Translates a node into the Java type denoted by <code>clazz</code>. 
-     * Expects a node on the stack and pushes an object of the appropriate
-     * type after coercion.
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	il.append(methodGen.loadDOM());
-	il.append(SWAP);		// dom ref must be below node index
-
-	String className = clazz.getName();
-	if (className.equals("org.w3c.dom.Node")) {
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  MAKE_NODE,
-						  MAKE_NODE_SIG);
-	    il.append(new INVOKEINTERFACE(index, 2));
-	}
-	else if (className.equals("org.w3c.dom.NodeList")) {
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  MAKE_NODE_LIST,
-						  MAKE_NODE_LIST_SIG);
-	    il.append(new INVOKEINTERFACE(index, 2));
-	}
-	else {
-	    classGen.getParser().internalError();
-	}
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new CHECKCAST(cpg.addClass(RUNTIME_NODE_CLASS)));
-	il.append(new GETFIELD(cpg.addFieldref(RUNTIME_NODE_CLASS,
-					       NODE_FIELD,
-					       NODE_FIELD_SIG)));
-    }
-
-    /**
-     * Returns the class name of an internal type's external representation.
-     */
-    public String getClassName() {
-	return(RUNTIME_NODE_CLASS);
-    }
-
-    public Instruction LOAD(int slot) {
-	return new ILOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ISTORE(slot);
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/NumberType.java b/src/org/apache/xalan/xsltc/compiler/util/NumberType.java
deleted file mode 100644
index 398bf60..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/NumberType.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-
-public abstract class NumberType extends Type {
-    public boolean isNumber() {
-	return true;
-    }
-
-    public boolean isSimple() {
-	return true;
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/RealType.java b/src/org/apache/xalan/xsltc/compiler/util/RealType.java
deleted file mode 100644
index dc178c5..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/RealType.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public final class RealType extends NumberType {
-    protected RealType() {}
-
-    public String toString() {
-	return "real";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return "D";
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return de.fub.bytecode.generic.Type.DOUBLE;
-    }
-
-    /**
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#distanceTo
-     */
-    public int distanceTo(Type type) {
-	if (type == this) {
-	    return 0;
-	}
-	else if (type == Type.Int) {
-	    return 1;
-	}
-	else {
-	    return Integer.MAX_VALUE;
-	}
-    }
-
-    /**
-     * Translates a real into an object of internal type <code>type</code>. The
-     * translation to int is undefined since reals are never converted to ints.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType) type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType) type);
-	}
-	else if (type == Type.Int) {
-	    translateTo(classGen, methodGen, (IntType) type);
-	}
-	else {
-	    classGen.getParser().internalError();		// undefined
-	}
-    }
-
-    /**
-     * Expects a real on the stack and pushes its string value by calling
-     * <code>Double.toString(double d)</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
-						    "realToString",
-						    "(D)" + STRING_SIG)));
-    }
-
-    /**
-     * Expects a real on the stack and pushes a 0 if that number is 0.0 and
-     * a 1 otherwise.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
-	il.append(ICONST_1);
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsel.backPatch(il.append(ICONST_0));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Expects a real on the stack and pushes a truncated integer value
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    IntType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
-						    "realToInt","(D)I")));
-    }
-
-    /**
-     * Translates a real into a non-synthesized boolean. It does not push a 
-     * 0 or a 1 but instead returns branchhandle list to be appended to the 
-     * false list. A NaN must be converted to "false".
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	LocalVariableGen local;
-	final FlowList flowlist = new FlowList();
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Store real into a local variable
-	il.append(DUP2);
-	local = methodGen.addLocalVariable("real_to_boolean_tmp", 
-					   de.fub.bytecode.generic.Type.DOUBLE,
-					   il.getEnd(), null);
-	il.append(new DSTORE(local.getIndex()));
-
-	// Compare it to 0.0
-	il.append(DCONST_0);
-	il.append(DCMPG);
-	flowlist.add(il.append(new IFEQ(null)));
-
-	//!!! call isNaN
-	// Compare it to itself to see if NaN
-	il.append(new DLOAD(local.getIndex()));
-	il.append(new DLOAD(local.getIndex()));
-	il.append(DCMPG);
-	flowlist.add(il.append(new IFNE(null)));	// NaN != NaN
-	return flowlist;
-    }
-
-    /**
-     * Expects a double on the stack and pushes a boxed double. Boxed 
-     * double are represented by an instance of <code>java.lang.Double</code>.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
-	il.append(DUP_X2);
-	il.append(DUP_X2);
-	il.append(POP);
-	il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
-						     "<init>", "(D)V")));
-    }
-
-    /**
-     * Translates a real into the Java type denoted by <code>clazz</code>. 
-     * Expects a real on the stack and pushes a number of the appropriate
-     * type after coercion.
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    final Class clazz) {
-	final InstructionList il = methodGen.getInstructionList();
-	if (clazz == Character.TYPE) {
-	    il.append(D2I);
-	    il.append(I2C);
-	}
-	else if (clazz == Byte.TYPE) {
-	    il.append(D2I);
-	    il.append(I2B);
-	}
-	else if (clazz == Short.TYPE) {
-	    il.append(D2I);
-	    il.append(I2S);
-	}
-	else if (clazz == Integer.TYPE) {
-	    il.append(D2I);
-	}
-	else if (clazz == Long.TYPE) {
-	    il.append(D2L);
-	}
-	else if (clazz == Float.TYPE) {
-	    il.append(D2F);
-	}
-	else if (clazz == Double.TYPE) {
-	    il.append(NOP);
-	}
-	else {
-	    classGen.getParser().internalError();
-	}
-    }
-
-    /**
-     * Translates an external (primitive) Java type into a real. Expects a java 
-     * object on the stack and pushes a real (i.e., a double).
-     */
-    public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, 
-			      Class clazz) {
-	InstructionList il = methodGen.getInstructionList();
-
-	if (clazz == Character.TYPE || clazz == Byte.TYPE ||
-	    clazz == Short.TYPE || clazz == Integer.TYPE) {
-	    il.append(I2D);
-	}
-	else if (clazz == Long.TYPE) {
-	    il.append(L2D);
-	}
-	else if (clazz == Float.TYPE) {
-	    il.append(F2D);
-	}
-	else if (clazz == Double.TYPE) {
-	    il.append(NOP);
-	}
-	else {
-	    classGen.getParser().internalError();
-	}
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new CHECKCAST(cpg.addClass(DOUBLE_CLASS)));
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOUBLE_CLASS,
-						     DOUBLE_VALUE, 
-						     DOUBLE_VALUE_SIG)));
-    }
-
-    public Instruction ADD() {
-	return InstructionConstants.DADD;
-    }
-
-    public Instruction SUB() {
-	return InstructionConstants.DSUB;
-    }
-
-    public Instruction MUL() {
-	return InstructionConstants.DMUL;
-    }
-
-    public Instruction DIV() {
-	return InstructionConstants.DDIV;
-    }
-
-    public Instruction REM() {
-	return InstructionConstants.DREM;
-    }
-
-    public Instruction NEG() {
-	return InstructionConstants.DNEG;
-    }
-
-    public Instruction LOAD(int slot) {
-	return new DLOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new DSTORE(slot);
-    }
-
-    public Instruction POP() {
-	return POP2;
-    }
-    
-    public Instruction CMP(boolean less) {
-	return less ? InstructionConstants.DCMPG : InstructionConstants.DCMPL;
-    }
-
-    public Instruction DUP() {
-	return DUP2;
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java b/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java
deleted file mode 100644
index b5967c6..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public final class ReferenceType extends Type {
-    protected ReferenceType() {}
-
-    public String toString() {
-	return "reference";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return "Ljava/lang/Object;";
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return de.fub.bytecode.generic.Type.OBJECT;
-    }
-
-    /**
-     * Translates a reference to an object of internal type <code>type</code>. 
-     * The translation to int is undefined since references
-     * are always converted to reals in arithmetic expressions.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType) type);
-	}
-	else if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType) type);
-	}
-	else if (type == Type.NodeSet) {
-	    translateTo(classGen, methodGen, (NodeSetType) type);
-	}
-	else if (type == Type.Node) {
-	    translateTo(classGen, methodGen, (NodeType) type);
-	}
-	else {
-	    classGen.getParser().internalError();		// undefined
-	}
-    }
-
-    /**
-     * Translates reference into object of internal type <code>type</code>. 
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final int current = methodGen.getLocalIndex("current");
-	ConstantPoolGen cpg = classGen.getConstantPool();
-	InstructionList il = methodGen.getInstructionList();
-
-	il.append(new ILOAD(current));
-	il.append(methodGen.loadDOM());
-	final int stringF = cpg.addMethodref(BASIS_LIBRARY_CLASS,
-					     "stringF", 
-					     "("
-					     + OBJECT_SIG
-					     + NODE_SIG
-					     + DOM_INTF_SIG
-					     + ")" + STRING_SIG);
-	il.append(new INVOKESTATIC(stringF));
-    }
-
-    /**
-     * Translates a reference into an object of internal type <code>type</code>. 
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	il.append(methodGen.loadDOM());
-	int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "numberF", 
-				     "(" 
-				     + OBJECT_SIG
-				     + DOM_INTF_SIG
-				     + ")D");
-	il.append(new INVOKESTATIC(index));
-    }
-
-    /**
-     * Translates a reference to an object of internal type <code>type</code>. 
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "booleanF", 
-				     "(" 
-				     + OBJECT_SIG
-				     + ")Z");
-	il.append(new INVOKESTATIC(index));
-    }
-
-    /**
-     * Casts a reference into a NodeIterator.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    NodeSetType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToNodeSet", 
-				     "("
-				     + OBJECT_SIG
-				     + ")"
-				     + NODE_ITERATOR_SIG);
-	il.append(new INVOKESTATIC(index));
-	
-	// Reset this iterator
-	index = cpg.addInterfaceMethodref(NODE_ITERATOR, RESET, RESET_SIG);
-	il.append(new INVOKEINTERFACE(index, 1));
-    }
-
-    /**
-     * Casts a reference into a Node.
-     *
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-			    NodeType type) {
-	translateTo(classGen, methodGen, Type.NodeSet);
-	Type.NodeSet.translateTo(classGen, methodGen, type);
-    }
-
-    /**
-     * Expects a reference on the stack and translates it to a non-synthesized
-     * boolean. It does not push a 0 or a 1 but instead returns branchhandle 
-     * list to be appended to the false list.
-     *
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	InstructionList il = methodGen.getInstructionList();
-	translateTo(classGen, methodGen, type);
-	return new FlowList(il.append(new IFEQ(null)));
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-    }
-
-
-    public Instruction LOAD(int slot) {
-	return new ALOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ASTORE(slot);
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java b/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java
deleted file mode 100644
index 7bf5d26..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.DOM;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public final class ResultTreeType extends Type {
-    private final String _methodName;
-
-    protected ResultTreeType() {
-	_methodName = null;
-    }
-
-    public ResultTreeType(String methodName) {
-	_methodName = methodName;
-    }
-
-    public String toString() {
-	return "result-tree";
-    }
-
-    public boolean identicalTo(Type other) {
-	return (other instanceof ResultTreeType);
-    }
-
-    public String toSignature() {
-	return DOM_INTF_SIG;
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return Util.getJCRefType(toSignature());
-    }
-
-    public String getMethodName() {
-	return _methodName;
-    }
-
-    public boolean implementedAsMethod() {
-	return _methodName != null;
-    }
-
-    /**
-     * Translates a result tree to object of internal type <code>type</code>. 
-     * The translation to int is undefined since result trees
-     * are always converted to reals in arithmetic expressions.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of the type to translate the result tree to
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType)type);
-	}
-	else if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType)type);
-	}
-	else if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType)type);
-	}
-	else if (type == Type.NodeSet) {
-	    translateTo(classGen, methodGen, (NodeSetType)type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType)type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Expects an result tree on the stack and pushes a boolean.
-     * Translates a result tree to a boolean by first converting it to string.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of BooleanType (any)
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	// A result tree is always 'true' when converted to a boolean value,
-	// since the tree always has at least one node (the root).
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(POP);      // don't need the DOM reference
-	il.append(ICONST_1); // push 'true' on the stack
-    }
-
-    /**
-     * Expects an result tree on the stack and pushes a string.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of StringType (any)
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	
-	if (_methodName == null) {
-	    int index = cpg.addInterfaceMethodref(DOM_INTF,
-						  "getStringValue", 
-						  "()"+STRING_SIG);
-	    il.append(new INVOKEINTERFACE(index, 1));
-	}
-	else {
-	    final String className = classGen.getClassName();
-	    final int current = methodGen.getLocalIndex("current");
-	    
-	    // Push required parameters 
-	    il.append(classGen.loadTranslet());
-	    if (classGen.isExternal()) {
-		il.append(new CHECKCAST(cpg.addClass(className)));
-	    }
-	    il.append(DUP);
-	    il.append(new GETFIELD(cpg.addFieldref(className, "_dom",
-						   DOM_INTF_SIG)));
-
-	    // Create a new instance of a StringValueHandler
-	    int index = cpg.addMethodref(STRING_VALUE_HANDLER, "<init>", "()V");
-	    il.append(new NEW(cpg.addClass(STRING_VALUE_HANDLER)));
-	    il.append(DUP);
-	    il.append(DUP);
-	    il.append(new INVOKESPECIAL(index));
-	    
-	    // Store new Handler into a local variable
-	    final LocalVariableGen handler =
-		methodGen.addLocalVariable("rt_to_string_handler", 
-					   Util.getJCRefType(STRING_VALUE_HANDLER_SIG),
-					   null, null);
-	    il.append(new ASTORE(handler.getIndex()));
-
-	    // Call the method that implements this result tree
-	    index = cpg.addMethodref(className, _methodName,
-				     "("+DOM_INTF_SIG+TRANSLET_OUTPUT_SIG+")V");
-	    il.append(new INVOKEVIRTUAL(index));
-	    
-	    // Restore new handler and call getValue()
-	    il.append(new ALOAD(handler.getIndex()));
-	    index = cpg.addMethodref(STRING_VALUE_HANDLER,
-				     "getValue",
-				     "()" + STRING_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-	}
-    }
-
-    /**
-     * Expects an result tree on the stack and pushes a real.
-     * Translates a result tree into a real by first converting it to string.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of RealType (any)
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	translateTo(classGen, methodGen, Type.String);
-	Type.String.translateTo(classGen, methodGen, Type.Real);	
-    }
-
-    /**
-     * Expects a result tree on the stack and pushes a boxed result tree.
-     * Result trees are already boxed so the translation is just a NOP.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of ReferenceType (any)
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	if (_methodName == null) {
-	    il.append(NOP);
-	}
-	else {
-	    LocalVariableGen domBuilder, newDom;
-	    final String className = classGen.getClassName();
-	    final int current = methodGen.getLocalIndex("current");
-
-	    // Push required parameters 
-	    il.append(classGen.loadTranslet());
-	    if (classGen.isExternal()) {
-		il.append(new CHECKCAST(cpg.addClass(className)));
-	    }
-	    il.append(methodGen.loadDOM());
-
-	    // Create new instance of DOM class (with 64 nodes)
-	    int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
-	    il.append(new NEW(cpg.addClass(DOM_IMPL)));
-	    il.append(DUP);
-	    il.append(DUP);
-	    il.append(new PUSH(cpg, 64));
-	    il.append(new INVOKESPECIAL(index));
-	    
-	    // Store new DOM into a local variable
-	    newDom = methodGen.addLocalVariable("rt_to_reference_dom", 
-						Util.getJCRefType(DOM_INTF_SIG),
-						null, null);
-	    il.append(new CHECKCAST(cpg.addClass(DOM_INTF_SIG)));
-	    il.append(new ASTORE(newDom.getIndex()));
-
-	    // Overwrite old handler with DOM handler
-	    index = cpg.addMethodref(DOM_IMPL,
-				     "getOutputDomBuilder", 
-				     "()" + TRANSLET_OUTPUT_SIG);
-	    il.append(new INVOKEVIRTUAL(index));
-	    il.append(DUP);
-	    il.append(DUP);
-
-	    // Store DOM handler in a local in order to call endDocument()
-	    domBuilder =
-		methodGen.addLocalVariable("rt_to_reference_handler", 
-					   Util.getJCRefType(TRANSLET_OUTPUT_SIG),
-					   null, null);
-	    il.append(new ASTORE(domBuilder.getIndex()));
-
-	    // Call startDocument on the new handler
-	    index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE, 
-					      "startDocument", "()V");
-	    il.append(new INVOKEINTERFACE(index, 1));
-
-	    // Call the method that implements this result tree
-	    index = cpg.addMethodref(className,
-				     _methodName,
-				     "("
-				     + DOM_INTF_SIG
-				     + TRANSLET_OUTPUT_SIG
-				     +")V");
-	    il.append(new INVOKEVIRTUAL(index));
-
-	    // Call endDocument on the DOM handler
-	    il.append(new ALOAD(domBuilder.getIndex()));
-	    index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE, 
-					      "endDocument", "()V");
-	    il.append(new INVOKEINTERFACE(index, 1));
-
-	    // Push the new DOM on the stack
-	    il.append(new ALOAD(newDom.getIndex()));
-	}
-    }
-
-    /**
-     * Expects a result tree on the stack and pushes a node-set (iterator).
-     * Note that the produced iterator is an iterator for the DOM that
-     * contains the result tree, and not the DOM that is currently in use.
-     * This conversion here will therefore not directly work with elements
-     * such as <xsl:apply-templates> and <xsl:for-each> without the DOM
-     * parameter/variable being updates as well.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of NodeSetType (any)
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    NodeSetType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	// Put an extra copy of the result tree (DOM) on the stack
-	il.append(DUP);
-
-	// DOM adapters containing a result tree are not initialised with
-	// translet-type to DOM-type mapping. This must be done now for
-	// XPath expressions and patterns to work for the iterator we create.
-	il.append(classGen.loadTranslet()); // get names array
-	il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       NAMES_INDEX,
-					       NAMES_INDEX_SIG)));
-	il.append(classGen.loadTranslet()); // get namespaces array
-	il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
-					       NAMESPACE_INDEX,
-					       NAMESPACE_INDEX_SIG)));
-	// Pass the type mappings to the DOM adapter
-	final int mapping = cpg.addInterfaceMethodref(DOM_INTF,
-						      "setupMapping",
-						      "(["+STRING_SIG+
-						      "["+STRING_SIG+")V");
-	il.append(new INVOKEINTERFACE(mapping, 3));
-	il.append(DUP);
-
-	// Create an iterator with all the nodes in the DOM adapter
-	final int iter = cpg.addInterfaceMethodref(DOM_INTF,
-						   "getChildren",
-						   "(I)"+NODE_ITERATOR_SIG);
-	il.append(new PUSH(cpg, DOM.ROOTNODE));
-	il.append(new INVOKEINTERFACE(iter, 2));
-    }
-
-    /**
-     * Translates a result tree into a non-synthesized boolean.
-     * It does not push a 0 or a 1 but instead returns branchhandle list
-     * to be appended to the false list.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An instance of BooleanType (any)
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	translateTo(classGen, methodGen, Type.Boolean);
-	return new FlowList(il.append(new IFEQ(null)));
-    }
-
-    /**
-     * Translates a result tree to a Java type denoted by <code>clazz</code>. 
-     * Expects a result tree on the stack and pushes an object
-     * of the appropriate type after coercion. Result trees are translated
-     * to W3C Node or W3C NodeList and the translation is done
-     * via node-set type.
-     *
-     * @param classGen A BCEL class generator
-     * @param methodGen A BCEL method generator
-     * @param type An reference to the Class to translate to
-     * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	final String className = clazz.getName();
-	if (className.equals("org.w3c.dom.Node") ||
-	    className.equals("org.w3c.dom.NodeList")) {
-	    translateTo(classGen, methodGen, Type.NodeSet);
-	    Type.NodeSet.translateTo(classGen, methodGen, clazz);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	methodGen.getInstructionList().append(NOP);
-    }
-
-    /**
-     * Returns the class name of an internal type's external representation.
-     */
-    public String getClassName() {
-	return(DOM_INTF);
-    }
-
-    public Instruction LOAD(int slot) {
-	return new ALOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ASTORE(slot);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/RtMethodGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/RtMethodGenerator.java
deleted file mode 100644
index 4ad1693..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/RtMethodGenerator.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import java.util.Vector;
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.Template;
-
-/**
- * This class is used for result trees implemented as methods. These
- * methods take a reference to the DOM and to the handler only.
- */
-public final class RtMethodGenerator extends MethodGenerator {
-    private static final int HANDLER_INDEX = 2;
-    private final Instruction _astoreHandler;
-    private final Instruction _aloadHandler;
-
-    public RtMethodGenerator(int access_flags, Type return_type,
-			     Type[] arg_types, String[] arg_names,
-			     String method_name, String class_name,
-			     InstructionList il, ConstantPoolGen cp) {
-	super(access_flags, return_type, arg_types, arg_names, method_name, 
-	      class_name, il, cp);
-	
-	_astoreHandler = new ASTORE(HANDLER_INDEX);
-	_aloadHandler  = new ALOAD(HANDLER_INDEX);
-    }
-
-    public int getIteratorIndex() {
-	return INVALID_INDEX;		// not available
-    }
-    
-    public final Instruction storeHandler() {
-	return _astoreHandler;
-    }
-
-    public final Instruction loadHandler() {
-	return _aloadHandler;
-    }
-
-    public int getLocalIndex(String name) {
-	return INVALID_INDEX;		// not available
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java b/src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java
deleted file mode 100644
index b7f6c72..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-
-final class SlotAllocator {
-    private int   _firstAvailableSlot;
-    private int   _size = 8;
-    private int   _free = 0;
-    private int[] _slotsTaken = new int[_size];
-
-    /*
-    private static int Serial = 0;
-    private final int _serial = Serial++;
-    
-
-    private void printState(String msg) {
-	System.out.println("=========== " + _serial + " =========== " + msg);
-	System.out.println("firstAvailableSlot = " + _firstAvailableSlot);
-	
-	for (int i = 0; i < _free; i++) {
-	    System.out.println("\tslotsTaken = " + _slotsTaken[i]);
-	}
-	
-	System.out.println("========================");
-    }
-    */
-    
-    public void initialize(LocalVariableGen[] vars) {
-	final int length = vars.length;
-	//System.out.println(_serial + " initialize " + length);
-	int slot = 0;
-	for (int i = 0; i < length; i++) {
-	    //System.out.println("index " + vars[i].getIndex());
-	    //System.out.println("all " + allocateSlot(vars[i].getType()));
-	    //allocateSlot(vars[i].getType());
-	    slot = Math.max(slot,
-			    vars[i].getIndex() + vars[i].getType().getSize());
-	}
-	_firstAvailableSlot = slot;
-	//System.out.println("firstAvailableSlot = " + _firstAvailableSlot);
-    }
-
-    public int allocateSlot(Type type) {
-	final int size = type.getSize();
-	final int limit = _free;
-	int slot = _firstAvailableSlot, where = 0;
-
-	//printState("allocating");
-
-	if (_free + size > _size) {
-	    final int[] array = new int[_size *= 2];
-	    for (int j = 0; j < limit; j++) {
-		array[j] = _slotsTaken[j];
-	    }
-	    _slotsTaken = array;
-	}
-
-	while (where < limit) {
-	    if (slot + size <= _slotsTaken[where]) {
-		// insert
-		for (int j = limit - 1; j >= where; j--) {
-		    _slotsTaken[j + size] = _slotsTaken[j];
-		}
-		break;
-	    }
-	    else {
-		slot = _slotsTaken[where++] + 1;
-	    }
-	}
-	
-	for (int j = 0; j < size; j++) {
-	    _slotsTaken[where + j] = slot + j;
-	}
-	
-	_free += size;
-	//System.out.println("allocated slot " + slot);
-	//printState("done");
-	return slot;
-    }
-
-    public void releaseSlot(LocalVariableGen lvg) {
-	final int size = lvg.getType().getSize();
-	final int slot = lvg.getIndex();
-	final int limit = _free;
-	
-	//printState("releasing " + slot);
-	for (int i = 0; i < limit; i++) {
-	    if (_slotsTaken[i] == slot) {
-		int j = i + size;
-		while (j < limit) {
-		    _slotsTaken[i++] = _slotsTaken[j++];
-		}
-		_free -= size;
-		//System.out.println("released slot " + slot);
-		
-		//printState("done");
-		return;
-	    }
-	}
-	System.err.println("size = " + size);
-	System.err.println("slot = " + slot);
-	System.err.println("limit = " + limit);
-	//printState("error");
-	throw new Error("releaseSlot");
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/StringStack.java b/src/org/apache/xalan/xsltc/compiler/util/StringStack.java
deleted file mode 100644
index 424b754..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/StringStack.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import java.util.Stack;
-
-public final class StringStack extends Stack {
-    public String peekString() {
-	return (String) super.peek();
-    }
-	
-    public String popString() {
-	return (String) super.pop();
-    }
-	
-    public String pushString(String val) {
-	return (String) super.push(val);
-    }		
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/StringType.java b/src/org/apache/xalan/xsltc/compiler/util/StringType.java
deleted file mode 100644
index 0f186c3..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/StringType.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.FlowList;
-
-public class StringType extends Type {
-    protected StringType() {}
-
-    public String toString() {
-	return "string";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return "Ljava/lang/String;";
-    }
-
-    public boolean isSimple() {
-	return true;
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return de.fub.bytecode.generic.Type.STRING;
-    }
-
-    /**
-     * Translates a string into an object of internal type <code>type</code>.
-     * The translation to int is undefined since strings are always converted
-     * to reals in arithmetic expressions.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.Boolean) {
-	    translateTo(classGen, methodGen, (BooleanType) type);
-	}
-	else if (type == Type.Real) {
-	    translateTo(classGen, methodGen, (RealType) type);
-	}
-	else if (type == Type.Reference) {
-	    translateTo(classGen, methodGen, (ReferenceType) type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Translates a string into a synthesized boolean.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    BooleanType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
-	il.append(ICONST_1);
-	final BranchHandle truec = il.append(new GOTO(null));
-	falsel.backPatch(il.append(ICONST_0));
-	truec.setTarget(il.append(NOP));
-    }
-
-    /**
-     * Translates a string into a real by calling stringToReal() from the
-     * basis library.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    RealType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
-						    STRING_TO_REAL,
-						    STRING_TO_REAL_SIG)));
-    }
-
-    /**
-     * Translates a string into a non-synthesized boolean. It does not push a 
-     * 0 or a 1 but instead returns branchhandle list to be appended to the 
-     * false list.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	final ConstantPoolGen cpg = classGen.getConstantPool();
-	final InstructionList il = methodGen.getInstructionList();
-
-	il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
-						     "length", "()I")));
-	return new FlowList(il.append(new IFEQ(null)));
-    }
-
-    /**
-     * Expects a string on the stack and pushes a boxed string.
-     * Strings are already boxed so the translation is just a NOP.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    ReferenceType type) {
-	methodGen.getInstructionList().append(NOP);
-    }
-
-    /**
-     * Translates a internal string into an external (Java) string. 
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateFrom
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	if (clazz.getName().equals("java.lang.String")) {
-	    // same internal representation
-	    methodGen.getInstructionList().append(NOP);
-	}
-	else {
-	    classGen.getParser().internalError();
-	}
-    }
-    
-    /**
-     * Translates an external (primitive) Java type into a string. 
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateFrom
-     */
-    public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, 
-			      Class clazz) {
-	translateTo(classGen, methodGen, clazz);
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	translateTo(classGen, methodGen, Type.Reference);
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	methodGen.getInstructionList().append(NOP);
-    }
-
-    /**
-     * Returns the class name of an internal type's external representation.
-     */
-    public String getClassName() {
-	return(STRING_CLASS);
-    }
-
-
-    public Instruction LOAD(int slot) {
-	return new ALOAD(slot);
-    }
-	
-    public Instruction STORE(int slot) {
-	return new ASTORE(slot);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/TestGenerator.java b/src/org/apache/xalan/xsltc/compiler/util/TestGenerator.java
deleted file mode 100644
index 7d5d040..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/TestGenerator.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Template;
-
-public final class TestGenerator extends MethodGenerator {
-    private static int CONTEXT_NODE_INDEX = 1;
-    private static int CURRENT_NODE_INDEX = 4;
-    private static int ITERATOR_INDEX = 6;
-
-    private Instruction _aloadDom;
-    private final Instruction _iloadCurrent;
-    private final Instruction _iloadContext;
-    private final Instruction _istoreCurrent;
-    private final Instruction _istoreContext;
-    private final Instruction _astoreIterator;
-    private final Instruction _aloadIterator;
-
-    public TestGenerator(int access_flags, Type return_type,
-			 Type[] arg_types, String[] arg_names,
-			 String method_name, String class_name,
-			 InstructionList il, ConstantPoolGen cp) {
-	super(access_flags, return_type, arg_types, arg_names, method_name, 
-	      class_name, il, cp);
-	
-	_iloadCurrent  = new ILOAD(CURRENT_NODE_INDEX);
-	_istoreCurrent = new ISTORE(CURRENT_NODE_INDEX);
-	_iloadContext  = new ILOAD(CONTEXT_NODE_INDEX);
-	_istoreContext  = new ILOAD(CONTEXT_NODE_INDEX);
-	_astoreIterator = new ASTORE(ITERATOR_INDEX);
-	_aloadIterator  = new ALOAD(ITERATOR_INDEX);
-    }
-
-    public int getHandlerIndex() {
-	return INVALID_INDEX;		// not available
-    }
-
-    public int getIteratorIndex() {
-	return ITERATOR_INDEX;		// not available
-    }
-
-    public void setDomIndex(int domIndex) {
-	_aloadDom = new ALOAD(domIndex);
-    }
-
-    public Instruction loadDOM() {
-	return _aloadDom;
-    }
-
-    public Instruction loadCurrentNode() {
-	return _iloadCurrent;
-    }
-
-    /** by default context node is the same as current node. MK437 */
-    public Instruction loadContextNode() {
-	return _iloadContext;
-    }
-
-    public Instruction storeContextNode() {
-	return _istoreContext;
-    }
-
-    public Instruction storeCurrentNode() {
-	return _istoreCurrent;
-    }
-
-    public Instruction storeIterator() {
-	return _astoreIterator;
-    }
-    
-    public Instruction loadIterator() {
-	return _aloadIterator;
-    }
-
-    public int getLocalIndex(String name) {
-	if (name.equals("current")) {
-	    return CURRENT_NODE_INDEX;
-	}
-	else {
-	    return super.getLocalIndex(name);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/Type.java b/src/org/apache/xalan/xsltc/compiler/util/Type.java
deleted file mode 100644
index de8bb59..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/Type.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-import org.apache.xalan.xsltc.compiler.NodeTest;
-import org.apache.xalan.xsltc.compiler.FlowList;
-import org.apache.xalan.xsltc.compiler.Constants;
-
-public abstract class Type implements Constants {
-    public static final Type Int        = new IntType();
-    public static final Type Real       = new RealType();
-    public static final Type Boolean    = new BooleanType();
-    public static final Type NodeSet    = new NodeSetType();
-    public static final Type String     = new StringType();
-    public static final Type ResultTree = new ResultTreeType();
-    public static final Type Reference  = new ReferenceType();
-    public static final Type Void       = new VoidType();
-
-    public static final Type Node       = new NodeType(NodeTest.ANODE);
-    public static final Type Root       = new NodeType(NodeTest.ROOT);
-    public static final Type Element    = new NodeType(NodeTest.ELEMENT);
-    public static final Type Attribute  = new NodeType(NodeTest.ATTRIBUTE);
-    public static final Type Text       = new NodeType(NodeTest.TEXT);
-    public static final Type Comment    = new NodeType(NodeTest.COMMENT);
-    public static final Type Processing_Instruction = new NodeType(NodeTest.PI);
-
-    /**
-     * Returns a string representation of this type.	
-     */
-    public abstract String toString();
-
-    /**
-     * Returns true if this and other are identical types.
-     */
-    public abstract boolean identicalTo(Type other);
-
-    /**
-     * Returns true if this type is a numeric type. Redefined in NumberType.
-     */
-    public boolean isNumber() {
-	return false;
-    }
-
-    /**
-     * Returns true if this type has no object representaion. Redefined in
-     * ResultTreeType.
-     */
-    public boolean implementedAsMethod() {
-	return false;
-    }
-
-    /**
-     * Returns true if this type is a simple type. Redefined in NumberType,
-     * BooleanType and StringType.
-     */
-    public boolean isSimple() {
-	return false;
-    }
-
-    public abstract de.fub.bytecode.generic.Type toJCType();
-
-    /**
-     * Returns the distance between two types. This measure is used to select
-     * overloaded functions/operators. This method is typically redefined by
-     * the subclasses.
-     */
-    public int distanceTo(Type type) {
-	return type == this ? 0 : Integer.MAX_VALUE;
-    }
-
-    /**
-     * Returns the signature of an internal type's external representation.
-     */
-    public abstract String toSignature();
-
-    /**
-     * Translates an object of this type to an object of type
-     * <code>type</code>. 
-     * Expects an object of the former type and pushes an object of the latter.
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	classGen
-	    .getParser()
-	    .notYetImplemented(toString() + " -> " + type.toString());
-    }
-
-    /**
-     * Translates object of this type to an object of type <code>type</code>. 
-     * Expects an object of the former type and pushes an object of the latter
-     * if not boolean. If type <code>type</code> is boolean then a branchhandle
-     * list (to be appended to the false list) is returned.
-     */
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     Type type) {
-	FlowList fl = null;
-	if (type == Type.Boolean) {
-	    fl = translateToDesynthesized(classGen, methodGen,
-					  (BooleanType)type);
-	}
-	else {
-	    translateTo(classGen, methodGen, type);
-	}
-	return fl;
-    }
-
-    /**
-     * Translates an object of this type to an non-synthesized boolean. It
-     * does not push a 0 or a 1 but instead returns branchhandle list to be
-     * appended to the false list.
-     */ 
-    public FlowList translateToDesynthesized(ClassGenerator classGen, 
-					     MethodGenerator methodGen, 
-					     BooleanType type) {
-	classGen
-	    .getParser()
-	    .notYetImplemented(toString() + " -> " + type.toString());
-	return null;
-    }
-
-    /**
-     * Translates an object of this type to the external (Java) type denoted
-     * by <code>clazz</code>. This method is used to translate parameters 
-     * when external functions are called.
-     */ 
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Class clazz) {
-	classGen.getParser().notYetImplemented(toString() + " -> " +
-					       clazz.getClass().toString());
-    }
-
-    /**
-     * Translates an external (Java) type denoted by <code>clazz</code> to 
-     * an object of this type. This method is used to translate return values 
-     * when external functions are called.
-     */ 
-    public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, 
-			      Class clazz) {
-	classGen
-	    .getParser()
-	    .notYetImplemented(clazz.getClass().toString() + " -> "
-			       + toString());
-    }
-
-    /**
-     * Translates an object of this type to its boxed representation.
-     */ 
-    public void translateBox(ClassGenerator classGen,
-			     MethodGenerator methodGen) {
-	classGen
-	    .getParser()
-	    .notYetImplemented(toString() + " -> boxed " + toString());
-    }
-
-    /**
-     * Translates an object of this type to its unboxed representation.
-     */ 
-    public void translateUnBox(ClassGenerator classGen,
-			       MethodGenerator methodGen) {
-	classGen
-	    .getParser()
-	    .notYetImplemented(toString() + " -> unboxed " + toString());
-    }
-
-    /**
-     * Returns the class name of an internal type's external representation.
-     */
-    public String getClassName() {
-	return(EMPTYSTRING);
-    }
-
-    public Instruction ADD() {
-	return null;		// should never be called
-    }
-
-    public Instruction SUB() {
-	return null;		// should never be called
-    }
-
-    public Instruction MUL() {
-	return null;		// should never be called
-    }
-
-    public Instruction DIV() {
-	return null;		// should never be called
-    }
-
-    public Instruction REM() {
-	return null;		// should never be called
-    }
-
-    public Instruction NEG() {
-	return null;		// should never be called
-    }
-
-    public Instruction LOAD(int slot) {
-	return null;		// should never be called
-    }
-	
-    public Instruction STORE(int slot) {
-	return null;		// should never be called
-    }
-
-    public Instruction POP() {
-	return POP;
-    }
-
-    public BranchInstruction GT(boolean tozero) {
-	return null;		// should never be called
-    }
-
-    public BranchInstruction GE(boolean tozero) {
-	return null;		// should never be called
-    }
-
-    public BranchInstruction LT(boolean tozero) {
-	return null;		// should never be called
-    }
-
-    public BranchInstruction LE(boolean tozero) {
-	return null;		// should never be called
-    }
-
-    public Instruction CMP(boolean less) {
-	return null;		// should never be called
-    }
-	
-    public Instruction DUP() {
-	return DUP;	// default
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java b/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java
deleted file mode 100644
index 3da39e8..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.SyntaxTreeNode;
-
-public class TypeCheckError extends Exception {
-    ErrorMsg _error = null;
-    SyntaxTreeNode _node = null;
-	
-    public TypeCheckError(SyntaxTreeNode node) {
-	super();
-	_node = node;
-    }
-
-    public TypeCheckError(ErrorMsg error) {
-	super();
-	_error = error;
-    }
-	
-    public TypeCheckError(int code, Object param) {
-	super();
-	_error = new ErrorMsg(code, param);
-    }
-
-    public TypeCheckError(int code, Object param1, Object param2) {
-	super();
-	_error = new ErrorMsg(code, param1, param2);
-    }
-
-    public String toString() {
-	String result;
-
-	if (_error != null) {
-	    result = _error.toString();
-	}
-	else if (_node != null) {
-	    result = "Type check error in " + _node.toString() + ".";
-	}
-	else {
-	    result = "Type check error (no line information).";
-	}
-
-	return result;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/util/Util.java b/src/org/apache/xalan/xsltc/compiler/util/Util.java
deleted file mode 100644
index ce5d273..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/Util.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import de.fub.bytecode.generic.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-
-public final class Util {
-    static public char filesep;
-
-    static {
-	String temp = System.getProperty("file.separator", "/");
-	filesep = temp.charAt(0);
-    }
-
-    public static String noExtName(String name) {
-	final int index = name.lastIndexOf('.');
-	return name.substring(0, index >= 0 ? index : name.length());
-    }
-
-    /**
-     * Search for both slashes in order to support URLs and 
-     * files.
-     */
-    public static String baseName(String name) {
-	int index = name.lastIndexOf('/');
-	if (index < 0) {
-	    index = name.lastIndexOf('\\');
-	}
-	return name.substring(index + 1);
-    }
-
-    /**
-     * Search for both slashes in order to support URLs and 
-     * files.
-     */
-    public static String pathName(String name) {
-	int index = name.lastIndexOf('/');
-	if (index < 0) {
-	    index = name.lastIndexOf('\\');
-	}
-	return name.substring(0, index + 1);
-    }
-
-    /**
-     * Replace all illegal Java chars by '_'.
-     */
-    public static String toJavaName(String name) {
-	final StringBuffer result = new StringBuffer();
-
-	char ch = name.charAt(0);
-	result.append(Character.isJavaIdentifierStart(ch) ? ch : '_');
-
-	final int n = name.length();
-	for (int i = 1; i < n; i++) {
-	    ch = name.charAt(i);
-	    result.append(Character.isJavaIdentifierPart(ch)  ? ch : '_');
-	}
-	return result.toString();
-    }
-
-    public static Type getJCRefType(String signature) {
-	return Type.getType(signature);
-    }
-
-    public static String internalName(String cname) {
-	return cname.replace('.', filesep);
-    }
-
-    public static void println(String s) {
-	if (false) {
-	    System.out.println(s);
-	}
-    }
-
-    public static void println(char ch) {
-	/*
-	  //	if (Parser.debug()) {
-	  if (false) {
-	  System.out.println(ch);
-	  }
-	*/
-    }
-
-    public static void TRACE1() {
-	System.out.println("TRACE1");
-    }
-
-    public static void TRACE2() {
-	System.out.println("TRACE2");
-    }
-
-    public static void TRACE3() {
-	System.out.println("TRACE3");
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/compiler/util/VoidType.java b/src/org/apache/xalan/xsltc/compiler/util/VoidType.java
deleted file mode 100644
index b79c13b..0000000
--- a/src/org/apache/xalan/xsltc/compiler/util/VoidType.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.compiler.util;
-
-import org.apache.xalan.xsltc.compiler.util.Type;
-import de.fub.bytecode.generic.*;
-import org.apache.xalan.xsltc.compiler.Parser;
-
-public final class VoidType extends Type {
-    protected VoidType() {}
-
-    public String toString() {
-	return "void";
-    }
-
-    public boolean identicalTo(Type other) {
-	return this == other;
-    }
-
-    public String toSignature() {
-	return "V";
-    }
-
-    public de.fub.bytecode.generic.Type toJCType() {
-	return null;	// should never be called
-    }
-
-    /**
-     * Translates a void into an object of internal type <code>type</code>.
-     * This translation is needed when calling external functions
-     * that return void.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    Type type) {
-	if (type == Type.String) {
-	    translateTo(classGen, methodGen, (StringType) type);
-	}
-	else {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-
-    /**
-     * Translates a void into a string by pushing the empty string ''.
-     *
-     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
-     */
-    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
-			    StringType type) {
-	final InstructionList il = methodGen.getInstructionList();
-	il.append(new PUSH(classGen.getConstantPool(), ""));
-    }
-
-    /**
-     * Translates an external (primitive) Java type into a void.
-     * Only an external "void" can be converted to this class.
-     */
-    public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, 
-			      Class clazz) {
-	if (!clazz.getName().equals("void")) {
-	    classGen.getParser().internalError(); // undefined
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/compiler/xpath.cup b/src/org/apache/xalan/xsltc/compiler/xpath.cup
deleted file mode 100644
index dca1695..0000000
--- a/src/org/apache/xalan/xsltc/compiler/xpath.cup
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- * @(#)$Id$
- *
- * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * This software is the proprietary information of Sun Microsystems, Inc.  
- * Use is subject to license terms.
- *  
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *  
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java.util.Stack;
-import java.util.Vector;
-import java.io.StringReader;
-import java_cup.runtime.*;
-
-import org.apache.xalan.xsltc.dom.Axis;
-import org.apache.xalan.xsltc.runtime.Operators;
-import org.apache.xalan.xsltc.compiler.util.ErrorMsg;
-
-parser code {:
-    /**
-     * Used by function calls with no args.
-     */
-    static public final Vector EmptyArgs = new Vector(0);
-
-    /**
-     * Reference to non-existing variable.
-     */
-    static public final VariableRef DummyVarRef = null;
-
-    /**
-     * Reference to the Parser class.
-     */
-    private Parser _parser;
-    private XSLTC  _xsltc;
-
-    /**
-     * Line number where this expression/pattern was declared.
-     */
-    private int _lineNumber = 0;
-
-    /**
-     * Reference to the symbol table.
-     */
-    public SymbolTable _symbolTable;
-
-    public XPathParser(Parser parser) {
-        _parser = parser;
-	_xsltc = parser.getXSLTC();
-        _symbolTable = parser.getSymbolTable();
-    }
-
-    public int getLineNumber() {
-        return _lineNumber;
-    }
-
-    public QName getQName(String name) {
-          return _parser.getQName(name);
-    }    
-
-    public void setMultiDocument(boolean flag) {
-          _xsltc.setMultiDocument(flag);
-    }
-
-    public int findNodeType(int axis, Object test) {
-	if (test == null) {  // *
-            return axis == Axis.ATTRIBUTE
-                   ? NodeTest.ATTRIBUTE
-                   : NodeTest.ELEMENT;
-        }
-        else if (test instanceof Integer) {
-            return ((Integer)test).intValue();
-        }
-        else {
-	    QName name = (QName)test;
-            if (name.getPrefix() == null || name.getNamespace() == null) {
-                final String local = name.getLocalPart();
-	        if (local.equals("*"))
-                    return(NodeTest.ELEMENT);
-                else if (local.equals("@*"))
-                    return(NodeTest.ATTRIBUTE);
-	        if (local.startsWith("@"))
-                    name = new QName(null,null,local);
-            }
-	    return axis == Axis.ATTRIBUTE
-		? _xsltc.registerAttribute(name)
-		: _xsltc.registerElement(name);
-        }
-    }
-
-    /**
-     * Parse the expression passed to the current scanner. If this
-     * expression contains references to local variables and it will be 
-     * compiled in an external module (not in the main class) request 
-     * the current template to create a new variable stack frame.
-     *
-     * @param lineNumber Line where the current expression is defined.
-     * @param external   Set to <tt>true</tt> if this expression is
-     *                   compiled in a separate module.
-     * 
-     */
-    public Symbol parse(int lineNumber) throws Exception {
-        try {
-	    _lineNumber = lineNumber;
-	    return super.parse();
-        }
-        catch (IllegalCharException e) {
-	    addError(new ErrorMsg("Illegal character '" + e.getMessage() +
-	    	"' in XPath expression.", lineNumber));
-        }
-        return null;
-    }
-
-    /**
-     * Lookup a variable or parameter in the symbol table given its name. 
-     *
-     * @param name Name of the symbol being looked up.
-     */
-    final SyntaxTreeNode lookupName(QName name) {
-        // Is it a local var or param ?
-        final SyntaxTreeNode result = _parser.lookupVariable(name);
-	if (result != null)
-            return(result);
-        else
-	    return(_symbolTable.lookupName(name));
-    }
-
-    public final void addError(ErrorMsg error) {
-        //_parser.addError(error);
-	_parser.reportError(Constants.ERROR, error);
-    } 
-           
-    public void report_error(String message, Object info) {
-        // empty
-    }
-
-    public void report_fatal_error(String message, Object info) {
-        // empty
-    }
-:}
-
-terminal SLASH, DOT, LBRACK, RBRACK, VBAR, LPAREN, RPAREN, STAR, COMMA;
-terminal DOLLAR, ATSIGN;
-terminal DDOT, DCOLON, DSLASH;
-terminal EQ, NE;
-terminal LT, GT, LE, GE;
-terminal PLUS, MINUS, DIV, MOD;
-terminal String Literal;
-terminal String QNAME;
-terminal ID, KEY, TEXT, NODE, OR, AND, COMMENT, PI, PRECEDINGSIBLING;
-terminal SELF, PARENT, CHILD, ATTRIBUTE, ANCESTOR, ANCESTORORSELF, DESCENDANT; 
-terminal DESCENDANTORSELF, FOLLOWING, FOLLOWINGSIBLING, NAMESPACE, PRECEDING;
-terminal Double REAL;
-terminal Integer INT;
-terminal PATTERN, EXPRESSION;
-
-non terminal SyntaxTreeNode TopLevel;
-    
-non terminal Expression Expr, Argument, LocationPath;
-non terminal Expression Predicate, FilterExpr, Step;
-non terminal Expression OrExpr, AndExpr, EqualityExpr;
-non terminal Expression RelationalExpr, AdditiveExpr;
-non terminal Expression MultiplicativeExpr, UnaryExpr;
-non terminal Expression VariableReference, FunctionCall;
-non terminal Expression PrimaryExpr, UnionExpr, PathExpr, AbbreviatedStep;
-non terminal Expression RelativeLocationPath, AbbreviatedRelativeLocationPath;
-non terminal Expression AbsoluteLocationPath, AbbreviatedAbsoluteLocationPath;
-
-non terminal Object NodeTest, NameTest;
-
-non terminal IdKeyPattern IdKeyPattern;
-non terminal Pattern Pattern;
-non terminal Pattern LocationPathPattern;
-non terminal RelativePathPattern RelativePathPattern;
-non terminal StepPattern StepPattern;
-non terminal Object NodeTestPattern, NameTestPattern;
-
-non terminal Vector Predicates, NonemptyArgumentList;
-non terminal QName QName, FunctionName, VariableName;
-non terminal Integer AxisName, AxisSpecifier;
-non terminal Integer ChildOrAttributeAxisSpecifier;
-
-precedence left VBAR;
-precedence left OR;
-precedence left AND;
-precedence nonassoc EQ, NE;
-precedence left LT, GT, LE, GE;
-    
-precedence left PLUS, MINUS;
-precedence left DIV, MOD, STAR;
-precedence left DOLLAR;
-precedence left ATSIGN;
-precedence right DCOLON;
-
-start with TopLevel;
-
-TopLevel ::= PATTERN Pattern:pattern
-            {: RESULT = pattern; :}
-
-            | EXPRESSION Expr:expr
-            {: RESULT = expr; :};
-
-/* --------------------------- Patterns ----------------------------------- */
-
-Pattern ::= LocationPathPattern:lpp
-            {: RESULT = lpp; :}
-
-            | LocationPathPattern:lpp VBAR Pattern:p
-            {: RESULT = new AlternativePattern(lpp, p);  :};
-
-LocationPathPattern ::= SLASH
-            {: RESULT = new AbsolutePathPattern(null); :}
-
-            | SLASH RelativePathPattern:rpp
-            {: RESULT = new AbsolutePathPattern(rpp); :}
-
-            | IdKeyPattern:ikp
-            {: RESULT = ikp; :}
-
-            | IdKeyPattern:ikp SLASH RelativePathPattern:rpp
-            {: RESULT = new ParentPattern(ikp, rpp); :}
-
-            | IdKeyPattern:ikp DSLASH RelativePathPattern:rpp
-            {: RESULT = new AncestorPattern(ikp, rpp); :}
-
-            | DSLASH RelativePathPattern:rpp
-            {: RESULT = new AncestorPattern(rpp); :}
-
-            | RelativePathPattern:rpp
-            {: RESULT = rpp; :};
-
-IdKeyPattern ::= ID LPAREN Literal:l RPAREN
-            {: RESULT = new IdPattern(l); :}
-
-            | KEY LPAREN Literal:l1 COMMA Literal:l2 RPAREN
-            {: RESULT = new KeyPattern(l1, l2); :};
-
-RelativePathPattern ::= StepPattern:sp
-            {: RESULT = sp; :}
-
-            | StepPattern:sp SLASH RelativePathPattern:rpp
-            {: RESULT = new ParentPattern(sp, rpp); :}
-
-            | StepPattern:sp DSLASH RelativePathPattern:rpp
-            {: RESULT = new AncestorPattern(sp, rpp); :};
-
-StepPattern ::= NodeTestPattern:nt
-            {: RESULT = new StepPattern(Axis.CHILD,
-                                        parser.findNodeType(Axis.CHILD, nt),
-                                        null);
-            :}
-
-            | NodeTestPattern:nt Predicates:pp
-            {: RESULT = new StepPattern(Axis.CHILD,
-                                        parser.findNodeType(Axis.CHILD, nt),
-                                        pp);
-            :}
-
-            | ChildOrAttributeAxisSpecifier:axis NodeTestPattern:nt
-            {: RESULT=new StepPattern(axis.intValue(),
-                                      parser.findNodeType(axis.intValue(), nt),
-                                      null);
-            :}
-
-	    | ChildOrAttributeAxisSpecifier:axis
-		  NodeTestPattern:nt Predicates:pp
-            {: RESULT = new StepPattern(axis.intValue(),
-                                        parser.findNodeType(axis.intValue(),
-                                                            nt),
-                                        pp);
-            :};
-
-NodeTestPattern ::= NameTestPattern:nt
-            {: RESULT = nt; :}
-
-            | NODE
-            {: RESULT = new Integer(NodeTest.ANODE); :} 
-
-            | TEXT
-            {: RESULT = new Integer(NodeTest.TEXT); :}
-
-            | COMMENT
-            {: RESULT = new Integer(NodeTest.COMMENT); :}
-
-            | PI
-            {: RESULT = new Integer(NodeTest.PI); :};
-
-NameTestPattern ::= STAR
-            {: RESULT = null; :}
-
-            | QName:qn
-            {: RESULT = qn; :};
-
-ChildOrAttributeAxisSpecifier ::= ATSIGN
-            {: RESULT = new Integer(Axis.ATTRIBUTE); :}
-
-            | CHILD DCOLON
-            {: RESULT = new Integer(Axis.CHILD); :}
-
-            | ATTRIBUTE DCOLON
-            {: RESULT = new Integer(Axis.ATTRIBUTE); :};
-
-Predicates ::= Predicate:p
-            {: 
-		Vector temp = new Vector();
-		temp.addElement(p);
-		RESULT = temp;     
-            :}
-
-            | Predicate:p Predicates:pp
-            {: pp.insertElementAt(p, 0); RESULT = pp; :}; 
-
-Predicate ::=  LBRACK Expr:e RBRACK
-	    {:
-		RESULT = new Predicate(e);
-	    :};
-
-/* --------------------------- Expressions --------------------------------- */
-
-Expr ::= OrExpr:ex
-        {: RESULT = ex; :};
-
-OrExpr ::= AndExpr:ae
-        {: RESULT = ae; :}
-
-        | OrExpr:oe OR AndExpr:ae
-        {: RESULT = new LogicalExpr(LogicalExpr.OR, oe, ae); :};
-
-AndExpr ::= EqualityExpr:e
-        {: RESULT = e; :}
-
-        | AndExpr:ae AND EqualityExpr:ee
-        {: RESULT = new LogicalExpr(LogicalExpr.AND, ae, ee); :};
-    
-EqualityExpr ::= RelationalExpr:re
-        {: RESULT = re; :}
-
-        | EqualityExpr:ee EQ RelationalExpr:re
-        {: RESULT = new EqualityExpr(Operators.EQ, ee, re); :}
-
-        | EqualityExpr:ee NE RelationalExpr:re
-        {: RESULT = new EqualityExpr(Operators.NE, ee, re); :};
-
-RelationalExpr ::= AdditiveExpr:ae
-        {: RESULT = ae; :}
-
-        | RelationalExpr:re LT AdditiveExpr:ae
-        {: RESULT = new RelationalExpr(Operators.LT, re, ae); :}
-
-        | RelationalExpr:re GT AdditiveExpr:ae
-        {: RESULT = new RelationalExpr(Operators.GT, re, ae); :}
-
-        | RelationalExpr:re LE AdditiveExpr:ae
-        {: RESULT = new RelationalExpr(Operators.LE, re, ae); :}
-
-        | RelationalExpr:re GE AdditiveExpr:ae
-        {: RESULT = new RelationalExpr(Operators.GE, re, ae); :};
-
-AdditiveExpr ::= MultiplicativeExpr:me
-        {: RESULT = me; :}
-
-        | AdditiveExpr:ae PLUS  MultiplicativeExpr:me
-        {: RESULT = new BinOpExpr(BinOpExpr.PLUS, ae, me); :}
-
-        | AdditiveExpr:ae MINUS MultiplicativeExpr:me
-        {: RESULT = new BinOpExpr(BinOpExpr.MINUS, ae, me); :};
-
-MultiplicativeExpr ::= UnaryExpr:ue
-        {: RESULT = ue; :}
-
-        | MultiplicativeExpr:me STAR UnaryExpr:ue
-        {: RESULT = new BinOpExpr(BinOpExpr.TIMES, me, ue); :}
-
-        | MultiplicativeExpr:me DIV UnaryExpr:ue
-        {: RESULT = new BinOpExpr(BinOpExpr.DIV, me, ue); :}
-
-        | MultiplicativeExpr:me MOD UnaryExpr:ue
-        {: RESULT = new BinOpExpr(BinOpExpr.MOD, me, ue); :};
-
-UnaryExpr ::= UnionExpr:ue
-        {: RESULT = ue; :}
-
-        | MINUS UnaryExpr:ue
-        {: RESULT = new UnaryOpExpr(ue); :};
-
-UnionExpr ::= PathExpr:pe
-        {: RESULT = pe; :}
- 
-        | PathExpr:pe VBAR UnionExpr:rest
-        {: RESULT = new UnionPathExpr(pe, rest); :};
-
-PathExpr ::= LocationPath:lp
-        {: RESULT = lp; :}
-
-        | FilterExpr:fexp
-        {: RESULT = fexp; :}
-
-        | FilterExpr:fexp SLASH RelativeLocationPath:rlp
-        {: RESULT = new FilterParentPath(fexp, rlp); :}
-
-        | FilterExpr:fexp DSLASH RelativeLocationPath:rlp
-        {:
-           // Expand '//' into '/descendant-or-self::node()/'
-           Step nodeStep = new Step(Axis.DESCENDANTORSELF, 
-	                            NodeTest.ANODE, null); 
-           RESULT = new FilterParentPath(
-	                new FilterParentPath(fexp, nodeStep), rlp);
-        :};
-
-LocationPath ::= RelativeLocationPath:rlp
-        {: RESULT = rlp; :}
-
-        | AbsoluteLocationPath:alp
-        {: RESULT = alp; :};
-
-RelativeLocationPath ::= Step:step
-        {: RESULT = step; :}
-
-        | RelativeLocationPath:rlp SLASH Step:step
-        {:     
-        if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
-              RESULT = step;       // Remove './' from the middle
-        }
-        else if (((Step) step).isAbbreviatedDot()) {
-              RESULT = rlp;        // Remove '/.' from the end
-        }
-        else {
-             RESULT =
-                new ParentLocationPath((RelativeLocationPath) rlp, step); 
-           }
-        :}
-
-        | AbbreviatedRelativeLocationPath:arlp
-        {: RESULT = arlp; :};
-
-AbsoluteLocationPath ::= SLASH
-        {: RESULT = new AbsoluteLocationPath(); :}
-
-        | SLASH RelativeLocationPath:rlp
-        {: RESULT = new AbsoluteLocationPath(rlp); :}
-
-        | AbbreviatedAbsoluteLocationPath:aalp
-        {: RESULT = aalp; :};
-
-AbbreviatedRelativeLocationPath ::= RelativeLocationPath:rlp DSLASH Step:step
-        {: 
-	   Step nodeStep;
-	   final Step temp = (Step) step;
-	   if (temp.getAxis() == Axis.CHILD) {
-	       // Expand 'rlp//child::E' into 'rlp/descendant::E'
-	       nodeStep = new Step(Axis.DESCENDANT, 
-				   temp.getNodeType(), 
-				   temp.getPredicates());
-
-               if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
-                  RESULT = nodeStep;       // Remove './/' from the beginning
-               }
-	       else {
-	          RESULT = new ParentLocationPath((RelativeLocationPath) rlp,
-                                                  nodeStep);
-               }
-	   }
-	   else {
-	       // Expand 'rlp//step' into 'rlp/descendant-or-self::node()/step'
-	       nodeStep = new Step(Axis.DESCENDANTORSELF, 
-					NodeTest.ANODE, null); 
-	       RESULT = new ParentLocationPath(
-			    new ParentLocationPath((RelativeLocationPath) rlp, 
-						   nodeStep), step);
-	   }
-        :};
-
-
-AbbreviatedAbsoluteLocationPath ::= DSLASH RelativeLocationPath:rlp
-        {:
-
-	// GTM bug fix 2553; 3360 (handles predicates in nodeStep2). 
-	AbsoluteLocationPath absLocPath = null;
-	if (rlp instanceof ParentLocationPath) {
-	    // GTM, bug fix 3312  
-            Step nodeStep1 = new Step(Axis.DESCENDANTORSELF, -1, null);
-	    ParentLocationPath parLocPath = new ParentLocationPath(nodeStep1,
-		rlp);
-	    absLocPath = new AbsoluteLocationPath(parLocPath);
-	}
-	else {
-	    int nodeType = NodeTest.ELEMENT;
-            int axis = Axis.CHILD;
-            Vector predicates = null;
-
-	    if (rlp instanceof Step) {
-                nodeType = ((Step)rlp).getNodeType();
-                axis = ((Step)rlp).getAxis();
-                predicates = ((Step)rlp).getPredicates();
-	    }
- 	    // create the new abs location path
-            Step nodeStep1 = new Step(Axis.DESCENDANTORSELF, -1, null);
-            Step nodeStep2 = new Step(axis, nodeType, predicates);
-	    absLocPath = new AbsoluteLocationPath(
-                   new ParentLocationPath(nodeStep1, nodeStep2));
-	}
-
-	RESULT = new FilteredAbsoluteLocationPath(absLocPath);	
-	:};
-
-
-
-Step ::= NodeTest:ntest
-        {: RESULT = new Step(Axis.CHILD,
-                             parser.findNodeType(Axis.CHILD, ntest),
-                             null);
-        :}
-
-        | NodeTest:ntest Predicates:pp
-        {: RESULT = new Step(Axis.CHILD,
-                             parser.findNodeType(Axis.CHILD, ntest),
-                             pp);
-        :}
-
-        | AxisSpecifier:axis NodeTest:ntest Predicates:pp
-        {: RESULT = new Step(axis.intValue(),
-                             parser.findNodeType(axis.intValue(), ntest),
-                             pp);
-        :}
-
-        | AxisSpecifier:axis NodeTest:ntest
-        {: RESULT = new Step(axis.intValue(),
-                             parser.findNodeType(axis.intValue(), ntest),
-                             null);
-        :}
-
-        | AbbreviatedStep:abbrev
-        {: RESULT = abbrev; :};
-
-AxisSpecifier ::= AxisName:an DCOLON
-        {: RESULT = an; :}
-
-        | ATSIGN
-        {: RESULT = new Integer(Axis.ATTRIBUTE); :};
-
-AxisName ::=    ANCESTOR
-        {: RESULT = new Integer(Axis.ANCESTOR); :}
-
-        | ANCESTORORSELF
-        {: RESULT = new Integer(Axis.ANCESTORORSELF); :}
-
-        | ATTRIBUTE
-        {: RESULT = new Integer(Axis.ATTRIBUTE); :}
-
-        | CHILD
-        {: RESULT = new Integer(Axis.CHILD); :}
-
-        | DESCENDANT
-        {: RESULT = new Integer(Axis.DESCENDANT); :}
-
-        | DESCENDANTORSELF
-        {: RESULT = new Integer(Axis.DESCENDANTORSELF); :}
-
-        | FOLLOWING
-        {: RESULT = new Integer(Axis.FOLLOWING); :}
-
-        | FOLLOWINGSIBLING
-        {: RESULT = new Integer(Axis.FOLLOWINGSIBLING); :}
-
-        | NAMESPACE
-        {: RESULT = new Integer(Axis.NAMESPACE); :}
-
-        | PARENT
-        {: RESULT = new Integer(Axis.PARENT); :}
-
-        | PRECEDING
-        {: RESULT = new Integer(Axis.PRECEDING); :}
-
-        | PRECEDINGSIBLING
-        {: RESULT = new Integer(Axis.PRECEDINGSIBLING); :}
-
-        | SELF
-        {: RESULT = new Integer(Axis.SELF); :};
-
-AbbreviatedStep ::= DOT
-        {: RESULT = new Step(Axis.SELF, NodeTest.ANODE, null); :}
-
-        | DDOT
-        {: RESULT = new Step(Axis.PARENT, NodeTest.ANODE, null); :};
-
-FilterExpr ::=  PrimaryExpr:primary
-        {: RESULT = primary; :}
-
-        | PrimaryExpr:primary Predicates:pp
-        {: RESULT = new FilterExpr(primary, pp); :};
-
-PrimaryExpr ::= VariableReference:vr
-        {: RESULT = vr; :}
-
-        | LPAREN Expr:ex RPAREN
-        {: RESULT = ex; :}
-
-	| Literal:string
-	{: 
-	/*
-	* If the string appears to have the syntax of a QName, store 
-	* namespace info in the literal expression. This is used for
-	* element-available and function-available functions.
-	*/
-	final int index = string.lastIndexOf(':');
-	final String prefix = index >= 0
-                                     ? string.substring(0, index)
-                                     : Constants.EMPTYSTRING;
-	String namespace = parser._symbolTable.lookupNamespace(prefix);
-	RESULT = namespace == null
-                         ? new LiteralExpr(string)
-                         : new LiteralExpr(string, namespace); 
-	:}
-
-        | INT:num
-        {: 
-	    if (num.doubleValue() == -0)
-	        RESULT = new RealExpr(num.doubleValue());
-	    else if (num.intValue() == 0)
-	        RESULT = new IntExpr(num.intValue());
-	    else if (num.doubleValue() == 0.0)
-	        RESULT = new RealExpr(num.doubleValue());
-	    else
-	        RESULT = new IntExpr(num.intValue());
-        :}
-
-        | REAL:num
-        {: RESULT = new RealExpr(num.doubleValue()); :}
-
-        | FunctionCall:fc
-        {: RESULT = fc; :};
-
-VariableReference ::= DOLLAR VariableName:varName
-        {: 
-            // An empty qname prefix for a variable or parameter reference
-            // should map to the null namespace and not the default URI.
-            SyntaxTreeNode node = parser.lookupName(varName);
-
-            if (node != null) {
-                if (node instanceof Variable) {
-                    RESULT = new VariableRef((Variable)node);
-                }
-                else if (node instanceof Param) {
-                    RESULT = new ParameterRef((Param)node);
-                } 
-                else {
-                    node = null;
-                }
-            }
-
-            if (node == null) {
-                RESULT = parser.DummyVarRef;
-                parser.addError(new ErrorMsg(ErrorMsg.VARUNDEF_ERR,
-		    parser.getLineNumber(), varName));
-            }
-
-        :};
-
-FunctionCall ::= FunctionName:fname LPAREN RPAREN
-        {: 
-          if (fname == parser.getQName("current")) {
-            RESULT = new CurrentCall(fname);
-	  }
-          else if (fname == parser.getQName("number")) {
-            RESULT = new NumberCall(fname, parser.EmptyArgs);
-	  }
-          else if (fname == parser.getQName("string")) {
-            RESULT = new StringCall(fname, parser.EmptyArgs);
-	  }
-          else if (fname == parser.getQName("concat")) {
-            RESULT = new ConcatCall(fname, parser.EmptyArgs);
-	  }
-          else if (fname == parser.getQName("true")) {
-            RESULT = new BooleanExpr(true);
-	  }
-          else if (fname == parser.getQName("false")) {
-            RESULT = new BooleanExpr(false);
-	  }
-          else if (fname == parser.getQName("name")) {
-            RESULT = new NameCall(fname);
-	  }
-          else if (fname == parser.getQName("generate-id")) {
-            RESULT = new GenerateIdCall(fname, parser.EmptyArgs);
-	  }
-          else if (fname == parser.getQName("string-length")) {
-            RESULT = new StringLengthCall(fname, parser.EmptyArgs);
-	  }
-          else if (fname == parser.getQName("position")) {
-            RESULT = new PositionCall(fname);
-	  }
-          else if (fname == parser.getQName("last")) {
-            RESULT = new LastCall(fname);
-	  }
-          else if (fname == parser.getQName("local-name")) {
-            RESULT = new LocalNameCall(fname);
-	  }
-          else if (fname == parser.getQName("namespace-uri")) {
-            RESULT = new NamespaceUriCall(fname);
-	  }
-          else {
-            RESULT = new FunctionCall(fname, parser.EmptyArgs);
-	  }
-        :}
-
-        | FunctionName:fname LPAREN NonemptyArgumentList:argl RPAREN
-        {:
-          if (fname == parser.getQName("concat")) {
-            RESULT = new ConcatCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("number")) {
-            RESULT = new NumberCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("document")) {
-	    parser.setMultiDocument(true);
-            RESULT = new DocumentCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("string")) {
-            RESULT = new StringCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("boolean")) {
-            RESULT = new BooleanCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("name")) {
-            RESULT = new NameCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("generate-id")) {
-            RESULT = new GenerateIdCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("not")) {
-            RESULT = new NotCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("format-number")) {
-            RESULT = new FormatNumberCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("unparsed-entity-uri")) {
-            RESULT = new UnparsedEntityUriCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("key")) {
-            RESULT = new KeyCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("id")) {
-            RESULT = new KeyCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("ceiling")) {
-            RESULT = new CeilingCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("round")) {
-            RESULT = new RoundCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("floor")) {
-            RESULT = new FloorCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("contains")) {
-            RESULT = new ContainsCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("string-length")) {
-            RESULT = new StringLengthCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("starts-with")) {
-            RESULT = new StartsWithCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("function-available")) {
-            RESULT = new FunctionAvailableCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("element-available")) {
-            RESULT = new ElementAvailableCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("local-name")) {
-            RESULT = new LocalNameCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("lang")) {
-            RESULT = new LangCall(fname, argl);
-	  }
-          else if (fname == parser.getQName("namespace-uri")) {
-            RESULT = new NamespaceUriCall(fname, argl);
-	  }
-          else {
-            RESULT = new FunctionCall(fname, argl);
-	  }
-    :};
-
-NonemptyArgumentList ::= Argument:arg
-        {: 
-            Vector temp = new Vector();
-            temp.addElement(arg);
-            RESULT = temp;
-        :}
-
-        | Argument:arg COMMA NonemptyArgumentList:argl
-        {: argl.insertElementAt(arg, 0); RESULT = argl; :};
-        /* Is insertElement ok ? */
-
-FunctionName ::= QName:fname
-        {:
-            fname.clearDefaultNamespace();
-            RESULT = fname; 
-        :};
-
-VariableName ::= QName:vname
-        {:
-            vname.clearDefaultNamespace();
-            RESULT = vname; 
-        :};
-
-Argument ::=    Expr:ex
-        {: RESULT = ex; :};
-
-NodeTest ::= NameTest:nt
-        {: RESULT = nt; :}
-
-        | NODE
-        {: RESULT = new Integer(NodeTest.ANODE); :}
-
-        | TEXT
-        {: RESULT = new Integer(NodeTest.TEXT); :}
-
-        | COMMENT
-        {: RESULT = new Integer(NodeTest.COMMENT); :}
-
-        | PI
-        {: RESULT = new Integer(NodeTest.PI); :};
-
-NameTest ::= STAR
-             {: RESULT = null; :}
-
-             | QName:qn
-             {: RESULT = qn; :};
-
-QName ::= QNAME:qname
-        {: RESULT = parser.getQName(qname); :}
-
-        | DIV
-        {: RESULT = parser.getQName("div"); :}
-
-        | MOD
-        {: RESULT = parser.getQName("mod"); :}
-
-        | KEY
-        {: RESULT = parser.getQName("key"); :}
-
-        | CHILD
-        {: RESULT = parser.getQName("child"); :}
-
-        | PARENT
-        {: RESULT = parser.getQName("parent"); :}
-
-        | PRECEDING
-        {: RESULT = parser.getQName("preceding"); :}
-
-        | ATTRIBUTE
-        {: RESULT = parser.getQName("attribute"); :}
-
-        | SELF
-        {: RESULT = parser.getQName("self"); :}
-
-        | ID
-        {: RESULT = parser.getQName("id"); :};
-
diff --git a/src/org/apache/xalan/xsltc/compiler/xpath.lex b/src/org/apache/xalan/xsltc/compiler/xpath.lex
deleted file mode 100644
index 58db6d7..0000000
--- a/src/org/apache/xalan/xsltc/compiler/xpath.lex
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * @(#)$Id$
- *
- * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * This software is the proprietary information of Sun Microsystems, Inc.  
- * Use is subject to license terms.
- * 
- */
-
-package org.apache.xalan.xsltc.compiler;
-
-import java_cup.runtime.Symbol;
-%%
-%cup
-%unicode
-%class XPathLexer
-%yyeof
-
-%eofval{
-return new Symbol(sym.EOF);
-%eofval}
-
-%yylexthrow{
-Exception
-%yylexthrow}
-
-Digit=[0-9]
-Letter=[A-Za-z]
-NCNameChar=({Letter}|{Digit}|"."|"-"|"_")
-NCName=({Letter}|"_")({NCNameChar})*
-%%
-
-"*"                      { return new Symbol(sym.STAR); }
-"/"                      { return new Symbol(sym.SLASH); } 
-"+"                      { return new Symbol(sym.PLUS); }
-"-"                      { return new Symbol(sym.MINUS); }
-"div"                    { return new Symbol(sym.DIV); }
-"mod"                    { return new Symbol(sym.MOD); }
-"::"                     { return new Symbol(sym.DCOLON); }
-","                      { return new Symbol(sym.COMMA); }
-"@"                      { return new Symbol(sym.ATSIGN); }
-".."                     { return new Symbol(sym.DDOT); }
-"|"                      { return new Symbol(sym.VBAR); }
-"$"                      { return new Symbol(sym.DOLLAR); }
-"//"                     { return new Symbol(sym.DSLASH); }
-"="                      { return new Symbol(sym.EQ); }
-"!="                     { return new Symbol(sym.NE); }
-"<"                      { return new Symbol(sym.LT); } 
-">"                      { return new Symbol(sym.GT); }
-"<="                     { return new Symbol(sym.LE); }
-">="                     { return new Symbol(sym.GE); }
-"id"                     { return new Symbol(sym.ID); }
-"key"                    { return new Symbol(sym.KEY); }
-"text()"                 { return new Symbol(sym.TEXT); }
-"node()"                 { return new Symbol(sym.NODE); }
-"comment()"              { return new Symbol(sym.COMMENT); }
-"processing-instruction()" { return new Symbol(sym.PI); }
-"or"                     { return new Symbol(sym.OR); }
-"and"                    { return new Symbol(sym.AND); }
-"child"                  { return new Symbol(sym.CHILD); }
-"attribute"              { return new Symbol(sym.ATTRIBUTE); }
-"ancestor"               { return new Symbol(sym.ANCESTOR); }
-"ancestor-or-self"       { return new Symbol(sym.ANCESTORORSELF); }
-"descendant"             { return new Symbol(sym.DESCENDANT); }
-"descendant-or-self"     { return new Symbol(sym.DESCENDANTORSELF); }
-"following"              { return new Symbol(sym.FOLLOWING); }
-"following-sibling"      { return new Symbol(sym.FOLLOWINGSIBLING); }
-"namespace"              { return new Symbol(sym.NAMESPACE); }
-"parent"                 { return new Symbol(sym.PARENT); }
-"preceding"              { return new Symbol(sym.PRECEDING); }
-"preceding-sibling"      { return new Symbol(sym.PRECEDINGSIBLING); }
-"self"                   { return new Symbol(sym.SELF); }
-"["                      { return new Symbol(sym.LBRACK); }
-"]"                      { return new Symbol(sym.RBRACK); }
-"("                      { return new Symbol(sym.LPAREN); }
-")"                      { return new Symbol(sym.RPAREN); }
-"<PATTERN>"              { return new Symbol(sym.PATTERN); }
-"<EXPRESSION>"           { return new Symbol(sym.EXPRESSION); }
-\"[^\"]*\"               { return new Symbol(sym.Literal,
-			      yytext().substring(1, yytext().length() - 1)); }
-\'[^\']*\'               { return new Symbol(sym.Literal,
-			      yytext().substring(1, yytext().length() - 1)); }
-{Digit}+               	 { return new Symbol(sym.INT, new Integer(yytext())); }
-{Digit}+("."{Digit}*)? 	 { return new Symbol(sym.REAL, new Double(yytext())); }
-"."{Digit}+            	 { return new Symbol(sym.REAL, new Double(yytext())); }
-"."                      { return new Symbol(sym.DOT); }
-({NCName}":")?{NCName}   { return new Symbol(sym.QNAME, yytext()); }
-({NCName}":")?"*"        { return new Symbol(sym.QNAME, yytext()); }
-({NCName}":")?"@*"       { return new Symbol(sym.QNAME, yytext()); }
-[ \t\r\n\f]              { /* ignore white space. */ }
-.                        { throw new Exception(yytext()); }
diff --git a/src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java b/src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
deleted file mode 100644
index 042c9ba..0000000
--- a/src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public final class AbsoluteIterator extends NodeIteratorBase {
-    private NodeIterator _source;
-	
-    public AbsoluteIterator(NodeIterator source) {
-	_source = source;
-    }
-
-    public int next() {
-	// Should never be called - well, it is!!!
-	return _source.next();
-    }
-	
-    public NodeIterator setStartNode(int node) {
-	_startNode = DOM.ROOTNODE;
-	if (_isRestartable) {
-	    resetPosition();
-	    return _source.setStartNode(_startNode = DOM.ROOTNODE);
-	}
-	return reset();
-    }
-
-    public NodeIterator cloneIterator() {
-	try {
-	    final AbsoluteIterator clone = (AbsoluteIterator)super.clone();
-	    clone._isRestartable = false;
-	    clone._source = _source.cloneIterator();
-	    return clone.reset();
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported."); 
-	    return null;
-	}
-    }
-
-    public NodeIterator reset() {
-	_source.reset();
-	return resetPosition();
-    }
-    
-    public void setMark() {
-	_source.setMark();
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/AnyNodeCounter.java b/src/org/apache/xalan/xsltc/dom/AnyNodeCounter.java
deleted file mode 100644
index 8b24488..0000000
--- a/src/org/apache/xalan/xsltc/dom/AnyNodeCounter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.NodeIterator;
-
-public abstract class AnyNodeCounter extends NodeCounter {
-    public AnyNodeCounter(Translet translet,
-			  DOM document, NodeIterator iterator) {
-	super(translet, document, iterator);
-    }
-	
-    public NodeCounter setStartNode(int node) {
-	_node = node;
-	_nodeType = _document.getType(node);
-	return this;
-    }
-
-    public String getCounter() {
-	int result;
-	if (_value != Integer.MIN_VALUE) {
-	    result = _value;
-	}
-	else {
-	    int next = _node;
-	    result = 0;
-	    while (next >= 0 && !matchesFrom(next)) {
-		if (matchesCount(next)) {
-		    ++result;	
-		}
-		--next;
-	    }
-	}
-	return formatNumbers(result);
-    }
-
-    public static NodeCounter getDefaultNodeCounter(Translet translet,
-						    DOM document,
-						    NodeIterator iterator) {
-	return new DefaultAnyNodeCounter(translet, document, iterator);
-    }
-
-    static class DefaultAnyNodeCounter extends AnyNodeCounter {
-	public DefaultAnyNodeCounter(Translet translet,
-				     DOM document, NodeIterator iterator) {
-	    super(translet, document, iterator);
-	}
-
-	public String getCounter() {
-	    int result;
-	    if (_value != Integer.MIN_VALUE) {
-		result = _value;
-	    }
-	    else {
-		int next = _node;
-		result = 0;
-		final int ntype = _document.getType(_node); 
-		while (next >= 0) {
-		    if (ntype == _document.getType(next)) {
-			result++;
-		    }
-		    next--;
-		}
-	    }
-	    return formatNumbers(result);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/Axis.java b/src/org/apache/xalan/xsltc/dom/Axis.java
deleted file mode 100644
index 70a5d7e..0000000
--- a/src/org/apache/xalan/xsltc/dom/Axis.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-/*
- * IMPORTANT NOTE - this interface will probably be replaced by
- * org.apache.xml.dtm.Axis (very similar)
- */
-
-public interface Axis {
-    public static final int ANCESTOR         =  0;
-    public static final int ANCESTORORSELF   =  1;
-    public static final int ATTRIBUTE        =  2;
-    public static final int CHILD            =  3;
-    public static final int DESCENDANT       =  4;
-    public static final int DESCENDANTORSELF =  5;
-    public static final int FOLLOWING        =  6;
-    public static final int FOLLOWINGSIBLING =  7;
-    public static final int NAMESPACEDECLS   =  8;
-    public static final int NAMESPACE        =  9;
-    public static final int PARENT           = 10;
-    public static final int PRECEDING        = 11;
-    public static final int PRECEDINGSIBLING = 12;
-    public static final int SELF             = 13;
-	
-    public static final String[] names = {
-	"ancestor",
-	"ancestor-or-self",
-	"attribute",
-	"child",
-	"descendant",
-	"descendant-or-self",
-	"following",
-	"following-sibling",
-	"namespace",
-	"namespace-decls",
-	"parent",
-	"preceding",
-	"preceding-sibling",
-	"self"
-    };
-}
diff --git a/src/org/apache/xalan/xsltc/dom/BitArray.java b/src/org/apache/xalan/xsltc/dom/BitArray.java
deleted file mode 100644
index c764366..0000000
--- a/src/org/apache/xalan/xsltc/dom/BitArray.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-
-
-public class BitArray {
-
-    private int[] _bits;
-    private int   _bitSize;
-    private int   _intSize;
-    private int   _mask;
-
-    // This table is used to prevent expensive shift operations
-    // (These operations are inexpensive on CPUs but very expensive on JVMs.)
-    private final int[] _masks = {
-	0x80000000, 0x40000000, 0x20000000, 0x10000000,
-	0x08000000, 0x04000000, 0x02000000, 0x01000000,
-	0x00800000, 0x00400000, 0x00200000, 0x00100000,
-	0x00080000, 0x00040000, 0x00020000, 0x00010000,
-	0x00008000, 0x00004000, 0x00002000, 0x00001000,
-	0x00000800, 0x00000400, 0x00000200, 0x00000100,
-	0x00000080, 0x00000040, 0x00000020, 0x00000010,
-	0x00000008, 0x00000004, 0x00000002, 0x00000001 };
-
-    /**
-     * Constructor. Defines the initial size of the bit array (in bits).
-     */
-    public BitArray(int size) {
-	if (size < 32) size = 32;
-	_bitSize = size;
-	_intSize = (_bitSize >>> 5) + 1;
-	_bits = new int[_intSize + 1];
-    }
-
-    /**
-     * Set the mask for this bit array. The upper 8 bits of this mask
-     * indicate the DOM in which the nodes in this array belong.
-     */    
-    public void setMask(int mask) {
-	_mask = mask;
-    }
-
-    /**
-     * See setMask()
-     */
-    public int getMask() {
-	return(_mask);
-    }
-
-    /**
-     * Returns the size of this bit array (in bits).
-     */
-    public final int size() {
-	return(_bitSize);
-    }
-
-    /**
-     * Returns true if the given bit is set
-     */
-    public final boolean getBit(int bit) {
-	return((_bits[bit>>>5] & _masks[bit%32]) != 0);
-    }
-
-    /**
-     * Returns the next set bit from a given position
-     */
-    public final int getNextBit(int startBit) {
-	for (int i = (startBit >>> 5) ; i<=_intSize; i++) {
-	    int bits = _bits[i];
-	    if (bits != 0) {
-		for (int b = (startBit % 32); b<32; b++) {
-		    if ((bits & _masks[b]) != 0) {
-			return((i << 5) + b);
-		    }
-		}
-	    }
-	    startBit = 0;
-	}
-	return(NodeIterator.END);
-    }
-
-    /**
-     * This method returns the Nth bit that is set in the bit array. The
-     * current position is cached in the following 4 variables and will
-     * help speed up a sequence of next() call in an index iterator. This
-     * method is a mess, but it is fast and it works, so don't fuck with it.
-     */
-    private int _pos = Integer.MAX_VALUE;
-    private int _node = 0;
-    private int _int = 0;
-    private int _bit = 0;
-
-    public final int getBitNumber(int pos) {
-
-	// Return last node if position we're looking for is the same
-	if (pos == _pos) return(_node);
-	
-	// Start from beginning of position we're looking for is before
-	// the point where we left off the last time.
-	if (pos < _pos) {
-	    _int = _bit = _pos = 0;
-	}
-
-	// Scan through the bit array - skip integers that have no bits set
-	for ( ; _int <= _intSize; _int++) {
-	    int bits = _bits[_int];
-	    if (bits != 0) { // Any bits set?
-		for ( ; _bit < 32; _bit++) {
-		    if ((bits & _masks[_bit]) != 0) {
-			if (++_pos == pos) {
-			    _node = ((_int << 5) + _bit) - 1;
-			    return (_node);
-			}
-		    }
-		}
-		_bit = 0;
-	    }
-	}
-	return(0);
-    }
-
-    /**
-     * Returns the integer array in which the bit array is contained
-     */
-    public final int[] data() {
-	return(_bits);
-    }
-
-    int _first = Integer.MAX_VALUE; // The index where first set bit is
-    int _last  = Integer.MIN_VALUE; // The _INTEGER INDEX_ where last set bit is
-
-    /**
-     * Sets a given bit
-     */
-    public final void setBit(int bit) {
-	if (bit >= _bitSize) return;
-	final int i = (bit >>> 5);
-	if (i < _first) _first = i;
-	if (i > _last) _last = i;
-	_bits[i] |= _masks[bit % 32];
-    }
-
-    /**
-     * Merge two bit arrays. This currently only works for nodes from
-     * a single DOM (because there is only one _mask per array).
-     */
-    public final BitArray merge(BitArray other) {
-	// Take other array's bits if we have node set
-	if (_last == -1) {
-	    _bits = other._bits;
-	}
-	// Only merge if other array has any bits set
-	else if (other._last != -1) {
-	    int start = (_first < other._first) ? _first : other._first;
-	    int stop  = (_last > other._last) ? _last : other._last;
-
-	    // Merge these bits into other array if other array is larger
-	    if (other._intSize > _intSize) {
-		if (stop > _intSize) stop = _intSize;
-		for (int i=start; i<=stop; i++)
-		    other._bits[i] |= _bits[i];
-		_bits = other._bits;
-	    }
-	    // Merge other bits into this array if this arrai is large/equal.
-	    else {
-		if (stop > other._intSize) stop = other._intSize;
-		for (int i=start; i<=stop; i++)
-		    _bits[i] |= other._bits[i];
-	    }
-	}
-	return(this);
-    }
-
-    /**
-     * Resizes the bit array - try to avoid using this method!!!
-     */
-    public final void resize(int newSize) {
-	if (newSize > _bitSize) {
-	    _intSize = (newSize >>> 5) + 1;
-	    final int[] newBits = new int[_intSize + 1];
-	    System.arraycopy(_bits, 0, newBits, 0, (_bitSize>>>5) + 1);
-	    _bits = newBits;
-	    _bitSize = newSize;
-	}
-    }
-
-
-}
-
-
-    
diff --git a/src/org/apache/xalan/xsltc/dom/CurrentNodeListFilter.java b/src/org/apache/xalan/xsltc/dom/CurrentNodeListFilter.java
deleted file mode 100644
index c0895c5..0000000
--- a/src/org/apache/xalan/xsltc/dom/CurrentNodeListFilter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-public interface CurrentNodeListFilter {
-    public abstract boolean test(int node, int position, int last, int current,
-				 AbstractTranslet translet, NodeIterator iter);
-}
diff --git a/src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java b/src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
deleted file mode 100644
index 1f20132..0000000
--- a/src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import org.apache.xalan.xsltc.util.IntegerArray;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public final class CurrentNodeListIterator extends NodeIteratorBase {
-    private NodeIterator _source;
-    private final boolean _docOrder;
-    private final CurrentNodeListFilter _filter;
-    private IntegerArray _nodes = new IntegerArray();
-	
-    private int _current;	// index in _nodes of the next node to try
-	
-    private AbstractTranslet _translet;
-    private final int _currentNode;
-    private int _last;		
-
-    public CurrentNodeListIterator(NodeIterator source, 
-				   CurrentNodeListFilter filter,
-				   int currentNode,
-				   AbstractTranslet translet) {
-	this(source, !source.isReverse(), filter, currentNode, translet);
-    }
-
-    public CurrentNodeListIterator(NodeIterator source, boolean docOrder,
-				   CurrentNodeListFilter filter,
-				   int currentNode,
-				   AbstractTranslet translet) {
-	_source = source;
-	_filter = filter;
-	_translet = translet;
-	_docOrder = docOrder;
-	_currentNode = currentNode;
-    }
-    
-    public boolean isReverse() {
-	return !_docOrder;
-    }
-
-    public NodeIterator cloneIterator() {
-	try {
-	    final CurrentNodeListIterator clone =
-		(CurrentNodeListIterator)super.clone();
-	    clone._isRestartable = false;
-	    clone._nodes = (IntegerArray)_nodes.clone();
-	    return clone.reset();
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported."); 
-	    return null;
-	}
-    }
-    
-    public NodeIterator reset() {
-	_current = 0;
-	return resetPosition();
-    }
-
-    public int next() {
-	final boolean docOrder = _docOrder;
-	final int last = _nodes.cardinality();
-	final int currentNode = _currentNode;
-
-	for (int index = _current; index < last; ) {
-	    final int node = _nodes.at(index++); // note increment
-	    final int position = docOrder ? index : last - index + 1;
-	    if (_filter.test(node, position, last, currentNode, _translet, this)) {
-		_current = index;
-		return returnNode(node);
-	    }
-	}
-	return END;
-    }
-
-    private int computePositionOfLast() {
-	int lastPosition = 0;
-	final boolean docOrder = _docOrder;
-        final int last = _nodes.cardinality();
-        final int currNode = _currentNode;
-
-	for (int index = _current; index < last; ) {
-            int nodeIndex = _nodes.at(index++); // note increment
-            final int pos = docOrder ? index : last - index + 1;
-            if (_filter.test(nodeIndex, pos, last, currNode, _translet, this)) {
-                lastPosition++;
-            }
-        }
-	return lastPosition;
-    }
-
-    public NodeIterator setStartNode(int node) {
-	NodeIterator retval = this;
-	
-	if (_isRestartable) {
-	    // iterator is not a clone
-	    _source.setStartNode(_startNode = node);
-	    // including ROOT
-	    _nodes.clear();
-	    while ((node = _source.next()) != END) {
-		_nodes.add(node);
-	    }
-	    _current = 0;
-	    retval = resetPosition();
-	}
-	// compute position of _last
-  	_last = computePositionOfLast();	
-	return retval;
-    }
-	
-    public int getLast() {
-	return ( _last == -1 ) ? computePositionOfLast() : _last;
-    }
-
-    public void setMark() {
-	_source.setMark();
-	_markedNode = _current;
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-	_current = _markedNode;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/DOMAdapter.java b/src/org/apache/xalan/xsltc/dom/DOMAdapter.java
deleted file mode 100644
index 073e8ef..0000000
--- a/src/org/apache/xalan/xsltc/dom/DOMAdapter.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.StripFilter;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.TransletOutputHandler;
-import org.apache.xalan.xsltc.TransletException;
-
-public final class DOMAdapter implements DOM {
-    private final DOMImpl _domImpl;
-    private short[] _mapping;
-    private short[] _reverse;
-    private short[] _NSmapping;
-    private short[] _NSreverse;
-
-    private StripFilter _filter = null;
-    
-    public DOMAdapter(DOMImpl dom,
-		      String[] namesArray,
-		      String[] namespaceArray) {
-	_domImpl = dom;
-	_mapping = dom.getMapping(namesArray);
-	_reverse = dom.getReverseMapping(namesArray);
-	_NSmapping = dom.getNamespaceMapping(namespaceArray);
-	_NSreverse = dom.getReverseNamespaceMapping(namespaceArray);
-    }
-
-    public void setupMapping(String[] names, String[] namespaces) {
-	_mapping = _domImpl.getMapping(names);
-	_reverse = _domImpl.getReverseMapping(names);
-	_NSmapping = _domImpl.getNamespaceMapping(namespaces);
-	_NSreverse = _domImpl.getReverseNamespaceMapping(namespaces);
-    }
-
-    /** returns singleton iterator containg the document root */
-    public NodeIterator getIterator() {
-	return _domImpl.getIterator();
-    }
-    
-    public String getStringValue() {
-	return _domImpl.getStringValue();
-    }
-    
-    public NodeIterator getChildren(final int node) {
-	NodeIterator iterator = _domImpl.getChildren(node);
-	if (_filter == null) {
-	    return(iterator.setStartNode(node));
-	}
-	else {
-	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
-	    return(iterator.setStartNode(node));
-	}
-    }
-
-    public void setFilter(StripFilter filter) {
-	_filter = filter;
-    }
-    
-    public NodeIterator getTypedChildren(final int type) {
-	NodeIterator iterator = _domImpl.getTypedChildren(_reverse[type]);
-	if ((_reverse[type] == DOM.TEXT) && (_filter != null))
-	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
-	return(iterator);
-    }
-
-    public NodeIterator getNamespaceAxisIterator(final int axis, final int ns) {
-	return _domImpl.getNamespaceAxisIterator(axis,_NSreverse[ns]);
-    }
-
-    public NodeIterator getAxisIterator(final int axis) {
-	NodeIterator iterator = _domImpl.getAxisIterator(axis);
-	if (_filter != null)
-	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
-	return(iterator);
-    }
-    
-    public NodeIterator getTypedAxisIterator(final int axis, final int type) {
-	NodeIterator iterator =
-	    _domImpl.getTypedAxisIterator(axis, _reverse[type]);
-	if ((_reverse[type] == DOM.TEXT) && (_filter != null))
-	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
-	return(iterator);
-    }
-
-    public NodeIterator getNthDescendant(int node, int n) {
-	return _domImpl.getNthDescendant(node, n);
-    }
-
-    public NodeIterator getNodeValueIterator(NodeIterator iterator,
-					     String value, boolean op) {
-	return _domImpl.getNodeValueIterator(iterator, value, op);
-    }
-
-    public NodeIterator orderNodes(NodeIterator source, int node) {
-	return _domImpl.orderNodes(source, node);
-    }
-        
-    public int getType(final int node) {
-	return _mapping[_domImpl.getType(node)];
-    }
-
-    public int getNamespaceType(final int node) {
-	return _NSmapping[_domImpl.getNamespaceType(node)];
-    }
-    
-    public int getParent(final int node) {
-	return _domImpl.getParent(node);
-    }
-
-    public int getTypedPosition(NodeIterator iterator, int type, int node) {
-	return _domImpl.getTypedPosition(iterator, _reverse[type], node);
-    }
-
-    public int getTypedLast(NodeIterator iterator, int type, int node) {
-	return _domImpl.getTypedLast(iterator, _reverse[type], node);
-    }
-
-    public int getAttributeNode(final int type, final int element) {
-	return _domImpl.getAttributeNode(_reverse[type], element);
-    }
-    
-    public String getNodeName(final int node) {
-	return _domImpl.getNodeName(node);
-    }
-
-    public String getNamespaceName(final int node) {
-	return _domImpl.getNamespaceName(node);
-    }
-    
-    public String getNodeValue(final int node) {
-	return _domImpl.getNodeValue(node);
-    }
-    
-    public void copy(final int node, TransletOutputHandler handler)
-	throws TransletException {
-	    _domImpl.copy(node, handler);
-    }
-    
-    public void copy(NodeIterator nodes, TransletOutputHandler handler)
-	throws TransletException {
-	    _domImpl.copy(nodes, handler);
-    }
-
-    public String shallowCopy(final int node, TransletOutputHandler handler)
-	throws TransletException {
-	    return _domImpl.shallowCopy(node, handler);
-    }
-    
-    public boolean lessThan(final int node1, final int node2) {
-	return _domImpl.lessThan(node1, node2);
-    }
-    
-    public void characters(final int textNode, TransletOutputHandler handler)
-	throws TransletException {
-	    _domImpl.characters(textNode, handler);
-    }
-
-    public Node makeNode(int index) {
-	return _domImpl.makeNode(index);
-    }
-
-    public Node makeNode(NodeIterator iter) {
-	return _domImpl.makeNode(iter);
-    }
-
-    public NodeList makeNodeList(int index) {
-	return _domImpl.makeNodeList(index);
-    }
-
-    public NodeList makeNodeList(NodeIterator iter) {
-	return _domImpl.makeNodeList(iter);
-    }
-
-    public String getLanguage(int node) {
-	return _domImpl.getLanguage(node);
-    }
-
-    public int getSize() {
-	return _domImpl.getSize();
-    }
-
-    public void setDocumentURI(String uri) {
-	_domImpl.setDocumentURI(uri);
-    }
-
-    public String getDocumentURI() {
-	return(_domImpl.getDocumentURI());
-    }
-
-    public String getDocumentURI(int node) {
-	return(_domImpl.getDocumentURI());
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/DOMBuilder.java b/src/org/apache/xalan/xsltc/dom/DOMBuilder.java
deleted file mode 100644
index cc67a53..0000000
--- a/src/org/apache/xalan/xsltc/dom/DOMBuilder.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-package org.apache.xalan.xsltc.dom;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-public interface DOMBuilder extends ContentHandler, LexicalHandler { }
diff --git a/src/org/apache/xalan/xsltc/dom/DOMImpl.java b/src/org/apache/xalan/xsltc/dom/DOMImpl.java
deleted file mode 100644
index 2109519..0000000
--- a/src/org/apache/xalan/xsltc/dom/DOMImpl.java
+++ /dev/null
@@ -1,3195 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-/* Issues to resolve:
-   o) All stacks in the DOMBuilder class have hardcoded length
-   o) There are no namespace nodes (but namespace are handled correctly).
-*/
-
-package org.apache.xalan.xsltc.dom;
-
-import java.io.Externalizable;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.Stack;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Document;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.util.IntegerArray;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-import org.apache.xalan.xsltc.runtime.SAXAdapter;
-import org.apache.xalan.xsltc.runtime.Hashtable;
-
-public final class DOMImpl implements DOM, Externalizable {
-
-    // empty String for null attribute values
-    private final static String EMPTYSTRING = "";
-
-    // empty iterator to be returned when there are no children
-    private final static NodeIterator EMPTYITERATOR = new NodeIterator() {
-	    public NodeIterator reset() { return this; }
-	    public NodeIterator setStartNode(int node) { return this; }
-	    public int next() { return NULL; }
-	    public void setMark() {}
-	    public void gotoMark() {}
-	    public int getLast() { return 0; }
-	    public int getPosition() { return 0; }
-	    public NodeIterator cloneIterator() { return this; }
-	    public boolean isReverse() { return false; }
-	    public NodeIterator resetOnce() { return this; }
-	};
-
-    // Contains the number of nodes and attribute nodes in the tree
-    private int       _treeNodeLimit;
-    private int       _firstAttributeNode;
-
-    // Node-to-type, type-to-name, and name-to-type mappings
-    private short[]   _type;
-    private Hashtable _types = null;
-    private String[]  _namesArray;
-
-    // Tree navigation arrays
-    private int[]     _parent;
-    private int[]     _nextSibling;
-    private int[]     _offsetOrChild; // Serves two purposes !!!
-    private int[]     _lengthOrAttr;  // Serves two purposes !!!
-
-    // Holds contents of text/comment nodes and attribute values
-    private char[]    _text;
-
-    // Namespace related stuff
-    private String[]  _uriArray;
-    private String[]  _prefixArray;
-    private short[]   _namespace;
-    private short[]   _prefix;
-    private Hashtable _nsIndex = new Hashtable();
-
-    // Tracks which textnodes are whitespaces and which are not
-    private BitArray  _whitespace; // takes xml:space into acc.
-
-    // The URI to this document
-    private String    _documentURI;
-
-    // Support for access/navigation through org.w3c.dom API
-    private Node[] _nodes;
-    private NodeList[] _nodeLists;
-    private static NodeList EmptyNodeList;
-    private static NamedNodeMap EmptyNamedNodeMap;
-
-    /**
-     * Define the origin of the document from which the tree was built
-     */
-    public void setDocumentURI(String uri) {
-	_documentURI = uri;
-    }
-
-    /**
-     * Returns the origin of the document from which the tree was built
-     */
-    public String getDocumentURI() {
-	return(_documentURI);
-    }
-
-    public String getDocumentURI(int node) {
-	return(_documentURI);
-    }
-
-    public void setupMapping(String[] names, String[] namespaces) {
-	// This method only has a function in DOM adapters
-    }
-
-    /**
-     * Returns 'true' if a specific node is an element (of any type)
-     */
-    private boolean isElement(final int node) {
-	return ((node < _firstAttributeNode) && (_type[node] >= NTYPES));
-    }
-
-    /**
-     * Returns the number of nodes in the tree (used for indexing)
-     */
-    public int getSize() {
-	return(_type.length);
-    }
-
-    /**
-     * Part of the DOM interface - no function here.
-     */
-    public void setFilter(StripFilter filter) { }
-
-
-    /**
-     * Returns true if node1 comes before node2 in document order
-     */
-    public boolean lessThan(int node1, int node2) {
-	if ((node2 < _treeNodeLimit) && (node1 < node2))
-	    return(true);
-	else
-	    return(false);
-    }
-
-    /**
-     * Create an org.w3c.dom.Node from a node in the tree
-     */
-    public Node makeNode(int index) {
-	if (_nodes == null) {
-	    _nodes = new Node[_type.length];
-	}
-	return _nodes[index] != null
-	    ? _nodes[index]
-	    : (_nodes[index] = new NodeImpl(index));
-    }
-
-    /**
-     * Create an org.w3c.dom.Node from a node in an iterator
-     * The iterator most be started before this method is called
-     */
-    public Node makeNode(NodeIterator iter) {
-	return makeNode(iter.next());
-    }
-
-    /**
-     * Create an org.w3c.dom.NodeList from a node in the tree
-     */
-    public NodeList makeNodeList(int index) {
-	if (_nodeLists == null) {
-	    _nodeLists = new NodeList[_type.length];
-	}
-	return _nodeLists[index] != null
-	    ? _nodeLists[index]
-	    : (_nodeLists[index] = new NodeListImpl(index));
-    }
-
-    /**
-     * Create an org.w3c.dom.NodeList from a node iterator
-     * The iterator most be started before this method is called
-     */
-    public NodeList makeNodeList(NodeIterator iter) {
-	return new NodeListImpl(iter);
-    }
-
-    /**
-     * Create an empty org.w3c.dom.NodeList
-     */
-    private NodeList getEmptyNodeList() {
-	return EmptyNodeList != null
-	    ? EmptyNodeList
-	    : (EmptyNodeList = new NodeListImpl(new int[0]));
-    }
-
-    /**
-     * Create an empty org.w3c.dom.NamedNodeMap
-     */
-    private NamedNodeMap getEmptyNamedNodeMap() {
-	return EmptyNamedNodeMap != null
-	    ? EmptyNamedNodeMap
-	    : (EmptyNamedNodeMap = new NamedNodeMapImpl(new int[0]));
-    }
-
-    /**
-     * Exception thrown by methods in inner classes implementing
-     * various org.w3c.dom interfaces (below)
-     */
-    private final class NotSupportedException extends DOMException {
-	public NotSupportedException() {
-	    super(NOT_SUPPORTED_ERR, "modification not supported");
-	}
-    }
-
-    /**************************************************************
-     * Implementation of org.w3c.dom.NodeList
-     */
-    private final class NodeListImpl implements NodeList {
-	private final int[] _nodes;
-
-	public NodeListImpl(int node) {
-	    _nodes = new int[1];
-	    _nodes[0] = node;
-	}
-
-	public NodeListImpl(int[] nodes) {
-	    _nodes = nodes;
-	}
-                  
-	public NodeListImpl(NodeIterator iter) {
-	    final IntegerArray list = new IntegerArray();
-	    int node;
-	    while ((node = iter.next()) != NodeIterator.END) {
-		list.add(node);
-	    }         
-	    _nodes = list.toIntArray();         
-	}
-
-	public int getLength() {
-	    return _nodes.length;
-	}
-                  
-	public Node item(int index) {
-	    return makeNode(_nodes[index]);
-	}
-    }
-
-                  
-    /**************************************************************
-     * Implementation of org.w3c.dom.NamedNodeMap
-     */
-    private final class NamedNodeMapImpl implements NamedNodeMap {
-
-	private final int[] _nodes;
-		
-	public NamedNodeMapImpl(int[] nodes) {
-	    _nodes = nodes;
-	}
-		
-	public int getLength() {
-	    return _nodes.length;
-	}
-		
-	public Node getNamedItem(String name) {
-	    for (int i = 0; i < _nodes.length; i++) {
-		if (name.equals(getNodeName(_nodes[i]))) {
-		    return makeNode(_nodes[i]);
-		}
-	    }
-	    return null;
-	}
-		
-	public Node item(int index) {
-	    return makeNode(_nodes[index]);
-	}
-		
-	public Node removeNamedItem(String name) {
-	    throw new NotSupportedException();
-	}
-		
-	public Node setNamedItem(Node node) {
-	    throw new NotSupportedException();
-	}
-
-	public Node getNamedItemNS(String uri, String local) {
-	    return(getNamedItem(uri+':'+local));
-	}
-
-	public Node setNamedItemNS(Node node) {
-	    throw new NotSupportedException();
-	}
-
-	public Node removeNamedItemNS(String uri, String local) {
-	    throw new NotSupportedException();
-	}
-
-    }
-
-
-    /**************************************************************
-     * Implementation of org.w3c.dom.Node
-     */
-    private final class NodeImpl implements Node {
-
-	private final int _index;
-
-	public NodeImpl(int index) {
-	    _index = index;
-	}
-
-	public short getNodeType() {
-	    switch (_type[_index]) {
-	    case ROOT:
-		return Node.DOCUMENT_NODE;
-		
-	    case TEXT:
-		return Node.TEXT_NODE;
-		
-	    case PROCESSING_INSTRUCTION:
-		return Node.PROCESSING_INSTRUCTION_NODE;
-		
-	    case COMMENT:
-		return Node.COMMENT_NODE;
-		
-	    default:
-		return _index < _firstAttributeNode
-		    ? Node.ELEMENT_NODE : Node.ATTRIBUTE_NODE;
-	    }
-	}
-		
-	public Node getParentNode() {
-	    final int parent = getParent(_index);
-	    return parent > NULL ? makeNode(parent) : null;
-	}
-		
-	public Node appendChild(Node node) throws DOMException {
-	    throw new NotSupportedException();
-	}
-		
-	public Node cloneNode(boolean deep) {
-	    throw new NotSupportedException();
-	}
-		
-	public NamedNodeMap getAttributes() {
-	    if (getNodeType() == Node.ELEMENT_NODE) {
-		int attribute = _lengthOrAttr[_index];
-		if (attribute != NULL) {
-		    final IntegerArray attributes = new IntegerArray(4);
-		    do {
-			attributes.add(attribute);
-		    }
-		    while ((attribute = _nextSibling[attribute]) != 0);
-		    return new NamedNodeMapImpl(attributes.toIntArray());
-		}
-		else {
-		    return getEmptyNamedNodeMap();
-		}
-	    }
-	    else {
-		return null;
-	    }
-	}
-
-	public NodeList getChildNodes() {
-	    if (hasChildNodes()) {
-		final IntegerArray children = new IntegerArray(8);
-		int child = _offsetOrChild[_index];
-		do {
-		    children.add(child);
-		}
-		while ((child = _nextSibling[child]) != 0);
-		return new NodeListImpl(children.toIntArray());
-	    }
-	    else {
-		return getEmptyNodeList();
-	    }
-	}
-		
-	public Node getFirstChild() {
-	    return hasChildNodes()
-		? makeNode(_offsetOrChild[_index])
-		: null;
-	}
-		
-	public Node getLastChild() {
-	    return hasChildNodes()
-		? makeNode(lastChild(_index))
-		: null;
-	}
-		
-	public Node getNextSibling() {
-	    final int next = _nextSibling[_index];
-	    return next != 0 ? makeNode(next) : null;
-	}
-		
-	public String getNodeName() {
-	    switch (_type[_index]) {
-	    case ROOT:
-		return "#document";
-	    case TEXT:
-		return "#text";
-	    case PROCESSING_INSTRUCTION:
-		return "#pi";
-	    case COMMENT:
-		return "#comment";
-	    default:
-		return DOMImpl.this.getNodeName(_index);
-	    }
-	}
-		
-	public String getNodeValue() throws DOMException {
-	    return DOMImpl.this.getNodeValue(_index);
-	}
-		
-	public Document getOwnerDocument() {
-	    return null;
-	}
-		
-	//??? how does it work with attributes
-	public Node getPreviousSibling() {
-	    int node = _parent[_index];
-	    if (node > NULL) {
-		int prev = -1;
-		node = _offsetOrChild[node];
-		while (node != _index) {
-		    node = _nextSibling[prev = node];
-		}
-		if (prev != -1) {
-		    return makeNode(prev);
-		}
-	    }
-	    return null;
-	}
-		
-	public boolean hasChildNodes() {
-	    switch (getNodeType()) {
-	    case Node.ELEMENT_NODE:
-	    case Node.DOCUMENT_NODE:
-		return _offsetOrChild[_index] != 0;
-
-	    default:
-		return false;
-	    }
-	}
-		
-	public Node insertBefore(Node n1, Node n2) throws DOMException {
-	    throw new NotSupportedException();
-	}
-		
-	public Node removeChild(Node n) throws DOMException {
-	    throw new NotSupportedException();
-	}
-		
-	public Node replaceChild(Node n1, Node n2) throws DOMException {
-	    throw new NotSupportedException();
-	}
-		
-	public void setNodeValue(String s) throws DOMException {
-	    throw new NotSupportedException();
-	}
-
-	public void normalize() {
-	    throw new NotSupportedException();
-	}
-
-	public boolean isSupported(String feature, String version) {
-	    return false;
-	}
-
-	public String getNamespaceURI() {
-	    return _uriArray[_namespace[_type[_index] - NTYPES]];
-	}
-
-	public String getPrefix() {
-	    return _prefixArray[_prefix[_index]];
-	}
-
-	public void setPrefix(String prefix) {
-	    throw new NotSupportedException();
-	}
-
-	public String getLocalName() {
-	    return DOMImpl.this.getLocalName(_index);
-	}
-
-	public boolean hasAttributes() {
-	    return (_lengthOrAttr[_index] != NULL);
-	}
-
-    }
-
-    // A single copy (cache) of ElementFilter
-    private Filter _elementFilter;
-
-    /**
-     * Returns a filter that lets only element nodes through
-     */
-    private Filter getElementFilter() {
-	if (_elementFilter == null) {
-	    _elementFilter = new Filter() {
-		    public boolean test(int node) {
-			return isElement(node);
-		    }
-		};
-	}
-	return _elementFilter;
-    }
-
-    /**
-     * Implementation of a filter that only returns nodes of a
-     * certain type (instanciate through getTypeFilter()).
-     */
-    private final class TypeFilter implements Filter {
-	private final int _nodeType;
-                  
-	public TypeFilter(int type) {
-	    _nodeType = type;
-	}
-                  
-	public boolean test(int node) {
-	    return _type[node] == _nodeType;
-	}
-    }
-
-    /**
-     * Returns a node type filter (implementation of Filter)
-     */
-    public Filter getTypeFilter(int type) {
-	return new TypeFilter(type);
-    }
-
-
-    /**************************************************************
-     * Iterator that returns all children of a given node
-     */
-    private final class ChildrenIterator extends NodeIteratorBase {
-	// child to return next
-	private int _currentChild;
-         
-	public NodeIterator setStartNode(final int node) {
-	    if (_isRestartable) {
-		_currentChild = hasChildren(node)
-		    ? _offsetOrChild[_startNode = node] : END;
-		return resetPosition();
-	    }
-	    return this;
-	}
-
-	public int next() {
-	    final int node = _currentChild;
-	    _currentChild = _nextSibling[node];
-	    return returnNode(node);
-	}
-
-	public void setMark() {
-	    _markedNode = _currentChild;
-	}
-
-	public void gotoMark() {
-	    _currentChild = _markedNode;
-	}
-
-    } // end of ChildrenIterator
-
-
-    /**************************************************************
-     * Iterator that returns the parent of a given node
-     */
-    private final class ParentIterator extends NodeIteratorBase {
-	// candidate parent node
-	private int _node;
-	private int _nodeType = -1;
-         
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_node = _parent[_startNode = node];
-		return resetPosition();
-	    }
-	    return this;
-	}
-             
-	public NodeIterator setNodeType(final int type) {
-	    _nodeType = type;
-	    return this;
-	}
-
-	public int next() {
-	    int result = _node;
-	    if ((_nodeType != -1) && (_type[_node] != _nodeType))
-		result = END;
-	    else
-		result = _node;
-	    _node = END;
-	    return returnNode(result);
-	}
-
-	public void setMark() {
-	    _markedNode = _node;
-	}
-
-	public void gotoMark() {
-	    _node = _markedNode;
-	}
-    } // end of ParentIterator
-
-
-    /**************************************************************
-     * Iterator that returns children of a given type for a given node.
-     * The functionality chould be achieved by putting a filter on top
-     * of a basic child iterator, but a specialised iterator is used
-     * for efficiency (both speed and size of translet).
-     */
-    private final class TypedChildrenIterator extends NodeIteratorBase {
-	private final int _nodeType;
-	// node to consider next
-	private int _currentChild;
-         
-	public TypedChildrenIterator(int nodeType) {
-	    _nodeType = nodeType;
-	}
-
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_currentChild = hasChildren(node)
-		    ? _offsetOrChild[_startNode = node] : END;
-		return resetPosition();
-	    }
-	    return this;
-	}
-
-	public int next() {
-	    for (int node = _currentChild; node != END;
-		 node = _nextSibling[node]) {
-		if (_type[node] == _nodeType) {
-		    _currentChild = _nextSibling[node];
-		    return returnNode(node);
-		}
-	    }
-	    return END;
-	}
-
-	public void setMark() {
-	    _markedNode = _currentChild;
-	}
-
-	public void gotoMark() {
-	    _currentChild = _markedNode;
-	}
-    } // end of TypedChildrenIterator
-
-
-    /**************************************************************
-     * Iterator that returns children within a given namespace for a
-     * given node. The functionality chould be achieved by putting a
-     * filter on top of a basic child iterator, but a specialised
-     * iterator is used for efficiency (both speed and size of translet).
-     */
-    private final class NamespaceChildrenIterator extends NodeIteratorBase {
-	private final int _nsType;
-	private int _currentChild;
-         
-	public NamespaceChildrenIterator(final int type) {
-	    _nsType = type;
-	}
-
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_currentChild = hasChildren(node)
-		    ? _offsetOrChild[_startNode = node] : END;
-		return resetPosition();
-	    }
-	    return this;
-	}
-
-	public int next() {
-	    for (int node = _currentChild; node != END; 
-		 node = _nextSibling[node]) {
-		if (getNamespaceType(node) == _nsType) {
-		    _currentChild = _nextSibling[node];
-		    return returnNode(node);
-		}
-	    }
-	    return END;
-	}
-
-	public void setMark() {
-	    _markedNode = _currentChild;
-	}
-
-	public void gotoMark() {
-	    _currentChild = _markedNode;
-	}
-
-    } // end of TypedChildrenIterator
-
-
-    /**************************************************************
-     * Iterator that returns attributes within a given namespace for a node.
-     */
-    private final class NamespaceAttributeIterator extends NodeIteratorBase {
-
-	private final int _nsType;
-	private int _attribute;
-         
-	public NamespaceAttributeIterator(int nsType) {
-	    super();
-	    _nsType = nsType;
-	}
-                  
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		for (node = _lengthOrAttr[_startNode = node];
-		     node != NULL && getNamespaceType(node) != _nsType;
-		     node = _nextSibling[node]);
-		_attribute = node;
-		return resetPosition();
-	    }
-	    return this;
-	}
-                  
-	public int next() {
-	    final int save = _attribute;
-	    int node = save;
-	    _attribute = _nextSibling[_attribute];
-	    for (node = _lengthOrAttr[_startNode = node];
-		 node != NULL && getNamespaceType(node) != _nsType;
-		 node = _nextSibling[node]);
-	    _attribute = node;
-
-	    return returnNode(save);
-	}
-
-	public void setMark() {
-	    _markedNode = _attribute;
-	}
-
-	public void gotoMark() {
-	    _attribute = _markedNode;
-	}
-         
-    } // end of TypedChildrenIterator
-
-
-    /**************************************************************
-     * Iterator that returns all siblings of a given node.
-     */
-    private class FollowingSiblingIterator extends NodeIteratorBase {
-	private int _node;
-         
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_node = _startNode = node;
-		return resetPosition();
-	    }
-	    return this;
-	}
-                  
-	public int next() {
-	    return returnNode(_node = _nextSibling[_node]);
-	}
-
-	public void setMark() {
-	    _markedNode = _node;
-	}
-
-	public void gotoMark() {
-	    _node = _markedNode;
-	}
-    } // end of FollowingSiblingIterator
-
-
-    /**************************************************************
-     * Iterator that returns all following siblings of a given node.
-     */
-    private final class TypedFollowingSiblingIterator
-	extends FollowingSiblingIterator {
-	private final int _nodeType;
-
-	public TypedFollowingSiblingIterator(int type) {
-	    _nodeType = type;
-	}
-         
-	public int next() {
-	    int node;
-	    while ((node = super.next()) != NULL) {
-		if (_type[node] == _nodeType) return node;
-	    }
-	    return END;
-	}
-
-    } // end of TypedFollowingSiblingIterator
-
-
-    /**************************************************************
-     * Iterator that returns attribute nodes (of what nodes?)
-     */
-    private final class AttributeIterator extends NodeIteratorBase {
-	private int _attribute;
-         
-	// assumes caller will pass element nodes
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_attribute = isElement(node)
-		    ? _lengthOrAttr[_startNode = node]
-		    : NULL;
-		return resetPosition();
-	    }
-	    return this;
-	}
-                  
-	public int next() {
-	    final int node = _attribute;
-	    _attribute = _nextSibling[_attribute];
-	    return returnNode(node);
-	}
-
-	public void setMark() {
-	    _markedNode = _attribute;
-	}
-
-	public void gotoMark() {
-	    _attribute = _markedNode;
-	}
-    } // end of AttributeIterator
-
-
-    /**************************************************************
-     * Iterator that returns attribute nodes of a given type
-     */
-    private final class TypedAttributeIterator extends NodeIteratorBase {
-	private final int _nodeType;
-	private int _attribute;
-         
-	public TypedAttributeIterator(int nodeType) {
-	    _nodeType = nodeType;
-	}
-                  
-	// assumes caller will pass element nodes
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		for (node = _lengthOrAttr[_startNode = node];
-		     node != NULL && _type[node] != _nodeType;
-		     node = _nextSibling[node]);
-		_attribute = node;
-		return resetPosition();
-	    }
-	    return this;
-	}
-                  
-	public int next() {
-	    final int node = _attribute;
-	    _attribute = NULL;         // singleton iterator
-	    return returnNode(node);
-	}
-
-	public void setMark() {
-	    _markedNode = _attribute;
-	}
-
-	public void gotoMark() {
-	    _attribute = _markedNode;
-	}
-    } // end of TypedAttributeIterator
-
-
-    /**************************************************************
-     * Iterator that returns preceding siblings of a given node
-     */
-    private class PrecedingSiblingIterator extends NodeIteratorBase {
-	private int _start;
-	private int _node;
-         
-	public boolean isReverse() {
-	    return true;
-	}
-         
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_node = _offsetOrChild[_parent[_startNode = _start = node]];
-		return resetPosition();
-	    }
-	    return this;
-	}
-                  
-	public int next() {
-	    if (_node == _start) {
-		return NULL;
-	    }
-	    else {
-		final int node = _node;
-		_node = _nextSibling[node];
-		return returnNode(node);
-	    }
-	}
-
-	public void setMark() {
-	    _markedNode = _node;
-	}
-
-	public void gotoMark() {
-	    _node = _markedNode;
-	}
-    } // end of PrecedingSiblingIterator
-
-
-    /**************************************************************
-     * Iterator that returns preceding siblings of a given type for
-     * a given node
-     */
-    private final class TypedPrecedingSiblingIterator
-	extends PrecedingSiblingIterator {
-	private final int _nodeType;
-
-	public TypedPrecedingSiblingIterator(int type) {
-	    _nodeType = type;
-	}
-         
-	public int next() {
-	    int node;
-	    while ((node = super.next()) != NULL && _type[node] != _nodeType) {
-	    }
-	    return node;
-	}
-
-    } // end of PrecedingSiblingIterator
-
-
-    /**************************************************************
-     * Iterator that returns preceding nodes of a given node.
-     * This includes the node set {root+1, start-1}, but excludes
-     * all ancestors.
-     */
-    private class PrecedingIterator extends NodeIteratorBase {
-
-	private int _node = 0;
-	private int[] _stack = new int[8];
-	private int _sp = 0;
-	private int _spStart = 0;
-	private int _spMark = 0;
-
-	public boolean isReverse() {
-	    return true;
-	}
-         
-	public NodeIterator cloneIterator() {
-	    try {
-		_isRestartable = false;
-		final PrecedingIterator clone = 
-		    (PrecedingIterator)super.clone();
-		return clone.reset();
-	    }
-	    catch (CloneNotSupportedException e) {
-		BasisLibrary.runTimeError("Iterator clone not supported.");
-		return null;
-	    }
-	}
-         
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_startNode = node;
-		_node = ROOTNODE;
-		int parent = node;
-		while ((parent = _parent[parent]) > ROOTNODE) {
-		    if (_sp == _stack.length) {
-			final int[] stack = new int[_sp + 4];
-			System.arraycopy(_stack, 0, stack, 0, _sp);
-			_stack = stack;
-		    }
-		    _stack[_sp++] = parent;
-		}
-		_sp--;
-		_spStart = _sp;
-		return resetPosition();
-	    }
-	    return this;
-	}
-                  
-	public int next() {
-	    // Advance node index and check if all nodes have been returned.
-	    while (++_node < _startNode) {
-		// Check if we reached one of the base node's ancestors
-		if ((_sp < 0) || (_node < _stack[_sp])) return(_node);
-		// Anvance past the next ancestor node
-		_sp--;
-	    }
-	    return(NULL);
-	}
-
-	// redefine NodeIteratorBase's reset
-	public NodeIterator reset() {
-	    _node = ROOTNODE;
-	    _spStart = _sp;
-	    return resetPosition();
-	}
-
-	public void setMark() {
-	    _markedNode = _node;
-	    _spMark = _sp;
-	}
-
-	public void gotoMark() {
-	    _node = _markedNode;
-	    _sp = _spMark;
-	}
-    } // end of PrecedingIterator
-
-
-    /**************************************************************
-     * Iterator that returns preceding nodes of agiven type for a
-     * given node. This includes the node set {root+1, start-1}, but
-     * excludes all ancestors.
-     */
-    private final class TypedPrecedingIterator extends PrecedingIterator {
-	private final int _nodeType;
-
-	public TypedPrecedingIterator(int type) {
-	    _nodeType = type;
-	}
-         
-	public int next() {
-	    int node;
-	    while ((node = super.next()) != NULL && _type[node] != _nodeType) {
-	    }
-	    return node;
-	}
-
-    } // end of TypedPrecedingIterator
-
-
-    /**************************************************************
-     * Iterator that returns following nodes of for a given node.
-     */
-    private class FollowingIterator extends NodeIteratorBase {
-	//  _node precedes search for next
-	protected int _node;
-                  
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_startNode = node;
-		// find rightmost descendant (or self)
-		int current;
-		while ((node = lastChild(current = node)) != NULL) {
-		}
-		_node = current;
-		// _node precedes possible following(node) nodes
-		return resetPosition();
-	    }
-	    return this;
-	}
-                      
-	public int next() {
-	    final int node = _node + 1;
-	    return node < _treeNodeLimit ? returnNode(_node = node) : NULL;
-	}
-
-	public void setMark() {
-	    _markedNode = _node;
-	}
-
-	public void gotoMark() {
-	    _node = _markedNode;
-	}
-    } // end of FollowingIterator
-
-
-    /**************************************************************
-     * Iterator that returns following nodes of a given type for a given node.
-     */
-    private final class TypedFollowingIterator extends FollowingIterator {
-	private final int _nodeType;
-
-	public TypedFollowingIterator(int type) {
-	    _nodeType = type;
-	}
-                  
-	public int next() {
-	    int node;
-	    while ((node = super.next()) != NULL) {
-		if (_type[node] == _nodeType) return node;
-	    }
-	    return END;
-	}
-    } // end of TypedFollowingIterator
-
-
-    /**************************************************************
-     * Iterator that returns the ancestors of a given node.
-     * The nodes are returned in reverse document order, so you
-     * get the context node (or its parent node) first, and the
-     * root node in the very, very end.
-     */         
-    private class AncestorIterator extends NodeIteratorBase {
-
-	protected int _index;
-
-	public final boolean isReverse() {
-	    return true;
-	}
-
-	public int getLast() {
-	    return(ROOT);
-	}
-         
-	public NodeIterator cloneIterator() {
-	    _isRestartable = false;         // must set to false for any clone
-	    try {
-		final AncestorIterator clone = (AncestorIterator)super.clone();
-		clone._startNode = _startNode;
-		return clone.reset();
-	    } catch (CloneNotSupportedException e) {
-		BasisLibrary.runTimeError("Iterator clone not supported.");
-		return null;
-	    }
-	}
-                  
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		if (_includeSelf)
-		    _startNode = node;
-		else
-		    _startNode = _parent[node];
-		_index = _startNode;
-		return resetPosition();
-	    }
-	    return this;
-	}
-
-	public NodeIterator reset() {
-	    _index = _startNode;
-	    return resetPosition();
-	}
-                  
-	public int next() {
-	    if (_index >= 0) {
-		int bob = _index;
-		if (_index == 0)
-		    _index = -1;
-		else
-		    _index = _parent[_index];
-		return returnNode(bob);
-	    }
-	    return(NULL);
-	}
-
-	public void setMark() {
-	    _markedNode = _index;
-	}
-
-	public void gotoMark() {
-	    _index = _markedNode;
-	}
-    } // end of AncestorIterator
-
-
-    /**************************************************************
-     * Typed iterator that returns the ancestors of a given node.
-     */             
-    private final class TypedAncestorIterator extends AncestorIterator {
-
-	private final int _nodeType;
-                  
-	public TypedAncestorIterator(int type) {
-	    _nodeType = type;
-	}
-
-	public int next() {
-	    int node;
-	    while ((node = super.next()) != NULL) {
-		if (_type[node] == _nodeType)
-		    return returnNode(node);
-	    }
-	    return(NULL);
-	}
-
-	public int getLast() {
-	    int last = _index;
-	    int curr = _index;
-
-	    while (curr >= 0) {
-		if (curr == 0)
-		    curr = -1;
-		else
-		    curr = _parent[curr];
-		if (_type[curr] == _nodeType)
-		    last = curr;
-	    }
-	    return(last);
-	}
-
-    } // end of TypedAncestorIterator
-
-
-    /**************************************************************
-     * Iterator that returns the descendants of a given node.
-     */             
-    private class DescendantIterator extends NodeIteratorBase {
-	//  _node precedes search for next
-	protected int _node;
-	// first node outside descendant range
-	protected int _limit;
-
-	public NodeIterator setStartNode(int node) {
-	    _startNode = node;
-	    if (_isRestartable) {
-		_node = _startNode = _includeSelf ? node - 1 : node;
-		// no descendents if no children
-		if (hasChildren(node) == false) {
-		    // set _limit to match next()'s criteria for end
-		    _limit = node + 1;
-		}
-		// find leftmost descendant of next sibling
-		else if ((node = _nextSibling[node]) == 0) {
-		    // no next sibling, array end is the limit
-		    _limit = _treeNodeLimit;
-		}
-		else {
-		    _limit = leftmostDescendant(node);
-		}
-		return resetPosition();
-	    }
-	    return this;
-	}
-
-	public int next() {
-	    if (++_node >= (_limit))
-		return(NULL);
-	    else
-		return(returnNode(_node));
-	}
-
-	public void setMark() {
-	    _markedNode = _node;
-	}
-
-	public void gotoMark() {
-	    _node = _markedNode;
-	}
-
-    } // end of DescendantIterator
-
-
-    /**************************************************************
-     * Typed iterator that returns the descendants of a given node.
-     */             
-    private final class TypedDescendantIterator extends DescendantIterator {
-	private final int _nodeType;
-                  
-	public TypedDescendantIterator(int nodeType) {
-	    _nodeType = nodeType;
-	}
-                  
-	public int next() {
-	    final int limit = _limit;
-	    final int type = _nodeType;
-	    int node = _node + 1; // start search w/ next
-	    // while condition == which nodes to skip
-	    // iteration stops when at end or node w/ desired type
-	    while (node < limit && _type[node] != type) {
-		++node;
-	    }
-	    return node < limit ? returnNode(_node = node) : NULL;
-	}
-
-    } // end of TypedDescendantIterator
-
-
-    /**************************************************************
-     * Iterator that returns the descendants of a given node.
-     */             
-    private class NthDescendantIterator extends DescendantIterator {
-
-	int _pos;
-
-	public NthDescendantIterator(int pos) {
-	    _pos = pos;
-	    _limit = _treeNodeLimit;
-	}
-
-	// The start node of this iterator is always the root!!!
-	public NodeIterator setStartNode(int node) {
-	    NodeIterator iterator = super.setStartNode(1);
-	    _limit = _treeNodeLimit;
-	    return iterator;
-	}
-
-	public int next() {
-	    int node;
-	    while ((node = super.next()) != END) {
-		int parent = _parent[node];
-		int child = _offsetOrChild[parent];
-		int pos = 0;
-
-		do {
-		    if (isElement(child)) pos++;
-		} while ((pos < _pos) && (child = _nextSibling[child]) != 0);
-		if (node == child) return node;
-	    }
-	    return(END);
-	}
-
-    } // end of NthDescendantIterator
-
-
-    /**************************************************************
-     * Iterator that returns a given node only if it is of a given type.
-     */             
-    private final class TypedSingletonIterator extends SingletonIterator {
-	private final int _nodeType;
-
-	public TypedSingletonIterator(int nodeType) {
-	    _nodeType = nodeType;
-	}
-         
-	public int next() {
-	    final int result = super.next();
-	    return _type[result] == _nodeType ? result : NULL;
-	}
-    } // end of TypedSingletonIterator
-
-
-    /**************************************************************
-     * Iterator to put on top of other iterators. It will take the
-     * nodes from the underlaying iterator and return all but
-     * whitespace text nodes. The iterator needs to be a supplied
-     * with a filter that tells it what nodes are WS text.
-     */             
-    private final class StrippingIterator extends NodeIteratorBase {
-
-	private static final int USE_PREDICATE  = 0;
-	private static final int STRIP_SPACE    = 1;
-	private static final int PRESERVE_SPACE = 2;
-
-	private StripFilter _filter = null;
-	private short[] _mapping = null;
-	private final NodeIterator _source;
-	private boolean _children = false;
-	private int _action = USE_PREDICATE;
-	private int _last = -1;
-
-	public StrippingIterator(NodeIterator source,
-				 short[] mapping,
-				 StripFilter filter) {
-
-	    _filter = filter;
-	    _mapping = mapping;
-	    _source = source;
-
-	    if (_source instanceof ChildrenIterator ||
-		_source instanceof TypedChildrenIterator) {
-		_children = true;
-	    }
-	}
-
-	public NodeIterator setStartNode(int node) {
-	    if (_children) {
-		if (_filter.stripSpace((DOM)DOMImpl.this, node,
-				       _mapping[_type[node]]))
-		    _action = STRIP_SPACE;
-		else
-		    _action = PRESERVE_SPACE;
-	    }
-
-	    _source.setStartNode(node);
-	    return resetPosition();
-	}
-    
-	public int next() {
-	    int node;
-	    while ((node = _source.next()) != END) {
-		switch(_action) {
-		case STRIP_SPACE:
-		    if (_whitespace.getBit(node)) continue;
-		    // fall through...
-		case PRESERVE_SPACE:
-		    return returnNode(node);
-		case USE_PREDICATE:
-		    if (_whitespace.getBit(node) &&
-			_filter.stripSpace((DOM)DOMImpl.this, node,
-					   _mapping[_type[_parent[node]]]))
-			continue;
-		    return returnNode(node);
-		}
-	    }
-	    return END;
-	}
-    
-	public void setMark() {
-	    _source.setMark();
-	}
-
-	public void gotoMark() {
-	    _source.gotoMark();
-	}
-
-	public int getLast() {
-	    // Return chached value (if we have it)
-	    if (_last != -1) return _last;
-
-	    int count = getPosition();
-	    int node;
-
-	    _source.setMark();
-	    while ((node = _source.next()) != END) {
-		switch(_action) {
-		case STRIP_SPACE:
-		    if (_whitespace.getBit(node))
-			continue;
-		    // fall through...
-		case PRESERVE_SPACE:
-		    count++;
-		    break;
-		case USE_PREDICATE:
-		    if (_whitespace.getBit(node) &&
-			_filter.stripSpace((DOM)DOMImpl.this, node,
-					   _mapping[_type[_parent[node]]]))
-			continue;
-		    else
-			count++;
-		}
-	    }
-	    _source.gotoMark();
-	    _last = count;
-	    return(count);
-	}
-
-    } // end of StrippingIterator
-
-    public NodeIterator strippingIterator(NodeIterator iterator,
-					  short[] mapping,
-					  StripFilter filter) {
-	return(new StrippingIterator(iterator, mapping, filter));
-    }
-
-    /**************************************************************
-     * This is a specialised iterator for predicates comparing node or
-     * attribute values to variable or parameter values.
-     */
-    private final class NodeValueIterator extends NodeIteratorBase {
-
-	private NodeIterator _source;
-	private String _value;
-	private boolean _op;
-	private final boolean _isReverse;
-
-	public NodeValueIterator(NodeIterator source,
-				 String value, boolean op) {
-	    _source = source;
-	    _value = value;
-	    _op = op;
-	    _isReverse = source.isReverse();
-	}
-
-	public boolean isReverse() {
-	    return _isReverse;
-	}
-    
-	public NodeIterator cloneIterator() {
-	    try {
-		NodeValueIterator clone = (NodeValueIterator)super.clone();
-		clone._isRestartable = false;
-		clone._source = _source.cloneIterator();
-		clone._value = _value;
-		clone._op = _op;
-		return clone.reset();
-	    }
-	    catch (CloneNotSupportedException e) {
-		BasisLibrary.runTimeError("Iterator clone not supported."); 
-		return null;
-	    }
-	}
-    
-	public NodeIterator reset() {
-	    _source.reset();
-	    return resetPosition();
-	}
-
-	public int next() {
-
-	    int node;
-	    while ((node = _source.next()) != END) {
-		String val = getNodeValue(node);
-		if (_value.equals(val) == _op) {
-		    return _parent[node];
-		}
-	    }
-	    return END;
-	}
-
-	public NodeIterator setStartNode(int node) {
-	    if (_isRestartable) {
-		_source.setStartNode(_startNode = node); 
-		return resetPosition();
-	    }
-	    return this;
-	}
-
-	public void setMark() {
-	    _source.setMark();
-	}
-
-	public void gotoMark() {
-	    _source.gotoMark();
-	}
-    }                       
-
-    public NodeIterator getNodeValueIterator(NodeIterator iterator,
-					     String value, boolean op) {
-	return(new NodeValueIterator(iterator, value, op));
-    }
-
-    /**************************************************************
-     * Iterator that assured that a single node is only returned once
-     * and that the nodes are returned in document order.
-     */             
-    private final class OrderedIterator extends NodeIteratorBase {
-
-	private BitArray  _nodes = null;
-	private int       _save = 0;
-	private int       _mark = 0;
-	private int       _start = 0;
-	private int       _node = -1;
-	private int       _last = 0;
-
-	public OrderedIterator(NodeIterator source, int node) {
-	    _nodes = new BitArray(_treeNodeLimit);
-	    source.setStartNode(node);
-	    while ((_node = source.next()) != END) {
-		if (_start == -1) _start = _node;
-		_last = _node;
-		_nodes.setBit(_node);
-	    }
-	    _node = -1;
-	}
- 
-	public int next() {
-	    while ((_node < _treeNodeLimit) && (!_nodes.getBit(++_node))) ;
-	    if (_node >= _treeNodeLimit) return(END);
-	    return returnNode(_node);
-	}
-
-	public NodeIterator reset() {
-	    _node = _start - 1;
-	    return(this);
-	}
-
-	public int getLast() {
-	    return(_last);
-	}
-         
-	public void setMark() {
-	    _save = _node;
-	}
-
-	public void gotoMark() {
-	    _node = _save;
-	}
-
-	public NodeIterator setStartNode(int start) {
-	    _start = start;
-	    return((NodeIterator)this);
-	}
-
-	public boolean isReverse() {
-	    return(false);
-	}
-
-	public NodeIterator cloneIterator() {
-	    return((NodeIterator)this);
-	}
-
-    } // end of OrderedIterator
-
-
-    /**
-     * Encapsulates an iterator in an OrderedIterator to ensure node order
-     */
-    public NodeIterator orderNodes(NodeIterator source, int node) {
-	return new OrderedIterator(source, node);
-    }
-
-    /**
-     * Returns the leftmost descendant of a node (bottom left in sub-tree)
-     */
-    private int leftmostDescendant(int node) {
-	int current;
-	while (_type[current = node] >= NTYPES 
-	       && (node = _offsetOrChild[node]) != NULL) {
-	}
-	return current;
-    }
-
-    /**
-     * Returns index of last child or 0 if no children
-     */
-    private int lastChild(int node) {
-	if (isElement(node) || node == ROOTNODE) {
-	    int child;
-	    if ((child = _offsetOrChild[node]) != NULL) {
-		while ((child = _nextSibling[node = child]) != NULL) {
-		}
-		return node;
-	    }
-	}
-	return 0;
-    }
-
-    /**
-     * Returns the parent of a node
-     */
-    public int getParent(final int node) {
-	return _parent[node];
-    }
-
-    /**
-     * Returns a node's position amongst other nodes of the same type
-     */
-    public int getTypedPosition(NodeIterator iterator, int type, int node) {
-
-	// Just return the basic position if no type is specified
-	if (type == -1) type = _type[node];
-
-	int match = 1;
-	int curr  = 0;
-	iterator.reset();
-
-	while ( ((curr = iterator.next()) != NULL) && (curr != node)) {
-	    if (_type[curr] == type) match++;
-	}
-	return match;         
-    }
-
-    /**
-     * Returns an iterator's last node of a given type
-     */
-    public int getTypedLast(NodeIterator iterator, int type, int node) {
-	// Just return the basic position if no type is specified
-	if (type == -1) return(iterator.getLast());
-
-	int match = 0;
-	int curr  = 0;
-	iterator.setMark();
-	iterator.reset();
-
-	while ((curr = iterator.next()) != NULL) {
-	    if (_type[curr] == type) match++;
-	}
-	iterator.gotoMark();
-	return match;         
-    }
-
-    /**
-     * Returns singleton iterator containg the document root
-     * Works for them main document (mark == 0)
-     */
-    public NodeIterator getIterator() {
-	return new SingletonIterator(ROOTNODE);
-    }
-
-    /**
-     * Returns the type of a specific node
-     */
-    public int getType(final int node) {
-	if (node >= _type.length)
-	    return(0);
-	else
-	    return _type[node];
-    }
-    
-    /**
-     * Returns the namespace type of a specific node
-     */
-    public int getNamespaceType(final int node) {
-	final int type = _type[node];
-	if (type >= NTYPES)
-	    return(_namespace[type-NTYPES]);
-	else
-	    return(0); // default namespace
-    }
-
-    /**
-     * Returns the node-to-type mapping array
-     */
-    public short[] getTypeArray() {
-	return _type;
-    }
-
-    /**
-     * Returns the (String) value of any node in the tree
-     */
-    public String getNodeValue(final int node) {
-	if (node == NULL) return EMPTYSTRING;
-	switch(_type[node]) {
-	case ROOT:
-	    return getNodeValue(_offsetOrChild[node]);
-	case TEXT:
-	case COMMENT:
-	case PROCESSING_INSTRUCTION:
-	    return makeStringValue(node);
-	default:
-	    if (node < _firstAttributeNode)
-		return getElementValue(node); // element string value
-	    else
-		return makeStringValue(node); // attribute value
-	}
-    }
-
-    private String getLocalName(int node) {
-	final int type = _type[node] - NTYPES;
-	final String qname = _namesArray[type];
-	final String uri = _uriArray[_namespace[type]];
-
-	if (uri != null) {
-	    final int len = uri.length();
-	    if (len > 0) return qname.substring(len+1);
-	}
-	return qname;
-    }
-
-    /**
-     * Sets up a translet-to-dom type mapping table
-     */
-    private Hashtable setupMapping(String[] namesArray) {
-	final int nNames = namesArray.length;
-	final Hashtable types = new Hashtable(nNames);
-	for (int i = 0; i < nNames; i++) {
-	    types.put(namesArray[i], new Integer(i + NTYPES));
-	}
-	return types;
-    }
-
-    /**
-     * Returns the internal type associated with an expaneded QName
-     */
-    public int getGeneralizedType(final String name) {
-	final Integer type = (Integer)_types.get(name);
-	if (type == null) {
-	    // memorize default type
-	    final int code = name.charAt(0) == '@' ? ATTRIBUTE : ELEMENT;
-	    _types.put(name, new Integer(code));
-	    return code;
-	}
-	else {
-	    return type.intValue();
-	}
-    }
-
-    /**
-     * Get mapping from DOM element/attribute types to external types
-     */
-    public short[] getMapping(String[] names) {
-	int i;
-	final int namesLength = names.length;
-	final int mappingLength = _namesArray.length + NTYPES;
-	final short[] result = new short[mappingLength];
-
-	// primitive types map to themselves
-	for (i = 0; i < NTYPES; i++)
-	    result[i] = (short)i;
-
-	// extended types initialized to "beyond caller's types"
-	// unknown element or Attr
-	for (i = NTYPES; i < mappingLength; i++) {
-	    final int type = i - NTYPES;
-	    final String name = _namesArray[type];
-	    final String uri = _uriArray[_namespace[type]];
-	    int len = 0;
-	    if (uri != null) {
-		len = uri.length();
-		if (len > 0) len++;
-	    }
-	    if (name.charAt(len) == '@')
-		result[i] = (short)ATTRIBUTE;
-	    else
-		result[i] = (short)ELEMENT;
-	}
-
-	// actual mapping of caller requested names
-	for (i = 0; i < namesLength; i++) {
-	    result[getGeneralizedType(names[i])] = (short)(i + NTYPES);
-	}
-             
-	return(result);
-
-    }
-
-    /**
-     * Get mapping from external element/attribute types to DOM types
-     */
-    public short[] getReverseMapping(String[] names) {
-	int i;
-	final short[] result = new short[names.length + NTYPES];
-	// primitive types map to themselves
-	for (i = 0; i < NTYPES; i++) {
-	    result[i] = (short)i;
-	}
-	// caller's types map into appropriate dom types
-	for (i = 0; i < names.length; i++) {
-	    result[i + NTYPES] = (short)getGeneralizedType(names[i]);
-	    if (result[i + NTYPES] == ELEMENT)
-		result[i + NTYPES] = NO_TYPE;
-	}
-	return(result);
-    }
-
-    /**
-     * Get mapping from DOM namespace types to external namespace types
-     */
-    public short[] getNamespaceMapping(String[] namespaces) {
-	int i;
-	final int nsLength = namespaces.length;
-	final int mappingLength = _uriArray.length;
-	final short[] result = new short[mappingLength];
-
-	// Initialize all entries to -1
-	for (i=0; i<mappingLength; i++)
-	    result[i] = (-1);
-
-	for (i=0; i<nsLength; i++) {
-	    Integer type = (Integer)_nsIndex.get(namespaces[i]);
-	    if (type != null) {
-		result[type.intValue()] = (short)i;
-	    }
-	}
-
-	return(result);
-    }
-
-    /**
-     * Get mapping from external namespace types to DOM namespace types
-     */
-    public short[] getReverseNamespaceMapping(String[] namespaces) {
-	int i;
-	final int length = namespaces.length;
-	final short[] result = new short[length];
-
-	for (i=0; i<length; i++) {
-	    Integer type = (Integer)_nsIndex.get(namespaces[i]);
-	    if (type == null)
-		result[i] = -1;
-	    else
-		result[i] = type.shortValue();
-	}
-
-	return(result);
-    }
-
-    /**
-     * Dump the whole tree to a file (serialized)
-     */
-    public void writeExternal(ObjectOutput out) throws IOException {
-	out.writeInt(_treeNodeLimit);
-	out.writeObject(_type);
-	out.writeObject(_namespace);
-	out.writeObject(_parent);
-	out.writeObject(_nextSibling);
-	out.writeObject(_offsetOrChild);
-	out.writeObject(_lengthOrAttr);
-	out.writeObject(_text);
-	out.writeObject(_namesArray);
-	out.writeObject(_uriArray);
-	out.writeObject(_whitespace);
-	out.writeObject(_prefix);
-	out.flush();
-    }
-
-    /**
-     * Read the whole tree from a file (serialized)
-     */
-    public void readExternal(ObjectInput in)
-	throws IOException, ClassNotFoundException {
-	_treeNodeLimit = in.readInt();
-	_type          = (short[])in.readObject();
-	_namespace     = (short[])in.readObject();
-	_parent        = (int[])in.readObject();
-	_nextSibling   = (int[])in.readObject();
-	_offsetOrChild = (int[])in.readObject();
-	_lengthOrAttr  = (int[])in.readObject();
-	_text          = (char[])in.readObject();
-	_namesArray    = (String[])in.readObject();
-	_uriArray      = (String[])in.readObject();
-	_whitespace    = (BitArray)in.readObject();
-	_prefix        = (short[])in.readObject();
-	_types         = setupMapping(_namesArray);
-    }
-
-    /**
-     * Constructor - defaults to 32K nodes
-     */
-    public DOMImpl() {
-	this(32*1024);
-    }
-         
-    /**
-     * Constructor - defines initial size
-     */
-    public DOMImpl(int size) {
-	_type          = new short[size];
-	_parent        = new int[size];
-	_nextSibling   = new int[size];
-	_offsetOrChild = new int[size];
-	_lengthOrAttr  = new int[size];
-	_text          = new char[size * 10];
-	_whitespace    = new BitArray(size);
-	_prefix        = new short[size];
-	// _namesArray[] and _uriArray are allocated in endDocument
-    }
-
-    /**
-     * Prints the whole tree to standard output
-     */
-    public void print(int node, int level) {
-	switch(_type[node]) {
-	case ROOT:
-	    print(_offsetOrChild[node], level);
-	    break;
-	case TEXT:
-	case COMMENT:
-	case PROCESSING_INSTRUCTION:
-	    System.out.print(makeStringValue(node));
-	    break;
-	default:                  // element
-	    final String name = getNodeName(node);
-	    System.out.print("<" + name);
-	    for (int a = _lengthOrAttr[node]; a != NULL; a = _nextSibling[a]) {
-		System.out.print("\n" + getNodeName(a) +
-				 "=\"" + makeStringValue(a) + "\"");
-	    }
-	    System.out.print('>');
-	    for (int child = _offsetOrChild[node]; child != NULL;
-		 child = _nextSibling[child]) {
-		print(child, level + 1);
-	    }
-	    System.out.println("</" + name + '>');
-	    break;
-	}
-    }
-
-    /**
-     * Returns the name of a node (attribute or element).
-     */
-    public String getNodeName(final int node) {
-	// Get the node type and make sure that it is within limits
-	final short type = _type[node];
-	switch(type) {
-	case DOM.ROOT:
-	case DOM.TEXT:
-	case DOM.UNUSED:
-	case DOM.ELEMENT:
-	case DOM.ATTRIBUTE:
-	case DOM.COMMENT:
-	    return EMPTYSTRING;
-	case DOM.PROCESSING_INSTRUCTION:
-	    return "a-pi";
-	default:
-	    // Construct the local part (omit '@' for attributes)
-	    String name  = getLocalName(node);
-	    if (node >= _firstAttributeNode)
-		name = name.substring(1);
-
-	    final int pi = _prefix[node];
-	    if (pi > 0) {
-		final String prefix = _prefixArray[pi];
-		if (prefix != EMPTYSTRING)
-		    name = prefix+':'+name;
-	    }
-	    return name;
-	}
-    }
-
-    /**
-     * Returns the namespace URI to which a node belongs
-     */
-    public String getNamespaceName(final int node) {
-	final int type = getNamespaceType(node);
-	final String name = _uriArray[type];
-	if (name == null)
-	    return(EMPTYSTRING);
-	else
-	    return(name);
-    }
-
-    /**
-     * Returns the string value of a single text/comment node or
-     * attribute value (they are all stored in the same array).
-     */
-    private String makeStringValue(final int node) {
-	return new String(_text, _offsetOrChild[node], _lengthOrAttr[node]);
-    }
-
-    /**
-     * Returns the attribute node of a given type (if any) for an element
-     */
-    public int getAttributeNode(final int type, final int element) {
-	for (int attr = _lengthOrAttr[element];
-	     attr != NULL;
-	     attr = _nextSibling[attr]) {
-	    if (_type[attr] == type) return attr;
-	}
-	return NULL;
-    }
-
-    /**
-     * Returns the value of a given attribute type of a given element
-     */
-    public String getAttributeValue(final int type, final int element) {
-	final int attr = getAttributeNode(type, element);
-	if (attr != NULL)
-	    return makeStringValue(attr);
-	else
-	    return EMPTYSTRING;
-    }
-
-    /**
-     * Returns true if a given element has an attribute of a given type
-     */
-    public boolean hasAttribute(final int type, final int node) {
-	if (getAttributeNode(type, node) != NULL)
-	    return true;
-	else
-	    return false;
-    }
-
-    /**
-     * This method is for testing/debugging only
-     */
-    public String getAttributeValue(final String name, final int element) {
-	return getAttributeValue(getGeneralizedType(name), element);
-    }
-    
-    /**
-     * Returns true if the given element has any children
-     */
-    private boolean hasChildren(final int node) {
-	if (node < _firstAttributeNode) {
-	    final int type = _type[node];
-	    return(((type >= NTYPES) || (type == ROOT)) &&
-		   (_offsetOrChild[node] != 0));
-	}
-	return(false);
-    }
-
-    /**
-     * Returns an iterator with all the children of a given node
-     */
-    public NodeIterator getChildren(final int node) {
-	if (hasChildren(node))
-	    return(new ChildrenIterator());
-	else
-	    return(EMPTYITERATOR);
-    }
-
-    /**
-     * Returns an iterator with all children of a specific type
-     * for a given node (element)
-     */
-    public NodeIterator getTypedChildren(final int type) {
-	return(new TypedChildrenIterator(type));
-    }
-
-    /**
-     * This is a shortcut to the iterators that implement the
-     * supported XPath axes (only namespace::) is not supported.
-     * Returns a bare-bones iterator that must be initialized
-     * with a start node (using iterator.setStartNode()).
-     */
-    public NodeIterator getAxisIterator(final int axis) {
-	NodeIterator iterator = null;
-
-	switch (axis) {
-	case Axis.SELF:
-	    iterator = new SingletonIterator();
-	    break;
-	case Axis.CHILD:
-	    iterator = new ChildrenIterator();
-	    break;
-	case Axis.PARENT:
-	    return(new ParentIterator());
-	case Axis.ANCESTOR:
-	    return(new AncestorIterator());
-	case Axis.ANCESTORORSELF:
-	    return((new AncestorIterator()).includeSelf());
-	case Axis.ATTRIBUTE:
-	    return(new AttributeIterator());
-	case Axis.DESCENDANT:
-	    iterator = new DescendantIterator();
-	    break;
-	case Axis.DESCENDANTORSELF:
-	    iterator = (new DescendantIterator()).includeSelf();
-	    break;
-	case Axis.FOLLOWING:
-	    iterator = new FollowingIterator();
-	    break;
-	case Axis.PRECEDING:
-	    iterator = new PrecedingIterator();
-	    break;
-	case Axis.FOLLOWINGSIBLING:
-	    iterator = new FollowingSiblingIterator();
-	    break;
-	case Axis.PRECEDINGSIBLING:
-	    iterator = new PrecedingSiblingIterator();
-	    break;
-	case Axis.NAMESPACE:
-	    return(new TypedAttributeIterator(getGeneralizedType("xmlns")));
-	default:
-	    BasisLibrary.runTimeError("Error: iterator for axis '" + 
-				      Axis.names[axis] + "' not implemented");
-	    System.exit(1);
-	}
-	return(iterator);
-    }
-
-    /**
-     * Similar to getAxisIterator, but this one returns an iterator
-     * containing nodes of a typed axis (ex.: child::foo)
-     */
-    public NodeIterator getTypedAxisIterator(int axis, int type) {
-	NodeIterator iterator = null;
-
-	/* This causes an error when using patterns for elements that
-	   do not exist in the DOM (translet types which do not correspond
-	   to a DOM type are mapped to the DOM.ELEMENT type).
-	*/
-
-	if (type == NO_TYPE) {
-	    return(EMPTYITERATOR);
-	}
-        else if (type == ELEMENT) {
-	    iterator = new FilterIterator(getAxisIterator(axis),
-					  getElementFilter());
-	}
-	else {
-	    switch (axis) {
-	    case Axis.SELF:
-		iterator = new TypedSingletonIterator(type);
-		break;
-	    case Axis.CHILD:
-		iterator = new TypedChildrenIterator(type);
-		break;
-	    case Axis.PARENT:
-		return(new ParentIterator().setNodeType(type));
-	    case Axis.ANCESTOR:
-		return(new TypedAncestorIterator(type));
-	    case Axis.ANCESTORORSELF:
-		return((new TypedAncestorIterator(type)).includeSelf());
-	    case Axis.ATTRIBUTE:
-		return(new TypedAttributeIterator(type));
-	    case Axis.DESCENDANT:
-		iterator = new TypedDescendantIterator(type);
-		break;
-	    case Axis.DESCENDANTORSELF:
-		iterator = (new TypedDescendantIterator(type)).includeSelf();
-		break;
-	    case Axis.FOLLOWING:
-		iterator = new TypedFollowingIterator(type);
-		break;
-	    case Axis.PRECEDING:
-		iterator = new TypedPrecedingIterator(type);
-		break;
-	    case Axis.FOLLOWINGSIBLING:
-		iterator = new TypedFollowingSiblingIterator(type);
-		break;
-	    case Axis.PRECEDINGSIBLING:
-		iterator = new TypedPrecedingSiblingIterator(type);
-		break;
-	    default:
-		BasisLibrary.runTimeError("Error: typed iterator for axis " + 
-					  Axis.names[axis]+"not implemented");
-	    }
-	}
-	    return(iterator);
-    }
-
-    /**
-     * Do not thing that this returns an iterator for the namespace axis.
-     * It returns an iterator with nodes that belong in a certain namespace,
-     * such as with <xsl:apply-templates select="blob/foo:*"/>
-     * The 'axis' specifies the axis for the base iterator from which the
-     * nodes are taken, while 'ns' specifies the namespace URI type.
-     */
-    public NodeIterator getNamespaceAxisIterator(int axis, int ns) {
-
-	NodeIterator iterator = null;
-
-	if (ns == NO_TYPE) {
-	    return(EMPTYITERATOR);
-	}
-	else {
-	    switch (axis) {
-	    case Axis.CHILD:
-		iterator = new NamespaceChildrenIterator(ns);
-		break;
-	    case Axis.ATTRIBUTE:
-		iterator = new NamespaceAttributeIterator(ns);
-		break;
-	    default:
-		BasisLibrary.runTimeError("Error: typed iterator for axis " + 
-					  Axis.names[axis]+"not implemented");
-	    }
-	}
-	return(iterator);
-    }
-
-    /**
-     * Returns an iterator with all descendants of a node that are of
-     * a given type.
-     */
-    public NodeIterator getTypedDescendantIterator(int type) {
-	NodeIterator iterator = new TypedDescendantIterator(type);
-	iterator.setStartNode(1);
-	return(iterator);
-    }
-
-    /**
-     * Returns the nth descendant of a node (1 = parent, 2 = gramps)
-     */
-    public NodeIterator getNthDescendant(int node, int n) {
-	return (new NthDescendantIterator(n));
-    }
-
-    /**
-     * Copy the contents of a text-node to an output handler
-     */
-    public void characters(final int textNode, TransletOutputHandler handler)
-	throws TransletException {
-	handler.characters(_text,
-			   _offsetOrChild[textNode],
-			   _lengthOrAttr[textNode]);
-    }
-
-    /**
-     * Copy a node-set to an output handler
-     */
-    public void copy(NodeIterator nodes, TransletOutputHandler handler)
-	throws TransletException {
-	int node;
-	while ((node = nodes.next()) != NULL) {
-	    copy(node, handler);
-	}
-    }
-
-    /**
-     * Copy the whole tree to an output handler
-     */
-    public void copy(TransletOutputHandler handler) throws TransletException {
-	copy(ROOTNODE, handler);
-    }
-
-    /** 
-     * Performs a deep copy (ref. XSLs copy-of())
-     *
-     * TODO: Copy namespace declarations. Can't be done until we
-     *       add namespace nodes and keep track of NS prefixes
-     * TODO: Copy comment nodes
-     */
-    public void copy(final int node, TransletOutputHandler handler)
-	throws TransletException {
-
-	final int type = _type[node];
-
-	switch(type) {
-	case ROOT:
-	    for (int c=_offsetOrChild[node]; c!=NULL; c=_nextSibling[c])
-		copy(c, handler);
-	    break;
-	case PROCESSING_INSTRUCTION:
-	    copyPI(node, handler);
-	    break;
-	case COMMENT:
-	case TEXT:
-	    handler.characters(_text,
-			       _offsetOrChild[node],
-			       _lengthOrAttr[node]);
-	    break;
-	case ATTRIBUTE:
-	    shallowCopy(node, handler);
-	    break;
-	default:
-	    if (isElement(node)) {
-		// Start element definition
-		final String name = copyElement(node, type, handler);
-		// Copy element attribute
-		for (int a=_lengthOrAttr[node]; a!=NULL; a=_nextSibling[a])
-		    handler.attribute(getNodeName(a), makeStringValue(a));
-		// Copy element children
-		for (int c=_offsetOrChild[node]; c!=NULL; c=_nextSibling[c])
-		    copy(c, handler);
-		// Close element definition
-		handler.endElement(name);
-	    }
-	    // Shallow copy of attribute to output handler
-	    else {
-		handler.attribute(getNodeName(node), makeStringValue(node));
-	    }
-	    break;
-	}
-    }
-
-    /**
-     * Copies a processing instruction node to an output handler
-     */ 
-    private void copyPI(final int node, TransletOutputHandler handler)
-	throws TransletException {
-	final char[] text = _text;
-	final int start = _offsetOrChild[node];
-	final int length = _lengthOrAttr[node];
-
-	// Target and Value are separated by a whitespace - find it!
-	int i = start;
-	while (text[i] != ' ') i++;
-
-	final int len = i - start;
-	final String target = new String(text, start, len);
-	final String value  = new String(text, i + 1, length - len);
-
-	handler.processingInstruction(target, value);
-    }
-
-    /**
-     * Performs a shallow copy (ref. XSLs copy())
-     *
-     * TODO: Copy namespace declarations. Can't be done until we
-     *       add namespace nodes and keep track of NS prefixes
-     * TODO: Copy comment nodes
-     */
-    public String shallowCopy(final int node, TransletOutputHandler handler)
-	throws TransletException {
-
-	final int type = _type[node];
-
-	switch(type) {
-	case ROOT: // do nothing
-	    return EMPTYSTRING;
-	case TEXT:
-	    handler.characters(_text,
-			       _offsetOrChild[node],
-			       _lengthOrAttr[node]);
-	    return null;
-	case PROCESSING_INSTRUCTION:
-	    copyPI(node, handler);
-	    return null;
-	case COMMENT:
-	    return null;
-	default:
-	    if (isElement(node)) {
-		return(copyElement(node, type, handler));
-	    }
-	    else {
-		String name = getNodeName(node);
-		final String value = makeStringValue(node);
-		handler.attribute(name, value);
-		return null;
-	    }
-	}
-    }
-
-    private String copyElement(int node, int type,
-			       TransletOutputHandler handler)
-	throws TransletException {
-
-	type = type - NTYPES;
-	String name = _namesArray[type];
-	final int pi = _prefix[node];
-	if (pi > 0) {
-	    final String prefix = _prefixArray[pi];
-	    final String uri = _uriArray[_namespace[type]];
-	    final String local = getLocalName(node);
-	    if (prefix.equals(EMPTYSTRING))
-		name = local;
-	    else
-		name = prefix+':'+local;
-	    handler.startElement(name);
-	    handler.namespace(prefix, uri);
-	}
-	else {
-	    handler.startElement(name);
-	}
-	return name;
-    }
-
-    /**
-     * Returns the string value of the entire tree
-     */
-    public String getStringValue() {
-	return getElementValue(ROOTNODE);
-    }
-
-    /**
-     * Returns the string value of any element
-     */
-    public String getElementValue(final int element) {
-	// optimization: only create StringBuffer if > 1 child
-	final int child = _offsetOrChild[element];
-	return child != NULL
-	    ? (_type[child] == TEXT && _nextSibling[child] == NULL
-	       ? makeStringValue(child)
-	       : stringValueAux(new StringBuffer(), element).toString())
-	    : EMPTYSTRING;
-    }
-
-    /**
-     * Helper to getElementValue() above
-     */
-    private StringBuffer stringValueAux(StringBuffer buffer, final int element) {
-	for (int child = _offsetOrChild[element];
-	     child != NULL;
-	     child = _nextSibling[child]) {
-	    switch (_type[child]) {
-	    case TEXT:
-	    case COMMENT:
-		buffer.append(_text,
-			      _offsetOrChild[child],
-			      _lengthOrAttr[child]);
-		break;
-	    case PROCESSING_INSTRUCTION:
-		break;
-		// !!! at the moment default can only be an element???
-	    default:
-		stringValueAux(buffer, child);
-	    }
-	}
-	return buffer;
-    }
-
-    /**
-     * Returns a node' defined language for a node (if any)
-     */
-    public String getLanguage(int node) {
-	final Integer langType = (Integer)_types.get("xml:@lang");
-	if (langType != null) {
-	    final int type = langType.intValue();
-	    while (node != DOM.NULL) {
-		int attr = _lengthOrAttr[node];
-		while (attr != DOM.NULL) {
-		    if (_type[attr] == type)
-			return(getNodeValue(attr));
-		    attr = _nextSibling[attr];
-		}
-		node = getParent(node);
-	    }
-	}
-	return(null);
-    }
-
-    /**
-     * Returns an instance of the DOMBuilder inner class
-     * This class will consume the input document through a SAX2
-     * interface and populate the tree.
-     */
-    public DOMBuilder getBuilder() {
-	return new DOMBuilderImpl();
-    }
-
-    /**
-     * Returns a DOMBuilder class wrapped in a SAX adapter.
-     * I am not sure if we need this one anymore now that the
-     * DOM builder's interface is pure SAX2 (must investigate)
-     */
-    public TransletOutputHandler getOutputDomBuilder() {
-	return new SAXAdapter(getBuilder());
-    }
-
-    /**
-     * Returns true if a character is an XML whitespace character.
-     * Order of tests is important for performance ([space] first).
-     */
-    private static final boolean isWhitespaceChar(char c) {
-	return c == 0x20 || c == 0x0A || c == 0x0D || c == 0x09;
-    }
-
-
-    /****************************************************************/
-    /*               DOM builder class definition                   */
-    /****************************************************************/
-    private final class DOMBuilderImpl implements DOMBuilder {
-
-	private final static int ATTR_ARRAY_SIZE = 32;
-	private final static int REUSABLE_TEXT_SIZE = 32;
-	private Hashtable _shortTexts           = null;
-
-	private Hashtable _names                = null;
-	private int       _nextNameCode         = NTYPES;
-	private int[]     _parentStack          = new int[64];
-	private int[]     _previousSiblingStack = new int[64];
-	private int       _sp;
-	private int       _baseOffset           = 0;
-	private int       _currentOffset        = 0;
-	private int       _currentNode          = 0;
-
-	// Temporary structures for attribute nodes
-	private int       _currentAttributeNode = 0;
-	private short[]   _type2        = new short[ATTR_ARRAY_SIZE];
-	private short[]   _prefix2      = new short[ATTR_ARRAY_SIZE];
-	private int[]     _parent2      = new int[ATTR_ARRAY_SIZE];
-	private int[]     _nextSibling2 = new int[ATTR_ARRAY_SIZE];
-	private int[]     _offset       = new int[ATTR_ARRAY_SIZE];
-	private int[]     _length       = new int[ATTR_ARRAY_SIZE];
-
-	// Namespace prefix-to-uri mapping stuff
-	private Hashtable _nsPrefixes   = new Hashtable();
-	private int       _uriCount     = 0;
-	private int       _prefixCount  = 0;
-	
-	// Stack used to keep track of what whitespace text nodes are protected
-	// by xml:space="preserve" attributes and which nodes that are not.
-	private int[]   _xmlSpaceStack = new int[64];
-	private int     _idx = 1;
-	private boolean _preserve = false;
-
-	private static final String XML_STRING = "xml:";
-	private static final String XMLSPACE_STRING = "xml:space";
-	private static final String PRESERVE_STRING = "preserve";
-
-	/**
-	 * Default constructor for the DOMBuiler class
-	 */
-	public DOMBuilderImpl() {
-	    _xmlSpaceStack[0] = DOM.ROOTNODE;
-	}
-
-	/**
-	 * Returns the namespace URI that a prefix currentl maps to
-	 */
-	private String getNamespaceURI(String prefix) {
-	    // Get the stack associated with this namespace prefix
-	    final Stack stack = (Stack)_nsPrefixes.get(prefix);
-	    if ((stack != null) && (!stack.empty())) {
-		return((String)stack.peek());
-	    }
-	    else
-		return(EMPTYSTRING);
-	}
-
-	/**
-	 * Call this when an xml:space attribute is encountered to
-	 * define the whitespace strip/preserve settings.
-	 */
-	private void xmlSpaceDefine(String val, final int node) {
-	    final boolean setting = val.equals(PRESERVE_STRING);
-	    if (setting != _preserve) {
-		_xmlSpaceStack[_idx++] = node;
-		_preserve = setting;
-	    }
-	}
-
-	/**
-	 * Call this from endElement() to revert strip/preserve setting
-	 * to whatever it was before the corresponding startElement()
-	 */
-	private void xmlSpaceRevert(final int node) {
-	    if (node == _xmlSpaceStack[_idx - 1]) {
-		_idx--;
-		_preserve = !_preserve;
-	    }
-	}
-
-	/**
-	 * Returns the next available node. Increases the various arrays
-	 * that constitute the node if necessary.
-	 */
-	private int nextNode() {
-	    final int index = _currentNode++;
-	    if (index == _type.length) {
-		resizeArrays(_type.length * 2, index);
-	    }
-	    return index;
-	}
-
-	/**
-	 * Returns the next available attribute node. Increases the
-	 * various arrays that constitute the attribute if necessary
-	 */
-	private int nextAttributeNode() {
-	    final int index = _currentAttributeNode++;
-	    if (index == _type2.length) {
-		resizeArrays2(_type2.length * 2, index);
-	    }
-	    return index;
-	}
-
-	/**
-	 * Resize the character array that holds the contents of
-	 * all text nodes, comments and attribute values
-	 */
-	private void resizeTextArray(final int newSize) {
-	    final char[] newText = new char[newSize];
-	    System.arraycopy(_text, 0, newText, 0, _currentOffset);
-	    _text = newText;
-	}
-	
-	/**
-	 * Links together the children of a node. Child nodes are linked
-	 * through the _nextSibling array
-	 */
-	private void linkChildren(final int node) {
-	    _parent[node] = _parentStack[_sp];
-	    if (_previousSiblingStack[_sp] != 0) { // current not first child
-		_nextSibling[_previousSiblingStack[_sp]] = node;
-	    }
-	    else {
-		_offsetOrChild[_parentStack[_sp]] = node;
-	    }
-	    _previousSiblingStack[_sp] = node;
-	}
-
-	/**
-	 * Generate the internal type for an element's expanded QName
-	 */
-	private short makeElementNode(String uri, String localname)
-	    throws SAXException {
-	    
-	    final String name;
-	    if (uri != EMPTYSTRING)
-		name = uri + ':' + localname;
-	    else
-		name = localname;
-
-	    // Stuff the QName into the names vector & hashtable
-	    Integer obj = (Integer)_names.get(name);
-	    if (obj == null) {
-		_names.put(name, obj = new Integer(_nextNameCode++));
-	    }
-	    return (short)obj.intValue();
-	}
-
-	/**
-	 * Generate the internal type for an element's expanded QName
-	 */
-	private short makeElementNode(String name, int col)
-	    throws SAXException {
-	    // Expand prefix:localname to full QName
-	    if (col > -1) {
-		final String uri = getNamespaceURI(name.substring(0, col));
-		name = uri + name.substring(col);
-	    }
-	    // Append default namespace with the name has no prefix
-	    else {
-		final String uri = getNamespaceURI(EMPTYSTRING);
-		if (!uri.equals(EMPTYSTRING)) name = uri + ':' + name;
-	    }
-
-	    // Stuff the QName into the names vector & hashtable
-	    Integer obj = (Integer)_names.get(name);
-	    if (obj == null) {
-		_names.put(name, obj = new Integer(_nextNameCode++));
-	    }
-	    return (short)obj.intValue();
-	}
-
-	/**
-	 *
-	 */
-	private short registerPrefix(String prefix) {
-	    Stack stack = (Stack)_nsPrefixes.get(prefix);
-	    if (stack != null) {
-		Integer obj = (Integer)stack.elementAt(0);
-		return (short)obj.intValue();
-	    }
-	    return 0;
-	}
-
-	/*
-	 * This method will check if the current text node contains text that
-	 * is already in the text array. If the text is found in the array
-	 * then this method returns the offset of the previous instance of the
-	 * string. Otherwise the text is inserted in the array, and the
-	 * offset of the new instance is inserted.
-	 * Updates the globals _baseOffset and _currentOffset
-	 */
-	private int maybeReuseText(final int length) {
-	    final int base = _baseOffset;
-	    if (length <= REUSABLE_TEXT_SIZE) {
-		// Use a char array instead of string for performance benefit
-		char[] chars = new char[length];
-		System.arraycopy(_text, base, chars, 0, length);
-		final Integer offsetObj = (Integer)_shortTexts.get(chars);
-
-		if (offsetObj != null) {
-		    _currentOffset = base;       // step back current
-		    return offsetObj.intValue(); // reuse previous string
-		}
-		else {
-		    _shortTexts.put(chars, new Integer(base));
-		}
-	    }
-	    _baseOffset = _currentOffset; // advance base to current
-	    return base;
-	}
-
-	/**
-	 * Links a text reference (an occurance of a sequence of characters
-	 * in the _text[] array) to a specific node index.
-	 */
-	private void storeTextRef(final int node) {
-	    final int length = _currentOffset - _baseOffset;
-	    _offsetOrChild[node] = maybeReuseText(length);
-	    _lengthOrAttr[node]  = length;
-	}
-	
-	/**
-	 * Creates a text-node and checks if it is a whitespace node.
-	 */
-	private int makeTextNode(boolean isWhitespace) {
-	    if (_currentOffset > _baseOffset) {
-		final int node = nextNode();
-		final int limit = _currentOffset;
-		// Tag as whitespace node if the parser tells us that it is...
-		if (isWhitespace) {
-		    _whitespace.setBit(node);
-		}
-		// ...otherwise we check if this is a whitespace node, unless
-		// the node is protected by an xml:space="preserve" attribute.
-		else if (!_preserve) {
-		    int i = _baseOffset;
-		    while (isWhitespaceChar(_text[i++]) && i < limit) ;
-		    if ((i == limit) && isWhitespaceChar(_text[i-1])) 
-			_whitespace.setBit(node);
-		}
-
-		_type[node] = TEXT;
-		linkChildren(node);
-		storeTextRef(node);
-		return node;
-	    }
-	    return -1;
-	}
-
-	/**
-	 * Links an attribute value (an occurance of a sequence of characters
-	 * in the _text[] array) to a specific attribute node index.
-	 */
-	private void storeAttrValRef(final int attributeNode) {
-	    final int length = _currentOffset - _baseOffset;
-	    _offset[attributeNode] = maybeReuseText(length);
-	    _length[attributeNode] = length;
-	}
-
-	/**
-	 * Creates an attribute node
-	 */
-	private int makeAttributeNode(int parent, Attributes attList, int i)
-	    throws SAXException {
-
-    	    final int node = nextAttributeNode();
-
-	    final String qname = attList.getQName(i);
-	    final String localname = attList.getLocalName(i);
-	    final String value = attList.getValue(i);
-	    StringBuffer namebuf = new StringBuffer(EMPTYSTRING);
-	    
-	    // Create the internal attribute node name (uri+@+localname)
-	    if (qname.startsWith(XML_STRING)) {
-		if (qname.startsWith(XMLSPACE_STRING))
-		    xmlSpaceDefine(attList.getValue(i), parent);
-		namebuf.append("xml:");
-	    }
-	    else {
-		final String uri = attList.getURI(i);
-		if ((uri != null) && (!uri.equals(EMPTYSTRING))) {
-		    namebuf.append(uri);
-		    namebuf.append(':');
-		}
-	    }
-	    namebuf.append('@');
-	    namebuf.append(localname);
-
-	    String name = namebuf.toString();
-	    
-	    // Get the index of the attribute node name (create new if non-ex).
-	    Integer obj = (Integer)_names.get(name);
-	    if (obj == null) {
-		_type2[node] = (short)_nextNameCode;
-		_names.put(name, obj = new Integer(_nextNameCode++));
-	    }
-	    else {
-		_type2[node] = (short)obj.intValue();
-	    }
-
-	    _parent2[node] = parent;
-
-	    final int col = qname.lastIndexOf(':');
-	    if (col > 0) {
-		_prefix2[node] = registerPrefix(qname.substring(0, col));
-	    }
-
-	    characters(attList.getValue(i));
-	    storeAttrValRef(node);
-	    return node;
-	}
-	
-	/****************************************************************/
-	/*               SAX Interface Starts Here                      */
-	/****************************************************************/
-
-	/**
-	 * SAX2: Receive notification of character data.
-	 */
-	public void characters(char[] ch, int start, int length) {
-	    if (_currentOffset + length > _text.length) {
-		resizeTextArray(_text.length * 2);
-	    }
-	    System.arraycopy(ch, start, _text, _currentOffset, length);
-	    _currentOffset += length;
-	}
-
-	/**
-	 * SAX2: Receive notification of the beginning of a document.
-	 */
-	public void startDocument() {
-	    _shortTexts     = new Hashtable();
-	    _names          = new Hashtable();
-	    _sp             = 0;
-	    _parentStack[0] = ROOTNODE;	// root
-	    _currentNode    = ROOTNODE + 1;
-	    _currentAttributeNode = 0;
-	    startPrefixMapping(EMPTYSTRING, EMPTYSTRING);
-	}
-
-	/**
-	 * SAX2: Receive notification of the end of a document.
-	 */
-	public void endDocument() {
-	    makeTextNode(false);
-
-	    _shortTexts = null;
-	    final int namesSize = _nextNameCode - NTYPES;
-
-	    // Fill the _namesArray[] array
-	    _namesArray = new String[namesSize];
-	    Enumeration keys = _names.keys();
-	    while (keys.hasMoreElements()) {
-		final String name = (String)keys.nextElement();
-		final Integer idx = (Integer)_names.get(name);
-		_namesArray[idx.intValue() - NTYPES] = name;
-	    }
-
-	    _names = null;
-	    _types = setupMapping(_namesArray);
-
-	    // trim arrays' sizes
-	    resizeTextArray(_currentOffset);
-	    
-	    _firstAttributeNode = _currentNode;
-	    shiftAttributes(_currentNode);
-	    resizeArrays(_currentNode + _currentAttributeNode, _currentNode);
-	    appendAttributes();
-	    _treeNodeLimit = _currentNode;
-
-	    // Fill the _namespace[] and _uriArray[] array
-	    _namespace = new short[namesSize];
-	    _uriArray = new String[_uriCount];
-	    for (int i = 0; i<namesSize; i++) {
-		final String qname = _namesArray[i];
-		final int col = _namesArray[i].lastIndexOf(':');
-		// Elements/attributes with the xml prefix are not in a NS
-		if ((!qname.startsWith(XML_STRING)) && (col > -1)) {
-		    final String uri = _namesArray[i].substring(0, col);
-		    final Integer idx = (Integer)_nsIndex.get(uri);
-		    _namespace[i] = idx.shortValue();
-		    _uriArray[idx.intValue()] = uri;
-		}
-	    }
-
-	    _prefixArray = new String[_prefixCount];
-	    Enumeration p = _nsPrefixes.keys();
-	    while (p.hasMoreElements()) {
-		final String prefix = (String)p.nextElement();
-		final Stack stack = (Stack)_nsPrefixes.get(prefix);
-		final Integer I = (Integer)stack.elementAt(0);
-		_prefixArray[I.shortValue()] = prefix;
-	    }
-	}
-	
-	/**
-	 * SAX2: Receive notification of the beginning of an element.
-	 */
-	public void startElement(String uri, String localName,
-				 String qname, Attributes attributes)
-	    throws SAXException {
-
-	    makeTextNode(false);
-
-	    // Get node index and setup parent/child references
-	    final int node = nextNode();
-	    linkChildren(node);
-	    _parentStack[++_sp] = node;
-
-	    final int count = attributes.getLength();
-
-	    // Process attribute list and create attr nodes
-	    if (count > 0) {
-		int attr = _currentAttributeNode + 1;
-		_lengthOrAttr[node] = attr;
-		for (int i = 0; i<count; i++) {
-		    attr = makeAttributeNode(node, attributes, i);
-		    _nextSibling2[attr] = attr + 1;
-		}
-		_nextSibling2[attr] = DOM.NULL;
-	    }
-	    // The element has no attributes
-	    else {
-		_lengthOrAttr[node] = DOM.NULL;
-	    }	    
-	    
-	    final int col = qname.lastIndexOf(':');
-
-	    // Assign an internal type to this element (may exist)
-	    if ((uri != null) && (localName.length() > 0))
-		_type[node] = makeElementNode(uri, localName);
-	    else
-		_type[node] = makeElementNode(qname, col);
-
-	    // Assign an internal type to the element's prefix (may exist)
-	    if (col > -1) {
-		_prefix[node] = registerPrefix(qname.substring(0, col));
-	    }
-	}
-	
-	/**
-	 * SAX2: Receive notification of the end of an element.
-	 */
-	public void endElement(String namespaceURI, String localName,
-			       String qname) {
-	    makeTextNode(false);
-	    // Revert to strip/preserve-space setting from before this element
-	    xmlSpaceRevert(_parentStack[_sp]);
-	    _previousSiblingStack[_sp--] = 0;
-	}
-
-	/**
-	 * SAX2: Receive notification of a processing instruction.
-	 */
-	public void processingInstruction(String target, String data)
-	    throws SAXException {
-
-	    makeTextNode(false);
-
-	    final int node = nextNode();
-	    _type[node] = PROCESSING_INSTRUCTION;
-	    linkChildren(node);
-	    characters(target);
-	    characters(" ");
-	    characters(data);
-	    storeTextRef(node);
-	}
-
-	/**
-	 * SAX2: Receive notification of ignorable whitespace in element
-	 * content. Similar to characters(char[], int, int).
-	 */
-	public void ignorableWhitespace(char[] ch, int start, int length) {
-	    if (_currentOffset + length > _text.length) {
-		resizeTextArray(_text.length * 2);
-	    }
-	    System.arraycopy(ch, start, _text, _currentOffset, length);
-	    _currentOffset += length;
-	    makeTextNode(true);
-	}
-
-	/**
-	 * SAX2: Receive an object for locating the origin of SAX document
-	 * events. 
-	 */
-	public void setDocumentLocator(Locator locator) {
-	    // Not handled
-	}
-
-	/**
-	 * SAX2: Receive notification of a skipped entity.
-	 */
-	public void skippedEntity(String name) {
-	    // Not handled 
-	}
-
-	/**
-	 * SAX2: Begin the scope of a prefix-URI Namespace mapping.
-	 */
-	public void startPrefixMapping(String prefix, String uri) {
-	    // Get the stack associated with this namespace prefix
-	    Stack stack = (Stack)_nsPrefixes.get(prefix);
-	    if (stack == null) {
-		stack = new Stack();
-		stack.push(new Integer(_prefixCount++));
-		_nsPrefixes.put(prefix, stack);
-	    }
-
-	    // Check if the URI already exists before pushing on stack
-	    if (_nsIndex.get(uri) == null) {
-		_nsIndex.put(uri, new Integer(_uriCount++));
-	    }
-	    stack.push(uri);
-	}
-
-	/**
-	 * SAX2: End the scope of a prefix-URI Namespace mapping.
-	 */
-	public void endPrefixMapping(String prefix) {
-	    // Get the stack associated with this namespace prefix
-	    final Stack stack = (Stack)_nsPrefixes.get(prefix);
-	    if ((stack != null) && (!stack.empty())) stack.pop();
-	}
-
-	/**
-	 * SAX2: Report an XML comment anywhere in the document.
-	 */
-	public void comment(char[] ch, int start, int length) {
-	    makeTextNode(false);
-	    if (_currentOffset + length > _text.length) {
-		resizeTextArray(_text.length * 2);
-	    }
-	    System.arraycopy(ch, start, _text, _currentOffset, length);
-	    _currentOffset += length;
-	    final int node = makeTextNode(false);
-	    _type[node] = COMMENT;
-	}
-
-	/**
-	 * SAX2: Ignored events
-	 */
-	public void startCDATA() {}
-	public void endCDATA() {}
-	public void startDTD(String name, String publicId, String systemId) {}
-	public void endDTD() {}
-	public void startEntity(String name) {}
-	public void endEntity(String name) {}
-
-	/**
-	 * Similar to the SAX2 method character(char[], int, int), but this
-	 * method takes a string as its only parameter. The effect is the same.
-	 */
-	private void characters(final String string) {
-	    final int length = string.length();
-	    if (_currentOffset + length > _text.length) {
-		resizeTextArray(_text.length * 2);
-	    }
-	    string.getChars(0, length, _text, _currentOffset);
-	    _currentOffset += length;
-	}
-
-	private void resizeArrays(final int newSize, final int length) {
-	    if (newSize > length) {
-		// Resize the '_type' array
-		final short[] newType = new short[newSize];
-		System.arraycopy(_type, 0, newType, 0, length);
-		_type = newType;
-
-		// Resize the '_parent' array
-		final int[] newParent = new int[newSize];
-		System.arraycopy(_parent, 0, newParent, 0, length);
-		_parent = newParent;
-
-		// Resize the '_nextSibling' array
-		final int[] newNextSibling = new int[newSize];
-		System.arraycopy(_nextSibling, 0, newNextSibling, 0, length);
-		_nextSibling = newNextSibling;
-
-		// Resize the '_offsetOrChild' array
-		final int[] newOffsetOrChild = new int[newSize];
-		System.arraycopy(_offsetOrChild, 0, newOffsetOrChild, 0,length);
-		_offsetOrChild = newOffsetOrChild;
-
-		// Resize the '_lengthOrAttr' array
-		final int[] newLengthOrAttr = new int[newSize];
-		System.arraycopy(_lengthOrAttr, 0, newLengthOrAttr, 0, length);
-		_lengthOrAttr = newLengthOrAttr;
-
-		// Resize the '_whitespace' array (a BitArray instance)
-		_whitespace.resize(newSize);
-
-		// Resize the '_prefix' array
-		final short[] newPrefix = new short[newSize];
-		System.arraycopy(_prefix, 0, newPrefix, 0, length);
-		_prefix = newPrefix;
-	    }
-	}
-	
-	private void resizeArrays2(final int newSize, final int length) {
-	    if (newSize > length) {
-		// Resize the '_type2' array (attribute types)
-		final short[] newType = new short[newSize];
-		System.arraycopy(_type2, 0, newType, 0, length);
-		_type2 = newType;
-
-		// Resize the '_parent2' array (attribute parent elements)
-		final int[] newParent = new int[newSize];
-		System.arraycopy(_parent2, 0, newParent, 0, length);
-		_parent2 = newParent;
-
-		// Resize the '_nextSibling2' array (you get the idea...)
-		final int[] newNextSibling = new int[newSize];
-		System.arraycopy(_nextSibling2, 0, newNextSibling, 0, length);
-		_nextSibling2 = newNextSibling;
-
-		// Resize the '_offset' array (attribute value start)
-		final int[] newOffset = new int[newSize];
-		System.arraycopy(_offset, 0, newOffset, 0, length);
-		_offset = newOffset;
-
-		// Resize the 'length' array (attribute value length)
-		final int[] newLength = new int[newSize];
-		System.arraycopy(_length, 0, newLength, 0, length);
-		_length = newLength;
-
-		// Resize the '_prefix2' array
-		final short[] newPrefix = new short[newSize];
-		System.arraycopy(_prefix2, 0, newPrefix, 0, length);
-		_prefix2 = newPrefix;
-	    }
-	}
-	
-	private void shiftAttributes(final int shift) {
-	    int i = 0;
-	    int next = 0;
-	    final int limit = _currentAttributeNode;
-	    int lastParent = -1;
-
-	    for (i = 0; i < limit; i++) {
-		if (_parent2[i] != lastParent) {
-		    lastParent = _parent2[i];
-		    _lengthOrAttr[lastParent] = i + shift;
-		}
-		next = _nextSibling2[i];
-		_nextSibling2[i] = next != 0 ? next + shift : 0;
-	    }
-	}
-	
-	private void appendAttributes() {
-	    final int len = _currentAttributeNode;
-	    if (len > 0) {
-		final int dst = _currentNode;
-		System.arraycopy(_type2,         0, _type,          dst, len);
-		System.arraycopy(_prefix2,       0, _prefix,        dst, len);
-		System.arraycopy(_parent2,       0, _parent,        dst, len);
-		System.arraycopy(_nextSibling2,  0, _nextSibling,   dst, len);
-		System.arraycopy(_offset,        0, _offsetOrChild, dst, len);
-		System.arraycopy(_length,        0, _lengthOrAttr,  dst, len);
-	    }
-	}
-
-    } // end of DOMBuilder
-}
diff --git a/src/org/apache/xalan/xsltc/dom/DTDMonitor.java b/src/org/apache/xalan/xsltc/dom/DTDMonitor.java
deleted file mode 100644
index 98bff1b..0000000
--- a/src/org/apache/xalan/xsltc/dom/DTDMonitor.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import java.util.Enumeration;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import org.apache.xalan.xsltc.runtime.Hashtable;
-
-final public class DTDMonitor implements DTDHandler, DeclHandler {
-
-    private final static String EMPTYSTRING = "";
-
-    // This is the name of the index used for ID attributes
-    private final static String ID_INDEX_NAME = "##id";
-    // Stores the names of the ID attributes for the various element types
-    private Hashtable _idAttributes = new Hashtable(); 
-    // Stores names of all unparsed entities
-    private Hashtable _unparsedEntities = new Hashtable();
-
-    // Name of DTD declaration handler property of an XMLReader object
-    private final static String DECL_HANDLER_PROP =
-	"http://xml.org/sax/properties/declaration-handler";
-
-    // Error message used when the SAX parser does not generate DTD events
-    private final static String NO_DTD_SUPPORT_STR =
-	"Your SAX parser does not handle DTD declarations";
-
-    /**
-     * Constructor - does nothing
-     */
-    public DTDMonitor() { }
-
-    /**
-     * Set an instance of this class as the DTD declaration handler for
-     * an XMLReader object (using the setProperty() method).
-     */
-    public void handleDTD(XMLReader reader) throws RuntimeException {
-	try {
-	    reader.setProperty(DECL_HANDLER_PROP, this);
-	    reader.setDTDHandler(this);
-	}
-	catch (SAXNotRecognizedException e) {
-	    throw(new RuntimeException(NO_DTD_SUPPORT_STR));
-	}
-	catch (SAXNotSupportedException e) {
-	    throw(new RuntimeException(NO_DTD_SUPPORT_STR));
-	}
-    }
-
-    /**
-     * SAX2: Receive notification of a notation declaration event.
-     */
-    public void notationDecl(String name, String publicId, String systemId)
-	throws SAXException { }
-
-    /**
-     * SAX2: Receive notification of an unparsed entity declaration event.
-     * The only method here that does not have to do with ID attributes.
-     * Passes names of unparsed entities to the translet.
-     */
-    public void unparsedEntityDecl(String name, String publicId,
-				   String systemId, String notation)
-	throws SAXException {
-	if (_unparsedEntities.containsKey(name) == false) {
-	    _unparsedEntities.put(name, systemId);
-	}
-    }
-
-    public Hashtable getUnparsedEntityURIs() {
-	return(_unparsedEntities);
-    }
-
-    /**
-     * Stores the association between the name of an ID attribute and the
-     * name of element that may contain it  Such an association would be
-     * represented in a DTD as in:
-     *              <!ATTLIST Person SSN ID #REQUIRED>
-     * where 'Person' would be elemtName and 'SSN' would be the ID attribute
-     */
-    public void attributeDecl(String element, String attribute, String type,
-			      String[] options, String defaultValue,
-			      boolean fixed, boolean required) {
-	_idAttributes.put(element, "@"+attribute);
-    }
-
-    /**
-     * SAX2 extension handler for DTD declaration events
-     * Report an attribute type declaration
-     */
-    public void attributeDecl(String element, String attribute, 
-			      String type, String defaultValue, String value) {
-	// Stores the association between the name of an ID attribute and the
-	// name of element that may contain it  Such an association would be
-	// represented in a DTD as in:
-	//           <!ATTLIST Person SSN ID #REQUIRED>
-	// where 'Person' would be elemtName and 'SSN' would be the ID attribute
-	_idAttributes.put(element, "@"+attribute);
-    }
-    
-    /**
-     * SAX2 extension handler for DTD declaration events
-     * Report an element type declaration.
-     */
-    public void elementDecl(String element, String model) { }
-                 
-    /**
-     * SAX2 extension handler for DTD declaration events
-     * Report a parsed external entity declaration.
-     */
-    public void externalEntityDecl(String name, String pid, String sid) { }
-                 
-
-    /**
-     * SAX2 extension handler for DTD declaration events
-     * Report an internal entity declaration.
-     */
-    public void internalEntityDecl(String name, String value) { }
-
-    /**
-     * Retrieves the name of the ID attribute associated with an element type
-     */
-    private final String getIdAttrName(String elemtName) {
-        final String idAttrName = (String)_idAttributes.get(elemtName);
-        return ((idAttrName == null) ? "" : idAttrName);
-    }
-
-    /**
-     * Leverages the Key Class to implement the XSLT id() function.
-     * buildIdIndex creates the index (##id) that Key Class uses. 
-     * The index contains the node index (int) and the id value (String).
-     */
-    public final void buildIdIndex(DOMImpl dom, int mask,
-				   AbstractTranslet translet) {
-
-	// These variables are put up here for speed
-	int node, attr, type, typeCache;
-
-	// Do nothing if there were no ID declarations in the DTD
-	if ((_idAttributes == null) || (_idAttributes.isEmpty())) return;
-
-	// Convert the _idAttribute Hashtable so that instead of containing
-	// an element name (String) mapping to an ID attribute name (String),
-	// it contains pairs of element types (Integer) mapping to ID attribute
-	// types (Integer). This eliminates string comparisons, and makes it
-	// possible for us to traverse the input DOM just once.
-	Enumeration elements = _idAttributes.keys();
-	if (elements.nextElement() instanceof String) {
-	    Hashtable newAttributes = new Hashtable();
-	    elements = _idAttributes.keys();
-	    while (elements.hasMoreElements()) {
-		String element = (String)elements.nextElement();
-		String attribute = (String)_idAttributes.get(element);
-		int elemType = dom.getGeneralizedType(element);
-		int attrType = dom.getGeneralizedType(attribute);
-		newAttributes.put(new Integer(elemType), new Integer(attrType));
-	    }
-	    _idAttributes = newAttributes;
-	}
-
-	// Get all nodes in the DOM
-	final NodeIterator iter = dom.getAxisIterator(Axis.DESCENDANT);
-	iter.setStartNode(DOM.ROOTNODE);
-
-	Integer E = new Integer(typeCache = 0);
-	Integer A = null;
-
-	while ((node = iter.next()) != NodeIterator.END) {
-	    // Get the node type of this node
-	    type = dom.getType(node);
-	    if (type != typeCache) {
-		E = new Integer(typeCache = type);
-		A = (Integer)_idAttributes.get(E);
-	    }
-
-	    // See if it has a defined ID attribute type
-	    if (A != null) {
-		// Only store the attribute value if the element has this attr.
-		if ((attr = dom.getAttributeNode(A.intValue(), node)) != 0) {
-		    final String value = dom.getNodeValue(attr);
-		    translet.buildKeyIndex(ID_INDEX_NAME, mask|node, value);
-		}
-	    }
-	}
-    }
-
-}
-
diff --git a/src/org/apache/xalan/xsltc/dom/DocumentCache.java b/src/org/apache/xalan/xsltc/dom/DocumentCache.java
deleted file mode 100644
index 4c3a426..0000000
--- a/src/org/apache/xalan/xsltc/dom/DocumentCache.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import java.io.PrintWriter;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.net.URLConnection;
-import java.net.MalformedURLException;
-import java.util.Hashtable;
-import java.util.Date;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.DOMCache;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-import org.apache.xalan.xsltc.dom.DTDMonitor;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import org.apache.xalan.xsltc.runtime.Constants;
-
-public final class DocumentCache implements DOMCache {
-
-    private int       _size;
-    private Hashtable _references;
-    private String[]  _URIs;
-    private int       _count;
-    private int       _current;
-    private SAXParser _parser;
-    private XMLReader _reader;
-
-    private static final int REFRESH_INTERVAL = 1000;
-
-    /*
-     * Inner class containing a DOMImpl object and DTD handler
-     */
-    public final class CachedDocument {
-	
-	// Statistics data
-	private long _firstReferenced;
-	private long _lastReferenced;
-	private long _accessCount;
-	private long _lastModified;
-	private long _lastChecked;
-	private long _buildTime;
-
-	// DOM and DTD handler references
-	private DOMImpl    _dom = null;
-	private DTDMonitor _dtdMonitor = null;
-	
-	/**
-	 * Constructor - load document and initialise statistics
-	 */
-	public CachedDocument(String uri) {
-	    // Initialise statistics variables
-	    final long stamp = System.currentTimeMillis();
-	    _firstReferenced = stamp;
-	    _lastReferenced  = stamp;
-	    _accessCount     = 0;
-	    loadDocument(uri);
-
-	    _buildTime = System.currentTimeMillis() - stamp;
-	}
-
-	/**
-	 * Loads the document and updates build-time (latency) statistics
-	 */
-	public void loadDocument(String uri) {
-
-	    _dom = new DOMImpl();
-	    _dtdMonitor = new DTDMonitor();
-
-	    try {
-		final long stamp = System.currentTimeMillis();
-
-		_reader.setContentHandler(_dom.getBuilder());
-		_dtdMonitor.handleDTD(_reader);
-		_reader.parse(uri);
-		_dom.setDocumentURI(uri);
-
-		// The build time can be used for statistics for a better
-		// priority algorithm (currently round robin).
-		final long thisTime = System.currentTimeMillis() - stamp;
-		if (_buildTime > 0)
-		    _buildTime = (_buildTime + thisTime) >>> 1;
-		else
-		    _buildTime = thisTime;
-	    }
-	    catch (Exception e) {
-		_dom = null;
-		_dtdMonitor = null;
-	    }
-	}
-
-	public DOMImpl getDocument()       { return(_dom); }
-
-	public DTDMonitor getDTDMonitor()  { return(_dtdMonitor); }
-
-	public long getFirstReferenced()   { return(_firstReferenced); }
-
-	public long getLastReferenced()    { return(_lastReferenced); }
-
-	public long getAccessCount()       { return(_accessCount); }
-
-	public void incAccessCount()       { _accessCount++; }
-
-	public long getLastModified()      { return(_lastModified); }
-
-	public void setLastModified(long t){ _lastModified = t; }
-
-	public long getLatency()           { return(_buildTime); }
-
-	public long getLastChecked()       { return(_lastChecked); }
-	
-	public void setLastChecked(long t) { _lastChecked = t; }
-
-	public long getEstimatedSize() {
-	    if (_dom != null)
-		return(_dom.getSize() << 5); // ???
-	    else
-		return(0);
-	}
-
-    }
-
-    /**
-     * DocumentCache constructor
-     */
-    public DocumentCache(int size) throws SAXException {
-	_count = 0;
-	_current = 0;
-	_size  = size;
-	_references = new Hashtable(_size+2);
-	_URIs = new String[_size];
-
-	try {
-	    // Create a SAX parser and get the XMLReader object it uses
-	    final SAXParserFactory factory = SAXParserFactory.newInstance();
-	    try {
-		factory.setFeature(Constants.NAMESPACE_FEATURE,true);
-	    }
-	    catch (Exception e) {
-		factory.setNamespaceAware(true);
-	    }
-	    _parser = factory.newSAXParser();
-	    _reader = _parser.getXMLReader();
-	}
-	catch (ParserConfigurationException e) {
-	    System.err.println("Your SAX parser is not configured correctly.");
-	    System.exit(-1);
-	}
-    }
-
-    /**
-     * Returns the time-stamp for a document's last update
-     */
-    private final long getLastModified(String uri) {
-	try {
-	    URL url = new URL(uri);
-	    URLConnection connection = url.openConnection();
-	    long timestamp = connection.getLastModified();
-	    // Check for a "file:" URI (courtesy of Brian Ewins)
-	    if (timestamp == 0){ // get 0 for local URI
-	        if ("file".equals(url.getProtocol())){
-	            File localfile = new File(URLDecoder.decode(url.getFile()));
-	            timestamp = localfile.lastModified();
-	        }
-	    }
-	    return(timestamp);
-	}
-	// Brutal handling of all exceptions
-	catch (Exception e) {
-	    return(System.currentTimeMillis());
-	}
-    }
-
-    /**
-     *
-     */
-    private CachedDocument lookupDocument(String uri) {
-	return((CachedDocument)_references.get(uri));
-    }
-
-    /**
-     *
-     */
-    private synchronized void insertDocument(String uri, CachedDocument doc) {
-	if (_count < _size) {
-	    // Insert out URI in circular buffer
-	    _URIs[_count++] = uri;
-	    _current = 0;
-	}
-	else {
-	    // Remove oldest URI from reference Hashtable
-	    _references.remove(_URIs[_current]);
-	    // Insert our URI in circular buffer
-	    _URIs[_current] = uri;
-	    if (++_current >= _size) _current = 0;
-	}
-	_references.put(uri, doc);
-    }
-
-    /**
-     *
-     */
-    private synchronized void replaceDocument(String uri, CachedDocument doc) {
-	CachedDocument old = (CachedDocument)_references.get(uri);
-	if (doc == null)
-	    insertDocument(uri, doc);
-	else
-	    _references.put(uri, doc);
-    }
-
-    /**
-     * Returns a document either by finding it in the cache or
-     * downloading it and putting it in the cache.
-     */
-    public final DOMImpl retrieveDocument(String uri, int mask, Translet trs) {
-	CachedDocument doc;
-
-	// Try to get the document from the cache first
-	if ((doc = lookupDocument(uri)) == null) {
-	    doc = new CachedDocument(uri);
-	    if (doc == null) return null; // better error handling needed!!!
-	    doc.setLastModified(getLastModified(uri));
-	    insertDocument(uri, doc);
-	}
-	// If the document is in the cache we must check if it is still valid
-	else {
-	    long now = System.currentTimeMillis();
-	    long chk = doc.getLastChecked();
-	    doc.setLastChecked(now);
-	    // Has the modification time for this file been checked lately?
-	    if (now > (chk + REFRESH_INTERVAL)) {
-		doc.setLastChecked(now);
-		long last = getLastModified(uri);
-		// Reload document if it has been modified since last download
-		if (last > doc.getLastModified()) {
-		    doc = new CachedDocument(uri);
-		    if (doc == null) return null;
-		    doc.setLastModified(getLastModified(uri));
-		    replaceDocument(uri, doc);
-		}
-	    }
-	    
-	}
-
-	// Get the references to the actual DOM and DTD handler
-	final DOMImpl    dom = doc.getDocument();
-	final DTDMonitor dtd = doc.getDTDMonitor();
-
-	// The dom reference may be null if the URL pointed to a
-	// non-existing document
-	if (dom == null) return null;
-
-	doc.incAccessCount(); // For statistics
-
-	final AbstractTranslet translet = (AbstractTranslet)trs;
-
-	// Set minimum needed size for key/id indices in the translet
-	translet.setIndexSize(dom.getSize());
-	// Create index for any ID attributes defined in the document DTD
-	dtd.buildIdIndex(dom, mask, translet);
-	// Pass all unparsed entities to the translet
-	translet.setUnparsedEntityURIs(dtd.getUnparsedEntityURIs());
-
-	return(doc.getDocument());
-    }
-
-    /**
-     * Outputs the cache statistics
-     */
-    public void getStatistics(PrintWriter out) {
-	out.println("<h2>DOM cache statistics</h2><center><table border=\"2\">"+
-		    "<tr><td><b>Document URI</b></td>"+
-		    "<td><center><b>Build time</b></center></td>"+
-		    "<td><center><b>Access count</b></center></td>"+
-		    "<td><center><b>Last accessed</b></center></td>"+
-		    "<td><center><b>Last modified</b></center></td></tr>");
-
-	for (int i=0; i<_count; i++) {
-	    CachedDocument doc = (CachedDocument)_references.get(_URIs[i]);
-	    out.print("<tr><td><a href=\""+_URIs[i]+"\">"+
-		      "<font size=-1>"+_URIs[i]+"</font></a></td>");
-	    out.print("<td><center>"+doc.getLatency()+"ms</center></td>");
-	    out.print("<td><center>"+doc.getAccessCount()+"</center></td>");
-	    out.print("<td><center>"+(new Date(doc.getLastReferenced()))+
-		      "</center></td>");
-	    out.print("<td><center>"+(new Date(doc.getLastModified()))+
-		      "</center></td>");
-	    out.println("</tr>");
-	}
-
-	out.println("</table></center>");
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java b/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
deleted file mode 100644
index 16a0a4a..0000000
--- a/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller 
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.TransletException;
-
-public final class DupFilterIterator extends NodeIteratorBase {
-
-    private final static int INIT_DATA_SIZE = 16;
-
-    private final NodeIterator _source; // the source iterator
-    private int[] _data = null;         // cached nodes from the source
-    private int _last = 0;              // the number of nodes in this iterator
-    private int _current = 0;
-
-    /**
-     * Creates a new duplicate filter iterator based on an existing iterator.
-     * This iterator should be used with union expressions and other complex
-     * iterator combinations (like 'get me the parents of all child node in
-     * the dom' sort of thing). The iterator is also used to cache node-sets
-     * returned by id() and key() iterators.
-     * @param source The iterator this iterator will get its nodes from
-     */
-    public DupFilterIterator(NodeIterator source) {
-	// Save a reference to the source iterator
-	_source = source;
-
-	// Cache contents of id() or key() index right away. Necessary for
-	// union expressions containing multiple calls to the same index, and
-	// correct as well since start-node is irrelevant for id()/key() exrp.
-	if (source instanceof KeyIndex) setStartNode(DOM.ROOTNODE);
-    }
-
-    /**
-     * Returns the next node in this iterator - excludes duplicates.
-     * @return The next node in this iterator
-     */
-    public int next() {
-	return _current < _last ? _data[_current++] : END;
-    }
-
-    /**
-     * Set the start node for this iterator
-     * @param node The start node
-     * @return A reference to this node iterator
-     */
-    public NodeIterator setStartNode(int node) {
-	// KeyIndex iterators are always relative to the root node, so there
-	// is never any point in re-reading the iterator (and we SHOULD NOT).
-	if ((_source instanceof KeyIndex) && (_data != null)) return this;
-
-	// If the _data array is populated, and the current start node is
-	// equal to the new start node, we know we already have what we need.
-	if ((_data == null) || (node != _startNode)) {
-
-	    _startNode = node;
-	    _last = 0;
-	    _source.setStartNode(node);
-	    _data = new int[INIT_DATA_SIZE];
-
-	    // Gather all nodes from the source iterator, eliminate dups
-	    while ((node = _source.next()) != END) {
-		if (_last == _data.length) {
-		    int[] newArray = new int[_data.length * 2];
-		    System.arraycopy(_data, 0, newArray, 0, _last);
-		    _data = newArray;
-		}
-		if (!isDup(node)) _data[_last++] = node;
-	    }
-	}
-
-	_current = 0;  // set to beginning 
-	return this;
-    }
-
-    /**
-     * Check if a node is already in the _data array. The nodes should be in
-     * document order or reverse document order, so we may be able to use
-     * binary search here.
-     */
-    private boolean isDup(int node) {
-	boolean retval = false;
-	int size = _data.length;
-	for (int i=0; i<size; i++) {
-	    if (_data[i] == node) {
-		retval = true; break;
-	    }
-	}
-	return retval;
-    }
-
-    /**
-     * Returns the current position of the iterator. The position is within the
-     * node set covered by this iterator, not within the DOM.
-     */
-    public int getPosition() {
-	return (_current);
-    }
-
-    /**
-     * Returns the position of the last node in this iterator. The integer
-     * returned is equivalent to the number of nodes in this iterator.
-     */
-    public int getLast() {
-	return _last;
-    }
-
-    /**
-     * Saves the position of this iterator - see gotoMark()
-     */
-    public void setMark() {
-	_source.setMark();
-	_markedNode = _current;
-    }
-
-    /**
-     * Restores the position of this iterator - see setMark()
-     */
-    public void gotoMark() {
-	_source.gotoMark();
-	_current = _markedNode;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/EmptyFilter.java b/src/org/apache/xalan/xsltc/dom/EmptyFilter.java
deleted file mode 100644
index 88511f2..0000000
--- a/src/org/apache/xalan/xsltc/dom/EmptyFilter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-public final class EmptyFilter implements Filter {
-    public boolean test(int node) {
-	return true;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/Filter.java b/src/org/apache/xalan/xsltc/dom/Filter.java
deleted file mode 100644
index 4954e59..0000000
--- a/src/org/apache/xalan/xsltc/dom/Filter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-public interface Filter {
-    public boolean test(int node);
-}
diff --git a/src/org/apache/xalan/xsltc/dom/FilterIterator.java b/src/org/apache/xalan/xsltc/dom/FilterIterator.java
deleted file mode 100644
index e48f70c..0000000
--- a/src/org/apache/xalan/xsltc/dom/FilterIterator.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public final class FilterIterator extends NodeIteratorBase {
-    private NodeIterator _source;
-    private final Filter _filter;
-    private final boolean _isReverse;
-	
-    public FilterIterator(NodeIterator source, Filter filter) {
-	_source = source;
-	_filter = filter;
-	_isReverse = source.isReverse();
-    }
-
-    public boolean isReverse() {
-	return _isReverse;
-    }
-    
-    public NodeIterator cloneIterator() {
-	try {
-	    final FilterIterator clone = (FilterIterator)super.clone();
-	    clone._isRestartable = false;
-	    clone._source = _source.cloneIterator();
-	    return clone.reset();
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported."); 
-	    return null;
-	}
-    }
-    
-    public NodeIterator reset() {
-	_source.reset();
-	return resetPosition();
-    }
-    
-    public int next() {
-	int node;
-	while ((node = _source.next()) != END) {
-	    if (_filter.test(node)) {
-		return returnNode(node);
-	    }
-	}
-	return END;
-    }
-
-    public NodeIterator setStartNode(int node) {
-	if (_isRestartable) {
-	    // iterator is not a clone
-	    _source.setStartNode(_startNode = node); 
-	    return resetPosition();
-	}
-	return this;
-    }
-
-    public void setMark() {
-	_source.setMark();
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/FilteredStepIterator.java b/src/org/apache/xalan/xsltc/dom/FilteredStepIterator.java
deleted file mode 100644
index 13cc385..0000000
--- a/src/org/apache/xalan/xsltc/dom/FilteredStepIterator.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public final class FilteredStepIterator extends NodeIteratorBase {
-    private NodeIterator _source;
-    private NodeIterator _iterator;
-    private final Filter _filter;
-	
-    public FilteredStepIterator(NodeIterator source,
-				NodeIterator iterator,
-				Filter filter) {
-	_source = source;
-	_iterator = iterator;
-	_filter = filter;
-    }
-
-    public NodeIterator cloneIterator() {
-	try {
-	    final FilteredStepIterator clone =
-		(FilteredStepIterator)super.clone();
-	    clone._isRestartable = false;
-	    clone._source = _source.cloneIterator();
-	    clone._iterator = _iterator.cloneIterator()
-		.setStartNode(_source.next());
-	    return clone.resetPosition();
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported.");
-	    return null;
-	}
-    }
-    
-    public NodeIterator setStartNode(int node) {
-	if (_isRestartable) {
-	    // iterator is not a clone
-	    _source.setStartNode(_startNode = node);
-	    _iterator.setStartNode(_source.next());
-	    return resetPosition();
-	}
-	return this;
-    }
-
-    public NodeIterator reset() {
-	_source.reset();
-	_iterator.setStartNode(_source.next());
-	return resetPosition();
-    }
-    
-    public int next() {
-	for (int node;;) {
-	    while ((node = _iterator.next()) != END)
-		if (_filter.test(node)) {
-		    return returnNode(node);
-		}
-	    // local iterator ran out of nodes
-	    // try to get new start node from source
-	    if ((node = _source.next()) == END)
-		return END;
-	    else
-		_iterator.setStartNode(node);
-	}
-    }
-		
-    public void setMark() {
-	_source.setMark();
-	_iterator.setMark();
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-	_iterator.gotoMark();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/KeyIndex.java b/src/org/apache/xalan/xsltc/dom/KeyIndex.java
deleted file mode 100644
index 16ef33e..0000000
--- a/src/org/apache/xalan/xsltc/dom/KeyIndex.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import java.util.Vector;
-import java.util.StringTokenizer;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.Hashtable;
-
-public class KeyIndex implements NodeIterator {
-    private Hashtable _index = new Hashtable();
-    private BitArray  _nodes = null;
-    private int       _pos = 0;
-    private int       _mark = 0;
-    private int       _save = 0;
-    private int       _start = 0;
-    private int       _arraySize = 0;
-    private int       _node = -1;
-
-    /**
-     * Creates an index for a key defined by xsl:key
-     */
-    public KeyIndex(int size) {
-	_arraySize = size;
-    }
- 
-    /**
-     * Adds a node to the node list for a given value.
-     * The BitArray object makes sure duplicate nodes are eliminated.
-     */
-    public void add(Object value, int node) {
-	if ((_nodes = (BitArray)_index.get(value)) == null) {
-	    _nodes = new BitArray(_arraySize);
-	    _nodes.setMask(node & 0xff000000);
-	    _index.put(value,_nodes);
-	}
-	_nodes.setBit(node & 0x00ffffff);
-
-	/*
-	 * TODO: A bit array can currently only hold nodes from one DOM.
-	 * An index will therefore only return nodes from a single document.
-	 */
-    }
-
-    /**
-     * Merge this node set with nodes from another index
-     */
-    public void merge(KeyIndex other) {
-	// Only merge if other node set is not empty
-	if (other != null) {
-	    if (other._nodes != null) {
-		// Create new Vector for nodes if this set is empty
-		if (_nodes == null)
-		    _nodes = other._nodes;
-		else
-		    _nodes = _nodes.merge(other._nodes);
-	    }
-	}
-    }
-
-    /**
-     * This method must be called by the code generated by the id() function
-     * prior to returning the node iterator. The lookup code for key() and
-     * id() differ in the way the lookup value can be whitespace separated
-     * list of tokens for the id() function, but a single string for the
-     * key() function.
-     */
-    public void lookupId(Object value) {
-	if (value instanceof String) {
-	    final String string = (String)value;
-	    if (string.indexOf(' ') > -1) {
-		StringTokenizer values = new StringTokenizer(string);
-		while (values.hasMoreElements()) {
-		    BitArray nodes = (BitArray)_index.get(values.nextElement());
-		    if (nodes != null) {
-			if (_nodes == null)
-			    _nodes = nodes;
-			else
-			    _nodes = _nodes.merge(nodes);
-		    }
-		}
-		return;
-	    }
-	}
-	_nodes = (BitArray)_index.get(value);
-    }
-
-    /**
-     * This method must be called by the code generated by the key() function
-     * prior to returning the node iterator.
-     */
-    public void lookupKey(Object value) {
-	_nodes = (BitArray)_index.get(value);
-    }
-
-    /** 
-     * Callers should not call next() after it returns END.
-     */
-    public int next() {
-	if (_nodes == null) return(END);
-	if ((_node = _nodes.getNextBit(++_node)) == END) return(END);
-	_pos++;
-	return(_node | _nodes.getMask());
-    }
-
-    public int containsID(int node, Object value) { 
-	if (value instanceof String) {
-	    final String string = (String)value;
-	    if (string.indexOf(' ') > -1) {
-		StringTokenizer values = new StringTokenizer(string);
-		while (values.hasMoreElements()) {
-		    BitArray nodes = (BitArray)_index.get(values.nextElement());
-		    if ((nodes != null) && (nodes.getBit(node))) return(1);
-		}
-		return(0);
-	    }
-	}
-
-	BitArray nodes = (BitArray)_index.get(value);
-	if ((nodes != null) && (nodes.getBit(node))) return(1);
-	return(0);
-    }
-
-    public int containsKey(int node, Object value) { 
-	BitArray nodes = (BitArray)_index.get(value);
-	if ((nodes != null) && (nodes.getBit(node))) return(1);
-	return(0);
-    }
-
-    /**
-     * Resets the iterator to the last start node.
-     */
-    public NodeIterator reset() {
-	_pos = _start;
-	_node = _start - 1;
-	return(this);
-    }
-
-    /**
-     * Returns the number of elements in this iterator.
-     */
-    public int getLast() {
-	if (_nodes == null)
-	    return(0);
-	else
-	    return(_nodes.size()); // TODO: count actual nodes
-    }
-
-    /**
-     * Returns the position of the current node in the set.
-     */
-    public int getPosition() {
-	return(_pos);
-    }
-
-    /**
-     * Remembers the current node for the next call to gotoMark().
-     */
-    public void setMark() {
-	_mark = _pos;
-	_save = _node;
-    }
-
-    /**
-     * Restores the current node remembered by setMark().
-     */
-    public void gotoMark() {
-	_pos = _mark;
-	_node = _save;
-    }
-
-    /** 
-     * Set start to END should 'close' the iterator, 
-     * i.e. subsequent call to next() should return END.
-     */
-    public NodeIterator setStartNode(int start) {
-	if (start == END) {
-	    _nodes = null;
-	}
-	else if (_nodes != null) {
-	    // Node count starts with 1, while bit arrays count from 0. Must
-	    // subtract one from 'start' to initialize bit array correctly.
-	    _start = _nodes.getBitNumber(start-1); 
-	    _node = _start - 1;
-	}
-	return((NodeIterator)this);
-    }
-
-    /**
-     * True if this iterator has a reversed axis.
-     */
-    public boolean isReverse() {
-	return(false);
-    }
-
-    /**
-     * Returns a deep copy of this iterator.
-     */
-    public NodeIterator cloneIterator() {
-	return((NodeIterator)this);
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/LoadDocument.java b/src/org/apache/xalan/xsltc/dom/LoadDocument.java
deleted file mode 100644
index e68e2b9..0000000
--- a/src/org/apache/xalan/xsltc/dom/LoadDocument.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import java.io.File;
-import java.net.URL;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.DOMCache;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.TransletException;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-public final class LoadDocument {
-
-    private static final String NAMESPACE_FEATURE =
-	"http://xml.org/sax/features/namespaces";
-
-    /**
-     * Returns an iterator containing a set of nodes from an XML document
-     * loaded by the document() function.
-     */
-    public static NodeIterator document(String uri, String base,
-					AbstractTranslet translet, DOM dom)
-	throws Exception {
-
-	MultiDOM multiplexer = (MultiDOM)dom;
-
-	// Return an empty iterator if the URI is clearly invalid
-	// (to prevent some unncessary MalformedURL exceptions).
-	if ((uri == null) || (uri.equals("")))
-	    return(new SingletonIterator(DOM.NULL,true));
-
-	// Prepend URI base to URI (from context)
-	if ((base != null) && (!base.equals(""))) {
-	    if ((!uri.startsWith(base)) &&     // unless URI contains base
-		(!uri.startsWith("/")) &&      // unless URI is abs. file path
-		(!uri.startsWith("http:/")) && // unless URI is abs. http URL
-		(!uri.startsWith("file:/"))) { // unless URI is abs. file URL
-		uri = base+uri;
-	    }
-	}
-
-	// Check if this is a local file name
-	final File file = new File(uri);
-	if (file.exists())
-	    uri = "file:" + file.getAbsolutePath();
-	
-	// Check if this DOM has already been added to the multiplexer
-	int mask = multiplexer.getDocumentMask(uri);
-	if (mask != -1) {
-	    return new SingletonIterator(DOM.ROOTNODE | mask, true);
-	}
-
-	// Check if we can get the DOM from a DOMCache
-	DOMCache cache = translet.getDOMCache();
-	DOMImpl newdom;
-
-	mask = multiplexer.nextMask(); // peek
-
-	if (cache != null) {
-	    newdom = cache.retrieveDocument(uri, mask, translet);
-	}
-	else {
-	    // Parse the input document and construct DOM object
-	    // Create a SAX parser and get the XMLReader object it uses
-	    final SAXParserFactory factory = SAXParserFactory.newInstance();
-	    try {
-		factory.setFeature(NAMESPACE_FEATURE,true);
-	    }
-	    catch (Exception e) {
-		factory.setNamespaceAware(true);
-	    }
-	    final SAXParser parser = factory.newSAXParser();
-	    final XMLReader reader = parser.getXMLReader();
-
-	    // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
-	    newdom = new DOMImpl();
-	    reader.setContentHandler(newdom.getBuilder());
-	    // Create a DTD monitor and pass it to the XMLReader object
-	    DTDMonitor dtdMonitor = new DTDMonitor();
-	    dtdMonitor.handleDTD(reader);
-
-	    newdom.setDocumentURI(uri);
-	    reader.parse(uri);
-
-	    // Set size of key/id indices
-	    translet.setIndexSize(newdom.getSize());
-	    // Create index for any ID attributes defined in the document DTD
-	    dtdMonitor.buildIdIndex(newdom, mask, translet);
-	    // Pass any unparsed URI elements to the translet
-	    translet.setUnparsedEntityURIs(dtdMonitor.getUnparsedEntityURIs());
-	}
-
-	// Wrap the DOM object in a DOM adapter and add to multiplexer
-	final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
-	mask = multiplexer.addDOMAdapter(domAdapter);
-
-	// Create index for any key elements
-	translet.buildKeys((DOM)newdom, null, null, DOM.ROOTNODE | mask);
-
-	// Return a singleton iterator containing the root node
-	return new SingletonIterator(DOM.ROOTNODE | mask, true);
-    }
-
-    /**
-     * Interprets the arguments passed from the document() function (see
-     * org/apache/xalan/xsltc/compiler/DocumentCall.java) and returns an
-     * iterator containing the requested nodes. Builds a union-iterator if
-     * several documents are requested.
-     */
-    public static NodeIterator document(Object arg, String contextURI,
-					AbstractTranslet translet, DOM dom)
-	throws TransletException {
-	try {
-
-	    String baseURI = "";
-
-	    // Get the base of the conext URI (if any)
-	    if (contextURI != null) {
-		final int sep = contextURI.lastIndexOf('/') + 1;
-		baseURI = contextURI.substring(0, sep); // could be empty string
-	    }
-
-	    // If the argument is just a single string (an URI) we just return
-	    // the nodes from the one document this URI points to.
-	    if (arg instanceof String) {
-		return document((String)arg, baseURI, translet, dom);
-	    }
-	    // Otherwise we must create a union iterator, add the nodes from
-	    // all the DOMs to this iterator, and return the union in the end.
-	    else {
-		UnionIterator union = new UnionIterator(dom);
-		NodeIterator iterator = (NodeIterator)arg;
-		int node;
-
-		while ((node = iterator.next()) != DOM.NULL) {
-		    String uri = dom.getNodeValue(node);
-		    union.addIterator(document(uri, baseURI, translet, dom));
-		}
-		return(union);
-	    }
-	}
-	catch (Exception e) {
-	    throw new TransletException(e);
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/MatchingIterator.java b/src/org/apache/xalan/xsltc/dom/MatchingIterator.java
deleted file mode 100644
index d6bd6a1..0000000
--- a/src/org/apache/xalan/xsltc/dom/MatchingIterator.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public final class MatchingIterator extends NodeIteratorBase {
-    private NodeIterator _source;
-    private final int    _match;
-    private int _matchPos, _matchLast = -1;
-	
-    public MatchingIterator(int match, NodeIterator source) {
-	_source = source;
-	_match = match;
-    }
-
-    public NodeIterator cloneIterator() {
-	try {
-	    final MatchingIterator clone = (MatchingIterator)super.clone();
-	    clone._isRestartable = false;
-	    clone._source = _source.cloneIterator();
-	    return clone;
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported."); 
-	    return null;
-	}
-    }
-    
-    public NodeIterator setStartNode(int node) {
-	if (_isRestartable) {
-	    // iterator is not a clone
-	    _source.setStartNode(_startNode = node);
-
-	    // Calculate the position of the node in the set
-	    final int match = _match;
-	    int i = 1;
-	    while ((node = _source.next()) != END && node != match) {
-		++i;
-	    }
-	    _matchPos = i;
-	    _matchLast = -1;
-	}
-	return this;
-    }
-
-    public NodeIterator reset() {
-	return this;	// should not be called
-    }
-    
-    public int next() {
-	return _source.next();
-    }
-	
-    public int getLast() {
-	if (_matchLast == -1) {
-	    _source.reset();
-	    int i = 1, node;
-	    while ((node = _source.next()) != END) {
-		++i;
-	    }
-	    _matchLast = i - 1;
-	}
-	return _matchLast;
-    }
-
-    public int getPosition() {
-	return _matchPos;
-    }
-
-    public void setMark() {
-	_source.setMark();
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/MultiDOM.java b/src/org/apache/xalan/xsltc/dom/MultiDOM.java
deleted file mode 100644
index 6f91ed2..0000000
--- a/src/org/apache/xalan/xsltc/dom/MultiDOM.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.StripFilter;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.TransletOutputHandler;
-import org.apache.xalan.xsltc.TransletException;
-import org.apache.xalan.xsltc.runtime.Hashtable;
-
-public final class MultiDOM implements DOM {
-    private static final int NO_TYPE = DOM.FIRST_TYPE - 2;
-    private static final int INITIAL_SIZE = 4;
-    private static final int CLR = 0x00FFFFFF;
-    private static final int SET = 0xFF000000;
-    
-    private DOM[] _adapters;
-    private int _free;
-    private int _size;
-
-    private Hashtable _documents = new Hashtable();
-
-    private final class AxisIterator implements NodeIterator {
-	// constitutive data
-	private final int _axis;
-	private final int _type;
-	// implementation mechanism
-	private NodeIterator _source;
-	private int _mask;
-	
-	public AxisIterator(final int axis, final int type) {
-	    _axis = axis;
-	    _type = type;
-	}
-	
-	public int next() {
-	    if (_source == null) return(END);
-	    if (_mask == 0) return _source.next();
-	    final int node = _source.next();
-	    return node != END ? (node | _mask) : END;
-	}
-	
-	public NodeIterator setStartNode(final int node) {
-	    _mask = node & SET;
-	    // consider caching these
-	    if ((_type == NO_TYPE) || (_type == DOM.ELEMENT)) {
-		_source = _adapters[node>>>24].getAxisIterator(_axis);
-	    }
-	    else if (_axis == Axis.CHILD) {
-		_source = _adapters[node>>>24].getTypedChildren(_type);
-	    }
-	    else {
-		_source = _adapters[node>>>24].getTypedAxisIterator(_axis,_type);
-	    }
-	    _source.setStartNode(node & CLR);
-	    return this;
-	}
-
-	public NodeIterator reset() {
-	    if (_source != null) _source.reset();
-	    return this;
-	}
-    
-	public int getLast() {
-	    return _source.getLast();
-	}
-    
-	public int getPosition() {
-	    return _source.getPosition();
-	}
-    
-	public boolean isReverse() {
-	    if (_source == null)
-		return(false);
-	    else
-		return _source.isReverse();
-	}
-    
-	public void setMark() {
-	    _source.setMark();
-	}
-    
-	public void gotoMark() {
-	    _source.gotoMark();
-	}
-    
-	public NodeIterator cloneIterator() {
-	    //!! not entirely good
-	    //!! not clear when cloning is performed
-	    // and what's the desired state of the new clone
-	    final NodeIterator clone = new AxisIterator(_axis, _type);
-	    //return clone.reset();
-	    return clone;
-	}
-    } // end of AxisIterator
-
-
-    public MultiDOM(DOM main) {
-	_size = INITIAL_SIZE;
-	_free = 1;
-	_adapters = new DOM[INITIAL_SIZE];
-	_adapters[0] = main;
-    }
-
-    public int nextMask() {
-	return(_free << 24);
-    }
-
-    public void setupMapping(String[] names, String[] namespaces) {
-	// This method only has a function in DOM adapters
-    }
-
-    public int addDOMAdapter(DOM dom) {
-
-	// Add the DOM adapter to the array of DOMs
-	final int domNo = _free++;
-	if (domNo == _size) {
-	    final DOMAdapter[] newArray = new DOMAdapter[_size *= 2];
-	    System.arraycopy(_adapters, 0, newArray, 0, domNo);
-	    _adapters = newArray;
-	}
-	_adapters[domNo] = dom;
-
-	// Store reference to document (URI) in hashtable
-	String uri = dom.getDocumentURI(0);
-	_documents.put(uri,new Integer(domNo));
-	
-	return domNo << 24;
-    }
-    
-    public int getDocumentMask(String uri) {
-	Integer domIdx = (Integer)_documents.get(uri);
-	if (domIdx == null)
-	    return(-1);
-	else
-	    return((domIdx.intValue() << 24));
-    }
-
-    /** returns singleton iterator containg the document root */
-    public NodeIterator getIterator() {
-	// main source document @ 0
-	return _adapters[0].getIterator();
-    }
-    
-    public String getStringValue() {
-	return _adapters[0].getStringValue();
-    }
-    
-    public NodeIterator getChildren(final int node) {
-	return (node & SET) == 0
-	    ? _adapters[0].getChildren(node)
-	    : getAxisIterator(Axis.CHILD).setStartNode(node);
-    }
-    
-    public NodeIterator getTypedChildren(final int type) {
-	return new AxisIterator(Axis.CHILD, type);
-    }
-    
-    public NodeIterator getAxisIterator(final int axis) {
-	return new AxisIterator(axis, NO_TYPE);
-    }
-    
-    public NodeIterator getTypedAxisIterator(final int axis, final int type) {
-	return new AxisIterator(axis, type);
-    }
-
-    public NodeIterator getNthDescendant(int node, int n) {
-	return _adapters[node>>>24].getNthDescendant(node & CLR, n);
-    }
-
-    public NodeIterator getNodeValueIterator(NodeIterator iterator,
-					     String value, boolean op) {
-	return _adapters[0].getNodeValueIterator(iterator, value, op);
-    }
-
-    public NodeIterator getNamespaceAxisIterator(final int axis, final int ns) {
-	NodeIterator iterator = _adapters[0].getNamespaceAxisIterator(axis,ns);
-	return(iterator);	
-    }
-
-    public NodeIterator orderNodes(NodeIterator source, int node) {
-	return _adapters[node>>>24].orderNodes(source, node & CLR);
-    }
-
-    public int getType(final int node) {
-	return _adapters[node>>>24].getType(node & CLR);
-    }
-
-    public int getNamespaceType(final int node) {
-	return _adapters[node>>>24].getNamespaceType(node & CLR);
-    }
-    
-    public int getParent(final int node) {
-	return _adapters[node>>>24].getParent(node & CLR) | node&SET;
-    }
-    
-    public int getTypedPosition(NodeIterator iterator, int type, int node) {
-	return _adapters[node>>>24].getTypedPosition(iterator, type, node&CLR);
-    }
-
-    public int getTypedLast(NodeIterator iterator, int type, int node) {
-	return _adapters[node>>>24].getTypedLast(iterator, type, node&CLR);
-    }
-
-    public int getAttributeNode(final int type, final int el) {
-	return _adapters[el>>>24].getAttributeNode(type, el&CLR) | el&SET;
-    }
-    
-    public String getNodeName(final int node) {
-	return _adapters[node>>>24].getNodeName(node & CLR);
-    }
-
-    public String getNamespaceName(final int node) {
-	return _adapters[node>>>24].getNamespaceName(node & CLR);
-    }
-    
-    public String getNodeValue(final int node) {
-	return _adapters[node>>>24].getNodeValue(node & CLR);
-    }
-    
-    public void copy(final int node, TransletOutputHandler handler)
-	throws TransletException {
-	_adapters[node>>>24].copy(node & CLR, handler);
-    }
-    
-    public void copy(NodeIterator nodes, TransletOutputHandler handler)
-	throws TransletException {
-	int node;
-	while ((node = nodes.next()) != DOM.NULL) {
-	    _adapters[node>>>24].copy(node & CLR, handler);
-	}
-    }
-
-
-    public String shallowCopy(final int node, TransletOutputHandler handler)
-	throws TransletException {
-	return _adapters[node>>>24].shallowCopy(node & CLR, handler);
-    }
-    
-    public boolean lessThan(final int node1, final int node2) {
-	final int dom1 = node1>>>24;
-	final int dom2 = node2>>>24;
-	return dom1 == dom2
-	    ? _adapters[dom1].lessThan(node1 & CLR, node2 & CLR)
-	    : dom1 < dom2;
-    }
-    
-    public void characters(final int textNode, TransletOutputHandler handler)
-	throws TransletException {
-	    _adapters[textNode>>>24].characters(textNode & CLR, handler);
-    }
-
-    public void setFilter(StripFilter filter) {
-	for (int dom=0; dom<_free; dom++) {
-	    _adapters[dom].setFilter(filter);
-	}
-    }
-
-    public Node makeNode(int index) {
-	return _adapters[index>>>24].makeNode(index & CLR);
-    }
-
-    public Node makeNode(NodeIterator iter) {
-	// TODO: gather nodes from all DOMs ?
-	return _adapters[0].makeNode(iter);
-    }
-
-    public NodeList makeNodeList(int index) {
-	return _adapters[index>>>24].makeNodeList(index & CLR);
-    }
-
-    public NodeList makeNodeList(NodeIterator iter) {
-	// TODO: gather nodes from all DOMs ?
-	return _adapters[0].makeNodeList(iter);
-    }
-
-    public String getLanguage(int node) {
-	return _adapters[node>>>24].getLanguage(node & CLR);
-    }
-
-    public int getSize() {
-	int size = 0;
-	for (int i=0; i<_size; i++)
-	    size += _adapters[i].getSize();
-	return(size);
-    }
-
-    public String getDocumentURI(int node) {
-	return _adapters[node>>24].getDocumentURI(0);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/MultipleNodeCounter.java b/src/org/apache/xalan/xsltc/dom/MultipleNodeCounter.java
deleted file mode 100644
index ba69a2a..0000000
--- a/src/org/apache/xalan/xsltc/dom/MultipleNodeCounter.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.util.IntegerArray;
-
-public abstract class MultipleNodeCounter extends NodeCounter {
-    private NodeIterator _precSiblings = null;
-
-    public MultipleNodeCounter(Translet translet,
-			       DOM document, NodeIterator iterator) {
-	super(translet, document, iterator);
-    }
-	
-    public NodeCounter setStartNode(int node) {
-	_node = node;
-	_nodeType = _document.getType(node);
-	_precSiblings = _document.getAxisIterator(PRECEDINGSIBLING);
-	return this;
-    }
-
-    public String getCounter() {
-	if (_value != Integer.MIN_VALUE) {
-	    return formatNumbers(_value);
-	}
-
-	IntegerArray ancestors = new IntegerArray();
-
-	// Gather all ancestors that do not match from pattern
-	int next = _node;
-	ancestors.add(next);		// include self
-	while ((next = _document.getParent(next)) > END && 
-	       !matchesFrom(next)) {
-	    ancestors.add(next);
-	}
-
-	// Create an array of counters
-	final int nAncestors = ancestors.cardinality();
-	final int[] counters = new int[nAncestors]; 
-	for (int i = 0; i < nAncestors; i++) {
-	    counters[i] = Integer.MIN_VALUE;
-	}
-
-	// Increment array of counters according to semantics
-	for (int j = 0, i = nAncestors - 1; i >= 0 ; i--, j++) {
-	    final int counter = counters[j];
-	    final int ancestor = ancestors.at(i);
-
-	    if (matchesCount(ancestor)) {
-		_precSiblings.setStartNode(ancestor);
-		while ((next = _precSiblings.next()) != END) {
-		    if (matchesCount(next)) {
-			counters[j] = (counters[j] == Integer.MIN_VALUE) ? 1 
-			    : counters[j] + 1;		
-		    }
-		}
-		// Count the node itself
-		counters[j] = counters[j] == Integer.MIN_VALUE
-		    ? 1 
-		    : counters[j] + 1;	
-	    }
-	}
-	return formatNumbers(counters);
-    }
-
-    public static NodeCounter getDefaultNodeCounter(Translet translet,
-						    DOM document,
-						    NodeIterator iterator) {
-	return new DefaultMultipleNodeCounter(translet, document, iterator);
-    }
-
-    static class DefaultMultipleNodeCounter extends MultipleNodeCounter {
-	public DefaultMultipleNodeCounter(Translet translet,
-					  DOM document,
-					  NodeIterator iterator) {
-	    super(translet, document, iterator);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/NodeCounter.java b/src/org/apache/xalan/xsltc/dom/NodeCounter.java
deleted file mode 100644
index 392722b..0000000
--- a/src/org/apache/xalan/xsltc/dom/NodeCounter.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import java.util.Vector;
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.dom.Axis;
-
-public abstract class NodeCounter implements Axis {
-    public static final int END = DOM.NULL;
-
-    protected int _node = END;
-    protected int _nodeType = DOM.FIRST_TYPE - 1;
-    protected int _value = Integer.MIN_VALUE;
-
-    public final DOM          _document;
-    public final NodeIterator _iterator;
-    public final Translet     _translet;
-
-    protected String _format;
-    protected String _lang;
-    protected String _letterValue;
-    protected String _groupSep;
-    protected int    _groupSize;
-
-    private static String[] Thousands = 
-        {"", "m", "mm", "mmm" };
-    private static String[] Hundreds = 
-	{"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"};
-    private static String[] Tens = 
-	{"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"};
-    private static String[] Ones = 
-	{"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"};
-
-    protected NodeCounter(Translet translet,
-			  DOM document, NodeIterator iterator) {
-	_translet = translet;
-	_document = document;
-	_iterator = iterator;
-    }
-
-    /** 
-     * Set the start node for this counter. The same <tt>NodeCounter</tt>
-     * object can be used multiple times by resetting the starting node.
-     */
-    abstract public NodeCounter setStartNode(int node);
-
-    /** 
-     * If the user specified a value attribute, use this instead of 
-     * counting nodes.
-     */
-    public NodeCounter setValue(int value) {
-	_value = value;
-	return this;
-    }
-
-    /**
-     * Sets formatting fields before calling formatNumbers().
-     */
-    protected void setFormatting(String format, String lang, String letterValue,
-				 String groupSep, String groupSize) {
-	_lang = lang;
-	_format = format;
-	_groupSep = groupSep;
-	_letterValue = letterValue;
-
-	try {
-	    _groupSize = Integer.parseInt(groupSize);
-	}
-	catch (NumberFormatException e) {
-	    _groupSize = 0;
-	}
-    }
-
-    /**
-     * Sets formatting fields to their default values.
-     */
-    public NodeCounter setDefaultFormatting() {
-	setFormatting("1", "en", "alphabetic", null, null);
-	return this;
-    }
-
-    /**
-     * Returns the position of <tt>node</tt> according to the level and 
-     * the from and count patterns.
-     */
-    abstract public String getCounter();
-
-    /**
-     * Returns the position of <tt>node</tt> according to the level and 
-     * the from and count patterns. This position is converted into a
-     * string based on the arguments passed.
-     */
-    public String getCounter(String format, String lang, String letterValue,
-			     String groupSep, String groupSize) {
-	setFormatting(format, lang, letterValue, groupSep, groupSize);
-	return getCounter();
-    }
-
-    /**
-     * Returns true if <tt>node</tt> matches the count pattern. By
-     * default a node matches the count patterns if it is of the 
-     * same type as the starting node.
-     */
-    public boolean matchesCount(int node) {
-	return _nodeType == _document.getType(node);
-    }
-
-    /**
-     * Returns true if <tt>node</tt> matches the from pattern. By default, 
-     * no node matches the from pattern.
-     */
-    public boolean matchesFrom(int node) {
-	return false;
-    }
-
-    /**
-     * Format a single value according to the format parameters.
-     */
-    protected String formatNumbers(int value) {
-	return formatNumbers(new int[] { value });
-    }
-
-    /**
-     * Format a sequence of values according to the format paramaters
-     * set by calling setFormatting().
-     */
-    protected String formatNumbers(int[] values) {
-	final int nValues = values.length;
-	final int length = _format.length();
-        final Vector separToks = new Vector();
-        final Vector formatToks = new Vector();
-
-        boolean isFirst = true;
-	boolean separFirst = true;
-	boolean isEmpty = true;
-
-	for (int t=0; t<nValues; t++)
-	    if (values[t] != Integer.MIN_VALUE) isEmpty = false;
-	if (isEmpty) return("");
-
-	/* 
-	 * Tokenize the format string into alphanumeric and non-alphanumeric
-	 * tokens as described in M. Kay page 241.
-	 */
-	for (int j = 0, i = 0; i < length;) {
-            char c = _format.charAt(i);
-            for (j = i; Character.isLetterOrDigit(c);) {
-                if (++i == length) break;
-		c = _format.charAt(i);
-            }
-            if (i > j) {
-                if (isFirst) {
-                    separToks.addElement(".");
-                    isFirst = separFirst = false;
-                }
-                formatToks.addElement(_format.substring(j, i));
-            }
-
-            if (i == length) break;
-
-            c = _format.charAt(i);
-            for (j = i; !Character.isLetterOrDigit(c);) {
-                if (++i == length) break;
-                c = _format.charAt(i);
-                isFirst = false;
-            }
-            if (i > j) {
-                separToks.addElement(_format.substring(j, i));
-            }
-        }
-  
-	/* 
-	 * Format the output string using the values array and the tokens
-	 * just parsed.
-	 */
-	isFirst = true;
-	int t = 0, n = 0;
-	final StringBuffer buffer = new StringBuffer();
-
-	if (separFirst) {
-	    buffer.append((String) separToks.elementAt(t));
-	}
-
-	while (n < nValues) {
-	    final int value = values[n];
-	    if (value != Integer.MIN_VALUE) {
-		if (!isFirst) {
-		    buffer.append((String) separToks.elementAt(t));
-		}
-		formatValue(value, (String) formatToks.elementAt(t++), buffer);
-		if (t == formatToks.size()) {
-		    t--;
-		}
-		isFirst = false;
-	    }
-	    n++;
-	}
-
-	final int nSepars = separToks.size();
-	if (nSepars > formatToks.size()) {
-	    buffer.append((String) separToks.elementAt(nSepars - 1));
-	}
-	return buffer.toString();
-    }
-
-    /**
-     * Format a single value based on the appropriate formatting token. 
-     * This method is based on saxon (Michael Kay) and only implements
-     * lang="en".
-     */
-    private void formatValue(int value, String format, StringBuffer buffer) {
-        char c = format.charAt(0);
-        if (Character.isDigit(c)) {
-            char zero = (char)(c - Character.getNumericValue(c));
-
-            StringBuffer temp = buffer;
-            if (_groupSize > 0) {
-                temp = new StringBuffer();
-            }
-            String s = "";
-            int n = value;
-            while (n > 0) {
-                s = (char) ((int) zero + (n % 10)) + s;
-                n = n / 10;
-            }
-                
-            for (int i = 0; i < format.length() - s.length(); i++) {
-                temp.append(zero);
-            }
-            temp.append(s);
-            
-            if (_groupSize > 0) {
-                for (int i = 0; i < temp.length(); i++) {
-                    if (i != 0 && ((temp.length() - i) % _groupSize) == 0) {
-                        buffer.append(_groupSep);
-                    }
-                    buffer.append(temp.charAt(i));
-                }
-            }
-        } 
-	else if (c == 'i' && !_letterValue.equals("alphabetic")) {
-            buffer.append(romanValue(value));
-        } 
-	else if (c == 'I' && !_letterValue.equals("alphabetic")) {
-            buffer.append(romanValue(value).toUpperCase());
-        } 
-	else {
-            int min = (int) c;
-            int max = (int) c;
-            while (Character.isLetterOrDigit((char) (max+1))) {
-		max++;
-	    }
-            buffer.append(alphaValue(value, min, max));
-        }
-    }
-
-    private String alphaValue(int value, int min, int max) {
-        if (value <= 0) {
-	    return "" + value;
-	}
-
-        int range = max - min + 1;
-        char last = (char)(((value-1) % range) + min);
-        if (value > range) {
-            return alphaValue((value-1) / range, min, max) + last;
-        } 
-	else {
-            return "" + last;
-        }
-    }
-
-    private String romanValue(int n) {
-        if (n <= 0 || n > 4000) {
-	    return "" + n;
-	}
-        return
-	    Thousands[n / 1000] +
-	    Hundreds[(n / 100) % 10] +
-	    Tens[(n/10) % 10] +
-	    Ones[n % 10];
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java b/src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
deleted file mode 100644
index a11ffcb..0000000
--- a/src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public abstract class NodeIteratorBase implements NodeIterator {
-    private int _last = -1;
-    private int _position = 0;
-
-    protected int _markedNode;
-    protected int _startNode = NodeIterator.END;
-    protected boolean _includeSelf = false;
-    protected boolean _isRestartable = true;
-
-    public NodeIterator reset() {
-	final boolean temp = _isRestartable;
-	_isRestartable = true;
-	setStartNode(_startNode);
-	_isRestartable = temp;
-	return this;
-    }
-
-    public NodeIterator includeSelf() {
-	_includeSelf = true;
-	return this;
-    }
-
-    public int getLast() {
-	if (_last == -1) {
-	    final int temp = _position;
-	    setMark();
-	    reset();
-	    do {
-		_last++;
-	    } while (next() != END);
-	    gotoMark();
-	    _position = temp;
-	}
-	return _last;
-    }
-
-    public int getPosition() {
-	return _position == 0 ? 1 : _position;
-    }
-
-    public boolean isReverse() {
-	return false;
-    }
-    
-    public NodeIterator cloneIterator() {
-	try {
-	    final NodeIteratorBase clone = (NodeIteratorBase)super.clone();
-	    clone._isRestartable = false;
-	    return clone.reset();
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported.");
-	    return null;
-	}
-    }
-    
-    protected final int returnNode(final int node) {
-	_position++;
-	return node;
-    }
-    
-    protected final NodeIterator resetPosition() {
-	_position = 0;
-	return this;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/NodeSortRecord.java b/src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
deleted file mode 100644
index 991fff0..0000000
--- a/src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import java.util.Vector;
-import java.text.Collator;
-import java.text.CollationKey;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-/**
- * Base class for sort records containing application specific sort keys 
- */
-public abstract class NodeSortRecord {
-    public static int COMPARE_STRING     = 0;
-    public static int COMPARE_NUMERIC    = 1;
-
-    public static int COMPARE_ASCENDING  = 0;
-    public static int COMPARE_DESCENDING = 1;
-
-    protected static Collator _collator = Collator.getInstance();
-    protected static int[] _compareType;
-    protected static int[] _sortOrder;
-    protected static int _levels = 1;
-
-    private AbstractTranslet _translet = null;
-
-    private DOM    _dom = null;
-    private int    _node;           // The position in the current iterator
-    private int    _last = 0;       // Number of nodes in the current iterator
-    private int    _scanned = 0;    // Number of key levels extracted from DOM
-
-    private Object[] _values; // Contains either CollationKey or Double
-
-    /**
-     * This constructor is run by a call to Class.forName() in the
-     * makeNodeSortRecord method in the NodeSortRecordFactory class. Since we
-     * cannot pass any parameters to the constructor in that case we just set
-     * the default values here and wait for new values through initialize().
-     */ 
-    public NodeSortRecord(int node) {
-	_node = node;
-    }
-
-    public NodeSortRecord() {
-        this(0);
-    }
-
-    /**
-     * This method allows the caller to set the values that could not be passed
-     * to the default constructor.
-     */
-    public final void initialize(int node, int last, DOM dom,
-				 AbstractTranslet translet) {
-	_dom = dom;
-	_node = node;
-	_last = last;
-	_translet = translet;
-	_scanned = 0;
-
-	_values = new Object[_levels];
-    }
-
-    /**
-     * Returns the node for this sort object
-     */
-    public final int getNode() {
-	return _node;
-    }
-
-    /**
-     *
-     */
-    public final int compareDocOrder(NodeSortRecord other) {
-	return _node - other._node;
-    }
-
-    /**
-     * Get the string or numeric value of a specific level key for this sort
-     * element. The value is extracted from the DOM if it is not already in
-     * our sort key vector.
-     */
-    private final CollationKey stringValue(int level) {
-	// Get value from our array if possible
-	if (_scanned <= level) {
-	    // Get value from DOM if accessed for the first time
-	    final String str = extractValueFromDOM(_dom, _node, level,
-						   _translet, _last);
-	    final CollationKey key = _collator.getCollationKey(str);
-	    _values[_scanned++] = key;
-	    return(key);
-	}
-	return((CollationKey)_values[level]);
-    }
-    
-    private final Double numericValue(int level) {
-	// Get value from our vector if possible
-	if (_scanned <= level) {
-	    // Get value from DOM if accessed for the first time
-	    final String str = extractValueFromDOM(_dom, _node, level,
-						   _translet, _last);
-	    Double num;
-	    try {
-		num = new Double(str);
-	    }
-	    // Treat number as NaN if it cannot be parsed as a double
-	    catch (NumberFormatException e) {
-		num = new Double(Double.NaN);
-	    }
-	    _values[_scanned++] = num;
-	    return(num);
-	}
-	return((Double)_values[level]);
-    }
-
-    /**
-     * Compare this sort element to another. The first level is checked first,
-     * and we proceed to the next level only if the first level keys are
-     * identical (and so the key values may not even be extracted from the DOM)
-     *
-     * !!!!MUST OPTIMISE - THIS IS REALLY, REALLY SLOW!!!!
-     */
-    public int compareTo(NodeSortRecord other) {
-	int cmp, level;
-	for (level = 0; level < _levels; level++) {
-	    // Compare the two nodes either as numeric or text values
-	    if (_compareType[level] == COMPARE_NUMERIC) {
-		final Double our = numericValue(level);
-		final Double their = other.numericValue(level);
-		cmp = our.compareTo(their);
-	    }
-	    else {
-		final CollationKey our = stringValue(level);
-		final CollationKey their = other.stringValue(level);
-		cmp = our.compareTo(their);
-	    }
-	    
-	    // Return inverse compare value if inverse sort order
-	    if (cmp != 0) {
-		return _sortOrder[level] == COMPARE_DESCENDING ? 0 - cmp : cmp;
-	    }
-	}
-	// Compare based on document order if all sort keys are equal
-	return(_node - other._node);
-    }
-
-    /**
-     * Returns the Collator used for text comparisons in this object.
-     * May be overridden by inheriting classes
-     */
-    public Collator getCollator() {
-	return _collator;
-    }
-
-    /**
-     * Extract the sort value for a level of this key.
-     */
-    public abstract String extractValueFromDOM(DOM dom, int current, int level,
-					       AbstractTranslet translet,
-					       int last);
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java b/src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
deleted file mode 100644
index 13e5c45..0000000
--- a/src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.TransletException;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-public class NodeSortRecordFactory {
-    private final DOM      _dom;
-    private final Class    _class;
-    private final String   _className;
-
-    private final AbstractTranslet _translet;
-
-    /**
-     * Creates a NodeSortRecord producing object. The DOM specifies which tree
-     * to get the nodes to sort from, the class name specifies what auxillary
-     * class to use to sort the nodes (this class is generated by the Sort
-     * class), and the translet parameter is needed for methods called by
-     * this object.
-     */
-    public NodeSortRecordFactory(DOM dom, String className, Translet translet)
-	throws TransletException {
-	try {
-	    _dom = dom;
-	    _className = className;
-	    _class = Class.forName(className);
-	    _translet = (AbstractTranslet)translet;
-	}
-	catch (ClassNotFoundException e) {
-	    throw new TransletException("Could not find class " + className);
-	}
-    }
-
-    /**
-     * Create an instance of a sub-class of NodeSortRecord. The name of this
-     * sub-class is passed to us in the constructor.
-     */
-    public NodeSortRecord makeNodeSortRecord(int node, int last)
-	throws ExceptionInInitializerError,
-	       LinkageError,
-	       IllegalAccessException,
-	       InstantiationException,
-	       SecurityException,
-	       TransletException {
-
-	final NodeSortRecord sortRecord =
-	    (NodeSortRecord)_class.newInstance();
-	sortRecord.initialize(node, last, _dom, _translet);
-	return sortRecord;
-    }
-
-    public String getClassName() {
-	return _className;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/NthIterator.java b/src/org/apache/xalan/xsltc/dom/NthIterator.java
deleted file mode 100644
index ccde162..0000000
--- a/src/org/apache/xalan/xsltc/dom/NthIterator.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-
-public final class NthIterator extends NodeIteratorBase {
-    // ...[N]
-    private final int _position;
-    private final NodeIterator _source;
-    private boolean _ready;
-
-    public NthIterator(NodeIterator source, int n) {
-	_source = source;
-	_position = n;
-    }
-    
-    public int next() {
-	if (_ready && _position > 0) {
-	    _ready = false;
-	    // skip N-1 nodes
-	    for (int n = _position - 1; n-- > 0;) {
-		if (_source.next() == NodeIterator.END) {
-		    return NodeIterator.END;
-		}
-	    }
-	    return _source.next();
-	}
-	return NodeIterator.END;
-    }
-	
-    public NodeIterator setStartNode(final int node) {
-	_source.setStartNode(node);
-	_ready = true;
-	return this;
-    }
-	
-    public NodeIterator reset() {
-	_source.reset();
-	return this;
-    }
-    
-    public int getLast() {
-	return 1;
-    }
-    
-    public int getPosition() {
-	return 1;
-    }
-    
-    public boolean isReverse() {
-	return _source.isReverse();
-    }
-    
-    public void setMark() {
-	_source.setMark();
-    }
-    
-    public void gotoMark() {
-	_source.gotoMark();
-    }
-    
-    public NodeIterator cloneIterator() {
-	//!! not clear when cloning is performed
-	// and what's the desired state of the new clone
-	return new NthIterator(_source.cloneIterator(), _position);
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/ReverseIterator.java b/src/org/apache/xalan/xsltc/dom/ReverseIterator.java
deleted file mode 100644
index 60e716b..0000000
--- a/src/org/apache/xalan/xsltc/dom/ReverseIterator.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.TransletException;
-
-public final class ReverseIterator extends NodeIteratorBase {
-
-    private final static int INIT_DATA_SIZE = 16;
-    private final NodeIterator _source;
-    private int[] _data = null;
-    private int _last = 0;
-    private int _current = 0;
-    private int _start = -1;
-
-    public ReverseIterator(NodeIterator source) {
-	_source = source;
-    }
-
-    public int next() {
-	return _current > 0 ? _data[--_current] : END;
-    }
-	
-    public NodeIterator setStartNode(int node) {
-	if ((_data == null) || (node != _start)) {
-	    _start = node;
-	    _source.setStartNode(node);
-	    _data = new int[INIT_DATA_SIZE];
-	    _last = 0;
-	    // gather all nodes from the source iterator
-	    while ((node = _source.next()) != END) {
-		if (_last == _data.length) {
-		    int[] newArray = new int[_data.length * 2];
-		    System.arraycopy(_data, 0, newArray, 0, _last);
-		    _data = newArray;
-		}
-		_data[_last++] = node;
-	    }
-	}
-
-	_current = _last;
-	return this;
-    }
-	
-    public int getPosition() {
-	return (_last - _current);
-    }
-
-    public int getLast() {
-	return _last;
-    }
-
-    public void setMark() {
-	_source.setMark();
-	_markedNode = _current;
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-	_current = _markedNode;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/dom/SingleNodeCounter.java b/src/org/apache/xalan/xsltc/dom/SingleNodeCounter.java
deleted file mode 100644
index ba8643a..0000000
--- a/src/org/apache/xalan/xsltc/dom/SingleNodeCounter.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-
-public abstract class SingleNodeCounter extends NodeCounter {
-    static private final int[] EmptyArray = new int[] { };
-    NodeIterator _countSiblings = null;
-
-    public SingleNodeCounter(Translet translet,
-			     DOM document,
-			     NodeIterator iterator) {
-	super(translet, document, iterator);
-    }
-
-    public NodeCounter setStartNode(int node) {
-	_node = node;
-	_nodeType = _document.getType(node);
-	_countSiblings = _document.getAxisIterator(PRECEDINGSIBLING);
-	return this;
-    }
-
-    public String getCounter() {
-	int result;
-	if (_value != Integer.MIN_VALUE) {
-	    result = _value;
-	}
-	else {
-	    int next = _node;
-	    result = 0;
-	    if (!matchesCount(next)) {
-		while ((next = _document.getParent(next)) > END) {
-		    if (matchesCount(next)) {
-			break;		// found target
-		    }
-		    if (matchesFrom(next)) {
-			next = END;
-			break;		// no target found
-		    }
-		}
-	    }
-
-	    if (next != END) {
-		result++;		// count target
-		_countSiblings.setStartNode(next);
-		while ((next = _countSiblings.next()) != END) {
-		    if (matchesCount(next)) {
-			result++;
-		    }
-		}
-	    }
-	    /*
-	      else {
-				// If no target found then pass the empty list
-				return formatNumbers(EmptyArray);
-				}
-	    */
-	}
-	return formatNumbers(result);
-    }
-
-    public static NodeCounter getDefaultNodeCounter(Translet translet,
-						    DOM document,
-						    NodeIterator iterator) {
-	return new DefaultSingleNodeCounter(translet, document, iterator);
-    }
-
-    static class DefaultSingleNodeCounter extends SingleNodeCounter {
-	public DefaultSingleNodeCounter(Translet translet,
-					DOM document, NodeIterator iterator) {
-	    super(translet, document, iterator);
-	}
-
-	public NodeCounter setStartNode(int node) {
-	    _node = node;
-	    _nodeType = _document.getType(node);
-	    _countSiblings =
-		_document.getTypedAxisIterator(PRECEDINGSIBLING,
-					       _document.getType(node));
-	    return this;
-	}
-
-	public String getCounter() {
-	    int result;
-	    if (_value != Integer.MIN_VALUE) {
-		result = _value;
-	    }
-	    else {
-		int next;
-		result = 1;
-		_countSiblings.setStartNode(_node);
-		while ((next = _countSiblings.next()) != END) {
-		    result++;
-		}
-	    }
-	    return formatNumbers(result);
-	}
-    }
-}
-
diff --git a/src/org/apache/xalan/xsltc/dom/SingletonIterator.java b/src/org/apache/xalan/xsltc/dom/SingletonIterator.java
deleted file mode 100644
index 9f41fb9..0000000
--- a/src/org/apache/xalan/xsltc/dom/SingletonIterator.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-
-public class SingletonIterator extends NodeIteratorBase {
-    private int _node;
-    private final boolean _isConstant;
-
-    public SingletonIterator() {
-	this(Integer.MIN_VALUE, false);
-    }
-
-    public SingletonIterator(int node) {
-	this(node, false);
-    }
-
-    public SingletonIterator(int node, boolean constant) {
-	_node = _startNode = node;
-	_isConstant = constant;
-    }
-    
-    /**
-     * Override the value of <tt>_node</tt> only when this
-     * object was constructed using the empty constructor.
-     */
-    public NodeIterator setStartNode(int node) {
-	if (_isConstant) {
-	    _node = _startNode;
-	    return resetPosition();
-	}
-	else if (_isRestartable) {
-	    if (_node <= 0)
-		_node = _startNode = node;
-	    return resetPosition();
-	}
-	return this;
-    }
-	
-    public NodeIterator reset() {
-	if (_isConstant) {
-	    _node = _startNode;
-	    return resetPosition();
-	}
-	else {
-	    final boolean temp = _isRestartable;
-	    _isRestartable = true;
-	    setStartNode(_startNode);
-	    _isRestartable = temp;
-	}
-	return this;
-    }
-    
-    public int next() {
-	final int result = _node;
-	_node = NodeIterator.END;
-	return returnNode(result);
-    }
-
-    public void setMark() {
-	_markedNode = _node;
-    }
-
-    public void gotoMark() {
-	_node = _markedNode;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/SortingIterator.java b/src/org/apache/xalan/xsltc/dom/SortingIterator.java
deleted file mode 100644
index 9d16c2b..0000000
--- a/src/org/apache/xalan/xsltc/dom/SortingIterator.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.TransletException;
-
-public final class SortingIterator extends NodeIteratorBase {
-    private final static int INIT_DATA_SIZE = 16;
-    private final NodeIterator _source;
-    private final NodeSortRecordFactory _factory;
-    private NodeSortRecord[] _data;
-    private int _free = 0;
-    private int _current;	// index in _nodes of the next node to try
-
-    public SortingIterator(NodeIterator source, 
-			   NodeSortRecordFactory factory) {
-	_source = source;
-	_factory = factory;
-    }
-
-    public int next() {
-	return _current < _free ? _data[_current++].getNode() : END;
-    }
-	
-    public NodeIterator setStartNode(int node) {
-	try {
-	    _source.setStartNode(_startNode = node);
-	    _data = new NodeSortRecord[INIT_DATA_SIZE];
-	    _free = 0;
-
-	    // gather all nodes from the source iterator
-	    while ((node = _source.next()) != END) {
-		addRecord(_factory.makeNodeSortRecord(node,_free));
-	    }
-	    // now sort the records
-	    quicksort(0, _free - 1);
-
-	    _current = 0;
-	    return this;
-	}
-	catch (Exception e) {
-	    return this;
-	}
-    }
-	
-    public int getPosition() {
-	return _current == 0 ? 1 : _current;
-    }
-
-    public int getLast() {
-	return _free;
-    }
-
-    public void setMark() {
-	_source.setMark();
-	_markedNode = _current;
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-	_current = _markedNode;
-    }
-    
-    private void addRecord(NodeSortRecord record) {
-	if (_free == _data.length) {
-	    NodeSortRecord[] newArray = new NodeSortRecord[_data.length * 2];
-	    System.arraycopy(_data, 0, newArray, 0, _free);
-	    _data = newArray;
-	}
-	_data[_free++] = record;
-    }
-
-    private void quicksort(int p, int r) {
-	while (p < r) {
-	    final int q = partition(p, r);
-	    quicksort(p, q);
-	    p = q + 1;
-	}
-    }
-    
-    private int partition(int p, int r) {
-	final NodeSortRecord x = _data[(p + r) >>> 1];
-	int i = p - 1;
-	int j = r + 1;
-	while (true) {
-	    while (x.compareTo(_data[--j]) < 0);
-	    while (x.compareTo(_data[++i]) > 0);
-	    if (i < j) {
-		final NodeSortRecord t = _data[i];
-		_data[i] = _data[j];
-		_data[j] = t;
-	    }
-	    else {
-		return(j);
-	    }
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/StepIterator.java b/src/org/apache/xalan/xsltc/dom/StepIterator.java
deleted file mode 100644
index 4d2be9a..0000000
--- a/src/org/apache/xalan/xsltc/dom/StepIterator.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-public final class StepIterator extends NodeIteratorBase {
-    private NodeIterator _source;
-    private NodeIterator _iterator;
-
-    public StepIterator(NodeIterator source, NodeIterator iterator) {
-	_source = source;
-	_iterator = iterator;
-    }
-
-    public NodeIterator cloneIterator() {
-	_isRestartable = false;
-	try {
-	    final StepIterator clone = (StepIterator)super.clone();
-	    clone._source = _source.cloneIterator();
-	    clone._iterator = _iterator.cloneIterator();
-	    // Special case -> _iterator must be restartable
-	    if (clone._iterator instanceof NodeIteratorBase) {
-		((NodeIteratorBase)(clone._iterator))._isRestartable = true;
-	    }
-	    return clone.reset();
-	}
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported.");
-	    return null;
-	}
-    }
-    
-    public NodeIterator setStartNode(int node) {
-	if (_isRestartable) {
-	    // iterator is not a clone
-	    _source.setStartNode(_startNode = node);
-	    _iterator.setStartNode(_source.next());
-	    return resetPosition();
-	}
-	return this;
-    }
-
-    public NodeIterator reset() {
-	_source.setStartNode(_startNode);
-	_source.reset();
-	int node = _source.next();
-	_iterator.setStartNode(node);
-	return resetPosition();
-    }
-    
-    public int next() {
-	for (int node;;) {
-	    if ((node = _iterator.next()) != END) {
-		return returnNode(node);
-	    }
-	    // local iterator ran out of nodes
-	    // try to get new start node from source
-	    else if ((node = _source.next()) == END) {
-		return END;
-	    }
-	    else {
-		_iterator.setStartNode(node);
-	    }
-	}
-    }
-
-    public void setMark() {
-	_source.setMark();
-	_iterator.setMark();
-    }
-
-    public void gotoMark() {
-	_source.gotoMark();
-	_iterator.gotoMark();
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/dom/StripWhitespaceFilter.java b/src/org/apache/xalan/xsltc/dom/StripWhitespaceFilter.java
deleted file mode 100644
index 624af59..0000000
--- a/src/org/apache/xalan/xsltc/dom/StripWhitespaceFilter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-
-public interface StripWhitespaceFilter {
-    public boolean stripSpace(DOM dom, int node, int type);
-}
diff --git a/src/org/apache/xalan/xsltc/dom/UnionIterator.java b/src/org/apache/xalan/xsltc/dom/UnionIterator.java
deleted file mode 100644
index 69ca37b..0000000
--- a/src/org/apache/xalan/xsltc/dom/UnionIterator.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.dom;
-
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.runtime.BasisLibrary;
-
-/**
- * UnionIterator takes a set of NodeIterators and produces
- * a merged NodeSet in document order with duplicates removed
- * The individual iterators are supposed to generate nodes
- * in document order
- */
-public final class UnionIterator extends NodeIteratorBase {
-    /** wrapper for NodeIterators to support iterator
-	comparison on the value of their next() method
-    */
-    final private DOM _dom;
-
-    private final static class LookAheadIterator {
-	public int node, markedNode;
-	public final NodeIterator iterator;
-		
-	public LookAheadIterator(NodeIterator iterator) {
-	    this.iterator = iterator;
-	}
-		
-	public int step() {
-	    node = iterator.next();
-	    return node;
-	}
-
-	public void setMark() {
-	    markedNode = node;
-	    iterator.setMark();
-	}
-
-	public void gotoMark() {
-	    node = markedNode;
-	    iterator.gotoMark();
-	}
-
-    } // end of LookAheadIterator
-
-    private static final int InitSize = 8;
-  
-    private int            _heapSize = 0;
-    private int            _size = InitSize;
-    private LookAheadIterator[] _heap = new LookAheadIterator[InitSize];
-    private int            _free = 0;
-  
-    // last node returned by this UnionIterator to the caller of next
-    // used to prune duplicates
-    private int _returnedLast;
-
-    public UnionIterator(DOM dom) {
-	_dom = dom;
-    }
-
-    public NodeIterator cloneIterator() {
-	_isRestartable = false;
-	final LookAheadIterator[] heapCopy = 
-	    new LookAheadIterator[_heap.length];
-	try {
-	    final UnionIterator clone = (UnionIterator)super.clone();
-	    System.arraycopy(_heap, 0, heapCopy, 0, _heap.length);
-	    clone._heap = heapCopy;
-	    return clone.reset();
-	} 
-	catch (CloneNotSupportedException e) {
-	    BasisLibrary.runTimeError("Iterator clone not supported.");
-	    return null;
-	}
-    }
-    
-    public UnionIterator addIterator(NodeIterator iterator) {
-	if (_free == _size) {
-	    LookAheadIterator[] newArray = new LookAheadIterator[_size *= 2];
-	    System.arraycopy(_heap, 0, newArray, 0, _free);
-	    _heap = newArray;
-	}
-	_heapSize++;
-	_heap[_free++] = new LookAheadIterator(iterator);
-	return this;
-    }
-  
-    public int next() {
-	while (_heapSize > 0) {
-	    final int smallest = _heap[0].node;
-	    if (smallest == END) { // iterator _heap[0] is done
-		if (_heapSize > 1) {
-		    // replace it with last
-		    _heap[0] = _heap[--_heapSize];
-		}
-		else {
-		    return END;
-		}
-	    }
-	    else if (smallest == _returnedLast) {	// duplicate
-		_heap[0].step(); // value consumed
-	    }
-	    else {
-		_heap[0].step(); // value consumed
-		heapify(0);
-		return returnNode(_returnedLast = smallest);
-	    }
-	    // fallthrough if not returned above
-	    heapify(0);
-	}
-	return END;
-    }
-  
-    public NodeIterator setStartNode(int node) {
-	if (_isRestartable) {
-	    _startNode = node;
-	    for (int i = 0; i < _free; i++) {
-		_heap[i].iterator.setStartNode(node);
-		_heap[i].step();	// to get the first node
-	    }
-	    // build heap
-	    for (int i = (_heapSize = _free)/2; i >= 0; i--) {
-		heapify(i);
-	    }
-	    _returnedLast = END;
-	    return resetPosition();
-	}
-	return this;
-    }
-	
-    private void heapify(int i) {
-	for (int r, l, smallest;;) {
-	    r = (i + 1) << 1; l = r - 1;
-	    smallest = l < _heapSize 
-		&& _dom.lessThan(_heap[l].node, _heap[i].node) ? l : i;
-	    if (r < _heapSize && _dom.lessThan(_heap[r].node,
-					       _heap[smallest].node)) {
-		smallest = r;
-	    }
-	    if (smallest != i) {
-		final LookAheadIterator temp = _heap[smallest];
-		_heap[smallest] = _heap[i];
-		_heap[i] = temp;
-		i = smallest;
-	    }
-	    else
-		break;
-	}
-    }
-
-    public void setMark() {
-	for (int i = 0; i < _free; i++) {
-	    _heap[i].setMark();
-	}
-    }
-
-    public void gotoMark() {
-	for (int i = 0; i < _free; i++) {
-	    _heap[i].gotoMark();
-	}
-    }
-
-    public NodeIterator reset() {
-	super.reset();
-	for (int i = 0; i < _free; i++) {
-	    _heap[i].iterator.reset();
-	}
-	return(this);
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java b/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
deleted file mode 100644
index f8b0758..0000000
--- a/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author G. Todd Miller
- * @author John Howard, JohnH@schemasoft.com 
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import java.io.File;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.dom.DOMAdapter;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-import org.apache.xalan.xsltc.dom.KeyIndex;
-import org.apache.xalan.xsltc.dom.DTDMonitor;
-import org.apache.xalan.xsltc.util.IntegerArray;
-
-public abstract class AbstractTranslet implements Translet {
-
-    // These attributes are extracted from the xsl:output element. They also
-    // appear as fields (with the same type, only public) in Output.java
-    public String  _version = "1.0";
-    public String  _method = null;
-    public String  _encoding = "utf-8";
-    public boolean _omitHeader = false;
-    public String  _standalone = null;
-    public String  _doctypePublic = null;
-    public String  _doctypeSystem = null;
-    public boolean _indent = false;
-    public String  _mediaType = null;
-    public Hashtable _cdata = null;
-
-    // DOM/translet handshaking - the arrays are set by the compiled translet
-    protected String[] namesArray;
-    protected String[] namespaceArray;
-
-    // TODO - these should only be instanciated when needed
-    protected StringValueHandler stringValueHandler = new StringValueHandler();
-
-    // Use one empty string instead of constantly instanciating String("");
-    private final static String EMPTYSTRING = "";
-
-    /**
-     * Wrap the initial input DOM in a dom adapter. This adapter is wrapped in
-     * a DOM multiplexer if the document() function is used (handled by compiled
-     * code in the translet - see compiler/Stylesheet.compileTransform()).
-     */
-    public final DOMAdapter makeDOMAdapter(DOM dom)
-	throws TransletException {
-	if (dom instanceof DOMImpl) {
-	    return new DOMAdapter((DOMImpl)dom, namesArray, namespaceArray);
-	}
-	else {
-	    throw new TransletException("wrong type of source DOM");
-	}
-    }
-
-    /************************************************************************
-     * Variable and parameter handling
-     ************************************************************************/
-
-    // Variable's stack: <tt>vbase</tt> and <tt>vframe</tt> are used 
-    // to denote the current variable frame.
-    protected int vbase = 0, vframe = 0;
-    protected Vector varsStack = new Vector();
-
-    // Parameter's stack: <tt>pbase</tt> and <tt>pframe</tt> are used 
-    // to denote the current parameter frame.
-    protected int pbase = 0, pframe = 0;
-    protected Vector paramsStack = new Vector();
-
-    /**
-     * Push a new parameter frame.
-     */
-    public final void pushParamFrame() {
-	paramsStack.insertElementAt(new Integer(pbase), pframe);
-	pbase = ++pframe;
-    }
-
-    /**
-     * Pop the topmost parameter frame.
-     */
-    public final void popParamFrame() {
-	if (pbase > 0) {
-	    int bot = pbase - 1;
-	    int top = pframe - 1;
-	    pframe = pbase - 1;
-	    pbase = ((Integer) paramsStack.elementAt(pframe)).intValue();
-	    // bug fix #3424, John Howard.
-	    // remove objects that are in the stack since objects are	
-	    // added with insertElementAt(int) and will cause memory retention
-	    for (int i=top; i>=bot; i--) {
-		paramsStack.removeElementAt(i);
-	    }
-	}
-    }
-
-    /**
-     * Add a new global parameter if not already in the current frame.
-     */
-    public final Object addParameter(String name, Object value) {
-	return addParameter(name, value, false);
-    }
-
-    /**
-     * Add a new global or local parameter if not already in the current frame.
-     * The 'isDefault' parameter is set to true if the value passed is the
-     * default value from the <xsl:parameter> element's select attribute or
-     * element body.
-     */
-    public final Object addParameter(String name, Object value,
-				     boolean isDefault) {
-
-	// Local parameters need to be re-evaluated for each iteration
-	for (int i = pframe - 1; i >= pbase; i--) {
-	    final Parameter param = (Parameter) paramsStack.elementAt(i);
-	    if (param._name.equals(name)) {
-		// Only overwrite if current value is the default value and
-		// the new value is _NOT_ the default value.
-		if ((param._isDefault == true) || (!isDefault)) {
-		    param._value = value;
-		    param._isDefault = isDefault;
-		    return value;
-		}
-		return param._value;
-	    }
-	}
-
-	// Add new parameter to parameter stack
-	final Parameter param = new Parameter(name, value, isDefault);
-	paramsStack.insertElementAt(param, pframe++);
-	return value;
-    }
-
-    /**
-     * Clears the parameter stack.
-     */
-    public void clearParameters() {  
-	paramsStack.clear();
-    }
-
-    /**
-     * Get the value of a parameter from the current frame or
-     * <tt>null</tt> if undefined.
-     */
-    public final Object getParameter(String name) {
-	for (int i = pframe - 1; i >= pbase; i--) {
-	    final Parameter param = (Parameter)paramsStack.elementAt(i);
-	    if (param._name.equals(name)) return param._value;
-	}
-	return null;
-    }
-
-    /**
-     * Push a new variable frame.
-     */
-    public final void pushVarFrame(int frameSize) {
-	varsStack.insertElementAt(new Integer(vbase), vframe);
-	vbase = ++vframe;
-	vframe += frameSize;
-    }
-
-    /**
-     * Pop the topmost variable frame.
-     */
-    public final void popVarFrame() {
-	if (vbase > 0) {
-	    int bot = vbase - 1;
-	    int top = vframe - 1;
-	    vframe = vbase - 1;
-	    vbase = ((Integer)varsStack.elementAt(vframe)).intValue();
-	    // bug fix 3424, John Howard
-	    // remove objects that are in the stack since objects are	
-	    // added with insertElementAt(int) and will cause memory retention
-	    for (int i=top; i>=bot; i--) {
-		varsStack.removeElementAt(i);
-	    }
-	}
-    }
-
-    /**
-     * Get the value of a variable given its index.
-     */
-    public final Object getVariable(int vindex) {
-	// bug fix 3424, John Howard
-	return varsStack.elementAt(vbase + vindex);
-    }
-	
-
-    /**
-     * Set the value of a variable in the current frame.
-     */
-    public final void addVariable(int vindex, Object value) {
-	final int index = vbase + vindex;
-	if (index > varsStack.size()) varsStack.setSize(index);
-	varsStack.insertElementAt(value, index);
-    }
-
-    /************************************************************************
-     * Message handling - implementation of <xsl:message>
-     ************************************************************************/
-
-    // Holds the translet's message handler - used for <xsl:message>.
-    // The deault message handler dumps a string stdout, but anything can be
-    // used, such as a dialog box for applets, etc.
-    private MessageHandler _msgHandler = null;
-
-    /**
-     * Set the translet's message handler - must implement MessageHandler
-     */
-    public final void setMessageHandler(MessageHandler handler) {
-	_msgHandler = handler;
-    }
-
-    /**
-     * Pass a message to the message handler - used by Message class.
-     */
-    public final void displayMessage(String msg) {
-	if (_msgHandler == null) {
-            System.err.println(msg);
-	}
-	else {
-	    _msgHandler.displayMessage(msg);
-	}
-    }
-
-    /************************************************************************
-     * Decimal number format symbol handling
-     ************************************************************************/
-
-    // Contains decimal number formatting symbols used by FormatNumberCall
-    public Hashtable _formatSymbols = null;
-
-    /**
-     * Adds a DecimalFormat object to the _formatSymbols hashtable.
-     * The entry is created with the input DecimalFormatSymbols.
-     */
-    public void addDecimalFormat(String name, DecimalFormatSymbols symbols) {
-	// Instanciate hashtable for formatting symbols if needed
-	if (_formatSymbols == null) _formatSymbols = new Hashtable();
-
-	// The name cannot be null - use empty string instead
-	if (name == null) name = EMPTYSTRING;
-
-	// Construct a DecimalFormat object containing the symbols we got
-	final DecimalFormat df = new DecimalFormat();
-	if (symbols != null) {
-	    df.setDecimalFormatSymbols(symbols);
-	}
-	_formatSymbols.put(name, df);
-    }
-
-    /**
-     * Retrieves a named DecimalFormat object from _formatSymbols hashtable.
-     */
-    public final DecimalFormat getDecimalFormat(String name) {
-
-	if (_formatSymbols != null) {
-	    // The name cannot be null - use empty string instead
-	    if (name == null) name = EMPTYSTRING;
-
-	    final DecimalFormat df = (DecimalFormat)_formatSymbols.get(name);
-	    if (df != null)
-		return df;
-	    else
-		return((DecimalFormat)_formatSymbols.get(EMPTYSTRING));
-	}
-	return(null);
-    }
-
-    /************************************************************************
-     * Unparsed entity URI handling - implements unparsed-entity-uri()
-     ************************************************************************/
-
-    // Keeps all unparsed entity URIs specified in the XML input
-    public Hashtable _unparsedEntities = null;
-
-    /**
-     * Get the value of an unparsed entity URI.
-     * This method is used by the compiler/UnparsedEntityUriCall class.
-     */
-    public final String getUnparsedEntity(String name) {
-	final String uri = (String)_unparsedEntities.get(name);
-	return uri == null ? EMPTYSTRING : uri;
-    }
-
-    /**
-     * Add an unparsed entity URI. The URI/value pairs are passed from the
-     * DOM builder to the translet.
-     */
-    public final void addUnparsedEntity(String name, String uri) {
-	if (_unparsedEntities == null)
-	    _unparsedEntities = new Hashtable();
-	if (_unparsedEntities.containsKey(name) == false)
-	    _unparsedEntities.put(name, uri);
-    }
-    
-    /**
-     * Add an unparsed entity URI. The URI/value pairs are passed from the
-     * DOM builder to the translet.
-     */
-    public final void setUnparsedEntityURIs(Hashtable table) {
-	if (_unparsedEntities == null)
-	    _unparsedEntities = table;
-	else {
-	    Enumeration keys = table.keys();
-	    while (keys.hasMoreElements()) {
-		String name = (String)keys.nextElement();
-		_unparsedEntities.put(name,table.get(name));
-	    }
-	}
-    }
-
-    /**
-     * The DTD monitor used by the DOM builder scans the input document DTD
-     * for unparsed entity URIs. These are passed to the translet using
-     * this method.
-     */
-    public final void setDTDMonitor(DTDMonitor monitor) {
-	setUnparsedEntityURIs(monitor.getUnparsedEntityURIs());
-    }
-
-    /************************************************************************
-     * Index(es) for <xsl:key> / key() / id()
-     ************************************************************************/
-
-    // Container for all indexes for xsl:key elements
-    private Hashtable _keyIndexes = null;
-    private KeyIndex  _emptyKeyIndex = new KeyIndex(1);
-    private int       _indexSize = 0;
-
-    /**
-     * This method is used to pass the largest DOM size to the translet.
-     * Needed to make sure that the translet can index the whole DOM.
-     */
-    public void setIndexSize(int size) {
-	if (size > _indexSize) _indexSize = size;
-    }
-
-    /**
-     * Creates a KeyIndex object of the desired size - don't want to resize!!!
-     */
-    public KeyIndex createKeyIndex() {
-	return(new KeyIndex(_indexSize));
-    }
-
-    /**
-     * Adds a value to a key/id index
-     *   @name is the name of the index (the key or ##id)
-     *   @node is the node id of the node to insert
-     *   @value is the value that will look up the node in the given index
-     */
-    public void buildKeyIndex(String name, int node, Object value) {
-	if (_keyIndexes == null) _keyIndexes = new Hashtable();
-	
-	KeyIndex index = (KeyIndex)_keyIndexes.get(name);
-	if (index == null) {
-	    _keyIndexes.put(name, index = new KeyIndex(_indexSize));
-	}
-	index.add(value, node);
-    }
-
-    /**
-     * Returns the index for a given key (or id).
-     * The index implements our internal iterator interface
-     */
-    public KeyIndex getKeyIndex(String name) {
-	// Return an empty key index iterator if none are defined
-	if (_keyIndexes == null) return(_emptyKeyIndex);
-
-	// Look up the requested key index
-	final KeyIndex index = (KeyIndex)_keyIndexes.get(name);
-
-	// Return an empty key index iterator if the requested index not found
-	if (index == null) return(_emptyKeyIndex);
-
-	return(index);
-    }
-
-    /**
-     * This method builds key indexes - it is overridden in the compiled
-     * translet in cases where the <xsl:key> element is used
-     */
-    public void buildKeys(DOM document, NodeIterator iterator,
-			  TransletOutputHandler handler,
-			  int root) throws TransletException {
-    }
-
-    /************************************************************************
-     * DOM cache handling
-     ************************************************************************/
-
-    // Hold the DOM cache (if any) used with this translet
-    private DOMCache _domCache = null;
-
-    /**
-     * Sets the DOM cache used for additional documents loaded using the
-     * document() function.
-     */
-    public void setDOMCache(DOMCache cache) {
-	_domCache = cache;
-    }
-
-    /**
-     * Returns the DOM cache used for this translet. Used by the LoadDocument
-     * class (if present) when the document() function is used.
-     */
-    public DOMCache getDOMCache() {
-	return(_domCache);
-    }
-
-    /************************************************************************
-     * Start of an implementation of a multiple output extension.
-     * See compiler/TransletOutput for actual implementation.
-     ************************************************************************/
-
-    public TransletOutputHandler openOutputHandler(String filename) 
-	throws TransletException {
-	try {
-	    // Use the default SAX handler to send the output to the file
-	    DefaultSAXOutputHandler handler =
-		new DefaultSAXOutputHandler(filename, _encoding);
-
-	    // Create a translet output handler and plug in the SAX handler
-	    TextOutput text = new TextOutput(handler, handler, _encoding);
-	    transferOutputSettings(text);
-	    text.startDocument();
-	    return(text);
-	}
-	catch (Exception e) {
-	    throw new TransletException(e);
-	}
-    }
-
-    public void closeOutputHandler(TransletOutputHandler handler) {
-	try {
-	    handler.endDocument();
-	    handler.close();
-	}
-	catch (Exception e) {
-	    // what can you do?
-	}
-    }
-
-    /************************************************************************
-     * Native API transformation methods - _NOT_ JAXP/TrAX
-     ************************************************************************/
-
-    /**
-     * Main transform() method - this is overridden by the compiled translet
-     */
-    public abstract void transform(DOM document, NodeIterator iterator,
-				   TransletOutputHandler handler)
-	throws TransletException;
-
-    /**
-     * Calls transform() with a given output handler
-     */
-    public final void transform(DOM document, TransletOutputHandler handler) 
-	throws TransletException {
-	transform(document, document.getIterator(), handler);
-    }
-	
-    /**
-     * Calls transform() with a set of given output handlers
-     */
-    public final void transform(DOM document,
-				TransletOutputHandler[] handlers) 
-	throws TransletException {
-	transform(document, document.getIterator(), handlers[0]);
-    }
-
-    /**
-     * Used by some compiled code as a shortcut for passing strings to the
-     * output handler
-     */
-    public final void characters(final String string,
-				 TransletOutputHandler handler) 
-	throws TransletException {
-	final int length = string.length();
-	handler.characters(string.toCharArray(), 0, length);
-    }
-
-    /**
-     * Add's a name of an element whose text contents should be output as CDATA
-     */
-    public void addCdataElement(String name) {
-	if (_cdata == null) _cdata = new Hashtable();
-	_cdata.put(name, name);
-    }
-
-    /**
-     * Transfer the output settings to the output post-processor
-     */
-    protected void transferOutputSettings(TransletOutputHandler output) {
-
-	// It is an error if this method is called with anything else than
-	// the translet post-processor (TextOutput)
-	if (!(output instanceof TextOutput)) return;
-
-	TextOutput handler = (TextOutput)output;
-
-	// Transfer the output method setting
-	if (_method != null) {
-	    // Transfer all settings relevant to XML output
-	    if (_method.equals("xml")) {
-		handler.setType(TextOutput.XML);
-		handler.setCdataElements(_cdata);
-		if (_version != null) handler.setVersion(_version);
-		if (_standalone != null) handler.setStandalone(_standalone);
-		if (_omitHeader) handler.omitHeader(true);
-		if (_indent) handler.setIndent(_indent);
-		if (_doctypeSystem != null)
-		    handler.setDoctype(_doctypeSystem, _doctypePublic);
-	    }
-	    // Transfer all output settings relevant to HTML output
-	    else if (_method.equals("html")) {
-		handler.setType(TextOutput.HTML);
-		if (_indent)
-		    handler.setIndent(_indent);
-		else
-		    handler.setIndent(true);
-		handler.setDoctype(_doctypeSystem, _doctypePublic);
-		if (_mediaType != null) handler.setMediaType(_mediaType);
-	    }
-	    else if (_method.equals("text")) {
-		handler.setType(TextOutput.TEXT);
-	    }
-	    else {
-		handler.setType(TextOutput.QNAME);
-	    }
-	}
-	else {
-	    handler.setCdataElements(_cdata);
-	    if (_version != null) handler.setVersion(_version);
-	    if (_standalone != null) handler.setStandalone(_standalone);
-	    if (_omitHeader) handler.omitHeader(true);
-	    if (_indent) handler.setIndent(_indent);
-	    handler.setDoctype(_doctypeSystem, _doctypePublic);
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/AttributeList.java b/src/org/apache/xalan/xsltc/runtime/AttributeList.java
deleted file mode 100644
index cebbeb4..0000000
--- a/src/org/apache/xalan/xsltc/runtime/AttributeList.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * $Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.Attributes;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-public class AttributeList implements org.xml.sax.Attributes {
-
-    private final static String EMPTYSTRING = "";
-    private final static String CDATASTRING = "CDATA";
-
-    private Hashtable _attributes;
-    private Vector    _names;
-    private Vector    _qnames;
-    private Vector    _values;
-    private Vector    _uris;
-    private int       _length;
-
-    /**
-     * AttributeList constructor
-     */
-    public AttributeList() {
-	_attributes = new Hashtable();
-	_names  = new Vector();
-	_values = new Vector();
-	_qnames = new Vector();
-	_uris   = new Vector();
-	_length = 0;
-    }
-
-    /**
-     * Attributes clone constructor
-     */
-    public AttributeList(org.xml.sax.Attributes attributes) {
-	this();
-	if (attributes != null) {
-	    final int count = attributes.getLength();
-	    for (int i = 0; i < count; i++) {
-		add(attributes.getQName(i),attributes.getValue(i));
-	    }
-	}
-    }
-
-    /**
-     * SAX2: Return the number of attributes in the list. 
-     */
-    public int getLength() {
-	return(_length);
-    }
-
-    /**
-     * SAX2: Look up an attribute's Namespace URI by index.
-     */
-    public String getURI(int index) {
-	if (index < _length)
-	    return((String)_uris.elementAt(index));
-	else
-	    return(null);
-    }
-
-    /**
-     * SAX2: Look up an attribute's local name by index.
-     */
-    public String getLocalName(int index) {
-	if (index < _length)
-	    return((String)_names.elementAt(index));
-	else
-	    return(null);
-    }
-
-    /**
-     * Return the name of an attribute in this list (by position).
-     */
-    public String getQName(int pos) {
-	if (pos < _length)
-	    return((String)_qnames.elementAt(pos));
-	else
-	    return(null);
-    }
-
-    /**
-     * SAX2: Look up an attribute's type by index.
-     */
-    public String getType(int index) {
-	return(CDATASTRING);
-    }
-
-    /**
-     * SAX2: Look up the index of an attribute by Namespace name.
-     */
-    public int getIndex(String namespaceURI, String localPart) {
-	return(0);
-    }
-
-    /**
-     * SAX2: Look up the index of an attribute by XML 1.0 qualified name.
-     */
-    public int getIndex(String qname) {
-	return(0);
-    }
-
-    /**
-     * SAX2: Look up an attribute's type by Namespace name.
-     */
-    public String getType(String uri, String localName) {
-	return(CDATASTRING);
-    }
-
-    /**
-     * SAX2: Look up an attribute's type by qname.
-     */
-    public String getType(String qname) {
-	return(CDATASTRING);
-    }
-
-    /**
-     * SAX2: Look up an attribute's value by index.
-     */
-    public String getValue(int pos) {
-	if (pos < _length)
-	    return((String)_values.elementAt(pos));
-	else
-	    return(null);
-    }
-
-    /**
-     * SAX2: Look up an attribute's value by qname.
-     */
-    public String getValue(String qname) {
-	final Integer obj = (Integer)_attributes.get(qname);
-	if (obj == null) return null;
-	return(getValue(obj.intValue()));
-    }
-
-    /**
-     * SAX2: Look up an attribute's value by Namespace name - SLOW!
-     */
-    public String getValue(String uri, String localName) {
-	return(getValue(uri+':'+localName));
-    }
-
-    /**
-     * Adds an attribute to the list
-     */
-    public void add(String qname, String value) {
-	// Stuff the QName into the names vector & hashtable
-	Integer obj = (Integer)_attributes.get(qname);
-	if (obj == null) {
-	    _attributes.put(qname, obj = new Integer(_length++));
-	    _qnames.addElement(qname);
-	    _values.addElement(value);
-	    int col = qname.lastIndexOf(':');
-	    if (col > -1) {
-		_uris.addElement(qname.substring(0,col));
-		_names.addElement(qname.substring(col+1));
-	    }
-	    else {
-		_uris.addElement(EMPTYSTRING);
-		_names.addElement(qname);
-	    }
-	}
-	else {
-	    final int index = obj.intValue();
-	    _values.set(index, value);
-	}
-    }
-
-    /**
-     * Clears the attribute list
-     */
-    public void clear() {
-	_length = 0;
-	_attributes.clear();
-	_names.removeAllElements();
-	_values.removeAllElements();
-	_qnames.removeAllElements();
-	_uris.removeAllElements();
-    }
-    
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/Attributes.java b/src/org/apache/xalan/xsltc/runtime/Attributes.java
deleted file mode 100644
index 62c3350..0000000
--- a/src/org/apache/xalan/xsltc/runtime/Attributes.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import org.xml.sax.AttributeList;
-import org.apache.xalan.xsltc.DOM;
-
-public final class Attributes implements AttributeList {
-    private int _element;
-    private DOM _document;
-
-    public Attributes(DOM document, int element) {
-	_element = element;
-	_document = document;
-    }
-
-    public int getLength() {
-	return 0;
-    }
-
-    public String getName(int i) {
-	return null;
-    }
-
-    public String getType(int i) {
-	return null;
-    }
-
-    public String getType(String name) {
-	return null;
-    }
-
-    public String getValue(int i) {
-	return null;
-    }
-
-    public String getValue(String name) {
-	return null;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java b/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
deleted file mode 100644
index 6d7e992..0000000
--- a/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
+++ /dev/null
@@ -1,955 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-//import java.util.Hashtable;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.text.FieldPosition;
-
-import org.xml.sax.AttributeList;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.DOM;
-import org.apache.xalan.xsltc.NodeIterator;
-import org.apache.xalan.xsltc.dom.SingletonIterator;
-
-/**
- * Standard XSLT functions. All standard functions expect the current node 
- * and the DOM as their last two arguments.
- */
-public final class BasisLibrary implements Operators {
-
-    private final static String EMPTYSTRING = "";
-
-    /**
-     * Standard function count(node-set)
-     */
-    public static int countF(NodeIterator iterator) {
-	int counter = 0;
-	while (iterator.next() != NodeIterator.END) {
-	    ++counter;
-	}
-	return counter;
-    }
-
-    /**
-     * XSLT Standard function sum(node-set). 
-     * stringToDouble is inlined
-     */
-    public static double sumF(NodeIterator iterator, DOM dom) {
-	try {
-	    double result = 0.0;
-	    int node;
-	    while ((node = iterator.next()) != NodeIterator.END) {
-		result += Double.parseDouble(dom.getNodeValue(node));
-	    }
-	    return result;
-	}
-	catch (NumberFormatException e) {
-	    return Double.NaN;
-	}
-    }
-
-    /**
-     * XSLT Standard function string()
-     */
-    public static String stringF(int node, DOM dom) {
-	return dom.getNodeValue(node);
-    }
-
-    /**
-     * XSLT Standard function string(value)
-     */
-    public static String stringF(Object obj, DOM dom) {
-	if (obj instanceof NodeIterator) {
-	    return dom.getNodeValue(((NodeIterator)obj).reset().next());
-	}
-	else if (obj instanceof Node) {
-	    return dom.getNodeValue(((Node)obj).node);
-	}
-	else if (obj instanceof DOM) {
-	    return ((DOM)obj).getStringValue();
-	}
-	else {
-	    return obj.toString();
-	}
-    }
-
-    /**
-     * XSLT Standard function string(value)
-     */
-    public static String stringF(Object obj, int node, DOM dom) {
-	if (obj instanceof NodeIterator) {
-	    return dom.getNodeValue(((NodeIterator)obj).reset().next());
-	}
-	else if (obj instanceof Node) {
-	    return dom.getNodeValue(((Node)obj).node);
-	}
-	else if (obj instanceof DOM) {
-	    // When the first argument is a DOM we want the whole fecking
-	    // DOM and not just a single node - that would not make sense.
-	    //return ((DOM)obj).getNodeValue(node);
-	    return ((DOM)obj).getStringValue();
-	}
-	else {
-	    return obj.toString();
-	}
-    }
-
-    /**
-     * XSLT Standard function number()
-     */
-    public static double numberF(int node, DOM dom) {
-	return stringToReal(dom.getNodeValue(node));
-    }
-
-    /**
-     * XSLT Standard function number(value)
-     */
-    public static double numberF(Object obj, DOM dom) {
-	if (obj instanceof Double) {
-	    return ((Double) obj).doubleValue();
-	}
-	else if (obj instanceof Integer) {
-	    return ((Integer) obj).doubleValue();
-	}
-	else if (obj instanceof Boolean) {
-	    return  ((Boolean) obj).booleanValue() ? 1.0 : 0.0;
-	}
-	else if (obj instanceof String) {
-	    return stringToReal((String) obj);
-	}
-	else if (obj instanceof NodeIterator) {
-	    NodeIterator iter = (NodeIterator) obj;
-	    return stringToReal(dom.getNodeValue(iter.reset().next()));
-	}
-	else if (obj instanceof Node) {
-	    return stringToReal(dom.getNodeValue(((Node) obj).node));
-	}
-	else if (obj instanceof DOM) {
-	    return stringToReal(((DOM) obj).getStringValue());
-	}
-	else {
-	    runTimeError("Invalid argument type in call to number().");
-	    return 0.0;
-	}
-    }
-
-    /**
-     * XSLT Standard function boolean()
-     */
-    public static boolean booleanF(Object obj) {
-	if (obj instanceof Double) {
-	    final double temp = ((Double) obj).doubleValue();
-	    return temp != 0.0 && !Double.isNaN(temp);
-	}
-	else if (obj instanceof Integer) {
-	    return ((Integer) obj).doubleValue() != 0;
-	}
-	else if (obj instanceof Boolean) {
-	    return  ((Boolean) obj).booleanValue();
-	}
-	else if (obj instanceof String) {
-	    return !((String) obj).equals(EMPTYSTRING);
-	}
-	else if (obj instanceof NodeIterator) {
-	    NodeIterator iter = (NodeIterator) obj;
-	    return iter.reset().next() != NodeIterator.END;
-	}
-	else if (obj instanceof Node) {
-	    return true;
-	}
-	else if (obj instanceof DOM) {
-	    String temp = ((DOM) obj).getStringValue();
-	    return !temp.equals(EMPTYSTRING);
-	}
-	else {
-	    runTimeError("Invalid argument type in call to number().");
-	}
-	return false;
-    }
-
-    /**
-     * XSLT Standard function substring(). Must take a double because of
-     * conversions resulting into NaNs and rounding.
-     */
-    public static String substringF(String value, double start) {
-	try {
-	    final int strlen = value.length();
-	    int istart = (int)Math.round(start) - 1;
-
-	    if (Double.isNaN(start)) return(EMPTYSTRING);
-	    if (istart > strlen) return(EMPTYSTRING);
- 	    if (istart < 1) istart = 0;
-
-	    return value.substring(istart);
-	}
-	catch (IndexOutOfBoundsException e) {
-	    runTimeInternalError();
-	    return null;
-	}
-    }
-
-    /**
-     * XSLT Standard function substring(). Must take a double because of
-     * conversions resulting into NaNs and rounding.
-     */
-    public static String substringF(String value, double start, double length) {
-	try {
-	    final int strlen  = value.length();
-	    int istart = (int)Math.round(start) - 1;
-	    int isum   = istart + (int)Math.round(length);
-
-	    if (Double.isNaN(start) || Double.isNaN(length))
-		return(EMPTYSTRING);
-	    if (istart > strlen) return(EMPTYSTRING);
-	    if (isum < 0)  return(EMPTYSTRING);
-
- 	    if (istart < 0) istart = 0;
-
-	    if (isum > strlen)
-		return value.substring(istart);
-	    else
-		return value.substring(istart, isum);
-	}
-	catch (IndexOutOfBoundsException e) {
-	    runTimeInternalError();
-	    return null;
-	}
-    }
-
-    /**
-     * XSLT Standard function substring-after(). 
-     */
-    public static String substring_afterF(String value, String substring) {
-	final int index = value.indexOf(substring);
-	if (index >= 0)
-	    return value.substring(index + substring.length());
-	else
-	    return EMPTYSTRING;
-    }
-
-    /**
-     * XSLT Standard function substring-before(). 
-     */
-    public static String substring_beforeF(String value, String substring) {
-	final int index = value.indexOf(substring);
-	if (index >= 0)
-	    return value.substring(0, index);
-	else
-	    return EMPTYSTRING;
-    }
-
-    /**
-     * XSLT Standard function translate(). 
-     */
-    public static String translateF(String value, String from, String to) {
-	final int tol = to.length();
-	final int froml = from.length();
-	final int valuel = value.length();
-
-	final StringBuffer result = new StringBuffer();
-	for (int j, i = 0; i < valuel; i++) {
-	    final char ch = value.charAt(i);
-	    for (j = 0; j < froml; j++) {
-		if (ch == from.charAt(j)) {
-		    if (j < tol)
-			result.append(to.charAt(j));
-		    break;
-		}
-	    }	
-	    if (j == froml)
-		result.append(ch);
-	}
-	return result.toString();
-    }
-
-    /**
-     * XSLT Standard function normalize-space(). 
-     */
-    public static String normalize_spaceF(int node, DOM dom) {
-	return normalize_spaceF(dom.getNodeValue(node));
-    }
-
-    /**
-     * XSLT Standard function normalize-space(string). 
-     */
-    public static String normalize_spaceF(String value) {
-	int i = 0, n = value.length();
-	StringBuffer result = new StringBuffer();
-
-	while (i < n && isWhiteSpace(value.charAt(i)))
-	    i++;
-
-	while (true) {
-	    while (i < n && !isWhiteSpace(value.charAt(i))) {
-		result.append(value.charAt(i++));
-	    }
-	    if (i == n)
-		break;
-	    while (i < n && isWhiteSpace(value.charAt(i))) {
-		i++;
-	    }
-	    if (i < n)
-		result.append(' ');
-	}
-	return result.toString();
-    }
-
-    /**
-     * XSLT Standard function generate-id(). 
-     */
-    public static String generate_idF(int node) {
-	if (node > 0)
-	    // Only generate ID if node exists
-	    return "N" + node;
-	else
-	    // Otherwise return an empty string
-	    return EMPTYSTRING;
-    }
-    
-    /**
-     * utility function for calls to local-name(). 
-     */
-    public static String getLocalName(String value) {
-	int idx = value.lastIndexOf(':');
-	if (idx >= 0) value = value.substring(idx + 1);
-	idx = value.lastIndexOf('@');
-	if (idx >= 0) value = value.substring(idx + 1);
-	return(value);
-    }
-
-    /**
-     * External functions that cannot be resolved are replaced with a call
-     * to this method. This method will generate a runtime errors. A good
-     * stylesheet checks whether the function exists using conditional
-     * constructs, and never really tries to call it if it doesn't exist.
-     * But simple stylesheets may result in a call to this method.
-     * The compiler should generate a warning if it encounters a call to
-     * an unresolved external function.
-     */
-    public static void unresolved_externalF(String name) {
-	runTimeError("External function '"+name+"' not supported by XSLTC.");
-    }
-
-    /**
-     * XSLT Standard function namespace-uri(node-set).
-     */
-    public static String namespace_uriF(NodeIterator iter, DOM dom) {
-	return namespace_uriF(iter.next(), dom);
-    }
-
-    /**
-     * XSLT Standard function system-property(name)
-     */
-    public static String system_propertyF(String name) {
-	if (name.equals("xsl:version"))
-	    return("1.0");
-	if (name.equals("xsl:vendor"))
-	    return("Sun Microsystems' xsltc");
-	if (name.equals("xsl:vendor-url"))
-	    return("http://www.sun.com/");
-	
-	runTimeError("Invalid argument type '"+name+
-		     "' in call to system-property().");
-	return(EMPTYSTRING);
-    }
-
-    /**
-     * XSLT Standard function namespace-uri(). 
-     */
-    public static String namespace_uriF(int node, DOM dom) {
-	final String value = dom.getNodeName(node);
-	final int colon = value.lastIndexOf(':');
-	if (colon >= 0)
-	    return value.substring(0, colon);
-	else
-	    return EMPTYSTRING;
-    }
-
-    //-- Begin utility functions
-
-    private static boolean isWhiteSpace(char ch) {
-	return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r';
-    }
-
-    private static boolean compareStrings(String lstring, String rstring,
-					  int op, DOM dom) {
-	switch (op) {
-	case EQ:
-	    return lstring.equals(rstring);
-
-	case NE:
-	    return !lstring.equals(rstring);
-
-	case GT:
-	    return numberF(lstring, dom) > numberF(rstring, dom);
-
-	case LT:
-	    return numberF(lstring, dom) < numberF(rstring, dom);
-
-	case GE:
-	    return numberF(lstring, dom) >= numberF(rstring, dom);
-
-	case LE:
-	    return numberF(lstring, dom) <= numberF(rstring, dom);
-
-	default:
-	    runTimeInternalError();
-	    return false;
-	}
-    }
-
-    /**
-     * Utility function: node-set/node-set compare. 
-     */
-    public static boolean compare(NodeIterator left, NodeIterator right,
-				  int op, int node, DOM dom) {
-	int lnode;
-	left.reset();
-	
-	while ((lnode = left.next()) != NodeIterator.END) {
-	    final String lvalue = dom.getNodeValue(lnode);
-	    
-	    int rnode;
-	    right.reset();
-	    while ((rnode = right.next()) != NodeIterator.END) {
-		if (compareStrings(lvalue, dom.getNodeValue(rnode), op, dom)) {
-		    return true;
-		}
-	    }
-	} 
-	return false;
-    }
-
-    /**
-     * Utility function: node/node-set compare.
-     */
-    public static boolean compare(int node, NodeIterator nodeSet,
-				  int op, DOM dom) {
-	final String lvalue = dom.getNodeValue(node);
-	int rnode;
-	nodeSet.reset();
-	while ((rnode = nodeSet.next()) != NodeIterator.END) {
-	    if (compareStrings(lvalue, dom.getNodeValue(rnode), op, dom)) {
-		return true;
-	    }
-	} 
-	return false;
-    }
-
-    public static boolean compare(int node, NodeIterator iterator,
-				  int op, int dummy, DOM dom) {
-	iterator.reset();
-
-	int rnode;
-	String value;
-
-	switch(op) {
-	case EQ:
-	    /* TODO:
-	     * This needs figuring out: What sort of comparison is done here?
-	     * Are we comparing exact node id's, node types, or node values?
-	     * Values is the obvious for attributes, but what about elements?
-	     */
-	    value = dom.getNodeValue(node);
-	    while ((rnode = iterator.next()) != NodeIterator.END)
-		if (value.equals(dom.getNodeValue(rnode))) return true;
-	    // if (rnode == node) return true; It just ain't that easy!!!
-	    break;
-	case NE:
-	    value = dom.getNodeValue(node);
-	    while ((rnode = iterator.next()) != NodeIterator.END)
-		if (!value.equals(dom.getNodeValue(rnode))) return true;
-	    // if (rnode != node) return true;
-	    break;
-	case LT:
-	    // Assume we're comparing document order here
-	    while ((rnode = iterator.next()) != NodeIterator.END)
-		if (rnode > node) return true;
-	    break;
-	case GT:
-	    // Assume we're comparing document order here
-	    while ((rnode = iterator.next()) != NodeIterator.END)
-		if (rnode < node) return true;
-	    break;
-	} 
-	return(false);
-    }
-
-    public static boolean compare(NodeIterator left, final double rnumber,
-				  final int op, final int node, DOM dom) {
-	return(compare(left,rnumber,op,dom));
-    }
-
-    /**
-     * Utility function: node-set/number compare.
-     */
-    public static boolean compare(NodeIterator left, final double rnumber,
-				  final int op, DOM dom) {
-	int node;
-	left.reset();
-
-	switch (op) {
-	case EQ:
-	    while ((node = left.next()) != NodeIterator.END) {
-		if (numberF(dom.getNodeValue(node), dom) == rnumber)
-		    return true;
-	    }
-	    break;
-
-	case NE:
-	    while ((node = left.next()) != NodeIterator.END) {
-		if (numberF(dom.getNodeValue(node), dom) != rnumber)
-		    return true;
-	    }
-	    break;
-
-	case GT:
-	    while ((node = left.next()) != NodeIterator.END) {
-		if (numberF(dom.getNodeValue(node), dom) > rnumber)
-		    return true;
-	    }
-	    break;
-
-	case LT:
-	    while ((node = left.next()) != NodeIterator.END) {
-		if (numberF(dom.getNodeValue(node), dom) < rnumber)
-		    return true;
-	    }
-	    break;
-
-	case GE:
-	    while ((node = left.next()) != NodeIterator.END) {
-		if (numberF(dom.getNodeValue(node), dom) >= rnumber)
-		    return true;
-	    }
-	    break;
-
-	case LE:
-	    while ((node = left.next()) != NodeIterator.END) {
-		if (numberF(dom.getNodeValue(node), dom) <= rnumber)
-		    return true;
-	    }
-	    break;
-
-	default:
-	    runTimeInternalError();
-	}
-
-	return false;
-    }
-
-    /**
-     * Utility function: node-set/string comparison. 
-     */
-    public static boolean compare(NodeIterator left, final String rstring,
-				  int op, DOM dom) {
-	int node;
-	left.reset();
-	while ((node = left.next()) != NodeIterator.END) {
-	    if (compareStrings(dom.getNodeValue(node), rstring, op, dom)) {
-		return true;
-	    }
-	}
-	return false;
-    }
-
-    public static boolean compare(NodeIterator left, final String rstring,
-				  int op, int node, DOM dom) {
-	
-	if (compareStrings(dom.getNodeValue(node), rstring, op, dom)) {
-	    return true;
-	}
-	else {
-	    return false;
-	}
-    }
-
-    public static boolean compare(Object left, Object right,
-				  int op, int node, DOM dom) { 
-	boolean result = false;
-	boolean hasSimpleArgs = hasSimpleType(left) && hasSimpleType(right);
-
-	if (op != EQ && op != NE) {
-	    // If node-boolean comparison -> convert node to boolean
-	    if (left instanceof Node || right instanceof Node) {
-		if (left instanceof Boolean) {
-		    right = new Boolean(booleanF(right));
-		    hasSimpleArgs = true;
-		}
-		if (right instanceof Boolean) {
-		    left = new Boolean(booleanF(left));
-		    hasSimpleArgs = true;
-		}
-	    }
-
-	    if (hasSimpleArgs) {
-		switch (op) {
-		case GT:
-		    return numberF(left, dom) > numberF(right, dom);
-		    
-		case LT:
-		    return numberF(left, dom) < numberF(right, dom);
-		    
-		case GE:
-		    return numberF(left, dom) >= numberF(right, dom);
-		    
-		case LE:
-		    return numberF(left, dom) <= numberF(right, dom);
-		    
-		default:
-		    runTimeInternalError();
-		}
-	    }
-	    // falls through
-	}
-
-	if (hasSimpleArgs) {
-	    if (left instanceof Boolean || right instanceof Boolean) {
-		result = booleanF(left) == booleanF(right);
-	    }
-	    else if (left instanceof Double || right instanceof Double ||
-		     left instanceof Integer || right instanceof Integer) {
-		result = numberF(left, dom) == numberF(right, dom);
-	    }
-	    else { // compare them as strings
-		result = stringF(left, dom).equals(stringF(right, dom));
-	    }
-
-	    if (op == Operators.NE) {
-		result = !result;
-	    }
-	}
-	else {
-	    if (left instanceof Node) {
-		left = new SingletonIterator(((Node)left).node);
-	    }
-	    if (right instanceof Node) {
-		right = new SingletonIterator(((Node)right).node);
-	    }
-
-	    if (hasSimpleType(left) ||
-		left instanceof DOM && right instanceof NodeIterator) {
-		// swap operands
-		final Object temp = right; right = left; left = temp;
-	    }
-
-	    if (left instanceof DOM) {
-		if (right instanceof Boolean) {
-		    result = ((Boolean)right).booleanValue();
-		    return result == (op == Operators.EQ);
-		}
-
-		final String sleft = ((DOM)left).getStringValue();
-
-		if (right instanceof Number) {
-		    result = ((Number)right).doubleValue() ==
-			stringToReal(sleft);
-		}
-		else if (right instanceof String) {
-		    result = sleft.equals((String)right);
-		}
-		else if (right instanceof DOM) {
-		    result = sleft.equals(((DOM)right).getStringValue());
-		}
-
-		if (op == Operators.NE) {
-		    result = !result;
-		}
-		return result;
-	    }
-
-	    // Next, node-set/t for t in {real, string, node-set, result-tree}
-
-	    NodeIterator iter = ((NodeIterator)left).reset();
-
-	    if (right instanceof NodeIterator) {
-		result = compare(iter, (NodeIterator)right, op, node, dom);
-	    }
-	    else if (right instanceof String) {
-		//result = compare(iter, (String)right, op, node, dom);
-		result = compare(iter, (String)right, op, dom);
-	    }	
-	    else if (right instanceof Number) {
-		final double temp = ((Number)right).doubleValue();
-		result = compare(iter, temp, op, dom);
-	    }
-	    else if (right instanceof Boolean) {
-		boolean temp = ((Boolean)right).booleanValue();
-		result = (iter.reset().next() != NodeIterator.END) == temp;
-	    }
-	    else if (right instanceof DOM) {
-		result = compare(iter, ((DOM)right).getStringValue(),
-				 op, node, dom);
-	    }
-	    else if (right == null) {
-		return(false);
-	    }
-	    else {
-		runTimeError("Unknown argument type in call to equal.");
-	    }
-	}
-	return result;
-    }
-
-    /**
-     * Utility function: used to test context node's language
-     */
-    public static boolean testLanguage(String testLang, DOM dom, int node) {
-	// language for context node (if any)
-	String nodeLang = dom.getLanguage(node);
-	if (nodeLang == null)
-	    return(false);
-	else
-	    nodeLang = nodeLang.toLowerCase();
-
-	// compare context node's language agains test language
-	testLang = testLang.toLowerCase();
-	if (testLang.length() == 2) {
-	    return(nodeLang.startsWith(testLang));
-	}
-	else {
-	    return(nodeLang.equals(testLang));
-	}
-    }
-
-    private static boolean hasSimpleType(Object obj) {
-	return obj instanceof Boolean || obj instanceof Double ||
-	    obj instanceof Integer || obj instanceof String ||
-	    obj instanceof Node;
-    }
-
-    /**
-     * Utility function: used in StringType to convert a string to a real.
-     */
-    public static double stringToReal(String s) {
-	try {
-	    return Double.valueOf(s).doubleValue();
-	}
-	catch (NumberFormatException e) {
-	    return Double.NaN;
-	}
-    }
-
-    /**
-     * Utility function: used in StringType to convert a string to an int.
-     */
-    public static int stringToInt(String s) {
-	try {
-	    return Integer.valueOf(s).intValue();
-	}
-	catch (NumberFormatException e) {
-	    return(-1); // ???
-	}
-    }
-
-    /**
-     * Utility function: used in RealType to convert a real to a string.
-     * Removes the decimal if null.
-     */
-    public static String realToString(double d) {
-	final String result = Double.toString(d);
-	final int length = result.length();
-	if (result.charAt(length-2) == '.' && result.charAt(length-1) == '0') {
-	    return result.substring(0, length-2);
-	}
-	return result;
-    }
-
-    /**
-     * Utility function: used in RealType to convert a real to an integer
-     */
-    public static int realToInt(double d) {
-	final Double result = new Double(d);
-	return result.intValue();
-    }
-
-    /**
-     * Utility function: used to format/adjust  a double to a string. The 
-     * DecimalFormat object comes from the 'format_symbols' hashtable in 
-     * AbstractTranslet.
-     */
-    private static FieldPosition _fieldPosition = new FieldPosition(0);
-
-    public static String formatNumber(double number, String pattern,
-				      DecimalFormat formatter) {
-	try {
-	    StringBuffer result = new StringBuffer();
-	    formatter.applyLocalizedPattern(pattern);
-	    formatter.format(number,result,_fieldPosition);
-	    return(result.toString());
-	}
-	catch (IllegalArgumentException e) {
-	    runTimeError("Attempting to format number '"+ number +
-			 "' using pattern '" + pattern + "'.");
-	    return(EMPTYSTRING);
-	}
-    }
-    
-    /**
-     * Utility function: used to convert references to node-sets. If the
-     * obj is an instanceof Node then create a singleton iterator.
-     */
-    public static NodeIterator referenceToNodeSet(Object obj) {
-	try {
-	    // Convert var/param -> node
-	    if (obj instanceof Node) {
-		return(new SingletonIterator(((Node)obj).node));
-	    }
-	    // Convert var/param -> node-set
-	    else if (obj instanceof NodeIterator) {
-		return((NodeIterator)obj);
-	    }
-	    // Convert var/param -> result-tree fragment
-	    else if (obj instanceof DOM) {
-		DOM dom = (DOM)obj;
-		return(dom.getIterator());
-	    }
-	    else {
-		runTimeTypeError("reference", "node-set");
-		return null;
-	    }
-	}
-	catch (ClassCastException e) {
-	    runTimeTypeError("reference", "node-set");
-	    return null;
-	}
-    }
-
-    /**
-     * Utility function: used with nth position filters to convert a sequence
-     * of nodes to just one single node (the one at position n).
-     */
-    public static NodeIterator getSingleNode(NodeIterator iterator) {
-	int node = iterator.next();
-	return(new SingletonIterator(node));
-    }
-
-    /**
-     * Utility function: used in xsl:copy.
-     */
-    private static char[] _characterArray = new char[32];
-
-    public static void copy(Object obj,
-			    TransletOutputHandler handler,
-			    int node,
-			    DOM dom) {
-	try {
-	    if (obj instanceof NodeIterator) {
-		NodeIterator iter = (NodeIterator) obj;
-		//dom.copy(iter.reset(), handler);
-		//!!
-		System.err.println("not implemented copy iter");
-	    }
-	    else if (obj instanceof Node) {
-		dom.copy(((Node) obj).node, handler);
-	    }
-	    else if (obj instanceof DOM) {
-		((DOM)obj).copy(1, handler);
-	    }
-	    else {
-		String string = obj.toString();		// or call stringF()
-		final int length = string.length();
-		if (length > _characterArray.length)
-		    _characterArray = new char[length];
-		string.getChars(0, length, _characterArray, 0);
-		handler.characters(_characterArray, 0, length);
-	    }
-	}
-	catch (TransletException e) {
-	    runTimeError("TransletException raised in copy().");
-	}
-    }
-
-    /**
-     * Print a run-time type error message.
-     */
-    public static void runTimeTypeError(String from, String to) {
-	runTimeError("Invalid conversion from '" + from + "' to '" + to + "'.");
-    }
-
-    /**
-     * Print a run-time internal error message.
-     */
-    public static void runTimeInternalError() {
-	runTimeError("Internal error.");
-    }
-
-    /**
-     * Print a run-time error message.
-     */
-    public static void runTimeError(String message) {
-	throw new RuntimeException(message);
-    }
-
-    public static void consoleOutput(String msg) {
-	System.out.println(msg);
-    }
-
-    //-- End utility functions
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/Constants.java b/src/org/apache/xalan/xsltc/runtime/Constants.java
deleted file mode 100644
index 4f72e23..0000000
--- a/src/org/apache/xalan/xsltc/runtime/Constants.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import org.apache.xalan.xsltc.DOM;
-
-/**
- * This class defines constants used by both the compiler and the 
- * runtime system.
- */
-public interface Constants {
-
-    final static int ANY       = -1;
-    final static int ATTRIBUTE = -2;
-    final static int ROOT      = DOM.ROOT;
-    final static int TEXT      = DOM.TEXT;
-    final static int ELEMENT   = DOM.ELEMENT;
-    final static int COMMENT   = DOM.COMMENT;
-    final static int PROCESSING_INSTRUCTION = DOM.PROCESSING_INSTRUCTION;
-
-    public static String XSLT_URI = "http://www.w3.org/1999/XSL/Transform";
-    public static final String NAMESPACE_FEATURE =
-	"http://xml.org/sax/features/namespaces";
-
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/DefaultRun.java b/src/org/apache/xalan/xsltc/runtime/DefaultRun.java
deleted file mode 100644
index d3dfdce..0000000
--- a/src/org/apache/xalan/xsltc/runtime/DefaultRun.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import java.io.*;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.UnknownHostException;
-import java.util.Vector;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-import org.apache.xalan.xsltc.dom.Axis;
-import org.apache.xalan.xsltc.dom.DTDMonitor;
-import org.apache.xalan.xsltc.runtime.Constants;
-
-final public class DefaultRun {
-
-    private TransletOutputHandler _handler;
-
-    private String  _fileName;
-    private String  _className;
-    private String  _jarFileSrc;
-    private boolean _isJarFileSpecified = false;
-    private Vector  _params = null;
-    private boolean _uri, _debug;
-
-    AbstractTranslet _translet;
-
-    public DefaultRun(String className, String fileName,
-		      boolean uri, boolean debug) {
-	_fileName = fileName;
-	_className = className;
-	_uri = uri;
-	_debug = debug;
-    }
-
-    public void setParameters(Vector params) {
-	_params = params;
-    }
-
-    private void setJarFileInputSrc(boolean flag,  String jarFile) {
-	// TODO: at this time we do not do anything with this
-	// information, attempts to add the jarfile to the CLASSPATH
-	// were successful via System.setProperty, but the effects
-	// were not visible to the running JVM. For now we add jarfile
-	// to CLASSPATH in the wrapper script that calls this program. 
-	_isJarFileSpecified = flag;
-	// TODO verify jarFile exists...
-	_jarFileSrc = jarFile;	
-    }
-
-    private void doTransform() {
-	try {
-	    final Class clazz = Class.forName(_className);
-	    final Translet translet = (Translet)clazz.newInstance();
-
-	    // Create a SAX parser and get the XMLReader object it uses
-	    final SAXParserFactory factory = SAXParserFactory.newInstance();
-	    try {
-		factory.setFeature(Constants.NAMESPACE_FEATURE, true);
-	    }
-	    catch (Exception e) {
-		factory.setNamespaceAware(true);
-	    }
-	    final SAXParser parser = factory.newSAXParser();
-	    final XMLReader reader = parser.getXMLReader();
-
-	    // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
-	    final DOMImpl dom = new DOMImpl();
-	    reader.setContentHandler(dom.getBuilder());
-	    // Create a DTD monitor and pass it to the XMLReader object
-	    final DTDMonitor dtdMonitor = new DTDMonitor();
-	    dtdMonitor.handleDTD(reader);
-
-	    _translet = (AbstractTranslet)translet;
-	    dom.setDocumentURI(_fileName);
-	    if (_uri)
-		reader.parse(_fileName);
-	    else
-		reader.parse("file:"+(new File(_fileName).getAbsolutePath()));
-	    
-	    // Set size of key/id indices
-	    _translet.setIndexSize(dom.getSize());
-	    // If there are any elements with ID attributes, build an index
-	    dtdMonitor.buildIdIndex(dom, 0, _translet);
-
-	    _translet.setDTDMonitor(dtdMonitor);
-
-	    // Pass global parameters
-	    int n = _params.size();
-	    for (int i = 0; i < n; i++) {
-		Parameter param = (Parameter) _params.elementAt(i);
-		translet.addParameter(param._name, param._value);
-	    }
-
-	    // Transform the document
-	    String encoding = _translet._encoding;
-
-	    DefaultSAXOutputHandler saxHandler =
-		new DefaultSAXOutputHandler(System.out, encoding);
-	    TextOutput textOutput =
-		new TextOutput((ContentHandler)saxHandler,
-			       (LexicalHandler)saxHandler, encoding);
-	    translet.transform(dom, textOutput);
-
-	    if (_debug) {
-		TransletOutputBase handler = new TransletOutputBase();
-		long start = System.currentTimeMillis();
-		final int nTimes = 100;
-		for (int i = 0; i < nTimes; i++)
-		    translet.transform(dom, dom.getIterator(), handler);
-		long end = System.currentTimeMillis();
-		System.out.println("total " + (end - start) + " msec for " 
-				   + nTimes + " transformations");
-		System.out.println(((double)end - start)/nTimes + " msec avg");
-	    }
-	}
-	catch (TransletException e) {
-	    System.err.println("\nTranslet Error: " + e.getMessage());
-	    if (_debug) {
-		System.err.println(e.toString());
-		e.printStackTrace();
-	    }
-	    doSystemExit(1);	    
-	}
-	catch (RuntimeException e) {
-	    System.err.println("\nRuntime Error: " + e.getMessage());
-	    if (_debug) {
-		System.err.println(e.toString());
-		e.printStackTrace();
-	    }
-	    doSystemExit(1);
-	}
-	catch (FileNotFoundException e) {
-	    System.err.println("Error: File or URI '"+_fileName+"' not found.");
-	    doSystemExit(1);
-	}
-	catch (MalformedURLException e) {
-	    System.err.println("Error: Invalid URI '"+_fileName+"'.");
-	    doSystemExit(1);
-	}
-	catch (ClassNotFoundException e) {
-	    System.err.println("Error: Cannot find class '"+_className+"'.");
-	    doSystemExit(1);
-	}
-        catch (UnknownHostException e) {
-	    System.err.println("Error: Can't resolve URI specification '"+ 
-			       _fileName+"'.");
-	    doSystemExit(1);
-        }
-	catch (Exception e) {
-	    e.printStackTrace();
-	    System.err.println("Error: internal error.");
-	    doSystemExit(1);
-	}
-    }
-
-    /** If we should call System.exit or not */
-    protected static boolean allowSystemExit = true;
-
-    /** Worker method to call System.exit or not */
-    protected static void doSystemExit(int retVal) {
-        if (allowSystemExit)
-            System.exit(retVal);
-    }
-
-    private final static String USAGE_STRING =
-	"Usage: \n" +
-	"     xslt [-j <jarfile>] {-u <document_url> | <document>} <class>\n"+
-	"          [<name1>=<value1> ...]\n\n" +
-	"           <document> is the xml document to be transformed, or\n" +
-	"           <document_url> is a url for the xml document,\n" +
-	"           <class> is the translet class which is either in\n" +
-	"           user's CLASSPATH or in the <jarfile> specified \n" +
-	"           with the -j option.\n" +
-	"          also: [-x] (debug), [-s] (don't allow System.exit)";	
-
-    public static void printUsage() {
-	System.err.println(USAGE_STRING);
-	System.exit(1);
-    }
-
-    public static void main(String[] args) {
-	try {
-	    if (args.length > 0) {
-		int i;
-		boolean uri = false, debug = false;
-		boolean isJarFileSpecified = false;
-		String  jarFile = null;
-
-		// Parse options starting with '-'
-		for (i = 0; i < args.length && args[i].charAt(0) == '-'; i++) {
-		    if (args[i].equals("-u")) {
-			uri = true;
-		    }
-		    else if (args[i].equals("-s")){
-			allowSystemExit = false;
-		    }
-		    else if (args[i].equals("-x")) {
-			debug = true;
-		    }
-		    else if (args[i].equals("-j")) {
-			isJarFileSpecified = true;	
-			jarFile = args[++i];
-		    }
-		    else {
-			printUsage();
-		    }
-		}
-
-		// Enough arguments left ?
-		if (args.length - i < 2) {
-		    printUsage();
-		}
-
-		// Get document file and class name
-		DefaultRun handler = new DefaultRun(args[i+1], args[i], 
-						    uri, debug);
-		handler.setJarFileInputSrc(isJarFileSpecified,	jarFile);
-
-		// Parse stylesheet parameters
-		Vector params = new Vector();
-		for (i += 2; i < args.length; i++) {
-		    int equal = args[i].indexOf('=');
-		    if (equal > 0) {
-			final Parameter param =
-			    new Parameter(args[i].substring(0, equal), 
-					  args[i].substring(equal + 1,
-							    args[i].length()));
-			params.addElement(param);
-		    }
-		    else {
-			printUsage();
-		    }
-		}
-
-		if (i == args.length) {
-		    handler.setParameters(params);
-		    handler.doTransform();
-		    doSystemExit(0);
-		}
-	    }else{
-	       printUsage();
-	    }
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java b/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java
deleted file mode 100644
index eccc475..0000000
--- a/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- * @author G. Todd Miller 
- * @author Santiago Pericas-Geertsen
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.BufferedWriter;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-public class DefaultSAXOutputHandler implements ContentHandler, LexicalHandler {
-
-    // The output writer
-    private Writer _writer;
-
-    // Contains end-tags for closing elements (for speeding up output)
-    private Hashtable _endTags = new Hashtable();
-    // Contains commonly used attributes (for speeding up output)
-    private Hashtable _attributeTemplates = new Hashtable();
-    // Contains all HTML elements that should not get an end tag
-    private Hashtable _emptyElements = new Hashtable();
-    // Contains the name of the last opened element (set in startElement())
-    private String _element = null;
-
-    // Settings passed on from TextOutput
-    private int	    _outputType = TextOutput.UNKNOWN;
-    private String  _encoding   = "utf-8";
-    private String  _version    = "1.0";
-    private String  _standalone = null;
-    private boolean _indent = false;
-    private boolean _omitHeader = false;
-
-    // This variable is set to 'true' when a start tag is left open
-    private boolean _startTagOpen = false;
-
-    // Commonly used strings are stored as char arrays for speed
-    private static final char[] BEGPI    = "<?".toCharArray();
-    private static final char[] ENDPI    = "?>".toCharArray();
-    private static final char[] GT_CR    = ">".toCharArray();
-    private static final char[] GT_LT_SL = "></".toCharArray();
-    private static final char[] SL_GT    = "/>".toCharArray();
-    private static final char[] XMLNS    = " xmlns".toCharArray();
-
-    // All of these are used to control/track output indentation
-    private static final char[] INDENT = "                    ".toCharArray();
-    private static final int MAX_INDENT_LEVEL = (INDENT.length >> 1);
-    private static final int MAX_INDENT       = INDENT.length;
-
-    private static final String EMPTYSTRING = "";
-
-    private boolean _lineFeedNextStartTag = false;
-    private boolean _linefeedNextEndTag = false;
-    private boolean _indentNextEndTag = false;
-    private int     _indentLevel = 0;
-
-    // This is used for aggregating namespace declarations
-    private AttributeList _namespaceDeclarations = new AttributeList();
-
-    /**
-     * Constructor - set Writer to send output to and output encoding
-     */
-    public DefaultSAXOutputHandler(Writer writer, String encoding)
-	throws IOException {
-	_writer = writer;
-	_encoding = encoding;
-	init();
-    }
-
-    /**
-     * Constructor - simple, initially for use in servlets
-     */
-    public DefaultSAXOutputHandler(Writer writer) throws IOException {
-	this(writer, "utf-8");
-    }
-
-    /**
-     * Constructor - set output-stream & output encoding. 
-     */
-    public DefaultSAXOutputHandler(OutputStream out, String encoding)
-	throws IOException {
-
-        OutputStreamWriter writer;
-        try {
-            writer = new OutputStreamWriter(out, _encoding = encoding);
-        }
-        catch (java.io.UnsupportedEncodingException e) {
-            writer = new OutputStreamWriter(out, _encoding = "utf-8" );
-        }
-        _writer = new BufferedWriter(writer);
-	init();
-    }
-
-    /**
-     * Constructor - set output file and output encoding
-     */
-    public DefaultSAXOutputHandler(String filename, String encoding)
-	throws IOException {
-	this(new FileOutputStream(filename), encoding);
-    }
-
-    /**
-     * Utility method: Initialise the output handler 
-     */
-    private void init() throws IOException {
-
-	// These are HTML tags that can occur as empty elements with
-	// no closing tags (such as <br> insteadof XHTML's <br/>).
-        final String[] tags = { "area", "base", "basefont", "br",
-				"col", "frame", "hr", "img", "input",
-				"isindex", "link", "meta", "param" };
-        for (int i = 0; i < tags.length; i++)
-            _emptyElements.put(tags[i],tags[i]);
-
-	_endTags.clear();
-	_outputType = TextOutput.UNKNOWN;
-	_indent = false;
-	_indentNextEndTag = false;
-	_indentLevel = 0;
-	_startTagOpen = false;
-    }
-
-    /**
-     * Close the output stream
-     */
-    public void close() {
-	try {
-	    if (_writer != null) _writer.close();
-	}
-	catch (IOException e) {
-	    // what can you do?
-	}
-    }
-
-    /**
-     * Utility method - outputs an XML header
-     */
-    private void emitHeader() throws SAXException {
-	// First check if the 'omit-xml-declaration' was set to yes in the
-	// stylesheet's <xsl:output> element (if any)
-	if (_omitHeader) return;
-
-	// If not go ahead and output the XML header
-	StringBuffer buffer = new StringBuffer();
-	buffer.append("<?xml version=\"");
-	buffer.append(_version);
-	buffer.append("\" encoding=\"");
-	buffer.append(_encoding);
-	if (_standalone != null) {
-	    buffer.append("\" standalone=\"");
-	    buffer.append(_standalone);
-	}
-	buffer.append("\" ?>\n");
-	characters(buffer.toString());
-    }
-
-    /**
-     * Utility method - determine output type; XML or HTML
-     */
-    private void determineOutputType(String element) throws SAXException {
-	// Assume this is an HTML document if first element is <html>
-	if ((element != null) && (element.toLowerCase().equals("html"))) {
-	    _outputType = TextOutput.HTML;
-	}
-	// Otherwise we assume this is an XML document
-	else {
-	    _outputType = TextOutput.XML;
-	    emitHeader();
-	}
-    }
-
-    /**
-     * SAX2: Receive notification of the beginning of a document.
-     */
-    public void startDocument() throws SAXException { }
-
-    /**
-     * SAX2: Receive notification of the end of an element.
-     */
-    public void endDocument() throws SAXException  { 
-        try {
-	    _writer.flush();
-        } catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * SAX2: Receive notification of the beginning of an element.
-     */
-    public void startElement(String uri, String localname,
-			     String elementName, Attributes attrs) throws
-	SAXException {
-	try {
-	    // Determine the output document type if not already known
-	    if (_outputType == TextOutput.UNKNOWN)
-		determineOutputType(elementName);
-
-            if (_startTagOpen) closeStartTag(true); // Close any open element.
-            _element = elementName; // Save element name
-
-	    // Handle indentation (not a requirement)
-            if (_indent) {
-		if (!_emptyElements.containsKey(elementName.toLowerCase())) {
-		    indent(_lineFeedNextStartTag);
-		    _lineFeedNextStartTag = true;
-		    _indentNextEndTag = false;
-		}
-		_indentLevel++;
-            }
-
-	    // Now, finally, output the start tag for the element.
-	    _writer.write('<');
-	    _writer.write(elementName);
-	    _startTagOpen = true;
-	    _indentNextEndTag = false;
-
-	    // Output namespace declarations first...
-	    int declCount = _namespaceDeclarations.getLength();
-	    for (int i=0; i<declCount; i++) {
-		final String prefix = _namespaceDeclarations.getQName(i);
-		_writer.write(XMLNS);
-		if ((prefix != null) && (prefix != EMPTYSTRING)) {
-		    _writer.write(':');
-		    _writer.write(prefix);
-		}
-		_writer.write('=');
-		_writer.write('\"');
-		_writer.write(_namespaceDeclarations.getValue(i));
-		_writer.write('\"');
-            }
-	    _namespaceDeclarations.clear();
-
-	    // ...then output all attributes
-	    int attrCount = attrs.getLength();
-	    for (int i=0; i<attrCount; i++) {
-		_writer.write(' ');
-		_writer.write(attrs.getQName(i));
-		_writer.write('=');
-		_writer.write('\"');
-		_writer.write(attrs.getValue(i));
-		_writer.write('\"');
-            }
-	} catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * SAX2: Receive notification of the end of an element.
-     */
-    public void endElement(String uri, String localname,
-			   String elementName)  throws SAXException {
-	try {
-
-            if (_indent) _indentLevel--;
-
-            if (_startTagOpen) {
-                closeStartTag(false);
-            }
-            else {
-                if ((_indent) && (_indentNextEndTag)) {
-		    indent(_indentNextEndTag);
-		    _indentNextEndTag = true;
-		}
-                char[] endTag = (char[])_endTags.get(elementName);
-                if (endTag == null) {
-		    // We dont' want to concatenate String objects!!!!
-		    // endTag = ("</"+elementName+">").toCharArray();
-		    final int len = elementName.length();
-		    final char[] src = elementName.toCharArray();
-		    endTag = new char[len+3];
-		    System.arraycopy(src, 0, endTag, 2, len);
-		    endTag[0] = '<';
-		    endTag[1] = '/';
-		    endTag[len+2] = '>';
-                    _endTags.put(elementName,endTag);
-                }
-                _writer.write(endTag);
-            }
-            _indentNextEndTag = true;
-        } catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * Utility method - pass a string to the SAX handler's characters() method
-     */
-    private void characters(String str) throws SAXException{
-	final char[] ch = str.toCharArray();
-	characters(ch, 0, ch.length);
-    }
-
-    /**
-     * Utility method - pass a whole character array to the SAX handler
-     */
-    private void characters(char[] ch) throws SAXException{
-	characters(ch, 0, ch.length);
-    }
-
-    /**
-     * SAX2: Receive notification of character data.
-     */
-    public void characters(char[] ch, int off, int len) throws SAXException {
-        try {
-	    // Determine the output document type if not already known
-	    if (_outputType == TextOutput.UNKNOWN)
-		determineOutputType(null);
-	    
-            if (len == 0) return;
-
-            // Close any open start-tags.
-            if (_startTagOpen) closeStartTag(true);
-
-            // Output text
-	    _writer.write(ch, off, len);
-        }
-        catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * SAX2: Receive notification of a processing instruction.
-     */
-    public void processingInstruction(String target, String data)
-	throws SAXException {
-	try {
-            if (_startTagOpen) closeStartTag(true);
-            _writer.write(BEGPI);
-            _writer.write(target);
-            _writer.write(' ');
-            _writer.write(data);
-            if (_outputType == TextOutput.HTML)
-                _writer.write('>');
-            else
-                _writer.write(ENDPI);
-
-        } catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * SAX2: Receive notification of ignorable whitespace in element content.
-     */
-    public void ignorableWhitespace(char[] ch, int start, int len) { }
-
-    /**
-     * SAX2: Receive an object for locating the origin of SAX document events.
-     */
-    public void setDocumentLocator(Locator locator) { } 
-
-    /**
-     * SAX2: Receive notification of a skipped entity.
-     */
-    public void skippedEntity(String name) { }
-
-    /**
-     * SAX2: Begin the scope of a prefix-URI Namespace mapping.
-     *       Namespace declarations are output in startElement()
-     */
-    public void startPrefixMapping(String prefix, String uri) {
-	_namespaceDeclarations.add(prefix,uri);
-    }
-
-    /**
-     * SAX2: End the scope of a prefix-URI Namespace mapping.
-     */
-    public void endPrefixMapping(String prefix) {
-	// Do nothing
-    }
-
-    // The above are ignored methods of the org.xml.sax.ext.LexicalHandler intf.
-    public void startCDATA() { }
-    public void endCDATA() { }
-    public void comment(char[] ch, int start, int length) { }
-    public void startEntity(java.lang.String name) { }
-    public void endDTD() { }
-    public void endEntity(String name) { }
-
-    /**
-     * This method is part of the LexicalHandler interface. It is only used to
-     * pass DOCTYPE declarations (based on the doctype-system/public attributes
-     * in the <xsl:output> element) to the output handler.
-     * @param name     The document type name (name of first element)
-     * @param publicId <xsl:output doctype-public="..."/>
-     * @param systemId <xsl:output doctype-system="..."/>
-     * @throws SAXException Whenever
-     */
-    public void startDTD(String name, String publicId, String systemId)
-	throws SAXException {
-	try {
-	    StringBuffer buf = new StringBuffer("<!DOCTYPE ");
-	    buf.append(name);
-	    if (publicId == null) {
-		buf.append(" SYSTEM");
-	    }
-	    else {
-		buf.append(" PUBLIC \"");
-		buf.append(publicId);
-		buf.append("\"");
-	    }
-	    if (systemId != null) {
-		buf.append(" \"");
-		buf.append(systemId);
-		buf.append("\">\n");
-	    }
-	    else {
-		buf.append(">\n");
-	    }
-	    _writer.write(buf.toString());
-	}
-        catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * Adds a newline in the output stream and indents to correct level
-     */
-    private void indent(boolean linefeed) throws IOException {
-        if (linefeed)
-            _writer.write('\n');
-        if (_indentLevel < MAX_INDENT_LEVEL)
-            _writer.write(INDENT, 0, (_indentLevel+_indentLevel));
-        else
-            _writer.write(INDENT, 0, MAX_INDENT);
-    }
-
-    /**
-     * Closes a start tag of an element
-     */
-    private void closeStartTag(boolean content) throws SAXException {
-        try {
-            // Take special care when outputting empty tags in HTML documents.
-            if (!content) {
-                if (_outputType == TextOutput.HTML) {
-                    // HTML: output empty element as <tag> or <tag></tag>
-                    if (!_emptyElements.containsKey(_element.toLowerCase())){
-                        _writer.write(GT_LT_SL);
-                        _writer.write(_element);
-                    }
-		    else {
-			_writer.write(GT_CR);
-		    }
-                }
-                else {
-                    // XML: output empty element as <tag/>
-                    _writer.write(SL_GT);
-                }
-            }
-            else {
-              _writer.write('>');
-            }
-            _startTagOpen = false;
-        }
-        catch (IOException e) {
-            throw new SAXException(e);
-        }
-    }
-
-    /**
-     * Turns output indentation on/off (used with XML and HTML output only)
-     * Breaks the SAX HandlerBase interface, but TextOutput will only call
-     * this method of the SAX handler is an instance of this class.
-     */
-    public void setIndent(boolean indent) {
-        _indent = indent;
-    }
-
-    /**
-     * Sets the version number that will be output in the XML header.
-     */
-    public void setVersion(String version) {
-	_version = version;
-    }
-
-    /**
-     * Sets the 'standalone' attribute that will be output in the XML header.
-     * The attribute will be omitted unless this method is called.
-     */
-    public void setStandalone(String standalone) {
-	_standalone = standalone;
-    }
-
-    /**
-     * Turns xml declaration generation on/off, dependent on the attribute
-     * omit-xml-declaration in any xsl:output element. 
-     * Breaks the SAX HandlerBase interface, but TextOutput will only call
-     * this method of the SAX handler is an instance of this class.
-     */
-    public void omitHeader(boolean value) {
-        _omitHeader = value;
-    }
-
-    /**
-     * Set the output type (either TEXT, HTML or XML)
-     * Breaks the SAX HandlerBase interface, but TextOutput will only call
-     * this method of the SAX handler is an instance of this class.
-     */
-    public void setOutputType(int type) throws SAXException {
-	_outputType = type;
-	if (_outputType == TextOutput.XML ) {
-	    emitHeader();
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/Hashtable.java b/src/org/apache/xalan/xsltc/runtime/Hashtable.java
deleted file mode 100644
index 9d41fcb..0000000
--- a/src/org/apache/xalan/xsltc/runtime/Hashtable.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import java.io.*;
-import java.util.Enumeration;
-
-/**
- * IMPORTANT NOTE:
- * This code was taken from Sun's Java1.1 JDK java.util.HashTable.java
- * All "synchronized" keywords and some methods we do not need have been 
- * all been removed.
- */
-
-/**
- * Object that wraps entries in the hash-table
- */
-class HashtableEntry {
-    int hash;
-    Object key;
-    Object value;
-    HashtableEntry next;
-
-    protected Object clone() {
-	HashtableEntry entry = new HashtableEntry();
-	entry.hash = hash;
-	entry.key = key;
-	entry.value = value;
-	entry.next = (next != null) ? (HashtableEntry)next.clone() : null;
-	return entry;
-    }
-}
-
-/**
- * The main hash-table implementation
- */
-public class Hashtable {
-
-    private transient HashtableEntry table[]; // hash-table entries
-    private transient int count;              // number of entries
-    private int threshold;                    // current size of hash-tabke
-    private float loadFactor;                 // load factor
-
-    /**
-     * Constructs a new, empty hashtable with the specified initial 
-     * capacity and the specified load factor. 
-     */
-    public Hashtable(int initialCapacity, float loadFactor) {
-	if (initialCapacity <= 0) initialCapacity = 11;
-	if (loadFactor <= 0.0) loadFactor = 0.75f;
-	this.loadFactor = loadFactor;
-	table = new HashtableEntry[initialCapacity];
-	threshold = (int)(initialCapacity * loadFactor);
-    }
-
-    /**
-     * Constructs a new, empty hashtable with the specified initial capacity
-     * and default load factor.
-     */
-    public Hashtable(int initialCapacity) {
-	this(initialCapacity, 0.75f);
-    }
-
-    /**
-     * Constructs a new, empty hashtable with a default capacity and load
-     * factor. 
-     */
-    public Hashtable() {
-	this(101, 0.75f);
-    }
-
-    /**
-     * Returns the number of keys in this hashtable.
-     */
-    public int size() {
-	return count;
-    }
-
-    /**
-     * Tests if this hashtable maps no keys to values.
-     */
-    public boolean isEmpty() {
-	return count == 0;
-    }
-
-    /**
-     * Returns an enumeration of the keys in this hashtable.
-     */
-    public Enumeration keys() {
-	return new HashtableEnumerator(table, true);
-    }
-
-    /**
-     * Returns an enumeration of the values in this hashtable.
-     * Use the Enumeration methods on the returned object to fetch the elements
-     * sequentially.
-     */
-    public Enumeration elements() {
-	return new HashtableEnumerator(table, false);
-    }
-
-    /**
-     * Tests if some key maps into the specified value in this hashtable.
-     * This operation is more expensive than the <code>containsKey</code>
-     * method.
-     */
-    public boolean contains(Object value) {
-
-	if (value == null) throw new NullPointerException();
-
-	int i;
-	HashtableEntry e;
-	HashtableEntry tab[] = table;
-
-	for (i = tab.length ; i-- > 0 ;) {
-	    for (e = tab[i] ; e != null ; e = e.next) {
-		if (e.value.equals(value)) {
-		    return true;
-		}
-	    }
-	}
-	return false;
-    }
-
-    /**
-     * Tests if the specified object is a key in this hashtable.
-     */
-    public boolean containsKey(Object key) {
-	HashtableEntry e;
-	HashtableEntry tab[] = table;
-	int hash = key.hashCode();
-	int index = (hash & 0x7FFFFFFF) % tab.length;
-
-	for (e = tab[index] ; e != null ; e = e.next)
-	    if ((e.hash == hash) && e.key.equals(key))
-		return true;
-
-	return false;
-    }
-
-    /**
-     * Returns the value to which the specified key is mapped in this hashtable.
-     */
-    public Object get(Object key) {
-	HashtableEntry e;
-	HashtableEntry tab[] = table;
-	int hash = key.hashCode();
-	int index = (hash & 0x7FFFFFFF) % tab.length;
-
-	for (e = tab[index] ; e != null ; e = e.next) 
-	    if ((e.hash == hash) && e.key.equals(key)) 
-		return e.value;
-
-	return null;
-    }
-
-    /**
-     * Rehashes the contents of the hashtable into a hashtable with a 
-     * larger capacity. This method is called automatically when the 
-     * number of keys in the hashtable exceeds this hashtable's capacity 
-     * and load factor. 
-     */
-    protected void rehash() {
-	HashtableEntry e, old;
-	int i, index;
-	int oldCapacity = table.length;
-	HashtableEntry oldTable[] = table;
-
-	int newCapacity = oldCapacity * 2 + 1;
-	HashtableEntry newTable[] = new HashtableEntry[newCapacity];
-
-	threshold = (int)(newCapacity * loadFactor);
-	table = newTable;
-
-	for (i = oldCapacity ; i-- > 0 ;) {
-	    for (old = oldTable[i] ; old != null ; ) {
-		e = old;
-		old = old.next;
-		index = (e.hash & 0x7FFFFFFF) % newCapacity;
-		e.next = newTable[index];
-		newTable[index] = e;
-	    }
-	}
-    }
-
-    /**
-     * Maps the specified <code>key</code> to the specified 
-     * <code>value</code> in this hashtable. Neither the key nor the 
-     * value can be <code>null</code>. 
-     * <p>
-     * The value can be retrieved by calling the <code>get</code> method 
-     * with a key that is equal to the original key. 
-     */
-    public Object put(Object key, Object value) {
-	// Make sure the value is not null
-	if (value == null) throw new NullPointerException();
-
-	// Makes sure the key is not already in the hashtable.
-	HashtableEntry e;
-	HashtableEntry tab[] = table;
-	int hash = key.hashCode();
-	int index = (hash & 0x7FFFFFFF) % tab.length;
-
-	for (e = tab[index] ; e != null ; e = e.next) {
-	    if ((e.hash == hash) && e.key.equals(key)) {
-		Object old = e.value;
-		e.value = value;
-		return old;
-	    }
-	}
-
-	// Rehash the table if the threshold is exceeded
-	if (count >= threshold) {
-	    rehash();
-	    return put(key, value);
-	} 
-
-	// Creates the new entry.
-	e = new HashtableEntry();
-	e.hash = hash;
-	e.key = key;
-	e.value = value;
-	e.next = tab[index];
-	tab[index] = e;
-	count++;
-	return null;
-    }
-
-    /**
-     * Removes the key (and its corresponding value) from this 
-     * hashtable. This method does nothing if the key is not in the hashtable.
-     */
-    public Object remove(Object key) {
-	HashtableEntry e, prev;
-	HashtableEntry tab[] = table;
-	int hash = key.hashCode();
-	int index = (hash & 0x7FFFFFFF) % tab.length;
-	for (e = tab[index], prev = null ; e != null ; prev = e, e = e.next) {
-	    if ((e.hash == hash) && e.key.equals(key)) {
-		if (prev != null)
-		    prev.next = e.next;
-		else
-		    tab[index] = e.next;
-		count--;
-		return e.value;
-	    }
-	}
-	return null;
-    }
-
-    /**
-     * Clears this hashtable so that it contains no keys. 
-     */
-    public void clear() {
-	HashtableEntry tab[] = table;
-	for (int index = tab.length; --index >= 0; )
-	    tab[index] = null;
-	count = 0;
-    }
-
-    /**
-     * Returns a rather long string representation of this hashtable.
-     * Handy for debugging - leave it here!!!
-     */
-    public String toString() {
-	int i;
-	int max = size() - 1;
-	StringBuffer buf = new StringBuffer();
-	Enumeration k = keys();
-	Enumeration e = elements();
-	buf.append("{");
-
-	for (i = 0; i <= max; i++) {
-	    String s1 = k.nextElement().toString();
-	    String s2 = e.nextElement().toString();
-	    buf.append(s1 + "=" + s2);
-	    if (i < max) buf.append(", ");
-	}
-	buf.append("}");
-	return buf.toString();
-    }
-
-    /**
-     * A hashtable enumerator class.  This class should remain opaque 
-     * to the client. It will use the Enumeration interface.
-     */
-    class HashtableEnumerator implements Enumeration {
-	boolean keys;
-	int index;
-	HashtableEntry table[];
-	HashtableEntry entry;
-
-	HashtableEnumerator(HashtableEntry table[], boolean keys) {
-	    this.table = table;
-	    this.keys = keys;
-	    this.index = table.length;
-	}
-	
-	public boolean hasMoreElements() {
-	    if (entry != null) {
-		return true;
-	    }
-	    while (index-- > 0) {
-		if ((entry = table[index]) != null) {
-		    return true;
-		}
-	    }
-	    return false;
-	}
-
-	public Object nextElement() {
-	    if (entry == null) {
-		while ((index-- > 0) && ((entry = table[index]) == null));
-	    }
-	    if (entry != null) {
-		HashtableEntry e = entry;
-		entry = e.next;
-		return keys ? e.key : e.value;
-	    }
-	    return null;
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/MessageHandler.java b/src/org/apache/xalan/xsltc/runtime/MessageHandler.java
deleted file mode 100644
index 120c0ca..0000000
--- a/src/org/apache/xalan/xsltc/runtime/MessageHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-public class MessageHandler {
-    public void displayMessage(String msg) {
-	System.err.println(msg);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/Node.java b/src/org/apache/xalan/xsltc/runtime/Node.java
deleted file mode 100644
index 98606da..0000000
--- a/src/org/apache/xalan/xsltc/runtime/Node.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-/**
- * This class is used as "wrapper" for dom nodes. Wrappers are needed when
- * a node is passed as a parameter to a template.
- */
-public class Node {
-    public int node;
-    public int type;
-	
-    public Node(int n, int t) {
-	node = n;
-	type = t;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/Operators.java b/src/org/apache/xalan/xsltc/runtime/Operators.java
deleted file mode 100644
index aa72c84..0000000
--- a/src/org/apache/xalan/xsltc/runtime/Operators.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-public interface Operators {
-    public static final int EQ = 0;
-    public static final int NE = 1;
-    public static final int GT = 2;
-    public static final int LT = 3;
-    public static final int GE = 4;
-    public static final int LE = 5;
-	
-    public static final String[] names = {
-	"=", "!=", ">", "<", ">=", "<="
-    };
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/Parameter.java b/src/org/apache/xalan/xsltc/runtime/Parameter.java
deleted file mode 100644
index 15229ff..0000000
--- a/src/org/apache/xalan/xsltc/runtime/Parameter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-public class Parameter {
-
-    public String  _name;
-    public Object  _value;
-    public boolean _isDefault;
-
-    public Parameter(String name, Object value) {
-	_name = name;
-	_value = value;
-	_isDefault = true;
-    }
-
-    public Parameter(String name, Object value, boolean isDefault) {
-	_name = name;
-	_value = value;
-	_isDefault = isDefault;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/SAXAdapter.java b/src/org/apache/xalan/xsltc/runtime/SAXAdapter.java
deleted file mode 100644
index c49618c..0000000
--- a/src/org/apache/xalan/xsltc/runtime/SAXAdapter.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import org.xml.sax.*;
-import org.apache.xalan.xsltc.*;
-
-public final class SAXAdapter implements TransletOutputHandler {
-
-    private final ContentHandler _saxHandler;
-    private final AttributeList  _attributes = new AttributeList();
-
-    private String _openElementName;
-    
-    public SAXAdapter(ContentHandler saxHandler) {
-	_saxHandler = saxHandler;
-    }
-
-    private void maybeEmitStartElement() throws SAXException {
-	if (_openElementName != null) {
-	    _saxHandler.startElement(null, null, _openElementName, _attributes);
-	    _openElementName = null;
-	}
-    }
-
-    public void startDocument() throws TransletException {
-	try {
-	    _saxHandler.startDocument();
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    public void endDocument() throws TransletException {
-	try {
-	    _saxHandler.endDocument();
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    public void characters(char[] characters, int offset, int length)
-	throws TransletException {
-	try {
-	    maybeEmitStartElement();
-	    _saxHandler.characters(characters, offset, length);
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    public void startElement(String elementName) throws TransletException {
-	try {
-	    maybeEmitStartElement();
-	    _openElementName = elementName;
-	    _attributes.clear();
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    public void endElement(String elementName) throws TransletException {
-	try {
-	    maybeEmitStartElement();
-	    _saxHandler.endElement(null, null, elementName);
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    public void attribute(String attributeName, String attributeValue)
-	throws TransletException {
-	if (_openElementName != null) {
-	    _attributes.add(attributeName, attributeValue);
-	}
-	else {
-	    throw new TransletException("attribute outside of start tag");
-	}
-    }
-    
-    public void namespace(String prefix, String uri)
-	throws TransletException {
-	// ???
-    }
-
-    public void comment(String comment) throws TransletException {
-	try {
-	    maybeEmitStartElement();
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    public void processingInstruction(String target, String data)
-	throws TransletException {
-	try {
-	    maybeEmitStartElement();
-	    _saxHandler.processingInstruction(target, data);
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-
-    // The SAX handler does not handle these:
-    public void setType(int type) {}
-    public void setHeader(String header) {}
-    public void setIndent(boolean indent) {}
-    public void omitHeader(boolean value) {}
-    public void setCdataElements(Hashtable elements) { }
-    public void close() {}
-    public boolean setEscaping(boolean escape)  throws TransletException {
-        return(true);
-    }
-    public String getPrefix(String uri) { return(""); }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java b/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
deleted file mode 100644
index 2e47eb4..0000000
--- a/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import org.apache.xalan.xsltc.*;
-
-public final class StringValueHandler extends TransletOutputBase {
-
-    private char[] _buffer = new char[32];
-    private int _free = 0;
-	
-    public void characters(char[] ch, int off, int len) {
-	if (_free + len >= _buffer.length) {
-	    char[] newBuffer = new char[_free + len + 32];
-	    System.arraycopy(_buffer, 0, newBuffer, 0, _free);
-	    _buffer = newBuffer;
-	}
-	System.arraycopy(ch, off, _buffer, _free, len);
-	_free += len;
-    }
-
-    public String getValue() {
-	final int length = _free;
-	_free = 0;		// getValue resets
-	return new String(_buffer, 0, length);
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/TextOutput.java b/src/org/apache/xalan/xsltc/runtime/TextOutput.java
deleted file mode 100644
index 6238fc6..0000000
--- a/src/org/apache/xalan/xsltc/runtime/TextOutput.java
+++ /dev/null
@@ -1,908 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Seth Ford <seth.ford@fmr.com> 
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-import java.io.*;
-import java.net.URLEncoder;
-import java.util.Stack;
-import java.util.Enumeration;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xalan.xsltc.*;
-
-public final class TextOutput implements TransletOutputHandler {
-
-    // These are the various output types we handle
-    public static final int UNKNOWN = -1; // determine type from output contents
-    public static final int TEXT    = 0;
-    public static final int XML     = 1;
-    public static final int HTML    = 2;
-    public static final int QNAME   = 3;  // no special handling
-
-    // These parameters are set by the <xsl:output> element, or by the
-    // get/setOutputProperty() methods in TrAX
-    private int	   _outputType = UNKNOWN;
-    private String _encoding;
-    private String _mediaType = "text/html";
-    private String _doctypeSystem = null;
-    private String _doctypePublic = null;
-
-    private boolean   _escapeChars = false;
-    private boolean   _startTagOpen = false;
-    private boolean   _headTagOpen = false;
-    private boolean   _cdataTagOpen = false;
-
-    // Contains all elements that should be output as CDATA sections
-    private Hashtable _cdata = null;
-
-    private static final String XML_PREFIX = "xml";
-
-    private static final char[] AMP      = "&amp;".toCharArray();
-    private static final char[] LT       = "&lt;".toCharArray();
-    private static final char[] GT       = "&gt;".toCharArray();
-    private static final char[] CRLF     = "&#xA;".toCharArray();
-    private static final char[] QUOTE    = "&quot;".toCharArray();
-    private static final char[] NBSP     = "&nbsp;".toCharArray();
-
-    private static final int AMP_length   = AMP.length;
-    private static final int LT_length    = LT.length;
-    private static final int GT_length    = GT.length;
-    private static final int CRLF_length  = CRLF.length;
-    private static final int QUOTE_length = QUOTE.length;
-    private static final int NBSP_length  = NBSP.length;
-
-    private static final char[] BEGCDATA = "<![CDATA[".toCharArray();
-    private static final char[] ENDCDATA = "]]>".toCharArray();
-    private static final char[] CNTCDATA = "]]]]><![CDATA[>".toCharArray();
-    private static final char[] BEGCOMM  = "<!--".toCharArray();
-    private static final char[] ENDCOMM  = "-->\n".toCharArray();
-
-    private static final String EMPTYSTRING = "";
-
-    private AttributeList _attributes = new AttributeList();
-    private String        _elementName = null;
-
-    // Each entry (prefix) in this hashtable points to a Stack of URIs
-    private Hashtable _namespaces;
-    // The top of this stack contains an id of the element that last declared
-    // a namespace. Used to ensure prefix/uri map scopes are closed correctly
-    private Stack     _nodeStack;
-    // The top of this stack is the prefix that was last mapped to an URI
-    private Stack     _prefixStack;
-
-    // The top of this stack contains the QName of the currently open element
-    private Stack     _qnameStack;
-
-    // The top of this stack contains the element id of the last element whose
-    // contents should be output as CDATA sections.
-    private Stack     _cdataStack;
-
-    // Holds the current tree depth (see startElement() and endElement()).
-    private int _depth = 0;
-
-    // Reference to the SAX2 handlers that consume this handler's output
-    private ContentHandler _saxHandler;
-    private LexicalHandler _lexHandler;
-
-    /**
-     * Creates a new translet output post-processor
-     *
-     * @param handler A SAX2 handler to consume the generated SAX events 
-     * @throws IOException
-     */
-    public TextOutput(ContentHandler handler) throws IOException {
-        _saxHandler = handler;
-        init();
-    }
-
-    /**
-     * Creates a new translet output post-processor
-     *
-     * @param handler A SAX2 handler to consume the generated SAX events 
-     * @param encoding The default encoding to use (set in <xsl:output>)
-     * @throws IOException
-     */
-    public TextOutput(ContentHandler handler, String encoding)
-	throws IOException {
-        _saxHandler = handler;
-        init();
-	_encoding = encoding;
-    }
-
-    /**
-     * Creates a new translet output post-processor
-     *
-     * @param handler A SAX2 handler to consume the generated SAX events 
-     * @param encoding The default encoding to use (set in <xsl:output>)
-     * @throws IOException
-     */
-    public TextOutput(ContentHandler sax, LexicalHandler lex, String encoding)
-	throws IOException {
-        _saxHandler = sax;
-	_lexHandler = lex;
-        init();
-	_encoding = encoding;
-    }
-
-    /**
-     * Initialise global variables
-     */
-    private void init() throws IOException {
-	// Reset all output configuration from <xsl:output>
-	_outputType = UNKNOWN;
-	_encoding = "utf-8";
-	_mediaType = "text/html";
-
-	// Reset all internal variables and tables
-	_escapeChars  = false;
-	_startTagOpen = false;
-	_cdataTagOpen = false;
-	_qnameStack = new Stack();
-	_cdataStack = new Stack();
-	_cdataStack.push(new Integer(-1)); // push dummy value
-
-	// Reset our internal namespace handling
-	initNamespaces();
-    }
-
-    /**
-     * Closes the output stream
-     */
-    public void close() {
-	if ((_saxHandler != null) &&
-	    (_saxHandler instanceof DefaultSAXOutputHandler)) {
-	    ((DefaultSAXOutputHandler)_saxHandler).close();
-	}
-    }
-
-    /**
-     * This method is used internally when the output type was initially
-     * undefined and the type is set (by this handler) based on the contents
-     * of the output. Set the default values for some output paramters.
-     */
-    private void setTypeInternal(int type) {
-	if (type == XML) {
-	    _escapeChars = true;
-	}
-	else if (type == HTML) {
-	    _escapeChars = true;
-	    setIndent(true);
-	}
-	setType(type);
-    }
-
-    /**
-     * Emit header through the SAX handler
-     */
-    private void emitHeader() throws SAXException {
-	// Output HTML header as META element
-	if (_outputType == HTML) {
-	    AttributeList attrs = new AttributeList();
-	    attrs.add("http-equiv", "Content-Type");
-	    attrs.add("content", _mediaType+"; charset="+_encoding);
-	    _saxHandler.startElement(null, null, "meta", attrs);
-	    _saxHandler.endElement(null, null, "meta");
-	}
-    }
-
-    /**
-     * This method is called when all the data needed for a call to the
-     * SAX handler's startElement() method has been gathered.
-     */
-    public void closeStartTag() throws TransletException {
-	try {
-	    _startTagOpen = false;
-	    
-	    // Final check to assure that the element is within a namespace
-	    // that has been declared (all declarations for this element
-	    // should have been processed at this point).
-	    int col = _elementName.lastIndexOf(':');
-	    if (col > 0) {
-		final String prefix = _elementName.substring(0,col);
-		final String localname = _elementName.substring(col+1);
-		final String uri = lookupNamespace(prefix);
-		if (uri == null) {
-		    throw new TransletException("Namespace for prefix "+
-						prefix+" has not been "+
-						"declared.");
-		}
-		if (uri.equals(EMPTYSTRING)) _elementName = localname;
-		_saxHandler.startElement(uri, localname,
-					 _elementName, _attributes);
-	    }
-	    else {
-		final String uri = lookupNamespace(EMPTYSTRING);
-		_saxHandler.startElement(uri, _elementName,
-					 _elementName, _attributes);
-	    }
-
-	    // Insert <META> tag directly after <HEAD> element in HTML output
-	    if (_headTagOpen) {
-		emitHeader();
-		_headTagOpen = false;
-	    }
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    } 
-
-    /**
-     * Turns special character escaping on/off. Note that characters will
-     * never, even if this option is set to 'true', be escaped within
-     * CDATA sections in output XML documents.
-     */
-    public boolean setEscaping(boolean escape) throws TransletException {
-	// Set output type to XML (the default) if still unknown.
-	if (_outputType == UNKNOWN) setTypeInternal(XML);
-
-	// Save old escaping setting (for the return value) and set new value
-	boolean oldSetting = _escapeChars;
-	_escapeChars = escape;
-
-	// Characters are never escaped in output mode 'text'
-	if (_outputType == TEXT) _escapeChars = false; 
-
-	return(oldSetting);
-    }
-
-    /**
-     * Starts the output document. Outputs the document header if the
-     * output type is set to XML.
-     */
-    public void startDocument() throws TransletException {
-        try {
-            _saxHandler.startDocument();
-	    // Output escaping is _ALWAYS_ enabled for XML output
-            if (_outputType == XML) _escapeChars = true;
-        } catch (SAXException e) {
-            throw new TransletException(e);
-        }
-    }
-
-    /**
-     * Ends the document output.
-     */
-    public void endDocument() throws TransletException {
-        try {
-            // Set output type to XML (the default) if still unknown.
-            if (_outputType == UNKNOWN) setTypeInternal(XML);
-
-	    // Close any open start tag
-	    if (_startTagOpen) closeStartTag();
-	    if (_cdataTagOpen) closeCDATA();
-
-	    // Close output document
-            _saxHandler.endDocument();
-        } catch (SAXException e) {
-            throw new TransletException(e);
-        }
-    }
-
-    /**
-     * Utility method - pass a string to the SAX handler's characters() method
-     */
-    private void characters(String str) throws SAXException {
-	final char[] ch = str.toCharArray();
-	_saxHandler.characters(ch, 0, ch.length);
-    }
-
-    /**
-     * Utility method - pass a whole character array to the SAX handler
-     */
-    private void characters(char[] ch) throws SAXException {
-	_saxHandler.characters(ch, 0, ch.length);
-    }
-
-    /**
-     * Utility method - escape special characters and pass to SAX handler
-     */
-    private void escapeCharacters(char[] ch, int off, int len)
-	throws SAXException {
-
-	final int limit = off + len;
-	int offset = off;
-
-	// Step through characters and escape all special characters
-	for (int i = off; i < limit; i++) {
-	    switch (ch[i]) {
-	    case '&':
-		_saxHandler.characters(ch, offset, i - offset);
-		_saxHandler.characters(AMP, 0, AMP_length);
-		offset = i + 1;
-		break;
-	    case '"':
-		_saxHandler.characters(ch, offset, i - offset);
-		_saxHandler.characters(QUOTE, 0, QUOTE_length);
-		offset = i + 1;
-		break;
-	    case '<':
-		_saxHandler.characters(ch, offset, i - offset);
-		_saxHandler.characters(LT, 0, LT_length);
-		offset = i + 1;
-		break;
-	    case '>':
-		_saxHandler.characters(ch, offset, i - offset);
-		_saxHandler.characters(GT, 0, GT_length);
-		offset = i + 1;
-		break;
-	    case '\u00a0':
-		_saxHandler.characters(ch, offset, i - offset);
-		_saxHandler.characters(NBSP, 0, NBSP_length);
-		offset = i + 1;
-		break;
-	    }
-	    // TODO - more characters need escaping!!!
-	}
-	// Output remaining characters (that do not need escaping).
-	if (offset < limit) _saxHandler.characters(ch, offset, limit - offset);
-    }
-
-    /**
-     * Utility method - pass a whole charactes as CDATA to SAX handler
-     */
-    private void startCDATA(char[] ch, int off, int len) throws SAXException {
-	
-	final int limit = off + len;
-	int offset = off;
-
-	// Output start bracket - "<![CDATA["
-	characters(BEGCDATA);
-
-	// Detect any occurence of "]]>" in the character array
-	for (int i = offset; i < limit-2; i++) {
-	    if (ch[i] == ']' && ch[i+1] == ']' && ch[i+2] == '>') {
-		_saxHandler.characters(ch, offset, i - offset);
-		characters(CNTCDATA);
-		offset = i+3;
-		i=i+2; // Skip next chars ']' and '>'.
-	    }
-	}
-
-	// Output the remaining characters
-	if (offset < limit) _saxHandler.characters(ch, offset, limit - offset);
-
-	_cdataTagOpen = true;
-    }
-
-    private void closeCDATA() throws SAXException {
-	// Output closing bracket - "]]>"
-	characters(ENDCDATA);
-	_cdataTagOpen = false;
-    }
-
-    /**
-     * Send characters to the output document
-     */
-    public void characters(char[] ch, int off, int len)	
-	throws TransletException {
-        try {
-	    // Close any open start tag
-	    if (_startTagOpen) closeStartTag();
-	    
-            // Set output type to XML (the default) if still unknown.
-            if (_outputType == UNKNOWN) setTypeInternal(XML);
-
-            // Take special precautions if within a CDATA section. If we
-            // encounter the sequence ']]>' within the CDATA, we need to
-            // break the section in two and leave the ']]' at the end of
-            // the first CDATA and '>' at the beginning of the next. Other
-	    // special characters/sequences are _NOT_ escaped within CDATA.
-	    Integer I = (Integer)_cdataStack.peek();
-	    if ((I.intValue() == _depth) && (!_cdataTagOpen)) {
-		startCDATA(ch, off, len);
-	    }
-	    // Output escaped characters if required. Non-ASCII characters
-            // within HTML attributes should _NOT_ be escaped.
-	    else if (_escapeChars) {
-		if (_outputType == HTML) {
-		    final String qname = (String)_qnameStack.peek();
-		    if ((qname.equals("style")) || (qname.equals("script"))) {
-			_saxHandler.characters(ch, off, len);
-			return;
-		    }
-		}
-		escapeCharacters(ch, off, len);
-	    }
-	    // Output the chracters as the are
-	    else {
-		_saxHandler.characters(ch, off, len);
-	    }
-        }
-	catch (SAXException e) {
-            throw new TransletException(e);
-        }
-    }
-
-    /**
-     * Start an element in the output document. This might be an XML
-     * element (<elem>data</elem> type) or a CDATA section.
-     */
-    public void startElement(String elementName)
-	throws TransletException {
-
-	try {
-	    // Do not output element tags if output mode is 'text'
-	    if (_outputType == TEXT) return; 
-
-	    // Close any open start tag
-	    if (_startTagOpen) closeStartTag();
-	    if (_cdataTagOpen) closeCDATA();
-
-	    // If we don't know the output type yet we need to examine
-	    // the very first element to see if it is "html".
-	    if (_outputType == UNKNOWN) {
-		if (elementName.toLowerCase().equals("html"))
-		    setTypeInternal(HTML);
-		else
-		    setTypeInternal(XML);
-	    }
-
-	    // Handle document type declaration (for first element only)
-	    if (_lexHandler != null) {
-		if (((_outputType == XML) && (_doctypeSystem != null)) ||
-		    ((_doctypeSystem != null) || (_doctypePublic != null)))
-		    _lexHandler.startDTD(elementName,
-					 _doctypePublic,_doctypeSystem);
-		_lexHandler = null;
-	    }
-
-	    _depth++;
-	    _elementName = elementName;
-	    _attributes.clear();
-	    _startTagOpen = true;
-
-	    _qnameStack.push(elementName);
-
-	    // bug fix 2807, <seth.ford@fmr.com>
-	    if (_cdata != null) {
-		if (_cdata.get(elementName) != null) {
-		    _cdataStack.push(new Integer(_depth));
-		}
-	    }
-
-	    // Insert <META> tag directly after <HEAD> element in HTML doc
-	    if (_outputType == HTML)
-		if (elementName.toLowerCase().equals("head"))
-		    _headTagOpen = true;
-	}
-	catch (SAXException e) {
-            throw new TransletException(e);
-        }
-    }
-
-    /**
-     * This method escapes special characters used in attribute values
-     */
-    private String escapeChars(String value) {
-
-	int i;
-	char[] ch = value.toCharArray();
-	int limit = ch.length;
-	int offset = 0;
-	StringBuffer buf = new StringBuffer();
-	
-	for (i = 0; i < limit; i++) {
-	    switch (ch[i]) {
-	    case '&':
-		buf.append(ch, offset, i - offset);
-		buf.append(AMP);
-		offset = i + 1;
-		break;
-	    case '"':
-		buf.append(ch, offset, i - offset);
-		buf.append(QUOTE);
-		offset = i + 1;
-		break;
-	    case '<':
-		buf.append(ch, offset, i - offset);
-		buf.append(LT);
-		offset = i + 1;
-		break;
-	    case '>':
-		buf.append(ch, offset, i - offset);
-		buf.append(GT);
-		offset = i + 1;
-		break;
-	    case '\n':
-		buf.append(ch, offset, i - offset);
-		buf.append(CRLF);
-		offset = i + 1;
-		break;
-	    }
-	}
-	if (offset < limit) {
-	    buf.append(ch, offset, limit - offset);
-	}
-	return(buf.toString());
-    }
-
-    /**
-     * Put an attribute and its value in the start tag of an element.
-     * Signal an exception if this is attempted done outside a start tag.
-     */
-    public void attribute(String name, final String value)
-	throws TransletException {
-	
-	// Do not output attributes if output mode is 'text'
-	if (_outputType == TEXT) return; 
-
-	if (_startTagOpen) {
-
-	    // URL-encode href attributes in HTML output
-	    if ((_outputType == HTML) && (name.equals("href"))) {
-		_attributes.add(name, URLEncoder.encode(value));
-		return;
-	    }
-
-	    // Intercept namespace declarations and handle them separately
-	    if (name.startsWith("xmlns")) {
-		if (name.length() == 5)
-		    namespace(EMPTYSTRING,value);
-		else
-		    namespace(name.substring(6),value);
-	    }
-	    else {
-		final int col = name.lastIndexOf(':');
-		if (col > 0) {
-		    final String prefix = name.substring(0,col);
-		    final String localname = name.substring(col+1);
-		    final String uri = lookupNamespace(prefix);
-		    if (uri == null) {
-			throw new TransletException("Namespace for prefix "+
-						    prefix+" has not been "+
-						    "declared.");
-		    }
-		    if (uri.equals(EMPTYSTRING)) name = localname;
-		}
-		if (_outputType == HTML)
-		    _attributes.add(name, value);
-		else
-		    _attributes.add(name, escapeChars(value));
-	    }
-	}
-	else {
-	    throw new TransletException("attribute '"+name+
-					"' outside of element");
-	}
-    }
-
-    /**
-     * End an element or CDATA section in the output document
-     */
-    public void endElement(String elementName) throws TransletException {
-	
-	// Do not output element tags if output mode is 'text'
-	if (_outputType == TEXT) return;
- 
-	try {
-	    boolean closeElement = true;
-
-	    // Close any open element
-	    if (_startTagOpen) closeStartTag();
-	    if (_cdataTagOpen) closeCDATA();
-
-	    final String qname = (String)(_qnameStack.pop());
-            if (closeElement) _saxHandler.endElement(null, null, qname);
-
-            popNamespaces();
-
-	    Integer I = (Integer)_cdataStack.peek();
-	    if (I.intValue() == _depth) _cdataStack.pop();
-
-            _depth--;
-
-        } catch (SAXException e) {
-            throw new TransletException(e);
-        }
-    }
-
-    /**
-     * Send a HTML-style comment to the output document
-     */
-    public void comment(String comment) throws TransletException {
-	try {
-	    // Close any open element before emitting comment
-            if (_startTagOpen) closeStartTag();
-	    if (_cdataTagOpen) closeCDATA();
-
-            // Set output type to XML (the default) if still unknown.
-            if (_outputType == UNKNOWN) setTypeInternal(XML);
-
-            // ...and then output the comment.
-            characters(BEGCOMM);
-            characters(comment);
-            characters(ENDCOMM);
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-    
-    /**
-     * Send a processing instruction to the output document
-     */
-    public void processingInstruction(String target, String data)
-	throws TransletException {
-        try {
-	    // Close any open element
-	    if (_startTagOpen) closeStartTag();
-	    if (_cdataTagOpen) closeCDATA();
-
-	    // Pass the processing instruction to the SAX handler
-            _saxHandler.processingInstruction(target, data);
-        } catch (SAXException e) {
-            throw new TransletException(e);
-        }
-    }
-
-    /**
-     * Initialize namespace stacks
-     */
-    private void initNamespaces() {
-	_namespaces = new Hashtable();
-	_nodeStack = new Stack();
-	_prefixStack = new Stack();
-
-	// Define the default namespace (initially maps to "" uri)
-	Stack stack =  new Stack();
-	_namespaces.put(EMPTYSTRING, stack);
-	stack.push(EMPTYSTRING);
-	_prefixStack.push(EMPTYSTRING);
-	_nodeStack.push(new Integer(-1));
-	_depth = 0;
-    }
-
-    /**
-     * Declare a prefix to point to a namespace URI
-     */
-    private void pushNamespace(String prefix, String uri) throws SAXException {
-
-	if (prefix.equals(XML_PREFIX)) return;
-
-	Stack stack;
-	// Get the stack that contains URIs for the specified prefix
-	if ((stack = (Stack)_namespaces.get(prefix)) == null) {
-	    stack = new Stack();
-	    _namespaces.put(prefix, stack);
-	}
-	// Quit now if the URI the prefix currently maps to is the same as this
-	if (!stack.empty() && uri.equals(stack.peek())) return;
-	// Put this URI on top of the stack for this prefix
-	stack.push(uri);
-
-	_prefixStack.push(prefix);
-	_nodeStack.push(new Integer(_depth));
-
-	if ((!prefix.equals(EMPTYSTRING)) && (uri.equals(EMPTYSTRING))) return;
-	_saxHandler.startPrefixMapping(prefix, uri);
-    }
-
-    /**
-     * Undeclare the namespace that is currently pointed to by a given prefix
-     */
-    private void popNamespace(String prefix) throws SAXException {
-
-	if (prefix.equals(XML_PREFIX)) return;
-
-	Stack stack;
-	if ((stack = (Stack)_namespaces.get(prefix)) != null) {
-	    stack.pop();
-	    _saxHandler.endPrefixMapping(prefix);
-	}
-    }
-
-    /**
-     * Pop all namespace definitions that were delcared by the current element
-     */
-    private void popNamespaces() throws TransletException {
-	try {
-	    while (true) {
-		if (_nodeStack.isEmpty()) return;
-		Integer i = (Integer)(_nodeStack.peek());
-		if (i.intValue() != _depth) return;
-		_nodeStack.pop();
-		popNamespace((String)_prefixStack.pop());
-	    }
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-
-    /**
-     * Use a namespace prefix to lookup a namespace URI
-     */
-    private String lookupNamespace(String prefix) {
-	final Stack stack = (Stack)_namespaces.get(prefix);
-	return stack != null && !stack.isEmpty() ? (String)stack.peek() : null;
-    }
-
-    /**
-     * Send a namespace declaration in the output document. The namespace
-     * declaration will not be include if the namespace is already in scope
-     * with the same prefix.
-     */
-    public void namespace(final String prefix, final String uri)
-	throws TransletException {
-	try {
-	    if (_startTagOpen)
-		pushNamespace(prefix, uri);
-	    else
-		throw new TransletException("namespace declaration '"+prefix+
-					    "'='"+uri+"' outside of element");
-	}
-	catch (SAXException e) {
-	    throw new TransletException(e);
-	}
-    }
-
-    /** 
-     * Takes a qname as a string on the format prefix:local-name and
-     * returns a strig with the expanded QName on the format uri:local-name.
-     */
-    private String expandQName(String withPrefix) {
-	int col = withPrefix.lastIndexOf(':');
-	if (col == -1) return(withPrefix);
-
-	final String prefix = withPrefix.substring(0,col);
-	final String local =  withPrefix.substring(col+1,withPrefix.length());
-	final String uri = lookupNamespace(prefix);
-
-	if (uri == null)
-	    return(local);
-	else if (uri == EMPTYSTRING)
-	    return(local);
-	else
-	    return(uri+":"+local);
-    }
-
-    /************************************************************************
-     * The following are all methods for configuring the output settings
-     ************************************************************************/
-    /**
-     * Set the output type. The type must be wither TEXT, XML or HTML.
-     */
-    public void setType(int type)  {
-	try {
-	    _outputType = type;
-	    if (_encoding == null) _encoding = "utf-8";
-	    if (_saxHandler instanceof DefaultSAXOutputHandler)
-		((DefaultSAXOutputHandler)_saxHandler).setOutputType(type);
-	}
-	catch (SAXException e) { }
-    }
-
-    /**
-     * Turns output indentation on/off. Should only be set to on
-     * if the output type is XML or HTML.
-     */
-    public void setIndent(boolean indent) {
-	if (_saxHandler instanceof DefaultSAXOutputHandler) {
-            ((DefaultSAXOutputHandler)_saxHandler).setIndent(indent);
-	}
-    } 
-
-    /**
-     * Directive to turn xml header declaration  on/off. 
-     */
-    public void omitHeader(boolean value) {
-	if (_saxHandler instanceof DefaultSAXOutputHandler) {
-            ((DefaultSAXOutputHandler)_saxHandler).omitHeader(value);
-	}
-    }
-
-    /**
-     * Set the XML output document version - should be 1.0
-     */
-    public void setVersion(String version) {
-	if (_saxHandler instanceof DefaultSAXOutputHandler) {
-            ((DefaultSAXOutputHandler)_saxHandler).setVersion(version);
-	}
-    }
-
-    /**
-     * Set the XML standalone attribute - must be "yes" or "no"
-     */
-    public void setStandalone(String standalone) {
-	if (_saxHandler instanceof DefaultSAXOutputHandler) {
-            ((DefaultSAXOutputHandler)_saxHandler).setStandalone(standalone);
-	}
-    }
-
-    /**
-     * Set the output document system/public identifiers
-     */
-    public void setDoctype(String system, String pub) {
-	_doctypeSystem = system;
-	_doctypePublic = pub;
-    }
-
-    /**
-     * Set the output media type - only relevant for HTML output
-     */
-    public void setMediaType(String mediaType) {
-	// This value does not have to be passed to the SAX handler. This
-	// handler creates the HTML <meta> tag in which the media-type
-	// (MIME-type) will be used.
-	_mediaType = mediaType;
-    }
-
-    /**
-     * The <xsl:output method="xml"/> instruction can specify that certain
-     * XML elements should be output as CDATA sections. This methods allows
-     * the translet to insert these elements into a hashtable of strings.
-     * Every output element is looked up in this hashtable before it is
-     * output.
-     */ 
-    public void setCdataElements(Hashtable elements) {
-	_cdata = elements;
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/runtime/TransletOutputBase.java b/src/org/apache/xalan/xsltc/runtime/TransletOutputBase.java
deleted file mode 100644
index 79bc81a..0000000
--- a/src/org/apache/xalan/xsltc/runtime/TransletOutputBase.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.runtime;
-
-
-import org.apache.xalan.xsltc.*;
-import org.apache.xalan.xsltc.runtime.Hashtable;
-
-public class TransletOutputBase implements TransletOutputHandler {
-    public void startDocument() throws TransletException {}
-    public void endDocument() throws TransletException {}
-    public void characters(char[] characters, int offset, int length)
-	throws TransletException {}
-    public void startElement(String elementName) throws TransletException {}
-    public void endElement(String elementName) throws TransletException {}
-    public void attribute(String attributeName, String attributeValue)
-	throws TransletException {}
-    public void namespace(String prefix, String uri)
-	throws TransletException {}
-    public void comment(String comment) throws TransletException {}
-    public void processingInstruction(String target, String data)
-	throws TransletException {}
-    public boolean setEscaping(boolean escape) 
-	throws TransletException { return true; }
-    public String expandQName(String withPrefix) { return(withPrefix); }
-    public void setType(int type) {}
-    public void setIndent(boolean indent) {}
-    public void omitHeader(boolean value) {}
-    public void setCdataElements(Hashtable elements) {}
-    public void close() {}
-}
diff --git a/src/org/apache/xalan/xsltc/trax/DOM2SAX.java b/src/org/apache/xalan/xsltc/trax/DOM2SAX.java
deleted file mode 100644
index 3aeb00d..0000000
--- a/src/org/apache/xalan/xsltc/trax/DOM2SAX.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller 
- *
- */
-
-
-package org.apache.xalan.xsltc.trax;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import java.io.IOException;
-import org.w3c.dom.Entity;
-import org.w3c.dom.Notation;
-
-public class DOM2SAX implements XMLReader , Locator {
-    private Document _dom = null;
-    private ContentHandler _contentHdlr = null;
- 
-    public DOM2SAX(Node root) {
-	_dom = (Document)root;
-    }
-
-    public ContentHandler getContentHandler() { 
-	return _contentHdlr;
-    }
-    public DTDHandler getDTDHandler() { 
-	return null;
-    }
-    public ErrorHandler getErrorHandler() {
-	return null;
-    }
-    public boolean getFeature(String name) throws SAXNotRecognizedException,
-	SAXNotSupportedException
-    {
-	return false;
-    }
-    public void setFeature(String name, boolean value) throws 
-	SAXNotRecognizedException, SAXNotSupportedException 
-    {
-    }
-
-    public void parse(InputSource unused) throws IOException, SAXException {
-        Node currNode = _dom;
-        parse(currNode);
-    }
-
-    private void parse(Node currNode) throws IOException, SAXException {
-        Node first = null;
- 	if (currNode == null ) return;
-
-        switch (currNode.getNodeType()) {
-            case Node.ATTRIBUTE_NODE :
-                    break;
-            case Node.CDATA_SECTION_NODE :
-                    break;
-            case Node.COMMENT_NODE :
-                    break;
-            case Node.DOCUMENT_FRAGMENT_NODE :
-                    break;
-            case Node.DOCUMENT_NODE :
-                    _contentHdlr.setDocumentLocator(this);
-                    _contentHdlr.startDocument();
-                    Node next = currNode.getFirstChild();
-                    while ( next != null ) {
-                        parse(next);
-                        next = next.getNextSibling();
-                    }
-                    _contentHdlr.endDocument();
-                    break;
-            case Node.DOCUMENT_TYPE_NODE :
-                    break;
-            case Node.ELEMENT_NODE :
-                    AttributesImpl attrList = new AttributesImpl();
-                    NamedNodeMap map = currNode.getAttributes();
-                    int length = map.getLength();
-                    for (int i=0; i<length; i++ ){
-                        Node attrNode = map.item(i);
-                        short code = attrNode.getNodeType();
-                        attrList.addAttribute(attrNode.getNamespaceURI(),
-                            attrNode.getLocalName(),
-                            attrNode.getNodeName(),
-                            getNodeTypeFromCode(code),  // must be better way
-                            attrNode.getNodeValue());
-                    }
-                    _contentHdlr.startElement(currNode.getNamespaceURI(),
-                        currNode.getLocalName(), currNode.getNodeName(),
-                        attrList);
-                    next = currNode.getFirstChild();
-                    while ( next != null ) {
-                        parse(next);
-                        next = next.getNextSibling();
-                    }
-                    _contentHdlr.endElement(currNode.getNamespaceURI(),
-                        currNode.getLocalName(), currNode.getNodeName());
-                    break;
-            case Node.ENTITY_NODE :
-                    //Entity edecl = (Entity)currNode;
-                    //String name = edecl.getNotationName();
-                    //if ( name != null ) {
-                    //   _contentHdlr.unparsedEntityDecl(currNode.getNodeName(),
-                    //      edecl.getPublicId(), edecl.getSystemId(), name);
-                    //}
-                    break;
-             case Node.ENTITY_REFERENCE_NODE :
-                    break;
-             case Node.NOTATION_NODE :
-                    //Notation ndecl = (Notation)currNode;
-                    //_contentHdlr.notationDecl(currNode.getNodeName(),
-                     //   ndecl.getPublicId(), ndecl.getSystemId());
-                    break;
-             case Node.PROCESSING_INSTRUCTION_NODE :
-                    _contentHdlr.processingInstruction(currNode.getNodeName(),
-                        currNode.getNodeValue());
-                    break;
-             case Node.TEXT_NODE :
-                    String data = currNode.getNodeValue();
-                    length = data.length();
-                    char[] array = new char[length];
-                    data.getChars(0, length, array, 0);
-                    _contentHdlr.characters(array, 0, length);
-                    break;
-            }
-    }
-
-    public void parse(String sysId) throws IOException, SAXException {
-	throw new IOException("This method is not yet implemented.");
-    }
-    public void setContentHandler(ContentHandler handler) throws 
-	NullPointerException 
-    {
-	if (handler == null ) throw new NullPointerException();
-	_contentHdlr = handler;
-    }
-    public void setDTDHandler(DTDHandler handler) throws NullPointerException {
-	if (handler == null )  throw new NullPointerException();
-    }
-    public void setEntityResolver(EntityResolver resolver) throws 
-	NullPointerException 
-    {
-	if (resolver == null )  throw new NullPointerException();
-    }
-    public EntityResolver getEntityResolver() {
-	return null;
-    }
-    public void setErrorHandler(ErrorHandler handler) throws 
-	NullPointerException
-    {
-	if (handler == null )  throw new NullPointerException();
-    }
-    public void setProperty(String name, Object value) throws
-	SAXNotRecognizedException, SAXNotSupportedException {
-    }
-    public Object getProperty(String name) throws SAXNotRecognizedException,
-	SAXNotSupportedException
-    {
-	return null;
-    }
-
-    // Locator methods
-    public int getColumnNumber() { return 0; }
-    public int getLineNumber() { return 0; }
-    public String getPublicId() { return null; }
-    public String getSystemId() { return null; }
-
-
-    // private 
-    private String getNodeTypeFromCode(short code) {
-	String retval = null;
-	switch (code) {
-                case Node.ATTRIBUTE_NODE : 
-		    retval = "ATTRIBUTE_NODE"; break; 
-                case Node.CDATA_SECTION_NODE :
-		    retval = "CDATA_SECTION_NODE"; break; 
-                case Node.COMMENT_NODE :
-		    retval = "COMMENT_NODE"; break; 
-                case Node.DOCUMENT_FRAGMENT_NODE :
-		    retval = "DOCUMENT_FRAGMENT_NODE"; break; 
-                case Node.DOCUMENT_NODE :
-		    retval = "DOCUMENT_NODE"; break; 
-                case Node.DOCUMENT_TYPE_NODE :
-		    retval = "DOCUMENT_TYPE_NODE"; break; 
-                case Node.ELEMENT_NODE :
-		    retval = "ELEMENT_NODE"; break; 
-                case Node.ENTITY_NODE :
-		    retval = "ENTITY_NODE"; break; 
-                case Node.ENTITY_REFERENCE_NODE :
-		    retval = "ENTITY_REFERENCE_NODE"; break; 
-                case Node.NOTATION_NODE :
-		    retval = "NOTATION_NODE"; break; 
-                case Node.PROCESSING_INSTRUCTION_NODE :
-		    retval = "PROCESSING_INSTRUCTION_NODE"; break; 
-                case Node.TEXT_NODE:
-		    retval = "TEXT_NODE"; break; 
-        }
-	return retval;
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/trax/OutputSettings.java b/src/org/apache/xalan/xsltc/trax/OutputSettings.java
deleted file mode 100644
index 7a6580a..0000000
--- a/src/org/apache/xalan/xsltc/trax/OutputSettings.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.trax;
-
-import javax.xml.transform.*;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.compiler.*;
-import org.apache.xalan.xsltc.runtime.*;
-
-import java.util.Properties;
-
-public final class OutputSettings {
-    
-    private String _cdata_section_elements = null;
-    private String _doctype_public = null;
-    private String _encoding = null;
-    private String _indent = null;
-    private String _media_type = null;
-    private String _method = null;
-    private String _omit_xml_declaration = null;
-    private String _standalone = null;
-    private String _version = null;
-
-    public Properties getProperties() {
-	Properties properties = new Properties();
-	return(properties);
-    }
-
-    
-}
diff --git a/src/org/apache/xalan/xsltc/trax/SAX2DOM.java b/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
deleted file mode 100644
index 82bcd95..0000000
--- a/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller 
- *
- */
-
-
-package org.apache.xalan.xsltc.trax;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.w3c.dom.Attr;
-import java.util.Stack;
-
-
-public class SAX2DOM implements ContentHandler {
-
-    private Document _document = null;
-    private DocumentBuilder _builder = null;
-    private Stack _nodeStk = null;
- 
-    public SAX2DOM() throws ParserConfigurationException {
-	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-	_builder = factory.newDocumentBuilder();
-	_nodeStk = new Stack();
-    }
-
-    public Node getDOM() {
-	return _document;
-    }
-
-    public void characters(char[] ch, int start, int length) {
-	Text text = _document.createTextNode(new String(ch, start, length));
-	Node last = (Node)_nodeStk.peek();
-	last.appendChild(text);
-    }
-
-    public void startDocument() {
-	_document = _builder.newDocument();
-	Element root = (Element)_document.createElement("root");
-	_document.appendChild(root);
-	_nodeStk.push(root);
-    }
-
-    public void endDocument() {
-	//printDOM();
-    }
-
-    public void startElement(String namespace, String localName, String qName,
-	Attributes attrs ) 
-    {
-	// create new element
-	Element tmp = (Element)_document.createElementNS(namespace, qName);
-	int nattrs = attrs.getLength();
-	for (int i=0; i<nattrs; i++ ) {
-	    String namespaceuri = attrs.getURI(i);
-	    String value = attrs.getValue(i);
-	    String qname = attrs.getQName(i);
-	    if ((namespaceuri == null) || (namespaceuri.equals("")))
-		tmp.setAttribute(qname, value);
-	    else
-		tmp.setAttributeNS(namespaceuri, qname, value);
-	}
-	// append this new node onto current stack node
-	Node last = (Node)_nodeStk.peek();
-	last.appendChild(tmp);
-	// push this node onto stack
-	_nodeStk.push(tmp);
-    }
-
-    public void endElement(String namespace, String localName, String qName) {
-	Node lastActive = (Node)_nodeStk.pop();  
-    }
-
-
-    public void ignorableWhitespace(char[] ch, int start, int length) {
-    }
-
-    public void processingInstruction(String target, String data) {
-    }
-
-    public void setDocumentLocator(Locator locator) {
-    }
-
-    public void skippedEntity(String name) {
-    }
-
-    public void startPrefixMapping(String prefix, String uri) {
-    }
-
-    public void endPrefixMapping(String prefix) {
-    }
-
-
-    // for debugging - will be removed
-    private void printDOM() {
-        System.out.println("SAX2DOM.java:Printing DOM...");
-        Node currNode = _document;
-        while (currNode != null) {
-            // start of node processing
-            switch (currNode.getNodeType()) {
-                case Node.ATTRIBUTE_NODE :
-                    break;
-                case Node.CDATA_SECTION_NODE :
-                    break;
-                case Node.COMMENT_NODE :
-                    break;
-                case Node.DOCUMENT_FRAGMENT_NODE :
-                    break;
-                case Node.DOCUMENT_NODE :
-                    break;
-                case Node.DOCUMENT_TYPE_NODE :
-                    break;
-                case Node.ELEMENT_NODE :
-                    System.out.println("ELEMT NODE " + currNode.getLocalName() +":");
-		     org.w3c.dom.NamedNodeMap map = currNode.getAttributes();
-                    int length = map.getLength();
-                    for (int i=0; i<length; i++ ){
-                        Node attrNode = map.item(i);
-                        short code = attrNode.getNodeType();
-                        System.out.println("\tattr:"+attrNode.getNamespaceURI()+
-                            "," + attrNode.getLocalName() +
-                            "," + attrNode.getNodeName() +
-                            "=" + attrNode.getNodeValue());
-                    }
-                    break;
-                case Node.ENTITY_NODE :
-                    org.w3c.dom.Entity edecl = (org.w3c.dom.Entity)currNode;
-                    String name = edecl.getNotationName();
-                    if ( name != null ) {
-                        System.out.println("ENT NODE: "+currNode.getNodeName()+
-                           ", "+ edecl.getSystemId()+ "," + name);
-                    }
-                    break;
-                case Node.ENTITY_REFERENCE_NODE :
-                    break;
-                case Node.NOTATION_NODE :
-                    break;
-                case Node.PROCESSING_INSTRUCTION_NODE :
-                    break;
-                case Node.TEXT_NODE :
-                    String data = currNode.getNodeValue();
-                    System.out.println("TEXT NODE:" + data);
-                    break;
-            }
-
-            // move to first child
-            Node next = currNode.getFirstChild();
-            if (next != null) {
-                currNode = next;
-                continue;
-            }
-
-            // no child nodes, walk the tree
-            while (currNode != null) {
-                switch (currNode.getNodeType()) {
-                    case Node.DOCUMENT_NODE:
-                        break;
-                    case Node.ELEMENT_NODE:
-                        break;
-                }
-                next = currNode.getNextSibling();
-                if (next != null ) {
-                    currNode = next;
-                    break;
-                }
-                // move up a level
-                currNode = currNode.getParentNode();
-            }
-        }
-   }
-
-}
diff --git a/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java b/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
deleted file mode 100644
index 29702ac..0000000
--- a/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.trax;
-
-import javax.xml.transform.*;
-import javax.xml.transform.sax.*;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import org.apache.xalan.xsltc.compiler.*;
-import org.apache.xalan.xsltc.compiler.util.Util;
-
-/**
- * Implementation of a JAXP1.1 TemplatesHandler
- */
-public class TemplatesHandlerImpl extends Parser implements TemplatesHandler {
-
-    private String _defaultTransletName = "GregorSamsa";
-    private String _systemId;
-
-    /**
-     * Default constructor
-     */
-    protected TemplatesHandlerImpl() {
-	super(null);
-    }
-
-    /**
-     * Internal initialization
-     */
-    public void init() {
-	// Create and initialize a stylesheet compiler
-	final XSLTC xsltc = new XSLTC();
-	super.setXSLTC(xsltc);
-	xsltc.setParser(this);
-	xsltc.init();
-	xsltc.setOutputType(XSLTC.BYTEARRAY_OUTPUT);
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TemplatesHandler.getSystemId()
-     * Get the base ID (URI or system ID) from where relative URLs will be
-     * resolved.
-     * @return The systemID that was set with setSystemId(String id)
-     */
-    public String getSystemId() {
-	return _systemId;
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TemplatesHandler.setSystemId()
-     * Get the base ID (URI or system ID) from where relative URLs will be
-     * resolved.
-     * @param id Base URI for this stylesheet
-     */
-    public void setSystemId(String id) {
-	_systemId = id;
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TemplatesHandler.getTemplates()
-     * When a TemplatesHandler object is used as a ContentHandler or
-     * DocumentHandler for the parsing of transformation instructions, it
-     * creates a Templates object, which the caller can get once the SAX
-     * events have been completed.
-     * @return The Templates object that was created during the SAX event
-     *         process, or null if no Templates object has been created.
-     */
-    public Templates getTemplates() {
-
-	try {
-	    // Create a placeholder for the translet bytecodes
-	    byte[][] bytecodes = null;
-
-	    final XSLTC xsltc = getXSLTC();
-
-	    // Set the translet class name if not already set
-	    String transletName = _defaultTransletName;
-	    if (_systemId != null) transletName = Util.baseName(_systemId);
-	    xsltc.setClassName(transletName);
-
-	    Stylesheet stylesheet = null;
-	    SyntaxTreeNode root = getDocumentRoot();
-
-	    // Compile the translet - this is where the work is done!
-	    if ((!errorsFound()) && (root != null)) {
-		// Create a Stylesheet element from the root node
-		stylesheet = makeStylesheet(root);
-		stylesheet.setSystemId(_systemId);
-		stylesheet.setParentStylesheet(null);
-		setCurrentStylesheet(stylesheet);
-		// Create AST under the Stylesheet element (parse & type-check)
-		createAST(stylesheet);
-	    }
-
-	    // Generate the bytecodes and output the translet class(es)
-	    if ((!errorsFound()) && (stylesheet != null)) {
-		stylesheet.setMultiDocument(xsltc.isMultiDocument());
-		stylesheet.translate();
-	    }
-
-	    xsltc.printWarnings();
-
-	    // Check that the transformation went well before returning
-	    if (bytecodes == null) {
-		xsltc.printErrors();
-		return null;
-	    }
-
-	    return(new TemplatesImpl(bytecodes, transletName));
-	}
-	catch (CompilerException e) {
-	    return null;
-	}
-    }
-}
-
-
diff --git a/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java b/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
deleted file mode 100644
index 87412c0..0000000
--- a/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- * @author G. Todd Miller
- *
- */
-
-package org.apache.xalan.xsltc.trax;
-
-import java.io.Serializable;
-
-import javax.xml.transform.*;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.compiler.*;
-import org.apache.xalan.xsltc.runtime.*;
-
-import java.util.Properties;
-
-public final class TemplatesImpl implements Templates, Serializable {
-    
-    // Contains the name of the main translet class
-    private String   _transletName = null;
-
-    // Contains the actual class definition for the translet class and
-    // any auxiliary classes (representing node sort records, predicates, etc.)
-    private byte[][] _bytecodes = null;
-
-    // This error could occur when a compilation inside the TransformerFactory
-    // failed and when a template has been loaded from stable storage.
-    private final static String TRANSLET_ERR_MSG =
-	"This template does not contain a valid translet class definition.";
-    
-    // Our own private class loader - builds Class definitions from bytecodes
-    private class TransletClassLoader extends ClassLoader {
-	public Class defineClass(byte[] b) {
-	    return super.defineClass(null, b, 0, b.length);
-	}
-    }
-
-    /**
-     * The only way to create an XSLTC emplate object
-     * The bytecodes for the translet and auxiliary classes, plus the name of
-     * the main translet class, must be supplied
-     */
-    protected TemplatesImpl(byte[][] bytecodes, String transletName) {
-	_bytecodes = bytecodes;
-	_transletName = transletName;
-    }
-
-    /**
-     * The TransformerFactory must pass us the translet bytecodes using this
-     * method before we can create any translet instances
-     */
-    protected void setTransletBytecodes(byte[][] bytecodes) {
-	_bytecodes = bytecodes;
-    }
-
-    /**
-     * Returns the translet bytecodes stored in this template
-     */
-    protected byte[][] getTransletBytecodes() {
-	return(_bytecodes);
-    }
-
-    /**
-     * The TransformerFactory should call this method to set the translet name
-     */
-    protected void setTransletName(String name) {
-	_transletName = name;
-    }
-
-    /**
-     * Returns the name of the main translet class stored in this template
-     */
-    protected String getTransletName() {
-	return _transletName;
-    }
-
-    /**
-     * Defines the translet class and auxiliary classes.
-     * Returns a reference to the Class object that defines the main class
-     */
-    private Class defineTransletClasses() {
-	if (_bytecodes == null) return null;
-
-	TransletClassLoader loader = new TransletClassLoader();
-
-	try {
-	    Class transletClass = null;
-	    final int classCount = _bytecodes.length;
-	    for (int i = 0; i < classCount; i++) {
-		Class clazz = loader.defineClass(_bytecodes[i]);
-		if (clazz.getName().equals(_transletName))
-		    transletClass = clazz;
-	    }
-	    return transletClass; // Could still be 'null'
-	}
-	catch (ClassFormatError e) {
-	    return null;
-	}
-    }
-
-    /**
-     * This method generates an instance of the translet class that is
-     * wrapped inside this Template. The translet instance will later
-     * be wrapped inside a Transformer object.
-     */
-    private Translet getTransletInstance() {
-	if (_transletName == null) return null;
-
-	// First assume that the JVM already had the class definition
-	try {
-	    Class transletClass = Class.forName(_transletName);
-	    return((Translet)transletClass.newInstance());
-	}
-	// Ignore these for now, try to define translet class again
-	catch (LinkageError e) { }
-	catch (InstantiationException e) { }
-	catch (ClassNotFoundException e) { }
-	catch (IllegalAccessException e) { }
-
-	// Create the class definition from the bytecodes if failed
-	try {
-	    Class transletClass = defineTransletClasses();
-	    if (transletClass == null) return null;
-	    return((Translet)transletClass.newInstance());
-	}
-	catch (LinkageError e) { return(null); }
-	catch (InstantiationException e) { return(null); }
-	catch (IllegalAccessException e) { return(null); }
-    }
-
-    /**
-     * Implements JAXP's Templates.newTransformer()
-     *
-     * @throws TransformerConfigurationException
-     */
-    public Transformer newTransformer()
-	throws TransformerConfigurationException {
-	Translet translet = getTransletInstance();
-	if (translet == null)
-	    throw new TransformerConfigurationException(TRANSLET_ERR_MSG);
-	TransformerImpl transformer = new TransformerImpl(translet);
-        return(transformer);
-    }
-
-    /**
-     * Implements JAXP's Templates.getOutputProperties()
-     */
-    public Properties getOutputProperties() { 
-	// We need to instanciate a translet to get the output settings, so
-	// we might as well just instanciate a Transformer and use its
-	// implementation of this method
-	try {
-	    Transformer transformer = newTransformer();
-	    return transformer.getOutputProperties();
-	}
-	catch (TransformerConfigurationException e) {
-	    return null;
-	}
-    }
-
-}
-
diff --git a/src/org/apache/xalan/xsltc/trax/TrAXFilter.java b/src/org/apache/xalan/xsltc/trax/TrAXFilter.java
deleted file mode 100644
index f721208..0000000
--- a/src/org/apache/xalan/xsltc/trax/TrAXFilter.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller 
- *
- */
-
-
-package org.apache.xalan.xsltc.trax;
-
-import org.xml.sax.XMLFilter;
-import org.xml.sax.helpers.XMLFilterImpl;
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerConfigurationException;
-
-
-/**
- * skeleton extension of XMLFilterImpl for now.  
- */
-public class TrAXFilter extends XMLFilterImpl {
-    public TrAXFilter(Templates templates)  throws 
-	TransformerConfigurationException
-    {
-	/* nothing yet */ 
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java b/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
deleted file mode 100644
index 036e352..0000000
--- a/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author G. Todd Miller 
- * @author Morten Jorgensen
- *
- */
-
-
-package org.apache.xalan.xsltc.trax;
-
-import java.io.File;
-import java.io.Reader;
-import java.io.InputStream;
-import java.io.ByteArrayInputStream;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Vector;
-import java.util.Hashtable;
-
-import javax.xml.transform.*;
-import javax.xml.transform.sax.*;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.stream.*;
-
-import org.w3c.dom.Document;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.InputSource;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.compiler.XSLTC;
-import org.apache.xalan.xsltc.compiler.SourceLoader;
-import org.apache.xalan.xsltc.compiler.CompilerException;
-import org.apache.xalan.xsltc.compiler.util.Util;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-/**
- * Implementation of a JAXP1.1 TransformerFactory for Translets.
- */
-public class TransformerFactoryImpl
-    extends SAXTransformerFactory implements SourceLoader {
-
-    // This constant should be removed once all abstract methods are impl'ed.
-    private static final String NYI = "Not yet implemented";
-
-    // This error listener is used only for this factory and is not passed to
-    // the Templates or Transformer objects that we create!!!
-    private ErrorListener _errorListener = null; 
-
-    // This URIResolver is passed to all created Templates and Transformers
-    private URIResolver _uriResolver = null;
-
-    // Cache for the newTransformer() method - see method for details
-    private String      _defaultTransletName = "GregorSamsa";
-    private Transformer _copyTransformer = null;
-    private static final String COPY_TRANSLET_CODE =
-	"<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"+
-	"<xsl:template match=\"/\"><xsl:copy-of select=\".\"/></xsl:template>"+
-	"</xsl:stylesheet>";
-
-    // All used error messages should be listed here
-    private static final String ERROR_LISTENER_NULL =
-	"Attempting to set ErrorListener for TransformerFactory to null";
-    private static final String UNKNOWN_SOURCE_ERR =
-	"Only StreamSource and SAXSource are supported by XSLTC";
-    private static final String NO_SOURCE_ERR =
-	"Source object passed to newTemplates() has no contents";
-    private static final String NO_ACCESS_ERR =
-	"Cannot access file or URL ";
-    private static final String COMPILE_ERR =
-	"Could not compile stylesheet";
-
-    // This Hashtable is used to store parameters for locating
-    // <?xml-stylesheet ...?> processing instructions in XML documents.
-    private Hashtable _piParams = null;
-
-    // The above hashtable stores objects of this class only:
-    private class PIParamWrapper {
-	public String _media = null;
-	public String _title = null;
-	public String _charset = null;
-	
-	public PIParamWrapper(String media, String title, String charset) {
-	    _media = media;
-	    _title = title;
-	    _charset = charset;
-	}
-    }
-
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Contains nothing yet
-     */
-    public TransformerFactoryImpl() {
-	// Don't need anything here so far...
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Set the error event listener for the TransformerFactory, which is used
-     * for the processing of transformation instructions, and not for the
-     * transformation itself.
-     *
-     * @param listener The error listener to use with the TransformerFactory
-     * @throws IllegalArgumentException
-     */
-    public void setErrorListener(ErrorListener listener) 
-	throws IllegalArgumentException {
-	if (listener == null)
-            throw new IllegalArgumentException(ERROR_LISTENER_NULL);
-	_errorListener = listener;
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Get the error event handler for the TransformerFactory.
-     *
-     * @return The error listener used with the TransformerFactory
-     */
-    public ErrorListener getErrorListener() { 
-	return _errorListener;
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Returns the value set for a TransformerFactory attribute
-     *
-     * @param name The attribute name
-     * @return An object representing the attribute value
-     * @throws IllegalArgumentException
-     */
-    public Object getAttribute(String name) 
-	throws IllegalArgumentException { 
-	if (name.equals("translet-name"))
-	    return(_defaultTransletName);
-	return(null);
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Sets the value for a TransformerFactory attribute.
-     *
-     * @param name The attribute name
-     * @param value An object representing the attribute value
-     * @throws IllegalArgumentException
-     */
-    public void setAttribute(String name, Object value) 
-	throws IllegalArgumentException { 
-	// Set the default translet name (ie. class name), which will be used
-	// for translets that cannot be given a name from their system-id.
-	if ((name.equals("translet-name")) && (value instanceof String))
-	    _defaultTransletName = (String)value;
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Look up the value of a feature (to see if it is supported).
-     * This method must be updated as the various methods and features of this
-     * class are implemented.
-     *
-     * @param name The feature name
-     * @return 'true' if feature is supported, 'false' if not
-     */
-    public boolean getFeature(String name) { 
-	// All supported features should be listed here
-	String[] features = {
-	    DOMSource.FEATURE,
-	    DOMResult.FEATURE,
-	    SAXSource.FEATURE,
-	    SAXResult.FEATURE,
-	    StreamSource.FEATURE,
-	    StreamResult.FEATURE
-	};
-
-	// Inefficient, but it really does not matter in a function like this
-	for (int i=0; i<features.length; i++)
-	    if (name.equals(features[i])) return true;
-
-	// Feature not supported
-	return false;
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Get the object that is used by default during the transformation to
-     * resolve URIs used in document(), xsl:import, or xsl:include.
-     *
-     * @return The URLResolver used for this TransformerFactory and all
-     * Templates and Transformer objects created using this factory
-     */    
-    public URIResolver getURIResolver() {
-	return(_uriResolver);
-    } 
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Set the object that is used by default during the transformation to
-     * resolve URIs used in document(), xsl:import, or xsl:include. Note that
-     * this does not affect Templates and Transformers that are already
-     * created with this factory.
-     *
-     * @param resolver The URLResolver used for this TransformerFactory and all
-     * Templates and Transformer objects created using this factory
-     */    
-    public void setURIResolver(URIResolver resolver) {
-	_uriResolver = resolver;
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Get the stylesheet specification(s) associated via the xml-stylesheet
-     * processing instruction (see http://www.w3.org/TR/xml-stylesheet/) with
-     * the document document specified in the source parameter, and that match
-     * the given criteria.
-     *
-     * @param source The XML source document.
-     * @param media The media attribute to be matched. May be null, in which
-     * case the prefered templates will be used (i.e. alternate = no).
-     * @param title The value of the title attribute to match. May be null.
-     * @param charset The value of the charset attribute to match. May be null.
-     * @return A Source object suitable for passing to the TransformerFactory.
-     * @throws TransformerConfigurationException
-     */
-    public Source getAssociatedStylesheet(Source source, String media,
-					  String title, String charset)
-	throws TransformerConfigurationException {
-	// First create a hashtable that maps Source refs. to parameters
-	if (_piParams == null) _piParams = new Hashtable();
-	// Store the parameters for this Source in the Hashtable
-	_piParams.put(source, new PIParamWrapper(media, title, charset));
-	// Return the same Source - we'll locate the stylesheet later
-	return(source);
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Create a Transformer object that copies the input document to the result.
-     *
-     * @return A Transformer object that simply copies the source to the result.
-     * @throws TransformerConfigurationException
-     */    
-    public Transformer newTransformer()
-	throws TransformerConfigurationException { 
-
-	if (_copyTransformer != null) {
-	    if (_uriResolver != null)
-		_copyTransformer.setURIResolver(_uriResolver);
-	    return _copyTransformer;
-	}
-
-	XSLTC xsltc = new XSLTC();
-	xsltc.init();
-
-	// Compile the default copy-stylesheet
-	byte[] bytes = COPY_TRANSLET_CODE.getBytes();
-	ByteArrayInputStream bytestream = new ByteArrayInputStream(bytes);
-	InputSource input = new InputSource(bytestream);
-	input.setSystemId(_defaultTransletName);
-	byte[][] bytecodes = xsltc.compile(_defaultTransletName, input);
-
-	// Check that the transformation went well before returning
-	if (bytecodes == null) {
-	    throw new TransformerConfigurationException(COMPILE_ERR);
-	}
-
-	// Create a Transformer object and store for other calls
-	Templates templates = new TemplatesImpl(bytecodes,_defaultTransletName);
-	_copyTransformer = templates.newTransformer();
-	if (_uriResolver != null) _copyTransformer.setURIResolver(_uriResolver);
-	return(_copyTransformer);
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Process the Source into a Templates object, which is a a compiled
-     * representation of the source. Note that this method should not be
-     * used with XSLTC, as the time-consuming compilation is done for each
-     * and every transformation.
-     *
-     * @return A Templates object that can be used to create Transformers.
-     * @throws TransformerConfigurationException
-     */
-    public Transformer newTransformer(Source source) throws
-	TransformerConfigurationException {
-	final Templates templates = newTemplates(source);
-	final Transformer transformer = templates.newTransformer();
-	if (_uriResolver != null) transformer.setURIResolver(_uriResolver);
-	return(transformer);
-    }
-
-    /**
-     * Pass warning messages from the compiler to the error listener
-     */
-    private void passWarningsToListener(Vector messages) {
-	try {
-	    // Nothing to do if there is no registered error listener
-	    if (_errorListener == null) return;
-	    // Nothing to do if there are not warning messages
-	    if (messages == null) return;
-	    // Pass messages to listener, one by one
-	    final int count = messages.size();
-	    for (int pos=0; pos<count; pos++) {
-		String message = messages.elementAt(pos).toString();
-		_errorListener.warning(new TransformerException(message));
-	    }
-	}
-	catch (TransformerException e) {
-	    // nada
-	}
-    }
-
-    /**
-     * Pass error messages from the compiler to the error listener
-     */
-    private void passErrorsToListener(Vector messages) {
-	try {
-	    // Nothing to do if there is no registered error listener
-	    if (_errorListener == null) return;
-	    // Nothing to do if there are not warning messages
-	    if (messages == null) return;
-	    // Pass messages to listener, one by one
-	    final int count = messages.size();
-	    for (int pos=0; pos<count; pos++) {
-		String message = messages.elementAt(pos).toString();
-		_errorListener.error(new TransformerException(message));
-	    }
-	}
-	catch (TransformerException e) {
-	    // nada
-	}
-    }
-
-    /**
-     * Creates a SAX2 InputSource object from a TrAX Source object
-     */
-    private InputSource getInputSource(XSLTC xsltc, Source source)
-	throws TransformerConfigurationException {
-
-	InputSource input = null;
-	final String systemId = source.getSystemId();
-
-	try {
-
-	    // Try to get InputSource from SAXSource input
-	    if (source instanceof SAXSource) {
-		final SAXSource sax = (SAXSource)source;
-		input = sax.getInputSource();
-		// Pass the SAX parser to the compiler
-		xsltc.setXMLReader(sax.getXMLReader());
-	    }
-	    // handle  DOMSource  
-	    else if (source instanceof DOMSource) {
-		final DOMSource domsrc = (DOMSource)source;
-		final Document dom = (Document)domsrc.getNode();
-		final DOM2SAX dom2sax = new DOM2SAX(dom);
-		xsltc.setXMLReader(dom2sax);  
-	        // try to get SAX InputSource from DOM Source.
-		input = SAXSource.sourceToInputSource(source);
-	    }
-	    // Try to get InputStream or Reader from StreamSource
-	    else if (source instanceof StreamSource) {
-		final StreamSource stream = (StreamSource)source;
-		final InputStream istream = stream.getInputStream();
-		final Reader reader = stream.getReader();
-		// Create InputSource from Reader or InputStream in Source
-		if (istream != null)
-		    input = new InputSource(istream);
-		else if (reader != null)
-		    input = new InputSource(reader);
-	    }
-	    else {
-		throw new TransformerConfigurationException(UNKNOWN_SOURCE_ERR);
-	    }
-	    // Try to create an InputStream from the SystemId if no input so far
-	    if (input == null) {
-		if ((new File(systemId)).exists())
-		    input = new InputSource("file:/"+systemId);
-		else
-		    input = new InputSource(systemId);
-	    }
-
-	    // Pass system id to InputSource just to be on the safe side
-	    input.setSystemId(systemId);
-	}
-	catch (NullPointerException e) {
-	    throw new TransformerConfigurationException(NO_SOURCE_ERR);
-	}
-	catch (SecurityException e) {
-	    throw new TransformerConfigurationException(NO_ACCESS_ERR+systemId);
-	}
-	finally {
-	    return(input);
-	}
-    }
-
-    /**
-     * javax.xml.transform.sax.TransformerFactory implementation.
-     * Process the Source into a Templates object, which is a a compiled
-     * representation of the source.
-     *
-     * @param stylesheet The input stylesheet - DOMSource not supported!!!
-     * @return A Templates object that can be used to create Transformers.
-     * @throws TransformerConfigurationException
-     */
-    public Templates newTemplates(Source source)
-	throws TransformerConfigurationException {
-
-	// Create and initialize a stylesheet compiler
-	final XSLTC xsltc = new XSLTC();
-	xsltc.init();
-
-	// Set a document loader (for xsl:include/import) if defined
-	if (_uriResolver != null) xsltc.setSourceLoader(this);
-
-	// Pass parameters to the Parser to make sure it locates the correct
-	// <?xml-stylesheet ...?> PI in an XML input document
-	if ((_piParams != null) && (_piParams.get(source) != null)) {
-	    // Get the parameters for this Source object
-	    PIParamWrapper p = (PIParamWrapper)_piParams.get(source);
-	    // Pass them on to the compiler (which will pass then to the parser)
-	    if (p != null) 
-		xsltc.setPIParameters(p._media, p._title, p._charset);
-	}
-
-	// Compile the stylesheet
-	final InputSource input = getInputSource(xsltc, source);
-	byte[][] bytecodes = xsltc.compile(null, input);
-	final String transletName = xsltc.getClassName();
-
-	// Pass compiler warnings to the error listener
-	if (_errorListener != null)
-	    passWarningsToListener(xsltc.getWarnings());
-	else
-	    xsltc.printWarnings();
-
-	// Check that the transformation went well before returning
-	if (bytecodes == null) {
-	    // Pass compiler errors to the error listener
-	    if (_errorListener != null)
-		passErrorsToListener(xsltc.getErrors());
-	    else
-		xsltc.printErrors();
-	    throw new TransformerConfigurationException(COMPILE_ERR);
-	}
-	return(new TemplatesImpl(bytecodes, transletName));
-    }
-
-    /**
-     * javax.xml.transform.sax.SAXTransformerFactory implementation.
-     * Get a TemplatesHandler object that can process SAX ContentHandler
-     * events into a Templates object.
-     *
-     * @return A TemplatesHandler object that can handle SAX events
-     * @throws TransformerConfigurationException
-     */
-    public TemplatesHandler newTemplatesHandler() 
-	throws TransformerConfigurationException { 
-	return(new TemplatesHandlerImpl());
-    }
-
-    /**
-     * javax.xml.transform.sax.SAXTransformerFactory implementation.
-     * Get a TransformerHandler object that can process SAX ContentHandler
-     * events into a Result. This method will return a pure copy transformer.
-     *
-     * @return A TransformerHandler object that can handle SAX events
-     * @throws TransformerConfigurationException
-     */
-    public TransformerHandler newTransformerHandler() 
-	throws TransformerConfigurationException {
-	final Transformer transformer = newTransformer();
-	final TransformerImpl internal = (TransformerImpl)transformer;
-	return(new TransformerHandlerImpl(internal));
-    }
-
-    /**
-     * javax.xml.transform.sax.SAXTransformerFactory implementation.
-     * Get a TransformerHandler object that can process SAX ContentHandler
-     * events into a Result, based on the transformation instructions
-     * specified by the argument.
-     *
-     * @param src The source of the transformation instructions.
-     * @return A TransformerHandler object that can handle SAX events
-     * @throws TransformerConfigurationException
-     */
-    public TransformerHandler newTransformerHandler(Source src) 
-	throws TransformerConfigurationException { 
-	final Transformer transformer = newTransformer(src);
-	final TransformerImpl internal = (TransformerImpl)transformer;
-	return(new TransformerHandlerImpl(internal));
-    }
-
-    /**
-     * javax.xml.transform.sax.SAXTransformerFactory implementation.
-     * Get a TransformerHandler object that can process SAX ContentHandler
-     * events into a Result, based on the transformation instructions
-     * specified by the argument.
-     *
-     * @param templates Represents a pre-processed stylesheet
-     * @return A TransformerHandler object that can handle SAX events
-     * @throws TransformerConfigurationException
-     */    
-    public TransformerHandler newTransformerHandler(Templates templates) 
-	throws TransformerConfigurationException  {
-	final Transformer transformer = templates.newTransformer();
-	final TransformerImpl internal = (TransformerImpl)transformer;
-	return(new TransformerHandlerImpl(internal));
-    }
-
-
-    /**
-     * javax.xml.transform.sax.SAXTransformerFactory implementation.
-     * Create an XMLFilter that uses the given source as the
-     * transformation instructions.
-     *
-     * @param src The source of the transformation instructions.
-     * @return An XMLFilter object, or null if this feature is not supported.
-     * @throws TransformerConfigurationException
-     */
-    public XMLFilter newXMLFilter(Source src) 
-	throws TransformerConfigurationException {
-	Templates templates = newTemplates(src);
-	if (templates == null ) return null; 
-	return newXMLFilter(templates);
-    }
-
-    /**
-     * javax.xml.transform.sax.SAXTransformerFactory implementation.
-     * Create an XMLFilter that uses the given source as the
-     * transformation instructions.
-     *
-     * @param src The source of the transformation instructions.
-     * @return An XMLFilter object, or null if this feature is not supported.
-     * @throws TransformerConfigurationException
-     */
-    public XMLFilter newXMLFilter(Templates templates) 
-	throws TransformerConfigurationException {
-	try {
-      	    return new org.apache.xalan.xsltc.trax.TrAXFilter(templates);
-    	}
-	catch(TransformerConfigurationException e1) {
-      	    if(_errorListener != null) {
-                try {
-          	    _errorListener.fatalError(e1);
-          	    return null;
-        	}
-		catch( TransformerException e2) {
-          	    new TransformerConfigurationException(e2);
-        	}
-      	    }
-      	    throw e1;
-    	}
-    }
-
-    /**
-     * This method implements XSLTC's SourceLoader interface. It is used to
-     * glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.
-     *
-     * @param href The URI of the document to load
-     * @param context The URI of the currently loaded document
-     * @param xsltc The compiler that resuests the document
-     * @return An InputSource with the loaded document
-     */
-    public InputSource loadSource(String href, String context, XSLTC xsltc) {
-	try {
-	    final Source source = _uriResolver.resolve(href, context);
-	    final InputSource input = getInputSource(xsltc, source);
-	    return(input);
-	}
-	catch (TransformerConfigurationException e) {
-	    return null;
-	}
-	catch (TransformerException e) {
-	    return null;
-	}
-    }
-
-}
diff --git a/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java b/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
deleted file mode 100644
index 53cc007..0000000
--- a/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- *
- */
-
-package org.apache.xalan.xsltc.trax;
-
-import org.xml.sax.*;
-
-import javax.xml.transform.*;
-import javax.xml.transform.sax.*;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-import org.apache.xalan.xsltc.dom.DTDMonitor;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-/**
- * Implementation of a JAXP1.1 TransformerHandler
- */
-public class TransformerHandlerImpl implements TransformerHandler {
-
-    private TransformerImpl  _transformer;
-    private AbstractTranslet _translet = null;
-    private String           _systemId;
-    private DOMImpl          _dom = null;
-    private ContentHandler   _handler = null;
-    private DTDMonitor       _dtd = null;
-    private Result           _result = null;
-
-    private boolean          _done = false; // Set in endDocument()
-
-    private final static String NULL_RESULT_ERROR =
-	"setResult() must be called prior to startDocument().";
-
-    /**
-     * Cosntructor - pass in reference to a TransformerImpl object
-     */
-    protected TransformerHandlerImpl(TransformerImpl transformer) {
-	// Save the reference to the transformer
-	_transformer = transformer;
-
-	// Create an internal DOM (not W3C) and get SAX2 input handler
-	_dom = new DOMImpl();
-	_handler = _dom.getBuilder();
-
-	// Set this DOM as the transformer's DOM
-	_transformer.setDOM(_dom);
-	
-	// Get a reference to the translet wrapped inside the transformer
-	_translet = _transformer.getTranslet();
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TransformerHandler.getSystemId()
-     * Get the base ID (URI or system ID) from where relative URLs will be
-     * resolved.
-     * @return The systemID that was set with setSystemId(String id)
-     */
-    public String getSystemId() {
-	return _systemId;
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TransformerHandler.setSystemId()
-     * Get the base ID (URI or system ID) from where relative URLs will be
-     * resolved.
-     * @param id Base URI for this stylesheet
-     */
-    public void setSystemId(String id) {
-	_systemId = id;
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TransformerHandler.getTransformer()
-     * Get the Transformer associated with this handler, which is needed in
-     * order to set parameters and output properties.
-     * @return The Transformer object
-     */
-    public Transformer getTransformer() {
-	return(null);
-    }
-
-    /**
-     * Implements javax.xml.transform.sax.TransformerHandler.setResult()
-     * Enables the user of the TransformerHandler to set the to set the Result
-     * for the transformation.
-     * @param result A Result instance, should not be null
-     * @throws IllegalArgumentException if result is invalid for some reason
-     */
-    public void setResult(Result result) throws IllegalArgumentException {
-	_result = result;
-
-	// Run the transformation now, if not already done
-	if (_done) {
-	    try {
-		_transformer.setDOM(_dom);
-		_transformer.transform(null, _result);
-	    }
-	    catch (TransformerException e) {
-		// What the hell are we supposed to do with this???
-		throw new IllegalArgumentException(e.getMessage());
-	    }
-	}
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.characters()
-     * Receive notification of character data.
-     */
-    public void characters(char[] ch, int start, int length) 
-	throws SAXException {
-	_handler.characters(ch, start, length);
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.startDocument()
-     * Receive notification of the beginning of a document.
-     */
-    public void startDocument() throws SAXException {
-	if (_result == null) {
-	    throw new SAXException(NULL_RESULT_ERROR);
-	}
-	_handler.startDocument();
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.endDocument()
-     * Receive notification of the end of a document.
-     */
-    public void endDocument() throws SAXException {
-	// Signal to the DOMBuilder that the document is complete
-	_handler.endDocument();
-	// Pass unparsed entity declarations (if any) to the translet 
-	if (_dtd != null) _translet.setDTDMonitor(_dtd);
-	// Run the transformation now if we have a reference to a Result object
-	if (_result != null) {
-	    try {
-		_transformer.setDOM(_dom);
-		_transformer.transform(null, _result);
-	    }
-	    catch (TransformerException e) {
-		throw new SAXException(e);
-	    }
-	}
-	// Signal that the internal DOM is build (see 'setResult()').
-	_done = true;
-    }
-	
-    /**
-     * Implements org.xml.sax.ContentHandler.startElement()
-     * Receive notification of the beginning of an element.
-     */
-    public void startElement(String uri, String localName,
-			     String qname, Attributes attributes)
-	throws SAXException {
-	_handler.startElement(uri, localName, qname, attributes);
-    }
-	
-    /**
-     * Implements org.xml.sax.ContentHandler.endElement()
-     * Receive notification of the end of an element.
-     */
-    public void endElement(String namespaceURI, String localName, String qname)
-	throws SAXException {
-	_handler.endElement(namespaceURI, localName, qname);
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.processingInstruction()
-     * Receive notification of a processing instruction.
-     */
-    public void processingInstruction(String target, String data)
-	throws SAXException {
-	_handler.processingInstruction(target, data);
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.ignorableWhitespace()
-     * Receive notification of ignorable whitespace in element
-     * content. Similar to characters(char[], int, int).
-     */
-    public void ignorableWhitespace(char[] ch, int start, int length)
-	throws SAXException {
-	_handler.ignorableWhitespace(ch, start, length);
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.setDocumentLocator()
-     * Receive an object for locating the origin of SAX document events. 
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void setDocumentLocator(Locator locator) {
-	// Not handled by DOMBuilder - ignored
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.skippedEntity()
-     * Receive notification of a skipped entity.
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void skippedEntity(String name) {
-	// Not handled by DOMBuilder - ignored
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.startPrefixMapping()
-     * Begin the scope of a prefix-URI Namespace mapping.
-     */
-    public void startPrefixMapping(String prefix, String uri) 
-	throws SAXException {
-	_handler.startPrefixMapping(prefix, uri);
-    }
-
-    /**
-     * Implements org.xml.sax.ContentHandler.endPrefixMapping()
-     * End the scope of a prefix-URI Namespace mapping.
-     */
-    public void endPrefixMapping(String prefix) throws SAXException {
-	_handler.endPrefixMapping(prefix);
-    }
-
-    /**
-     * Implements org.xml.sax.DTDHandler.notationDecl()
-     * End the scope of a prefix-URI Namespace mapping.
-     * We do not handle this method, and the input is quietly ignored.
-     */
-    public void notationDecl(String name, String publicId, String systemId) {
-	// Not handled by DTDMonitor - ignored
-    }
-
-    /**
-     * Implements org.xml.sax.DTDHandler.unparsedEntityDecl()
-     * End the scope of a prefix-URI Namespace mapping.
-     */
-    public void unparsedEntityDecl(String name, String publicId,
-				   String systemId, String notationName)
-	throws SAXException {
-	// Create new contained for unparsed entities
-	if (_dtd == null) _dtd = new DTDMonitor();
-	_dtd.unparsedEntityDecl(name, publicId, systemId, notationName);
-    }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.startDTD()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void startDTD(String name, String publicId, String systemId) { }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.endDTD()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void endDTD() { }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.startEntity()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void startEntity(String name) { }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.endEntity()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void endEntity(String name) { }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.startCDATA()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void startCDATA() { }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.endCDATA()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void endCDATA() { }
-
-    /**
-     * Implements org.xml.sax.ext.LexicalHandler.comment()
-     * We do not handle this method, and the input is quietly ignored
-     */
-    public void comment(char[] ch, int start, int length) { }
-
-}
diff --git a/src/org/apache/xalan/xsltc/trax/TransformerImpl.java b/src/org/apache/xalan/xsltc/trax/TransformerImpl.java
deleted file mode 100644
index e6c3f5e..0000000
--- a/src/org/apache/xalan/xsltc/trax/TransformerImpl.java
+++ /dev/null
@@ -1,725 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Morten Jorgensen
- * @author G. Todd Miller
- *
- */
-
-package org.apache.xalan.xsltc.trax;
-
-import java.io.File;
-import java.io.Writer;
-import java.io.Reader;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.FileOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.MalformedURLException;
-import java.net.UnknownHostException;
-import java.net.UnknownServiceException;
-
-import java.lang.IllegalArgumentException;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.w3c.dom.Document;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.*;
-import javax.xml.transform.sax.*;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.stream.*;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.TransletException;
-import org.apache.xalan.xsltc.DOMCache;
-import org.apache.xalan.xsltc.dom.*;
-import org.apache.xalan.xsltc.runtime.*;
-import org.apache.xalan.xsltc.compiler.*;
-
-import java.util.Properties;
-
-public final class TransformerImpl extends Transformer implements DOMCache {
-
-    private AbstractTranslet _translet = null;
-    private String           _encoding = null;
-    private ContentHandler   _handler = null;
-
-    private ErrorListener _errorListener = null;
-    private URIResolver   _uriResolver = null;
-    private Properties    _properties = null;
-
-    // Used for default output property settings
-    private final static String EMPTY_STRING = "";
-    private final static String NO_STRING    = "no";
-    private final static String YES_STRING   = "yes";
-    private final static String XML_STRING   = "xml";
-
-    // Pre-set DOMImpl to use as input (used only with TransformerHandlerImpl)
-    private DOMImpl _dom = null;
-    
-    // List all error messages here
-    private final static String TRANSLET_ERR_MSG = 
-	"The transformer has no encapsulated translet object.";
-    private final static String HANDLER_ERR_MSG = 
-	"No defined output handler for transformation result.";
-    private static final String ERROR_LISTENER_NULL =
-	"Attempting to set ErrorListener for Transformer to null";
-    private static final String INPUT_SOURCE_EMPTY =
-	"The Source object passed to transform() has no contents.";
-    private static final String OUTPUT_RESULT_EMPTY =
-	"The Result object passed to transform() is invalid.";
-
-    /**
-     * Implements JAXP's Transformer constructor
-     * Our Transformer objects always need a translet to do the actual work
-     */
-    protected TransformerImpl(Translet translet) {
-	_translet = (AbstractTranslet)translet;
-    }
-
-    /**
-     * Returns the translet wrapped inside this Transformer
-     */
-    protected AbstractTranslet getTranslet() {
-	return(_translet);
-    }
-
-    /**
-     * Implements JAXP's Transformer.transform()
-     *
-     * @param source Contains the input XML document
-     * @param result Will contain the output from the transformation
-     * @throws TransformerException
-     */
-    public void transform(Source source, Result result)
-	throws TransformerException {
-
-	if (_translet == null) {
-	    throw new TransformerException(TRANSLET_ERR_MSG);
-	}
-
-	_handler = getOutputHandler(result);
-	if (_handler == null) { 
-	    throw new TransformerException(HANDLER_ERR_MSG);
-	}
-
-	if (_uriResolver != null) {
-	    _translet.setDOMCache(this);
-	}
-
-	// Run the transformation
-	transform(source, (ContentHandler)_handler, _encoding);
-
-	// If a DOMResult, then we must set the DOM Tree so it can
-	// be retrieved later 
-	if (result instanceof DOMResult) {
-	    ((DOMResult)result).setNode(((SAX2DOM)_handler).getDOM());
-	}
-    }
-
-    /**
-     * Create an output handler (SAX2 handler) for the transformation output
-     * based on the type and contents of the TrAX Result object passed to
-     * the transform() method. Only StreamResult and SAXResult are currently
-     * handled.
-     */
-    private ContentHandler getOutputHandler(Result result) 
-	throws TransformerException {
-	// Try to get the encoding from Translet (may not be set)
-	if (_translet._encoding != null)
-	    _encoding = _translet._encoding;
-	else
-	    _encoding = "utf-8"; // default output encoding
-
-	try {
-	    String systemId = result.getSystemId();
-
-	    // Handle SAXResult output handler
-	    if (result instanceof SAXResult) {
-		final SAXResult target = (SAXResult)result;
-		final ContentHandler handler = target.getHandler();
-		// Simple as feck, just pass the SAX handler back...
-		if (handler != null) return handler;
-	    }
-	    // Handle StreamResult output handler
-	    else if (result instanceof StreamResult) {
-		final StreamResult target = (StreamResult)result;
-		final OutputStream ostream = target.getOutputStream();
-		final Writer writer = target.getWriter();
-
-		if (ostream != null)
-		    return (new DefaultSAXOutputHandler(ostream, _encoding));
-		else if (writer != null)
-		    return (new DefaultSAXOutputHandler(writer, _encoding));
-	    }
-	    // Handle DOMResult output handler
-	    else if (result instanceof DOMResult) {
-		return (new SAX2DOM());
-	    }
-
-	    // Common, final handling of all input sources, only used if the
-	    // other contents of the Result object could not be used
-	    if (systemId != null) {
-		if ((new File(systemId)).exists())
-		    systemId = "file:/"+systemId;
-		final URL url = new URL(systemId);
-		final URLConnection connection = url.openConnection();
-		final OutputStream ostream = connection.getOutputStream();
-		return(new DefaultSAXOutputHandler(ostream, _encoding));
-	    }
-	    else {
-		throw new TransformerException(OUTPUT_RESULT_EMPTY);
-	    }
-	}
-	// If we cannot write to the location specified by the SystemId
-	catch (UnknownServiceException e) {
-	    throw new TransformerException(e);
-	}
-	// If we cannot create a SAX2DOM adapter
-	catch (ParserConfigurationException e) {
-	    throw new TransformerException(
-		"SAX2DOM adapter could not be created, " + e.getMessage());
-	}
-	// If we cannot create the file specified by the SystemId
-	catch (IOException e) {
-	    throw new TransformerException(e);
-	}
-    }
-
-    /**
-     * Set the internal DOMImpl that will be used for the next transformation
-     */
-    protected void setDOM(DOMImpl dom) {
-	_dom = dom;
-    }
-
-    /**
-     * Builds an internal DOM from a TrAX Source object
-     */
-    private DOMImpl getDOM(Source source, int mask)
-	throws TransformerException {
-	try {
-	    // Use the pre-defined DOM if present
-	    if (_dom != null) {
-		DOMImpl dom = _dom;
-		_dom = null; // use only once, so reset to 'null'
-		return(dom);
-	    }
-
-	    // Create an internal DOM (not W3C) and get SAX2 input handler
-	    final DOMImpl dom = new DOMImpl();
-	    final ContentHandler inputHandler = dom.getBuilder();
-
-	    // Create a DTDMonitor that will trace all unparsed entity URIs
-	    final DTDMonitor dtdMonitor = new DTDMonitor();
-
-	    // Handle SAXSource input
-	    if (source instanceof SAXSource) {
-		// Get all info from the input SAXSource object
-		final SAXSource   sax    = (SAXSource)source;
-		final XMLReader   reader = sax.getXMLReader();
-		final InputSource input  = sax.getInputSource();
-		final String      systemId = sax.getSystemId();
-		dtdMonitor.handleDTD(reader);
-		reader.setContentHandler(inputHandler);
-		reader.parse(input);
-		dom.setDocumentURI(systemId);
-	    }
-	    // Handle DOMSource input
-	    else if (source instanceof DOMSource) {
-		final DOMSource   domsrc = (DOMSource)source;
-		final Document    tree = (Document)domsrc.getNode();
-		final DOM2SAX     dom2sax = new DOM2SAX(tree);
-		final InputSource input = null; 
-		final String      systemId = domsrc.getSystemId(); 
-		dtdMonitor.handleDTD(dom2sax);
-		dom2sax.setContentHandler(inputHandler);
-		dom2sax.parse(input); // need this parameter?
-		dom.setDocumentURI(systemId);
-	    }
-	    // Handle StreamSource input
-	    else if (source instanceof StreamSource) {
-		// With a StreamSource we need to create our own parser
-		final SAXParserFactory factory = SAXParserFactory.newInstance();
-		final SAXParser parser = factory.newSAXParser();
-		final XMLReader reader = parser.getXMLReader();
-		dtdMonitor.handleDTD(reader);
-
-		// Get all info from the input StreamSource object
-		final StreamSource stream = (StreamSource)source;
-		final InputStream  streamInput = stream.getInputStream();
-		final Reader streamReader = stream.getReader();
-		final String systemId = stream.getSystemId();
-
-		reader.setContentHandler(inputHandler);
-		
-		InputSource input;
-		if (streamInput != null)
-		    input = new InputSource(streamInput);
-		else if (streamReader != null)
-		    input = new InputSource(streamReader);
-		else if (systemId != null)
-		    input = new InputSource(systemId);
-		else
-		    throw new TransformerException(INPUT_SOURCE_EMPTY);
-		reader.parse(input);
-		dom.setDocumentURI(systemId);
-	    }
-	    else {
-		return null;
-	    }
-
-	    // Set size of key/id indices
-	    _translet.setIndexSize(dom.getSize());
-	    // If there are any elements with ID attributes, build an index
-	    dtdMonitor.buildIdIndex(dom, mask, _translet);
-	    // Pass unparsed entity URIs to the translet
-	    _translet.setDTDMonitor(dtdMonitor);
-	    return dom;
-	}
-	catch (FileNotFoundException e) {
-	    if (_errorListener != null)
-		postErrorToListener("File not found: " + e.getMessage());
-	    throw new TransformerException(e);
-	}
-	catch (MalformedURLException e) {
-	    if (_errorListener != null)
-		postErrorToListener("Malformed URL: " + e.getMessage());
-	    throw new TransformerException(e);
-	}
-	catch (UnknownHostException e) {
-	    if (_errorListener != null)
-		postErrorToListener("Cannot resolve URI: " + e.getMessage());
-	    throw new TransformerException(e);
-	}
-	catch (Exception e) {
-	    if (_errorListener != null)
-		postErrorToListener("Internal error: " + e.getMessage()); 
-	    throw new TransformerException(e);
-	}
-    }
- 
-    /**
-     * Internal transformation method - uses the internal APIs of XSLTC
-     */
-    private void transform(Source src, ContentHandler sax, String encoding)
-	throws TransformerException {
-	try {
-	    // Build an iternal DOMImpl from the TrAX Source
-	    DOMImpl dom = getDOM(src, 0);
-
-	    // Pass output properties to the translet
-	    setOutputProperties(_translet, _properties);
-	    
-	    // This handler will post-process the translet output
-	    TextOutput handler;
-
-	    // Check if the ContentHandler also implements LexicalHandler
-	    if (sax instanceof LexicalHandler)
-		handler = new TextOutput(sax, (LexicalHandler)sax, encoding);
-	    else
-		handler = new TextOutput(sax, encoding);
-	    _translet.transform(dom, handler);
-	}
-	catch (TransletException e) {
-	    if (_errorListener != null)
-		postErrorToListener(e.getMessage());
-	    throw new TransformerException(e);
-	}
-	catch (RuntimeException e) {
-	    if (_errorListener != null)
-		postErrorToListener("Runtime Error: " + e.getMessage());
-	    System.err.println("Error: "+e.getMessage());
-	    e.printStackTrace();
-	    throw new TransformerException(e);
-	}
-	catch (Exception e) {
-	    if (_errorListener != null)
-		postErrorToListener("Internal error: " + e.getMessage()); 
-	    throw new TransformerException(e);
-	}
-    }
-
-    /**
-     * Implements JAXP's Transformer.getErrorListener()
-     * Get the error event handler in effect for the transformation.
-     *
-     * @return The error event handler currently in effect
-     */
-    public ErrorListener getErrorListener() {  
-	return _errorListener; 
-    }
-
-    /**
-     * Implements JAXP's Transformer.setErrorListener()
-     * Set the error event listener in effect for the transformation.
-     *
-     * @param listener The error event listener to use
-     * @throws IllegalArgumentException
-     */
-    public void setErrorListener(ErrorListener listener)
-	throws IllegalArgumentException {
-        if (listener == null)
-            throw new IllegalArgumentException(ERROR_LISTENER_NULL);
-        _errorListener = listener;
-    }
-
-    /**
-     * Inform TrAX error listener of an error
-     */
-    private void postErrorToListener(String message) {
-        try {
-            _errorListener.error(new TransformerException(message));
-	}
-	catch (TransformerException e) {
-            // ignored - transformation cannot be continued
-        }
-    }
-
-    /**
-     * Inform TrAX error listener of a warning
-     */
-    private void postWarningToListener(String message) {
-        try {
-            _errorListener.warning(new TransformerException(message));
-        }
-	catch (TransformerException e) {
-            // ignored - transformation cannot be continued
-        }
-    }
-
-    /**
-     * Implements JAXP's Transformer.getOutputProperties().
-     * Returns a copy of the output properties for the transformation. Note that
-     * this method will only return properties that were set in this class.
-     * The output settings defined in the stylesheet's <xsl:output> element
-     * and default XSLT output settings will not be returned by this method.
-     *
-     * @return Properties explicitly set for this Transformer
-     */
-    public Properties getOutputProperties() {
-	return(_properties);
-    }
-
-    /**
-     * The translet stores all CDATA sections set in the <xsl:output> element
-     * in a Hashtable. This method will re-construct the whitespace separated
-     * list of elements given in the <xsl:output> element.
-     */
-    private String makeCDATAString(Hashtable cdata) {
-	// Return a 'null' string if no CDATA section elements were specified
-	if (cdata == null) return null;
-
-	StringBuffer result = new StringBuffer();
-
-	// Get an enumeration of all the elements in the hashtable
-	Enumeration elements = cdata.keys();
-	if (elements.hasMoreElements()) {
-	    result.append((String)elements.nextElement());
-	    while (elements.hasMoreElements()) {
-		String element = (String)elements.nextElement();
-		result.append(' ');
-		result.append(element);
-	    }
-	}
-	
-	return(result.toString());
-    }
-
-    /**
-     * Implements JAXP's Transformer.getOutputProperty().
-     * Get an output property that is in effect for the transformation. The
-     * property specified may be a property that was set with setOutputProperty,
-     * or it may be a property specified in the stylesheet.
-     *
-     * @param name A non-null string that contains the name of the property
-     * @throws IllegalArgumentException if the property name is not known
-     */
-    public String getOutputProperty(String name)
-	throws IllegalArgumentException {
-
-	String value = null;
-
-	// Level1: Check if the property is overridden in this Transformer
-	if (_properties != null) value = _properties.getProperty(name);
-
-	// Level2: Check if the property value is set in the translet
-	if ((value == null) && (_translet != null)) {
-	    if (name.equals(OutputKeys.ENCODING))
-		value = _translet._encoding;
-	    else if (name.equals(OutputKeys.METHOD))
-		value = _translet._method;
-	    else if (name.equals(OutputKeys.INDENT))
-		value = (new Boolean(_translet._indent)).toString();
-	    else if (name.equals(OutputKeys.DOCTYPE_PUBLIC))
-		value = _translet._doctypePublic;
-	    else if (name.equals(OutputKeys.DOCTYPE_SYSTEM))
-		value = _translet._doctypeSystem;
-	    else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS))
-		value = makeCDATAString(_translet._cdata);
-	    else if (name.equals(OutputKeys.MEDIA_TYPE))
-		value = _translet._mediaType;
-	    else if (name.equals(OutputKeys.OMIT_XML_DECLARATION))
-		value = (new Boolean(_translet._omitHeader)).toString();
-	    else if (name.equals(OutputKeys.STANDALONE))
-		value = _translet._standalone;
-	    else if (name.equals(OutputKeys.VERSION))
-		value = _translet._version;
-	}
-
-	// Level3: Return the default property value
-	if (value == null) {
-	    if (name.equals(OutputKeys.ENCODING))
-		value = "utf-8";
-	    else if (name.equals(OutputKeys.METHOD))
-		value = XML_STRING;
-	    else if (name.equals(OutputKeys.INDENT))
-		value = NO_STRING;
-	    else if (name.equals(OutputKeys.DOCTYPE_PUBLIC))
-		value = EMPTY_STRING;
-	    else if (name.equals(OutputKeys.DOCTYPE_SYSTEM))
-		value = EMPTY_STRING;
-	    else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS))
-		value = EMPTY_STRING;
-	    else if (name.equals(OutputKeys.MEDIA_TYPE))
-		value = "text/xml";
-	    else if (name.equals(OutputKeys.OMIT_XML_DECLARATION))
-		value = NO_STRING;
-	    else if (name.equals(OutputKeys.STANDALONE))
-		value = NO_STRING;
-	    else if (name.equals(OutputKeys.VERSION))
-		value = "1.0";
-	}
-
-	return value;
-    }
-
-    /**
-     * Implements JAXP's Transformer.setOutputProperties().
-     * Set the output properties for the transformation. These properties
-     * will override properties set in the Templates with xsl:output.
-     * Unrecognised properties will be quitely ignored.
-     *
-     * @param properties The properties to use for the Transformer
-     * @throws IllegalArgumentException Never, errors are ignored
-     */
-    public void setOutputProperties(Properties properties)
-	throws IllegalArgumentException {
-	_properties = properties;
-    }
-
-    /**
-     * Implements JAXP's Transformer.setOutputProperty().
-     * Get an output property that is in effect for the transformation. The
-     * property specified may be a property that was set with 
-     * setOutputProperty(), or it may be a property specified in the stylesheet.
-     *
-     * @param name The name of the property to set
-     * @param value The value to assign to the property
-     * @throws IllegalArgumentException Never, errors are ignored
-     */
-    public void setOutputProperty(String name, String value)
-	throws IllegalArgumentException {
-	if (_properties == null) _properties = new Properties();
-	_properties.setProperty(name, value);
-    }
-
-    /**
-     * Internal method to pass any properties to the translet prior to
-     * initiating the transformation
-     */
-    private void setOutputProperties(AbstractTranslet translet,
-				     Properties properties) {
-	// Return right now if no properties are set
-	if (properties == null) return;
-
-	// Get a list of all the defined properties
-	Enumeration names = properties.propertyNames();
-	while (names.hasMoreElements()) {
-	    // Get the next property name and value
-	    String name = (String)names.nextElement();
-	    String value = properties.getProperty(name);
-
-	    // Pass property value to translet - override previous setting
-	    if (name.equals(OutputKeys.ENCODING))
-		translet._encoding = value;
-	    else if (name.equals(OutputKeys.METHOD))
-		translet._method = value;
-	    else if (name.equals(OutputKeys.DOCTYPE_PUBLIC))
-		translet._doctypePublic = value;
-	    else if (name.equals(OutputKeys.DOCTYPE_SYSTEM))
-		translet._doctypeSystem = value;
-	    else if (name.equals(OutputKeys.MEDIA_TYPE))
-		translet._mediaType = value;
-	    else if (name.equals(OutputKeys.STANDALONE))
-		translet._standalone = value;
-	    else if (name.equals(OutputKeys.VERSION))
-		translet._version = value;
-	    else if (name.equals(OutputKeys.OMIT_XML_DECLARATION)) {
-		if ((value != null) == (value.toLowerCase().equals("true"))) {
-		    translet._omitHeader = true;
-		}
-	    }
-	    else if (name.equals(OutputKeys.INDENT)) {
-		if ((value != null) == (value.toLowerCase().equals("true"))) {
-		    translet._indent = true;
-		}
-	    }
-	    else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) {
-		translet._cdata = null; // Important - clear previous setting
-		StringTokenizer e = new StringTokenizer(value);
-		while (e.hasMoreTokens()) {
-		    translet.addCdataElement(e.nextToken());
-		}
-	    }
-
-	}
-    }
-
-    /**
-     * Implements JAXP's Transformer.setParameter()
-     * Add a parameter for the transformation. The parameter is simply passed
-     * on to the translet - no validation is performed - so any unused
-     * parameters are quitely ignored by the translet.
-     *
-     * @param name The name of the parameter
-     * @param value The value to assign to the parameter
-     */
-    public void setParameter(String name, Object value) { 
-	_translet.addParameter(name, value, false);
-    }
-
-    /**
-     * Implements JAXP's Transformer.clearParameters()
-     * Clear all parameters set with setParameter. Clears the translet's
-     * parameter stack.
-     */
-    public void clearParameters() {  
-	_translet.clearParameters();
-    }
-
-    /**
-     * Implements JAXP's Transformer.getParameter()
-     * Returns the value of a given parameter. Note that the translet will not
-     * keep values for parameters that were not defined in the stylesheet.
-     *
-     * @param name The name of the parameter
-     * @return An object that contains the value assigned to the parameter
-     */
-    public final Object getParameter(String name) {
-	return(_translet.getParameter(name));
-    }
-
-    /**
-     * Implements JAXP's Transformer.getURIResolver()
-     * Set the object currently used to resolve URIs used in document().
-     *
-     * @returns The URLResolver object currently in use
-     */
-    public URIResolver getURIResolver() {
-	return _uriResolver;
-    }
-
-    /**
-     * Implements JAXP's Transformer.setURIResolver()
-     * Set an object that will be used to resolve URIs used in document().
-     *
-     * @param resolver The URIResolver to use in document()
-     */
-    public void setURIResolver(URIResolver resolver) { 
-	_uriResolver = resolver;
-    }
-
-    /**
-     * This class should only be used as a DOMCache for the translet if the
-     * URIResolver has been set.
-     *
-     * The method implements XSLTC's DOMCache interface, which is used to
-     * plug in an external document loader into a translet. This method acts
-     * as an adapter between TrAX's URIResolver interface and XSLTC's
-     * DOMCache interface. This approach is simple, but removes the
-     * possibility of using external document caches with XSLTC.
-     *
-     * @param uri  An URI pointing to the document location
-     * @param mask Contains a document ID (passed from the translet)
-     * @param translet A reference to the translet requesting the document
-     */
-    public DOMImpl retrieveDocument(String uri, int mask, Translet translet) {
-	try {
-	    return(getDOM(_uriResolver.resolve(uri, ""), mask));
-	}
-	catch (TransformerException e) {
-	    if (_errorListener != null)
-		postErrorToListener("File not found: " + e.getMessage());
-	    return(null);
-	}
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/util/IntegerArray.java b/src/org/apache/xalan/xsltc/util/IntegerArray.java
deleted file mode 100644
index c3a2297..0000000
--- a/src/org/apache/xalan/xsltc/util/IntegerArray.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * @author Jacek Ambroziak
- *
- */
-
-package org.apache.xalan.xsltc.util;
-
-public final class IntegerArray {
-    private static final int InitialSize = 32;
-    
-    private int[] _array;
-    private int   _size;
-    private int   _free = 0;
-  
-    public IntegerArray() {
-	this(InitialSize);
-    }
-  
-    public IntegerArray(int size) {
-	_array = new int[_size = size];
-    }
-
-    public IntegerArray(int[] array) {
-	this(array.length);
-	System.arraycopy(array, 0, _array, 0, _free = _size);
-    }
-
-    public void clear() {
-	_free = 0;
-    }
-
-    public Object clone() {
-	return new IntegerArray(_array);
-    }
-
-    public int[] toIntArray() {
-	final int[] result = new int[cardinality()];
-	System.arraycopy(_array, 0, result, 0, cardinality());
-	return result;
-    }
-
-    public final int at(int index) {
-	return _array[index];
-    }
-
-    public final void set(int index, int value) {
-	_array[index] = value;
-    }
-
-    public int indexOf(int n) {
-	for (int i = 0; i < _free; i++)
-	    if (n == _array[i])
-		return i;
-	return -1;
-    }
-
-    public final void add(int value) {
-	if (_free == _size)
-	    growArray(_size * 2);
-	_array[_free++] = value;
-    }
-  
-    /** adds new int at the end if not already present */
-    public void addNew(int value) {
-	for (int i = 0; i < _free; i++)
-	    if (_array[i] == value)	// already in array
-		return;
-	add(value);
-    }
-
-    private void growArray(int size) {
-	final int[] newArray = new int[_size = size];
-	System.arraycopy(_array, 0, newArray, 0, _free);
-	_array = newArray;
-    }
-
-    public int popLast() {
-	return _array[--_free];
-    }
-
-    public int last() {
-	return _array[_free - 1];
-    }
-
-    public void setLast(int n) {
-	_array[_free - 1] = n;
-    }
-
-    public void pop() {
-	_free--;
-    }
-
-    public void pop(int n) {
-	_free -= n;
-    }
-  
-    public final int cardinality() {
-	return _free;
-    }
-
-    public void print(java.io.PrintStream out) {
-	if (_free > 0) {
-	    for (int i = 0; i < _free - 1; i++) {
-		out.print(_array[i]);
-		out.print(' ');
-	    }
-	    out.println(_array[_free - 1]);
-	}
-	else
-	    out.println("IntegerArray: empty");
-    }
-}
diff --git a/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java b/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
deleted file mode 100644
index ff67517..0000000
--- a/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * @(#)$Id$
- *
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xalan.xsltc.util;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-
-/**
- * Utility class to redirect input to JavaCup program.
- *
- * Usage-command line: 
- * <code>java org.apache.xalan.xsltc.utils.JavaCupRedirect [args] -stdin filename.ext</code>
- *
- * @author Morten Jorgensen
- * @version $Id$
- */
-public class JavaCupRedirect {
-
-    private final static String ERRMSG = 
-		 "You must supply a filename with the -stdin option.";
-
-    public static void main (String args[]) {
-
-		 // If we should call System.exit or not
-         //@todo make this settable for use inside other java progs
-		 boolean systemExitOK = true;
-
-		 // This is the stream we'll set as our System.in
-		 InputStream input = null;
-
-		 // The number of arguments
-		 final int argc = args.length;
-
-		 // The arguments we'll pass to the real 'main()'
-		 String[] new_args = new String[argc - 2];
-		 int new_argc = 0;
-
-		 // Parse all parameters passed to this class
-		 for (int i = 0; i < argc; i++) {
-		     // Parse option '-stdin <filename>'
-		     if (args[i].equals("-stdin")) {
-		 		 // This option must have an argument
-		 		 if ((++i >= argc) || (args[i].startsWith("-"))) {
-		 		     System.err.println(ERRMSG);
-		 		     doSystemExit(systemExitOK);
-		 		 }
-		 		 try {
-		 		     input = new FileInputStream(args[i]);
-		 		 }
-		 		 catch (FileNotFoundException e) {
-		 		     System.err.println("Could not open file "+args[i]);
-		 		     doSystemExit(systemExitOK);
-		 		 }
-		 		 catch (SecurityException e) {
-		 		     System.err.println("No permission to file "+args[i]);
-		 		     doSystemExit(systemExitOK);
-		 		 }
-		     }
-		     else {
-		 		 if (new_argc == new_args.length) {
-		 		     System.err.println("Missing -stdin option!");
-		 		     doSystemExit(systemExitOK);
-		 		 }
-		 		 new_args[new_argc++] = args[i];
-		     }
-		 }
-
-		 System.setIn(input);
-		 try {
-		     java_cup.Main.main(new_args);
-		 }
-		 catch (Exception e) {
-		     System.err.println("Error running JavaCUP:");
-		     e.printStackTrace();
-		     doSystemExit(systemExitOK);
-		 }
-    }
-    public static void doSystemExit (boolean doExit) {
-        if (doExit)
-            System.exit(-1);
-    }
-}
\ No newline at end of file
diff --git a/src/org/apache/xml/dtm/Axis.java b/src/org/apache/xml/dtm/Axis.java
deleted file mode 100644
index 632f71c..0000000
--- a/src/org/apache/xml/dtm/Axis.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-/**
- * Specifies values related to XPath Axes.
- * <p>The ancestor, descendant, following, preceding and self axes partition a
- * document (ignoring attribute and namespace nodes): they do not overlap
- * and together they contain all the nodes in the document.</p>
- */
-public interface Axis
-{
-
-  /**
-   * The ancestor axis contains the ancestors of the context node;
-   *  the ancestors of the context node consist of the parent of context
-   *  node and the parent's parent and so on; thus, the ancestor axis will
-   *  always include the root node, unless the context node is the root node.
-   */
-  public static final int ANCESTOR = 0;
-
-  /**
-   * the ancestor-or-self axis contains the context node and the ancestors of
-   *  the context node; thus, the ancestor axis will always include the
-   *  root node.
-   */
-  public static final int ANCESTORORSELF = 1;
-
-  /**
-   * the attribute axis contains the attributes of the context node; the axis
-   *  will be empty unless the context node is an element.
-   */
-  public static final int ATTRIBUTE = 2;
-
-  /** The child axis contains the children of the context node. */
-  public static final int CHILD = 3;
-
-  /**
-   * The descendant axis contains the descendants of the context node;
-   *  a descendant is a child or a child of a child and so on; thus the
-   *  descendant axis never contains attribute or namespace nodes.
-   */
-  public static final int DESCENDANT = 4;
-
-  /**
-   * The descendant-or-self axis contains the context node and the
-   *  descendants of the context node.
-   */
-  public static final int DESCENDANTORSELF = 5;
-
-  /**
-   * the following axis contains all nodes in the same document as the
-   *  context node that are after the context node in document order, excluding
-   *  any descendants and excluding attribute nodes and namespace nodes.
-   */
-  public static final int FOLLOWING = 6;
-
-  /**
-   * The following-sibling axis contains all the following siblings of the
-   *  context node; if the context node is an attribute node or namespace node,
-   *  the following-sibling axis is empty.
-   */
-  public static final int FOLLOWINGSIBLING = 7;
-
-  /**
-   * The namespace axis contains the namespace nodes of the context node; the
-   *  axis will be empty unless the context node is an element.
-   */
-  public static final int NAMESPACEDECLS = 8;
-
-  /**
-   * The namespace axis contains the namespace nodes of the context node; the
-   *  axis will be empty unless the context node is an element.
-   */
-  public static final int NAMESPACE = 9;
-
-  /**
-   * The parent axis contains the parent of the context node,
-   *  if there is one.
-   */
-  public static final int PARENT = 10;
-
-  /**
-   * The preceding axis contains all nodes in the same document as the context
-   *  node that are before the context node in document order, excluding any
-   *  ancestors and excluding attribute nodes and namespace nodes
-   */
-  public static final int PRECEDING = 11;
-
-  /**
-   * The preceding-sibling axis contains all the preceding siblings of the
-   *  context node; if the context node is an attribute node or namespace node,
-   *  the preceding-sibling axis is empty.
-   */
-  public static final int PRECEDINGSIBLING = 12;
-
-  /** The self axis contains just the context node itself. */
-  public static final int SELF = 13;
-
-  /**
-   * A non-xpath axis, traversing the subtree including the subtree
-   *  root, descendants, attributes, and namespace node decls.
-   */
-  public static final int ALLFROMNODE = 14;
-
-  /**
-   * A non-xpath axis, traversing the the preceding and the ancestor nodes, 
-   * needed for inverseing select patterns to match patterns.
-   */
-  public static final int PRECEDINGANDANCESTOR = 15;
-  
-  // ===========================================
-  // All axis past this are absolute.
-  
-  /**
-   * A non-xpath axis, returns all nodes in the tree from and including the 
-   * root.
-   */
-  public static final int ALL = 16;
-
-  /**
-   * A non-xpath axis, returns all nodes that aren't namespaces or attributes, 
-   * from and including the root.
-   */
-  public static final int DESCENDANTSFROMROOT = 17;
-
-  /**
-   * A non-xpath axis, returns all nodes that aren't namespaces or attributes, 
-   * from and including the root.
-   */
-  public static final int DESCENDANTSORSELFFROMROOT = 18;
-
-  /**
-   * A non-xpath axis, returns root only.
-   */
-  public static final int ROOT = 19;
-
-  /**
-   * A non-xpath axis, for functions.
-   */
-  public static final int FILTEREDLIST = 20;
-
-
-  /** The names of the axes for diagnostic purposes. */
-  public static final String[] names =
-  {
-    "ancestor",  // 0
-    "ancestor-or-self",  // 1
-    "attribute",  // 2
-    "child",  // 3
-    "descendant",  // 4
-    "descendant-or-self",  // 5
-    "following",  // 6
-    "following-sibling",  // 7
-    "namespace-decls",  // 8
-    "namespace",  // 9
-    "parent",  // 10
-    "preceding",  // 11
-    "preceding-sibling",  // 12
-    "self",  // 13
-    "all-from-node",  // 14
-    "preceding-and-ancestor",  // 15
-    "all",  // 16
-    "descendants-from-root",  // 17
-    "descendants-or-self-from-root",  // 18
-    "root",  // 19
-    "filtered-list"  // 20
-  };
-}
diff --git a/src/org/apache/xml/dtm/DTM.java b/src/org/apache/xml/dtm/DTM.java
deleted file mode 100644
index 05d8999..0000000
--- a/src/org/apache/xml/dtm/DTM.java
+++ /dev/null
@@ -1,967 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-import org.apache.xml.utils.XMLString;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * <code>DTM</code> is an XML document model expressed as a table
- * rather than an object tree. It attempts to provide an interface to
- * a parse tree that has very little object creation. (DTM
- * implementations may also support incremental construction of the
- * model, but that's hidden from the DTM API.)
- *
- * <p>Nodes in the DTM are identified by integer "handles".  A handle must
- * be unique within a process, and carries both node identification and
- * document identification.  It must be possible to compare two handles
- * (and thus their nodes) for identity with "==".</p>
- *
- * <p>Namespace URLs, local-names, and expanded-names can all be
- * represented by and tested as integer ID values.  An expanded name
- * represents (and may or may not directly contain) a combination of
- * the URL ID, and the local-name ID.  Note that the namespace URL id
- * can be 0, which should have the meaning that the namespace is null.
- * For consistancy, zero should not be used for a local-name index. </p>
- *
- * <p>Text content of a node is represented by an index and length,
- * permitting efficient storage such as a shared FastStringBuffer.</p>
- *
- * <p>The model of the tree, as well as the general navigation model,
- * is that of XPath 1.0, for the moment.  The model will eventually be
- * adapted to match the XPath 2.0 data model, XML Schema, and
- * InfoSet.</p>
- *
- * <p>DTM does _not_ directly support the W3C's Document Object
- * Model. However, it attempts to come close enough that an
- * implementation of DTM can be created that wraps a DOM and vice
- * versa.</p>
- *
- * <p>State: In progress!!</p>
- */
-public interface DTM
-{
-
-  /**
-   * Null node handles are represented by this value.
-   */
-  public static final int NULL = -1;
-
-  // These nodeType mnemonics and values are deliberately the same as those
-  // used by the DOM, for convenient mapping
-  //
-  // %REVIEW% Should we actually define these as initialized to,
-  // eg. org.w3c.dom.Document.ELEMENT_NODE?
-
-  /**
-   * The node is an <code>Element</code>.
-   */
-  public static final short ELEMENT_NODE = 1;
-
-  /**
-   * The node is an <code>Attr</code>.
-   */
-  public static final short ATTRIBUTE_NODE = 2;
-
-  /**
-   * The node is a <code>Text</code> node.
-   */
-  public static final short TEXT_NODE = 3;
-
-  /**
-   * The node is a <code>CDATASection</code>.
-   */
-  public static final short CDATA_SECTION_NODE = 4;
-
-  /**
-   * The node is an <code>EntityReference</code>.
-   */
-  public static final short ENTITY_REFERENCE_NODE = 5;
-
-  /**
-   * The node is an <code>Entity</code>.
-   */
-  public static final short ENTITY_NODE = 6;
-
-  /**
-   * The node is a <code>ProcessingInstruction</code>.
-   */
-  public static final short PROCESSING_INSTRUCTION_NODE = 7;
-
-  /**
-   * The node is a <code>Comment</code>.
-   */
-  public static final short COMMENT_NODE = 8;
-
-  /**
-   * The node is a <code>Document</code>.
-   */
-  public static final short DOCUMENT_NODE = 9;
-
-  /**
-   * The node is a <code>DocumentType</code>.
-   */
-  public static final short DOCUMENT_TYPE_NODE = 10;
-
-  /**
-   * The node is a <code>DocumentFragment</code>.
-   */
-  public static final short DOCUMENT_FRAGMENT_NODE = 11;
-
-  /**
-   * The node is a <code>Notation</code>.
-   */
-  public static final short NOTATION_NODE = 12;
-
-  /**
-   * The node is a <code>namespace node</code>. Note that this is not
-   * currently a node type defined by the DOM API.
-   */
-  public static final short NAMESPACE_NODE = 13;
-
-  // ========= DTM Implementation Control Functions. ==============
-  // %TBD% RETIRED -- do via setFeature if needed. Remove from impls.
-  // public void setParseBlockSize(int blockSizeSuggestion);
-
-  /**
-   * Set an implementation dependent feature.
-   * <p>
-   * %REVIEW% Do we really expect to set features on DTMs?
-   *
-   * @param featureId A feature URL.
-   * @param state true if this feature should be on, false otherwise.
-   */
-  public void setFeature(String featureId, boolean state);
-
-  /**
-   * Set a run time property for this DTM instance.
-   *
-   * @param property a <code>String</code> value
-   * @param value an <code>Object</code> value
-   */
-  public void setProperty(String property, Object value);
-
-  // ========= Document Navigation Functions =========
-
-  /**
-   * This returns a stateless "traverser", that can navigate over an
-   * XPath axis, though not in document order.
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   *
-   * @return A DTMAxisIterator, or null if the givin axis isn't supported.
-   */
-  public DTMAxisTraverser getAxisTraverser(final int axis);
-
-  /**
-   * This is a shortcut to the iterators that implement
-   * XPath axes.
-   * Returns a bare-bones iterator that must be initialized
-   * with a start node (using iterator.setStartNode()).
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   *
-   * @return A DTMAxisIterator, or null if the givin axis isn't supported.
-   */
-  public DTMAxisIterator getAxisIterator(final int axis);
-
-  /**
-   * Get an iterator that can navigate over an XPath Axis, predicated by
-   * the extended type ID.
-   *
-   * @param axis
-   * @param type An extended type ID.
-   *
-   * @return A DTMAxisIterator, or null if the givin axis isn't supported.
-   */
-  public DTMAxisIterator getTypedAxisIterator(final int axis, final int type);
-
-  /**
-   * Given a node handle, test if it has child nodes.
-   * <p> %REVIEW% This is obviously useful at the DOM layer, where it
-   * would permit testing this without having to create a proxy
-   * node. It's less useful in the DTM API, where
-   * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and
-   * almost as self-evident. But it's a convenience, and eases porting
-   * of DOM code to DTM.  </p>
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int true if the given node has child nodes.
-   */
-  public boolean hasChildNodes(int nodeHandle);
-
-  /**
-   * Given a node handle, get the handle of the node's first child.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int DTM node-number of first child,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getFirstChild(int nodeHandle);
-
-  /**
-   * Given a node handle, get the handle of the node's last child.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int Node-number of last child,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getLastChild(int nodeHandle);
-
-  /**
-   * Retrieves an attribute node by local name and namespace URI
-   *
-   * %TBD% Note that we currently have no way to support
-   * the DOM's old getAttribute() call, which accesses only the qname.
-   *
-   * @param elementHandle Handle of the node upon which to look up this attribute.
-   * @param namespaceURI The namespace URI of the attribute to
-   *   retrieve, or null.
-   * @param name The local name of the attribute to
-   *   retrieve.
-   * @return The attribute node handle with the specified name (
-   *   <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
-   *   attribute.
-   */
-  public int getAttributeNode(int elementHandle, String namespaceURI,
-                              String name);
-
-  /**
-   * Given a node handle, get the index of the node's first attribute.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return Handle of first attribute, or DTM.NULL to indicate none exists.
-   */
-  public int getFirstAttribute(int nodeHandle);
-
-  /**
-   * Given a node handle, get the index of the node's first namespace node.
-   *
-   * @param nodeHandle handle to node, which should probably be an element
-   *                   node, but need not be.
-   *
-   * @param inScope true if all namespaces in scope should be
-   *                   returned, false if only the node's own
-   *                   namespace declarations should be returned.
-   * @return handle of first namespace,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getFirstNamespaceNode(int nodeHandle, boolean inScope);
-
-  /**
-   * Given a node handle, advance to its next sibling.
-   * @param nodeHandle int Handle of the node.
-   * @return int Node-number of next sibling,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getNextSibling(int nodeHandle);
-
-  /**
-   * Given a node handle, find its preceeding sibling.
-   * WARNING: DTM implementations may be asymmetric; in some,
-   * this operation has been resolved by search, and is relatively expensive.
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node-number of the previous sib,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getPreviousSibling(int nodeHandle);
-
-  /**
-   * Given a node handle, advance to the next attribute. If an
-   * element, we advance to its first attribute; if an attr, we advance to
-   * the next attr of the same element.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int DTM node-number of the resolved attr,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getNextAttribute(int nodeHandle);
-
-  /**
-   * Given a namespace handle, advance to the next namespace in the same scope
-   * (local or local-plus-inherited, as selected by getFirstNamespaceNode)
-   *
-   * @param baseHandle handle to original node from where the first child
-   * was relative to (needed to return nodes in document order).
-   * @param namespaceHandle handle to node which must be of type
-   * NAMESPACE_NODE.
-   * NEEDSDOC @param inScope
-   * @return handle of next namespace,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getNextNamespaceNode(int baseHandle, int namespaceHandle,
-                                  boolean inScope);
-
-  /**
-   * Given a node handle, find its parent node.
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node handle of parent,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getParent(int nodeHandle);
-
-  /**
-   * Given a node handle, find the owning document node. Note that
-   * the reason this can't just return 0 is that it needs to include the
-   * document number portion of the node handle.
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node handle of document, which should always be valid.
-   */
-  public int getDocument();
-
-  /**
-   * Given a node handle, find the owning document node.  This has the exact
-   * same semantics as the DOM Document method of the same name, in that if
-   * the nodeHandle is a document node, it will return NULL.
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node handle of owning document,
-   * or DTM.NULL if the nodeHandle is a document.
-   */
-  public int getOwnerDocument(int nodeHandle);
-
-  /**
-   * Get the string-value of a node as a String object
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A string object that represents the string-value of the given node.
-   */
-  public XMLString getStringValue(int nodeHandle);
-
-  /**
-   * Get number of character array chunks in
-   * the string-value of a node.
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   * Note that a single text node may have multiple text chunks.
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return number of character array chunks in
-   *         the string-value of a node.
-   */
-  public int getStringValueChunkCount(int nodeHandle);
-
-  /**
-   * Get a character array chunk in the string-value of a node.
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   * Note that a single text node may have multiple text chunks.
-   *
-   * @param nodeHandle The node ID.
-   * @param chunkIndex Which chunk to get.
-   * @param startAndLen  A two-integer array which, upon return, WILL
-   * BE FILLED with values representing the chunk's start position
-   * within the returned character buffer and the length of the chunk.
-   * @return The character array buffer within which the chunk occurs,
-   * setting startAndLen's contents as a side-effect.
-   */
-  public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
-                                    int[] startAndLen);
-
-  /**
-   * Given a node handle, return an ID that represents the node's expanded name.
-   *
-   * @param nodeHandle The handle to the node in question.
-   *
-   * @return the expanded-name id of the node.
-   */
-  public int getExpandedTypeID(int nodeHandle);
-
-  /**
-   * Given an expanded name, return an ID.  If the expanded-name does not
-   * exist in the internal tables, the entry will be created, and the ID will
-   * be returned.  Any additional nodes that are created that have this
-   * expanded name will use this ID.
-   *
-   * @param nodeHandle The handle to the node in question.
-   *
-   * NEEDSDOC @param namespace
-   * NEEDSDOC @param localName
-   * NEEDSDOC @param type
-   *
-   * @return the expanded-name id of the node.
-   */
-  public int getExpandedTypeID(String namespace, String localName, int type);
-
-  /**
-   * Given an expanded-name ID, return the local name part.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return String Local name of this node.
-   */
-  public String getLocalNameFromExpandedNameID(int ExpandedNameID);
-
-  /**
-   * Given an expanded-name ID, return the namespace URI part.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public String getNamespaceFromExpandedNameID(int ExpandedNameID);
-
-  /**
-   * Given a node handle, return its DOM-style node name. This will
-   * include names such as #text or #document.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   * %REVIEW% Document when empty string is possible...
-   */
-  public String getNodeName(int nodeHandle);
-
-  /**
-   * Given a node handle, return the XPath node name.  This should be
-   * the name as described by the XPath data model, NOT the DOM-style
-   * name.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node.
-   */
-  public String getNodeNameX(int nodeHandle);
-
-  /**
-   * Given a node handle, return its DOM-style localname.
-   * (As defined in Namespaces, this is the portion of the name after the
-   * prefix, if present, or the whole node name if no prefix exists)
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Local name of this node.
-   */
-  public String getLocalName(int nodeHandle);
-
-  /**
-   * Given a namespace handle, return the prefix that the namespace decl is
-   * mapping.
-   * Given a node handle, return the prefix used to map to the namespace.
-   * (As defined in Namespaces, this is the portion of the name before any
-   * colon character).
-   * @param postition int Handle of the node.
-   *
-   * <p> %REVIEW% Are you sure you want "" for no prefix?  </p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String prefix of this node's name, or "" if no explicit
-   * namespace prefix was given.
-   */
-  public String getPrefix(int nodeHandle);
-
-  /**
-   * Given a node handle, return its DOM-style namespace URI
-   * (As defined in Namespaces, this is the declared URI which this node's
-   * prefix -- or default in lieu thereof -- was mapped to.)
-   * @param postition int Handle of the node.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public String getNamespaceURI(int nodeHandle);
-
-  /**
-   * Given a node handle, return its node value. This is mostly
-   * as defined by the DOM, but may ignore some conveniences.
-   * <p>
-   * @param nodeHandle The node id.
-   * @return String Value of this node, or null if not
-   * meaningful for this node type.
-   */
-  public String getNodeValue(int nodeHandle);
-
-  /**
-   * Given a node handle, return its DOM-style node type.
-   *
-   * <p>%REVIEW% Generally, returning short is false economy. Return int?</p>
-   *
-   * @param nodeHandle The node id.
-   * @return int Node type, as per the DOM's Node._NODE constants.
-   */
-  public short getNodeType(int nodeHandle);
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the depth level of this node in the tree (equals 1 for
-   * a parentless node).
-   *
-   * @param nodeHandle The node id.
-   * @return the number of ancestors, plus one
-   */
-  public short getLevel(int nodeHandle);
-
-  // ============== Document query functions ==============
-
-  /**
-   * Tests whether DTM DOM implementation implements a specific feature and
-   * that feature is supported by this node.
-   * @param feature The name of the feature to test.
-   * @param version This is the version number of the feature to test.
-   *   If the version is not
-   *   specified, supporting any version of the feature will cause the
-   *   method to return <code>true</code>.
-   * @return Returns <code>true</code> if the specified feature is
-   *   supported on this node, <code>false</code> otherwise.
-   */
-  public boolean isSupported(String feature, String version);
-
-  /**
-   * Return the base URI of the document entity. If it is not known
-   * (because the document was parsed from a socket connection or from
-   * standard input, for example), the value of this property is unknown.
-   *
-   * @return the document base URI String object or null if unknown.
-   */
-  public String getDocumentBaseURI();
-
-  /**
-   * Set the base URI of the document entity.
-   *
-   * @param baseURI the document base URI String object or null if unknown.
-   */
-  public void setDocumentBaseURI(String baseURI);
-
-  /**
-   * Return the system identifier of the document entity. If
-   * it is not known, the value of this property is null.
-   *
-   * @param nodeHandle The node id, which can be any valid node handle.
-   * @return the system identifier String object or null if unknown.
-   */
-  public String getDocumentSystemIdentifier(int nodeHandle);
-
-  /**
-   * Return the name of the character encoding scheme
-   *        in which the document entity is expressed.
-   *
-   * @param nodeHandle The node id, which can be any valid node handle.
-   * @return the document encoding String object.
-   */
-  public String getDocumentEncoding(int nodeHandle);
-
-  /**
-   * Return an indication of the standalone status of the document,
-   *        either "yes" or "no". This property is derived from the optional
-   *        standalone document declaration in the XML declaration at the
-   *        beginning of the document entity, and has no value if there is no
-   *        standalone document declaration.
-   *
-   * @param nodeHandle The node id, which can be any valid node handle.
-   * @return the document standalone String object, either "yes", "no", or null.
-   */
-  public String getDocumentStandalone(int nodeHandle);
-
-  /**
-   * Return a string representing the XML version of the document. This
-   * property is derived from the XML declaration optionally present at the
-   * beginning of the document entity, and has no value if there is no XML
-   * declaration.
-   *
-   * @param the document handle
-   *
-   * NEEDSDOC @param documentHandle
-   *
-   * @return the document version String object
-   */
-  public String getDocumentVersion(int documentHandle);
-
-  /**
-   * Return an indication of
-   * whether the processor has read the complete DTD. Its value is a
-   * boolean. If it is false, then certain properties (indicated in their
-   * descriptions below) may be unknown. If it is true, those properties
-   * are never unknown.
-   *
-   * @return <code>true</code> if all declarations were processed;
-   *         <code>false</code> otherwise.
-   */
-  public boolean getDocumentAllDeclarationsProcessed();
-
-  /**
-   *   A document type declaration information item has the following properties:
-   *
-   *     1. [system identifier] The system identifier of the external subset, if
-   *        it exists. Otherwise this property has no value.
-   *
-   * @return the system identifier String object, or null if there is none.
-   */
-  public String getDocumentTypeDeclarationSystemIdentifier();
-
-  /**
-   * Return the public identifier of the external subset,
-   * normalized as described in 4.2.2 External Entities [XML]. If there is
-   * no external subset or if it has no public identifier, this property
-   * has no value.
-   *
-   * @param the document type declaration handle
-   *
-   * @return the public identifier String object, or null if there is none.
-   */
-  public String getDocumentTypeDeclarationPublicIdentifier();
-
-  /**
-   * Returns the <code>Element</code> whose <code>ID</code> is given by
-   * <code>elementId</code>. If no such element exists, returns
-   * <code>DTM.NULL</code>. Behavior is not defined if more than one element
-   * has this <code>ID</code>. Attributes (including those
-   * with the name "ID") are not of type ID unless so defined by DTD/Schema
-   * information available to the DTM implementation.
-   * Implementations that do not know whether attributes are of type ID or
-   * not are expected to return <code>DTM.NULL</code>.
-   *
-   * <p>%REVIEW% Presumably IDs are still scoped to a single document,
-   * and this operation searches only within a single document, right?
-   * Wouldn't want collisions between DTMs in the same process.</p>
-   *
-   * @param elementId The unique <code>id</code> value for an element.
-   * @return The handle of the matching element.
-   */
-  public int getElementById(String elementId);
-
-  /**
-   * The getUnparsedEntityURI function returns the URI of the unparsed
-   * entity with the specified name in the same document as the context
-   * node (see [3.3 Unparsed Entities]). It returns the empty string if
-   * there is no such entity.
-   * <p>
-   * XML processors may choose to use the System Identifier (if one
-   * is provided) to resolve the entity, rather than the URI in the
-   * Public Identifier. The details are dependent on the processor, and
-   * we would have to support some form of plug-in resolver to handle
-   * this properly. Currently, we simply return the System Identifier if
-   * present, and hope that it a usable URI or that our caller can
-   * map it to one.
-   * %REVIEW% Resolve Public Identifiers... or consider changing function name.
-   * <p>
-   * If we find a relative URI
-   * reference, XML expects it to be resolved in terms of the base URI
-   * of the document. The DOM doesn't do that for us, and it isn't
-   * entirely clear whether that should be done here; currently that's
-   * pushed up to a higher level of our application. (Note that DOM Level
-   * 1 didn't store the document's base URI.)
-   * %REVIEW% Consider resolving Relative URIs.
-   * <p>
-   * (The DOM's statement that "An XML processor may choose to
-   * completely expand entities before the structure model is passed
-   * to the DOM" refers only to parsed entities, not unparsed, and hence
-   * doesn't affect this function.)
-   *
-   * @param name A string containing the Entity Name of the unparsed
-   * entity.
-   *
-   * @return String containing the URI of the Unparsed Entity, or an
-   * empty string if no such entity exists.
-   */
-  public String getUnparsedEntityURI(String name);
-
-  // ============== Boolean methods ================
-
-  /**
-   * Return true if the xsl:strip-space or xsl:preserve-space was processed
-   * during construction of the document contained in this DTM.
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public boolean supportsPreStripping();
-
-  /**
-   * Figure out whether nodeHandle2 should be considered as being later
-   * in the document than nodeHandle1, in Document Order as defined
-   * by the XPath model. This may not agree with the ordering defined
-   * by other XML applications.
-   * <p>
-   * There are some cases where ordering isn't defined, and neither are
-   * the results of this function -- though we'll generally return true.
-   * <p>
-   * %REVIEW% Make sure this does the right thing with attribute nodes!!!
-   * <p>
-   * %REVIEW% Consider renaming for clarity. Perhaps isDocumentOrder(a,b)?
-   *
-   * @param firstNodeHandle DOM Node to perform position comparison on.
-   * @param secondNodeHandle DOM Node to perform position comparison on.
-   *
-   * @return false if secondNode comes before firstNode, otherwise return true.
-   * You can think of this as
-   * <code>(firstNode.documentOrderPosition &lt;= secondNode.documentOrderPosition)</code>.
-   */
-  public boolean isNodeAfter(int firstNodeHandle, int secondNodeHandle);
-
-  /**
-   * 2. [element content whitespace] A boolean indicating whether a
-   * text node represents white space appearing within element content
-   * (see [XML], 2.10 "White Space Handling").  Note that validating
-   * XML processors are required by XML 1.0 to provide this
-   * information... but that DOM Level 2 did not support it, since it
-   * depends on knowledge of the DTD which DOM2 could not guarantee
-   * would be available.
-   * <p>
-   * If there is no declaration for the containing element, an XML
-   * processor must assume that the whitespace could be meaningful and
-   * return false. If no declaration has been read, but the [all
-   * declarations processed] property of the document information item
-   * is false (so there may be an unread declaration), then the value
-   * of this property is indeterminate for white space characters and
-   * should probably be reported as false. It is always false for text
-   * nodes that contain anything other than (or in addition to) white
-   * space.
-   * <p>
-   * Note too that it always returns false for non-Text nodes.
-   * <p>
-   * %REVIEW% Joe wants to rename this isWhitespaceInElementContent() for clarity
-   *
-   * @param nodeHandle the node ID.
-   * @return <code>true</code> if the node definitely represents whitespace in
-   * element content; <code>false</code> otherwise.
-   */
-  public boolean isCharacterElementContentWhitespace(int nodeHandle);
-
-  /**
-   *    10. [all declarations processed] This property is not strictly speaking
-   *        part of the infoset of the document. Rather it is an indication of
-   *        whether the processor has read the complete DTD. Its value is a
-   *        boolean. If it is false, then certain properties (indicated in their
-   *        descriptions below) may be unknown. If it is true, those properties
-   *        are never unknown.
-   *
-   *
-   * @param the document handle
-   *
-   * @param documentHandle A node handle that must identify a document.
-   * @return <code>true</code> if all declarations were processed;
-   *         <code>false</code> otherwise.
-   */
-  public boolean isDocumentAllDeclarationsProcessed(int documentHandle);
-
-  /**
-   *     5. [specified] A flag indicating whether this attribute was actually
-   *        specified in the start-tag of its element, or was defaulted from the
-   *        DTD (or schema).
-   *
-   * @param the attribute handle
-   *
-   * NEEDSDOC @param attributeHandle
-   * @return <code>true</code> if the attribute was specified;
-   *         <code>false</code> if it was defaulted or the handle doesn't
-   *            refer to an attribute node.
-   */
-  public boolean isAttributeSpecified(int attributeHandle);
-
-  // ========== Direct SAX Dispatch, for optimization purposes ========
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value). Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   * @param normalize true if the content should be normalized according to
-   * the rules for the XPath
-   * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
-   * function.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(
-    int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
-      throws org.xml.sax.SAXException;
-
-  /**
-   * Directly create SAX parser events representing the XML content of
-   * a DTM subtree. This is a "serialize" operation.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
-    throws org.xml.sax.SAXException;
-
-  /**
-   * Return an DOM node for the given node.
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A node representation of the DTM node.
-   */
-  public org.w3c.dom.Node getNode(int nodeHandle);
-
-  // ==== Construction methods (may not be supported by some implementations!) =====
-  // %REVIEW% What response occurs if not supported?
-
-  /**
-   * @return true iff we're building this model incrementally (eg
-   * we're partnered with a CoroutineParser) and thus require that the
-   * transformation and the parse run simultaneously. Guidance to the
-   * DTMManager.
-   */
-  public boolean needsTwoThreads();
-
-  // %REVIEW% Do these appends make any sense, should we support a
-  // wider set of methods (like the "append" methods in the
-  // current DTMDocumentImpl draft), or should we just support SAX
-  // listener interfaces?  Should it be a separate interface to
-  // make that distinction explicit?
-
-  /**
-   * Return this DTM's content handler, if it has one.
-   *
-   * @return null if this model doesn't respond to SAX events.
-   */
-  public org.xml.sax.ContentHandler getContentHandler();
-
-  /**
-   * Return this DTM's lexical handler, if it has one.
-   *
-   * %REVIEW% Should this return null if constrution already done/begun?
-   *
-   * @return null if this model doesn't respond to lexical SAX events.
-   */
-  public org.xml.sax.ext.LexicalHandler getLexicalHandler();
-
-  /**
-   * Return this DTM's EntityResolver, if it has one.
-   *
-   * @return null if this model doesn't respond to SAX entity ref events.
-   */
-  public org.xml.sax.EntityResolver getEntityResolver();
-
-  /**
-   * Return this DTM's DTDHandler, if it has one.
-   *
-   * @return null if this model doesn't respond to SAX dtd events.
-   */
-  public org.xml.sax.DTDHandler getDTDHandler();
-
-  /**
-   * Return this DTM's ErrorHandler, if it has one.
-   *
-   * @return null if this model doesn't respond to SAX error events.
-   */
-  public org.xml.sax.ErrorHandler getErrorHandler();
-
-  /**
-   * Return this DTM's DeclHandler, if it has one.
-   *
-   * @return null if this model doesn't respond to SAX Decl events.
-   */
-  public org.xml.sax.ext.DeclHandler getDeclHandler();
-
-  /**
-   * Append a child to "the end of the document". Please note that
-   * the node is always cloned in a base DTM, since our basic behavior
-   * is immutable so nodes can't be removed from their previous
-   * location.
-   *
-   * <p> %REVIEW%  DTM maintains an insertion cursor which
-   * performs a depth-first tree walk as nodes come in, and this operation
-   * is really equivalent to:
-   *    insertionCursor.appendChild(document.importNode(newChild)))
-   * where the insert point is the last element that was appended (or
-   * the last one popped back to by an end-element operation).</p>
-   *
-   * @param newChild Must be a valid new node handle.
-   * @param clone true if the child should be cloned into the document.
-   * @param cloneDepth if the clone argument is true, specifies that the
-   *                   clone should include all it's children.
-   */
-  public void appendChild(int newChild, boolean clone, boolean cloneDepth);
-
-  /**
-   * Append a text node child that will be constructed from a string,
-   * to the end of the document. Behavior is otherwise like appendChild().
-   *
-   * @param str Non-null reference to a string.
-   */
-  public void appendTextChild(String str);
-
-  /**
-   * Get the location of a node in the source document.
-   *
-   * @param node an <code>int</code> value
-   * @return a <code>SourceLocator</code> value or null if no location
-   * is available
-   */
-  public SourceLocator getSourceLocatorFor(int node);
-
-  /**
-   * As the DTM is registered with the DTMManager, this method
-   * will be called. This will give the DTM implementation a
-   * chance to initialize any subsystems that are required to
-   * build the DTM
-   */
-  public void documentRegistration();
-
-  /**
-   * As documents are released from the DTMManager, the DTM implementation
-   * will be notified of the event. This will allow the DTM implementation
-   * to shutdown any subsystem activity that may of been assoiated with
-   * the active DTM Implementation.
-   */
-
-   public void documentRelease();
-}
diff --git a/src/org/apache/xml/dtm/DTMAxisIterator.java b/src/org/apache/xml/dtm/DTMAxisIterator.java
deleted file mode 100644
index 291f3d3..0000000
--- a/src/org/apache/xml/dtm/DTMAxisIterator.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-/**
- * This class iterates over a single XPath Axis, and returns node handles.
- */
-public interface DTMAxisIterator extends Cloneable
-{
-
-  /** Specifies the end of the iteration, and is the same as DTM.NULL.  */
-  public static final int END = DTM.NULL;
-
-  /**
-   * Get the next node in the iteration.
-   *
-   * @return The next node handle in the iteration, or END.
-   */
-  public int next();
-
-  /**
-   * Resets the iterator to the last start node.
-   *
-   * @return A DTMAxisIterator, which may or may not be the same as this 
-   *         iterator.
-   */
-  public DTMAxisIterator reset();
-
-  /**
-   * @return the number of nodes in this iterator.  This may be an expensive 
-   * operation when called the first time.
-   */
-  public int getLast();
-
-  /**
-   * @return The position of the current node in the set, as defined by XPath.
-   */
-  public int getPosition();
-
-  /**
-   * Remembers the current node for the next call to gotoMark().
-   */
-  public void setMark();
-
-  /**
-   * Restores the current node remembered by setMark().
-   */
-  public void gotoMark();
-
-  /**
-   * Set start to END should 'close' the iterator,
-   * i.e. subsequent call to next() should return END.
-   *
-   * @param node Sets the root of the iteration.
-   *
-   * @return A DTMAxisIterator set to the start of the iteration.
-   */
-  public DTMAxisIterator setStartNode(int node);
-
-  /**
-   * Get start to END should 'close' the iterator,
-   * i.e. subsequent call to next() should return END.
-   *
-   * @return The root node of the iteration.
-   */
-  public int getStartNode();
-
-  /**
-   * @return true if this iterator has a reversed axis, else false.
-   */
-  public boolean isReverse();
-
-  /**
-   * @return a deep copy of this iterator. The clone should not be reset 
-   * from its current position.
-   */
-  public DTMAxisIterator cloneIterator();
-}
diff --git a/src/org/apache/xml/dtm/DTMAxisTraverser.java b/src/org/apache/xml/dtm/DTMAxisTraverser.java
deleted file mode 100644
index a905b22..0000000
--- a/src/org/apache/xml/dtm/DTMAxisTraverser.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-/**
- * A class that implements traverses DTMAxisTraverser interface can traverse
- * a set of nodes, usually as defined by an XPath axis.  It is different from
- * an iterator, because it does not need to hold state, and, in fact, must not
- * hold any iteration-based state.  It is meant to be implemented as an inner
- * class of a DTM, and returned by the getAxisTraverser(final int axis)
- * function.
- *
- * <p>A DTMAxisTraverser can probably not traverse a reverse axis in
- * document order.</p>
- *
- * <p>Typical usage:</p>
- * <pre><code>
- * for(int nodeHandle=myTraverser.first(myContext);
- *     nodeHandle!=DTM.NULL;
- *     nodeHandle=myTraverser.next(myContext,nodeHandle))
- * { ... processing for node indicated by nodeHandle goes here ... }
- * </code></pre>
- *
- * @author Scott Boag
- */
-public abstract class DTMAxisTraverser
-{
-
-  /**
-   * By the nature of the stateless traversal, the context node can not be
-   * returned or the iteration will go into an infinate loop.  So to traverse 
-   * an axis, the first function must be used to get the first node.
-   *
-   * <p>This method needs to be overloaded only by those axis that process
-   * the self node. <\p>
-   *
-   * @param context The context node of this traversal. This is the point
-   * that the traversal starts from.
-   * @return the first node in the traversal.
-   */
-  public int first(int context)
-  {
-    return next(context, context);
-  }
-
-  /**
-   * By the nature of the stateless traversal, the context node can not be
-   * returned or the iteration will go into an infinate loop.  So to traverse 
-   * an axis, the first function must be used to get the first node.
-   *
-   * <p>This method needs to be overloaded only by those axis that process
-   * the self node. <\p>
-   *
-   * @param context The context node of this traversal. This is the point
-   * of origin for the traversal -- its "root node" or starting point.
-   * @param extendedTypeID The extended type ID that must match.
-   *
-   * @return the first node in the traversal.
-   */
-  public int first(int context, int extendedTypeID)
-  {
-    return next(context, context, extendedTypeID);
-  }
-
-  /**
-   * Traverse to the next node after the current node.
-   *
-   * @param context The context node of this traversal. This is the point
-   * of origin for the traversal -- its "root node" or starting point.
-   * @param current The current node of the traversal. This is the last known
-   * location in the traversal, typically the node-handle returned by the
-   * previous traversal step. For the first traversal step, context
-   * should be set equal to current. Note that in order to test whether
-   * context is in the set, you must use the first() method instead.
-   *
-   * @return the next node in the iteration, or DTM.NULL.
-   * @see first(int)
-   */
-  public abstract int next(int context, int current);
-
-  /**
-   * Traverse to the next node after the current node that is matched
-   * by the extended type ID.
-   *
-   * @param context The context node of this traversal. This is the point
-   * of origin for the traversal -- its "root node" or starting point.
-   * @param current The current node of the traversal. This is the last known
-   * location in the traversal, typically the node-handle returned by the
-   * previous traversal step. For the first traversal step, context
-   * should be set equal to current. Note that in order to test whether
-   * context is in the set, you must use the first() method instead.
-   * @param extendedTypeID The extended type ID that must match.
-   *
-   * @return the next node in the iteration, or DTM.NULL.
-   * @see first(int,int)
-   */
-  public abstract int next(int context, int current, int extendedTypeID);
-}
diff --git a/src/org/apache/xml/dtm/DTMConfigurationException.java b/src/org/apache/xml/dtm/DTMConfigurationException.java
deleted file mode 100644
index 2fd150d..0000000
--- a/src/org/apache/xml/dtm/DTMConfigurationException.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.apache.xml.dtm;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * Indicates a serious configuration error.
- */
-public class DTMConfigurationException extends DTMException {
-
-    /**
-     * Create a new <code>DTMConfigurationException</code> with no
-     * detail mesage.
-     */
-    public DTMConfigurationException() {
-        super("Configuration Error");
-    }
-
-    /**
-     * Create a new <code>DTMConfigurationException</code> with
-     * the <code>String </code> specified as an error message.
-     *
-     * @param msg The error message for the exception.
-     */
-    public DTMConfigurationException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * Create a new <code>DTMConfigurationException</code> with a
-     * given <code>Exception</code> base cause of the error.
-     *
-     * @param e The exception to be encapsulated in a
-     * DTMConfigurationException.
-     */
-    public DTMConfigurationException(Throwable e) {
-        super(e);
-    }
-
-    /**
-     * Create a new <code>DTMConfigurationException</code> with the
-     * given <code>Exception</code> base cause and detail message.
-     *
-     * @param e The exception to be encapsulated in a
-     * DTMConfigurationException
-     * @param msg The detail message.
-     * @param e The exception to be wrapped in a DTMConfigurationException
-     */
-    public DTMConfigurationException(String msg, Throwable e) {
-        super(msg, e);
-    }
-
-    /**
-     * Create a new DTMConfigurationException from a message and a Locator.
-     *
-     * <p>This constructor is especially useful when an application is
-     * creating its own exception from within a DocumentHandler
-     * callback.</p>
-     *
-     * @param message The error or warning message.
-     * @param locator The locator object for the error or warning.
-     */
-    public DTMConfigurationException(String message,
-                                             SourceLocator locator) {
-        super(message, locator);
-    }
-
-    /**
-     * Wrap an existing exception in a DTMConfigurationException.
-     *
-     * @param message The error or warning message, or null to
-     *                use the message from the embedded exception.
-     * @param locator The locator object for the error or warning.
-     * @param e Any exception.
-     */
-    public DTMConfigurationException(String message,
-                                             SourceLocator locator,
-                                             Throwable e) {
-        super(message, locator, e);
-    }
-}
\ No newline at end of file
diff --git a/src/org/apache/xml/dtm/DTMDOMException.java b/src/org/apache/xml/dtm/DTMDOMException.java
deleted file mode 100644
index b235cc0..0000000
--- a/src/org/apache/xml/dtm/DTMDOMException.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-/**
- * <meta name="usage" content="internal"/>
- * Simple implementation of DOMException.
- *
- * %REVIEW% Several classes were implementing this internally;
- * it makes more sense to have one shared version.
- */
-public class DTMDOMException extends org.w3c.dom.DOMException
-{
-  /**
-   * Constructs a DOM/DTM exception.
-   *
-   * @param code
-   * @param message
-   */
-  public DTMDOMException(short code, String message)
-  {
-    super(code, message);
-  }
-
-  /**
-   * Constructor DTMDOMException
-   *
-   *
-   * @param code
-   */
-  public DTMDOMException(short code)
-  {
-    super(code, "");
-  }
-}
diff --git a/src/org/apache/xml/dtm/DTMException.java b/src/org/apache/xml/dtm/DTMException.java
deleted file mode 100644
index 62fef1c..0000000
--- a/src/org/apache/xml/dtm/DTMException.java
+++ /dev/null
@@ -1,351 +0,0 @@
-package org.apache.xml.dtm;
-
-
-import java.lang.reflect.Method;
-import java.lang.IllegalAccessException;
-import java.lang.reflect.InvocationTargetException;
-
-import javax.xml.transform.SourceLocator;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-
-/**
- * This class specifies an exceptional condition that occured
- * in the DTM module.
- */
-public class DTMException extends RuntimeException {
-
-    /** Field locator specifies where the error occured.
-     *  @serial */
-    SourceLocator locator;
-
-    /**
-     * Method getLocator retrieves an instance of a SourceLocator
-     * object that specifies where an error occured.
-     *
-     * @return A SourceLocator object, or null if none was specified.
-     */
-    public SourceLocator getLocator() {
-        return locator;
-    }
-
-    /**
-     * Method setLocator sets an instance of a SourceLocator
-     * object that specifies where an error occured.
-     *
-     * @param location A SourceLocator object, or null to clear the location.
-     */
-    public void setLocator(SourceLocator location) {
-        locator = location;
-    }
-
-    /** Field containedException specifies a wrapped exception.  May be null.
-     *  @serial */
-    Throwable containedException;
-
-    /**
-     * This method retrieves an exception that this exception wraps.
-     *
-     * @return An Throwable object, or null.
-     * @see #getCause
-     */
-    public Throwable getException() {
-        return containedException;
-    }
-
-    /**
-     * Returns the cause of this throwable or <code>null</code> if the
-     * cause is nonexistent or unknown.  (The cause is the throwable that
-     * caused this throwable to get thrown.)
-     */
-    public Throwable getCause() {
-
-        return ((containedException == this)
-                ? null
-                : containedException);
-    }
-
-    /**
-     * Initializes the <i>cause</i> of this throwable to the specified value.
-     * (The cause is the throwable that caused this throwable to get thrown.)
-     *
-     * <p>This method can be called at most once.  It is generally called from
-     * within the constructor, or immediately after creating the
-     * throwable.  If this throwable was created
-     * with {@link #DTMException(Throwable)} or
-     * {@link #DTMException(String,Throwable)}, this method cannot be called
-     * even once.
-     *
-     * @param  cause the cause (which is saved for later retrieval by the
-     *         {@link #getCause()} method).  (A <tt>null</tt> value is
-     *         permitted, and indicates that the cause is nonexistent or
-     *         unknown.)
-     * @return  a reference to this <code>Throwable</code> instance.
-     * @throws IllegalArgumentException if <code>cause</code> is this
-     *         throwable.  (A throwable cannot
-     *         be its own cause.)
-     * @throws IllegalStateException if this throwable was
-     *         created with {@link #DTMException(Throwable)} or
-     *         {@link #DTMException(String,Throwable)}, or this method has already
-     *         been called on this throwable.
-     */
-    public synchronized Throwable initCause(Throwable cause) {
-
-        if ((this.containedException == null) && (cause != null)) {
-            throw new IllegalStateException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause");
-        }
-
-        if (cause == this) {
-            throw new IllegalArgumentException(
-                XSLMessages.createMessage(XSLTErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted");
-        }
-
-        this.containedException = cause;
-
-        return this;
-    }
-
-    /**
-     * Create a new DTMException.
-     *
-     * @param message The error or warning message.
-     */
-    public DTMException(String message) {
-
-        super(message);
-
-        this.containedException = null;
-        this.locator            = null;
-    }
-
-    /**
-     * Create a new DTMException wrapping an existing exception.
-     *
-     * @param e The exception to be wrapped.
-     */
-    public DTMException(Throwable e) {
-
-        super(e.getMessage());
-
-        this.containedException = e;
-        this.locator            = null;
-    }
-
-    /**
-     * Wrap an existing exception in a DTMException.
-     *
-     * <p>This is used for throwing processor exceptions before
-     * the processing has started.</p>
-     *
-     * @param message The error or warning message, or null to
-     *                use the message from the embedded exception.
-     * @param e Any exception
-     */
-    public DTMException(String message, Throwable e) {
-
-        super(((message == null) || (message.length() == 0))
-              ? e.getMessage()
-              : message);
-
-        this.containedException = e;
-        this.locator            = null;
-    }
-
-    /**
-     * Create a new DTMException from a message and a Locator.
-     *
-     * <p>This constructor is especially useful when an application is
-     * creating its own exception from within a DocumentHandler
-     * callback.</p>
-     *
-     * @param message The error or warning message.
-     * @param locator The locator object for the error or warning.
-     */
-    public DTMException(String message, SourceLocator locator) {
-
-        super(message);
-
-        this.containedException = null;
-        this.locator            = locator;
-    }
-
-    /**
-     * Wrap an existing exception in a DTMException.
-     *
-     * @param message The error or warning message, or null to
-     *                use the message from the embedded exception.
-     * @param locator The locator object for the error or warning.
-     * @param e Any exception
-     */
-    public DTMException(String message, SourceLocator locator,
-                                Throwable e) {
-
-        super(message);
-
-        this.containedException = e;
-        this.locator            = locator;
-    }
-
-    /**
-     * Get the error message with location information
-     * appended.
-     */
-    public String getMessageAndLocation() {
-
-        StringBuffer sbuffer = new StringBuffer();
-        String       message = super.getMessage();
-
-        if (null != message) {
-            sbuffer.append(message);
-        }
-
-        if (null != locator) {
-            String systemID = locator.getSystemId();
-            int    line     = locator.getLineNumber();
-            int    column   = locator.getColumnNumber();
-
-            if (null != systemID) {
-                sbuffer.append("; SystemID: ");
-                sbuffer.append(systemID);
-            }
-
-            if (0 != line) {
-                sbuffer.append("; Line#: ");
-                sbuffer.append(line);
-            }
-
-            if (0 != column) {
-                sbuffer.append("; Column#: ");
-                sbuffer.append(column);
-            }
-        }
-
-        return sbuffer.toString();
-    }
-
-    /**
-     * Get the location information as a string.
-     *
-     * @return A string with location info, or null
-     * if there is no location information.
-     */
-    public String getLocationAsString() {
-
-        if (null != locator) {
-            StringBuffer sbuffer  = new StringBuffer();
-            String       systemID = locator.getSystemId();
-            int          line     = locator.getLineNumber();
-            int          column   = locator.getColumnNumber();
-
-            if (null != systemID) {
-                sbuffer.append("; SystemID: ");
-                sbuffer.append(systemID);
-            }
-
-            if (0 != line) {
-                sbuffer.append("; Line#: ");
-                sbuffer.append(line);
-            }
-
-            if (0 != column) {
-                sbuffer.append("; Column#: ");
-                sbuffer.append(column);
-            }
-
-            return sbuffer.toString();
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Print the the trace of methods from where the error
-     * originated.  This will trace all nested exception
-     * objects, as well as this object.
-     */
-    public void printStackTrace() {
-        printStackTrace(new java.io.PrintWriter(System.err, true));
-    }
-
-    /**
-     * Print the the trace of methods from where the error
-     * originated.  This will trace all nested exception
-     * objects, as well as this object.
-     * @param s The stream where the dump will be sent to.
-     */
-    public void printStackTrace(java.io.PrintStream s) {
-        printStackTrace(new java.io.PrintWriter(s));
-    }
-
-    /**
-     * Print the the trace of methods from where the error
-     * originated.  This will trace all nested exception
-     * objects, as well as this object.
-     * @param s The writer where the dump will be sent to.
-     */
-    public void printStackTrace(java.io.PrintWriter s) {
-
-        if (s == null) {
-            s = new java.io.PrintWriter(System.err, true);
-        }
-
-        try {
-            String locInfo = getLocationAsString();
-
-            if (null != locInfo) {
-                s.println(locInfo);
-            }
-
-            super.printStackTrace(s);
-        } catch (Throwable e) {}
-
-        Throwable exception = getException();
-
-        for (int i = 0; (i < 10) && (null != exception); i++) {
-            s.println("---------");
-
-            try {
-                if (exception instanceof DTMException) {
-                    String locInfo =
-                        ((DTMException) exception)
-                            .getLocationAsString();
-
-                    if (null != locInfo) {
-                        s.println(locInfo);
-                    }
-                }
-
-                exception.printStackTrace(s);
-            } catch (Throwable e) {
-                s.println("Could not print stack trace...");
-            }
-
-            try {
-                Method meth =
-                    ((Object) exception).getClass().getMethod("getException",
-                        null);
-
-                if (null != meth) {
-                    Throwable prev = exception;
-
-                    exception = (Throwable) meth.invoke(exception, null);
-
-                    if (prev == exception) {
-                        break;
-                    }
-                } else {
-                    exception = null;
-                }
-            } catch (InvocationTargetException ite) {
-                exception = null;
-            } catch (IllegalAccessException iae) {
-                exception = null;
-            } catch (NoSuchMethodException nsme) {
-                exception = null;
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/org/apache/xml/dtm/DTMFilter.java b/src/org/apache/xml/dtm/DTMFilter.java
deleted file mode 100644
index 5efd4b8..0000000
--- a/src/org/apache/xml/dtm/DTMFilter.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-/**
- * Simple filter for doing node tests.  Note the semantics of this are
- * somewhat different that the DOM's NodeFilter.
- */
-public interface DTMFilter
-{
-
-  // Constants for whatToShow.  These are used to set the node type that will 
-  // be traversed. These values may be ORed together before being passed to
-  // the DTMIterator.
-
-  /**
-   * Show all <code>Nodes</code>.
-   */
-  public static final int SHOW_ALL = 0xFFFFFFFF;
-
-  /**
-   * Show <code>Element</code> nodes.
-   */
-  public static final int SHOW_ELEMENT = 0x00000001;
-
-  /**
-   * Show <code>Attr</code> nodes. This is meaningful only when creating an
-   * iterator or tree-walker with an attribute node as its
-   * <code>root</code>; in this case, it means that the attribute node
-   * will appear in the first position of the iteration or traversal.
-   * Since attributes are never children of other nodes, they do not
-   * appear when traversing over the main document tree.
-   */
-  public static final int SHOW_ATTRIBUTE = 0x00000002;
-
-  /**
-   * Show <code>Text</code> nodes.
-   */
-  public static final int SHOW_TEXT = 0x00000004;
-
-  /**
-   * Show <code>CDATASection</code> nodes.
-   */
-  public static final int SHOW_CDATA_SECTION = 0x00000008;
-
-  /**
-   * Show <code>EntityReference</code> nodes. Note that if Entity References
-   * have been fully expanded while the tree was being constructed, these
-   * nodes will not appear and this mask has no effect.
-   */
-  public static final int SHOW_ENTITY_REFERENCE = 0x00000010;
-
-  /**
-   * Show <code>Entity</code> nodes. This is meaningful only when creating
-   * an iterator or tree-walker with an<code> Entity</code> node as its
-   * <code>root</code>; in this case, it means that the <code>Entity</code>
-   *  node will appear in the first position of the traversal. Since
-   * entities are not part of the document tree, they do not appear when
-   * traversing over the main document tree.
-   */
-  public static final int SHOW_ENTITY = 0x00000020;
-
-  /**
-   * Show <code>ProcessingInstruction</code> nodes.
-   */
-  public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
-
-  /**
-   * Show <code>Comment</code> nodes.
-   */
-  public static final int SHOW_COMMENT = 0x00000080;
-
-  /**
-   * Show <code>Document</code> nodes. (Of course, as with Attributes
-   * and such, this is meaningful only when the iteration root is the
-   * Document itself, since Document has no parent.)
-   */
-  public static final int SHOW_DOCUMENT = 0x00000100;
-
-  /**
-   * Show <code>DocumentType</code> nodes. 
-   */
-  public static final int SHOW_DOCUMENT_TYPE = 0x00000200;
-
-  /**
-   * Show <code>DocumentFragment</code> nodes. (Of course, as with
-   * Attributes and such, this is meaningful only when the iteration
-   * root is the Document itself, since DocumentFragment has no parent.)
-   */
-  public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
-
-  /**
-   * Show <code>Notation</code> nodes. This is meaningful only when creating
-   * an iterator or tree-walker with a <code>Notation</code> node as its
-   * <code>root</code>; in this case, it means that the
-   * <code>Notation</code> node will appear in the first position of the
-   * traversal. Since notations are not part of the document tree, they do
-   * not appear when traversing over the main document tree.
-   */
-  public static final int SHOW_NOTATION = 0x00000800;
-  
-  /**
-
-   * This bit instructs the iterator to show namespace nodes, which
-   * are modeled by DTM but not by the DOM.  Make sure this does not
-   * conflict with {@link org.w3c.dom.traversal.NodeFilter}.
-   * <p>
-   * %REVIEW% Might be safer to start from higher bits and work down,
-   * to leave room for the DOM to expand its set of constants... Or,
-   * possibly, to create a DTM-specific field for these additional bits.
-   */
-  public static final int SHOW_NAMESPACE = 0x00001000;
-
-  /**
-   * Special bit for filters implementing match patterns starting with
-   * a function.  Make sure this does not conflict with
-   * {@link org.w3c.dom.traversal.NodeFilter}.
-   * <p>
-   * %REVIEW% Might be safer to start from higher bits and work down,
-   * to leave room for the DOM to expand its set of constants... Or,
-   * possibly, to create a DTM-specific field for these additional bits.
-   */
-  public static final int SHOW_BYFUNCTION = 0x00010000;
-
-  /**
-   * Test whether a specified node is visible in the logical view of a
-   * <code>DTMIterator</code>. Normally, this function
-   * will be called by the implementation of <code>DTMIterator</code>; 
-   * it is not normally called directly from
-   * user code.
-   * 
-   * @param nodeHandle int Handle of the node.
-   * @param whatToShow one of SHOW_XXX values.
-   * @return one of FILTER_ACCEPT, FILTER_REJECT, or FILTER_SKIP.
-   */
-  public short acceptNode(int nodeHandle, int whatToShow);
-  
-  /**
-   * Test whether a specified node is visible in the logical view of a
-   * <code>DTMIterator</code>. Normally, this function
-   * will be called by the implementation of <code>DTMIterator</code>; 
-   * it is not normally called directly from
-   * user code.
-   * <p>
-   * TODO: Should this be setNameMatch(expandedName) followed by accept()?
-   * Or will we really be testing a different name at every invocation?
-   * 
-   * <p>%REVIEW% Under what circumstances will this be used? The cases
-   * I've considered are just as easy and just about as efficient if
-   * the name test is performed in the DTMIterator... -- Joe</p>
-   * 
-   * <p>%REVIEW% Should that 0xFFFF have a mnemonic assigned to it?
-   * Also: This representation is assuming the expanded name is indeed
-   * split into high/low 16-bit halfwords. If we ever change the
-   * balance between namespace and localname bits (eg because we
-   * decide there are many more localnames than namespaces, which is
-   * fairly likely), this is going to break. It might be safer to
-   * encapsulate the details with a makeExpandedName method and make
-   * that responsible for setting up the wildcard version as well.</p>
-   * 
-   * @param nodeHandle int Handle of the node.
-   * @param whatToShow one of SHOW_XXX values.
-   * @param expandedName a value defining the exanded name as defined in 
-   *                     the DTM interface.  Wild cards will be defined 
-   *                     by 0xFFFF in the namespace and/or localname
-   *			 portion of the expandedName.
-   * @return one of FILTER_ACCEPT, FILTER_REJECT, or FILTER_SKIP.  */
-  public short acceptNode(int nodeHandle, int whatToShow, int expandedName);
- 
-}
diff --git a/src/org/apache/xml/dtm/DTMIterator.java b/src/org/apache/xml/dtm/DTMIterator.java
deleted file mode 100644
index 68633c3..0000000
--- a/src/org/apache/xml/dtm/DTMIterator.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-/**
-
- * <code>DTMIterators</code> are used to step through a (possibly
- * filtered) set of nodes.  Their API is modeled largely after the DOM
- * NodeIterator.
- * 
- * <p>A DTMIterator is a somewhat unusual type of iterator, in that it 
- * can serve both single node iteration and random access.</p>
- * 
- * <p>The DTMIterator's traversal semantics, i.e. how it walks the tree,
- * are specified when it is created, possibly and probably by an XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or 
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.</p>
- * 
- * <p>A DTMIterator is meant to be created once as a master static object, and 
- * then cloned many times for runtime use.  Or the master object itself may 
- * be used for simpler use cases.</p>
- *
- * <p>At this time, we do not expect DTMIterator to emulate
- * NodeIterator's "maintain relative position" semantics under
- * document mutation.  It's likely to respond more like the
- * TreeWalker's "current node" semantics. However, since the base DTM
- * is immutable, this issue currently makes no practical
- * difference.</p>
- *
- * <p>State: In progress!!</p> */
-public interface DTMIterator
-{
-
-  // Constants returned by acceptNode, borrowed from the DOM Traversal chapter
-  // %REVIEW% Should we explicitly initialize them from, eg,
-  // org.w3c.dom.traversal.NodeFilter.FILTER_ACCEPT?
-
-  /**
-   * Accept the node.
-   */
-  public static final short FILTER_ACCEPT = 1;
-
-  /**
-   * Reject the node. Same behavior as FILTER_SKIP. (In the DOM these
-   * differ when applied to a TreeWalker but have the same result when
-   * applied to a NodeIterator).
-   */
-  public static final short FILTER_REJECT = 2;
-
-  /**
-   * Skip this single node. 
-   */
-  public static final short FILTER_SKIP = 3;
-    
-  /**
-   * Get an instance of a DTM that "owns" a node handle.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTM using just the iterator.
-   *
-   * @param nodeHandle the nodeHandle.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(int nodeHandle);
-  
-  /**
-   * Get an instance of the DTMManager.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTMManager using just the iterator.
-   *
-   * @return a non-null DTMManager reference.
-   */
-  public DTMManager getDTMManager();
-
-  /**
-   * The root node of the <code>DTMIterator</code>, as specified when it
-   * was created.  Note the root node is not the root node of the 
-   * document tree, but the context node from where the iteration 
-   * begins and ends.
-   *
-   * @return nodeHandle int Handle of the context node.
-   */
-  public int getRoot();
-
-  /**
-   * Reset the root node of the <code>DTMIterator</code>, overriding
-   * the value specified when it was created.  Note the root node is
-   * not the root node of the document tree, but the context node from
-   * where the iteration begins.
-   *
-   * @param nodeHandle int Handle of the context node.
-   * @param environment The environment object.  
-   * The environment in which this iterator operates, which should provide:
-   * <ul>
-   * <li>a node (the context node... same value as "root" defined below) </li>
-   * <li>a pair of non-zero positive integers (the context position and the context size) </li>
-   * <li>a set of variable bindings </li>
-   * <li>a function library </li>
-   * <li>the set of namespace declarations in scope for the expression.</li>
-   * <ul>
-   * 
-   * <p>At this time the exact implementation of this environment is application 
-   * dependent.  Probably a proper interface will be created fairly soon.</p>
-   * 
-   */
-  public void setRoot(int nodeHandle, Object environment);
-  
-  /**
-   * Reset the iterator to the start. After resetting, the next node returned
-   * will be the root node -- or, if that's filtered out, the first node
-   * within the root's subtree which is _not_ skipped by the filters.
-   */
-  public void reset();
-
-  /**
-   * This attribute determines which node types are presented via the
-   * iterator. The available set of constants is defined above.  
-   * Nodes not accepted by
-   * <code>whatToShow</code> will be skipped, but their children may still
-   * be considered.
-   *
-   * @return one of the SHOW_XXX constants, or several ORed together.
-   */
-  public int getWhatToShow();
-
-  /**
-   * <p>The value of this flag determines whether the children of entity
-   * reference nodes are visible to the iterator. If false, they  and
-   * their descendants will be rejected. Note that this rejection takes
-   * precedence over <code>whatToShow</code> and the filter. </p>
-   * 
-   * <p> To produce a view of the document that has entity references
-   * expanded and does not expose the entity reference node itself, use
-   * the <code>whatToShow</code> flags to hide the entity reference node
-   * and set <code>expandEntityReferences</code> to true when creating the
-   * iterator. To produce a view of the document that has entity reference
-   * nodes but no entity expansion, use the <code>whatToShow</code> flags
-   * to show the entity reference node and set
-   * <code>expandEntityReferences</code> to false.</p>
-   *
-   * <p>NOTE: In Xalan's use of DTM we will generally have fully expanded
-   * entity references when the document tree was built, and thus this
-   * flag will have no effect.</p>
-   *
-   * @return true if entity references will be expanded.  */
-  public boolean getExpandEntityReferences();
-
-  /**
-   * Returns the next node in the set and advances the position of the
-   * iterator in the set. After a <code>DTMIterator</code> has setRoot called,
-   * the first call to <code>nextNode()</code> returns that root or (if it
-   * is rejected by the filters) the first node within its subtree which is
-   * not filtered out.
-   * @return The next node handle in the set being iterated over, or
-   *   -1 if there are no more members in that set.
-   */
-  public int nextNode();
-
-  /**
-   * Returns the previous node in the set and moves the position of the
-   * <code>DTMIterator</code> backwards in the set.
-   * @return The previous node handle in the set being iterated over,
-   *   or <code>null</code> if there are no more members in that set.
-   */
-  public int previousNode();
-
-  /**
-   * Detaches the <code>DTMIterator</code> from the set which it iterated
-   * over, releasing any computational resources and placing the iterator
-   * in the INVALID state. After <code>detach</code> has been invoked,
-   * calls to <code>nextNode</code> or <code>previousNode</code> will
-   * raise a runtime exception.
-   */
-  public void detach();
-  
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   * 
-   * @param allowRelease true if it is OK for detach to release this iterator 
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease);
-
-  /**
-   * Get the current node in the iterator. Note that this differs from
-   * the DOM's NodeIterator, where the current position lies between two
-   * nodes (as part of the maintain-relative-position semantic).
-   *
-   * @return The current node handle, or -1.
-   */
-  public int getCurrentNode();
-
-  /**
-   * Tells if this NodeSetDTM is "fresh", in other words, if
-   * the first nextNode() that is called will return the
-   * first node in the set.
-   *
-   * @return true if the iteration of this list has not yet begun.
-   */
-  public boolean isFresh();
-
-  //========= Random Access ==========
-
-  /**
-   * If setShouldCacheNodes(true) is called, then nodes will
-   * be cached, enabling random access, and giving the ability to do 
-   * sorts and the like.  They are not cached by default.
-   *
-   * %REVIEW% Shouldn't the other random-access methods throw an exception
-   * if they're called on a DTMIterator with this flag set false?
-   *
-   * @param b true if the nodes should be cached.
-   */
-  public void setShouldCacheNodes(boolean b);
-  
-  /**
-   * Tells if this iterator can have nodes added to it or set via 
-   * the <code>setItem(int node, int index)</code> method.
-   * 
-   * @return True if the nodelist can be mutated.
-   */
-  public boolean isMutable();
-
-  /** Get the current position within the cached list, which is one
-   * less than the next nextNode() call will retrieve.  i.e. if you
-   * call getCurrentPos() and the return is 0, the next fetch will
-   * take place at index 1.
-   *
-   * @return The position of the iteration.
-   */
-  public int getCurrentPos();
-
-  /**
-   * If an index is requested, NodeSetDTM will call this method
-   * to run the iterator to the index.  By default this sets
-   * m_next to the index.  If the index argument is -1, this
-   * signals that the iterator should be run to the end and
-   * completely fill the cache.
-   *
-   * @param index The index to run to, or -1 if the iterator should be run
-   *              to the end.
-   */
-  public void runTo(int index);
-
-  /**
-   * Set the current position in the node set.
-   * 
-   * @param i Must be a valid index.
-   */
-  public void setCurrentPos(int i);
-
-  /**
-   * Returns the <code>node handle</code> of an item in the collection. If
-   * <code>index</code> is greater than or equal to the number of nodes in
-   * the list, this returns <code>null</code>.
-   *
-   * @param index of the item.
-   * @return The node handle at the <code>index</code>th position in the
-   *   <code>DTMIterator</code>, or <code>-1</code> if that is not a valid
-   *   index.
-   */
-  public int item(int index);
-  
-  /**
-   * Sets the node at the specified index of this vector to be the
-   * specified node. The previous component at that position is discarded.
-   *
-   * <p>The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.  
-   * The iterator must be in cached mode.</p>
-   * 
-   * <p>Meant to be used for sorted iterators.</p>
-   *
-   * @param node Node to set
-   * @param index Index of where to set the node
-   */
-  public void setItem(int node, int index);
-  
-  /**
-   * The number of nodes in the list. The range of valid child node indices
-   * is 0 to <code>length-1</code> inclusive. Note that this requires running
-   * the iterator to completion, and presumably filling the cache.
-   *
-   * @return The number of nodes in the list.
-   */
-  public int getLength();
-    
-  //=========== Cloning operations. ============
-  
-  /**
-   * Get a cloned Iterator that is reset to the start of the iteration.
-   *
-   * @return A clone of this iteration that has been reset.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public DTMIterator cloneWithReset() throws CloneNotSupportedException;
-
-  /**
-   * Get a clone of this iterator, but don't reset the iteration in the 
-   * process, so that it may be used from the current position.
-   *
-   * @return A clone of this object.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException;
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * 
-   * @return true if all the nodes in the iteration well be returned in document 
-   * order.
-   */
-  public boolean isDocOrdered();
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis();
-
-}
diff --git a/src/org/apache/xml/dtm/DTMManager.java b/src/org/apache/xml/dtm/DTMManager.java
deleted file mode 100644
index fa39abe..0000000
--- a/src/org/apache/xml/dtm/DTMManager.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm;
-
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
-
-import java.util.Properties;
-import java.util.Enumeration;
-
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-/**
- * A DTMManager instance can be used to create DTM and
- * DTMIterator objects, and manage the DTM objects in the system.
- *
- * <p>The system property that determines which Factory implementation
- * to create is named "org.apache.xml.utils.DTMFactory". This
- * property names a concrete subclass of the DTMFactory abstract
- *  class. If the property is not defined, a platform default is be used.</p>
- *
- * <p>An instance of this class <emph>must</emph> be safe to use across
- * thread instances.  It is expected that a client will create a single instance
- * of a DTMManager to use across multiple threads.  This will allow sharing
- * of DTMs across multiple processes.</p>
- *
- * <p>Note: this class is incomplete right now.  It will be pretty much
- * modeled after javax.xml.transform.TransformerFactory in terms of its
- * factory support.</p>
- *
- * <p>State: In progress!!</p>
- */
-public abstract class DTMManager
-{
-
-  /** The default property name to load the manager. */
-  private static final String defaultPropName =
-    "org.apache.xml.dtm.DTMManager";
-
-  /**
-   * Factory for creating XMLString objects.
-   *  %TBD% Make this set by the caller.
-   */
-  protected XMLStringFactory m_xsf = null;
-
-  /**
-   * Default constructor is protected on purpose.
-   */
-  protected DTMManager(){}
-
-  /**
-   * Get the XMLStringFactory used for the DTMs.
-   *
-   *
-   * @return a valid XMLStringFactory object, or null if it hasn't been set yet.
-   */
-  public XMLStringFactory getXMLStringFactory()
-  {
-    return m_xsf;
-  }
-
-  /**
-   * Set the XMLStringFactory used for the DTMs.
-   *
-   *
-   * @param xsf a valid XMLStringFactory object, should not be null.
-   */
-  public void setXMLStringFactory(XMLStringFactory xsf)
-  {
-    m_xsf = xsf;
-  }
-
-  /**
-   * Obtain a new instance of a <code>DTMManager</code>.
-   * This static method creates a new factory instance
-   * This method uses the following ordered lookup procedure to determine
-   * the <code>DTMManager</code> implementation class to
-   * load:
-   * <ul>
-   * <li>
-   * Use the <code>org.apache.xml.dtm.DTMManager</code> system
-   * property.
-   * </li>
-   * <li>
-   * Use the JAVA_HOME(the parent directory where jdk is
-   * installed)/lib/jaxp.properties for a property file that contains the
-   * name of the implementation class keyed on the same value as the
-   * system property defined above.
-   * </li>
-   * <li>
-   * Use the Services API (as detailed in the JAR specification), if
-   * available, to determine the classname. The Services API will look
-   * for a classname in the file
-   * <code>META-INF/services/javax.xml.parsers.DTMManager</code>
-   * in jars available to the runtime.
-   * </li>
-   * <li>
-   * Use the default <code>DTMManager</code> classname, which is
-   * <code>org.apache.xml.dtm.ref.DTMManagerDefault</code>.
-   * </li>
-   * </ul>
-   *
-   * Once an application has obtained a reference to a <code>
-   * DTMManager</code> it can use the factory to configure
-   * and obtain parser instances.
-   *
-   * @return new DTMManager instance, never null.
-   *
-   * @throws DTMConfigurationException
-   * if the implementation is not available or cannot be instantiated.
-   */
-  public static DTMManager newInstance(XMLStringFactory xsf) 
-           throws DTMConfigurationException
-  {
-
-    String classname = findFactory(defaultPropName,
-                                   "org.apache.xml.dtm.ref.DTMManagerDefault");
-
-    if (classname == null)
-    {
-      throw new DTMConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DEFAULT_IMPL, null)); //"No default implementation found");
-    }
-
-    DTMManager factoryImpl;
-
-    try
-    {
-      Class clazz = Class.forName(classname);
-
-      factoryImpl = (DTMManager) clazz.newInstance();
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new DTMConfigurationException(cnfe);
-    }
-    catch (IllegalAccessException iae)
-    {
-      throw new DTMConfigurationException(iae);
-    }
-    catch (InstantiationException ie)
-    {
-      throw new DTMConfigurationException(ie);
-    }
-    factoryImpl.setXMLStringFactory(xsf);
-
-    return factoryImpl;
-  }
-
-  /**
-   * Get an instance of a DTM, loaded with the content from the
-   * specified source.  If the unique flag is true, a new instance will
-   * always be returned.  Otherwise it is up to the DTMManager to return a
-   * new instance or an instance that it already created and may be being used
-   * by someone else.
-   * (I think more parameters will need to be added for error handling, and entity
-   * resolution).
-   *
-   * @param source the specification of the source object, which may be null,
-   *               in which case it is assumed that node construction will take
-   *               by some other means.
-   * @param unique true if the returned DTM must be unique, probably because it
-   * is going to be mutated.
-   * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
-   *                         be null.
-   * @param incremental true if the DTM should be built incrementally, if
-   *                    possible.
-   * @param doIndexing true if the caller considers it worth it to use 
-   *                   indexing schemes.
-   *
-   * @return a non-null DTM reference.
-   */
-  public abstract DTM getDTM(javax.xml.transform.Source source,
-                             boolean unique, DTMWSFilter whiteSpaceFilter,
-                             boolean incremental, boolean doIndexing);
-
-  /**
-   * Get the instance of DTM that "owns" a node handle.
-   *
-   * @param nodeHandle the nodeHandle.
-   *
-   * @return a non-null DTM reference.
-   */
-  public abstract DTM getDTM(int nodeHandle);
-
-  /**
-   * Given a W3C DOM node, try and return a DTM handle.
-   * Note: calling this may be non-optimal.
-   *
-   * @param node Non-null reference to a DOM node.
-   *
-   * @return a valid DTM handle.
-   */
-  public abstract int getDTMHandleFromNode(org.w3c.dom.Node node);
-
-  /**
-   * Creates a DTM representing an empty <code>DocumentFragment</code> object.
-   * @return a non-null DTM reference.
-   */
-  public abstract DTM createDocumentFragment();
-
-  /**
-   * Release a DTM either to a lru pool, or completely remove reference.
-   * DTMs without system IDs are always hard deleted.
-   * State: experimental.
-   *
-   * @param dtm The DTM to be released.
-   * @param shouldHardDelete True if the DTM should be removed no matter what.
-   * @return true if the DTM was removed, false if it was put back in a lru pool.
-   */
-  public abstract boolean release(DTM dtm, boolean shouldHardDelete);
-
-  /**
-   * Create a new <code>DTMIterator</code> based on an XPath
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
-   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
-   *
-   * @param xpathCompiler ??? Somehow we need to pass in a subpart of the
-   * expression.  I hate to do this with strings, since the larger expression
-   * has already been parsed.
-   *
-   * @param pos The position in the expression.
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public abstract DTMIterator createDTMIterator(Object xpathCompiler,
-          int pos);
-
-  /**
-   * Create a new <code>DTMIterator</code> based on an XPath
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
-   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
-   *
-   * @param xpathString Must be a valid string expressing a
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
-   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
-   *
-   * @param presolver An object that can resolve prefixes to namespace URLs.
-   *
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public abstract DTMIterator createDTMIterator(String xpathString,
-          PrefixResolver presolver);
-
-  /**
-   * Create a new <code>DTMIterator</code> based only on a whatToShow
-   * and a DTMFilter.  The traversal semantics are defined as the
-   * descendant access.
-   * <p>
-   * Note that DTMIterators may not be an exact match to DOM
-   * NodeIterators. They are initialized and used in much the same way
-   * as a NodeIterator, but their response to document mutation is not
-   * currently defined.
-   *
-   * @param whatToShow This flag specifies which node types may appear in
-   *   the logical view of the tree presented by the iterator. See the
-   *   description of <code>NodeFilter</code> for the set of possible
-   *   <code>SHOW_</code> values.These flags can be combined using
-   *   <code>OR</code>.
-   * @param filter The <code>NodeFilter</code> to be used with this
-   *   <code>DTMFilter</code>, or <code>null</code> to indicate no filter.
-   * @param entityReferenceExpansion The value of this flag determines
-   *   whether entity reference nodes are expanded.
-   *
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public abstract DTMIterator createDTMIterator(int whatToShow,
-          DTMFilter filter, boolean entityReferenceExpansion);
-
-  /**
-   * Create a new <code>DTMIterator</code> that holds exactly one node.
-   *
-   * @param node The node handle that the DTMIterator will iterate to.
-   *
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public abstract DTMIterator createDTMIterator(int node);
-  
-  /* Flag indicating whether an incremental transform is desired */
-  public static boolean m_incremental = false;  
-  
-  /**
-   * Set a flag indicating whether an incremental transform is desired 
-   * @param incremental boolean to use to set m_incremental.
-   *
-   */
-  public synchronized static boolean getIncremental()
-  {
-    return m_incremental;  
-  }
-  
-  /**
-   * Set a flag indicating whether an incremental transform is desired 
-   * @param incremental boolean to use to set m_incremental.
-   *
-   */
-  public synchronized static void setIncremental(boolean incremental)
-  {
-    m_incremental = incremental;  
-  }
-  
-  
-
-  // -------------------- private methods --------------------
-
-  /**
-   * Avoid reading all the files when the findFactory
-   * method is called the second time (cache the result of
-   * finding the default impl).
-   */
-  private static String foundFactory = null;
-
-  /**
-   * Temp debug code - this will be removed after we test everything
-   */
-  private static boolean debug;
-
-  static
-  {
-    try
-    {
-      debug = System.getProperty("dtm.debug") != null;
-    }
-    catch (SecurityException ex){}
-  }
-
-  /**
-   * Private implementation method - will find the implementation
-   * class in the specified order.
-   *
-   * @param factoryId   Name of the factory interface.
-   * @param xmlProperties Name of the properties file based on JAVA/lib.
-   * @param defaultFactory Default implementation, if nothing else is found.
-   *
-   * @return The factory class name.
-   */
-  private static String findFactory(String factoryId, String defaultFactory)
-  {
-
-    // Use the system property first
-    try
-    {
-      String systemProp = null;
-
-      try
-      {
-        systemProp = System.getProperty(factoryId);
-      }
-      catch (SecurityException se){}
-
-      if (systemProp != null)
-      {
-        if (debug)
-        {
-          System.err.println("DTM: found system property" + systemProp);
-        }
-
-        return systemProp;
-      }
-    }
-    catch (SecurityException se){}
-
-    if (foundFactory != null)
-    {
-      return foundFactory;
-    }
-
-    // try to read from $java.home/lib/jaxp.properties
-    try
-    {
-      String javah = System.getProperty("java.home");
-      String configFile = javah + File.separator + "lib" + File.separator
-                          + "jaxp.properties";
-      File f = new File(configFile);
-
-      if (f.exists())
-      {
-        Properties props = new Properties();
-
-        props.load(new FileInputStream(f));
-
-        foundFactory = props.getProperty(factoryId);
-
-        if (debug)
-        {
-          System.err.println("DTM: found java.home property " + foundFactory);
-        }
-
-        if (foundFactory != null)
-        {
-          return foundFactory;
-        }
-      }
-    }
-    catch (Exception ex)
-    {
-      if (debug)
-      {
-        ex.printStackTrace();
-      }
-    }
-
-    String serviceId = "META-INF/services/" + factoryId;
-
-    // try to find services in CLASSPATH
-    try
-    {
-      ClassLoader cl = DTMManager.class.getClassLoader();
-      InputStream is = null;
-
-      if (cl == null)
-      {
-        is = ClassLoader.getSystemResourceAsStream(serviceId);
-      }
-      else
-      {
-        is = cl.getResourceAsStream(serviceId);
-      }
-
-      if (is != null)
-      {
-        if (debug)
-        {
-          System.err.println("DTM: found  " + serviceId);
-        }
-
-        BufferedReader rd = new BufferedReader(new InputStreamReader(is));
-
-        foundFactory = rd.readLine();
-
-        rd.close();
-
-        if (debug)
-        {
-          System.err.println("DTM: loaded from services: " + foundFactory);
-        }
-
-        if ((foundFactory != null) &&!"".equals(foundFactory))
-        {
-          return foundFactory;
-        }
-      }
-    }
-    catch (Exception ex)
-    {
-      if (debug)
-      {
-        ex.printStackTrace();
-      }
-    }
-
-    return defaultFactory;
-  }
-
-
-  /** This value, set at compile time, controls how many bits of the
-   * DTM node identifier numbers are used to identify a node within a
-   * document, and thus sets the maximum number of nodes per
-   * document. The remaining bits are used to identify the DTM
-   * document which contains this node.
-   *
-   * If you change IDENT_DTM_NODE_BITS, be sure to rebuild _ALL_ the
-   * files which use it... including the IDKey testcases.
-   *
-   * (FuncGenerateKey currently uses the node identifier directly and
-   * thus is sensitive to its format. The IDKEY results will still be
-   * _correct_ (presuming no other breakage), but simple equality
-   * comparison against the previous "golden" files will probably
-   * complain.)  */
-  public static final int IDENT_DTM_NODE_BITS = 22;
-    
-
-  /** When this bitmask is ANDed with a DTM node handle number, the result
-   * is the node's index number within that DTM.
-   */
-  public static final int IDENT_NODE_DEFAULT = (1<<IDENT_DTM_NODE_BITS)-1;
-
-
-  /** When this bitmask is ANDed with a DTM node handle number, the result
-   * is the DTM's document identity number.
-   */
-  public static final int IDENT_DTM_DEFAULT = ~IDENT_NODE_DEFAULT;
-
-  /** This is the maximum number of DTMs available.  The highest DTM is
-    * one less than this.
-   */
-  public static final int IDENT_MAX_DTMS = (IDENT_DTM_DEFAULT >>> IDENT_DTM_NODE_BITS) + 1;
-
-
-  /**
-   * %TBD% Doc
-   *
-   * NEEDSDOC @param dtm
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public abstract int getDTMIdentity(DTM dtm);
-
-  /**
-   * %TBD% Doc
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public int getDTMIdentityMask()
-  {
-    return IDENT_DTM_DEFAULT;
-  }
-
-  /**
-   * %TBD% Doc
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public int getNodeIdentityMask()
-  {
-    return IDENT_NODE_DEFAULT;
-  }
-
-}
diff --git a/src/org/apache/xml/dtm/DTMWSFilter.java b/src/org/apache/xml/dtm/DTMWSFilter.java
deleted file mode 100644
index 977e658..0000000
--- a/src/org/apache/xml/dtm/DTMWSFilter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.xml.dtm;
-
-/**
- * This interface is meant to be implemented by a client of the DTM, and allows
- * stripping of whitespace nodes.
- */
-public interface DTMWSFilter
-{
-  /**
-   * Do not strip whitespace child nodes of this element.
-   */
-  public static final short NOTSTRIP = 1;
-
-  /**
-   * Strip whitespace child nodes of this element.
-   */
-  public static final short STRIP = 2;
-
-  /**
-   * Inherit whitespace stripping behavior of the parent node.
-   */
-  public static final short INHERIT = 3;
-
-  /**
-   * Test whether whitespace-only text nodes are visible in the logical 
-   * view of <code>DTM</code>. Normally, this function
-   * will be called by the implementation of <code>DTM</code>; 
-   * it is not normally called directly from
-   * user code.
-   * 
-   * @param elementHandle int Handle of the element.
-   * @return one of NOTSTRIP, STRIP, or INHERIT.
-   */
-  public short getShouldStripSpace(int elementHandle, DTM dtm);
-  
-}
\ No newline at end of file
diff --git a/src/org/apache/xml/dtm/ref/ChunkedIntArray.java b/src/org/apache/xml/dtm/ref/ChunkedIntArray.java
deleted file mode 100644
index b5c7c24..0000000
--- a/src/org/apache/xml/dtm/ref/ChunkedIntArray.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
- 
-import org.w3c.dom.*;
-import org.apache.xml.dtm.*;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * <code>ChunkedIntArray</code> is an extensible array of blocks of integers.
- * (I'd consider Vector, but it's unable to handle integers except by
- * turning them into Objects.)
-
- * <p>Making this a separate class means some call-and-return overhead. But
- * doing it all inline tends to be fragile and expensive in coder time,
- * not to mention driving up code size. If you want to inline it, feel free.
- * The Java text suggest that private and Final methods may be inlined, 
- * and one can argue that this beast need not be made subclassable...</p>
- *
- * <p>%REVIEW% This has strong conceptual overlap with the IntVector class.
- * It would probably be a good thing to merge the two, when time permits.<p>
- */
-final class ChunkedIntArray
-{
-  final int slotsize=4; // Locked, MUST be power of two in current code
-  // Debugging tip: Cranking lowbits down to 4 or so is a good
-  // way to pound on the array addressing code.
-  static final int lowbits=10; // How many bits address within chunks
-  static final int chunkalloc=1<<lowbits;
-  static final int lowmask=chunkalloc-1;
-  
-  ChunksVector chunks=new ChunksVector();
-  final int fastArray[] = new int[chunkalloc];
-  int lastUsed=0;
-
-  /**
-   * Create a new CIA with specified record size. Currently record size MUST
-   * be a power of two... and in fact is hardcoded to 4.
-   */
-  ChunkedIntArray(int slotsize)
-  {
-    if(this.slotsize<slotsize)
-      throw new ArrayIndexOutOfBoundsException(XSLMessages.createMessage(XSLTErrorResources.ER_CHUNKEDINTARRAY_NOT_SUPPORTED, new Object[]{Integer.toString(slotsize)})); //"ChunkedIntArray("+slotsize+") not currently supported");
-    else if (this.slotsize>slotsize)
-      System.out.println("*****WARNING: ChunkedIntArray("+slotsize+") wasting "+(this.slotsize-slotsize)+" words per slot");
-    chunks.addElement(fastArray);
-  }
-  /**
-   * Append a 4-integer record to the CIA, starting with record 1. (Since
-   * arrays are initialized to all-0, 0 has been reserved as the "unknown"
-   * value in DTM.)
-   * @return the index at which this record was inserted.
-   */
-  int appendSlot(int w0, int w1, int w2, int w3)
-  {
-    /*
-    try
-    {
-      int newoffset = (lastUsed+1)*slotsize;
-      fastArray[newoffset] = w0;
-      fastArray[newoffset+1] = w1;
-      fastArray[newoffset+2] = w2;
-      fastArray[newoffset+3] = w3;
-      return ++lastUsed;
-    }
-    catch(ArrayIndexOutOfBoundsException aioobe)
-    */
-    {
-      final int slotsize=4;
-      int newoffset = (lastUsed+1)*slotsize;
-      int chunkpos = newoffset >> lowbits;
-      int slotpos = (newoffset & lowmask);
-
-      // Grow if needed
-      if (chunkpos > chunks.size() - 1)
-        chunks.addElement(new int[chunkalloc]);
-      int[] chunk = chunks.elementAt(chunkpos);
-      chunk[slotpos] = w0;
-      chunk[slotpos+1] = w1;
-      chunk[slotpos+2] = w2;
-      chunk[slotpos+3] = w3;
-
-      return ++lastUsed;
-    }
-  }
-  /**
-   * Retrieve an integer from the CIA by record number and column within
-   * the record, both 0-based (though position 0 is reserved for special
-   * purposes).
-   * @param position int Record number
-   * @param slotpos int Column number
-   */
-  int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException
-  {
-    /*
-    try
-    {
-      return fastArray[(position*slotsize)+offset];
-    }
-    catch(ArrayIndexOutOfBoundsException aioobe)
-    */
-    {
-      // System.out.println("Using slow read (1)");
-      if (offset>=slotsize)
-        throw new ArrayIndexOutOfBoundsException(XSLMessages.createMessage(XSLTErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot");
-      position*=slotsize;
-      int chunkpos = position >> lowbits;
-      int slotpos = position & lowmask;
-      int[] chunk = chunks.elementAt(chunkpos);
-      return chunk[slotpos + offset];
-    }
-  }
-  
-  // Check that the node at index "position" is not an ancestor
-  // of the node at index "startPos". IF IT IS, DO NOT ACCEPT IT AND
-  // RETURN -1. If position is NOT an ancestor, return position.
-  // Special case: The Document node (position==0) is acceptable.
-  //
-  // This test supports DTM.getNextPreceding.
-  int specialFind(int startPos, int position)
-  {
-          // We have to look all the way up the ancestor chain
-          // to make sure we don't have an ancestor.
-          int ancestor = startPos;
-          while(ancestor > 0)
-          {
-                // Get the node whose index == ancestor
-                ancestor*=slotsize;
-                int chunkpos = ancestor >> lowbits;
-                int slotpos = ancestor & lowmask;
-                int[] chunk = chunks.elementAt(chunkpos);
-                                                        
-                // Get that node's parent (Note that this assumes w[1]
-                // is the parent node index. That's really a DTM feature
-                // rather than a ChunkedIntArray feature.)
-                ancestor = chunk[slotpos + 1];
-
-                if(ancestor == position)
-                         break;
-          }
-
-          if (ancestor <= 0) 
-          {
-                  return position;
-          }
-          return -1;
-  }
-  
-  /**
-   * @return int index of highest-numbered record currently in use
-   */
-  int slotsUsed()
-  {
-    return lastUsed;
-  }
-
-  /** Disard the highest-numbered record. This is used in the string-buffer
-   CIA; when only a single characters() chunk has been recieved, its index
-   is moved into the Text node rather than being referenced by indirection
-   into the text accumulator.
-   */
-  void discardLast()
-  {
-    --lastUsed;
-  }
-
-  /**
-   * Overwrite the integer found at a specific record and column.
-   * Used to back-patch existing records, most often changing their
-   * "next sibling" reference from 0 (unknown) to something meaningful
-   * @param position int Record number
-   * @param offset int Column number
-   * @param value int New contents
-   */
-  void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException
-  {
-    /*
-    try
-    {
-      fastArray[( position*slotsize)+offset] = value;
-    }
-    catch(ArrayIndexOutOfBoundsException aioobe)
-    */
-    {
-      if (offset >= slotsize)
-        throw new ArrayIndexOutOfBoundsException(XSLMessages.createMessage(XSLTErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot");
-      position*=slotsize;
-      int chunkpos = position >> lowbits;
-      int slotpos = position & lowmask;
-      int[] chunk = chunks.elementAt(chunkpos);
-      chunk[slotpos + offset] = value; // ATOMIC!
-    }
-  }
-
-  /**
-   * Overwrite an entire (4-integer) record at the specified index.
-   * Mostly used to create record 0, the Document node.
-   * @param position integer Record number
-   * @param w0 int 
-   * @param w1 int
-   * @param w2 int
-   * @param w3 int
-   */
-  void writeSlot(int position, int w0, int w1, int w2, int w3)
-  {
-      position *= slotsize;
-      int chunkpos = position >> lowbits;
-      int slotpos = (position & lowmask);
-
-    // Grow if needed
-    if (chunkpos > chunks.size() - 1)
-      chunks.addElement(new int[chunkalloc]);
-    int[] chunk = chunks.elementAt(chunkpos);
-    chunk[slotpos] = w0;
-    chunk[slotpos + 1] = w1;
-    chunk[slotpos + 2] = w2;
-    chunk[slotpos + 3] = w3;
-  }
-
-  /**
-   * Retrieve the contents of a record into a user-supplied buffer array.
-   * Used to reduce addressing overhead when code will access several
-   * columns of the record.
-   * @param position int Record number
-   * @param buffer int[] Integer array provided by user, must be large enough
-   * to hold a complete record.
-   */
-  void readSlot(int position, int[] buffer)
-  {
-    /*
-    try
-    {
-      System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize);
-    }
-    catch(ArrayIndexOutOfBoundsException aioobe)
-    */
-    {
-      // System.out.println("Using slow read (2): "+position);
-      position *= slotsize;
-      int chunkpos = position >> lowbits;
-      int slotpos = (position & lowmask);
-
-      // Grow if needed
-      if (chunkpos > chunks.size() - 1)
-        chunks.addElement(new int[chunkalloc]);
-      int[] chunk = chunks.elementAt(chunkpos);
-      System.arraycopy(chunk,slotpos,buffer,0,slotsize);
-    }
-  }
-
-  class ChunksVector
-  {
-    final int BLOCKSIZE = 64;
-    int[] m_map[] = new int[BLOCKSIZE][];
-    int m_mapSize = BLOCKSIZE;
-    int pos = 0;
-    
-    ChunksVector()
-    {
-    }
-    
-    final int size()
-    {
-      return pos;
-    }
-    
-    void addElement(int[] value)
-    {
-      if(pos >= m_mapSize)
-      {
-        int orgMapSize = m_mapSize;
-        while(pos >= m_mapSize)
-          m_mapSize+=BLOCKSIZE;
-        int[] newMap[] = new int[m_mapSize][];
-        System.arraycopy(m_map, 0, newMap, 0, orgMapSize);
-        m_map = newMap;
-      }
-      // For now, just do a simple append.  A sorted insert only 
-      // makes sense if we're doing an binary search or some such.
-      m_map[pos] = value;
-      pos++;
-    }
-    
-    final int[] elementAt(int pos)
-    {
-      return m_map[pos];
-    }
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/CoroutineManager.java b/src/org/apache/xml/dtm/ref/CoroutineManager.java
deleted file mode 100644
index f1938a5..0000000
--- a/src/org/apache/xml/dtm/ref/CoroutineManager.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import java.util.*;
-import org.apache.xml.dtm.*;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * <meta name="usage" content="internal"/>
- * <p>Support the coroutine design pattern.</p>
- * 
- * <p>A coroutine set is a very simple cooperative non-preemptive
- * multitasking model, where the switch from one task to another is
- * performed via an explicit request. Coroutines interact according to
- * the following rules:</p>
- *
- * <ul>
- * <li>One coroutine in the set has control, which it retains until it
- * either exits or resumes another coroutine.</li>
- * <li>A coroutine is activated when it is resumed by some other coroutine
- * for the first time.</li>
- * <li>An active coroutine that gives up control by resuming another in
- * the set retains its context -- including call stack and local variables
- * -- so that if/when it is resumed, it will proceed from the point at which
- * it last gave up control.</li>
- * </ul>
- *
- * <p>Coroutines can be thought of as falling somewhere between pipes and
- * subroutines. Like call/return, there is an explicit flow of control
- * from one coroutine to another. Like pipes, neither coroutine is
- * actually "in charge", and neither must exit in order to transfer
- * control to the other. </p>
- * 
- * <p>One classic application of coroutines is in compilers, where both
- * the parser and the lexer are maintaining complex state
- * information. The parser resumes the lexer to process incoming
- * characters into lexical tokens, and the lexer resumes the parser
- * when it has reached a point at which it has a reliably interpreted
- * set of tokens available for semantic processing. Structuring this
- * as call-and-return would require saving and restoring a
- * considerable amount of state each time. Structuring it as two tasks
- * connected by a queue may involve higher overhead (in systems which
- * can optimize the coroutine metaphor), isn't necessarily as clear in
- * intent, may have trouble handling cases where data flows in both
- * directions, and may not handle some of the more complex cases where
- * more than two coroutines are involved.</p>
- * 
- * <p>Most coroutine systems also provide a way to pass data between the
- * source and target of a resume operation; this is sometimes referred
- * to as "yielding" a value.  Others rely on the fact that, since only
- * one member of a coroutine set is running at a time and does not
- * lose control until it chooses to do so, data structures may be
- * directly shared between them with only minimal precautions.</p>
- * 
- * <p>"Note: This should not be taken to mean that producer/consumer
- * problems should be always be done with coroutines." Queueing is
- * often a better solution when only two threads of execution are
- * involved and full two-way handshaking is not required. It's a bit
- * difficult to find short pedagogical examples that require
- * coroutines for a clear solution.</p>
- * 
- * <p>The fact that only one of a group of coroutines is running at a
- * time, and the control transfer between them is explicit, simplifies
- * their possible interactions, and in some implementations permits
- * them to be implemented more efficiently than general multitasking.
- * In some situations, coroutines can be compiled out entirely;
- * in others, they may only require a few instructions more than a
- * simple function call.</p>
- *
- * <p>This version is built on top of standard Java threading, since
- * that's all we have available right now. It's been encapsulated for
- * code clarity and possible future optimization.</p>
- * 
- * <p>(Two possible approaches: wait-notify based and queue-based. Some
- * folks think that a one-item queue is a cleaner solution because it's
- * more abstract -- but since coroutine _is_ an abstraction I'm not really
- * worried about that; folks should be able to switch this code without
- * concern.)</p>
- * 
- * <p>%TBD% THIS SHOULD BE AN INTERFACE, to facilitate building other
- * implementations... perhaps including a true coroutine system
- * someday, rather than controlled threading. Arguably Coroutine
- * itself should be an interface much like Runnable, but I think that
- * can be built on top of this.</p>
- * */
-public class CoroutineManager
-{
-  /** "Is this coroutine ID number already in use" lookup table.
-   * Currently implemented as a bitset as a compromise between
-   * compactness and speed of access, but obviously other solutions
-   * could be applied.
-   * */
-  BitSet m_activeIDs=new BitSet();
-
-  /** Limit on the coroutine ID numbers accepted. I didn't want the
-   * in-use table to grow without bound. If we switch to a more efficient
-   * sparse-array mechanism, it may be possible to raise or eliminate
-   * this boundary.
-   */
-  static final int m_unreasonableId=1024;
-
-  /** Internal field used to hold the data being explicitly passed
-   * from one coroutine to another during a co_resume() operation.
-   * (Of course implicit data sharing may also occur; one of the reasons
-   * for using coroutines is that you're guaranteed that none of the
-   * other coroutines in your set are using shared structures at the time
-   * you access them.)
-   *
-   * %REVIEW% It's been proposed that we be able to pass types of data
-   * other than Object -- more specific object types, or
-   * lighter-weight primitives.  This would seem to create a potential
-   * explosion of "pass x recieve y back" methods (or require
-   * fracturing resume into two calls, resume-other and
-   * wait-to-be-resumed), and the weight issue could be managed by
-   * reusing a mutable buffer object to contain the primitive
-   * (remember that only one coroutine runs at a time, so once the
-   * buffer's set it won't be walked on). Typechecking objects is
-   * interesting from a code-robustness point of view, but it's
-   * unclear whether it makes sense to encapsulate that in the
-   * coroutine code or let the callers do it, since it depends on RTTI
-   * either way. Restricting the parameters to objects implementing a
-   * specific CoroutineParameter interface does _not_ seem to be a net
-   * win; applications can do so if they want via front-end code, but
-   * there seem to be too many use cases involving passing an existing
-   * object type that you may not have the freedom to alter and may
-   * not want to spend time wrapping another object around.
-   * */
-  Object m_yield=null;
-
-  // Expose???
-  final static int NOBODY=-1;
-  final static int ANYBODY=-1;
-
-  /** Internal field used to confirm that the coroutine now waking up is
-   * in fact the one we intended to resume. Some such selection mechanism
-   * is needed when more that two coroutines are operating within the same
-   * group.
-   */
-  int m_nextCoroutine=NOBODY;
-  
-  /** <p>Each coroutine in the set managed by a single
-   * CoroutineManager is identified by a small positive integer. This
-   * brings up the question of how to manage those integers to avoid
-   * reuse... since if two coroutines use the same ID number, resuming
-   * that ID could resume either. I can see arguments for either
-   * allowing applications to select their own numbers (they may want
-   * to declare mnemonics via manefest constants) or generating
-   * numbers on demand.  This routine's intended to support both
-   * approaches.</p>
-   *
-   * <p>%REVIEW% We could use an object as the identifier. Not sure
-   * it's a net gain, though it would allow the thread to be its own
-   * ID. Ponder.</p>
-   *
-   * @param coroutineID: If >=0, requests that we reserve this number.
-   * If <0, requests that we find, reserve, and return an available ID
-   * number.
-   *
-   * @return If >=0, the ID number to be used by this coroutine. If <0,
-   * an error occurred -- the ID requested was already in use, or we
-   * couldn't assign one without going over the "unreasonable value" mark
-   * */
-  public synchronized int co_joinCoroutineSet(int coroutineID)
-  {
-    if(coroutineID>=0)
-      {
-        if(coroutineID>=m_unreasonableId || m_activeIDs.get(coroutineID))
-          return -1;
-      }
-    else
-      {
-        // What I want is "Find first clear bit". That doesn't exist.
-        // JDK1.2 added "find last set bit", but that doesn't help now.
-        coroutineID=0;
-        while(coroutineID<m_unreasonableId)
-          {
-            if(m_activeIDs.get(coroutineID))
-              ++coroutineID;
-            else
-              break;
-          }
-        if(coroutineID>=m_unreasonableId)
-          return -1;
-      }
-
-    m_activeIDs.set(coroutineID);
-    return coroutineID;
-  }
-
-  /** In the standard coroutine architecture, coroutines are
-   * identified by their method names and are launched and run up to
-   * their first yield by simply resuming them; its's presumed that
-   * this recognizes the not-already-running case and does the right
-   * thing. We seem to need a way to achieve that same threadsafe
-   * run-up...  eg, start the coroutine with a wait.
-   *
-   * %TBD% whether this makes any sense...
-   *
-   * @param thisCoroutine the identifier of this coroutine, so we can
-   * recognize when we are being resumed.
-   * @exception java.lang.NoSuchMethodException if thisCoroutine isn't
-   * a registered member of this group. %REVIEW% whether this is the
-   * best choice.
-   * */
-  public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException
-  {
-    if(!m_activeIDs.get(thisCoroutine))
-      throw new java.lang.NoSuchMethodException();
-
-    while(m_nextCoroutine != thisCoroutine)
-      {
-        try 
-          {
-            wait();
-          }
-        catch(java.lang.InterruptedException e)
-          {
-            // %TBD% -- Declare? Encapsulate? Ignore? Or
-            // dance widdershins about the instruction cache?
-          }
-      }
-    
-    return m_yield;
-  }
-
-  /** Transfer control to another coroutine which has already been started and
-   * is waiting on this CoroutineManager. We won't return from this call
-   * until that routine has relinquished control.
-   *
-   * %TBD% What should we do if toCoroutine isn't registered? Exception?
-   *
-   * @param arg_object A value to be passed to the other coroutine.
-   * @param thisCoroutine Integer identifier for this coroutine. This is the
-   * ID we watch for to see if we're the ones being resumed.
-   * @param toCoroutine. Integer identifier for the coroutine we wish to
-   * invoke. 
-   * @exception java.lang.NoSuchMethodException if toCoroutine isn't a
-   * registered member of this group. %REVIEW% whether this is the best choice.
-   * */
-  public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
-  {
-    if(!m_activeIDs.get(toCoroutine))
-      throw new java.lang.NoSuchMethodException(XSLMessages.createMessage(XSLTErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
-
-    // We expect these values to be overwritten during the notify()/wait()
-    // periods, as other coroutines in this set get their opportunity to run.
-    m_yield=arg_object;
-    m_nextCoroutine=toCoroutine;
-
-    notify();
-    while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
-      {
-        try 
-          {
-            // System.out.println("waiting...");
-            wait();
-          }
-        catch(java.lang.InterruptedException e)
-          {
-            // %TBD% -- Declare? Encapsulate? Ignore? Or
-            // dance deasil about the program counter?
-          }
-      }
-
-    if(m_nextCoroutine==NOBODY)
-      {
-        // Pass it along
-        co_exit(thisCoroutine);
-        // And inform this coroutine that its partners are Going Away
-        // %REVIEW% Should this throw/return something more useful?
-        throw new java.lang.NoSuchMethodException(XSLMessages.createMessage(XSLTErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
-      }
-    
-    return m_yield;
-  }
-  
-  /** Terminate this entire set of coroutines. The others will be
-   * deregistered and have exceptions thrown at them. Note that this
-   * is intended as a panic-shutdown operation; under normal
-   * circumstances a coroutine should always end with co_exit_to() in
-   * order to politely inform at least one of its partners that it is
-   * going away.
-   *
-   * %TBD% This may need significantly more work. 
-   *
-   * %TBD% Should this just be co_exit_to(,,CoroutineManager.PANIC)?
-   *
-   * @param thisCoroutine Integer identifier for the coroutine requesting exit.
-   * */
-  public synchronized void co_exit(int thisCoroutine)
-  {
-    m_activeIDs.clear(thisCoroutine);
-    m_nextCoroutine=NOBODY; // %REVIEW%
-    notify();
-  }
-
-  /** Make the ID available for reuse and terminate this coroutine,
-   * transferring control to the specified coroutine. Note that this
-   * returns immediately rather than waiting for any further coroutine
-   * traffic, so the thread can proceed with other shutdown activities.
-   *
-   * @param arg_object A value to be passed to the other coroutine.
-   * @param thisCoroutine Integer identifier for the coroutine leaving the set.
-   * @param toCoroutine. Integer identifier for the coroutine we wish to
-   * invoke. 
-   * @exception java.lang.NoSuchMethodException if toCoroutine isn't a
-   * registered member of this group. %REVIEW% whether this is the best choice.
-   * */
-  public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
-  {
-    if(!m_activeIDs.get(toCoroutine))
-      throw new java.lang.NoSuchMethodException(XSLMessages.createMessage(XSLTErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
-    
-    // We expect these values to be overwritten during the notify()/wait()
-    // periods, as other coroutines in this set get their opportunity to run.
-    m_yield=arg_object;
-    m_nextCoroutine=toCoroutine;
-
-    m_activeIDs.clear(thisCoroutine);
-
-    notify();
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/CoroutineParser.java b/src/org/apache/xml/dtm/ref/CoroutineParser.java
deleted file mode 100644
index 782a179..0000000
--- a/src/org/apache/xml/dtm/ref/CoroutineParser.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import java.io.IOException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.XMLReader;
-
-/** <p>CoroutineParser is an API for parser threads that operate as
- * coroutines. See CoroutineSAXParser and CoroutineSAXParser_Xerces
- * for examples.</p>
- *
- * <p>&lt;grumble&gt; I'd like the interface to require a specific form
- * for either the base constructor or a static factory method. Java
- * doesn't allow us to specify either, so I'll just document them
- * here:
- *
- * <ul>
- * <li>public CoroutineParser(CoroutineManager co, int appCoroutine);</li>
- * <li>public CoroutineParser createCoroutineParser(CoroutineManager co, int appCoroutine);</li>
- * </ul>
- *
- * &lt;/grumble&gt;</p>
- *
- * @deprecated Since the ability to start a parse via the
- * coroutine protocol was not being used and was complicating design.
- * See {@link IncrementalSAXSource}.
- * */
-public interface CoroutineParser {
-
-    /** @return the coroutine ID number for this CoroutineParser object.
-     * Note that this isn't useful unless you know which CoroutineManager
-     * you're talking to. Also note that the do...() methods encapsulate
-     * the common transactions with the CoroutineParser, so you shouldn't
-     * need this in most cases.
-     * */
-    public int getParserCoroutineID();
-
-    /** @return the CoroutineManager for this CoroutineParser object.
-     * If you're using the do...() methods, applications should only
-     * need to talk to the CoroutineManager once, to obtain the
-     * application's Coroutine ID.
-     * */
-    public CoroutineManager getCoroutineManager();
-
-  /** Register a SAX-style content handler for us to output to */
-  public void setContentHandler(ContentHandler handler);
-
-  /**  Register a SAX-style lexical handler for us to output to
-   *  Not all parsers support this...
-   *
-   * %REVIEW% Not called setLexicalHandler because Xalan uses that name
-   * internally, which causes subclassing nuisances. 
-   */
-  public void setLexHandler(org.xml.sax.ext.LexicalHandler handler);
-
-  /* The run() method is required in CoroutineParsers that run as
-   * threads (of course)... but it isn't part of our API, and
-   * shouldn't be declared here.
-   * */
-
-  //================================================================
-  /** doParse() is a simple API which tells the coroutine parser
-   * to begin reading from a file.  This is intended to be called from one
-   * of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * %REVIEW% Can/should this unify with doMore? (if URI hasn't changed,
-   * parse more from same file, else end and restart parsing...?
-   *
-   * @param source The InputSource to parse from.
-   * @param appCoroutine The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object doParse(InputSource source, int appCoroutine);
-
-  /** doMore() is a simple API which tells the coroutine parser
-   * that we need more nodes.  This is intended to be called from one
-   * of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * @param parsemore If true, tells the incremental parser to generate
-   * another chunk of output. If false, tells the parser that we're
-   * satisfied and it can terminate parsing of this document.
-   * @param appCoroutine The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object doMore (boolean parsemore, int appCoroutine);
-
-  /** doTerminate() is a simple API which tells the coroutine
-   * parser to terminate itself.  This is intended to be called from
-   * one of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * Returns only after the CoroutineParser has acknowledged the request.
-   *
-   * @param appCoroutine The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * */
-  public void doTerminate(int appCoroutine);
-
-
-    /**
-     *  Initialize the coroutine parser. Same parameters could be passed
-     *  in a non-default constructor, or by using using Class.forName and
-     *  newInstance and then calling init()
-     */
-  public void init( CoroutineManager co, int appCoroutineID, XMLReader parser );
-
-} // class CoroutineParser
diff --git a/src/org/apache/xml/dtm/ref/CoroutineSAXFilterTest.java b/src/org/apache/xml/dtm/ref/CoroutineSAXFilterTest.java
deleted file mode 100644
index 9dc0d85..0000000
--- a/src/org/apache/xml/dtm/ref/CoroutineSAXFilterTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.XMLReader;
-import java.io.IOException;
-import javax.xml.parsers.*;
-
-/** Primitive unit test for CoroutineSAXParser in filtering mode:
- * Attempt coroutine parsing of documents indicated by arguments (as
- * URIs), report progress. If a URI is followed by "!" as the next
- * argument, we cancel the parse early.
- *
- * This version tests the filtering mode, where the CoroutineParser
- * is managing a SAX stream generated by other code. Normally this
- * would be used when you've launched the consumer in a secondary
- * thread and are running the SAX event generation in the primary
- * thread. Of course it could be used the other way round as well.
- *
- * Note that unlike the fully-encapsulated version (see the inline
- * test in CoroutineSAXParser), this version does _not_ have a
- * dialog for starting the parse, or for restarting it with a new
- * file.
- * */
-class CoroutineSAXFilterTest implements Runnable
-{
-  // Statics are a sloppy way of passing data to the test thread,
-  // but for this quick-hack I don't much care.
-  static boolean TEST_EARLY_STOP=false;
-  static int appCoroutineID=-1;
-  static CoroutineSAXParser filter;
-
-  public static void main(String args[])
-  {
-    System.out.println("Starting in Filtering mode...");
-
-    org.xml.sax.XMLReader theSAXParser=null;
-    try {
-	SAXParserFactory factory=SAXParserFactory.newInstance();
-	SAXParser parser=factory.newSAXParser();
-	theSAXParser=parser.getXMLReader();
-    } catch( Exception ex ) {
-	ex.printStackTrace();
-	return;
-    }
-    
-    CoroutineManager co = new CoroutineManager();
-
-    appCoroutineID = co.co_joinCoroutineSet(appCoroutineID);
-    if (appCoroutineID == -1)
-      {
-        System.out.println("ERROR: Couldn't allocate coroutine number.\n");
-        return;
-      }
-
-    // Note that this is a global -- sloppy connection to the thread.
-    filter=new CoroutineSAXParser(co, appCoroutineID);
-
-    // Convenience function... Set handlers
-    filter.setXMLReader(theSAXParser);
-    
-    // Use a serializer as our sample output
-    org.apache.xml.serialize.XMLSerializer trace;
-    trace=new org.apache.xml.serialize.XMLSerializer(System.out,null);
-    filter.setContentHandler(trace);
-    filter.setLexHandler(trace);
-
-    // Launch the listener.
-    Thread listener=new Thread(new CoroutineSAXFilterTest());
-    listener.setDaemon(false);
-    listener.start();
-    
-    // Check stop-early flag
-    if(args.length>1 && "!".equals(args[1]))
-      TEST_EARLY_STOP=true;
-
-    // Run the parser
-    System.out.println("*** Parser start ***");
-    try
-      {
-        theSAXParser.parse(new InputSource(args[0]));
-      }
-    catch(java.io.IOException e)
-      {
-        e.printStackTrace();
-      }
-    catch(org.xml.sax.SAXException e)
-      {
-        e.printStackTrace();
-
-        // %REVIEW% We'll should probably expose these special types,
-        // if we might be testing them outside the filtering code...
-
-        Exception embedded=e.getException();
-        if(embedded!=null && embedded.getClass().getName().equals("org.apache.xml.dtm.CoroutineSAXParser$UserRequestedStopException"))
-          System.out.println("... NORMAL response to doTerminate().");
-      }
-    System.out.println("*** Parser end ***");
-    filter.doTerminate(appCoroutineID);
-  }
-  
-  // Issue coroutine transactions to simulate dialog with the parser
-  // for a single file.  Note that the sequence of calls here is
-  // identical to that when talking to the fully encapsulated
-  // parser... though doParse() will be a no-op since the parse
-  // is launched separately.
-  public void run() {
-  {
-    // %TBD% PROBLEM: Parser error hangs this process...
-
-    Object result;
-    boolean more=true;
-
-    for(result = filter.doParse(null, appCoroutineID);
-        (result instanceof Boolean && ((Boolean)result)==Boolean.TRUE);
-        result = filter.doMore(more, appCoroutineID))
-      {
-        // Special test: Terminate parsing early.
-        if(TEST_EARLY_STOP)
-          {
-            System.out.println("\nSome parsing successful, trying to stop.\n");
-            more=false;
-          }
-        else
-          System.out.println("\nSome parsing successful, trying more.\n");
-      }
-    
-    if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
-      {
-        System.out.println("\nfilter ended (EOF or on request).\n");
-      }
-    else if (result == null) {
-      System.out.println("\nUNEXPECTED: filter says shut down prematurely.\n");
-    }
-    else if (result instanceof Exception) {
-      System.out.println("\nfilter threw exception:");
-      ((Exception)result).printStackTrace();
-    }
-    
-  }
-  
-  filter.doTerminate(appCoroutineID);
-  }
-  
-}
diff --git a/src/org/apache/xml/dtm/ref/CoroutineSAXParser.java b/src/org/apache/xml/dtm/ref/CoroutineSAXParser.java
deleted file mode 100644
index 5e0a966..0000000
--- a/src/org/apache/xml/dtm/ref/CoroutineSAXParser.java
+++ /dev/null
@@ -1,1097 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.XMLReader;
-import java.io.IOException;
-import org.apache.xml.dtm.ref.CoroutineManager;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/** <p>CoroutineSAXParser runs a SAX2 parser in a coroutine to achieve
- * incremental parsing. Output from the parser will still be issued
- * via callbacks, which will need to be recieved and acted upon by an
- * appopriate handler. But those callbacks will pass through a
- * counting stage which periodically yields control back to the other
- * coroutines in this set.</p>
- *
- * <p>For a brief usage example, see the unit-test main() method.</p>
- *
- * @deprecated Since the ability to start a parse via the
- * coroutine protocol was not being used and was complicating design.
- * See {@link IncrementalSAXSource_Filter}.
- * */
-public class CoroutineSAXParser
-implements CoroutineParser, Runnable, ContentHandler, LexicalHandler, ErrorHandler
-{
-
-  boolean DEBUG=false; //Internal status report
-
-  //
-  // Data
-  //
-
-  private CoroutineManager fCoroutineManager = null;
-  private int fAppCoroutineID = -1;
-  private int fParserCoroutineID = -1;
-  private boolean fParseInProgress=false;
-  private XMLReader fXMLReader=null;
-  private boolean fRunningInThread=false;
-  private ContentHandler clientContentHandler=null; // %REVIEW% support multiple?
-  private LexicalHandler clientLexicalHandler=null; // %REVIEW% support multiple?
-  private ErrorHandler clientErrorHandler=null; // %REVIEW% support multiple?
-  private int eventcounter;
-  private int frequency=5;
-
-  // Horrendous kluge to run filter to completion. See co_yield()'s
-  // internal comments for details. "Is this any way to run a railroad?"
-  private boolean fNeverYieldAgain=false;
-  
-
-  //
-  // Constructors
-  //
-
-  public CoroutineSAXParser() {
-  }
-  
-  /** Create a CoroutineSAXParser which is not yet bound to a specific
-   * SAX event source.
-   *
-   * THIS VERSION DOES NOT LAUNCH A THREAD! It is presumed that the
-   * application coroutine will be started in a secondary thread and
-   * will be waiting for our first yield(), and that the parser will
-   * be run in the main thread.
-   * 
-   * Status: Experimental
-   * 
-   * @see setXMLReader
-   * */
-  public CoroutineSAXParser(CoroutineManager co, int appCoroutineID)
-  {
-    this.init( co, appCoroutineID, null );
-  }
-
-  /** Wrap a SAX2 XMLReader (parser or other event source)
-   * in a CoroutineSAXParser. This version launches the CoroutineSAXParser
-   * in a thread, and prepares it to invoke the parser from that thread
-   * upon request.
-   *
-   * @see doParse
-   */
-  public CoroutineSAXParser(CoroutineManager co, int appCoroutineID,
-                            XMLReader parser) {
-    this.init( co, appCoroutineID, parser );
-  }
-
-  //
-  // Public methods
-  //
-
-  public void init( CoroutineManager co, int appCoroutineID, XMLReader parser ) {
-    fXMLReader=null;    // No reader yet
-
-    eventcounter=frequency;
-
-    fCoroutineManager = co;
-    fAppCoroutineID = appCoroutineID;
-    fParserCoroutineID = co.co_joinCoroutineSet(-1);
-    if (fParserCoroutineID == -1)
-      throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_COJOINROUTINESET_FAILED, null)); //"co_joinCoroutineSet() failed");
-
-    fRunningInThread=false; // Unless overridden by the other constructor
-
-    if( parser!=null ) {
-      setXMLReader(parser);
-    
-      fRunningInThread=true;
-      org.apache.xalan.transformer.TransformerImpl.runTransformThread(this);
-      //Thread t = new Thread(this);
-      //t.setDaemon(false);
-      //t.start();
-    }
-    
-    // System.err.println(fRunningInThread ? "." : "*"); 
-  }
-    
-  /** Bind to the XMLReader. This operation is ignored if the reader has
-   * previously been set.
-   *
-   * Just a convenience routine; obviously you can explicitly register
-   * this as a listener with the same effect.
-   *
-   * %REVIEW% Should it unbind from the previous reader if there is one?
-   * %REVIEW% Do we really need to set fXMLReader???
-   *
-   * %TBD% This is a quick-hack solution. I'm not convinced that it's
-   * adequate. In particular, since in this model parser.parse() is
-   * invoked from outside rather than from our run() loop, I'm not
-   * sure the end-of-file response is being delivered properly.
-   * (There were questions of double-yields in earlier versions of the code.)
-   * */
-  public void setXMLReader(XMLReader parser)
-  {
-    if(fXMLReader!=null) return;
-    
-    fXMLReader=parser;
-    fXMLReader.setContentHandler(this);
-    fXMLReader.setErrorHandler(this); // to report fatal errors in filtering mode
-
-    // Not supported by all SAX2 parsers:
-    try 
-      {
-        fXMLReader.setProperty("http://xml.org/sax/properties/lexical-handler",
-                              this);
-      }
-    catch(SAXNotRecognizedException e)
-      {
-        // Nothing we can do about it
-      }
-    catch(SAXNotSupportedException e)
-      {
-        // Nothing we can do about it
-      }
-
-    // Should we also bind as other varieties of handler?
-    // (DTDHandler and so on)
-  }
-
-  // Register a content handler for us to output to
-  public void setContentHandler(ContentHandler handler)
-  {
-    clientContentHandler=handler;
-  }
-  // Register a lexical handler for us to output to
-  // Not all parsers support this...
-  // ??? Should we register directly on the parser?
-  // NOTE NAME -- subclassing issue in the Xerces version
-  public void setLexHandler(LexicalHandler handler)
-  {
-    clientLexicalHandler=handler;
-  }
-  // Register an error handler for us to output to
-  // NOTE NAME -- subclassing issue in the Xerces version
-  public void setErrHandler(ErrorHandler handler)
-  {
-    clientErrorHandler=handler;
-  }
-
-  // Set the number of events between resumes of our coroutine
-  // Immediately resets number of events before _next_ resume as well.
-  public void setReturnFrequency(int events)
-  {
-    if(events<1) events=1;
-    frequency=eventcounter=events;
-  }
-  
-  //
-  // ContentHandler methods
-  // These  pass the data to our client ContentHandler...
-  // but they also count the number of events passing through,
-  // and resume our coroutine each time that counter hits zero and
-  // is reset.
-  //
-  // Note that for everything except endDocument, we do the count-and-yield
-  // BEFORE passing the call along. I'm hoping that this will encourage JIT
-  // compilers to realize that these are tail-calls, reducing the expense of
-  // the additional layer of data flow.
-  //
-  // %REVIEW% Glenn suggests that pausing after endElement, endDocument,
-  // and characters may be sufficient. I actually may not want to
-  // stop after characters, since in our application these wind up being
-  // concatenated before they're processed... but that risks huge blocks of
-  // text causing greater than usual readahead. (Unlikely? Consider the
-  // possibility of a large base-64 block in a SOAP stream.)
-  //
-  public void characters(char[] ch, int start, int length)
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.characters(ch,start,length);
-  }
-  public void endDocument() 
-       throws org.xml.sax.SAXException
-  {
-    // EXCEPTION: In this case we need to run the event BEFORE we yield.
-    if(clientContentHandler!=null)
-      clientContentHandler.endDocument();
-
-    eventcounter=0;	
-    co_yield(false);
-  }
-  public void endElement(java.lang.String namespaceURI, java.lang.String localName,
-      java.lang.String qName) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.endElement(namespaceURI,localName,qName);
-  }
-  public void endPrefixMapping(java.lang.String prefix) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.endPrefixMapping(prefix);
-  }
-  public void ignorableWhitespace(char[] ch, int start, int length) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.ignorableWhitespace(ch,start,length);
-  }
-  public void processingInstruction(java.lang.String target, java.lang.String data) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.processingInstruction(target,data);
-  }
-  public void setDocumentLocator(Locator locator) 
-  {
-    if(--eventcounter<=0)
-      {
-        // This can cause a hang.  -sb
-        // co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.setDocumentLocator(locator);
-  }
-  public void skippedEntity(java.lang.String name) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.skippedEntity(name);
-  }
-  public void startDocument() 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.startDocument();
-  }
-  public void startElement(java.lang.String namespaceURI, java.lang.String localName,
-      java.lang.String qName, Attributes atts) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.startElement(namespaceURI, localName, qName, atts);
-  }
-  public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.startPrefixMapping(prefix,uri);
-  }
-
-  //
-  // LexicalHandler support. Not all SAX2 parsers support these events
-  // but we may want to pass them through when they exist...
-  //
-  // %REVIEW% These do NOT currently affect the eventcounter; I'm asserting
-  // that they're rare enough that it makes little or no sense to
-  // pause after them. As such, it may make more sense for folks who
-  // actually want to use them to register directly with the parser.
-  // But I want 'em here for now, to remind us to recheck this assertion!
-  //
-  public void comment(char[] ch, int start, int length) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.comment(ch,start,length);
-  }
-  public void endCDATA() 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.endCDATA();
-  }
-  public void endDTD() 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.endDTD();
-  }
-  public void endEntity(java.lang.String name) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.endEntity(name);
-  }
-  public void startCDATA() 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.startCDATA();
-  }
-  public void startDTD(java.lang.String name, java.lang.String publicId,
-      java.lang.String systemId) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler. startDTD(name, publicId, systemId);
-  }
-  public void startEntity(java.lang.String name) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.startEntity(name);
-  }
-
-  //
-  // ErrorHandler support.
-  //
-  // PROBLEM: Xerces is apparently _not_ calling the ErrorHandler for
-  // exceptions thrown by the ContentHandler, which prevents us from
-  // handling this properly when running in filtering mode with Xerces
-  // as our event source.  It's unclear whether this is a Xerces bug
-  // or a SAX design flaw.
-  // 
-  // %REVIEW% Current solution: In filtering mode, it is REQUIRED that
-  // event source make sure this method is invoked if the event stream
-  // abends before endDocument is delivered. If that means explicitly calling
-  // us in the exception handling code because it won't be delivered as part
-  // of the normal SAX ErrorHandler stream, that's fine; Not Our Problem.
-  //
-  public void error(SAXParseException exception) throws SAXException
-  {
-    if(null!=clientErrorHandler)
-      clientErrorHandler.error(exception);
-  }
-  
-  public void fatalError(SAXParseException exception) throws SAXException
-  {
-    // When we're in filtering mode we need to make sure that
-    // we terminate the parsing coroutine transaction -- announce
-    // the problem and shut down the dialog.
-
-    // PROBLEM: Xerces is apparently _not_ calling the ErrorHandler for
-    // exceptions thrown by the ContentHandler... specifically, doTerminate.
-    // %TBD% NEED A SOLUTION!
-    
-    if(!fRunningInThread)
-      {
-        try
-          {
-            fCoroutineManager.co_exit_to(exception,
-                                         fParserCoroutineID,fAppCoroutineID);
-            // %TBD% Do we need to wait for terminate?
-          }
-        catch(NoSuchMethodException e)
-          {
-            // Shouldn't happen unless we've miscoded our coroutine logic
-            // "Shut down the garbage smashers on the detention level!"
-            e.printStackTrace(System.err);
-            fCoroutineManager.co_exit(fParserCoroutineID);
-
-            // No need to throw shutdownException; we're already
-            // in the process of murdering the parser.
-          }
-      }
-
-    if(null!=clientErrorHandler)
-      clientErrorHandler.error(exception);
-  }
-  
-  public void warning(SAXParseException exception) throws SAXException
-  {
-    if(null!=clientErrorHandler)
-      clientErrorHandler.error(exception);
-  }
-  
-
-  //
-  // coroutine support
-  //
-
-  public int getParserCoroutineID() {
-    return fParserCoroutineID;
-  }
-
-  /** @return the CoroutineManager this CoroutineParser object is bound to.
-   * If you're using the do...() methods, applications should only
-   * need to talk to the CoroutineManager once, to obtain the
-   * application's Coroutine ID.
-   * */
-  public CoroutineManager getCoroutineManager()
-  {
-    return fCoroutineManager;
-  }
-
-  /** <p>In the SAX delegation code, I've inlined the count-down in
-   * the hope of encouraging compilers to deliver better
-   * performance. However, if we subclass (eg to directly connect the
-   * output to a DTM builder), that would require calling super in
-   * order to run that logic... which seems inelegant.  Hence this
-   * routine for the convenience of subclasses: every [frequency]
-   * invocations, issue a co_yield.</p>
-   *
-   * @param moreExepcted Should always be true unless this is being called
-   * at the end of endDocument() handling.
-   * */
-  void count_and_yield(boolean moreExpected)
-  {
-    if(!moreExpected) eventcounter=0;
-    
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-  }
-  
-
-  /**
-   * Co_Yield handles coroutine interactions while a parse is in progress.
-   * It will resume with 
-   *   co_resume(Boolean.TRUE, ...) on success with more to parse.
-   *   co_resume(Boolean.FALSE, ...) on success after endDocument.
-   *
-   * When control is passed back it may indicate
-   *
-   *      null            terminate this coroutine.
-   *                      Issues
-   *                          co_exit_to(null, ...)
-   *			  and throws UserRequestedShutdownException
-   *
-   *      Boolean.TRUE    indication to continue parsing the current document.
-   *			  Resumes normal SAX parsing.
-   *
-   *      Boolean.FALSE   indication to discontinue parsing and reset.
-   *			  Throws UserRequestedStopException
-   *			  to return control to the run() loop.
-   */
-  private void co_yield(boolean moreRemains)
-  {
-    // Horrendous kluge to run filter to completion. See below.
-    if(fNeverYieldAgain)
-      return;
-    
-    Object arg= moreRemains ? Boolean.TRUE : Boolean.FALSE;
-    
-    // %REVIEW% End-of-file behavior. When moreRemains==false, we have
-    // just ended parsing the document and are about to return
-    // from the parser.
-    //
-    // If we were invoked from the run() loop, we have to provide
-    // the coroutine argument returned above as the next command
-    // to be processed in that loop.
-    //
-    // Conversely, if we've been running in response to
-    // fXMLReader.parse() invoked directly, we will not be returning
-    // to that loop. In that case, the question becomes one of what we
-    // should do instead. The simplest answer would seem to be to do a
-    // co_exit_to immediately, since we don't have a command loop to
-    // continue to talk to.
-    if(!moreRemains)
-      {
-        if(fRunningInThread)
-          {
-            // Just return. The command loop in run() will send the
-            // "we're done" announcement and request the next command.
-            return; // let the parser terminate itself
-          }
-          
-        else try 
-          {
-            // Forced Termination dialog. Say we're done, wait for a
-            // termination request (don't accept anything else), and
-            // shut down.
-            arg = fCoroutineManager.co_resume(Boolean.FALSE, fParserCoroutineID,
-                                              fAppCoroutineID);
-            while(arg!=null)
-              {
-                // %REVIEW% On short documents, our timing-window fix may mean
-                // arg is actually TRUE (waiting for nodes). In that case
-                // we want to return FALSE (parsing complete). If we get TRUE
-                // at any other time, it's a dialog error, but I don't want
-                // to deal with inventing yet another value right now.
-                // RIGHT FIX will be to redesign the whole coroutine
-                // communications protocol.
-                if(arg==Boolean.TRUE)
-                {
-                  arg=Boolean.FALSE;
-                }
-                else
-                {
-                  System.err.println(
-                    "Filtering CoroutineSAXParser: unexpected resume parameter, "
-                    +arg.getClass()+" with value=\""+arg+'"');
-                  // If you don't do this, it can loop forever with the above
-                  // error printing out.  -sb
-                  arg = new RuntimeException(
-                    "Filtering CoroutineSAXParser: unexpected resume parameter, "
-                    +arg.getClass()+" with value=\""+arg+'"');
-                }
-                arg = fCoroutineManager.co_resume(arg, fParserCoroutineID,
-                                                  fAppCoroutineID);
-              }
-            
-            fCoroutineManager.co_exit_to(arg, fParserCoroutineID, fAppCoroutineID);
-            return; // let the parser return
-          }
-        catch(java.lang.NoSuchMethodException e)
-          {
-            // Shouldn't happen unless we've miscoded our coroutine logic
-            // "Shut down the garbage smashers on the detention level!"
-            e.printStackTrace(System.err);
-            fCoroutineManager.co_exit(fParserCoroutineID);
-            throw shutdownException;
-          }
-      } // if moreRemains
-
-
-    else try
-      {
-        arg = fCoroutineManager.co_resume(arg, fParserCoroutineID, fAppCoroutineID);
-
-        // %REVIEW% I'm really not happy with the following:
-        //
-        // If we're running in filter mode, driven by an external SAX
-        // event source, and have been been yielded back to with
-        // Boolean.FALSE (doMore(false)) there are two additional
-        // problems.
-        // 
-        // First: Scott tells me that our technique of throwing an
-        // exception from the ContentHandler to terminate SAX parsing,
-        // while almost a universal practice in the SAX community, is not
-        // acceptable because we can't force this contract upon the event
-        // generator. (Though he feels we _can_ force them to accept a
-        // contract to explicitly send us a fatalError event if parsing
-        // terminates due to some other SAXException... basically, it's
-        // the old "this is a normal condition so it shouldn't be an
-        // exception" rationalle, which has some validity to it.)
-        // Instead, and despite the wasted cycles, he wants me to simply
-        // let the event stream run to completion without passing the
-        // events along to our own client. That requires disabling
-        // co_yeild() as well. IF AND WHEN SAX ADDS AN OFFICIAL
-        // STOP-PARSING-EARLY OPERATION, we can leverage that.
-        //
-        // Second: The current architecture of CoroutineSAXParser's
-        // coroutine transactions assumes that doMore(false) will be
-        // followed by either doParse(newInputSource), or
-        // doTerminate(). We must complete that coroutine dialog.
-        // 
-        // "Black magic is a matter of symbolism and intent."
-        // -- Randall Garrett
-        //
-        // %TBD% We _MUST_ get away from this architecture and switch
-        // to CoroutineSAXFilter, just so we don't have to go through
-        // this "no, I don't want another file, thank you very much"
-        // transaction. In our application we should never need it,
-        // and the only justification for running the parse within a
-        // coroutine request -- capturing SAXExceptions -- could be
-        // handled per the above discussion.
-        // 
-        if(!fRunningInThread && arg==Boolean.FALSE)
-          {
-            clientContentHandler=null;
-            clientLexicalHandler=null;
-            // Anyone else?
-        
-            fNeverYieldAgain=true; // Horrendous kluge parsing to completion:
-
-            // Forced Termination dialog. Say we're done, wait for a
-            // termination request (don't accept anything else), and
-            // shut down.
-            arg = fCoroutineManager.co_resume(Boolean.FALSE, fParserCoroutineID,
-                                              fAppCoroutineID);
-            while(arg!=null)
-              {
-                String msg="Filtering CoroutineSAXParser: "+
-                  "unexpected resume parameter, "+
-                  arg.getClass()+" with value=\""+arg+'"';
-                System.err.println(msg);
-                // If you don't do this, it can loop forever with the above
-                // error printing out.  -sb
-                arg = new RuntimeException(msg);
-                arg = fCoroutineManager.co_resume(arg, fParserCoroutineID,
-                                                  fAppCoroutineID);
-              }
-            
-            fCoroutineManager.co_exit_to(arg, fParserCoroutineID, fAppCoroutineID);
-            return; // let the parser run to completion and return
-          }
-
-        if (arg == null) {
-          fCoroutineManager.co_exit_to(arg, fParserCoroutineID, fAppCoroutineID);
-          // %REVIEW% For some reason the (arg == null) condition is occuring.
-          // You can replicate this sometimes with:
-          // testo attribset\attribset01 -flavor th -edump
-          // Or with Crimson running, output\output01.
-          throw new UserRequestedShutdownException();
-          // throw shutdownException;
-        }
-
-        else if (arg instanceof Boolean) {
-          boolean keepgoing = ((Boolean)arg).booleanValue();
-          if (!keepgoing)
-            throw stopException;
-          }
-
-        else // Unexpected!
-          {
-            System.err.println(
-                  "Active CoroutineSAXParser: unexpected resume parameter, "
-                  +arg.getClass
-                  ()+" with value=\""+arg+'"');
-            System.err.println("\tStopping parser rather than risk deadlock");
-            throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_COROUTINE_PARAM, new Object[]{arg})); //"Coroutine parameter error ("+arg+')');
-          }
-
-      }
-    catch(java.lang.NoSuchMethodException e)
-      {
-        // Shouldn't happen unless we've miscoded our coroutine logic
-        // "Shut down the garbage smashers on the detention level!"
-        e.printStackTrace(System.err);
-        fCoroutineManager.co_exit(fParserCoroutineID);
-        throw new UserRequestedShutdownException();
-        // throw shutdownException;
-      }
-  }
-
-
-  /** Between parser executions, wait for our partner to resume us and
-   * tell us what to do:
-   *
-   *      null            terminate this coroutine.
-   *                      exits with:
-   *                          co_exit_to(null, ...)
-   *                      expects next:
-   *                          nothing, we have terminated the thread.
-   *
-   *      InputSource     setup to read from this source.
-   *                      resumes with:
-   *                          co_resume(Boolean.TRUE, ...) on partial parse
-   *                          co_resume(Boolean.FALSE, ...) on complete parse
-   *                          co_resume(Exception, ...) on error.
-   *
-   * %REVEIW% Should this be able to set listeners? Partner coroutine ID?
-   * */
-  public void run() {
-    try 
-      {
-        for(Object arg=fCoroutineManager.co_entry_pause(fParserCoroutineID);
-            true;
-            arg=fCoroutineManager.co_resume(arg, fParserCoroutineID, fAppCoroutineID))
-          {
-            
-            // Shut down requested.
-            if (arg == null) {
-              if(DEBUG)System.out.println("CoroutineSAXParser at-rest shutdown requested");
-              fCoroutineManager.co_exit_to(arg, fParserCoroutineID, fAppCoroutineID);
-              break;
-            }
-            
-            // Start-Parse requested
-            // For the duration of this operation, all coroutine handshaking
-            // will occur in the co_yield method. That's the nice thing about
-            // coroutines; they give us a way to hand off control from the
-            // middle of a synchronous method.
-            if (arg instanceof InputSource) {
-              try {
-              if(DEBUG)System.out.println("Inactive CoroutineSAXParser new parse "+arg);
-                fXMLReader.parse((InputSource)arg);
-                // Tell caller we returned from parsing
-                arg=Boolean.FALSE;
-              }
-
-              catch (SAXException ex) {
-                Exception inner=ex.getException();
-                if(inner instanceof UserRequestedStopException){
-                  if(DEBUG)System.out.println("Active CoroutineSAXParser user stop exception");
-                  arg=Boolean.FALSE;
-                }
-                else if(inner instanceof UserRequestedShutdownException){
-                  if(DEBUG)System.out.println("Active CoroutineSAXParser user shutdown exception");
-                  break;
-                }
-                else {
-                  if(DEBUG)System.out.println("Active CoroutineSAXParser UNEXPECTED SAX exception: "+ex);
-                  arg=ex;		  
-                }
-                
-              }
-              catch(Exception ex)
-                {
-                  if(DEBUG)System.out.println("Active CoroutineSAXParser non-SAX exception: "+ex);
-                  arg = ex;
-                }
-              
-            }
-
-            else // Unexpected!
-              {
-                System.err.println(
-                  "Inactive CoroutineSAXParser: unexpected resume parameter, "
-                  +arg.getClass()+" with value=\""+arg+'"');
-                  
-                // If you don't do this, it can loop forever with the above
-                // error printing out.  -sb
-                arg = new RuntimeException(
-                  "Inactive CoroutineSAXParser: unexpected resume parameter, "
-                  +arg.getClass()+" with value=\""+arg+'"');
-              }
-
-          } // end while
-      } // end try
-    catch(java.lang.NoSuchMethodException e)
-      {
-        // Shouldn't happen unless we've miscoded our coroutine logic
-        // "CPO, shut down the garbage smashers on the detention level!"
-        e.printStackTrace(System.err);
-        fCoroutineManager.co_exit(fParserCoroutineID);
-      }
-  }
-
-  /** Used so co_yield can return control to run for early parse
-   * termination.  */
-  class UserRequestedStopException extends RuntimeException
-  {
-  }
-  
-  /** %REVIEW% Should be static, but can't be because internal class */
-  final UserRequestedStopException stopException=new UserRequestedStopException();
-
-  /** Used so co_yield can return control to run for coroutine thread
-   * termination.  */
-  class UserRequestedShutdownException extends RuntimeException
-  {
-  }
-
-  /** %REVIEW% Should be static, but can't be because internal class */
-  final UserRequestedShutdownException shutdownException = new UserRequestedShutdownException();
-
-  //================================================================
-  /** doParse() is a simple API which tells the coroutine parser
-   * to begin reading from a file.  This is intended to be called from one
-   * of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * %REVIEW%: If we are NOT running in a thread (if we bound to an
-   * externally invoked XMLReader), this operation is a no-op. I don't
-   * _think_ it can safely synchronously invoke that reader's parse()
-   * operation, or doMore(), which would be the obvious alternatives....
-   *
-   * %REVIEW% Can/should this unify with doMore? (if URI hasn't changed,
-   * parse more from same file, else end and restart parsing...?
-   *
-   * @param source The InputSource to parse from.
-   * @param appCoroutineID The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object doParse(InputSource source, int appCoroutineID)
-  {
-    // %REVIEW% I'm not wild about this solution...
-    if(!fRunningInThread)
-      return Boolean.TRUE; // "Yes, we expect to deliver events."
-
-    try 
-      {
-        Object result=    
-          fCoroutineManager.co_resume(source, appCoroutineID, fParserCoroutineID);
-        
-        // %REVIEW% Better error reporting needed... though most of these
-        // should never arise during normal operation.
-        // Should this rethrow the parse exception?
-        if (result instanceof Exception) {
-          if(result instanceof SAXException)
-          {
-            SAXException se = (SAXException)result;
-            Exception e = se.getException();
-            if(null != e)
-            {
-              e.printStackTrace();
-            }
-            else
-            {
-              System.out.println("\nParser threw exception:");
-              se.printStackTrace();
-            }
-          }
-          else
-          {
-            System.out.println("\nParser threw exception:");
-            ((Exception)result).printStackTrace();
-          }
-        }
-
-        return result;
-      }
-
-    // SHOULD NEVER OCCUR, since the coroutine number and coroutine manager
-    // are those previously established for this CoroutineSAXParser...
-    // So I'm just going to return it as a parsing exception, for now.
-    catch(NoSuchMethodException e)
-      {
-        return e;
-      }
-  }
-  
-  
-  /** doMore() is a simple API which tells the coroutine parser
-   * that we need more nodes.  This is intended to be called from one
-   * of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * @param parsemore If true, tells the incremental parser to generate
-   * another chunk of output. If false, tells the parser that we're
-   * satisfied and it can terminate parsing of this document.
-   * @param appCoroutineID The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object doMore(boolean parsemore, int appCoroutineID)
-  {
-    try 
-      {
-        Object result =
-          fCoroutineManager.co_resume(parsemore?Boolean.TRUE:Boolean.FALSE,
-                                      appCoroutineID, fParserCoroutineID);
-        
-        // %REVIEW% Better error reporting needed
-        if (result == null)
-          {
-            System.out.println("\nUNEXPECTED: Parser doMore says shut down prematurely.\n");
-          }
-        else if (result instanceof Exception) {
-          System.out.println("\nParser threw exception:");
-          ((Exception)result).printStackTrace();
-        }
-        
-        return result;
-      }
-  
-    // SHOULD NEVER OCCUR, since the coroutine number and coroutine manager
-    // are those previously established for this CoroutineSAXParser...
-    // So I'm just going to return it as a parsing exception, for now.
-    catch(NoSuchMethodException e)
-      {
-        return e;
-      }
-  }
-  
-  
-  /** doTerminate() is a simple API which tells the coroutine
-   * parser to terminate itself.  This is intended to be called from
-   * one of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * Returns only after the CoroutineParser has acknowledged the request.
-   *
-   * @param appCoroutineID The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * */
-  public void doTerminate(int appCoroutineID)
-  {
-    try
-      {
-        Object result=Boolean.FALSE; // Dummy initial value
-
-        // Timing problem diagnostic/force-to-completion code; better to fix the problem.
-        //while(result!=null)
-          result = fCoroutineManager.co_resume(null, appCoroutineID, fParserCoroutineID);
-
-        // Debugging; shouldn't arise in normal operation
-        if(result!=null)
-        {
-          RuntimeException re = new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_PARSER_DOTERMINATE_ANSWERS, new Object[]{result})); //"\nUNEXPECTED: Parser doTerminate answers "+result);
-          // System.out.println("\nUNEXPECTED: Parser doTerminate answers "+result);
-          re.printStackTrace();
-          // throw re;
-        }
-      }
-    catch(java.lang.NoSuchMethodException e)
-      {
-        // That's OK; if it doesn't exist, we don't need to terminate it
-      }
-  }
-
-//  //================================================================
-//  /** Simple unit test. Attempt coroutine parsing of document indicated
-//   * by first argument (as a URI), report progress.
-//   */
-//  public static void main(String args[])
-//  {
-//    System.out.println("Starting...");
-//
-//    org.xml.sax.XMLReader theSAXParser=
-//      new org.apache.xerces.parsers.SAXParser();
-//    
-//    CoroutineManager co = new CoroutineManager();
-//    int appCoroutineID = co.co_joinCoroutineSet(-1);
-//    if (appCoroutineID == -1)
-//      {
-//        System.out.println("ERROR: Couldn't allocate coroutine number.\n");
-//        return;
-//      }
-//    CoroutineSAXParser parser=
-//      new CoroutineSAXParser(co, appCoroutineID, theSAXParser);
-//    int parserCoroutineID = parser.getParserCoroutineID();
-//
-//    // Use a serializer as our sample output
-//    org.apache.xml.serialize.XMLSerializer trace;
-//    trace=new org.apache.xml.serialize.XMLSerializer(System.out,null);
-//    parser.setContentHandler(trace);
-//    parser.setLexHandler(trace);
-//
-//    // Tell coroutine to begin parsing, run while parsing is in progress
-//    for(int arg=0;arg<args.length;++arg)
-//      {
-//        InputSource source = new InputSource(args[arg]);
-//        Object result=null;
-//        boolean more=true;
-//        for(result = parser.doParse(source, appCoroutineID);
-//            (result instanceof Boolean && ((Boolean)result)==Boolean.TRUE);
-//            result = parser.doMore(more, appCoroutineID))
-//          {
-//            System.out.println("\nSome parsing successful, trying more.\n");
-//            
-//            // Special test: Terminate parsing early.
-//            if(arg+1<args.length && "!".equals(args[arg+1]))
-//              {
-//                ++arg;
-//                more=false;
-//              }
-//            
-//          }
-//        
-//        if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
-//          {
-//            System.out.println("\nParser ended (EOF or on request).\n");
-//          }
-//        else if (result == null) {
-//          System.out.println("\nUNEXPECTED: Parser says shut down prematurely.\n");
-//        }
-//        else if (result instanceof Exception) {
-//          System.out.println("\nParser threw exception:");
-//          ((Exception)result).printStackTrace();
-//        }
-//        
-//      }
-//
-//    parser.doTerminate(appCoroutineID);
-//  }
-  
-} // class CoroutineSAXParser
diff --git a/src/org/apache/xml/dtm/ref/CoroutineSAXParser_Xerces.java b/src/org/apache/xml/dtm/ref/CoroutineSAXParser_Xerces.java
deleted file mode 100644
index c52f3ea..0000000
--- a/src/org/apache/xml/dtm/ref/CoroutineSAXParser_Xerces.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-//package org.apache.xerces.parsers;
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import java.io.IOException;
-//import org.apache.xml.dtm.CoroutineManager;
-import org.apache.xerces.parsers.SAXParser;
-import org.xml.sax.XMLReader;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/** <p>CoroutineSAXParser_Xerces takes advantage of the fact that Xerces
- * incremental mode is already a coroutine of sorts, and just wraps our
- * CoroutineParser API around it.</p>
- *
- * NOTE that this requires access to a few features which are not yet
- * part of the public Xerces API. Glenn solved that by making this class
- * a subclass of xerces.parsers.SAXParser. A better solution may be to
- * make a separate subclass thereof which exposes the relevant methods as
- * public -- both because it provides more explicit control over what
- * is and isn't exposed, and because it holds out the hope of dropping that
- * subclass and plugging in a normal instance of Xerces if/when these methods
- * become official API calls.
- *
- * <p>Usage example: See main().</p>
- *
- * @deprecated Since the ability to start a parse via the
- * coroutine protocol was not being used and was complicating design.
- * See {@link IncrementalSAXSource_Xerces}.
- * */
-public class CoroutineSAXParser_Xerces
-// extends org.apache.xerces.parsers.SAXParser
-implements CoroutineParser
-{
-  // IncrementalXercesSaxParser incrementalParser;
-  SAXParser incrementalParser;
-
-    //
-    // Data
-    //
-
-    private boolean fParseInProgress=false;
-
-    //
-    // Constructors
-    //
-    public CoroutineSAXParser_Xerces() {
-    }
-    
-    public CoroutineSAXParser_Xerces(CoroutineManager co, int appCoroutineID) {
-      this.init( co,appCoroutineID, null);
-    }
-
-    // XXX the parameter order is confusing, different from CoroutineSAXParser
-    public CoroutineSAXParser_Xerces(SAXParser ixsp, CoroutineManager co, int appCoroutineID) {
-      this.init( co, appCoroutineID, ixsp); 
-    }
-
-    public void init( CoroutineManager co, int appCoroutineID, XMLReader ixsp ) {
-      if(ixsp!=null)
-        incrementalParser=(SAXParser)ixsp;
-      else
-        incrementalParser=new SAXParser();
-      
-      // incrementalParser.initHandlers(true, incrementalParser, incrementalParser);
-    }
-    
-    //
-    // Factories
-    //
-    static public CoroutineParser createCoroutineParser(CoroutineManager co, int appCoroutineID) {
-      return new CoroutineSAXParser_Xerces(co, appCoroutineID);
-    }
-
-    //
-    // Public methods
-    //
-
-    // coroutine support
-
-    public int getParserCoroutineID() {
-      // return fParserCoroutineID;
-      return -1;
-    }
-
-  /** @return the CoroutineManager this CoroutineParser object is bound to.
-   * If you're using the do...() methods, applications should only
-   * need to talk to the CoroutineManager once, to obtain the
-   * application's Coroutine ID.
-   * */
-  public CoroutineManager getCoroutineManager()
-  {
-    // return fCoroutineManager;
-    return null;
-  }
-
-  // Register handler directly with the incremental parser
-  public void setContentHandler(org.xml.sax.ContentHandler handler)
-  {
-    incrementalParser.setContentHandler(handler);
-  }
-
-  // Note name, needed to dodge the inherited Xerces setLexicalHandler
-  // which isn't public.
-  public void setLexHandler(org.xml.sax.ext.LexicalHandler handler)
-  {
-    // Not supported by all SAX2 parsers but should work in Xerces:
-    try 
-      {
-        incrementalParser.setProperty("http://xml.org/sax/properties/lexical-handler",
-                    handler);
-      }
-    catch(org.xml.sax.SAXNotRecognizedException e)
-      {
-        // Nothing we can do about it
-      }
-    catch(org.xml.sax.SAXNotSupportedException e)
-      {
-        // Nothing we can do about it
-      }
-  }
-  
-  //================================================================
-  /** doParse() is a simple API which tells the coroutine parser
-   * to begin reading from a file.  This is intended to be called from one
-   * of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * %REVIEW% Can/should this unify with doMore? (if URI hasn't changed,
-   * parse more from same file, else end and restart parsing...?
-   *
-   * @param source The InputSource to parse from.
-   * @param appCoroutineID The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object doParse(InputSource source, int appCoroutineID)
-  {
-    if (fParseInProgress) {
-      // %review% -- We never set this flag in the previous version of
-      // this class, we still don't set it here... Discard, or fix?
-      return new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_PARSE_CALL_WHILE_PARSING, null)); //"parse may not be called while parsing.");
-    }
-    
-    Object arg;
-    try {
-      boolean ok = incrementalParser.parseSomeSetup(source);
-      arg = ok ? Boolean.TRUE : Boolean.FALSE;
-    }
-    catch (Exception ex) {
-      arg = ex;
-    }
-    return arg;
-  }
-
-  
-  /** doMore() is a simple API which tells the coroutine parser
-   * that we need more nodes.  This is intended to be called from one
-   * of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * @param parsemore If true, tells the incremental parser to generate
-   * another chunk of output. If false, tells the parser that we're
-   * satisfied and it can terminate parsing of this document.
-   * @param appCoroutineID The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object doMore (boolean parsemore, int appCoroutineID)
-  {
-    if(!parsemore)
-      {
-        fParseInProgress=false;
-        return Boolean.FALSE;
-      }
-
-    Object arg;
-    try {
-      boolean keepgoing = incrementalParser.parseSome();
-      arg = keepgoing ? Boolean.TRUE : Boolean.FALSE;
-    } catch (SAXException ex) {
-      arg = ex;
-    } catch (IOException ex) {
-      arg = ex;
-    } catch (Exception ex) {
-      arg = new SAXException(ex);
-    }
-    return arg;
-  }
-  
-  /** doTerminate() is a simple API which tells the coroutine
-   * parser to terminate itself.  This is intended to be called from
-   * one of our partner coroutines, and serves both to encapsulate the
-   * communication protocol and to avoid having to explicitly use the
-   * CoroutineParser's coroutine ID number.
-   *
-   * Returns only after the CoroutineParser has acknowledged the request.
-   *
-   * @param appCoroutineID The coroutine ID number of the coroutine invoking
-   * this method, so it can be resumed after the parser has responded to the
-   * request.
-   * */
-  public void doTerminate(int appCoroutineID)
-  {
-    // No-op in IncrementalXerces?
-
-    // Could release some data structures to promote garbage collection...
-    incrementalParser=null;
-  }
-
-  //================================================================
-  /** Simple unit test. Attempt coroutine parsing of document indicated
-   * by first argument (as a URI), report progress.
-   */
-  public static void main(String args[])
-  {
-    System.out.println("Starting...");
-
-    CoroutineManager co = new CoroutineManager();
-    int appCoroutineID = co.co_joinCoroutineSet(-1);
-    if (appCoroutineID == -1)
-      {
-        System.out.println("ERROR: Couldn't allocate coroutine number.\n");
-        return;
-      }
-    CoroutineSAXParser_Xerces parser=
-      new CoroutineSAXParser_Xerces(co, appCoroutineID);
-    int parserCoroutineID = parser.getParserCoroutineID();
-
-    // Use a serializer as our sample output
-    org.apache.xml.serialize.XMLSerializer trace;
-    trace=new org.apache.xml.serialize.XMLSerializer(System.out,null);
-    parser.setContentHandler(trace);
-    parser.setLexHandler(trace);
-
-    // Tell coroutine to begin parsing, run while parsing is in progress
-    for(int arg=0;arg<args.length;++arg)
-      {
-        InputSource source = new InputSource(args[arg]);
-        Object result=null;
-        boolean more=true;
-        /**    
-          for(result = co.co_resume(source, appCoroutineID, parserCoroutineID);
-          (result instanceof Boolean && ((Boolean)result)==Boolean.TRUE);
-          result = co.co_resume(more, appCoroutineID, parserCoroutineID))
-          **/
-        for(result = parser.doParse(source, appCoroutineID);
-            (result instanceof Boolean && ((Boolean)result)==Boolean.TRUE);
-            result = parser.doMore(more, appCoroutineID))
-          {
-            System.out.println("\nSome parsing successful, trying more.\n");
-            
-            // Special test: Terminate parsing early.
-            if(arg+1<args.length && "!".equals(args[arg+1]))
-              {
-                ++arg;
-                more=false;
-              }
-            
-          }
-        
-        if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
-          {
-            System.out.println("\nParser ended (EOF or on request).\n");
-          }
-        else if (result == null) {
-          System.out.println("\nUNEXPECTED: Parser says shut down prematurely.\n");
-        }
-        else if (result instanceof Exception) {
-          throw new org.apache.xml.utils.WrappedRuntimeException((Exception)result);
-//          System.out.println("\nParser threw exception:");
-//          ((Exception)result).printStackTrace();
-        }
-        
-      }
-
-    parser.doTerminate(appCoroutineID);
-  }
-  
-} // class CoroutineSAXParser
diff --git a/src/org/apache/xml/dtm/ref/CustomStringPool.java b/src/org/apache/xml/dtm/ref/CustomStringPool.java
deleted file mode 100644
index 920b9ed..0000000
--- a/src/org/apache/xml/dtm/ref/CustomStringPool.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-import java.util.Vector;
-import java.util.Hashtable;
-
-/** <p>CustomStringPool is an example of appliction provided data structure
- * for a DTM implementation to hold symbol references, e.g. elelment names.
- * It will follow the DTMDStringPool interface and use two simple methods
- * indexToString(int i) and stringToIndex(Sring s) to map between a set of
- * string values and a set of integer index values.  Therefore, an application
- * may improve DTM processing speed by substituting the DTM symbol resolution
- * tables with application specific quick symbol resolution tables.</p>
- *
- * %REVIEW% The only difference between this an DTMStringPool seems to be that
- * it uses a java.lang.Hashtable full of Integers rather than implementing its
- * own hashing. Joe deliberately avoided that approach when writing
- * DTMStringPool, since it is both much more memory-hungry and probably slower
- * -- especially in JDK 1.1.x, where Hashtable is synchronized. We need to
- * either justify this implementation or discard it.
- *
- * <p>Status: In progress, under discussion.</p>
- * */
-public class CustomStringPool extends DTMStringPool {
-        //final Vector m_intToString;
-        //static final int HASHPRIME=101;
-        //int[] m_hashStart=new int[HASHPRIME];
-        final Hashtable m_stringToInt = new Hashtable();
-        public static final int NULL=-1;
-
-        public CustomStringPool()
-        {
-                super();
-                /*m_intToString=new Vector();
-                System.out.println("In constructor m_intToString is " + 
-                                                                                         ((null == m_intToString) ? "null" : "not null"));*/
-                //m_stringToInt=new Hashtable();
-                //removeAllElements();
-        }
-
-        public void removeAllElements()
-        {
-                m_intToString.removeAllElements();
-                if (m_stringToInt != null) 
-                        m_stringToInt.clear();
-        }
-
-        /** @return string whose value is uniquely identified by this integer index.
-         * @throws java.lang.ArrayIndexOutOfBoundsException
-         *  if index doesn't map to a string.
-         * */
-        public String indexToString(int i)
-        throws java.lang.ArrayIndexOutOfBoundsException
-        {
-                return(String) m_intToString.elementAt(i);
-        }
-
-        /** @return integer index uniquely identifying the value of this string. */
-        public int stringToIndex(String s)
-        {
-                if (s==null) return NULL;
-                Integer iobj=(Integer)m_stringToInt.get(s);
-                if (iobj==null) {
-                        m_intToString.addElement(s);
-                        iobj=new Integer(m_intToString.size());
-                        m_stringToInt.put(s,iobj);
-                }
-                return iobj.intValue();
-        }
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java b/src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
deleted file mode 100644
index 2d26665..0000000
--- a/src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-
-/**
- * This class serves as a default base for implementations of DTMAxisIterators.
- */
-public abstract class DTMAxisIteratorBase implements DTMAxisIterator
-{
-
-  /** The position of the last node within the iteration, as defined by XPath.
-   * Note that this is _not_ the node's handle within the DTM. Also, don't
-   * confuse it with the current (most recently returned) position.
-   */
-  private int _last = -1;
-
-  /** The position of the current node within the iteration, as defined by XPath.
-   * Note that this is _not_ the node's handle within the DTM!
-   */
-  private int _position = 0;
-
-  /** The position of the marked node within the iteration;
-   * a saved itaration state that we may want to come back to.
-   * Note that only one mark is maintained; there is no stack.
-   */
-  protected int _markedNode;
-
-  /** The handle to the start, or root, of the iteration.
-   * Set this to END to construct an empty iterator.
-   */
-  protected int _startNode = DTMAxisIterator.END;
-
-  /** True if the start node should be considered part of the iteration.
-   * False will cause it to be skipped.
-   */
-  protected boolean _includeSelf = false;
-
-  /** True if this iteration can be restarted. False otherwise (eg, if
-   * we are iterating over a stream that can not be re-scanned, or if
-   * the iterator was produced by cloning another iterator.)
-   */
-  protected boolean _isRestartable = true;
-  
-  /**
-   * Get start to END should 'close' the iterator,
-   * i.e. subsequent call to next() should return END.
-   *
-   * @return The root node of the iteration.
-   */
-  public int getStartNode()
-  {
-    return _startNode;
-  }
-
-  /**
-   * @return A DTMAxisIterator which has been reset to the start node,
-   * which may or may not be the same as this iterator.
-   * */
-  public DTMAxisIterator reset()
-  {
-
-    final boolean temp = _isRestartable;
-
-    _isRestartable = true;
-
-    setStartNode(_startNode);
-
-    _isRestartable = temp;
-
-    return this;
-  }
-
-  /**
-   * Set the flag to include the start node in the iteration. 
-   *
-   *
-   * @return This default method returns just returns this DTMAxisIterator,
-   * after setting the flag.
-   * (Returning "this" permits C++-style chaining of
-   * method calls into a single expression.)
-   */
-  public DTMAxisIterator includeSelf()
-  {
-
-    _includeSelf = true;
-
-    return this;
-  }
-
-  /** Returns the position of the last node within the iteration, as
-   * defined by XPath.  In a forward iterator, I believe this equals the number of nodes which this
-   * iterator will yield. In a reverse iterator, I believe it should return
-   * 1 (since the "last" is the first produced.)
-   *
-   * This may be an expensive operation when called the first time, since
-   * it may have to iterate through a large part of the document to produce
-   * its answer.
-   *
-   * @return The number of nodes in this iterator (forward) or 1 (reverse).
-   */
-  public int getLast()
-  {
-
-    if (_last == -1)		// Not previously established
-    {
-      // Note that we're doing both setMark() -- which saves _currentChild
-      // -- and explicitly saving our position counter (number of nodes
-      // yielded so far).
-      //
-      // %REVIEW% Should position also be saved by setMark()?
-      // (It wasn't in the XSLTC version, but I don't understand why not.)
-
-      final int temp = _position; // Save state
-      setMark();
-
-      reset();			// Count the nodes found by this iterator
-      do
-      {
-        _last++;
-      }
-      while (next() != END);
-
-      gotoMark();		// Restore saved state
-      _position = temp;
-    }
-
-    return _last;
-  }
-
-  /**
-   * @return The position of the current node within the set, as defined by
-   * XPath. Note that this is one-based, not zero-based.
-   */
-  public int getPosition()
-  {
-    return _position == 0 ? 1 : _position;
-  }
-
-  /**
-   * @return true if this iterator has a reversed axis, else false
-   */
-  public boolean isReverse()
-  {
-    return false;
-  }
-
-  /**
-   * Returns a deep copy of this iterator. Cloned iterators may not be
-   * restartable. The iterator being cloned may or may not become
-   * non-restartable as a side effect of this operation.
-   *
-   * @return a deep copy of this iterator.
-   */
-  public DTMAxisIterator cloneIterator()
-  {
-
-    try
-    {
-      final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone();
-
-      // clone._isRestartable = false;
-
-      // return clone.reset();
-      return clone;
-    }
-    catch (CloneNotSupportedException e)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(e);
-    }
-  }
-
-  /**
-   * Do any final cleanup that is required before returning the node that was
-   * passed in, and then return it. The intended use is
-   * <br />
-   * <code>return returnNode(node);</code>
-   *
-   * %REVIEW% If we're calling it purely for side effects, should we really
-   * be bothering with a return value? Something like
-   * <br />
-   * <code> accept(node); return node; </code>
-   * <br />
-   * would probably optimize just about as well and avoid questions
-   * about whether what's returned could ever be different from what's
-   * passed in.
-   *
-   * @param node Node handle which iteration is about to yield.
-   *
-   * @return The node handle passed in.  */
-  protected final int returnNode(final int node)
-  {
-    _position++;
-
-    return node;
-  }
-
-  /**
-   * Reset the position to zero. NOTE that this does not change the iteration
-   * state, only the position number associated with that state.
-   *
-   * %REVIEW% Document when this would be used?
-   *
-   * @return This instance.
-   */
-  protected final DTMAxisIterator resetPosition()
-  {
-
-    _position = 0;
-
-    return this;
-  }
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * 
-   * @return true as a default.
-   */
-  public boolean isDocOrdered()
-  {
-    return true;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return -1;
-  }
-
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMDefaultBase.java b/src/org/apache/xml/dtm/ref/DTMDefaultBase.java
deleted file mode 100644
index 0e40e40..0000000
--- a/src/org/apache/xml/dtm/ref/DTMDefaultBase.java
+++ /dev/null
@@ -1,2039 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-import org.apache.xml.utils.SuballocatedIntVector;
-import org.apache.xml.utils.SuballocatedByteVector;
-import org.apache.xml.utils.IntStack;
-import org.apache.xml.utils.BoolStack;
-import org.apache.xml.utils.StringBufferPool;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-
-import java.util.Vector;
-
-import org.xml.sax.ContentHandler;
-
-import org.apache.xml.utils.NodeVector;
-
-import javax.xml.transform.Source;
-
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.res.XSLTErrorResources;
-
-import java.io.*; // for dumpDTM
-
-/**
- * The <code>DTMDefaultBase</code> class serves as a helper base for DTMs.
- * It sets up structures for navigation and type, while leaving data
- * management and construction to the derived classes.
- */
-public abstract class DTMDefaultBase implements DTM
-{
-  /**
-   * The number of nodes, which is also used to determine the next
-   *  node index.
-   */
-  protected int m_size = 0;
-
-  /** The expanded names, one array element for each node. */
-  protected SuballocatedIntVector m_exptype;
-
-  /** First child values, one array element for each node. */
-  protected SuballocatedIntVector m_firstch;
-
-  /** Next sibling values, one array element for each node. */
-  protected SuballocatedIntVector m_nextsib;
-
-  /** Previous sibling values, one array element for each node. */
-  protected SuballocatedIntVector m_prevsib;
-
-  /** Previous sibling values, one array element for each node. */
-  protected SuballocatedIntVector m_parent;
-
-  /** Experemental.  -sb */
-//  protected boolean m_haveSeenNamespace = false;
-
-  /** Vector of SuballocatedIntVectors of NS decl sets  -jjk */
-  protected Vector m_namespaceDeclSets = null;
-
-  /** SuballocatedIntVector  of elements at which corresponding
-   * namespaceDeclSets were defined -jjk */
-  protected SuballocatedIntVector m_namespaceDeclSetElements = null;
-
-  /**
-   * These hold indexes to elements based on namespace and local name.
-   * The base lookup is the the namespace.  The second lookup is the local
-   * name, and the last array contains the the first free element
-   * at the start, and the list of element handles following.
-   */
-  protected int[][][] m_elemIndexes;
-
-  /** The default initial block size of the node arrays */
-  protected int m_initialblocksize = 512;  // favor small docs.
-
-  /** Size of blocks to allocate */
-  protected int m_blocksize = 2 * 1024;
-
-  /**
-   * The value to use when the information has not been built yet.
-   */
-  protected static final int NOTPROCESSED = DTM.NULL - 1;
-
-  /**
-   * The DTM manager who "owns" this DTM.
-   */
-  protected DTMManager m_mgr;
-
-  /** The document identity, which is OR'd with node indexes to make handles. */
-  protected int m_dtmIdent;
-
-  /** The mask for the identity.
-      %REVIEW% Should this really be set to the _DEFAULT? What if
-      a particular DTM wanted to use another value? */
-  protected final static int m_mask = DTMManager.IDENT_NODE_DEFAULT;
-
-  /** The base URI for this document. */
-  protected String m_documentBaseURI;
-
-  /**
-   * The whitespace filter that enables elements to strip whitespace or not.
-   */
-  protected DTMWSFilter m_wsfilter;
-
-  /** Flag indicating whether to strip whitespace nodes */
-  protected boolean m_shouldStripWS = false;
-
-  /** Stack of flags indicating whether to strip whitespace nodes */
-  protected BoolStack m_shouldStripWhitespaceStack;
-
-  /** The XMLString factory for creating XMLStrings. */
-  protected XMLStringFactory m_xstrf;
-
-  /** The identity of the root node. */
-  public static final int ROOTNODE = 0;
-
-  /**
-   * The table for exandedNameID lookups.  This may or may not be the same
-   * table as is contained in the DTMManagerDefault.
-   */
-  protected ExpandedNameTable m_expandedNameTable;
-
-  /** true if indexing is turned on. */
-  protected boolean m_indexing;
-
-  /**
-   * Construct a DTMDefaultBase object from a DOM node.
-   *
-   * @param mgr The DTMManager who owns this DTM.
-   * @param domSource the DOM source that this DTM will wrap.
-   * @param source The object that is used to specify the construction source.
-   * @param dtmIdentity The DTM identity ID for this DTM.
-   * @param whiteSpaceFilter The white space filter for this DTM, which may
-   *                         be null.
-   * @param xstringfactory The factory to use for creating XMLStrings.
-   * @param doIndexing true if the caller considers it worth it to use
-   *                   indexing schemes.
-   */
-  public DTMDefaultBase(DTMManager mgr, Source source, int dtmIdentity,
-                        DTMWSFilter whiteSpaceFilter,
-                        XMLStringFactory xstringfactory, boolean doIndexing)
-  {
-    if(false == doIndexing)
-    {
-      m_initialblocksize = 8;
-      m_blocksize = 16;
-    }
-
-    m_exptype = new SuballocatedIntVector(m_initialblocksize);
-    m_firstch = new SuballocatedIntVector(m_initialblocksize);
-    m_nextsib = new SuballocatedIntVector(m_initialblocksize);
-    m_prevsib = new SuballocatedIntVector(m_initialblocksize);
-    m_parent = new SuballocatedIntVector(m_initialblocksize);
-
-    m_mgr = mgr;
-    m_documentBaseURI = (null != source) ? source.getSystemId() : null;
-    m_dtmIdent = dtmIdentity;
-    // m_mask = mgr.getNodeIdentityMask();
-    m_wsfilter = whiteSpaceFilter;
-    m_xstrf = xstringfactory;
-    m_indexing = doIndexing;
-
-    if (doIndexing)
-    {
-      m_expandedNameTable = new ExpandedNameTable();
-    }
-    else
-    {
-
-      // %REVIEW% Is there a better way to do this?
-      DTMManagerDefault dmd = (DTMManagerDefault) m_mgr;
-
-      m_expandedNameTable = dmd.getExpandedNameTable(this);
-    }
-
-    if (null != whiteSpaceFilter)
-    {
-      m_shouldStripWhitespaceStack = new BoolStack();
-
-      pushShouldStripWhitespace(false);
-    }
-  }
-
-  /**
-   * Ensure that the size of the element indexes can hold the information.
-   *
-   * @param namespaceID Namespace ID index.
-   * @param LocalNameID Local name ID.
-   */
-  protected void ensureSizeOfIndex(int namespaceID, int LocalNameID)
-  {
-
-    if (null == m_elemIndexes)
-    {
-      m_elemIndexes = new int[namespaceID + 20][][];
-    }
-    else if (m_elemIndexes.length <= namespaceID)
-    {
-      int[][][] indexes = m_elemIndexes;
-
-      m_elemIndexes = new int[namespaceID + 20][][];
-
-      System.arraycopy(indexes, 0, m_elemIndexes, 0, indexes.length);
-    }
-
-    int[][] localNameIndex = m_elemIndexes[namespaceID];
-
-    if (null == localNameIndex)
-    {
-      localNameIndex = new int[LocalNameID + 100][];
-      m_elemIndexes[namespaceID] = localNameIndex;
-    }
-    else if (localNameIndex.length <= LocalNameID)
-    {
-      int[][] indexes = localNameIndex;
-
-      localNameIndex = new int[LocalNameID + 100][];
-
-      System.arraycopy(indexes, 0, localNameIndex, 0, indexes.length);
-
-      m_elemIndexes[namespaceID] = localNameIndex;
-    }
-
-    int[] elemHandles = localNameIndex[LocalNameID];
-
-    if (null == elemHandles)
-    {
-      elemHandles = new int[128];
-      localNameIndex[LocalNameID] = elemHandles;
-      elemHandles[0] = 1;
-    }
-    else if (elemHandles.length <= elemHandles[0] + 1)
-    {
-      int[] indexes = elemHandles;
-
-      elemHandles = new int[elemHandles[0] + 1024];
-
-      System.arraycopy(indexes, 0, elemHandles, 0, indexes.length);
-
-      localNameIndex[LocalNameID] = elemHandles;
-    }
-  }
-
-  /**
-   * Add a node to the element indexes. The node will not be added unless
-   * it's an element.
-   *
-   * @param expandedTypeID The expanded type ID of the node.
-   * @param identity The node identity index.
-   */
-  protected void indexNode(int expandedTypeID, int identity)
-  {
-
-    ExpandedNameTable ent = m_expandedNameTable;
-    short type = ent.getType(expandedTypeID);
-
-    if (DTM.ELEMENT_NODE == type)
-    {
-      int namespaceID = ent.getNamespaceID(expandedTypeID);
-      int localNameID = ent.getLocalNameID(expandedTypeID);
-
-      ensureSizeOfIndex(namespaceID, localNameID);
-
-      int[] index = m_elemIndexes[namespaceID][localNameID];
-
-      index[index[0]] = identity;
-
-      index[0]++;
-    }
-  }
-
-  /**
-   * Find the first index that occurs in the list that is greater than or
-   * equal to the given value.
-   *
-   * @param list A list of integers.
-   * @param start The start index to begin the search.
-   * @param len The number of items to search.
-   * @param value Find the slot that has a value that is greater than or
-   * identical to this argument.
-   *
-   * @return The index in the list of the slot that is higher or identical
-   * to the identity argument, or -1 if no node is higher or equal.
-   */
-  protected int findGTE(int[] list, int start, int len, int value)
-  {
-
-    int low = start;
-    int high = start + (len - 1);
-    int end = high;
-
-    while (low <= high)
-    {
-      int mid = (low + high) / 2;
-      int c = list[mid];
-
-      if (c > value)
-        high = mid - 1;
-      else if (c < value)
-        low = mid + 1;
-      else
-        return mid;
-    }
-
-    return (low <= end && list[low] > value) ? low : -1;
-  }
-
-  /**
-   * Find the first matching element from the index at or after the
-   * given node.
-   *
-   * @param nsIndex The namespace index lookup.
-   * @param lnIndex The local name index lookup.
-   * @param firstPotential The first potential match that is worth looking at.
-   *
-   * @return The first node that is greater than or equal to the
-   *         firstPotential argument, or DTM.NOTPROCESSED if not found.
-   */
-  int findElementFromIndex(int nsIndex, int lnIndex, int firstPotential)
-  {
-
-    int[][][] indexes = m_elemIndexes;
-
-    if (null != indexes && nsIndex < indexes.length)
-    {
-      int[][] lnIndexs = indexes[nsIndex];
-
-      if (null != lnIndexs && lnIndex < lnIndexs.length)
-      {
-        int[] elems = lnIndexs[lnIndex];
-
-        if (null != elems)
-        {
-          int pos = findGTE(elems, 1, elems[0], firstPotential);
-
-          if (pos > -1)
-          {
-            return elems[pos];
-          }
-        }
-      }
-    }
-
-    return NOTPROCESSED;
-  }
-
-  /**
-   * Get the next node identity value in the list, and call the iterator
-   * if it hasn't been added yet.
-   *
-   * @param identity The node identity (index).
-   * @return identity+1, or DTM.NULL.
-   */
-  protected abstract int getNextNodeIdentity(int identity);
-
-  /**
-   * This method should try and build one or more nodes in the table.
-   *
-   * @return The true if a next node is found or false if
-   *         there are no more nodes.
-   */
-  protected abstract boolean nextNode();
-
-  /**
-   * Get the number of nodes that have been added.
-   *
-   * @return the number of nodes that have been mapped.
-   */
-  protected abstract int getNumberOfNodes();
-
-  /** Stateless axis traversers, lazely built. */
-  protected DTMAxisTraverser[] m_traversers;
-
-//    /**
-//     * Ensure that the size of the information arrays can hold another entry
-//     * at the given index.
-//     *
-//     * @param index On exit from this function, the information arrays sizes must be
-//     * at least index+1.
-//     */
-//    protected void ensureSize(int index)
-//    {
-//        // We've cut over to Suballocated*Vector, which are self-sizing.
-//    }
-
-  /**
-   * Get the simple type ID for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The simple type ID, or DTM.NULL.
-   */
-  protected short _type(int identity)
-  {
-
-    int info = getExpandedTypeID(identity);
-
-    if (NULL != info)
-      return ExpandedNameTable.getType(info);
-    else
-      return NULL;
-  }
-
-  /**
-   * Get the expanded type ID for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The expanded type ID, or DTM.NULL.
-   */
-  protected int _exptype(int identity)
-  {
-    // Reorganized test and loop into single flow
-    // Tiny performance improvement, saves a few bytes of code, clearer.
-    // %OPT% Other internal getters could be treated simliarly
-    while (identity>=m_size)
-    {
-      if (!nextNode() && identity >= m_size)
-        return NULL;
-    }
-    return m_exptype.elementAt(identity);
-
-  }
-
-  /**
-   * Get the level in the tree for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The tree level, or DTM.NULL.
-   */
-  protected int _level(int identity)
-  {
-    while (identity>=m_size)
-    {
-      boolean isMore = nextNode();
-      if (!isMore && identity >= m_size)
-        return NULL;
-    }
-
-    int i=0;
-    while(NULL != (identity=_parent(identity)))
-      ++i;
-    return i;
-  }
-
-  /**
-   * Get the first child for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The first child identity, or DTM.NULL.
-   */
-  protected int _firstch(int identity)
-  {
-
-    // Boiler-plate code for each of the _xxx functions, except for the array.
-    int info = (identity >= m_size) ? NOTPROCESSED : m_firstch.elementAt(identity);
-
-    // Check to see if the information requested has been processed, and,
-    // if not, advance the iterator until we the information has been
-    // processed.
-    while (info == NOTPROCESSED)
-    {
-      boolean isMore = nextNode();
-
-      if (identity >= m_size &&!isMore)
-        return NULL;
-      else
-      {
-        info = m_firstch.elementAt(identity);
-        if(info == NOTPROCESSED && !isMore)
-          return NULL;
-      }
-    }
-
-    return info;
-  }
-
-  /**
-   * Get the next sibling for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The next sibling identity, or DTM.NULL.
-   */
-  protected int _nextsib(int identity)
-  {
-
-    // Boiler-plate code for each of the _xxx functions, except for the array.
-    int info = (identity >= m_size) ? NOTPROCESSED : m_nextsib.elementAt(identity);
-
-    // Check to see if the information requested has been processed, and,
-    // if not, advance the iterator until we the information has been
-    // processed.
-    while (info == NOTPROCESSED)
-    {
-      boolean isMore = nextNode();
-
-      if (identity >= m_size &&!isMore)
-        return NULL;
-      else
-      {
-        info = m_nextsib.elementAt(identity);
-        if(info == NOTPROCESSED && !isMore)
-          return NULL;
-      }
-    }
-
-    return info;
-  }
-
-  /**
-   * Get the previous sibling for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The previous sibling identity, or DTM.NULL.
-   */
-  protected int _prevsib(int identity)
-  {
-
-    if (identity < m_size)
-      return m_prevsib.elementAt(identity);
-
-    // Check to see if the information requested has been processed, and,
-    // if not, advance the iterator until we the information has been
-    // processed.
-    while (true)
-    {
-      boolean isMore = nextNode();
-
-      if (identity >= m_size && !isMore)
-        return NULL;
-      else if (identity < m_size)
-        return m_prevsib.elementAt(identity);
-    }
-  }
-
-  /**
-   * Get the parent for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The parent identity, or DTM.NULL.
-   */
-  protected int _parent(int identity)
-  {
-
-    if (identity < m_size)
-      return m_parent.elementAt(identity);
-
-    // Check to see if the information requested has been processed, and,
-    // if not, advance the iterator until we the information has been
-    // processed.
-    while (true)
-    {
-      boolean isMore = nextNode();
-
-      if (identity >= m_size && !isMore)
-        return NULL;
-      else if (identity < m_size)
-        return m_parent.elementAt(identity);
-    }
-  }
-
-  /**
-   * Diagnostics function to dump the DTM.
-   */
-  public void dumpDTM()
-  {
-    try
-    {
-      File f = new File("DTMDump"+((Object)this).hashCode()+".txt");
-      System.err.println("Dumping... "+f.getAbsolutePath());
-      PrintStream ps = new PrintStream(new FileOutputStream(f));
-
-      while (nextNode()){}
-
-      int nRecords = m_size;
-
-      ps.println("Total nodes: " + nRecords);
-
-      for (int i = 0; i < nRecords; i++)
-      {
-        ps.println("=========== " + i + " ===========");
-        ps.println("NodeName: " + getNodeName(i));
-        ps.println("NodeNameX: " + getNodeNameX(i));
-        ps.println("LocalName: " + getLocalName(i));
-        ps.println("NamespaceURI: " + getNamespaceURI(i));
-        ps.println("Prefix: " + getPrefix(i));
-
-        int exTypeID = getExpandedTypeID(i);
-
-        ps.println("Expanded Type ID: "
-                           + Integer.toHexString(exTypeID));
-
-        int type = getNodeType(i);
-        String typestring;
-
-        switch (type)
-        {
-        case DTM.ATTRIBUTE_NODE :
-          typestring = "ATTRIBUTE_NODE";
-          break;
-        case DTM.CDATA_SECTION_NODE :
-          typestring = "CDATA_SECTION_NODE";
-          break;
-        case DTM.COMMENT_NODE :
-          typestring = "COMMENT_NODE";
-          break;
-        case DTM.DOCUMENT_FRAGMENT_NODE :
-          typestring = "DOCUMENT_FRAGMENT_NODE";
-          break;
-        case DTM.DOCUMENT_NODE :
-          typestring = "DOCUMENT_NODE";
-          break;
-        case DTM.DOCUMENT_TYPE_NODE :
-          typestring = "DOCUMENT_NODE";
-          break;
-        case DTM.ELEMENT_NODE :
-          typestring = "ELEMENT_NODE";
-          break;
-        case DTM.ENTITY_NODE :
-          typestring = "ENTITY_NODE";
-          break;
-        case DTM.ENTITY_REFERENCE_NODE :
-          typestring = "ENTITY_REFERENCE_NODE";
-          break;
-        case DTM.NAMESPACE_NODE :
-          typestring = "NAMESPACE_NODE";
-          break;
-        case DTM.NOTATION_NODE :
-          typestring = "NOTATION_NODE";
-          break;
-        case DTM.NULL :
-          typestring = "NULL";
-          break;
-        case DTM.PROCESSING_INSTRUCTION_NODE :
-          typestring = "PROCESSING_INSTRUCTION_NODE";
-          break;
-        case DTM.TEXT_NODE :
-          typestring = "TEXT_NODE";
-          break;
-        default :
-          typestring = "Unknown!";
-          break;
-        }
-
-        ps.println("Type: " + typestring);
-
-        int firstChild = _firstch(i);
-
-        if (DTM.NULL == firstChild)
-          ps.println("First child: DTM.NULL");
-        else if (NOTPROCESSED == firstChild)
-          ps.println("First child: NOTPROCESSED");
-        else
-          ps.println("First child: " + firstChild);
-
-        int prevSibling = _prevsib(i);
-
-        if (DTM.NULL == prevSibling)
-          ps.println("Prev sibling: DTM.NULL");
-        else if (NOTPROCESSED == prevSibling)
-          ps.println("Prev sibling: NOTPROCESSED");
-        else
-          ps.println("Prev sibling: " + prevSibling);
-
-        int nextSibling = _nextsib(i);
-
-        if (DTM.NULL == nextSibling)
-          ps.println("Next sibling: DTM.NULL");
-        else if (NOTPROCESSED == nextSibling)
-          ps.println("Next sibling: NOTPROCESSED");
-        else
-          ps.println("Next sibling: " + nextSibling);
-
-        int parent = _parent(i);
-
-        if (DTM.NULL == parent)
-          ps.println("Parent: DTM.NULL");
-        else if (NOTPROCESSED == parent)
-          ps.println("Parent: NOTPROCESSED");
-        else
-          ps.println("Parent: " + parent);
-
-        int level = _level(i);
-
-        ps.println("Level: " + level);
-        ps.println("Node Value: " + getNodeValue(i));
-        ps.println("String Value: " + getStringValue(i));
-      }
-    }
-    catch(IOException ioe)
-    {
-      ioe.printStackTrace(System.err);
-      System.exit(-1);
-    }
-  }
-  
-  /**
-   * Diagnostics function to dump a single node.
-   * 
-   * %REVIEW% KNOWN GLITCH: If you pass it a node index rather than a 
-   * node handle, it works just fine... but the displayed identity 
-   * number before the colon is different, which complicates comparing
-   * it with nodes printed the other way. We could always OR the DTM ID
-   * into the value, to suppress that distinction...
-   * 
-   * %REVIEW% This might want to be moved up to DTMDefaultBase, or possibly
-   * DTM itself, since it's a useful diagnostic and uses only DTM's public
-   * APIs.
-   */
-  public String dumpNode(int nodeHandle)
-  {	  
-	  if(nodeHandle==DTM.NULL)
-		  return "[null]";
-		  
-        String typestring;
-        switch (getNodeType(nodeHandle))
-        {
-        case DTM.ATTRIBUTE_NODE :
-          typestring = "ATTR";
-          break;
-        case DTM.CDATA_SECTION_NODE :
-          typestring = "CDATA";
-          break;
-        case DTM.COMMENT_NODE :
-          typestring = "COMMENT";
-          break;
-        case DTM.DOCUMENT_FRAGMENT_NODE :
-          typestring = "DOC_FRAG";
-          break;
-        case DTM.DOCUMENT_NODE :
-          typestring = "DOC";
-          break;
-        case DTM.DOCUMENT_TYPE_NODE :
-          typestring = "DOC_TYPE";
-          break;
-        case DTM.ELEMENT_NODE :
-          typestring = "ELEMENT";
-          break;
-        case DTM.ENTITY_NODE :
-          typestring = "ENTITY";
-          break;
-        case DTM.ENTITY_REFERENCE_NODE :
-          typestring = "ENT_REF";
-          break;
-        case DTM.NAMESPACE_NODE :
-          typestring = "NAMESPACE";
-          break;
-        case DTM.NOTATION_NODE :
-          typestring = "NOTATION";
-          break;
-        case DTM.NULL :
-          typestring = "null";
-          break;
-        case DTM.PROCESSING_INSTRUCTION_NODE :
-          typestring = "PI";
-          break;
-        case DTM.TEXT_NODE :
-          typestring = "TEXT";
-          break;
-        default :
-          typestring = "Unknown!";
-          break;
-        }
-
-      StringBuffer sb=new StringBuffer();
-	  sb.append("["+nodeHandle+": "+typestring+
-				"(0x"+Integer.toHexString(getExpandedTypeID(nodeHandle))+") "+
-				getNodeNameX(nodeHandle)+" {"+getNamespaceURI(nodeHandle)+"}"+
-				"=\""+ getNodeValue(nodeHandle)+"\"]");
-	  return sb.toString();
-  }
-
-  // ========= DTM Implementation Control Functions. ==============
-
-  /**
-   * Set an implementation dependent feature.
-   * <p>
-   * %REVIEW% Do we really expect to set features on DTMs?
-   *
-   * @param featureId A feature URL.
-   * @param state true if this feature should be on, false otherwise.
-   */
-  public void setFeature(String featureId, boolean state){}
-
-  // ========= Document Navigation Functions =========
-
-  /**
-   * Given a node handle, test if it has child nodes.
-   * <p> %REVIEW% This is obviously useful at the DOM layer, where it
-   * would permit testing this without having to create a proxy
-   * node. It's less useful in the DTM API, where
-   * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and
-   * almost as self-evident. But it's a convenience, and eases porting
-   * of DOM code to DTM.  </p>
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int true if the given node has child nodes.
-   */
-  public boolean hasChildNodes(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int firstChild = _firstch(identity);
-
-    return firstChild != DTM.NULL;
-  }
-
-  /**
-   * Given a node handle, get the handle of the node's first child.
-   * If not yet resolved, waits for more nodes to be added to the document and
-   * tries again.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int DTM node-number of first child, or DTM.NULL to indicate none exists.
-   */
-  public int getFirstChild(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int firstChild = _firstch(identity);
-
-    return firstChild | m_dtmIdent;
-  }
-
-  /**
-   * Given a node handle, advance to its last child.
-   * If not yet resolved, waits for more nodes to be added to the document and
-   * tries again.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int Node-number of last child,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getLastChild(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int child = _firstch(identity);
-    int lastChild = DTM.NULL;
-
-    while (child != DTM.NULL)
-    {
-      lastChild = child;
-      child = _nextsib(child);
-    }
-
-    return lastChild | m_dtmIdent;
-  }
-
-  /**
-   * Retrieves an attribute node by by qualified name and namespace URI.
-   *
-   * @param nodeHandle int Handle of the node upon which to look up this attribute..
-   * @param namespaceURI The namespace URI of the attribute to
-   *   retrieve, or null.
-   * @param name The local name of the attribute to
-   *   retrieve.
-   * @return The attribute node handle with the specified name (
-   *   <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
-   *   attribute.
-   */
-  public abstract int getAttributeNode(int nodeHandle, String namespaceURI,
-                                       String name);
-
-  /**
-   * Given a node handle, get the index of the node's first attribute.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return Handle of first attribute, or DTM.NULL to indicate none exists.
-   */
-  public int getFirstAttribute(int nodeHandle)
-  {
-
-    int type = getNodeType(nodeHandle);
-
-    if (DTM.ELEMENT_NODE == type)
-    {
-
-      // Assume that attributes and namespaces immediately follow the element.
-      int identity = nodeHandle & m_mask;
-
-      while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
-      {
-
-        // Assume this can not be null.
-        type = getNodeType(identity);
-
-        if (type == DTM.ATTRIBUTE_NODE)
-        {
-          return identity | m_dtmIdent;
-        }
-        else if (DTM.NAMESPACE_NODE != type)
-        {
-          break;
-        }
-      }
-    }
-
-    return DTM.NULL;
-  }
-
-  /**
-   * Given a node handle, advance to its next sibling.
-   * If not yet resolved, waits for more nodes to be added to the document and
-   * tries again.
-   * @param nodeHandle int Handle of the node.
-   * @return int Node-number of next sibling,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getNextSibling(int nodeHandle)
-  {
-    return _nextsib(nodeHandle & m_mask) | m_dtmIdent;
-  }
-
-  /**
-   * Given a node handle, find its preceeding sibling.
-   * WARNING: DTM is asymmetric; this operation is resolved by search, and is
-   * relatively expensive.
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node-number of the previous sib,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getPreviousSibling(int nodeHandle)
-  {
-    return _prevsib(nodeHandle & m_mask) | m_dtmIdent;
-  }
-
-  /**
-   * Given a node handle, advance to the next attribute.
-   * If an attr, we advance to
-   * the next attr on the same node.  If not an attribute, we return NULL.
-   *
-   * @param nodeHandle int Handle of the node.
-   * @return int DTM node-number of the resolved attr,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getNextAttribute(int nodeHandle)
-  {
-
-    int type = getNodeType(nodeHandle);
-
-    if (DTM.ATTRIBUTE_NODE == type)
-    {
-      // Assume that attributes and namespace nodes immediately follow the element.
-      int identity = nodeHandle & m_mask;
-
-      while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
-      {
-        type = getNodeType(identity);
-
-        if (type == DTM.ATTRIBUTE_NODE)
-        {
-          return identity | m_dtmIdent;
-        }
-        else if (type != DTM.NAMESPACE_NODE)
-        {
-          break;
-        }
-      }
-    }
-
-    return DTM.NULL;
-  }
-
-  /** Lazily created namespace lists. */
-  private Vector m_namespaceLists = null;  // on demand
-
-
-  /** Build table of namespace declaration
-   * locations during DTM construction. Table is a Vector of
-   * SuballocatedIntVectors containing the namespace node HANDLES declared at
-   * that ID, plus an SuballocatedIntVector of the element node INDEXES at which
-   * these declarations appeared.
-   *
-   * NOTE: Since this occurs during model build, nodes will be encountered
-   * in doucment order and thus the table will be ordered by element,
-   * permitting binary-search as a possible retrieval optimization.
-   *
-   * %REVIEW% Directly managed arrays rather than vectors?
-   * %REVIEW% Handles or IDs? Given usage, I think handles.
-   * */
-  protected void declareNamespaceInContext(int elementNodeIndex,int namespaceNodeIndex)
-  {
-    SuballocatedIntVector nsList=null;
-    if(m_namespaceDeclSets==null)
-      {
-
-        // First
-        m_namespaceDeclSetElements=new SuballocatedIntVector();
-        m_namespaceDeclSetElements.addElement(elementNodeIndex);
-        m_namespaceDeclSets=new Vector();
-        nsList=new SuballocatedIntVector();
-        m_namespaceDeclSets.addElement(nsList);
-      }
-    else
-      {
-        // Most recent?
-        // %OPT% Is there a lastElement() method? Should there be?
-        int last=m_namespaceDeclSetElements.size()-1;
-
-        if(elementNodeIndex==
-           m_namespaceDeclSetElements.elementAt(last))
-          {
-            nsList=(SuballocatedIntVector)m_namespaceDeclSets.elementAt(last);
-
-          }
-      }
-    if(nsList==null)
-      {
-        m_namespaceDeclSetElements.addElement(elementNodeIndex);
-        nsList=new SuballocatedIntVector();
-        m_namespaceDeclSets.addElement(nsList);
-
-        SuballocatedIntVector inherited= findNamespaceContext(_parent(elementNodeIndex));
-
-        if(inherited!=null)
-          {
-            // %OPT% Count-down might be faster, but debuggability may
-            // be better this way, and if we ever decide we want to
-            // keep this ordered by expanded-type...
-            int isize=inherited.size();
-            for(int i=0;i<isize;++i)
-              {
-                nsList.addElement(inherited.elementAt(i));
-              }
-          }
-      }
-
-    // Handle overwriting inherited.
-    // %OPT% Keep sorted? (By expanded-name rather than by doc order...)
-    // Downside: Would require insertElementAt if not found,
-    // which has recopying costs. But these are generally short lists...
-    int newEType=getExpandedTypeID(namespaceNodeIndex);
-
-    for(int i=nsList.size()-1;i>=0;--i)
-      {
-        if(newEType==getExpandedTypeID(nsList.elementAt(i)))
-          {
-            nsList.setElementAt(namespaceNodeIndex | m_dtmIdent,i);
-            return;
-          }
-      }
-    nsList.addElement(namespaceNodeIndex | m_dtmIdent);
-  }
-
-  /** Retrieve list of namespace declaration locations
-     * active at this node. List is an SuballocatedIntVector whose
-     * entries are the namespace node HANDLES declared at that ID.
-     *
-     * %REVIEW% Directly managed arrays rather than vectors?
-     * %REVIEW% Handles or IDs? Given usage, I think handles.
-     * */
-  protected SuballocatedIntVector findNamespaceContext(int elementNodeIndex)
-  {
-    if (null!=m_namespaceDeclSetElements)
-      {
-        // %OPT% Is binary-search really saving us a lot versus linear?
-        // (... It may be, in large docs with many NS decls.)
-        int wouldBeAt=findInSortedSuballocatedIntVector(m_namespaceDeclSetElements,
-                                            elementNodeIndex);
-        if(wouldBeAt>=0) // Found it
-          return (SuballocatedIntVector) m_namespaceDeclSets.elementAt(wouldBeAt);
-        if(wouldBeAt == -1) // -1-wouldbeat == 0
-          return null; // Not after anything; definitely not found
-
-        // Not found, but we know where it should have been.
-        // Search back until we find an ancestor or run out.
-        wouldBeAt=-1-wouldBeAt;
-
-        // Decrement wouldBeAt to find last possible ancestor
-        int candidate=m_namespaceDeclSetElements.elementAt(-- wouldBeAt);
-        int ancestor=_parent(elementNodeIndex);
-        while(wouldBeAt>=0 && ancestor>0)
-          {
-            candidate=m_namespaceDeclSetElements.elementAt(wouldBeAt);
-
-            if(candidate==ancestor) // Found ancestor in list
-                return (SuballocatedIntVector)m_namespaceDeclSets.elementAt(wouldBeAt);
-            else if(candidate<ancestor) // Too deep in tree
-                ancestor=_parent(ancestor);
-            else // Too late in list
-              --wouldBeAt;
-          }
-      }
-
-    return null; // No namespaces known at this node
-  }
-
-  /**
-     * Subroutine: Locate the specified node within
-     * m_namespaceDeclSetElements, or the last element which
-     * preceeds it in document order
-     *
-     * %REVIEW% Inlne this into findNamespaceContext? Create SortedSuballocatedIntVector type?
-     *
-     * @param elementNodeIndex Index of a node to look up.
-     *
-     * @return If positive or zero, the index of the found item.
-     * If negative, index of the point at which it would have appeared,
-     * encoded as -1-index and hence reconvertable by subtracting
-     * it from -1. (Encoding because I don't want to recompare the strings
-     * but don't want to burn bytes on a datatype to hold a flagged value.)
-     */
-  protected int findInSortedSuballocatedIntVector(SuballocatedIntVector vector, int lookfor)
-  {
-    // Binary search
-    int i = 0;
-    if(vector != null) {
-      int first = 0;
-      int last  = vector.size() - 1;
-
-      while (first <= last) {
-        i = (first + last) / 2;
-        int test = lookfor-vector.elementAt(i);
-        if(test == 0) {
-          return i; // Name found
-        }
-        else if (test < 0) {
-          last = i - 1; // looked too late
-        }
-        else {
-          first = i + 1; // looked ot early
-        }
-      }
-
-      if (first > i) {
-        i = first; // Clean up at loop end
-      }
-    }
-
-    return -1 - i; // not-found has to be encoded.
-  }
-
-
-  /**
-   * Given a node handle, get the index of the node's first child.
-   * If not yet resolved, waits for more nodes to be added to the document and
-   * tries again
-   *
-   * @param nodeHandle handle to node, which should probably be an element
-   *                   node, but need not be.
-   *
-   * @param inScope    true if all namespaces in scope should be returned,
-   *                   false if only the namespace declarations should be
-   *                   returned.
-   * @return handle of first namespace, or DTM.NULL to indicate none exists.
-   */
-  public int getFirstNamespaceNode(int nodeHandle, boolean inScope)
-  {
-        if(inScope)
-        {
-            SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);
-            if(nsContext==null || nsContext.size()<1)
-              return NULL;
-
-            return nsContext.elementAt(0) | m_dtmIdent;
-          }
-        else
-          {
-            // Assume that attributes and namespaces immediately
-            // follow the element.
-            //
-            // %OPT% Would things be faster if all NS nodes were built
-            // before all Attr nodes? Some costs at build time for 2nd
-            // pass...
-            int identity = nodeHandle & m_mask;
-            while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
-              {
-                int type = getNodeType(identity);
-                if (type == DTM.NAMESPACE_NODE)
-                    return identity | m_dtmIdent;
-                else if (DTM.ATTRIBUTE_NODE != type)
-                    break;
-              }
-            return NULL;
-          }
-  }
-
-  /**
-   * Given a namespace handle, advance to the next namespace.
-   *
-   * @param baseHandle handle to original node from where the first namespace
-   * was relative to (needed to return nodes in document order).
-   * @param namespaceHandle handle to node which must be of type
-   * NAMESPACE_NODE.
-   * @param nodeHandle A namespace handle for which we will find the next node.
-   * @param inScope true if all namespaces that are in scope should be processed,
-   * otherwise just process the nodes in the given element handle.
-   * @return handle of next namespace, or DTM.NULL to indicate none exists.
-   */
-  public int getNextNamespaceNode(int baseHandle, int nodeHandle,
-                                  boolean inScope)
-  {
-        if(inScope)
-          {
-            //Since we've been given the base, try direct lookup
-            //(could look from nodeHandle but this is at least one
-            //comparison/get-parent faster)
-            //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);
-
-                SuballocatedIntVector nsContext=findNamespaceContext(baseHandle & m_mask);
-
-            if(nsContext==null)
-              return NULL;
-            int i=1 + nsContext.indexOf(nodeHandle);
-            if(i<=0 || i==nsContext.size())
-              return NULL;
-
-            return nsContext.elementAt(i) | m_dtmIdent;
-          }
-        else
-          {
-            // Assume that attributes and namespace nodes immediately follow the element.
-            int identity = nodeHandle & m_mask;
-            while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
-              {
-                int type = getNodeType(identity);
-                if (type == DTM.NAMESPACE_NODE)
-                  {
-                    return identity | m_dtmIdent;
-                  }
-                else if (type != DTM.ATTRIBUTE_NODE)
-                  {
-                    break;
-                  }
-              }
-          }
-     return DTM.NULL;
-  }
-
-  /**
-   * Given a node handle, find its parent node.
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node-number of parent,
-   * or DTM.NULL to indicate none exists.
-   */
-  public int getParent(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-
-    if (identity > 0)
-      return _parent(identity) | m_dtmIdent;
-    else
-      return DTM.NULL;
-  }
-
-  /**
-   *  Given a node handle, find the owning document node.
-   *
-   *  @param nodeHandle the id of the node.
-   *  @return int Node handle of document, which should always be valid.
-   */
-  public int getDocument()
-  {
-    return m_dtmIdent;
-  }
-
-  /**
-   * Given a node handle, find the owning document node.  This has the exact
-   * same semantics as the DOM Document method of the same name, in that if
-   * the nodeHandle is a document node, it will return NULL.
-   *
-   * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM
-   * binding layer. Included here as a convenience function and to
-   * aid porting of DOM code to DTM.</p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return int Node handle of owning document, or -1 if the nodeHandle is
-   *             a document.
-   */
-  public int getOwnerDocument(int nodeHandle)
-  {
-
-    int type = getNodeType(nodeHandle);
-
-    if (DTM.DOCUMENT_NODE == type)
-    {
-      return DTM.NULL;
-    }
-
-    return getDocument();
-  }
-
-  /**
-   * Get the string-value of a node as a String object
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A string object that represents the string-value of the given node.
-   */
-  public abstract XMLString getStringValue(int nodeHandle);
-
-  /**
-   * Get number of character array chunks in
-   * the string-value of a node.
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   * Note that a single text node may have multiple text chunks.
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return number of character array chunks in
-   *         the string-value of a node.
-   */
-  public int getStringValueChunkCount(int nodeHandle)
-  {
-
-    // %TBD%
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//("getStringValueChunkCount not yet supported!");
-
-    return 0;
-  }
-
-  /**
-   * Get a character array chunk in the string-value of a node.
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   * Note that a single text node may have multiple text chunks.
-   *
-   * @param nodeHandle The node ID.
-   * @param chunkIndex Which chunk to get.
-   * @param startAndLen An array of 2 where the start position and length of
-   *                    the chunk will be returned.
-   *
-   * @return The character array reference where the chunk occurs.
-   */
-  public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
-                                    int[] startAndLen)
-  {
-
-    // %TBD%
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"getStringValueChunk not yet supported!");
-
-    return null;
-  }
-
-  /**
-   * Given a node handle, return an ID that represents the node's expanded name.
-   *
-   * @param nodeHandle The handle to the node in question.
-   *
-   * @return the expanded-name id of the node.
-   */
-  public int getExpandedTypeID(int nodeHandle)
-  {
-
-    return _exptype(nodeHandle & m_mask);
-  }
-
-  /**
-   * Given an expanded name, return an ID.  If the expanded-name does not
-   * exist in the internal tables, the entry will be created, and the ID will
-   * be returned.  Any additional nodes that are created that have this
-   * expanded name will use this ID.
-   *
-   * @param nodeHandle The handle to the node in question.
-   * @param type The simple type, i.e. one of ELEMENT, ATTRIBUTE, etc.
-   *
-   * @param namespace The namespace URI, which may be null, may be an empty
-   *                  string (which will be the same as null), or may be a
-   *                  namespace URI.
-   * @param localName The local name string, which must be a valid
-   *                  <a href="http://www.w3.org/TR/REC-xml-names/">NCName</a>.
-   *
-   * @return the expanded-name id of the node.
-   */
-  public int getExpandedTypeID(String namespace, String localName, int type)
-  {
-
-    ExpandedNameTable ent = m_expandedNameTable;
-
-    return ent.getExpandedTypeID(namespace, localName, type);
-  }
-
-  /**
-   * Given an expanded-name ID, return the local name part.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return String Local name of this node.
-   */
-  public String getLocalNameFromExpandedNameID(int expandedNameID)
-  {
-    return m_expandedNameTable.getLocalName(expandedNameID);
-  }
-
-  /**
-   * Given an expanded-name ID, return the namespace URI part.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public String getNamespaceFromExpandedNameID(int expandedNameID)
-  {
-    return m_expandedNameTable.getNamespace(expandedNameID);
-  }
-
-  /**
-   * Returns the namespace type of a specific node
-   * @param nodeHandle the id of the node.
-   * @return the ID of the namespace.
-   */
-  public int getNamespaceType(final int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int expandedNameID = _exptype(identity);
-
-    return ExpandedNameTable.getNamespaceID(expandedNameID);
-  }
-
-  /**
-   * Given a node handle, return its DOM-style node name. This will
-   * include names such as #text or #document.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   * %REVIEW% Document when empty string is possible...
-   * %REVIEW-COMMENT% It should never be empty, should it?
-   */
-  public abstract String getNodeName(int nodeHandle);
-
-  /**
-   * Given a node handle, return the XPath node name.  This should be
-   * the name as described by the XPath data model, NOT the DOM-style
-   * name.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   */
-  public String getNodeNameX(int nodeHandle)
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMDefaultBase abstract method */
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
-
-    return null;
-  }
-
-  /**
-   * Given a node handle, return its XPath-style localname.
-   * (As defined in Namespaces, this is the portion of the name after any
-   * colon character).
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Local name of this node.
-   */
-  public abstract String getLocalName(int nodeHandle);
-
-  /**
-   * Given a namespace handle, return the prefix that the namespace decl is
-   * mapping.
-   * Given a node handle, return the prefix used to map to the namespace.
-   *
-   * <p> %REVIEW% Are you sure you want "" for no prefix?  </p>
-   * <p> %REVIEW-COMMENT% I think so... not totally sure. -sb  </p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String prefix of this node's name, or "" if no explicit
-   * namespace prefix was given.
-   */
-  public abstract String getPrefix(int nodeHandle);
-
-  /**
-   * Given a node handle, return its DOM-style namespace URI
-   * (As defined in Namespaces, this is the declared URI which this node's
-   * prefix -- or default in lieu thereof -- was mapped to.)
-   *
-   * <p>%REVIEW% Null or ""? -sb</p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public abstract String getNamespaceURI(int nodeHandle);
-
-  /**
-   * Given a node handle, return its node value. This is mostly
-   * as defined by the DOM, but may ignore some conveniences.
-   * <p>
-   *
-   * @param nodeHandle The node id.
-   * @return String Value of this node, or null if not
-   * meaningful for this node type.
-   */
-  public abstract String getNodeValue(int nodeHandle);
-
-  /**
-   * Given a node handle, return its DOM-style node type.
-   * <p>
-   * %REVIEW% Generally, returning short is false economy. Return int?
-   * %REVIEW% Make assumption that node has already arrived.  Is OK?
-   *
-   * @param nodeHandle The node id.
-   * @return int Node type, as per the DOM's Node._NODE constants.
-   */
-  public short getNodeType(int nodeHandle)
-  {
-    return (short)(_exptype(nodeHandle & m_mask) >> ExpandedNameTable.ROTAMOUNT_TYPE);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the depth level of this node in the tree (equals 1 for
-   * a parentless node).
-   *
-   * @param nodeHandle The node id.
-   * @return the number of ancestors, plus one
-   */
-  public short getLevel(int nodeHandle)
-  {
-    // Apparently, the axis walker stuff requires levels to count from 1.
-    int identity = nodeHandle & m_mask;
-    return (short) (_level(identity) + 1);
-  }
-
-  // ============== Document query functions ==============
-
-  /**
-   * Tests whether DTM DOM implementation implements a specific feature and
-   * that feature is supported by this node.
-   *
-   * @param feature The name of the feature to test.
-   * @param versionThis is the version number of the feature to test.
-   *   If the version is not
-   *   specified, supporting any version of the feature will cause the
-   *   method to return <code>true</code>.
-   * @param version The version string of the feature requested, may be null.
-   * @return Returns <code>true</code> if the specified feature is
-   *   supported on this node, <code>false</code> otherwise.
-   */
-  public boolean isSupported(String feature, String version)
-  {
-
-    // %TBD%
-    return false;
-  }
-
-  /**
-   * Return the base URI of the document entity. If it is not known
-   * (because the document was parsed from a socket connection or from
-   * standard input, for example), the value of this property is unknown.
-   *
-   * @return the document base URI String object or null if unknown.
-   */
-  public String getDocumentBaseURI()
-  {
-    return m_documentBaseURI;
-  }
-
-  /**
-   * Set the base URI of the document entity.
-   *
-   * @param baseURI the document base URI String object or null if unknown.
-   */
-  public void setDocumentBaseURI(String baseURI)
-  {
-    m_documentBaseURI = baseURI;
-  }
-
-  /**
-   * Return the system identifier of the document entity. If
-   * it is not known, the value of this property is unknown.
-   *
-   * @param nodeHandle The node id, which can be any valid node handle.
-   * @return the system identifier String object or null if unknown.
-   */
-  public String getDocumentSystemIdentifier(int nodeHandle)
-  {
-
-    // %REVIEW%  OK? -sb
-    return m_documentBaseURI;
-  }
-
-  /**
-   * Return the name of the character encoding scheme
-   *        in which the document entity is expressed.
-   *
-   * @param nodeHandle The node id, which can be any valid node handle.
-   * @return the document encoding String object.
-   */
-  public String getDocumentEncoding(int nodeHandle)
-  {
-
-    // %REVIEW%  OK??  -sb
-    return "UTF-8";
-  }
-
-  /**
-   * Return an indication of the standalone status of the document,
-   *        either "yes" or "no". This property is derived from the optional
-   *        standalone document declaration in the XML declaration at the
-   *        beginning of the document entity, and has no value if there is no
-   *        standalone document declaration.
-   *
-   * @param nodeHandle The node id, which can be any valid node handle.
-   * @return the document standalone String object, either "yes", "no", or null.
-   */
-  public String getDocumentStandalone(int nodeHandle)
-  {
-    return null;
-  }
-
-  /**
-   * Return a string representing the XML version of the document. This
-   * property is derived from the XML declaration optionally present at the
-   * beginning of the document entity, and has no value if there is no XML
-   * declaration.
-   *
-   * @param documentHandle The document handle
-   *
-   * @return the document version String object.
-   */
-  public String getDocumentVersion(int documentHandle)
-  {
-    return null;
-  }
-
-  /**
-   * Return an indication of
-   * whether the processor has read the complete DTD. Its value is a
-   * boolean. If it is false, then certain properties (indicated in their
-   * descriptions below) may be unknown. If it is true, those properties
-   * are never unknown.
-   *
-   * @return <code>true</code> if all declarations were processed;
-   *         <code>false</code> otherwise.
-   */
-  public boolean getDocumentAllDeclarationsProcessed()
-  {
-
-    // %REVIEW% OK?
-    return true;
-  }
-
-  /**
-   *   A document type declaration information item has the following properties:
-   *
-   *     1. [system identifier] The system identifier of the external subset, if
-   *        it exists. Otherwise this property has no value.
-   *
-   * @return the system identifier String object, or null if there is none.
-   */
-  public abstract String getDocumentTypeDeclarationSystemIdentifier();
-
-  /**
-   * Return the public identifier of the external subset,
-   * normalized as described in 4.2.2 External Entities [XML]. If there is
-   * no external subset or if it has no public identifier, this property
-   * has no value.
-   *
-   * @param the document type declaration handle
-   *
-   * @return the public identifier String object, or null if there is none.
-   */
-  public abstract String getDocumentTypeDeclarationPublicIdentifier();
-
-  /**
-   * Returns the <code>Element</code> whose <code>ID</code> is given by
-   * <code>elementId</code>. If no such element exists, returns
-   * <code>DTM.NULL</code>. Behavior is not defined if more than one element
-   * has this <code>ID</code>. Attributes (including those
-   * with the name "ID") are not of type ID unless so defined by DTD/Schema
-   * information available to the DTM implementation.
-   * Implementations that do not know whether attributes are of type ID or
-   * not are expected to return <code>DTM.NULL</code>.
-   *
-   * <p>%REVIEW% Presumably IDs are still scoped to a single document,
-   * and this operation searches only within a single document, right?
-   * Wouldn't want collisions between DTMs in the same process.</p>
-   *
-   * @param elementId The unique <code>id</code> value for an element.
-   * @return The handle of the matching element.
-   */
-  public abstract int getElementById(String elementId);
-
-  /**
-   * The getUnparsedEntityURI function returns the URI of the unparsed
-   * entity with the specified name in the same document as the context
-   * node (see [3.3 Unparsed Entities]). It returns the empty string if
-   * there is no such entity.
-   * <p>
-   * XML processors may choose to use the System Identifier (if one
-   * is provided) to resolve the entity, rather than the URI in the
-   * Public Identifier. The details are dependent on the processor, and
-   * we would have to support some form of plug-in resolver to handle
-   * this properly. Currently, we simply return the System Identifier if
-   * present, and hope that it a usable URI or that our caller can
-   * map it to one.
-   * TODO: Resolve Public Identifiers... or consider changing function name.
-   * <p>
-   * If we find a relative URI
-   * reference, XML expects it to be resolved in terms of the base URI
-   * of the document. The DOM doesn't do that for us, and it isn't
-   * entirely clear whether that should be done here; currently that's
-   * pushed up to a higher level of our application. (Note that DOM Level
-   * 1 didn't store the document's base URI.)
-   * TODO: Consider resolving Relative URIs.
-   * <p>
-   * (The DOM's statement that "An XML processor may choose to
-   * completely expand entities before the structure model is passed
-   * to the DOM" refers only to parsed entities, not unparsed, and hence
-   * doesn't affect this function.)
-   *
-   * @param name A string containing the Entity Name of the unparsed
-   * entity.
-   *
-   * @return String containing the URI of the Unparsed Entity, or an
-   * empty string if no such entity exists.
-   */
-  public abstract String getUnparsedEntityURI(String name);
-
-  // ============== Boolean methods ================
-
-  /**
-   * Return true if the xsl:strip-space or xsl:preserve-space was processed
-   * during construction of the DTM document.
-   *
-   * @return true if this DTM supports prestripping.
-   */
-  public boolean supportsPreStripping()
-  {
-    return true;
-  }
-
-  /**
-   * Figure out whether nodeHandle2 should be considered as being later
-   * in the document than nodeHandle1, in Document Order as defined
-   * by the XPath model. This may not agree with the ordering defined
-   * by other XML applications.
-   * <p>
-   * There are some cases where ordering isn't defined, and neither are
-   * the results of this function -- though we'll generally return true.
-   *
-   * TODO: Make sure this does the right thing with attribute nodes!!!
-   *
-   * @param nodeHandle1 Node handle to perform position comparison on.
-   * @param nodeHandle2 Second Node handle to perform position comparison on .
-   *
-   * @return false if node2 comes before node1, otherwise return true.
-   * You can think of this as
-   * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
-   */
-  public boolean isNodeAfter(int nodeHandle1, int nodeHandle2)
-  {
-    if((nodeHandle1 & ~m_mask) != (nodeHandle2 & ~m_mask))
-      return false;
-
-    int index1 = nodeHandle1 & m_mask;
-    int index2 = nodeHandle2 & m_mask;
-
-    return index1 <= index2;
-  }
-
-  /**
-   *     2. [element content whitespace] A boolean indicating whether the
-   *        character is white space appearing within element content (see [XML],
-   *        2.10 "White Space Handling"). Note that validating XML processors are
-   *        required by XML 1.0 to provide this information. If there is no
-   *        declaration for the containing element, this property has no value for
-   *        white space characters. If no declaration has been read, but the [all
-   *        declarations processed] property of the document information item is
-   *        false (so there may be an unread declaration), then the value of this
-   *        property is unknown for white space characters. It is always false for
-   *        characters that are not white space.
-   *
-   * @param nodeHandle the node ID.
-   * @return <code>true</code> if the character data is whitespace;
-   *         <code>false</code> otherwise.
-   */
-  public boolean isCharacterElementContentWhitespace(int nodeHandle)
-  {
-
-    // %TBD%
-    return false;
-  }
-
-  /**
-   *    10. [all declarations processed] This property is not strictly speaking
-   *        part of the infoset of the document. Rather it is an indication of
-   *        whether the processor has read the complete DTD. Its value is a
-   *        boolean. If it is false, then certain properties (indicated in their
-   *        descriptions below) may be unknown. If it is true, those properties
-   *        are never unknown.
-   *
-   * @param the document handle
-   *
-   * @param documentHandle A node handle that must identify a document.
-   * @return <code>true</code> if all declarations were processed;
-   *         <code>false</code> otherwise.
-   */
-  public boolean isDocumentAllDeclarationsProcessed(int documentHandle)
-  {
-    return true;
-  }
-
-  /**
-   *     5. [specified] A flag indicating whether this attribute was actually
-   *        specified in the start-tag of its element, or was defaulted from the
-   *        DTD.
-   *
-   * @param attributeHandle The attribute handle in question.
-   *
-   * @return <code>true</code> if the attribute was specified;
-   *         <code>false</code> if it was defaulted.
-   */
-  public abstract boolean isAttributeSpecified(int attributeHandle);
-
-  // ========== Direct SAX Dispatch, for optimization purposes ========
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value). Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   * @param normalize true if the content should be normalized according to
-   * the rules for the XPath
-   * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
-   * function.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public abstract void dispatchCharactersEvents(
-    int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
-      throws org.xml.sax.SAXException;
-
-  /**
-   * Directly create SAX parser events from a subtree.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public abstract void dispatchToEvents(
-    int nodeHandle, org.xml.sax.ContentHandler ch)
-      throws org.xml.sax.SAXException;
-
-  /**
-   * Return an DOM node for the given node.
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A node representation of the DTM node.
-   */
-  public org.w3c.dom.Node getNode(int nodeHandle)
-  {
-    return new DTMNodeProxy(this, nodeHandle);
-  }
-
-  // ==== Construction methods (may not be supported by some implementations!) =====
-
-  /**
-   * Append a child to the end of the document. Please note that the node
-   * is always cloned if it is owned by another document.
-   *
-   * <p>%REVIEW% "End of the document" needs to be defined more clearly.
-   * Does it become the last child of the Document? Of the root element?</p>
-   *
-   * @param newChild Must be a valid new node handle.
-   * @param clone true if the child should be cloned into the document.
-   * @param cloneDepth if the clone argument is true, specifies that the
-   *                   clone should include all it's children.
-   */
-  public void appendChild(int newChild, boolean clone, boolean cloneDepth)
-  {
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"appendChild not yet supported!");
-  }
-
-  /**
-   * Append a text node child that will be constructed from a string,
-   * to the end of the document.
-   *
-   * <p>%REVIEW% "End of the document" needs to be defined more clearly.
-   * Does it become the last child of the Document? Of the root element?</p>
-   *
-   * @param str Non-null reverence to a string.
-   */
-  public void appendTextChild(String str)
-  {
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"appendTextChild not yet supported!");
-  }
-
-  /**
-   * Simple error for asserts and the like.
-   *
-   * @param msg Error message to report.
-   */
-  protected void error(String msg)
-  {
-    throw new DTMException(msg);
-  }
-
-  /**
-   * Find out whether or not to strip whispace nodes.
-   *
-   *
-   * @return whether or not to strip whispace nodes.
-   */
-  protected boolean getShouldStripWhitespace()
-  {
-    return m_shouldStripWS;
-  }
-
-  /**
-   * Set whether to strip whitespaces and push in current value of
-   * m_shouldStripWS in m_shouldStripWhitespaceStack.
-   *
-   * @param shouldStrip Flag indicating whether to strip whitespace nodes
-   */
-  protected void pushShouldStripWhitespace(boolean shouldStrip)
-  {
-
-    m_shouldStripWS = shouldStrip;
-
-    if (null != m_shouldStripWhitespaceStack)
-      m_shouldStripWhitespaceStack.push(shouldStrip);
-  }
-
-  /**
-   * Set whether to strip whitespaces at this point by popping out
-   * m_shouldStripWhitespaceStack.
-   *
-   */
-  protected void popShouldStripWhitespace()
-  {
-    if (null != m_shouldStripWhitespaceStack)
-      m_shouldStripWS = m_shouldStripWhitespaceStack.popAndTop();
-  }
-
-  /**
-   * Set whether to strip whitespaces and set the top of the stack to
-   * the current value of m_shouldStripWS.
-   *
-   *
-   * @param shouldStrip Flag indicating whether to strip whitespace nodes
-   */
-  protected void setShouldStripWhitespace(boolean shouldStrip)
-  {
-
-    m_shouldStripWS = shouldStrip;
-
-    if (null != m_shouldStripWhitespaceStack)
-      m_shouldStripWhitespaceStack.setTop(shouldStrip);
-  }
-
-  /**
-   * A dummy routine to satisify the abstract interface. If the DTM
-   * implememtation that extends the default base requires notification
-   * of registration, they can override this method.
-   */
-   public void documentRegistration()
-   {
-   }
-
-  /**
-   * A dummy routine to satisify the abstract interface. If the DTM
-   * implememtation that extends the default base requires notification
-   * when the document is being released, they can override this method
-   */
-   public void documentRelease()
-   {
-   }
-
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java b/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
deleted file mode 100644
index 0bc6580..0000000
--- a/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
+++ /dev/null
@@ -1,1919 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-
-import javax.xml.transform.Source;
-
-import org.apache.xml.utils.XMLStringFactory;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * This class implements the traversers for DTMDefaultBase.
- */
-public abstract class DTMDefaultBaseIterators extends DTMDefaultBaseTraversers
-{
-
-  /**
-   * Construct a DTMDefaultBaseTraversers object from a DOM node.
-   *
-   * @param mgr The DTMManager who owns this DTM.
-   * @param domSource the DOM source that this DTM will wrap.
-   * @param source The object that is used to specify the construction source.
-   * @param dtmIdentity The DTM identity ID for this DTM.
-   * @param whiteSpaceFilter The white space filter for this DTM, which may
-   *                         be null.
-   * @param xstringfactory The factory to use for creating XMLStrings.
-   * @param doIndexing true if the caller considers it worth it to use 
-   *                   indexing schemes.
-   */
-  public DTMDefaultBaseIterators(DTMManager mgr, Source source,
-                                 int dtmIdentity,
-                                 DTMWSFilter whiteSpaceFilter,
-                                 XMLStringFactory xstringfactory,
-                                 boolean doIndexing)
-  {
-    super(mgr, source, dtmIdentity, whiteSpaceFilter, 
-          xstringfactory, doIndexing);
-  }
-
-  /**
-   * Get an iterator that can navigate over an XPath Axis, predicated by
-   * the extended type ID.
-   * Returns an iterator that must be initialized
-   * with a start node (using iterator.setStartNode()).
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   * @param type An extended type ID.
-   *
-   * @return A DTMAxisIterator, or null if the given axis isn't supported.
-   */
-  public DTMAxisIterator getTypedAxisIterator(int axis, int type)
-  {
-
-    DTMAxisIterator iterator = null;
-
-    /* This causes an error when using patterns for elements that
-       do not exist in the DOM (translet types which do not correspond
-       to a DOM type are mapped to the DOM.ELEMENT type).
-    */
-
-    //        if (type == NO_TYPE) {
-    //            return(EMPTYITERATOR);
-    //        }
-    //        else if (type == ELEMENT) {
-    //            iterator = new FilterIterator(getAxisIterator(axis),
-    //                                          getElementFilter());
-    //        }
-    //        else 
-    {
-      switch (axis)
-      {
-      case Axis.SELF :
-        iterator = new TypedSingletonIterator(type);
-        break;
-      case Axis.CHILD :
-        iterator = new TypedChildrenIterator(type);
-        break;
-      case Axis.PARENT :
-        return (new ParentIterator().setNodeType(type));
-      case Axis.ANCESTOR :
-        return (new TypedAncestorIterator(type));
-      case Axis.ANCESTORORSELF :
-        return ((new TypedAncestorIterator(type)).includeSelf());
-      case Axis.ATTRIBUTE :
-        return (new TypedAttributeIterator(type));
-      case Axis.DESCENDANT :
-        iterator = new TypedDescendantIterator(type);
-        break;
-      case Axis.DESCENDANTORSELF :
-        iterator = (new TypedDescendantIterator(type)).includeSelf();
-        break;
-      case Axis.FOLLOWING :
-        iterator = new TypedFollowingIterator(type);
-        break;
-      case Axis.PRECEDING :
-        iterator = new TypedPrecedingIterator(type);
-        break;
-      case Axis.FOLLOWINGSIBLING :
-        iterator = new TypedFollowingSiblingIterator(type);
-        break;
-      case Axis.PRECEDINGSIBLING :
-        iterator = new TypedPrecedingSiblingIterator(type);
-        break;
-      case Axis.NAMESPACE :
-        iterator = new TypedNamespaceIterator(type);
-        break;
-      case Axis.ROOT :
-        iterator = new TypedRootIterator(type);
-        break;
-      default :
-        throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.names[axis]})); //"Error: typed iterator for axis "
-                               //+ Axis.names[axis] + "not implemented");
-      }
-    }
-
-    return (iterator);
-  }
-
-  /**
-   * This is a shortcut to the iterators that implement the
-   * XPath axes.
-   * Returns a bare-bones iterator that must be initialized
-   * with a start node (using iterator.setStartNode()).
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   *
-   * @return A DTMAxisIterator, or null if the given axis isn't supported.
-   */
-  public DTMAxisIterator getAxisIterator(final int axis)
-  {
-
-    DTMAxisIterator iterator = null;
-
-    switch (axis)
-    {
-    case Axis.SELF :
-      iterator = new SingletonIterator();
-      break;
-    case Axis.CHILD :
-      iterator = new ChildrenIterator();
-      break;
-    case Axis.PARENT :
-      return (new ParentIterator());
-    case Axis.ANCESTOR :
-      return (new AncestorIterator());
-    case Axis.ANCESTORORSELF :
-      return ((new AncestorIterator()).includeSelf());
-    case Axis.ATTRIBUTE :
-      return (new AttributeIterator());
-    case Axis.DESCENDANT :
-      iterator = new DescendantIterator();
-      break;
-    case Axis.DESCENDANTORSELF :
-      iterator = (new DescendantIterator()).includeSelf();
-      break;
-    case Axis.FOLLOWING :
-      iterator = new FollowingIterator();
-      break;
-    case Axis.PRECEDING :
-      iterator = new PrecedingIterator();
-      break;
-    case Axis.FOLLOWINGSIBLING :
-      iterator = new FollowingSiblingIterator();
-      break;
-    case Axis.PRECEDINGSIBLING :
-      iterator = new PrecedingSiblingIterator();
-      break;
-    case Axis.NAMESPACE :
-      iterator = new NamespaceIterator();
-      break;
-    case Axis.ROOT :
-      iterator = new RootIterator();
-      break;
-    default :
-      throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.names[axis]})); //"Error: iterator for axis '" + Axis.names[axis]
-                             //+ "' not implemented");
-    }
-
-    return (iterator);
-  }
-
-  /**
-   * Abstract superclass defining behaviors shared by all DTMDefault's
-   * internal implementations of DTMAxisIterator. Subclass this (and
-   * override, if necessary) to implement the specifics of an
-   * individual axis iterator.
-   *
-   * Currently there isn't a lot here
-   */
-  private abstract class InternalAxisIteratorBase extends DTMAxisIteratorBase
-  {
-
-    // %REVIEW% We could opt to share _nodeType and setNodeType() as
-    // well, and simply ignore them in iterators which don't use them.
-    // But Scott's worried about the overhead involved in cloning
-    // these, and wants them to have as few fields as possible. Note
-    // that we can't create a TypedInternalAxisIteratorBase because
-    // those are often based on the untyped versions and Java doesn't
-    // support multiple inheritance. <sigh/>
-
-    /**
-     * Current iteration location. Usually this is the last location
-     * returned (starting point for the next() search); for single-node
-     * iterators it may instead be initialized to point to that single node.
-     */
-    protected int _currentNode;
-
-    /**
-     * Remembers the current node for the next call to gotoMark().
-     *
-     * %REVIEW% Should this save _position too?
-     */
-    public void setMark()
-    {
-      _markedNode = _currentNode;
-    }
-
-    /**
-     * Restores the current node remembered by setMark().
-     *
-     * %REVEIW% Should this restore _position too?
-     */
-    public void gotoMark()
-    {
-      _currentNode = _markedNode;
-    }
-  }  // end of InternalAxisIteratorBase 
-
-  /**
-   * Iterator that returns all immediate children of a given node
-   */
-  private final class ChildrenIterator extends InternalAxisIteratorBase
-  {
-
-    /**
-     * Setting start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * If the iterator is not restartable, this has no effect.
-     * %REVIEW% Should it return/throw something in that case,
-     * or set current node to END, to indicate request-not-honored?
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(final int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = NOTPROCESSED;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END if no more
-     * are available.
-     */
-    public int next()
-    {
-
-      _currentNode = (NOTPROCESSED == _currentNode)
-                     ? getFirstChild(_startNode)
-                     : getNextSibling(_currentNode);
-
-      return returnNode(_currentNode);
-    }
-  }  // end of ChildrenIterator
-
-  /**
-   * Iterator that returns the parent of a given node. Note that
-   * this delivers only a single node; if you want all the ancestors,
-   * see AncestorIterator.
-   */
-  private final class ParentIterator extends InternalAxisIteratorBase
-  {
-
-    /** The extended type ID that was requested. */
-    private int _nodeType = -1;
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = getParent(node);
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Set the node type of the parent that we're looking for.
-     * Note that this does _not_ mean "find the nearest ancestor of
-     * this type", but "yield the parent if it is of this type".
-     *
-     *
-     * @param type extended type ID.
-     *
-     * @return ParentIterator configured with the type filter set.
-     */
-    public DTMAxisIterator setNodeType(final int type)
-    {
-
-      _nodeType = type;
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration. In this case, we return
-     * only the immediate parent, _if_ it matches the requested nodeType.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int result = _currentNode;
-
-      if ((_nodeType != -1) && (getExpandedTypeID(_currentNode) != _nodeType))
-        result = END;
-      else
-        result = _currentNode;
-
-      _currentNode = END;
-
-      return returnNode(result);
-    }
-  }  // end of ParentIterator
-
-  /**
-   * Iterator that returns children of a given type for a given node.
-   * The functionality chould be achieved by putting a filter on top
-   * of a basic child iterator, but a specialised iterator is used
-   * for efficiency (both speed and size of translet).
-   */
-  private final class TypedChildrenIterator extends InternalAxisIteratorBase
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedChildrenIterator
-     *
-     *
-     * @param nodeType The extended type ID being requested.
-     */
-    public TypedChildrenIterator(int nodeType)
-    {
-      _nodeType = nodeType;
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = NOTPROCESSED;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      for (int node = (NOTPROCESSED == _currentNode)
-                      ? getFirstChild(_startNode)
-                      : getNextSibling(_currentNode); node
-                        != END; node = getNextSibling(node))
-      {
-        if (getExpandedTypeID(node) == _nodeType)
-        {
-          _currentNode = node;
-
-          return returnNode(node);
-        }
-      }
-
-      return END;
-    }
-  }  // end of TypedChildrenIterator
-
-  /**
-   * Iterator that returns children within a given namespace for a
-   * given node. The functionality chould be achieved by putting a
-   * filter on top of a basic child iterator, but a specialised
-   * iterator is used for efficiency (both speed and size of translet).
-   */
-  private final class NamespaceChildrenIterator
-          extends InternalAxisIteratorBase
-  {
-
-    /** The extended type ID being requested. */
-    private final int _nsType;
-
-    /**
-     * Constructor NamespaceChildrenIterator
-     *
-     *
-     * @param type The extended type ID being requested.
-     */
-    public NamespaceChildrenIterator(final int type)
-    {
-      _nsType = type;
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = NOTPROCESSED;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      for (int node = (NOTPROCESSED == _currentNode)
-                      ? getFirstChild(_startNode)
-                      : getNextSibling(_currentNode); node
-                        != END; node = getNextSibling(node))
-      {
-        if (getNamespaceType(node) == _nsType)
-        {
-          _currentNode = node;
-
-          return returnNode(node);
-        }
-      }
-
-      return END;
-    }
-  }  // end of TypedChildrenIterator
-  
-  /**
-   * Iterator that returns the namespace nodes as defined by the XPath data model 
-   * for a given node.
-   */
-  private class NamespaceIterator
-          extends InternalAxisIteratorBase
-  {
-
-    /**
-     * Constructor NamespaceAttributeIterator
-     */
-    public NamespaceIterator()
-    {
-
-      super();
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = getFirstNamespaceNode(node, true);
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node = _currentNode;
-
-      if (DTM.NULL != node)
-        _currentNode = getNextNamespaceNode(_startNode, node, true);
-
-      return returnNode(node);
-    }
-  }  // end of NamespaceIterator
-  
-  /**
-   * Iterator that returns the namespace nodes as defined by the XPath data model 
-   * for a given node, filtered by extended type ID.
-   */
-  private class TypedNamespaceIterator extends NamespaceIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedChildrenIterator
-     *
-     *
-     * @param nodeType The extended type ID being requested.
-     */
-    public TypedNamespaceIterator(int nodeType)
-    {
-      super();
-      _nodeType = nodeType;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      for (int node = super.next(); node != END; node = super.next())
-      {
-        if (getExpandedTypeID(node) == _nodeType)
-        {
-          _currentNode = node;
-
-          return returnNode(node);
-        }
-      }
-
-      return END;
-    }
-  }  // end of TypedNamespaceIterator
-  
-  /**
-   * Iterator that returns the the root node as defined by the XPath data model 
-   * for a given node.
-   */
-  private class RootIterator
-          extends InternalAxisIteratorBase
-  {
-
-    /**
-     * Constructor RootIterator
-     */
-    public RootIterator()
-    {
-
-      super();
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = getDocument();
-        _currentNode = NULL;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-      if(_startNode == _currentNode)
-        return NULL;
-
-      _currentNode = _startNode;
-
-      return returnNode(_startNode);
-    }
-  }  // end of RootIterator
-  
-  /**
-   * Iterator that returns the namespace nodes as defined by the XPath data model 
-   * for a given node, filtered by extended type ID.
-   */
-  private class TypedRootIterator extends RootIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedRootIterator
-     *
-     * @param nodeType The extended type ID being requested.
-     */
-    public TypedRootIterator(int nodeType)
-    {
-      super();
-      _nodeType = nodeType;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      for (int node = super.next(); node != END; node = super.next())
-      {
-        if (getExpandedTypeID(node) == _nodeType)
-        {
-          _currentNode = node;
-
-          return returnNode(node);
-        }
-      }
-
-      return END;
-    }
-  }  // end of TypedRootIterator
-
-  /**
-   * Iterator that returns attributes within a given namespace for a node.
-   */
-  private final class NamespaceAttributeIterator
-          extends InternalAxisIteratorBase
-  {
-
-    /** The extended type ID being requested. */
-    private final int _nsType;
-
-    /**
-     * Constructor NamespaceAttributeIterator
-     *
-     *
-     * @param nsType The extended type ID being requested.
-     */
-    public NamespaceAttributeIterator(int nsType)
-    {
-
-      super();
-
-      _nsType = nsType;
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = getFirstNamespaceNode(node, false);
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node = _currentNode;
-
-      if (DTM.NULL != node)
-        _currentNode = getNextNamespaceNode(_startNode, node, false);
-
-      return returnNode(node);
-    }
-  }  // end of TypedChildrenIterator
-
-  /**
-   * Iterator that returns all siblings of a given node.
-   */
-  private class FollowingSiblingIterator extends InternalAxisIteratorBase
-  {
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _currentNode = _startNode = node;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-      return returnNode(_currentNode = getNextSibling(_currentNode));
-    }
-  }  // end of FollowingSiblingIterator
-
-  /**
-   * Iterator that returns all following siblings of a given node.
-   */
-  private final class TypedFollowingSiblingIterator
-          extends FollowingSiblingIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedFollowingSiblingIterator
-     *
-     *
-     * @param type The extended type ID being requested.
-     */
-    public TypedFollowingSiblingIterator(int type)
-    {
-      _nodeType = type;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node;
-
-      while ((node = super.next()) != NULL
-             && getExpandedTypeID(node) != _nodeType){}
-
-      return node;
-    }
-  }  // end of TypedFollowingSiblingIterator
-
-  /**
-   * Iterator that returns attribute nodes (of what nodes?)
-   */
-  private final class AttributeIterator extends InternalAxisIteratorBase
-  {
-
-    // assumes caller will pass element nodes
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-        _currentNode = getFirstAttribute(node);
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      final int node = _currentNode;
-
-      _currentNode = getNextAttribute(node);
-
-      return returnNode(node);
-    }
-  }  // end of AttributeIterator
-
-  /**
-   * Iterator that returns attribute nodes of a given type
-   */
-  private final class TypedAttributeIterator extends InternalAxisIteratorBase
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedAttributeIterator
-     *
-     *
-     * @param nodeType The extended type ID that is requested.
-     */
-    public TypedAttributeIterator(int nodeType)
-    {
-      _nodeType = nodeType;
-    }
-
-    // assumes caller will pass element nodes
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-
-        for (node = getFirstAttribute(node); node != END;
-                node = getNextAttribute(node))
-        {
-          if (getExpandedTypeID(node) == _nodeType)
-            break;
-        }
-
-        _currentNode = node;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      final int node = _currentNode;
-
-      // singleton iterator, since there can only be one attribute of 
-      // a given type.
-      _currentNode = NULL;
-
-      return returnNode(node);
-    }
-  }  // end of TypedAttributeIterator
-
-  /**
-   * Iterator that returns preceding siblings of a given node
-   */
-  private class PrecedingSiblingIterator extends InternalAxisIteratorBase
-  {
-
-    /**
-     * True if this iterator has a reversed axis.
-     *
-     * @return true.
-     */
-    public boolean isReverse()
-    {
-      return true;
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-      if (_isRestartable)
-      {
-        _startNode = node;
-
-        if(node == NULL)
-        {
-          _currentNode = node;
-          return resetPosition();
-        }
-          
-        int type = getExpandedTypeID(node) & ExpandedNameTable.MASK_NODETYPE;
-        if(ExpandedNameTable.ATTRIBUTE == type 
-           || ExpandedNameTable.NAMESPACE == type )
-        {
-          _currentNode = node;
-        }
-        else
-          _currentNode = getFirstChild(getParent(node));
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      if (_currentNode == _startNode)
-      {
-        return NULL;
-      }
-      else
-      {
-        final int node = _currentNode;
-        _currentNode = getNextSibling(node);
-
-        return returnNode(node);
-      }
-    }
-  }  // end of PrecedingSiblingIterator
-
-  /**
-   * Iterator that returns preceding siblings of a given type for
-   * a given node
-   */
-  private final class TypedPrecedingSiblingIterator
-          extends PrecedingSiblingIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedPrecedingSiblingIterator
-     *
-     *
-     * @param type The extended type ID being requested.
-     */
-    public TypedPrecedingSiblingIterator(int type)
-    {
-      _nodeType = type;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node;
-
-      while ((node = super.next()) != NULL
-             && getExpandedTypeID(node) != _nodeType){}
-
-      return node;
-    }
-  }  // end of PrecedingSiblingIterator
-
-  /**
-   * Iterator that returns preceding nodes of a given node.
-   * This includes the node set {root+1, start-1}, but excludes
-   * all ancestors.
-   */
-  private class PrecedingIterator extends InternalAxisIteratorBase
-  {
-
-    /** The max ancestors, but it can grow... */
-    private final int _maxAncestors = 8;
-
-    /**
-     * The stack of start node + ancestors up to ROOTNODE,
-     *  which we must avoid.
-     */
-    private int[] _stack = new int[_maxAncestors];
-
-    /** (not sure yet... -sb) */
-    private int _sp, _oldsp;
-
-    /* _currentNode precedes candidates.  This is the identity, not the handle! */
-
-    /**
-     * True if this iterator has a reversed axis.
-     *
-     * @return true since this iterator is a reversed axis.
-     */
-    public boolean isReverse()
-    {
-      return true;
-    }
-
-    /**
-     * Returns a deep copy of this iterator.   The cloned iterator is not reset.
-     *
-     * @return a deep copy of this iterator.
-     */
-    public DTMAxisIterator cloneIterator()
-    {
-      _isRestartable = false;
-
-      try
-      {
-        final PrecedingIterator clone = (PrecedingIterator) super.clone();
-        final int[] stackCopy = new int[_stack.length];
-        System.arraycopy(_stack, 0, stackCopy, 0, _stack.length);
-
-        clone._stack = stackCopy;
-
-        // return clone.reset();
-        return clone;
-      }
-      catch (CloneNotSupportedException e)
-      {
-        throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
-      }
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        node = node & m_mask;
-
-        // iterator is not a clone
-        int parent, index;
-
-        _startNode = node;
-        _currentNode = ROOTNODE;  // Remember it's the identity, not the full handle.
-        _stack[index = 0] = node;
-
-        if (node > ROOTNODE)
-        {
-          while ((parent = _parent(node)) != ROOTNODE)
-          {
-            if (++index == _stack.length)
-            {
-              final int[] stack = new int[index + 4];
-
-              System.arraycopy(_stack, 0, stack, 0, index);
-
-              _stack = stack;
-            }
-
-            _stack[index] = node = parent;
-          }
-        }
-
-        _oldsp = _sp = index;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      final int node = _currentNode + 1;
-
-      if ((_sp >= 0) && (node < _stack[_sp]))
-      {
-        return returnNode((_currentNode = node) | m_dtmIdent);
-      }
-      else
-      {
-        _currentNode = node;  // skip ancestor
-
-        return --_sp >= 0 ? next() : NULL;
-      }
-    }
-
-    // redefine DTMAxisIteratorBase's reset
-
-    /**
-     * Resets the iterator to the last start node.
-     *
-     * @return A DTMAxisIterator, which may or may not be the same as this
-     *         iterator.
-     */
-    public DTMAxisIterator reset()
-    {
-
-      _sp = _oldsp;
-
-      return resetPosition();
-    }
-  }  // end of PrecedingIterator
-
-  /**
-   * Iterator that returns preceding nodes of agiven type for a
-   * given node. This includes the node set {root+1, start-1}, but
-   * excludes all ancestors.
-   */
-  private final class TypedPrecedingIterator extends PrecedingIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedPrecedingIterator
-     *
-     *
-     * @param type The extended type ID being requested.
-     */
-    public TypedPrecedingIterator(int type)
-    {
-      _nodeType = type;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node;
-
-      while ((node = super.next()) != NULL
-             && getExpandedTypeID(node) != _nodeType){}
-
-      return node;
-    }
-  }  // end of TypedPrecedingIterator
-
-  /**
-   * Iterator that returns following nodes of for a given node.
-   */
-  private class FollowingIterator extends InternalAxisIteratorBase
-  {
-    DTMAxisTraverser m_traverser; // easier for now
-    
-    public FollowingIterator()
-    {
-      m_traverser = getAxisTraverser(Axis.FOLLOWING);
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        _startNode = node;
-
-        // ?? -sb
-        // find rightmost descendant (or self)
-        // int current;
-        // while ((node = getLastChild(current = node)) != NULL){}
-        // _currentNode = current;
-        _currentNode = m_traverser.first(node);
-
-        // _currentNode precedes possible following(node) nodes
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node = _currentNode;
-
-      _currentNode = m_traverser.next(_startNode, _currentNode);
-
-      return returnNode(node);
-    }
-  }  // end of FollowingIterator
-
-  /**
-   * Iterator that returns following nodes of a given type for a given node.
-   */
-  private final class TypedFollowingIterator extends FollowingIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedFollowingIterator
-     *
-     *
-     * @param type The extended type ID being requested.
-     */
-    public TypedFollowingIterator(int type)
-    {
-      _nodeType = type;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node;
-
-      while ((node = super.next()) != NULL
-             && getExpandedTypeID(node) != _nodeType){}
-
-      return returnNode(node);
-    }
-  }  // end of TypedFollowingIterator
-
-  /**
-   * Iterator that returns the ancestors of a given node in document
-   * order.  (NOTE!  This was changed from the XSLTC code!)
-   */
-  private class AncestorIterator extends InternalAxisIteratorBase
-  {
-    org.apache.xml.utils.NodeVector m_ancestors = 
-         new org.apache.xml.utils.NodeVector();
-         
-    int m_ancestorsPos;
-    
-    /** The real start node for this axes, since _startNode will be adjusted. */
-    int m_realStartNode;
-    
-    /**
-     * Get start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @return The root node of the iteration.
-     */
-    public int getStartNode()
-    {
-      return m_realStartNode;
-    }
-
-    /**
-     * True if this iterator has a reversed axis.
-     *
-     * @return true since this iterator is a reversed axis.
-     */
-    public final boolean isReverse()
-    {
-      return true;
-    }
-
-    /**
-     * Returns the last element in this interation.
-     *
-     * %TBD% %BUG% This is returning a nodeHandle rather than a _position
-     * value. That conflicts with what everyone else is doing. And it's
-     * talking about the start node, which conflicts with some of the
-     * other reverse iterators. DEFINITE BUG; needs to be reconciled.
-     *
-     * @return the last element in this interation.
-     */
-    public int getLast()
-    {
-      return (_startNode);
-    }
-
-    /**
-     * Returns a deep copy of this iterator.  The cloned iterator is not reset.
-     *
-     * @return a deep copy of this iterator.
-     */
-    public DTMAxisIterator cloneIterator()
-    {
-      _isRestartable = false;  // must set to false for any clone
-
-      try
-      {
-        final AncestorIterator clone = (AncestorIterator) super.clone();
-
-        clone._startNode = _startNode;
-
-        // return clone.reset();
-        return clone;
-      }
-      catch (CloneNotSupportedException e)
-      {
-        throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
-      }
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-      m_realStartNode = node;
-
-      if (_isRestartable)
-      {
-        if (_includeSelf)
-          _startNode = node;
-        else
-          _startNode = getParent(node);
-
-        _currentNode = getDocument();
-        
-        node = _startNode;
-        while (node != END)
-        {
-          m_ancestors.addElement(node);
-          node = getParent(node);
-        }
-        m_ancestorsPos = m_ancestors.size()-1;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Resets the iterator to the last start node.
-     *
-     * @return A DTMAxisIterator, which may or may not be the same as this
-     *         iterator.
-     */
-    public DTMAxisIterator reset()
-    {
-
-      _currentNode = getDocument();
-            
-      m_ancestorsPos = m_ancestors.size()-1;
-
-      return resetPosition();
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int next = _currentNode;
-      
-      int pos = m_ancestorsPos--;
-      if(pos < 0)
-        _currentNode = DTM.NULL;
-      else
-        _currentNode = m_ancestors.elementAt(pos);
-      
-      return returnNode(next);
-    }
-  }  // end of AncestorIterator
-
-  /**
-   * Typed iterator that returns the ancestors of a given node.
-   */
-  private final class TypedAncestorIterator extends AncestorIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedAncestorIterator
-     *
-     *
-     * @param type The extended type ID being requested.
-     */
-    public TypedAncestorIterator(int type)
-    {
-      _nodeType = type;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node;
-
-      while ((node = super.next()) != NULL)
-      {
-        if (getExpandedTypeID(node) == _nodeType)
-          return returnNode(node);
-      }
-
-      return (NULL);
-    }
-
-    /**
-     * Returns the last element in this interation.
-     *
-     * @return the last element in this interation.
-     */
-    public int getLast()
-    {
-
-      int last = NULL;
-      int curr = _startNode;
-
-      while (curr != NULL)
-      {
-        if (getExpandedTypeID(curr) == _nodeType)
-          last = curr;
-
-        curr = getParent(curr);
-      }
-
-      return (last);
-    }
-  }  // end of TypedAncestorIterator
-
-  /**
-   * Iterator that returns the descendants of a given node.
-   */
-  private class DescendantIterator extends InternalAxisIteratorBase
-  {
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isRestartable)
-      {
-        node = node & m_mask;
-        _startNode = node;
-
-        if (_includeSelf)
-          node--;
-
-        _currentNode = node;
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Tell if this node identity is a descendant.  Assumes that
-     * the node info for the element has already been obtained.
-     *
-     * This one-sided test works only if the parent has been
-     * previously tested and is known to be a descendent. It fails if
-     * the parent is the _startNode's next sibling, or indeed any node
-     * that follows _startNode in document order.  That may suffice
-     * for this iterator, but it's not really an isDescendent() test.
-     * %REVIEW% rename?
-     *
-     * @param identity The index number of the node in question.
-     * @return true if the index is a descendant of _startNode.
-     */
-    protected boolean isDescendant(int identity)
-    {
-      return (_startNode == identity) || _parent(identity) >= _startNode;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      while (true)
-      {
-        int node = ++_currentNode;
-        int type = _type(node);
-
-        if (NULL == type ||!isDescendant(node))
-          return END;
-
-        if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
-          continue;
-
-        return returnNode(node | m_dtmIdent);  // make handle.
-      }
-    }
-  }  // end of DescendantIterator
-
-  /**
-   * Typed iterator that returns the descendants of a given node.
-   */
-  private final class TypedDescendantIterator extends DescendantIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedDescendantIterator
-     *
-     *
-     * @param nodeType Extended type ID being requested.
-     */
-    public TypedDescendantIterator(int nodeType)
-    {
-      _nodeType = nodeType;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      int node;
-
-      while ((node = super.next()) != NULL
-             && getExpandedTypeID(node) != _nodeType){}
-
-      return node;
-    }
-  }  // end of TypedDescendantIterator
-
-  /**
-   * Iterator that returns the descendants of a given node.
-   * I'm not exactly clear about this one... -sb
-   */
-  private class NthDescendantIterator extends DescendantIterator
-  {
-
-    /** The current nth position. */
-    int _pos;
-
-    /**
-     * Constructor NthDescendantIterator
-     *
-     *
-     * @param pos The nth position being requested.
-     */
-    public NthDescendantIterator(int pos)
-    {
-      _pos = pos;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      // I'm not exactly clear yet what this is doing... -sb
-      int node;
-
-      while ((node = super.next()) != END)
-      {
-        node = (node & m_mask);
-
-        int parent = _parent(node);
-        int child = _firstch(parent);
-        int pos = 0;
-
-        do
-        {
-          int type = _type(child);
-
-          if (ELEMENT_NODE == type)
-            pos++;
-        }
-        while ((pos < _pos) && (child = _nextsib(child)) != END);
-
-        if (node == child)
-          return node;
-      }
-
-      return (END);
-    }
-  }  // end of NthDescendantIterator
-
-  /**
-   * Class SingletonIterator.
-   */
-  private class SingletonIterator extends InternalAxisIteratorBase
-  {
-
-    /** (not sure yet what this is.  -sb)  (sc & sb remove final to compile in JDK 1.1.8) */
-    private boolean _isConstant;
-
-    /**
-     * Constructor SingletonIterator
-     *
-     */
-    public SingletonIterator()
-    {
-      this(Integer.MIN_VALUE, false);
-    }
-
-    /**
-     * Constructor SingletonIterator
-     *
-     *
-     * @param node The node handle to return.
-     */
-    public SingletonIterator(int node)
-    {
-      this(node, false);
-    }
-
-    /**
-     * Constructor SingletonIterator
-     *
-     *
-     * @param node the node handle to return.
-     * @param constant (Not sure what this is yet.  -sb)
-     */
-    public SingletonIterator(int node, boolean constant)
-    {
-      _currentNode = _startNode = node;
-      _isConstant = constant;
-    }
-
-    /**
-     * Set start to END should 'close' the iterator,
-     * i.e. subsequent call to next() should return END.
-     *
-     * @param node Sets the root of the iteration.
-     *
-     * @return A DTMAxisIterator set to the start of the iteration.
-     */
-    public DTMAxisIterator setStartNode(int node)
-    {
-
-      if (_isConstant)
-      {
-        _currentNode = _startNode;
-
-        return resetPosition();
-      }
-      else if (_isRestartable)
-      {
-        if (_currentNode == Integer.MIN_VALUE)
-        {
-          _currentNode = _startNode = node;
-        }
-
-        return resetPosition();
-      }
-
-      return this;
-    }
-
-    /**
-     * Resets the iterator to the last start node.
-     *
-     * @return A DTMAxisIterator, which may or may not be the same as this
-     *         iterator.
-     */
-    public DTMAxisIterator reset()
-    {
-
-      if (_isConstant)
-      {
-        _currentNode = _startNode;
-
-        return resetPosition();
-      }
-      else
-      {
-        final boolean temp = _isRestartable;
-
-        _isRestartable = true;
-
-        setStartNode(_startNode);
-
-        _isRestartable = temp;
-      }
-
-      return this;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      final int result = _currentNode;
-
-      _currentNode = END;
-
-      return returnNode(result);
-    }
-  }
-
-  /**
-   * Iterator that returns a given node only if it is of a given type.
-   */
-  private final class TypedSingletonIterator extends SingletonIterator
-  {
-
-    /** The extended type ID that was requested. */
-    private final int _nodeType;
-
-    /**
-     * Constructor TypedSingletonIterator
-     *
-     *
-     * @param nodeType The extended type ID being requested.
-     */
-    public TypedSingletonIterator(int nodeType)
-    {
-      _nodeType = nodeType;
-    }
-
-    /**
-     * Get the next node in the iteration.
-     *
-     * @return The next node handle in the iteration, or END.
-     */
-    public int next()
-    {
-
-      final int result = super.next();
-
-      return getExpandedTypeID(result) == _nodeType ? result : NULL;
-    }
-  }  // end of TypedSingletonIterator
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java b/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java
deleted file mode 100644
index 8f57966..0000000
--- a/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java
+++ /dev/null
@@ -1,1669 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-
-import javax.xml.transform.Source;
-
-import org.apache.xml.utils.XMLStringFactory;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * This class implements the traversers for DTMDefaultBase.
- */
-public abstract class DTMDefaultBaseTraversers extends DTMDefaultBase
-{
-
-  /**
-   * Construct a DTMDefaultBaseTraversers object from a DOM node.
-   *
-   * @param mgr The DTMManager who owns this DTM.
-   * @param domSource the DOM source that this DTM will wrap.
-   * @param source The object that is used to specify the construction source.
-   * @param dtmIdentity The DTM identity ID for this DTM.
-   * @param whiteSpaceFilter The white space filter for this DTM, which may
-   *                         be null.
-   * @param xstringfactory The factory to use for creating XMLStrings.
-   * @param doIndexing true if the caller considers it worth it to use
-   *                   indexing schemes.
-   */
-  public DTMDefaultBaseTraversers(DTMManager mgr, Source source,
-                                  int dtmIdentity,
-                                  DTMWSFilter whiteSpaceFilter,
-                                  XMLStringFactory xstringfactory,
-                                  boolean doIndexing)
-  {
-    super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
-          doIndexing);
-  }
-
-  /**
-   * This returns a stateless "traverser", that can navigate
-   * over an XPath axis, though perhaps not in document order.
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   *
-   * @return A DTMAxisTraverser, or null if the given axis isn't supported.
-   */
-  public DTMAxisTraverser getAxisTraverser(final int axis)
-  {
-
-    DTMAxisTraverser traverser;
-
-    if (null == m_traversers)  // Cache of stateless traversers for this DTM
-    {
-      m_traversers = new DTMAxisTraverser[Axis.names.length];
-      traverser = null;
-    }
-    else
-    {
-      traverser = m_traversers[axis];  // Share/reuse existing traverser
-
-      if (traverser != null)
-        return traverser;
-    }
-
-    switch (axis)  // Generate new traverser
-    {
-    case Axis.ANCESTOR :
-      traverser = new AncestorTraverser();
-      break;
-    case Axis.ANCESTORORSELF :
-      traverser = new AncestorOrSelfTraverser();
-      break;
-    case Axis.ATTRIBUTE :
-      traverser = new AttributeTraverser();
-      break;
-    case Axis.CHILD :
-      traverser = new ChildTraverser();
-      break;
-    case Axis.DESCENDANT :
-      traverser = new DescendantTraverser();
-      break;
-    case Axis.DESCENDANTORSELF :
-      traverser = new DescendantOrSelfTraverser();
-      break;
-    case Axis.FOLLOWING :
-      traverser = new FollowingTraverser();
-      break;
-    case Axis.FOLLOWINGSIBLING :
-      traverser = new FollowingSiblingTraverser();
-      break;
-    case Axis.NAMESPACE :
-      traverser = new NamespaceTraverser();
-      break;
-    case Axis.NAMESPACEDECLS :
-      traverser = new NamespaceDeclsTraverser();
-      break;
-    case Axis.PARENT :
-      traverser = new ParentTraverser();
-      break;
-    case Axis.PRECEDING :
-      traverser = new PrecedingTraverser();
-      break;
-    case Axis.PRECEDINGSIBLING :
-      traverser = new PrecedingSiblingTraverser();
-      break;
-    case Axis.SELF :
-      traverser = new SelfTraverser();
-      break;
-    case Axis.ALL :
-      traverser = new AllFromRootTraverser();
-      break;
-    case Axis.ALLFROMNODE :
-      traverser = new AllFromNodeTraverser();
-      break;
-    case Axis.PRECEDINGANDANCESTOR :
-      traverser = new PrecedingAndAncestorTraverser();
-      break;
-    case Axis.DESCENDANTSFROMROOT :
-      traverser = new DescendantFromRootTraverser();
-      break;
-    case Axis.DESCENDANTSORSELFFROMROOT :
-      traverser = new DescendantOrSelfFromRootTraverser();
-      break;
-    case Axis.ROOT :
-      traverser = new RootTraverser();
-      break;
-    case Axis.FILTEREDLIST :
-      return null; // Don't want to throw an exception for this one.
-    default :
-      throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_UNKNOWN_AXIS_TYPE, new Object[]{Integer.toString(axis)})); //"Unknown axis traversal type: "+axis);
-    }
-
-    if (null == traverser)
-      throw new DTMException("Axis traverser not supported: "
-                             + Axis.names[axis]);
-
-    m_traversers[axis] = traverser;
-
-    return traverser;
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class AncestorTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node if this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-      return m_parent.elementAt(current & m_mask) | m_dtmIdent;
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      current = current & m_mask;
-
-      while (DTM.NULL != (current = m_parent.elementAt(current)))
-      {
-        if (m_exptype.elementAt(current) == extendedTypeID)
-          return current | m_dtmIdent;
-      }
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class AncestorOrSelfTraverser extends AncestorTraverser
-  {
-
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  To see if
-     * the self node should be processed, use this function.
-     *
-     * @param context The context node of this traversal.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return context;
-    }
-
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  To see if
-     * the self node should be processed, use this function.  If the context
-     * node does not match the extended type ID, this function will return
-     * false.
-     *
-     * @param context The context node of this traversal.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context, int extendedTypeID)
-    {
-      return (m_exptype.elementAt(context & m_mask) == extendedTypeID)
-             ? context : next(context, context, extendedTypeID);
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class AttributeTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-      return (context == current)
-             ? getFirstAttribute(context) : getNextAttribute(current);
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      current = (context == current)
-                ? getFirstAttribute(context) : getNextAttribute(current);
-
-      do
-      {
-        if (m_exptype.elementAt(current) == extendedTypeID)
-          return current;
-      }
-      while (DTM.NULL != (current = getNextAttribute(current)));
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class ChildTraverser extends DTMAxisTraverser
-  {
-    
-    /**
-     * Get the next indexed node that matches the extended type ID.  Before 
-     * calling this function, one should first call 
-     * {@link #isIndexed(int) isIndexed} to make sure that the index can 
-     * contain nodes that match the given extended type ID.
-     *
-     * @param axisRoot The root identity of the axis.
-     * @param nextPotential The node found must match or occur after this node.
-     * @param extendedTypeID The extended type ID for the request.
-     *
-     * @return The node or NULL if not found.
-     */
-    protected int getNextIndexed(int axisRoot, int nextPotential,
-                                 int extendedTypeID)
-    {
-
-      int nsIndex = m_expandedNameTable.getNamespaceID(extendedTypeID);
-      int lnIndex = m_expandedNameTable.getLocalNameID(extendedTypeID);
-
-      for (; ; ) 
-      {
-        int next = findElementFromIndex(nsIndex, lnIndex, nextPotential);
-
-        if (NOTPROCESSED != next)
-        {
-          int parent = m_parent.elementAt(next);
-          
-          // Is it a child?
-          if(parent == axisRoot)
-            return next;
-          
-          // If the parent occured before the subtree root, then 
-          // we know it is past the child axis.
-          if(parent < axisRoot)
-              return NULL;
-          
-          // Otherwise, it could be a descendant below the subtree root 
-          // children, or it could be after the subtree root.  So we have 
-          // to climb up until the parent is less than the subtree root, in 
-          // which case we return NULL, or until it is equal to the subtree 
-          // root, in which case we continue to look.
-          do
-          {
-            parent = m_parent.elementAt(parent);
-            if(parent < axisRoot)
-              return NULL;
-          }
-            while(parent > axisRoot);
-          
-          // System.out.println("Found node via index: "+first);
-          nextPotential = next+1;
-          continue;
-        }
-
-        nextNode();
-        
-        if(!(m_nextsib.elementAt(axisRoot) == NOTPROCESSED))
-          break;
-      }
-
-      return DTM.NULL;
-    }
-        
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  So to traverse 
-     * an axis, the first function must be used to get the first node.
-     *
-     * <p>This method needs to be overloaded only by those axis that process
-     * the self node. <\p>
-     *
-     * @param context The context node of this traversal. This is the point
-     * that the traversal starts from.
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return _firstch(context & m_mask) | m_dtmIdent;
-    }
-  
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  So to traverse 
-     * an axis, the first function must be used to get the first node.
-     *
-     * <p>This method needs to be overloaded only by those axis that process
-     * the self node. <\p>
-     *
-     * @param context The context node of this traversal. This is the point
-     * of origin for the traversal -- its "root node" or starting point.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context, int extendedTypeID)
-    {
-      if(true)
-      {
-        int identity = context & m_mask;
-        
-        int firstMatch = getNextIndexed(identity, _firstch(identity),
-                                 extendedTypeID);
-       
-        return firstMatch | m_dtmIdent;
-      }
-      else
-      {
-        for (int current = _firstch(context & m_mask); 
-             DTM.NULL != current; 
-             current = _nextsib(current)) 
-        {
-          if (m_exptype.elementAt(current) == extendedTypeID)
-              return current | m_dtmIdent;
-        }
-        return NULL;
-      }
-    }
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-      
-      return _nextsib(current & m_mask) | m_dtmIdent;
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      for (current = _nextsib(current & m_mask); 
-           DTM.NULL != current; 
-           current = _nextsib(current)) 
-      {
-        if (m_exptype.elementAt(current) == extendedTypeID)
-            return current | m_dtmIdent;
-      }
-      
-      return NULL;
-    }
-  }
-
-  /**
-   * Super class for derived classes that want a convenient way to access 
-   * the indexing mechanism.
-   */
-  private abstract class IndexedDTMAxisTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Tell if the indexing is on and the given extended type ID matches 
-     * what is in the indexes.  Derived classes should call this before 
-     * calling {@link #getNextIndexed(int, int, int) getNextIndexed} method.
-     *
-     * @param extendedTypeID The extended type ID being requested.
-     *
-     * @return true if it is OK to call the 
-     *         {@link #getNextIndexed(int, int, int) getNextIndexed} method.
-     */
-    protected final boolean isIndexed(int extendedTypeID)
-    {
-
-      return (m_indexing
-              && ExpandedNameTable.ELEMENT
-                 == (extendedTypeID & ExpandedNameTable.MASK_NODETYPE));
-    }
-
-    /**
-     * Tell if a node is outside the axis being traversed.  This method must be 
-     * implemented by derived classes, and must be robust enough to handle any 
-     * node that occurs after the axis root.
-     *
-     * @param axisRoot The root identity of the axis.
-     * @param identity The node in question.
-     *
-     * @return true if the given node falls outside the axis being traversed.
-     */
-    protected abstract boolean isAfterAxis(int axisRoot, int identity);
-
-    /**
-     * Tell if the axis has been fully processed to tell if a the wait for 
-     * an arriving node should terminate.  This method must be implemented 
-     * be a derived class.
-     *
-     * @param axisRoot The root identity of the axis.
-     *
-     * @return true if the axis has been fully processed.
-     */
-    protected abstract boolean axisHasBeenProcessed(int axisRoot);
-
-    /**
-     * Get the next indexed node that matches the extended type ID.  Before 
-     * calling this function, one should first call 
-     * {@link #isIndexed(int) isIndexed} to make sure that the index can 
-     * contain nodes that match the given extended type ID.
-     *
-     * @param axisRoot The root identity of the axis.
-     * @param nextPotential The node found must match or occur after this node.
-     * @param extendedTypeID The extended type ID for the request.
-     *
-     * @return The node or NULL if not found.
-     */
-    protected int getNextIndexed(int axisRoot, int nextPotential,
-                                 int extendedTypeID)
-    {
-
-      int nsIndex = m_expandedNameTable.getNamespaceID(extendedTypeID);
-      int lnIndex = m_expandedNameTable.getLocalNameID(extendedTypeID);
-
-      while(true)
-      {
-        int next = findElementFromIndex(nsIndex, lnIndex, nextPotential);
-
-        if (NOTPROCESSED != next)
-        {
-          if (isAfterAxis(axisRoot, next))
-            return NULL;
-
-          // System.out.println("Found node via index: "+first);
-          return next;
-        }
-        else if(axisHasBeenProcessed(axisRoot))
-          break;
-
-        nextNode();
-      }
-
-      return DTM.NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class DescendantTraverser extends IndexedDTMAxisTraverser
-  {
-    /**
-     * Get the first potential identity that can be returned.  This should 
-     * be overridded by classes that need to return the self node.
-     *
-     * @param identity The node identity of the root context of the traversal.
-     *
-     * @return The first potential node that can be in the traversal.
-     */
-    protected int getFirstPotential(int identity)
-    {
-      return identity + 1;
-    }
-    
-    /**
-     * Tell if the axis has been fully processed to tell if a the wait for 
-     * an arriving node should terminate.
-     *
-     * @param axisRoot The root identity of the axis.
-     *
-     * @return true if the axis has been fully processed.
-     */
-    protected boolean axisHasBeenProcessed(int axisRoot)
-    {
-      return !(m_nextsib.elementAt(axisRoot) == NOTPROCESSED);
-    }
-    
-    /**
-     * Get the subtree root identity from the handle that was passed in by 
-     * the caller.  Derived classes may override this to change the root 
-     * context of the traversal.
-     * 
-     * @param handle handle to the root context.
-     * @return identity of the root of the subtree.
-     */
-    protected int getSubtreeRoot(int handle)
-    {
-      return handle & m_mask;
-    }
-
-    /**
-     * Tell if this node identity is a descendant.  Assumes that
-     * the node info for the element has already been obtained.
-     *
-     * %REVIEW% This is really parentFollowsRootInDocumentOrder ...
-     * which fails if the parent starts after the root ends.
-     * May be sufficient for this class's logic, but misleadingly named!
-     *
-     * @param subtreeRootIdentity The root context of the subtree in question.
-     * @param identity The index number of the node in question.
-     * @return true if the index is a descendant of _startNode.
-     */
-    protected boolean isDescendant(int subtreeRootIdentity, int identity)
-    {
-      return _parent(identity) >= subtreeRootIdentity;
-    }
-
-    /**
-     * Tell if a node is outside the axis being traversed.  This method must be 
-     * implemented by derived classes, and must be robust enough to handle any 
-     * node that occurs after the axis root.
-     *
-     * @param axisRoot The root identity of the axis.
-     * @param identity The node in question.
-     *
-     * @return true if the given node falls outside the axis being traversed.
-     */
-    protected boolean isAfterAxis(int axisRoot, int identity)
-    {   
-      // %REVIEW% Is there *any* cheaper way to do this?
-      do
-      {
-        if(identity == axisRoot)
-          return false;
-        identity = m_parent.elementAt(identity);
-      }
-        while(identity >= axisRoot);
-        
-      return true;
-    }
-
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  So to traverse
-     * an axis, the first function must be used to get the first node.
-     *
-     * <p>This method needs to be overloaded only by those axis that process
-     * the self node. <\p>
-     *
-     * @param context The context node of this traversal. This is the point
-     * of origin for the traversal -- its "root node" or starting point.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context, int extendedTypeID)
-    {
-
-      if (isIndexed(extendedTypeID))
-      {
-        int identity = getSubtreeRoot(context);
-        int firstPotential = getFirstPotential(identity);
-
-        return getNextIndexed(identity, firstPotential, extendedTypeID)|m_dtmIdent;
-      }
-
-      return next(context, context, extendedTypeID);
-    }
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      int subtreeRootIdent = getSubtreeRoot(context);
-
-      for (current = (current & m_mask) + 1; ; current++)
-      {
-        int type = _type(current);  // may call nextNode()
-
-        if (!isDescendant(subtreeRootIdent, current))
-          return NULL;
-
-        if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      int subtreeRootIdent = getSubtreeRoot(context);
-
-      current = (current & m_mask) + 1;
-
-      if (isIndexed(extendedTypeID))
-      {
-        return getNextIndexed(subtreeRootIdent, current, extendedTypeID)|m_dtmIdent;
-      }
-
-      for (; ; current++)
-      {
-        int exptype = _exptype(current);  // may call nextNode()
-
-        if (!isDescendant(subtreeRootIdent, current))
-          return NULL;
-
-        if (exptype != extendedTypeID)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class DescendantOrSelfTraverser extends DescendantTraverser
-  {
-
-    /**
-     * Get the first potential identity that can be returned, which is the 
-     * axis context, in this case.
-     *
-     * @param identity The node identity of the root context of the traversal.
-     *
-     * @return The axis context.
-     */
-    protected int getFirstPotential(int identity)
-    {
-      return identity;
-    }
-
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  To see if
-     * the self node should be processed, use this function.
-     *
-     * @param context The context node of this traversal.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return context;
-    }
-  }
-
-  /**
-   * Implements traversal of the entire subtree, including the root node.
-   */
-  private class AllFromNodeTraverser extends DescendantOrSelfTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) + 1; ; current++)
-      {
-
-        // Trickological code: _exptype() has the side-effect of
-        // running nextNode until the specified node has been loaded,
-        // and thus can be used to ensure that incremental construction of
-        // the DTM has gotten this far. Using it just for that side-effect
-        // is a bit of a kluge...
-        _exptype(current);  // make sure it's here.
-
-        if (!isDescendant(subtreeRootIdent, current))
-          return NULL;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-  }
-
-  /**
-   * Implements traversal of the following access, in document order.
-   */
-  private class FollowingTraverser extends DescendantTraverser
-  {
-
-    /**
-     * Get the first of the following.
-     *
-     * @param context The context node of this traversal. This is the point
-     * that the traversal starts from.
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-
-      int first;
-      int type = _type(context);
-
-      if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type))
-      {
-        context = getParent(context);
-        first = getFirstChild(context);
-
-        if (NULL != first)
-          return first;
-      }
-
-      do
-      {
-        first = getNextSibling(context);
-
-        if (NULL == first)
-          context = getParent(context);
-      }
-      while (NULL == first && NULL != context);
-
-      return first;
-    }
-
-    /**
-     * Get the first of the following.
-     *
-     * @param context The context node of this traversal. This is the point
-     * of origin for the traversal -- its "root node" or starting point.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context, int extendedTypeID)
-    {
-
-      int first;
-      int type = _type(context);
-
-      if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type))
-      {
-        context = getParent(context);
-        first = getFirstChild(context);
-
-        if (NULL != first)
-        {
-          if (_exptype(first) == extendedTypeID)
-            return first;
-          else
-            return next(context, first, extendedTypeID);
-        }
-      }
-
-      do
-      {
-        first = getNextSibling(context);
-
-        if (NULL == first)
-          context = getParent(context);
-        else
-        {
-          if (_exptype(first) == extendedTypeID)
-            return first;
-          else
-            return next(context, first, extendedTypeID);
-        }
-      }
-      while (NULL == first && NULL != context);
-
-      return first;
-    }
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      while (true)
-      {
-        current++;
-
-        int type = _type(current);  // may call nextNode()
-
-        if (NULL == type)
-          return NULL;
-
-        if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      while (true)
-      {
-        current++;
-
-        int etype = _exptype(current);  // may call nextNode()
-
-        if (NULL == etype)
-          return NULL;
-
-        if (etype != extendedTypeID)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class FollowingSiblingTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-      return getNextSibling(current);
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      while (DTM.NULL != (current = getNextSibling(current)))
-      {
-        if (m_exptype.elementAt(current & m_mask) == extendedTypeID)
-          return current;
-      }
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class NamespaceDeclsTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      return (context == current)
-             ? getFirstNamespaceNode(context, false)
-             : getNextNamespaceNode(context, current, false);
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      current = (context == current)
-                ? getFirstNamespaceNode(context, false)
-                : getNextNamespaceNode(context, current, false);
-
-      do
-      {
-        if (m_exptype.elementAt(current) == extendedTypeID)
-          return current;
-      }
-      while (DTM.NULL
-             != (current = getNextNamespaceNode(context, current, false)));
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class NamespaceTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      return (context == current)
-             ? getFirstNamespaceNode(context, true)
-             : getNextNamespaceNode(context, current, true);
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      current = (context == current)
-                ? getFirstNamespaceNode(context, true)
-                : getNextNamespaceNode(context, current, true);
-
-      do
-      {
-        if (m_exptype.elementAt(current) == extendedTypeID)
-          return current;
-      }
-      while (DTM.NULL
-             != (current = getNextNamespaceNode(context, current, true)));
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class ParentTraverser extends DTMAxisTraverser
-  {
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  So to traverse 
-     * an axis, the first function must be used to get the first node.
-     *
-     * <p>This method needs to be overloaded only by those axis that process
-     * the self node. <\p>
-     *
-     * @param context The context node of this traversal. This is the point
-     * that the traversal starts from.
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return m_parent.elementAt(context & m_mask) | m_dtmIdent;
-    }
-  
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  So to traverse 
-     * an axis, the first function must be used to get the first node.
-     *
-     * <p>This method needs to be overloaded only by those axis that process
-     * the self node. <\p>
-     *
-     * @param context The context node of this traversal. This is the point
-     * of origin for the traversal -- its "root node" or starting point.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int current, int extendedTypeID)
-    {
-      current = current & m_mask;
-
-      while (NULL != (current = m_parent.elementAt(current)))
-      {
-        if (m_exptype.elementAt(current) == extendedTypeID)
-          return (current | m_dtmIdent);
-      }
-
-      return NULL;
-    }
-
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      return NULL;
-    }
-    
-
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class PrecedingTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Tell if the current identity is an ancestor of the context identity.
-     * This is an expensive operation, made worse by the stateless traversal.
-     * But the preceding axis is used fairly infrequently.
-     *
-     * @param contextIdent The context node of the axis traversal.
-     * @param currentIdent The node in question.
-     * @return true if the currentIdent node is an ancestor of contextIdent.
-     */
-    protected boolean isAncestor(int contextIdent, int currentIdent)
-    {
-
-      for (contextIdent = m_parent.elementAt(contextIdent); DTM.NULL != contextIdent;
-              contextIdent = m_parent.elementAt(contextIdent))
-      {
-        if (contextIdent == currentIdent)
-          return true;
-      }
-
-      return false;
-    }
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) - 1; current >= 0; current--)
-      {
-        int exptype = m_exptype.elementAt(current);
-        short type = ExpandedNameTable.getType(exptype);
-
-        if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type
-                || isAncestor(subtreeRootIdent, current))
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-
-      return NULL;
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) - 1; current >= 0; current--)
-      {
-        int exptype = m_exptype.elementAt(current);
-        short type = ExpandedNameTable.getType(exptype);
-
-        if (exptype != extendedTypeID
-                || isAncestor(subtreeRootIdent, current))
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor and the Preceding axis,
-   * in reverse document order.
-   */
-  private class PrecedingAndAncestorTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) - 1; current >= 0; current--)
-      {
-        int exptype = m_exptype.elementAt(current);
-        short type = ExpandedNameTable.getType(exptype);
-
-        if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-
-      return NULL;
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) - 1; current >= 0; current--)
-      {
-        int exptype = m_exptype.elementAt(current);
-        short type = ExpandedNameTable.getType(exptype);
-
-        if (exptype != extendedTypeID)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class PrecedingSiblingTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-      return getPreviousSibling(current);
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      while (DTM.NULL != (current = getPreviousSibling(current)))
-      {
-        if (m_exptype.elementAt(current & m_mask) == extendedTypeID)
-          return current;
-      }
-
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Self axis.
-   */
-  private class SelfTraverser extends DTMAxisTraverser
-  {
-
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  To see if
-     * the self node should be processed, use this function.
-     *
-     * @param context The context node of this traversal.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return context;
-    }
-
-    /**
-     * By the nature of the stateless traversal, the context node can not be
-     * returned or the iteration will go into an infinate loop.  To see if
-     * the self node should be processed, use this function.  If the context
-     * node does not match the extended type ID, this function will return
-     * false.
-     *
-     * @param context The context node of this traversal.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context, int extendedTypeID)
-    {
-      return (m_exptype.elementAt(context & m_mask) == extendedTypeID) ? context : NULL;
-    }
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return Always return NULL for this axis.
-     */
-    public int next(int context, int current)
-    {
-      return NULL;
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-      return NULL;
-    }
-  }
-
-  /**
-   * Implements traversal of the Ancestor access, in reverse document order.
-   */
-  private class AllFromRootTraverser extends AllFromNodeTraverser
-  {
-
-    /**
-     * Return the root.
-     *
-     * @param context The context node of this traversal.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return getDocument();
-    }
-
-    /**
-     * Return the root if it matches the extended type ID.
-     *
-     * @param context The context node of this traversal.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context, int extendedTypeID)
-    {
-      return (m_exptype.elementAt(getDocument() & m_mask) == extendedTypeID)
-             ? context : next(context, context, extendedTypeID);
-    }
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) + 1; ; current++)
-      {
-        int type = _type(current);  // may call nextNode()
-
-        if (type == NULL)
-          return NULL;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-
-      int subtreeRootIdent = context & m_mask;
-
-      for (current = (current & m_mask) + 1; ; current++)
-      {
-        int exptype = _exptype(current);  // may call nextNode()
-
-        if (exptype == NULL)
-          return NULL;
-
-        if (exptype != extendedTypeID)
-          continue;
-
-        return (current | m_dtmIdent);  // make handle.
-      }
-    }
-  }
-
-  /**
-   * Implements traversal of the Self axis.
-   */
-  private class RootTraverser extends AllFromRootTraverser
-  {
-
-    /**
-     * Traverse to the next node after the current node.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     *
-     * @return Always return NULL for this axis.
-     */
-    public int next(int context, int current)
-    {
-      return NULL;
-    }
-
-    /**
-     * Traverse to the next node after the current node that is matched
-     * by the extended type ID.
-     *
-     * @param context The context node of this iteration.
-     * @param current The current node of the iteration.
-     * @param extendedTypeID The extended type ID that must match.
-     *
-     * @return the next node in the iteration, or DTM.NULL.
-     */
-    public int next(int context, int current, int extendedTypeID)
-    {
-      return NULL;
-    }
-  }
-
-  /**
-   * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
-   * from and including the root.
-   */
-  private class DescendantOrSelfFromRootTraverser extends DescendantTraverser
-  {
-
-    /**
-     * Get the first potential identity that can be returned, which is the axis 
-     * root context in this case.
-     *
-     * @param identity The node identity of the root context of the traversal.
-     *
-     * @return The identity argument.
-     */
-    protected int getFirstPotential(int identity)
-    {
-      return identity;
-    }
-
-    /**
-     * Get the first potential identity that can be returned.
-     * @param handle handle to the root context.
-     * @return identity of the root of the subtree.
-     */
-    protected int getSubtreeRoot(int handle)
-    {
-      return getDocument() & m_mask;
-    }
-
-    /**
-     * Return the root.
-     *
-     * @param context The context node of this traversal.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return getDocument();
-    }
-  }
-  
-  /**
-   * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
-   * from but not including the root.
-   */
-  private class DescendantFromRootTraverser extends DescendantTraverser
-  {
-
-    /**
-     * Get the first potential identity that can be returned, which is the axis 
-     * root context in this case.
-     *
-     * @param identity The node identity of the root context of the traversal.
-     *
-     * @return The identity argument.
-     */
-    protected int getFirstPotential(int identity)
-    {
-      return _firstch(0);
-    }
-
-    /**
-     * Get the first potential identity that can be returned.
-     * @param handle handle to the root context.
-     * @return identity of the root of the subtree.
-     */
-    protected int getSubtreeRoot(int handle)
-    {
-      return 0;
-    }
-
-    /**
-     * Return the root.
-     *
-     * @param context The context node of this traversal.
-     *
-     * @return the first node in the traversal.
-     */
-    public int first(int context)
-    {
-      return _firstch(0) | m_dtmIdent;
-    }
-  }
-
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMDocumentImpl.java b/src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
deleted file mode 100644
index a0ca5b7..0000000
--- a/src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
+++ /dev/null
@@ -1,2431 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-import java.util.Hashtable;
-//import java.util.Stack;
-import java.util.Vector;
-
-import javax.xml.transform.SourceLocator;
-
-import org.apache.xml.dtm.ref.ChunkedIntArray;
-import org.apache.xml.utils.FastStringBuffer;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-
-/**
- * This is the implementation of the DTM document interface.  It receives
- * requests from an XML content handler similar to that of an XML DOM or SAX parser
- * to store information from the xml document in an array based
- * dtm table structure.  This informtion is used later for document navigation,
- * query, and SAX event dispatch functions. The DTM can also be used directly as a
- * document composition model for an application.  The requests received are:
- * <ul>
- * <li>initiating DTM to set the doc handle</li>
- * <li>resetting DTM for data structure reuse</li>
- * <li>hinting the end of document to adjust the end of data structure pointers</li>
- * <li>createnodes (element, comment, text, attribute, ....)</li>
- * <li>hinting the end of an element to patch parent and siblings<li>
- * <li>setting application provided symbol name stringpool data structures</li>
- * </ul>
- * <p>State: In progress!!</p>
- *
- * %REVIEW% I _think_ the SAX convention is that "no namespace" is expressed
- * as "" rather than as null (which is the DOM's convention). What should
- * DTM expect? What should it do with the other?
- *
- * <p>Origin: the implemention is a composite logic based on the DTM of XalanJ1 and
- *     DocImpl, DocumentImpl, ElementImpl, TextImpl, etc. of XalanJ2</p>
- */
-public class DTMDocumentImpl
-implements DTM, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler
-{
-
-        // Number of lower bits used to represent node index.
-        protected static final byte DOCHANDLE_SHIFT = 22;
-        // Masks the lower order of node handle.
-        // Same as {@link DTMConstructor.IDENT_NODE_DEFAULT}
-        protected static final int NODEHANDLE_MASK = (1 << (DOCHANDLE_SHIFT + 1)) - 1;
-        // Masks the higher order Document handle
-        // Same as {@link DTMConstructor.IDENT_DOC_DEFAULT}
-        protected static final int DOCHANDLE_MASK = -1 - NODEHANDLE_MASK;
-
-        int m_docHandle = NULL;		 // masked document handle for this dtm document
-        int m_docElement = NULL;	 // nodeHandle to the root of the actual dtm doc content
-
-        // Context for parse-and-append operations
-        int currentParent = 0;			// current parent - default is document root
-        int previousSibling = 0;		// previous sibling - no previous sibling
-        protected int m_currentNode = -1;		// current node
-
-        // The tree under construction can itself be used as
-        // the element stack, so m_elemStack isn't needed.
-        //protected Stack m_elemStack = new Stack();	 // element stack
-
-        private boolean previousSiblingWasParent = false;
-        // Local cache for record-at-a-time fetch
-        int gotslot[] = new int[4];
-
-        // endDocument recieved?
-        private boolean done = false;
-        boolean m_isError = false;
-
-        private final boolean DEBUG = false;
-
-        /** The document base URI. */
-        protected String m_documentBaseURI;
-
-  /** If we're building the model incrementally on demand, we need to
-   * be able to tell the source when to send us more data.
-   *
-   * Note that if this has not been set, and you attempt to read ahead
-   * of the current build point, we'll probably throw a null-pointer
-   * exception. We could try to wait-and-retry instead, as a very poor
-   * fallback, but that has all the known problems with multithreading
-   * on multiprocessors and we Don't Want to Go There.
-   *
-   * @see setIncrementalSAXSource
-   */
-  private IncrementalSAXSource m_incrSAXSource=null;
-
-
-        // ========= DTM data structure declarations. ==============
-
-        // nodes array: integer array blocks to hold the first level reference of the nodes,
-        // each reference slot is addressed by a nodeHandle index value.
-        // Assumes indices are not larger than {@link NODEHANDLE_MASK}
-        // ({@link DOCHANDLE_SHIFT} bits).
-        ChunkedIntArray nodes = new ChunkedIntArray(4);
-
-        // text/comment table: string buffer to hold the text string values of the document,
-        // each of which is addressed by the absolute offset and length in the buffer
-        private FastStringBuffer m_char = new FastStringBuffer();
-        // Start of string currently being accumulated into m_char;
-        // needed because the string may be appended in several chunks.
-        private int m_char_current_start=0;
-
-        // %TBD% INITIALIZATION/STARTUP ISSUES
-        // -- Should we really be creating these, or should they be
-        // passed in from outside? Scott want to be able to share
-        // pools across multiple documents, so setting them here is
-        // probably not the right default.
-        private DTMStringPool m_localNames = new DTMStringPool();
-        private DTMStringPool m_nsNames = new DTMStringPool();
-        private DTMStringPool m_prefixNames = new DTMStringPool();
-
-        // %TBD% If we use the current ExpandedNameTable mapper, it
-        // needs to be bound to the NS and local name pools. Which
-        // means it needs to attach to them AFTER we've resolved their
-        // startup. Or it needs to attach to this document and
-        // retrieve them each time. Or this needs to be
-        // an interface _implemented_ by this class... which might be simplest!
-        private ExpandedNameTable m_expandedNames=
-                new ExpandedNameTable(m_localNames,m_nsNames);
-
-        private XMLStringFactory m_xsf;
-
-
-        /**
-         * Construct a DTM.
-         *
-         * @param documentNumber the ID number assigned to this document.
-         * It will be shifted up into the high bits and returned as part of
-         * all node ID numbers, so those IDs indicate which document they
-         * came from as well as a location within the document. It is the
-         * DTMManager's responsibility to assign a unique number to each
-         * document.
-         */
-        public DTMDocumentImpl(DTMManager mgr, int documentNumber,
-                               DTMWSFilter whiteSpaceFilter,
-                               XMLStringFactory xstringfactory){
-                initDocument(documentNumber);	 // clear nodes and document handle
-                m_xsf = xstringfactory;
-        }
-
-  /** Bind a IncrementalSAXSource to this DTM. If we discover we need nodes
-   * that have not yet been built, we will ask this object to send us more
-   * events, and it will manage interactions with its data sources.
-   *
-   * Note that we do not actually build the IncrementalSAXSource, since we don't
-   * know what source it's reading from, what thread that source will run in,
-   * or when it will run.
-   *
-   * @param source The IncrementalSAXSource that we want to recieve events from
-   * on demand.
-   */
-  public void setIncrementalSAXSource(IncrementalSAXSource source)
-  {
-    m_incrSAXSource=source;
-
-    // Establish SAX-stream link so we can receive the requested data
-    source.setContentHandler(this);
-    source.setLexicalHandler(this);
-
-    // Are the following really needed? IncrementalSAXSource doesn't yet
-    // support them, and they're mostly no-ops here...
-    //source.setErrorHandler(this);
-    //source.setDTDHandler(this);
-    //source.setDeclHandler(this);
-  }
-
-        /**
-         * Wrapper for ChunkedIntArray.append, to automatically update the
-         * previous sibling's "next" reference (if necessary) and periodically
-         * wake a reader who may have encountered incomplete data and entered
-         * a wait state.
-         * @param w0 int As in ChunkedIntArray.append
-         * @param w1 int As in ChunkedIntArray.append
-         * @param w2 int As in ChunkedIntArray.append
-         * @param w3 int As in ChunkedIntArray.append
-         * @return int As in ChunkedIntArray.append
-         * @see ChunkedIntArray.append
-         */
-        private final int appendNode(int w0, int w1, int w2, int w3)
-        {
-                // A decent compiler may inline this.
-                int slotnumber = nodes.appendSlot(w0, w1, w2, w3);
-
-                if (DEBUG) System.out.println(slotnumber+": "+w0+" "+w1+" "+w2+" "+w3);
-
-                if (previousSiblingWasParent)
-                        nodes.writeEntry(previousSibling,2,slotnumber);
-
-                previousSiblingWasParent = false;	// Set the default; endElement overrides
-
-                return slotnumber;
-        }
-
-        // ========= DTM Implementation Control Functions. ==============
-
-        /**
-         * Set an implementation dependent feature.
-         * <p>
-         * %REVIEW% Do we really expect to set features on DTMs?
-         *
-         * @param featureId A feature URL.
-         * @param state true if this feature should be on, false otherwise.
-         */
-        public void setFeature(String featureId, boolean state) {};
-
-        /**
-         * Set a reference pointer to the element name symbol table.
-         * %REVIEW% Should this really be Public? Changing it while
-         * DTM is in use would be a disaster.
-         *
-         * @param poolRef DTMStringPool reference to an instance of table.
-         */
-        public void setLocalNameTable(DTMStringPool poolRef) {
-                m_localNames = poolRef;
-        }
-
-        /**
-         * Get a reference pointer to the element name symbol table.
-         *
-         * @return DTMStringPool reference to an instance of table.
-         */
-        public DTMStringPool getLocalNameTable() {
-                 return m_localNames;
-         }
-
-        /**
-         * Set a reference pointer to the namespace URI symbol table.
-         * %REVIEW% Should this really be Public? Changing it while
-         * DTM is in use would be a disaster.
-         *
-         * @param poolRef DTMStringPool reference to an instance of table.
-         */
-        public void setNsNameTable(DTMStringPool poolRef) {
-                m_nsNames = poolRef;
-        }
-
-        /**
-         * Get a reference pointer to the namespace URI symbol table.
-         *
-         * @return DTMStringPool reference to an instance of table.
-         */
-        public DTMStringPool getNsNameTable() {
-                 return m_nsNames;
-         }
-
-        /**
-         * Set a reference pointer to the prefix name symbol table.
-         * %REVIEW% Should this really be Public? Changing it while
-         * DTM is in use would be a disaster.
-         *
-         * @param poolRef DTMStringPool reference to an instance of table.
-         */
-        public void setPrefixNameTable(DTMStringPool poolRef) {
-                m_prefixNames = poolRef;
-        }
-
-        /**
-         * Get a reference pointer to the prefix name symbol table.
-         *
-         * @return DTMStringPool reference to an instance of table.
-         */
-        public DTMStringPool getPrefixNameTable() {
-                return m_prefixNames;
-        }
-
-         /**
-          * Set a reference pointer to the content-text repository
-          *
-          * @param bufferRef FastStringBuffer reference to an instance of
-          * buffer
-          */
-         void setContentBuffer(FastStringBuffer buffer) {
-                 m_char = buffer;
-         }
-
-         /**
-          * Get a reference pointer to the content-text repository
-          *
-          * @return FastStringBuffer reference to an instance of buffer
-          */
-         FastStringBuffer getContentBuffer() {
-                 return m_char;
-         }
-
-  /** getContentHandler returns "our SAX builder" -- the thing that
-   * someone else should send SAX events to in order to extend this
-   * DTM model.
-   *
-   * @return null if this model doesn't respond to SAX events,
-   * "this" if the DTM object has a built-in SAX ContentHandler,
-   * the IncrementalSAXSource if we're bound to one and should receive
-   * the SAX stream via it for incremental build purposes...
-   * */
-  public org.xml.sax.ContentHandler getContentHandler()
-  {
-    if (m_incrSAXSource instanceof IncrementalSAXSource_Filter)
-      return (ContentHandler) m_incrSAXSource;
-    else
-      return this;
-  }
-
-  /**
-   * Return this DTM's lexical handler.
-   *
-   * %REVIEW% Should this return null if constrution already done/begun?
-   *
-   * @return null if this model doesn't respond to lexical SAX events,
-   * "this" if the DTM object has a built-in SAX ContentHandler,
-   * the IncrementalSAXSource if we're bound to one and should receive
-   * the SAX stream via it for incremental build purposes...
-   */
-  public LexicalHandler getLexicalHandler()
-  {
-
-    if (m_incrSAXSource instanceof IncrementalSAXSource_Filter)
-      return (LexicalHandler) m_incrSAXSource;
-    else
-      return this;
-  }
-
-  /**
-   * Return this DTM's EntityResolver.
-   *
-   * @return null if this model doesn't respond to SAX entity ref events.
-   */
-  public org.xml.sax.EntityResolver getEntityResolver()
-  {
-
-    return null;
-  }
-
-  /**
-   * Return this DTM's DTDHandler.
-   *
-   * @return null if this model doesn't respond to SAX dtd events.
-   */
-  public org.xml.sax.DTDHandler getDTDHandler()
-  {
-
-    return null;
-  }
-
-  /**
-   * Return this DTM's ErrorHandler.
-   *
-   * @return null if this model doesn't respond to SAX error events.
-   */
-  public org.xml.sax.ErrorHandler getErrorHandler()
-  {
-
-    return null;
-  }
-
-  /**
-   * Return this DTM's DeclHandler.
-   *
-   * @return null if this model doesn't respond to SAX Decl events.
-   */
-  public org.xml.sax.ext.DeclHandler getDeclHandler()
-  {
-
-    return null;
-  }
-
-  /** @return true iff we're building this model incrementally (eg
-   * we're partnered with a IncrementalSAXSource) and thus require that the
-   * transformation and the parse run simultaneously. Guidance to the
-   * DTMManager.
-   * */
-  public boolean needsTwoThreads()
-  {
-    return null!=m_incrSAXSource;
-  }
-
-  //================================================================
-  // ========= SAX2 ContentHandler methods =========
-  // Accept SAX events, use them to build/extend the DTM tree.
-  // Replaces the deprecated DocumentHandler interface.
-
-  public void characters(char[] ch, int start, int length)
-       throws org.xml.sax.SAXException
-  {
-    // Actually creating the text node is handled by
-    // processAccumulatedText(); here we just accumulate the
-    // characters into the buffer.
-    m_char.append(ch,start,length);
-  }
-
-  // Flush string accumulation into a text node
-  private void processAccumulatedText()
-  {
-    int len=m_char.length();
-    if(len!=m_char_current_start)
-      {
-        // The FastStringBuffer has been previously agreed upon
-        appendTextChild(m_char_current_start,len-m_char_current_start);
-        m_char_current_start=len;
-      }
-  }
-  public void endDocument()
-       throws org.xml.sax.SAXException
-  {
-    // May need to tell the low-level builder code to pop up a level.
-    // There _should't_ be any significant pending text at this point.
-    appendEndDocument();
-  }
-  public void endElement(java.lang.String namespaceURI, java.lang.String localName,
-      java.lang.String qName)
-       throws org.xml.sax.SAXException
-  {
-    processAccumulatedText();
-    // No args but we do need to tell the low-level builder code to
-    // pop up a level.
-    appendEndElement();
-  }
-  public void endPrefixMapping(java.lang.String prefix)
-       throws org.xml.sax.SAXException
-  {
-    // No-op
-  }
-  public void ignorableWhitespace(char[] ch, int start, int length)
-       throws org.xml.sax.SAXException
-  {
-    // %TBD% I believe ignorable text isn't part of the DTM model...?
-  }
-  public void processingInstruction(java.lang.String target, java.lang.String data)
-       throws org.xml.sax.SAXException
-  {
-    processAccumulatedText();
-    // %TBD% Which pools do target and data go into?
-  }
-  public void setDocumentLocator(Locator locator)
-  {
-    // No-op for DTM
-  }
-  public void skippedEntity(java.lang.String name)
-       throws org.xml.sax.SAXException
-  {
-    processAccumulatedText();
-    //%TBD%
-  }
-  public void startDocument()
-       throws org.xml.sax.SAXException
-  {
-    appendStartDocument();
-  }
-  public void startElement(java.lang.String namespaceURI, java.lang.String localName,
-      java.lang.String qName, Attributes atts)
-       throws org.xml.sax.SAXException
-  {
-    processAccumulatedText();
-
-    // %TBD% Split prefix off qname
-    String prefix=null;
-    int colon=qName.indexOf(':');
-    if(colon>0)
-      prefix=qName.substring(0,colon);
-
-    // %TBD% Where do we pool expandedName, or is it just the union, or...
-    /**/System.out.println("Prefix="+prefix+" index="+m_prefixNames.stringToIndex(prefix));
-    appendStartElement(m_nsNames.stringToIndex(namespaceURI),
-                     m_localNames.stringToIndex(localName),
-                     m_prefixNames.stringToIndex(prefix)); /////// %TBD%
-
-    // %TBD% I'm assuming that DTM will require resequencing of
-    // NS decls before other attrs, hence two passes are taken.
-    // %TBD% Is there an easier way to test for NSDecl?
-    int nAtts=(atts==null) ? 0 : atts.getLength();
-    // %TBD% Countdown is more efficient if nobody cares about sequence.
-    for(int i=nAtts-1;i>=0;--i)
-      {
-        qName=atts.getQName(i);
-        if(qName.startsWith("xmlns:") || "xmlns".equals(qName))
-          {
-            prefix=null;
-            colon=qName.indexOf(':');
-            if(colon>0)
-              {
-                prefix=qName.substring(0,colon);
-              }
-            else
-              {
-                // %REVEIW% Null or ""?
-                prefix=null; // Default prefix
-              }
-
-
-            appendNSDeclaration(
-                                    m_prefixNames.stringToIndex(prefix),
-                                    m_nsNames.stringToIndex(atts.getValue(i)),
-                                    atts.getType(i).equalsIgnoreCase("ID"));
-          }
-      }
-
-    for(int i=nAtts-1;i>=0;--i)
-      {
-        qName=atts.getQName(i);
-        if(!(qName.startsWith("xmlns:") || "xmlns".equals(qName)))
-          {
-            // %TBD% I hate having to extract the prefix into a new
-            // string when we may never use it. Consider pooling whole
-            // qNames, which are already strings?
-            prefix=null;
-            colon=qName.indexOf(':');
-            if(colon>0)
-              {
-                prefix=qName.substring(0,colon);
-                localName=qName.substring(colon+1);
-              }
-            else
-              {
-                prefix=""; // Default prefix
-                localName=qName;
-              }
-
-
-            m_char.append(atts.getValue(i)); // Single-string value
-            int contentEnd=m_char.length();
-
-            if(!("xmlns".equals(prefix) || "xmlns".equals(qName)))
-              appendAttribute(m_nsNames.stringToIndex(atts.getURI(i)),
-                                  m_localNames.stringToIndex(localName),
-                                  m_prefixNames.stringToIndex(prefix),
-                                  atts.getType(i).equalsIgnoreCase("ID"),
-                                  m_char_current_start, contentEnd-m_char_current_start);
-            m_char_current_start=contentEnd;
-          }
-      }
-  }
-  public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM, handled during element/attr processing?
-  }
-
-  //
-  // LexicalHandler support. Not all SAX2 parsers support these events
-  // but we may want to pass them through when they exist...
-  //
-  public void comment(char[] ch, int start, int length)
-       throws org.xml.sax.SAXException
-  {
-    processAccumulatedText();
-
-    m_char.append(ch,start,length); // Single-string value
-    appendComment(m_char_current_start,length);
-    m_char_current_start+=length;
-  }
-  public void endCDATA()
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM
-  }
-  public void endDTD()
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM
-  }
-  public void endEntity(java.lang.String name)
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM
-  }
-  public void startCDATA()
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM
-  }
-  public void startDTD(java.lang.String name, java.lang.String publicId,
-      java.lang.String systemId)
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM
-  }
-  public void startEntity(java.lang.String name)
-       throws org.xml.sax.SAXException
-  {
-    // No-op in DTM
-  }
-
-
-  //================================================================
-  // ========= Document Handler Functions =========
-  // %REVIEW% jjk -- DocumentHandler is  SAX Level 1, and deprecated....
-  // and this wasn't a fully compliant or declared implementation of that API
-  // in any case. Phase out in favor of SAX2 ContentHandler/LexicalHandler
-
-        /**
-         * Reset a dtm document to its initial (empty) state.
-         *
-         * The DTMManager will invoke this method when the dtm is created.
-         *
-         * @param docHandle int the handle for the DTM document.
-         */
-        final void initDocument(int documentNumber)
-        {
-                // save masked DTM document handle
-                m_docHandle = documentNumber<<DOCHANDLE_SHIFT;
-
-                // Initialize the doc -- no parent, no next-sib
-                nodes.writeSlot(0,DOCUMENT_NODE,-1,-1,0);
-                // wait for the first startElement to create the doc root node
-                done = false;
-        }
-
-// 	/**
-// 	 * Receive hint of the end of a document.
-// 	 *
-// 	 * <p>The content handler will invoke this method only once, and it will
-// 	 * be the last method invoked during the parse.  The handler shall not
-// 	 * not invoke this method until it has either abandoned parsing
-// 	 * (because of an unrecoverable error) or reached the end of
-// 	 * input.</p>
-// 	 */
-// 	public void documentEnd()
-// 	{
-// 		done = true;
-// 		// %TBD% may need to notice the last slot number and slot count to avoid
-// 		// residual data from provious use of this DTM
-// 	}
-
-// 	/**
-// 	 * Receive notification of the beginning of a document.
-// 	 *
-// 	 * <p>The SAX parser will invoke this method only once, before any
-// 	 * other methods in this interface.</p>
-// 	 */
-// 	public void reset()
-// 	{
-
-// 		// %TBD% reset slot 0 to indicate ChunkedIntArray reuse or wait for
-// 		//       the next initDocument().
-// 		m_docElement = NULL;	 // reset nodeHandle to the root of the actual dtm doc content
-// 		initDocument(0);
-// 	}
-
-// 	/**
-// 	 * Factory method; creates an Element node in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * <p>The XML content handler will invoke endElement() method after all
-// 	 * of the element's content are processed in order to give DTM the indication
-// 	 * to prepare and patch up parent and sibling node pointers.</p>
-// 	 *
-// 	 * <p>The following interface for createElement will use an index value corresponds
-// 	 * to the symbol entry in the DTMDStringPool based symbol tables.</p>
-// 	 *
-// 	 * @param nsIndex The namespace of the node
-// 	 * @param nameIndex The element name.
-// 	 * @see #endElement
-// 	 * @see org.xml.sax.Attributes
-// 	 * @return nodeHandle int of the element created
-// 	 */
-// 	public int createElement(int nsIndex, int nameIndex, Attributes atts)
-// 	{
-// 		// do document root node creation here on the first element, create nodes for
-// 		// this element and its attributes, store the element, namespace, and attritute
-// 		// name indexes to the nodes array, keep track of the current node and parent
-// 		// element used
-
-// 		// W0  High:  Namespace  Low:  Node Type
-// 		int w0 = (nsIndex << 16) | ELEMENT_NODE;
-// 		// W1: Parent
-// 		int w1 = currentParent;
-// 		// W2: Next  (initialized as 0)
-// 		int w2 = 0;
-// 		// W3: Tagname
-// 		int w3 = nameIndex;
-// 		//int ourslot = nodes.appendSlot(w0, w1, w2, w3);
-// 		int ourslot = appendNode(w0, w1, w2, w3);
-// 		currentParent = ourslot;
-// 		previousSibling = 0;
-// 		setAttributes(atts);
-
-// 		// set the root element pointer when creating the first element node
-// 		if (m_docElement == NULL)
-// 			m_docElement = ourslot;
-// 		return (m_docHandle | ourslot);
-// 	}
-
-// 	// Factory method to create an Element node not associated with a given name space
-// 	// using String value parameters passed in from a content handler or application
-// 	/**
-// 	 * Factory method; creates an Element node not associated with a given name space in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * <p>The XML content handler or application will invoke endElement() method after all
-// 	 * of the element's content are processed in order to give DTM the indication
-// 	 * to prepare and patch up parent and sibling node pointers.</p>
-// 	 *
-// 	 * <p>The following parameters for createElement contains raw string values for name
-// 	 * symbols used in an Element node.</p>
-// 	 *
-// 	 * @param name String the element name, including the prefix if any.
-// 	 * @param atts The attributes attached to the element, if any.
-// 	 * @see #endElement
-// 	 * @see org.xml.sax.Attributes
-// 	 */
-// 	public int createElement(String name, Attributes atts)
-// 	{
-// 		// This method wraps around the index valued interface of the createElement interface.
-// 		// The raw string values are stored into the current DTM name symbol tables.  The method
-// 		// method will then use the index values returned to invoke the other createElement()
-// 		// onverted to index values modified to match a
-// 		// method.
-// 		int nsIndex = NULL;
-// 		int nameIndex = m_localNames.stringToIndex(name);
-// 		// note - there should be no prefix separator in the name because it is not associated
-// 		// with a name space
-
-// 		return createElement(nsIndex, nameIndex, atts);
-// 	}
-
-// 	// Factory method to create an Element node associated with a given name space
-// 	// using String value parameters passed in from a content handler or application
-// 	/**
-// 	 * Factory method; creates an Element node associated with a given name space in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * <p>The XML content handler or application will invoke endElement() method after all
-// 	 * of the element's content are processed in order to give DTM the indication
-// 	 * to prepare and patch up parent and sibling node pointers.</p>
-// 	 *
-// 	 * <p>The following parameters for createElementNS contains raw string values for name
-// 	 * symbols used in an Element node.</p>
-// 	 *
-// 	 * @param ns String the namespace of the node
-// 	 * @param name String the element name, including the prefix if any.
-// 	 * @param atts The attributes attached to the element, if any.
-// 	 * @see #endElement
-// 	 * @see org.xml.sax.Attributes
-// 	 */
-// 	public int createElementNS(String ns, String name, Attributes atts)
-// 	{
-// 		// This method wraps around the index valued interface of the createElement interface.
-// 		// The raw string values are stored into the current DTM name symbol tables.  The method
-// 		// method will then use the index values returned to invoke the other createElement()
-// 		// onverted to index values modified to match a
-// 		// method.
-// 		int nsIndex = m_nsNames.stringToIndex(ns);
-// 		int nameIndex = m_localNames.stringToIndex(name);
-// 		// The prefixIndex is not needed by the indexed interface of the createElement method
-// 		int prefixSep = name.indexOf(":");
-// 		int prefixIndex = m_prefixNames.stringToIndex(name.substring(0, prefixSep));
-// 		return createElement(nsIndex, nameIndex, atts);
-// 	}
-
-// 	/**
-// 	 * Receive an indication for the end of an element.
-// 	 *
-// 	 * <p>The XML content handler will invoke this method at the end of every
-// 	 * element in the XML document to give hint its time to pop up the current
-// 	 * element and parent and patch up parent and sibling pointers if necessary
-// 	 *
-// 	 * <p>%tbd% The following interface may need to be modified to match a
-// 	 * coordinated access to the DTMDStringPool based symbol tables.</p>
-// 		 *
-// 	 * @param ns the namespace of the element
-// 	 * @param localName The local part of the qualified name of the element
-// 	 * @param name The element name
-// 	 */
-// 	public void endElement(String ns, String name)
-// 	{
-// 		// pop up the stacks
-
-// 		//
-// 		if (previousSiblingWasParent)
-// 			nodes.writeEntry(previousSibling, 2, NULL);
-
-// 		// Pop parentage
-// 		previousSibling = currentParent;
-// 		nodes.readSlot(currentParent, gotslot);
-// 		currentParent = gotslot[1] & 0xFFFF;
-
-// 		// The element just being finished will be
-// 		// the previous sibling for the next operation
-// 		previousSiblingWasParent = true;
-
-// 		// Pop a level of namespace table
-// 		// namespaceTable.removeLastElem();
-// 	}
-
-// 	/**
-// 	 * Creates attributes for the current node.
-// 	 *
-// 	 * @param atts Attributes to be created.
-// 	 */
-// 	void setAttributes(Attributes atts) {
-// 		int atLength = (null == atts) ? 0 : atts.getLength();
-// 		for (int i=0; i < atLength; i++) {
-// 			String qname = atts.getQName(i);
-// 			createAttribute(atts.getQName(i), atts.getValue(i));
-// 		}
-// 	}
-
-// 	/**
-// 	 * Appends an attribute to the document.
-// 	 * @param qname Qualified Name of the attribute
-// 	 * @param value Value of the attribute
-// 	 * @return Handle of node
-// 	 */
-// 	public int createAttribute(String qname, String value) {
-// 		int colonpos = qname.indexOf(":");
-// 		String attName = qname.substring(colonpos+1);
-// 		int w0 = 0;
-// 		if (colonpos > 0) {
-// 			String prefix = qname.substring(0, colonpos);
-// 			if (prefix.equals("xml")) {
-// 				//w0 = ATTRIBUTE_NODE |
-// 				//	(org.apache.xalan.templates.Constants.S_XMLNAMESPACEURI << 16);
-// 			} else {
-// 				//w0 = ATTRIBUTE_NODE |
-// 			}
-// 		} else {
-// 			w0 = ATTRIBUTE_NODE;
-// 		}
-// 		// W1:  Parent
-// 		int w1 = currentParent;
-// 		// W2:  Next (not yet resolved)
-// 		int w2 = 0;
-// 		// W3:  Tag name
-// 		int w3 = m_localNames.stringToIndex(attName);
-// 		// Add node
-// 		int ourslot = appendNode(w0, w1, w2, w3);
-// 		previousSibling = ourslot;	// Should attributes be previous siblings
-
-// 		// W0: Node Type
-// 		w0 = TEXT_NODE;
-// 		// W1: Parent
-// 		w1 = ourslot;
-// 		// W2: Start Position within buffer
-// 		w2 = m_char.length();
-// 		m_char.append(value);
-// 		// W3: Length
-// 		w3 = m_char.length() - w2;
-// 		appendNode(w0, w1, w2, w3);
-// 		charStringStart=m_char.length();
-// 		charStringLength = 0;
-// 		//previousSibling = ourslot;
-// 		// Attrs are Parents
-// 		previousSiblingWasParent = true;
-// 		return (m_docHandle | ourslot);
-// 	}
-
-// 	/**
-// 	 * Factory method; creates a Text node in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * @param text String The characters text string from the XML document.
-// 	 * @return int DTM node-number of the text node created
-// 	 */
-// 	public int createTextNode(String text)
-// 	throws DTMException
-// 	{
-// 		// wraps around the index value based createTextNode method
-// 		return createTextNode(text.toCharArray(), 0, text.length());
-// 	}
-
-// 	/**
-// 	 * Factory method; creates a Text node in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * %REVIEW% for text normalization issues, unless we are willing to
-// 	 * insist that all adjacent text must be merged before this method
-// 	 * is called.
-// 	 *
-// 	 * @param ch The characters from the XML document.
-// 	 * @param start The start position in the array.
-// 	 * @param length The number of characters to read from the array.
-// 	 */
-// 	public int createTextNode(char ch[], int start, int length)
-// 	throws DTMException
-// 	{
-// 		m_char.append(ch, start, length);		// store the chunk to the text/comment string table
-
-// 		// create a Text Node
-// 		// %TBD% may be possible to combine with appendNode()to replace the next chunk of code
-// 		int w0 = TEXT_NODE;
-// 		// W1: Parent
-// 		int w1 = currentParent;
-// 		// W2: Start position within m_char
-// 		int w2 = charStringStart;
-// 		// W3: Length of the full string
-// 		int w3 = length;
-// 		int ourslot = appendNode(w0, w1, w2, w3);
-// 		previousSibling = ourslot;
-
-// 		charStringStart=m_char.length();
-// 		charStringLength = 0;
-// 		return (m_docHandle | ourslot);
-// 	}
-
-// 	/**
-// 	 * Factory method; creates a Comment node in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * @param text String The characters text string from the XML document.
-// 	 * @return int DTM node-number of the text node created
-// 	 */
-// 	public int createComment(String text)
-// 	throws DTMException
-// 	{
-// 		// wraps around the index value based createTextNode method
-// 		return createComment(text.toCharArray(), 0, text.length());
-// 	}
-
-// 	/**
-// 	 * Factory method; creates a Comment node in this document.
-// 	 *
-// 	 * The node created will be chained according to its natural order of request
-// 	 * received.  %TBD% It can be rechained later via the optional DTM writable interface.
-// 	 *
-// 	 * @param ch An array holding the characters in the comment.
-// 	 * @param start The starting position in the array.
-// 	 * @param length The number of characters to use from the array.
-// 	 * @see DTMException
-// 	 */
-// 	public int createComment(char ch[], int start, int length)
-// 	throws DTMException
-// 	{
-// 		m_char.append(ch, start, length);		// store the comment string to the text/comment string table
-
-// 		// create a Comment Node
-// 		// %TBD% may be possible to combine with appendNode()to replace the next chunk of code
-// 		int w0 = COMMENT_NODE;
-// 		// W1: Parent
-// 		int w1 = currentParent;
-// 		// W2: Start position within m_char
-// 		int w2 = charStringStart;
-// 		// W3: Length of the full string
-// 		int w3 = length;
-// 		int ourslot = appendNode(w0, w1, w2, w3);
-// 		previousSibling = ourslot;
-
-// 		charStringStart=m_char.length();
-// 		charStringLength = 0;
-// 		return (m_docHandle | ourslot);
-// 	}
-
-// 	// Counters to keep track of the current text string being accumulated with respect
-// 	// to the text/comment string table: charStringStart should point to the starting
-// 	// offset of the string in the table and charStringLength the acccumulated length when
-// 	// appendAccumulatedText starts, and reset to the end of the table and 0 at the end
-// 	// of appendAccumulatedText for the next set of characters receives
-// 	int charStringStart=0,charStringLength=0;
-
-        // ========= Document Navigation Functions =========
-
-        /** Given a node handle, test if it has child nodes.
-         * <p> %REVIEW% This is obviously useful at the DOM layer, where it
-         * would permit testing this without having to create a proxy
-         * node. It's less useful in the DTM API, where
-         * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and
-         * almost as self-evident. But it's a convenience, and eases porting
-         * of DOM code to DTM.  </p>
-         *
-         * @param nodeHandle int Handle of the node.
-         * @return int true if the given node has child nodes.
-         */
-        public boolean hasChildNodes(int nodeHandle) {
-                return(getFirstChild(nodeHandle) != NULL);
-        }
-
-        /**
-         * Given a node handle, get the handle of the node's first child.
-         * If not yet resolved, waits for more nodes to be added to the document and
-         * tries again.
-         *
-         * @param nodeHandle int Handle of the node.
-         * @return int DTM node-number of first child, or DTM.NULL to indicate none exists.
-         */
-        public int getFirstChild(int nodeHandle) {
-
-                // ###shs worry about tracing/debug later
-                nodeHandle &= NODEHANDLE_MASK;
-                // Read node into variable
-                nodes.readSlot(nodeHandle, gotslot);
-
-                // type is the last half of first slot
-                short type = (short) (gotslot[0] & 0xFFFF);
-
-                // Check to see if Element or Document node
-                if ((type == ELEMENT_NODE) || (type == DOCUMENT_NODE) ||
-                                (type == ENTITY_REFERENCE_NODE)) {
-
-                        // In case when Document root is given
-                        //	if (nodeHandle == 0) nodeHandle = 1;
-                        // %TBD% Probably was a mistake.
-                        // If someone explicitly asks for first child
-                        // of Document, I would expect them to want
-                        // that and only that.
-
-                        int kid = nodeHandle + 1;
-                        nodes.readSlot(kid, gotslot);
-                        while (ATTRIBUTE_NODE == (gotslot[0] & 0xFFFF)) {
-                                // points to next sibling
-                                kid = gotslot[2];
-                                // Return NULL if node has only attributes
-                                if (kid == NULL) return NULL;
-                                nodes.readSlot(kid, gotslot);
-                        }
-                        // If parent slot matches given parent, return kid
-                        if (gotslot[1] == nodeHandle)
-                        {
-                          int firstChild = kid | m_docHandle;
-
-                          return firstChild;
-                        }
-                }
-                // No child found
-
-                return NULL;
-        }
-
-        /**
-        * Given a node handle, advance to its last child.
-        * If not yet resolved, waits for more nodes to be added to the document and
-        * tries again.
-        *
-        * @param nodeHandle int Handle of the node.
-        * @return int Node-number of last child,
-        * or DTM.NULL to indicate none exists.
-        */
-        public int getLastChild(int nodeHandle) {
-                // ###shs put trace/debug later
-                nodeHandle &= NODEHANDLE_MASK;
-                // do not need to test node type since getFirstChild does that
-                int lastChild = NULL;
-                for (int nextkid = getFirstChild(nodeHandle); nextkid != NULL;
-                                nextkid = getNextSibling(nextkid)) {
-                        lastChild = nextkid;
-                }
-                return lastChild | m_docHandle;
-        }
-
-        /**
-         * Retrieves an attribute node by by qualified name and namespace URI.
-         *
-         * @param nodeHandle int Handle of the node upon which to look up this attribute.
-         * @param namespaceURI The namespace URI of the attribute to
-         *   retrieve, or null.
-         * @param name The local name of the attribute to
-         *   retrieve.
-         * @return The attribute node handle with the specified name (
-         *   <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
-         *   attribute.
-         */
-        public int getAttributeNode(int nodeHandle, String namespaceURI, String name) {
-                int nsIndex = m_nsNames.stringToIndex(namespaceURI),
-                                                                        nameIndex = m_localNames.stringToIndex(name);
-                nodeHandle &= NODEHANDLE_MASK;
-                nodes.readSlot(nodeHandle, gotslot);
-                short type = (short) (gotslot[0] & 0xFFFF);
-                // If nodeHandle points to element next slot would be first attribute
-                if (type == ELEMENT_NODE)
-                        nodeHandle++;
-                // Iterate through Attribute Nodes
-                while (type == ATTRIBUTE_NODE) {
-                        if ((nsIndex == (gotslot[0] << 16)) && (gotslot[3] == nameIndex))
-                                return nodeHandle | m_docHandle;
-                        // Goto next sibling
-                        nodeHandle = gotslot[2];
-                        nodes.readSlot(nodeHandle, gotslot);
-                }
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, get the index of the node's first attribute.
-         *
-         * @param nodeHandle int Handle of the Element node.
-         * @return Handle of first attribute, or DTM.NULL to indicate none exists.
-         */
-        public int getFirstAttribute(int nodeHandle) {
-                nodeHandle &= NODEHANDLE_MASK;
-
-                // %REVIEW% jjk: Just a quick observation: If you're going to
-                // call readEntry repeatedly on the same node, it may be
-                // more efficiently to do a readSlot to get the data locally,
-                // reducing the addressing and call-and-return overhead.
-
-                // Should we check if handle is element (do we want sanity checks?)
-                if (ELEMENT_NODE != (nodes.readEntry(nodeHandle, 0) & 0xFFFF))
-                        return NULL;
-                // First Attribute (if any) should be at next position in table
-                nodeHandle++;
-                return(ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) ?
-                nodeHandle | m_docHandle : NULL;
-        }
-
-        /**
-         * Given a node handle, get the index of the node's first child.
-         * If not yet resolved, waits for more nodes to be added to the document and
-         * tries again
-         *
-         * @param nodeHandle handle to node, which should probably be an element
-         *                   node, but need not be.
-         *
-         * @param inScope    true if all namespaces in scope should be returned,
-         *                   false if only the namespace declarations should be
-         *                   returned.
-         * @return handle of first namespace, or DTM.NULL to indicate none exists.
-         */
-        public int getFirstNamespaceNode(int nodeHandle, boolean inScope) {
-
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, advance to its next sibling.
-         *
-         * %TBD% This currently uses the DTM-internal definition of
-         * sibling; eg, the last attr's next sib is the first
-         * child. In the old DTM, the DOM proxy layer provided the
-         * additional logic for the public view.  If we're rewriting
-         * for XPath emulation, that test must be done here.
-         *
-         * %TBD% CODE INTERACTION WITH INCREMENTAL PARSE - If not yet
-         * resolved, should wait for more nodes to be added to the document
-         * and tries again.
-         *
-         * @param nodeHandle int Handle of the node.
-         * @return int Node-number of next sibling,
-         * or DTM.NULL to indicate none exists.
-         * */
-        public int getNextSibling(int nodeHandle) {
-                nodeHandle &= NODEHANDLE_MASK;
-                // Document root has no next sibling
-                if (nodeHandle == 0)
-                        return NULL;
-
-                short type = (short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF);
-                if ((type == ELEMENT_NODE) || (type == ATTRIBUTE_NODE) ||
-                                (type == ENTITY_REFERENCE_NODE)) {
-                        int nextSib = nodes.readEntry(nodeHandle, 2);
-                        if (nextSib == NULL)
-                                return NULL;
-                        if (nextSib != 0)
-                                return (m_docHandle | nextSib);
-                        // ###shs should cycle/wait if nextSib is 0? Working on threading next
-                }
-                // Next Sibling is in the next position if it shares the same parent
-                int thisParent = nodes.readEntry(nodeHandle, 1);
-
-                if (nodes.readEntry(++nodeHandle, 1) == thisParent)
-                        return (m_docHandle | nodeHandle);
-
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, find its preceeding sibling.
-         * WARNING: DTM is asymmetric; this operation is resolved by search, and is
-         * relatively expensive.
-         *
-         * @param nodeHandle the id of the node.
-         * @return int Node-number of the previous sib,
-         * or DTM.NULL to indicate none exists.
-         */
-        public int getPreviousSibling(int nodeHandle) {
-                nodeHandle &= NODEHANDLE_MASK;
-                // Document root has no previous sibling
-                if (nodeHandle == 0)
-                        return NULL;
-
-                int parent = nodes.readEntry(nodeHandle, 1);
-                int kid = NULL;
-                for (int nextkid = getFirstChild(parent); nextkid != nodeHandle;
-                                nextkid = getNextSibling(nextkid)) {
-                        kid = nextkid;
-                }
-                return kid | m_docHandle;
-        }
-
-        /**
-         * Given a node handle, advance to the next attribute. If an
-         * element, we advance to its first attribute; if an attr, we advance to
-         * the next attr on the same node.
-         *
-         * @param nodeHandle int Handle of the node.
-         * @return int DTM node-number of the resolved attr,
-         * or DTM.NULL to indicate none exists.
-         */
-        public int getNextAttribute(int nodeHandle) {
-                nodeHandle &= NODEHANDLE_MASK;
-                nodes.readSlot(nodeHandle, gotslot);
-
-                //%REVIEW% Why are we using short here? There's no storage
-                //reduction for an automatic variable, especially one used
-                //so briefly, and it typically costs more cycles to process
-                //than an int would.
-                short type = (short) (gotslot[0] & 0xFFFF);
-
-                if (type == ELEMENT_NODE) {
-                        return getFirstAttribute(nodeHandle);
-                } else if (type == ATTRIBUTE_NODE) {
-                        if (gotslot[2] != NULL)
-                                return (m_docHandle | gotslot[2]);
-                }
-                return NULL;
-        }
-
-        /**
-         * Given a namespace handle, advance to the next namespace.
-         *
-         * %TBD% THIS METHOD DOES NOT MATCH THE CURRENT SIGNATURE IN
-         * THE DTM INTERFACE.  FIX IT, OR JUSTIFY CHANGING THE DTM
-         * API.
-         *
-         * @param namespaceHandle handle to node which must be of type NAMESPACE_NODE.
-         * @return handle of next namespace, or DTM.NULL to indicate none exists.
-         */
-        public int getNextNamespaceNode(int baseHandle,int namespaceHandle, boolean inScope) {
-                // ###shs need to work on namespace
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, advance to its next descendant.
-         * If not yet resolved, waits for more nodes to be added to the document and
-         * tries again.
-         *
-         * @param subtreeRootNodeHandle
-         * @param nodeHandle int Handle of the node.
-         * @return handle of next descendant,
-         * or DTM.NULL to indicate none exists.
-         */
-        public int getNextDescendant(int subtreeRootHandle, int nodeHandle) {
-                subtreeRootHandle &= NODEHANDLE_MASK;
-                nodeHandle &= NODEHANDLE_MASK;
-                // Document root [Document Node? -- jjk] - no next-sib
-                if (nodeHandle == 0)
-                        return NULL;
-                while (!m_isError) {
-                        // Document done and node out of bounds
-                        if (done && (nodeHandle > nodes.slotsUsed()))
-                                break;
-                        if (nodeHandle > subtreeRootHandle) {
-                                nodes.readSlot(nodeHandle+1, gotslot);
-                                if (gotslot[2] != 0) {
-                                        short type = (short) (gotslot[0] & 0xFFFF);
-                                        if (type == ATTRIBUTE_NODE) {
-                                                nodeHandle +=2;
-                                        } else {
-                                                int nextParentPos = gotslot[1];
-                                                if (nextParentPos >= subtreeRootHandle)
-                                                        return (m_docHandle | (nodeHandle+1));
-                                                else
-                                                        break;
-                                        }
-                                } else if (!done) {
-                                        // Add wait logic here
-                                } else
-                                        break;
-                        } else {
-                                nodeHandle++;
-                        }
-                }
-                // Probably should throw error here like original instead of returning
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, advance to the next node on the following axis.
-         *
-         * @param axisContextHandle the start of the axis that is being traversed.
-         * @param nodeHandle
-         * @return handle of next sibling,
-         * or DTM.NULL to indicate none exists.
-         */
-        public int getNextFollowing(int axisContextHandle, int nodeHandle) {
-                //###shs still working on
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, advance to the next node on the preceding axis.
-         *
-         * @param axisContextHandle the start of the axis that is being traversed.
-         * @param nodeHandle the id of the node.
-         * @return int Node-number of preceding sibling,
-         * or DTM.NULL to indicate none exists.
-         */
-        public int getNextPreceding(int axisContextHandle, int nodeHandle) {
-                // ###shs copied from Xalan 1, what is this suppose to do?
-                nodeHandle &= NODEHANDLE_MASK;
-                while (nodeHandle > 1) {
-                        nodeHandle--;
-                        if (ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF))
-                                continue;
-
-                        // if nodeHandle is _not_ an ancestor of
-                        // axisContextHandle, specialFind will return it.
-                        // If it _is_ an ancestor, specialFind will return -1
-
-                        // %REVIEW% unconditional return defeats the
-                        // purpose of the while loop -- does this
-                        // logic make any sense?
-
-                        return (m_docHandle | nodes.specialFind(axisContextHandle, nodeHandle));
-                }
-                return NULL;
-        }
-
-        /**
-         * Given a node handle, find its parent node.
-         *
-         * @param nodeHandle the id of the node.
-         * @return int Node-number of parent,
-         * or DTM.NULL to indicate none exists.
-         */
-        public int getParent(int nodeHandle) {
-                // Should check to see within range?
-
-                // Document Root should not have to be handled differently
-                return (m_docHandle | nodes.readEntry(nodeHandle, 1));
-        }
-
-        /**
-         * Returns the root element of the document.
-         * @return nodeHandle to the Document Root.
-         */
-        public int getDocumentRoot() {
-                return (m_docHandle | m_docElement);
-        }
-
-        /**
-                * Given a node handle, find the owning document node.
-                *
-                * @param nodeHandle the id of the node.
-                * @return int Node handle of document, which should always be valid.
-                */
-        public int getDocument() {
-                return m_docHandle;
-        }
-
-        /**
-         * Given a node handle, find the owning document node.  This has the exact
-         * same semantics as the DOM Document method of the same name, in that if
-         * the nodeHandle is a document node, it will return NULL.
-         *
-         * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM
-         * binding layer. Included here as a convenience function and to
-         * aid porting of DOM code to DTM.</p>
-         *
-         * @param nodeHandle the id of the node.
-         * @return int Node handle of owning document, or NULL if the nodeHandle is
-         *             a document.
-         */
-        public int getOwnerDocument(int nodeHandle) {
-                // Assumption that Document Node is always in 0 slot
-                if ((nodeHandle & NODEHANDLE_MASK) == 0)
-                        return NULL;
-                return (nodeHandle & DOCHANDLE_MASK);
-        }
-
-
-        /**
-         * Get the string-value of a node as a String object
-         * (see http://www.w3.org/TR/xpath#data-model
-         * for the definition of a node's string-value).
-         *
-         * @param nodeHandle The node ID.
-         *
-         * @return A string object that represents the string-value of the given node.
-         */
-        public XMLString getStringValue(int nodeHandle) {
-        // ###zaj - researching
-        nodes.readSlot(nodeHandle, gotslot);
-        int nodetype=gotslot[0] & 0xFF;
-        String value=null;
-
-        switch (nodetype) {
-        case TEXT_NODE:
-        case COMMENT_NODE:
-        case CDATA_SECTION_NODE:
-                value= m_char.getString(gotslot[2], gotslot[3]);
-                break;
-        case PROCESSING_INSTRUCTION_NODE:
-        case ATTRIBUTE_NODE:
-        case ELEMENT_NODE:
-        case ENTITY_REFERENCE_NODE:
-        default:
-                break;
-        }
-        return m_xsf.newstr( value );
-
-        }
-
-        /**
-         * Get number of character array chunks in
-         * the string-value of a node.
-         * (see http://www.w3.org/TR/xpath#data-model
-         * for the definition of a node's string-value).
-         * Note that a single text node may have multiple text chunks.
-         *
-         * EXPLANATION: This method is an artifact of the fact that the
-         * underlying m_chars object may not store characters in a
-         * single contiguous array -- for example,the current
-         * FastStringBuffer may split a single node's text across
-         * multiple allocation units.  This call tells us how many
-         * separate accesses will be required to retrieve the entire
-         * content. PLEASE NOTE that this may not be the same as the
-         * number of SAX characters() events that caused the text node
-         * to be built in the first place, since m_chars buffering may
-         * be on different boundaries than the parser's buffers.
-         *
-         * @param nodeHandle The node ID.
-         *
-         * @return number of character array chunks in
-         *         the string-value of a node.
-         * */
-        //###zaj - tbd
-        public int getStringValueChunkCount(int nodeHandle)
-        {
-                //###zaj    return value
-                return 0;
-        }
-
-        /**
-         * Get a character array chunk in the string-value of a node.
-         * (see http://www.w3.org/TR/xpath#data-model
-         * for the definition of a node's string-value).
-         * Note that a single text node may have multiple text chunks.
-         *
-         * EXPLANATION: This method is an artifact of the fact that
-         * the underlying m_chars object may not store characters in a
-         * single contiguous array -- for example,the current
-         * FastStringBuffer may split a single node's text across
-         * multiple allocation units.  This call retrieves a single
-         * contiguous portion of the text -- as much as m-chars was
-         * able to store in a single allocation unit.  PLEASE NOTE
-         * that this may not be the same granularityas the SAX
-         * characters() events that caused the text node to be built
-         * in the first place, since m_chars buffering may be on
-         * different boundaries than the parser's buffers.
-         *
-         * @param nodeHandle The node ID.
-         * @param chunkIndex Which chunk to get.
-         * @param startAndLen An array of 2 where the start position and length of
-         *                    the chunk will be returned.
-         *
-         * @return The character array reference where the chunk occurs.  */
-        //###zaj - tbd
-        public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
-                                                                                                                                                int[] startAndLen) {return new char[0];}
-
-        /**
-         * Given a node handle, return an ID that represents the node's expanded name.
-         *
-         * @param nodeHandle The handle to the node in question.
-         *
-         * @return the expanded-name id of the node.
-         */
-        public int getExpandedTypeID(int nodeHandle) {
-           nodes.readSlot(nodeHandle, gotslot);
-           String qName = m_localNames.indexToString(gotslot[3]);
-           // Remove prefix from qName
-           // %TBD% jjk This is assuming the elementName is the qName.
-           int colonpos = qName.indexOf(":");
-           String localName = qName.substring(colonpos+1);
-           // Get NS
-           String namespace = m_nsNames.indexToString(gotslot[0] << 16);
-           // Create expanded name
-           String expandedName = namespace + ":" + localName;
-           int expandedNameID = m_nsNames.stringToIndex(expandedName);
-
-        return expandedNameID;
-        }
-
-
-        /**
-         * Given an expanded name, return an ID.  If the expanded-name does not
-         * exist in the internal tables, the entry will be created, and the ID will
-         * be returned.  Any additional nodes that are created that have this
-         * expanded name will use this ID.
-         *
-         * @param nodeHandle The handle to the node in question.
-         *
-         * @return the expanded-name id of the node.
-         */
-        public int getExpandedTypeID(String namespace, String localName, int type) {
-           // Create expanded name
-          // %TBD% jjk Expanded name is bitfield-encoded as
-          // typeID[6]nsuriID[10]localID[16]. Switch to that form, and to
-          // accessing the ns/local via their tables rather than confusing
-          // nsnames and expandednames.
-           String expandedName = namespace + ":" + localName;
-           int expandedNameID = m_nsNames.stringToIndex(expandedName);
-
-           return expandedNameID;
-        }
-
-
-        /**
-         * Given an expanded-name ID, return the local name part.
-         *
-         * @param ExpandedNameID an ID that represents an expanded-name.
-         * @return String Local name of this node.
-         */
-        public String getLocalNameFromExpandedNameID(int ExpandedNameID) {
-
-           // Get expanded name
-           String expandedName = m_localNames.indexToString(ExpandedNameID);
-           // Remove prefix from expanded name
-           int colonpos = expandedName.indexOf(":");
-           String localName = expandedName.substring(colonpos+1);
-           return localName;
-        }
-
-
-        /**
-         * Given an expanded-name ID, return the namespace URI part.
-         *
-         * @param ExpandedNameID an ID that represents an expanded-name.
-         * @return String URI value of this node's namespace, or null if no
-         * namespace was resolved.
-        */
-        public String getNamespaceFromExpandedNameID(int ExpandedNameID) {
-
-           String expandedName = m_localNames.indexToString(ExpandedNameID);
-           // Remove local name from expanded name
-           int colonpos = expandedName.indexOf(":");
-           String nsName = expandedName.substring(0, colonpos);
-
-        return nsName;
-        }
-
-
-        /**
-         * fixednames
-        */
-        static final String[] fixednames=
-        {
-                null,null,							// nothing, Element
-                null,"#text",						// Attr, Text
-                "#cdata_section",null,	// CDATA, EntityReference
-                null,null,							// Entity, PI
-                "#comment","#document",	// Comment, Document
-                null,"#document-fragment", // Doctype, DocumentFragment
-                null};									// Notation
-
-        /**
-         * Given a node handle, return its DOM-style node name. This will
-         * include names such as #text or #document.
-         *
-         * @param nodeHandle the id of the node.
-         * @return String Name of this node, which may be an empty string.
-         * %REVIEW% Document when empty string is possible...
-         */
-        public String getNodeName(int nodeHandle) {
-                nodes.readSlot(nodeHandle, gotslot);
-                short type = (short) (gotslot[0] & 0xFFFF);
-                String name = fixednames[type];
-                if (null == name) {
-                  int i=gotslot[3];
-                  /**/System.out.println("got i="+i+" "+(i>>16)+"/"+(i&0xffff));
-
-                  name=m_localNames.indexToString(i & 0xFFFF);
-                  String prefix=m_prefixNames.indexToString(i >>16);
-                  if(prefix!=null && prefix.length()>0)
-                    name=prefix+":"+name;
-                }
-                return name;
-        }
-
-        /**
-         * Given a node handle, return the XPath node name.  This should be
-         * the name as described by the XPath data model, NOT the DOM-style
-         * name.
-         *
-         * @param nodeHandle the id of the node.
-         * @return String Name of this node.
-         */
-        public String getNodeNameX(int nodeHandle) {return null;}
-
-        /**
-         * Given a node handle, return its DOM-style localname.
-         * (As defined in Namespaces, this is the portion of the name after any
-         * colon character)
-         *
-         * %REVIEW% What's the local name of something other than Element/Attr?
-         * Should this be DOM-style (undefined unless namespaced), or other?
-         *
-         * @param nodeHandle the id of the node.
-         * @return String Local name of this node.
-         */
-        public String getLocalName(int nodeHandle) {
-                nodes.readSlot(nodeHandle, gotslot);
-                short type = (short) (gotslot[0] & 0xFFFF);
-                String name = "";
-                if ((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) {
-                  int i=gotslot[3];
-                  name=m_localNames.indexToString(i & 0xFFFF);
-                  if(name==null) name="";
-                }
-                return name;
-        }
-
-        /**
-         * Given a namespace handle, return the prefix that the namespace decl is
-         * mapping.
-         * Given a node handle, return the prefix used to map to the namespace.
-         *
-         * <p> %REVIEW% Are you sure you want "" for no prefix?  </p>
-         *
-         * %REVIEW%  Should this be DOM-style (undefined unless namespaced),
-         * or other?
-         *
-         * @param nodeHandle the id of the node.
-         * @return String prefix of this node's name, or "" if no explicit
-         * namespace prefix was given.
-         */
-        public String getPrefix(int nodeHandle) {
-                nodes.readSlot(nodeHandle, gotslot);
-                short type = (short) (gotslot[0] & 0xFFFF);
-                String name = "";
-                if((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) {
-                  int i=gotslot[3];
-                  name=m_prefixNames.indexToString(i >>16);
-                  if(name==null) name="";
-                }
-                return name;
-        }
-
-        /**
-         * Given a node handle, return its DOM-style namespace URI
-         * (As defined in Namespaces, this is the declared URI which this node's
-         * prefix -- or default in lieu thereof -- was mapped to.)
-         *
-         * @param nodeHandle the id of the node.
-         * @return String URI value of this node's namespace, or null if no
-         * namespace was resolved.
-         */
-        public String getNamespaceURI(int nodeHandle) {return null;}
-
-        /**
-         * Given a node handle, return its node value. This is mostly
-         * as defined by the DOM, but may ignore some conveniences.
-         * <p>
-         *
-         * @param nodeHandle The node id.
-         * @return String Value of this node, or null if not
-         * meaningful for this node type.
-         */
-        public String getNodeValue(int nodeHandle)
-        {
-                nodes.readSlot(nodeHandle, gotslot);
-                int nodetype=gotslot[0] & 0xFF;		// ###zaj use mask to get node type
-                String value=null;
-
-                switch (nodetype) {			// ###zaj todo - document nodetypes
-                case ATTRIBUTE_NODE:
-                        nodes.readSlot(nodeHandle+1, gotslot);
-                case TEXT_NODE:
-                case COMMENT_NODE:
-                case CDATA_SECTION_NODE:
-                        value=m_char.getString(gotslot[2], gotslot[3]);		//###zaj
-                        break;
-                case PROCESSING_INSTRUCTION_NODE:
-                case ELEMENT_NODE:
-                case ENTITY_REFERENCE_NODE:
-                default:
-                        break;
-                }
-                return value;
-        }
-
-        /**
-         * Given a node handle, return its DOM-style node type.
-         * <p>
-         * %REVIEW% Generally, returning short is false economy. Return int?
-         *
-         * @param nodeHandle The node id.
-         * @return int Node type, as per the DOM's Node._NODE constants.
-         */
-        public short getNodeType(int nodeHandle) {
-                return(short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF);
-        }
-
-        /**
-         * <meta name="usage" content="internal"/>
-         * Get the depth level of this node in the tree (equals 1 for
-         * a parentless node).
-         *
-         * @param nodeHandle The node id.
-         * @return the number of ancestors, plus one
-         */
-        public short getLevel(int nodeHandle) {
-                short count = 0;
-                while (nodeHandle != 0) {
-                        count++;
-                        nodeHandle = nodes.readEntry(nodeHandle, 1);
-                }
-                return count;
-        }
-
-        // ============== Document query functions ==============
-
-        /**
-         * Tests whether DTM DOM implementation implements a specific feature and
-         * that feature is supported by this node.
-         *
-         * @param feature The name of the feature to test.
-         * @param versionThis is the version number of the feature to test.
-         *   If the version is not
-         *   specified, supporting any version of the feature will cause the
-         *   method to return <code>true</code>.
-         * @return Returns <code>true</code> if the specified feature is
-         *   supported on this node, <code>false</code> otherwise.
-         */
-        public boolean isSupported(String feature, String version) {return false;}
-
-        /**
-         * Return the base URI of the document entity. If it is not known
-         * (because the document was parsed from a socket connection or from
-         * standard input, for example), the value of this property is unknown.
-         *
-         * @return the document base URI String object or null if unknown.
-         */
-        public String getDocumentBaseURI()
-        {
-
-          return m_documentBaseURI;
-        }
-
-        /**
-         * Set the base URI of the document entity.
-         *
-         * @param baseURI the document base URI String object or null if unknown.
-         */
-        public void setDocumentBaseURI(String baseURI)
-        {
-
-          m_documentBaseURI = baseURI;
-        }
-
-        /**
-         * Return the system identifier of the document entity. If
-         * it is not known, the value of this property is unknown.
-         *
-         * @param nodeHandle The node id, which can be any valid node handle.
-         * @return the system identifier String object or null if unknown.
-         */
-        public String getDocumentSystemIdentifier(int nodeHandle) {return null;}
-
-        /**
-         * Return the name of the character encoding scheme
-         *        in which the document entity is expressed.
-         *
-         * @param nodeHandle The node id, which can be any valid node handle.
-         * @return the document encoding String object.
-         */
-        public String getDocumentEncoding(int nodeHandle) {return null;}
-
-        /**
-         * Return an indication of the standalone status of the document,
-         *        either "yes" or "no". This property is derived from the optional
-         *        standalone document declaration in the XML declaration at the
-         *        beginning of the document entity, and has no value if there is no
-         *        standalone document declaration.
-         *
-         * @param nodeHandle The node id, which can be any valid node handle.
-         * @return the document standalone String object, either "yes", "no", or null.
-         */
-        public String getDocumentStandalone(int nodeHandle) {return null;}
-
-        /**
-         * Return a string representing the XML version of the document. This
-         * property is derived from the XML declaration optionally present at the
-         * beginning of the document entity, and has no value if there is no XML
-         * declaration.
-         *
-         * @param the document handle
-         *
-         * @return the document version String object
-         */
-        public String getDocumentVersion(int documentHandle) {return null;}
-
-        /**
-         * Return an indication of
-         * whether the processor has read the complete DTD. Its value is a
-         * boolean. If it is false, then certain properties (indicated in their
-         * descriptions below) may be unknown. If it is true, those properties
-         * are never unknown.
-         *
-         * @return <code>true</code> if all declarations were processed {};
-         *         <code>false</code> otherwise.
-         */
-        public boolean getDocumentAllDeclarationsProcessed() {return false;}
-
-        /**
-         *   A document type declaration information item has the following properties:
-         *
-         *     1. [system identifier] The system identifier of the external subset, if
-         *        it exists. Otherwise this property has no value.
-         *
-         * @return the system identifier String object, or null if there is none.
-         */
-        public String getDocumentTypeDeclarationSystemIdentifier() {return null;}
-
-        /**
-         * Return the public identifier of the external subset,
-         * normalized as described in 4.2.2 External Entities [XML]. If there is
-         * no external subset or if it has no public identifier, this property
-         * has no value.
-         *
-         * @param the document type declaration handle
-         *
-         * @return the public identifier String object, or null if there is none.
-         */
-        public String getDocumentTypeDeclarationPublicIdentifier() {return null;}
-
-        /**
-         * Returns the <code>Element</code> whose <code>ID</code> is given by
-         * <code>elementId</code>. If no such element exists, returns
-         * <code>DTM.NULL</code>. Behavior is not defined if more than one element
-         * has this <code>ID</code>. Attributes (including those
-         * with the name "ID") are not of type ID unless so defined by DTD/Schema
-         * information available to the DTM implementation.
-         * Implementations that do not know whether attributes are of type ID or
-         * not are expected to return <code>DTM.NULL</code>.
-         *
-         * <p>%REVIEW% Presumably IDs are still scoped to a single document,
-         * and this operation searches only within a single document, right?
-         * Wouldn't want collisions between DTMs in the same process.</p>
-         *
-         * @param elementId The unique <code>id</code> value for an element.
-         * @return The handle of the matching element.
-         */
-        public int getElementById(String elementId) {return 0;}
-
-        /**
-         * The getUnparsedEntityURI function returns the URI of the unparsed
-         * entity with the specified name in the same document as the context
-         * node (see [3.3 Unparsed Entities]). It returns the empty string if
-         * there is no such entity.
-         * <p>
-         * XML processors may choose to use the System Identifier (if one
-         * is provided) to resolve the entity, rather than the URI in the
-         * Public Identifier. The details are dependent on the processor, and
-         * we would have to support some form of plug-in resolver to handle
-         * this properly. Currently, we simply return the System Identifier if
-         * present, and hope that it a usable URI or that our caller can
-         * map it to one.
-         * TODO: Resolve Public Identifiers... or consider changing function name.
-         * <p>
-         * If we find a relative URI
-         * reference, XML expects it to be resolved in terms of the base URI
-         * of the document. The DOM doesn't do that for us, and it isn't
-         * entirely clear whether that should be done here; currently that's
-         * pushed up to a higher level of our application. (Note that DOM Level
-         * 1 didn't store the document's base URI.)
-         * TODO: Consider resolving Relative URIs.
-         * <p>
-         * (The DOM's statement that "An XML processor may choose to
-         * completely expand entities before the structure model is passed
-         * to the DOM" refers only to parsed entities, not unparsed, and hence
-         * doesn't affect this function.)
-         *
-         * @param name A string containing the Entity Name of the unparsed
-         * entity.
-         *
-         * @return String containing the URI of the Unparsed Entity, or an
-         * empty string if no such entity exists.
-         */
-        public String getUnparsedEntityURI(String name) {return null;}
-
-
-        // ============== Boolean methods ================
-
-        /**
-         * Return true if the xsl:strip-space or xsl:preserve-space was processed
-         * during construction of the DTM document.
-         *
-         * <p>%REVEIW% Presumes a 1:1 mapping from DTM to Document, since
-         * we aren't saying which Document to query...?</p>
-         */
-        public boolean supportsPreStripping() {return false;}
-
-        /**
-         * Figure out whether nodeHandle2 should be considered as being later
-         * in the document than nodeHandle1, in Document Order as defined
-         * by the XPath model. This may not agree with the ordering defined
-         * by other XML applications.
-         * <p>
-         * There are some cases where ordering isn't defined, and neither are
-         * the results of this function -- though we'll generally return true.
-         *
-         * TODO: Make sure this does the right thing with attribute nodes!!!
-         *
-         * @param node1 DOM Node to perform position comparison on.
-         * @param node2 DOM Node to perform position comparison on .
-         *
-         * @return false if node2 comes before node1, otherwise return true.
-         * You can think of this as
-         * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
-         */
-        public boolean isNodeAfter(int nodeHandle1, int nodeHandle2) {return false;}
-
-        /**
-         *     2. [element content whitespace] A boolean indicating whether the
-         *        character is white space appearing within element content (see [XML],
-         *        2.10 "White Space Handling"). Note that validating XML processors are
-         *        required by XML 1.0 to provide this information. If there is no
-         *        declaration for the containing element, this property has no value for
-         *        white space characters. If no declaration has been read, but the [all
-         *        declarations processed] property of the document information item is
-         *        false (so there may be an unread declaration), then the value of this
-         *        property is unknown for white space characters. It is always false for
-         *        characters that are not white space.
-         *
-         * @param nodeHandle the node ID.
-         * @return <code>true</code> if the character data is whitespace;
-         *         <code>false</code> otherwise.
-         */
-        public boolean isCharacterElementContentWhitespace(int nodeHandle) {return false;}
-
-        /**
-         *    10. [all declarations processed] This property is not strictly speaking
-         *        part of the infoset of the document. Rather it is an indication of
-         *        whether the processor has read the complete DTD. Its value is a
-         *        boolean. If it is false, then certain properties (indicated in their
-         *        descriptions below) may be unknown. If it is true, those properties
-         *        are never unknown.
-         *
-         * @param the document handle
-         *
-         * @param documentHandle A node handle that must identify a document.
-         * @return <code>true</code> if all declarations were processed;
-         *         <code>false</code> otherwise.
-         */
-        public boolean isDocumentAllDeclarationsProcessed(int documentHandle) {return false;}
-
-        /**
-         *     5. [specified] A flag indicating whether this attribute was actually
-         *        specified in the start-tag of its element, or was defaulted from the
-         *        DTD.
-         *
-         * @param the attribute handle
-         *
-         * NEEDSDOC @param attributeHandle
-         * @return <code>true</code> if the attribute was specified;
-         *         <code>false</code> if it was defaulted.
-         */
-        public boolean isAttributeSpecified(int attributeHandle) {return false;}
-
-        // ========== Direct SAX Dispatch, for optimization purposes ========
-
-        /**
-         * Directly call the
-         * characters method on the passed ContentHandler for the
-         * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
-         * for the definition of a node's string-value). Multiple calls to the
-         * ContentHandler's characters methods may well occur for a single call to
-         * this method.
-         *
-         * @param nodeHandle The node ID.
-         * @param ch A non-null reference to a ContentHandler.
-         *
-         * @throws org.xml.sax.SAXException
-         */
-        public void dispatchCharactersEvents(
-                                                                                                                                                        int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
-        throws org.xml.sax.SAXException {}
-
-        /**
-         * Directly create SAX parser events from a subtree.
-         *
-         * @param nodeHandle The node ID.
-         * @param ch A non-null reference to a ContentHandler.
-         *
-         * @throws org.xml.sax.SAXException
-         */
-
-        public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
-        throws org.xml.sax.SAXException {}
-
-        /**
-         * Return an DOM node for the given node.
-         *
-         * @param nodeHandle The node ID.
-         *
-         * @return A node representation of the DTM node.
-         */
-        public org.w3c.dom.Node getNode(int nodeHandle)
-        {
-          return null;
-        }
-
-        // ==== Construction methods (may not be supported by some implementations!) =====
-        // %REVIEW% jjk: These probably aren't the right API. At the very least
-        // they need to deal with current-insertion-location and end-element
-        // issues.
-
-        /**
-         * Append a child to the end of the child list of the current node. Please note that the node
-         * is always cloned if it is owned by another document.
-         *
-         * <p>%REVIEW% "End of the document" needs to be defined more clearly.
-         * Does it become the last child of the Document? Of the root element?</p>
-         *
-         * @param newChild Must be a valid new node handle.
-         * @param clone true if the child should be cloned into the document.
-         * @param cloneDepth if the clone argument is true, specifies that the
-         *                   clone should include all it's children.
-         */
-        public void appendChild(int newChild, boolean clone, boolean cloneDepth) {
-                boolean sameDoc = ((newChild & DOCHANDLE_MASK) == m_docHandle);
-                if (clone || !sameDoc) {
-
-                } else {
-
-                }
-        }
-
-        /**
-         * Append a text node child that will be constructed from a string,
-         * to the end of the document.
-         *
-         * <p>%REVIEW% "End of the document" needs to be defined more clearly.
-         * Does it become the last child of the Document? Of the root element?</p>
-         *
-         * @param str Non-null reference to a string.
-         */
-        public void appendTextChild(String str) {
-                // ###shs Think more about how this differs from createTextNode
-          //%TBD%
-        }
-
-
-  //================================================================
-  // ==== BUILDER methods ====
-  // %TBD% jjk: SHOULD PROBABLY BE INLINED, unless we want to support
-  // both SAX1 and SAX2 and share this logic between them.
-
-  /** Append a text child at the current insertion point. Assumes that the
-   * actual content of the text has previously been appended to the m_char
-   * buffer (shared with the builder).
-   *
-   * @param m_char_current_start int Starting offset of node's content in m_char.
-   * @param contentLength int Length of node's content in m_char.
-   * */
-  void appendTextChild(int m_char_current_start,int contentLength)
-  {
-    // create a Text Node
-    // %TBD% may be possible to combine with appendNode()to replace the next chunk of code
-    int w0 = TEXT_NODE;
-    // W1: Parent
-    int w1 = currentParent;
-    // W2: Start position within m_char
-    int w2 = m_char_current_start;
-    // W3: Length of the full string
-    int w3 = contentLength;
-
-    int ourslot = appendNode(w0, w1, w2, w3);
-    previousSibling = ourslot;
-  }
-
-  /** Append a comment child at the current insertion point. Assumes that the
-   * actual content of the comment has previously been appended to the m_char
-   * buffer (shared with the builder).
-   *
-   * @param m_char_current_start int Starting offset of node's content in m_char.
-   * @param contentLength int Length of node's content in m_char.
-   * */
-  void appendComment(int m_char_current_start,int contentLength)
-  {
-    // create a Comment Node
-    // %TBD% may be possible to combine with appendNode()to replace the next chunk of code
-    int w0 = COMMENT_NODE;
-    // W1: Parent
-    int w1 = currentParent;
-    // W2: Start position within m_char
-    int w2 = m_char_current_start;
-    // W3: Length of the full string
-    int w3 = contentLength;
-
-    int ourslot = appendNode(w0, w1, w2, w3);
-    previousSibling = ourslot;
-  }
-
-
-  /** Append an Element child at the current insertion point. This
-   * Element then _becomes_ the insertion point; subsequent appends
-   * become its lastChild until an appendEndElement() call is made.
-   *
-   * Assumes that the symbols (local name, namespace URI and prefix)
-   * have already been added to the pools
-   *
-   * Note that this _only_ handles the Element node itself. Attrs and
-   * namespace nodes are unbundled in the ContentHandler layer
-   * and appended separately.
-   *
-   * @param namespaceIndex: Index within the namespaceURI string pool
-   * @param localNameIndex Index within the local name string pool
-   * @param prefixIndex: Index within the prefix string pool
-   * */
-  void appendStartElement(int namespaceIndex,int localNameIndex, int prefixIndex)
-  {
-                // do document root node creation here on the first element, create nodes for
-                // this element and its attributes, store the element, namespace, and attritute
-                // name indexes to the nodes array, keep track of the current node and parent
-                // element used
-
-                // W0  High:  Namespace  Low:  Node Type
-                int w0 = (namespaceIndex << 16) | ELEMENT_NODE;
-                // W1: Parent
-                int w1 = currentParent;
-                // W2: Next  (initialized as 0)
-                int w2 = 0;
-                // W3: Tagname high: prefix Low: local name
-                int w3 = localNameIndex | prefixIndex<<16;
-                /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff));
-
-                //int ourslot = nodes.appendSlot(w0, w1, w2, w3);
-                int ourslot = appendNode(w0, w1, w2, w3);
-                currentParent = ourslot;
-                previousSibling = 0;
-
-                // set the root element pointer when creating the first element node
-                if (m_docElement == NULL)
-                        m_docElement = ourslot;
-  }
-
-  /** Append a Namespace Declaration child at the current insertion point.
-   * Assumes that the symbols (namespace URI and prefix) have already been
-   * added to the pools
-   *
-   * @param prefixIndex: Index within the prefix string pool
-   * @param namespaceIndex: Index within the namespaceURI string pool
-   * @param isID: If someone really insists on writing a bad DTD, it is
-   * theoretically possible for a namespace declaration to also be declared
-   * as being a node ID. I don't really want to support that stupidity,
-   * but I'm not sure we can refuse to accept it.
-   * */
-  void appendNSDeclaration(int prefixIndex, int namespaceIndex,
-                           boolean isID)
-  {
-    // %REVIEW% I'm assigning this node the "namespace for namespaces"
-    // which the DOM defined. It is expected that the Namespace spec will
-    // adopt this as official. It isn't strictly needed since it's implied
-    // by the nodetype, but for now...
-
-    // %REVIEW% Prefix need not be recorded; it's implied too. But
-    // recording it might simplify the design.
-
-    // %TBD% isID is not currently honored.
-
-    final int namespaceForNamespaces=m_nsNames.stringToIndex("http://www.w3.org/2000/xmlns/");
-
-    // W0  High:  Namespace  Low:  Node Type
-    int w0 = NAMESPACE_NODE | (m_nsNames.stringToIndex("http://www.w3.org/2000/xmlns/")<<16);
-
-    // W1:  Parent
-    int w1 = currentParent;
-    // W2:  CURRENTLY UNUSED -- It's next-sib in attrs, but we have no kids.
-    int w2 = 0;
-    // W3:  namespace name
-    int w3 = namespaceIndex;
-    // Add node
-    int ourslot = appendNode(w0, w1, w2, w3);
-    previousSibling = ourslot;	// Should attributes be previous siblings
-    previousSiblingWasParent = false;
-    return ;//(m_docHandle | ourslot);
-  }
-
-  /** Append an Attribute child at the current insertion
-   * point.  Assumes that the symbols (namespace URI, local name, and
-   * prefix) have already been added to the pools, and that the content has
-   * already been appended to m_char. Note that the attribute's content has
-   * been flattened into a single string; DTM does _NOT_ attempt to model
-   * the details of entity references within attribute values.
-   *
-   * @param namespaceIndex int Index within the namespaceURI string pool
-   * @param localNameIndex int Index within the local name string pool
-   * @param prefixIndex int Index within the prefix string pool
-   * @param isID boolean True if this attribute was declared as an ID
-   * (for use in supporting getElementByID).
-   * @param m_char_current_start int Starting offset of node's content in m_char.
-   * @param contentLength int Length of node's content in m_char.
-   * */
-  void appendAttribute(int namespaceIndex, int localNameIndex, int prefixIndex,
-                       boolean isID,
-                       int m_char_current_start, int contentLength)
-  {
-    // %TBD% isID is not currently honored.
-
-    // W0  High:  Namespace  Low:  Node Type
-    int w0 = ATTRIBUTE_NODE | namespaceIndex<<16;
-
-    // W1:  Parent
-    int w1 = currentParent;
-    // W2:  Next (not yet resolved)
-    int w2 = 0;
-    // W3:  Tagname high: prefix Low: local name
-    int w3 = localNameIndex | prefixIndex<<16;
-    /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff));
-    // Add node
-    int ourslot = appendNode(w0, w1, w2, w3);
-    previousSibling = ourslot;	// Should attributes be previous siblings
-
-    // Attribute's content is currently appended as a Text Node
-
-    // W0: Node Type
-    w0 = TEXT_NODE;
-    // W1: Parent
-    w1 = ourslot;
-    // W2: Start Position within buffer
-    w2 = m_char_current_start;
-    // W3: Length
-    w3 = contentLength;
-    appendNode(w0, w1, w2, w3);
-
-    // Attrs are Parents
-    previousSiblingWasParent = true;
-    return ;//(m_docHandle | ourslot);
-  }
-
-  /**
-   * This returns a stateless "traverser", that can navigate over an
-   * XPath axis, though not in document order.
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   *
-   * @return A DTMAxisIterator, or null if the given axis isn't supported.
-   */
-  public DTMAxisTraverser getAxisTraverser(final int axis)
-  {
-    return null;
-  }
-
-  /**
-   * This is a shortcut to the iterators that implement the
-   * supported XPath axes (only namespace::) is not supported.
-   * Returns a bare-bones iterator that must be initialized
-   * with a start node (using iterator.setStartNode()).
-   *
-   * @param axis One of Axes.ANCESTORORSELF, etc.
-   *
-   * @return A DTMAxisIterator, or null if the given axis isn't supported.
-   */
-  public DTMAxisIterator getAxisIterator(final int axis)
-  {
-    // %TBD%
-    return null;
-  }
-
-  /**
-   * Get an iterator that can navigate over an XPath Axis, predicated by
-   * the extended type ID.
-   *
-   *
-   * @param axis
-   * @param type An extended type ID.
-   *
-   * @return A DTMAxisIterator, or null if the given axis isn't supported.
-   */
-  public DTMAxisIterator getTypedAxisIterator(final int axis, final int type)
-  {
-    // %TBD%
-    return null;
-  }
-
-
-  /** Terminate the element currently acting as an insertion point. Subsequent
-   * insertions will occur as the last child of this element's parent.
-   * */
-  void appendEndElement()
-  {
-    // pop up the stacks
-
-    if (previousSiblingWasParent)
-      nodes.writeEntry(previousSibling, 2, NULL);
-
-    // Pop parentage
-    previousSibling = currentParent;
-    nodes.readSlot(currentParent, gotslot);
-    currentParent = gotslot[1] & 0xFFFF;
-
-    // The element just being finished will be
-    // the previous sibling for the next operation
-    previousSiblingWasParent = true;
-
-    // Pop a level of namespace table
-    // namespaceTable.removeLastElem();
-  }
-
-  /**  Starting a new document. Perform any resets/initialization
-   * not already handled.
-   * */
-  void appendStartDocument()
-  {
-
-    // %TBD% reset slot 0 to indicate ChunkedIntArray reuse or wait for
-    //       the next initDocument().
-    m_docElement = NULL;	 // reset nodeHandle to the root of the actual dtm doc content
-    initDocument(0);
-  }
-
-  /**  All appends to this document have finished; do whatever final
-   * cleanup is needed.
-   * */
-  void appendEndDocument()
-  {
-    done = true;
-    // %TBD% may need to notice the last slot number and slot count to avoid
-    // residual data from provious use of this DTM
-  }
-
-  /**
-   * For the moment all the run time properties are ignored by this
-   * class.
-   *
-   * @param property a <code>String</code> value
-   * @param value an <code>Object</code> value
-   */
-  public void setProperty(String property, Object value)
-  {
-  }
-
-  /**
-   * Source information is not handled yet, so return
-   * <code>null</code> here.
-   *
-   * @param node an <code>int</code> value
-   * @return null
-   */
-  public SourceLocator getSourceLocatorFor(int node)
-  {
-    return null;
-  }
-
-
-  /**
-   * A dummy routine to satisify the abstract interface. If the DTM
-   * implememtation that extends the default base requires notification
-   * of registration, they can override this method.
-   */
-   public void documentRegistration()
-   {
-   }
-
-  /**
-   * A dummy routine to satisify the abstract interface. If the DTM
-   * implememtation that extends the default base requires notification
-   * when the document is being released, they can override this method
-   */
-   public void documentRelease()
-   {
-   }
-
-
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMManagerDefault.java b/src/org/apache/xml/dtm/ref/DTMManagerDefault.java
deleted file mode 100644
index a975bdf..0000000
--- a/src/org/apache/xml/dtm/ref/DTMManagerDefault.java
+++ /dev/null
@@ -1,712 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-
-import java.util.Vector;
-
-// JAXP 1.1
-import javax.xml.parsers.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.Source;
-import javax.xml.transform.SourceLocator;
-
-// Apache XML Utilities
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xml.dtm.ref.dom2dtm.DOM2DTM;
-import org.apache.xml.dtm.ref.sax2dtm.SAX2DTM;
-
-// W3C DOM
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-// SAX2
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * The default implementation for the DTMManager.
- */
-public class DTMManagerDefault extends DTMManager
-{
-
-  /**
-   * Vector of DTMs that this manager manages.
-   */
-  protected DTM m_dtms[] = new DTM[IDENT_MAX_DTMS];
-
-  /**
-   * Add a DTM to the DTM table.
-   *
-   * @param dtm Should be a valid reference to a DTM.
-   */
-  public void addDTM(DTM dtm, int id)
-  {
-    m_dtms[id] = dtm;
-    dtm.documentRegistration();
-  }
-
-  /**
-   * Get the first free DTM ID available.
-   */
-  public int getFirstFreeDTMID()
-  {
-    int n = m_dtms.length;
-    for (int i = 1; i < n; i++)
-    {
-      if(null == m_dtms[i])
-      {
-        return i;
-      }
-    }
-    throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DTMIDS_AVAIL, null)); //"No more DTM IDs are available!");
-  }
-
-  /**
-   * The default table for exandedNameID lookups.
-   */
-  private ExpandedNameTable m_expandedNameTable =
-    new ExpandedNameTable();
-
-  /**
-   * Constructor DTMManagerDefault
-   *
-   */
-  public DTMManagerDefault(){}
-
-  /** Set this to true if you want a dump of the DTM after creation. */
-  private static final boolean DUMPTREE = false;
-
-  /** Set this to true if you want a basic diagnostics. */
-  private static final boolean DEBUG = false;
-
-  /**
-   * Get an instance of a DTM, loaded with the content from the
-   * specified source.  If the unique flag is true, a new instance will
-   * always be returned.  Otherwise it is up to the DTMManager to return a
-   * new instance or an instance that it already created and may be being used
-   * by someone else.
-   * (I think more parameters will need to be added for error handling, and entity
-   * resolution).
-   *
-   * @param source the specification of the source object.
-   * @param unique true if the returned DTM must be unique, probably because it
-   * is going to be mutated.
-   * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
-   *                         be null.
-   * @param incremental true if the DTM should be built incrementally, if
-   *                    possible.
-   * @param doIndexing true if the caller considers it worth it to use
-   *                   indexing schemes.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(Source source, boolean unique,
-                    DTMWSFilter whiteSpaceFilter, boolean incremental,
-                    boolean doIndexing)
-  {
-
-    if(DEBUG && null != source)
-      System.out.println("Starting source: "+source.getSystemId());
-    XMLStringFactory xstringFactory = m_xsf;
-    int dtmPos = getFirstFreeDTMID();
-    int documentID = dtmPos << IDENT_DTM_NODE_BITS;
-
-    if ((null != source) && source instanceof DOMSource)
-    {
-      DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID,
-                                whiteSpaceFilter, xstringFactory, doIndexing);
-
-      addDTM(dtm, dtmPos);
-
-//      if (DUMPTREE)
-//      {
-//        dtm.dumpDTM();
-//      }
-
-      return dtm;
-    }
-    else
-    {
-      boolean isSAXSource = (null != source)
-                            ? (source instanceof SAXSource) : true;
-      boolean isStreamSource = (null != source)
-                               ? (source instanceof StreamSource) : false;
-
-      if (isSAXSource || isStreamSource)
-      {
-        XMLReader reader;
-        InputSource xmlSource;
-
-        if (null == source)
-        {
-          xmlSource = null;
-          reader = null;
-        }
-        else
-        {
-          reader = getXMLReader(source);
-          xmlSource = SAXSource.sourceToInputSource(source);
-
-          String urlOfSource = xmlSource.getSystemId();
-
-          if (null != urlOfSource)
-          {
-            try
-            {
-              urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource);
-            }
-            catch (Exception e)
-            {
-
-              // %REVIEW% Is there a better way to send a warning?
-              System.err.println("Can not absolutize URL: " + urlOfSource);
-            }
-
-            xmlSource.setSystemId(urlOfSource);
-          }
-        }
-
-        // Create the basic SAX2DTM.
-        SAX2DTM dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter,
-                                  xstringFactory, doIndexing);
-
-        // Go ahead and add the DTM to the lookup table.  This needs to be
-        // done before any parsing occurs.
-        addDTM(dtm, dtmPos);
-
-        boolean haveXercesParser =
-          (null != reader)
-          && (reader.getClass().getName().equals("org.apache.xerces.parsers.SAXParser") );
-
-        if (haveXercesParser)
-          incremental = true;  // No matter what.  %REVIEW%
-
-        // If the reader is null, but they still requested an incremental build,
-        // then we still want to set up the IncrementalSAXSource stuff.
-        if (this.m_incremental && incremental /* || ((null == reader) && incremental) */)
-        {
-          IncrementalSAXSource coParser=null;
-
-          if (haveXercesParser)
-          {
-            // IncrementalSAXSource_Xerces to avoid threading.
-            // System.out.println("Using IncrementalSAXSource_Xerces to avoid threading");
-            try {
-              // should be ok, it's in the same package - no need for thread class loader
-              Class c=Class.forName( "org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces" );
-              coParser=(IncrementalSAXSource)c.newInstance();
-            }  catch( Exception ex ) {
-              ex.printStackTrace();
-              coParser=null;
-            }
-          }
-
-          if( coParser==null ) {
-            // Create a IncrementalSAXSource that will run on the secondary thread.
-            if (null == reader)
-              coParser = new IncrementalSAXSource_Filter();
-            else
-	    {
-	      IncrementalSAXSource_Filter filter=new IncrementalSAXSource_Filter();
-	      filter.setXMLReader(reader);
-	      coParser=filter;
-	    }
-
-          }
-
-          // Have the DTM set itself up as the IncrementalSAXSource's listener.
-          dtm.setIncrementalSAXSource(coParser);
-
-          if (null == xmlSource)
-          {
-
-            // Then the user will construct it themselves.
-            return dtm;
-          }
-
-          reader.setDTDHandler(dtm);
-          reader.setErrorHandler(dtm);
-
-          try
-          {
-
-	    // Launch parsing coroutine.  Launches a second thread,
-	    // if we're using IncrementalSAXSource.filter().
-            coParser.startParse(xmlSource);
-          }
-          catch (RuntimeException re)
-          {
-
-            dtm.clearCoRoutine();
-
-            throw re;
-          }
-          catch (Exception e)
-          {
-
-            dtm.clearCoRoutine();
-
-            throw new org.apache.xml.utils.WrappedRuntimeException(e);
-          }
-        }
-        else
-        {
-          if (null == reader)
-          {
-
-            // Then the user will construct it themselves.
-            return dtm;
-          }
-
-          // not incremental
-          reader.setContentHandler(dtm);
-          reader.setDTDHandler(dtm);
-          reader.setErrorHandler(dtm);
-
-          try
-          {
-            reader.setProperty(
-              "http://xml.org/sax/properties/lexical-handler", dtm);
-          }
-          catch (SAXNotRecognizedException e){}
-          catch (SAXNotSupportedException e){}
-
-          try
-          {
-            reader.parse(xmlSource);
-          }
-          catch (RuntimeException re)
-          {
-
-            dtm.clearCoRoutine();
-
-            throw re;
-          }
-          catch (Exception e)
-          {
-
-            dtm.clearCoRoutine();
-
-            throw new org.apache.xml.utils.WrappedRuntimeException(e);
-          }
-        }
-
-        if (DUMPTREE)
-        {
-          System.out.println("Dumping SAX2DOM");
-          dtm.dumpDTM();
-        }
-
-        return dtm;
-      }
-      else
-      {
-
-        // It should have been handled by a derived class or the caller
-        // made a mistake.
-        throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source);
-      }
-    }
-  }
-
-  /**
-   * Given a W3C DOM node, try and return a DTM handle.
-   * Note: calling this may be non-optimal, and there is no guarantee that
-   * the node will be found in any particular DTM.
-   *
-   * @param node Non-null reference to a DOM node.
-   *
-   * @return a valid DTM handle.
-   */
-  public int getDTMHandleFromNode(org.w3c.dom.Node node)
-  {
-    if(null == node)
-      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!");
-
-    if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy)
-      return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber();
-    else
-    {
-      // Find the DOM2DTMs wrapped around this Document (if any)
-      // and check whether they contain the Node in question.
-      //
-      // NOTE that since a DOM2DTM may represent a subtree rather
-      // than a full document, we have to be prepared to check more
-      // than one -- and there is no guarantee that we will find
-      // one that contains ancestors or siblings of the node we're
-      // seeking.
-      //
-      // %REVIEW% We could search for the one which contains this
-      // node at the deepest level, and thus covers the widest
-      // subtree, but that's going to entail additional work
-      // checking more DTMs... and getHandleFromNode is not a
-      // cheap operation in most implementations.
-      // [I had to change this to look forward... sorry.  -sb]
-      int max = m_dtms.length;
-      for(int i = 0; i < max; i++)
-        {
-          DTM thisDTM=m_dtms[i];
-          if((null != thisDTM) && thisDTM instanceof DOM2DTM)
-          {
-            int handle=((DOM2DTM)thisDTM).getHandleOfNode(node);
-            if(handle!=DTM.NULL) return handle;
-          }
-         }
-
-      // Since the real root of our tree may be a DocumentFragment, we need to
-      // use getParent to find the root, instead of getOwnerDocument.  Otherwise
-      // DOM2DTM#getHandleOfNode will be very unhappy.
-      Node root = node;
-      for (Node p = root.getParentNode(); p != null; p = p.getParentNode())
-      {
-        root = p;
-      }
-
-      DTM dtm = getDTM(new javax.xml.transform.dom.DOMSource(root), false,
-                       null, true, true);
-
-      int handle = ((DOM2DTM)dtm).getHandleOfNode(node);
-
-      if(DTM.NULL == handle)
-        throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!");
-
-      return handle;
-    }
-  }
-
-  /**
-   * This method returns the SAX2 parser to use with the InputSource
-   * obtained from this URI.
-   * It may return null if any SAX2-conformant XML parser can be used,
-   * or if getInputSource() will also return null. The parser must
-   * be free for use (i.e.
-   * not currently in use for another parse().
-   *
-   * @param inputSource The value returned from the URIResolver.
-   * @returns a SAX2 XMLReader to use to resolve the inputSource argument.
-   *
-   * @return non-null XMLReader reference ready to parse.
-   */
-  public XMLReader getXMLReader(Source inputSource)
-  {
-
-    try
-    {
-      XMLReader reader = (inputSource instanceof SAXSource)
-                         ? ((SAXSource) inputSource).getXMLReader() : null;
-
-      boolean isUserReader = (reader != null);
-
-      if (null == reader)
-      {
-        try
-        {
-          javax.xml.parsers.SAXParserFactory factory =
-            javax.xml.parsers.SAXParserFactory.newInstance();
-
-          factory.setNamespaceAware(true);
-
-          javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser();
-
-          reader = jaxpParser.getXMLReader();
-        }
-        catch (javax.xml.parsers.ParserConfigurationException ex)
-        {
-          throw new org.xml.sax.SAXException(ex);
-        }
-        catch (javax.xml.parsers.FactoryConfigurationError ex1)
-        {
-          throw new org.xml.sax.SAXException(ex1.toString());
-        }
-        catch (NoSuchMethodError ex2){}
-        catch (AbstractMethodError ame){}
-
-        if (null == reader)
-          reader = XMLReaderFactory.createXMLReader();
-      }
-
-      try
-      {
-        reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                          true);
-      }
-      catch (org.xml.sax.SAXException se)
-      {
-
-        // What can we do?
-        // TODO: User diagnostics.
-      }
-
-        // Commented out as per discussion with Thomas2.Maesing@bgs-ag.de
-        // about bug 2124.
-//      if(!isUserReader)
-//      {
-//        try
-//        {
-//          reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-//                            true);
-//        }
-//        catch (org.xml.sax.SAXException se)
-//        {
-//
-//          // What can we do?
-//          // TODO: User diagnostics.
-//        }
-//      }
-
-      return reader;
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new DTMException(se.getMessage(), se);
-    }
-  }
-
-  /**
-   * NEEDSDOC Method getDTM
-   *
-   *
-   * NEEDSDOC @param nodeHandle
-   *
-   * NEEDSDOC (getDTM) @return
-   */
-  public DTM getDTM(int nodeHandle)
-  {
-
-    // Performance critical function.
-    return m_dtms[nodeHandle >>> IDENT_DTM_NODE_BITS];
-  }
-
-  /**
-   * Given a DTM, find it's ID number in the DTM list.
-   *
-   *
-   * @param dtm The DTM reference in question.
-   *
-   * @return The ID, or -1 if not found in the list.
-   */
-  public int getDTMIdentity(DTM dtm)
-  {
-
-    // A backwards search should normally be the fastest.
-    // [But we can't do it... sorry.  -sb]
-    int n = m_dtms.length;
-
-    for (int i = 0; i < n; i++)
-    {
-      DTM tdtm = m_dtms[i];
-
-      if (tdtm == dtm)
-        return i;
-    }
-
-    return -1;
-  }
-
-  /**
-   * NEEDSDOC Method release
-   *
-   *
-   * NEEDSDOC @param dtm
-   * NEEDSDOC @param shouldHardDelete
-   *
-   * NEEDSDOC (release) @return
-   */
-  public boolean release(DTM dtm, boolean shouldHardDelete)
-  {
-
-    if (dtm instanceof SAX2DTM)
-    {
-      ((SAX2DTM) dtm).clearCoRoutine();
-    }
-
-    int i = getDTMIdentity(dtm);
-
-    if (i >= 0)
-    {
-      m_dtms[i] = null;
-    }
-
-    dtm.documentRelease();
-    return true;
-  }
-
-  /**
-   * Method createDocumentFragment
-   *
-   *
-   * NEEDSDOC (createDocumentFragment) @return
-   */
-  public DTM createDocumentFragment()
-  {
-
-    try
-    {
-      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-
-      dbf.setNamespaceAware(true);
-
-      DocumentBuilder db = dbf.newDocumentBuilder();
-      Document doc = db.newDocument();
-      Node df = doc.createDocumentFragment();
-
-      return getDTM(new DOMSource(df), true, null, false, false);
-    }
-    catch (Exception e)
-    {
-      throw new DTMException(e);
-    }
-  }
-
-  /**
-   * NEEDSDOC Method createDTMIterator
-   *
-   *
-   * NEEDSDOC @param whatToShow
-   * NEEDSDOC @param filter
-   * NEEDSDOC @param entityReferenceExpansion
-   *
-   * NEEDSDOC (createDTMIterator) @return
-   */
-  public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter,
-                                       boolean entityReferenceExpansion)
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
-    return null;
-  }
-
-  /**
-   * NEEDSDOC Method createDTMIterator
-   *
-   *
-   * NEEDSDOC @param xpathString
-   * NEEDSDOC @param presolver
-   *
-   * NEEDSDOC (createDTMIterator) @return
-   */
-  public DTMIterator createDTMIterator(String xpathString,
-                                       PrefixResolver presolver)
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
-    return null;
-  }
-
-  /**
-   * NEEDSDOC Method createDTMIterator
-   *
-   *
-   * NEEDSDOC @param node
-   *
-   * NEEDSDOC (createDTMIterator) @return
-   */
-  public DTMIterator createDTMIterator(int node)
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
-    return null;
-  }
-
-  /**
-   * NEEDSDOC Method createDTMIterator
-   *
-   *
-   * NEEDSDOC @param xpathCompiler
-   * NEEDSDOC @param pos
-   *
-   * NEEDSDOC (createDTMIterator) @return
-   */
-  public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
-    return null;
-  }
-
-  /**
-   * return the expanded name table.
-   *
-   * NEEDSDOC @param dtm
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public ExpandedNameTable getExpandedNameTable(DTM dtm)
-  {
-    return m_expandedNameTable;
-  }
-
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java b/src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
deleted file mode 100644
index 9bb65a9..0000000
--- a/src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-import org.w3c.dom.*;
-
-import java.util.Vector;
-
-/**
- * <meta name="usage" content="internal"/>
- * DTMNamedNodeMap is a quickie (as opposed to quick) implementation of the DOM's
- * NamedNodeMap interface, intended to support DTMProxy's getAttributes()
- * call.
- * <p>
- * ***** Note: this does _not_ current attempt to cache any of the data;
- * if you ask for attribute 27 and then 28, you'll have to rescan the first
- * 27. It should probably at least keep track of the last one retrieved,
- * and possibly buffer the whole array.
- * <p>
- * ***** Also note that there's no fastpath for the by-name query; we search
- * linearly until we find it or fail to find it. Again, that could be
- * optimized at some cost in object creation/storage.
- */
-public class DTMNamedNodeMap implements NamedNodeMap
-{
-
-  /** The DTM for this node. */
-  DTM dtm;
-
-  /** The DTM element handle. */
-  int element;
-
-  /** The number of nodes in this map. */
-  short m_count = -1;
-
-  /**
-   * Create a getAttributes NamedNodeMap for a given DTM element node
-   *
-   * @param dtm The DTM Reference, must be non-null.
-   * @param element The DTM element handle.
-   */
-  DTMNamedNodeMap(DTM dtm, int element)
-  {
-    this.dtm = dtm;
-    this.element = element;
-  }
-
-  /**
-   * Return the number of Attributes on this Element
-   *
-   * @return The number of nodes in this map.
-   */
-  public int getLength()
-  {
-
-    if (m_count == -1)
-    {
-      short count = 0;
-
-      for (int n = dtm.getFirstAttribute(element); n != -1;
-              n = dtm.getNextAttribute(n))
-      {
-        ++count;
-      }
-
-      m_count = count;
-    }
-
-    return (int) m_count;
-  }
-
-  /**
-   * Retrieves a node specified by name.
-   * @param nameThe <code>nodeName</code> of a node to retrieve.
-   *
-   * @param name Name of the item being requested.
-   * @return A <code>Node</code> (of any type) with the specified
-   *   <code>nodeName</code>, or <code>null</code> if it does not identify
-   *   any node in this map.
-   */
-  public Node getNamedItem(String name)
-  {
-
-    for (int n = dtm.getFirstAttribute(element); n != -1;
-            n = dtm.getNextAttribute(n))
-    {
-      if (dtm.getNodeName(n).equals(name))
-        return dtm.getNode(n);
-    }
-
-    return null;
-  }
-
-  /**
-   * Returns the <code>index</code>th item in the map. If <code>index</code>
-   * is greater than or equal to the number of nodes in this map, this
-   * returns <code>null</code>.
-   * @param indexIndex into this map.
-   *
-   * @param i The index of the requested item.
-   * @return The node at the <code>index</code>th position in the map, or
-   *   <code>null</code> if that is not a valid index.
-   */
-  public Node item(int i)
-  {
-
-    int count = 0;
-
-    for (int n = dtm.getFirstAttribute(element); n != -1;
-            n = dtm.getNextAttribute(n))
-    {
-      if (count == i)
-        return dtm.getNode(n);
-      else
-        ++count;
-    }
-
-    return null;
-  }
-
-  /**
-   * Adds a node using its <code>nodeName</code> attribute. If a node with
-   * that name is already present in this map, it is replaced by the new
-   * one.
-   * <br>As the <code>nodeName</code> attribute is used to derive the name
-   * which the node must be stored under, multiple nodes of certain types
-   * (those that have a "special" string value) cannot be stored as the
-   * names would clash. This is seen as preferable to allowing nodes to be
-   * aliased.
-   * @param newNode node to store in this map. The node will later be
-   *   accessible using the value of its <code>nodeName</code> attribute.
-   *
-   * @return If the new <code>Node</code> replaces an existing node the
-   *   replaced <code>Node</code> is returned, otherwise <code>null</code>
-   *   is returned.
-   * @exception DOMException
-   *   WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
-   *   different document than the one that created this map.
-   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
-   *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
-   *   <code>Attr</code> that is already an attribute of another
-   *   <code>Element</code> object. The DOM user must explicitly clone
-   *   <code>Attr</code> nodes to re-use them in other elements.
-   */
-  public Node setNamedItem(Node newNode)
-  {
-    throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   * Removes a node specified by name. When this map contains the attributes
-   * attached to an element, if the removed attribute is known to have a
-   * default value, an attribute immediately appears containing the
-   * default value as well as the corresponding namespace URI, local name,
-   * and prefix when applicable.
-   * @param name The <code>nodeName</code> of the node to remove.
-   *
-   * @return The node removed from this map if a node with such a name
-   *   exists.
-   * @exception DOMException
-   *   NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
-   *   this map.
-   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
-   */
-  public Node removeNamedItem(String name)
-  {
-    throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   * Retrieves a node specified by local name and namespace URI. HTML-only
-   * DOM implementations do not need to implement this method.
-   * @param namespaceURI The namespace URI of the node to retrieve.
-   * @param localName The local name of the node to retrieve.
-   *
-   * @return A <code>Node</code> (of any type) with the specified local
-   *   name and namespace URI, or <code>null</code> if they do not
-   *   identify any node in this map.
-   * @since DOM Level 2
-   */
-  public Node getNamedItemNS(String namespaceURI, String localName)
-  {
-    throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * Adds a node using its <code>namespaceURI</code> and
-   * <code>localName</code>. If a node with that namespace URI and that
-   * local name is already present in this map, it is replaced by the new
-   * one.
-   * <br>HTML-only DOM implementations do not need to implement this method.
-   * @param arg A node to store in this map. The node will later be
-   *   accessible using the value of its <code>namespaceURI</code> and
-   *   <code>localName</code> attributes.
-   *
-   * @return If the new <code>Node</code> replaces an existing node the
-   *   replaced <code>Node</code> is returned, otherwise <code>null</code>
-   *   is returned.
-   * @exception DOMException
-   *   WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
-   *   different document than the one that created this map.
-   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
-   *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
-   *   <code>Attr</code> that is already an attribute of another
-   *   <code>Element</code> object. The DOM user must explicitly clone
-   *   <code>Attr</code> nodes to re-use them in other elements.
-   * @since DOM Level 2
-   */
-  public Node setNamedItemNS(Node arg) throws DOMException
-  {
-    throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   * Removes a node specified by local name and namespace URI. A removed
-   * attribute may be known to have a default value when this map contains
-   * the attributes attached to an element, as returned by the attributes
-   * attribute of the <code>Node</code> interface. If so, an attribute
-   * immediately appears containing the default value as well as the
-   * corresponding namespace URI, local name, and prefix when applicable.
-   * <br>HTML-only DOM implementations do not need to implement this method.
-   * 
-   * @param namespaceURI The namespace URI of the node to remove.
-   * @param localName The local name of the node to remove.
-   *
-   * @return The node removed from this map if a node with such a local
-   *   name and namespace URI exists.
-   * @exception DOMException
-   *   NOT_FOUND_ERR: Raised if there is no node with the specified
-   *   <code>namespaceURI</code> and <code>localName</code> in this map.
-   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
-   * @since DOM Level 2
-   */
-  public Node removeNamedItemNS(String namespaceURI, String localName)
-          throws DOMException
-  {
-    throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Simple implementation of DOMException.
-   */
-  public class DTMException extends org.w3c.dom.DOMException
-  {
-
-    /**
-     * Constructs a DOM/DTM exception.
-     *
-     * @param code
-     * @param message
-     */
-    public DTMException(short code, String message)
-    {
-      super(code, message);
-    }
-
-    /**
-     * Constructor DTMException
-     *
-     *
-     * @param code
-     */
-    public DTMException(short code)
-    {
-      super(code, "");
-    }
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMNodeIterator.java b/src/org/apache/xml/dtm/ref/DTMNodeIterator.java
deleted file mode 100644
index 71dfb98..0000000
--- a/src/org/apache/xml/dtm/ref/DTMNodeIterator.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-import org.apache.xml.dtm.*;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.traversal.*;
-
-/**
- * <code>DTMNodeIterator</code> gives us an implementation of the 
- * DTMNodeIterator which returns DOM nodes.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeIterator operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeIterator's "maintain current
- * position" response to document mutation. </li>
- *
- * <li>Since our design for XPath NodeIterators builds a stateful
- * filter directly into the traversal object, getNodeFilter() is not
- * supported.</li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- * */
-public class DTMNodeIterator implements org.w3c.dom.traversal.NodeIterator
-{
-  private DTMIterator dtm_iter;
-  private boolean valid=true;
-
-  //================================================================
-  // Methods unique to this class
-
-  /** Public constructor: Wrap a DTMNodeIterator around an existing
-   * and preconfigured DTMIterator
-   * */
-  public DTMNodeIterator(DTMIterator dtmIterator)
-    {
-      try
-      {
-        dtm_iter=(DTMIterator)dtmIterator.clone();
-      }
-      catch(CloneNotSupportedException cnse)
-      {
-        throw new org.apache.xml.utils.WrappedRuntimeException(cnse);
-      }
-    }
-
-  /** Access the wrapped DTMIterator. I'm not sure whether anyone will
-   * need this or not, but let's write it and think about it.
-   * */
-  public DTMIterator getDTMIterator()
-    {
-      return dtm_iter;
-    }
-  
-
-  //================================================================
-  // org.w3c.dom.traversal.NodeFilter API follows
-
-  /** Detaches the NodeIterator from the set which it iterated over,
-   * releasing any computational resources and placing the iterator in
-   * the INVALID state.
-   * */
-  public void detach() 
-    {
-      // Theoretically, we could release dtm_iter at this point. But
-      // some of the operations may still want to consult it even though
-      // navigation is now invalid.
-      valid=false;
-    }
-
-  /** The value of this flag determines whether the children
-   * of entity reference nodes are visible to the iterator.
-   *
-   * @return false, always (the DTM model flattens entity references)
-   * */
-  public boolean getExpandEntityReferences()
-    {
-      return false;
-    }
-  
-  /** Return a handle to the filter used to screen nodes.
-   *
-   * This is ill-defined in Xalan's usage of Nodeiterator, where we have
-   * built stateful XPath-based filtering directly into the traversal
-   * object. We could return something which supports the NodeFilter interface
-   * and allows querying whether a given node would be permitted if it appeared
-   * as our next node, but in the current implementation that would be very
-   * complex -- and just isn't all that useful.
-   * 
-   * @throws DOMException -- NOT_SUPPORTED_ERROR because I can't think
-   * of anything more useful to do in this case
-   * */
-  public NodeFilter getFilter() 
-    {
-      throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-    }
-  
-
-  /** @return The root node of the NodeIterator, as specified
-   * when it was created.
-   * */
-  public Node getRoot()
-    {
-      int handle=dtm_iter.getRoot();
-      return dtm_iter.getDTM(handle).getNode(handle);
-    }
-  
-
-  /** Return a mask describing which node types are presented via the
-   * iterator.
-   **/
-  public int getWhatToShow()
-    {
-      return dtm_iter.getWhatToShow();
-    }
-
-  /** @return the next node in the set and advance the position of the
-   * iterator in the set.
-   *
-   * @throw DOMException - INVALID_STATE_ERR Raised if this method is
-   * called after the detach method was invoked.
-   *  */
-  public Node nextNode() throws DOMException
-    {
-      if(!valid)
-        throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
-      
-      int handle=dtm_iter.nextNode();
-      if (handle==-1)
-        return null;
-      return dtm_iter.getDTM(handle).getNode(handle);
-    }
-  
-
-  /** @return the next previous in the set and advance the position of the
-   * iterator in the set.
-   *
-   * @throw DOMException - INVALID_STATE_ERR Raised if this method is
-   * called after the detach method was invoked.
-   *  */
-  public Node previousNode() 
-    {
-      if(!valid)
-        throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
-      
-      int handle=dtm_iter.previousNode();
-      return dtm_iter.getDTM(handle).getNode(handle);
-    }
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMNodeList.java b/src/org/apache/xml/dtm/ref/DTMNodeList.java
deleted file mode 100644
index d9688e5..0000000
--- a/src/org/apache/xml/dtm/ref/DTMNodeList.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-import org.apache.xml.dtm.*;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>DTMNodeList</code> gives us an implementation of the DOM's
- * NodeList interface wrapped around a DTM Iterator. The author
- * considers this something of an abominations, since NodeList was not
- * intended to be a general purpose "list of nodes" API and is
- * generally considered by the DOM WG to have be a mistake... but I'm
- * told that some of the XPath/XSLT folks say they must have this
- * solution.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeList operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeList's "live view" response to
- * document mutation. </li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- * */
-public class DTMNodeList implements org.w3c.dom.NodeList
-{
-  private DTMIterator dtm_iter;
-  private boolean valid=true;
-
-  //================================================================
-  // Methods unique to this class
-
-  /** Public constructor: Wrap a DTMNodeList around an existing
-   * and preconfigured DTMIterator
-   *
-   * WARNING: THIS HAS THE SIDE EFFECT OF ISSUING setShouldCacheNodes(true)
-   * AGAINST THE DTMIterator.
-   * */
-  public DTMNodeList(DTMIterator dtmIterator)
-    {
-      int pos = dtmIterator.getCurrentPos();
-      try
-      {
-        dtm_iter=(DTMIterator)dtmIterator.cloneWithReset();
-      }
-      catch(CloneNotSupportedException cnse) {}
-      dtm_iter.setShouldCacheNodes(true);
-      dtm_iter.runTo(-1);
-      dtm_iter.setCurrentPos(pos);
-    }
-
-  /** Access the wrapped DTMIterator. I'm not sure whether anyone will
-   * need this or not, but let's write it and think about it.
-   * */
-  DTMIterator getDTMIterator()
-    {
-      return dtm_iter;
-    }
-  
-
-  //================================================================
-  // org.w3c.dom.NodeList API follows
-
-    /**
-     * Returns the <code>index</code>th item in the collection. If 
-     * <code>index</code> is greater than or equal to the number of nodes in 
-     * the list, this returns <code>null</code>.
-     * @param indexIndex into the collection.
-     * @return The node at the <code>index</code>th position in the 
-     *   <code>NodeList</code>, or <code>null</code> if that is not a valid 
-     *   index.
-     */
-    public Node item(int index)
-    {
-      int handle=dtm_iter.item(index);
-      return dtm_iter.getDTM(handle).getNode(handle);
-    }
-
-    /**
-     * The number of nodes in the list. The range of valid child node indices 
-     * is 0 to <code>length-1</code> inclusive. 
-     */
-    public int getLength()
-    {
-        return dtm_iter.getLength();
-    }
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMNodeProxy.java b/src/org/apache/xml/dtm/ref/DTMNodeProxy.java
deleted file mode 100644
index 9dca76b..0000000
--- a/src/org/apache/xml/dtm/ref/DTMNodeProxy.java
+++ /dev/null
@@ -1,1283 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.w3c.dom.*;
-import org.apache.xml.dtm.*;
-
-/**
- * <meta name="usage" content="internal"/>
- * <code>DTMNodeProxy</code> presents a DOM Node API front-end to the DTM model.
- * <p>
- * It does _not_ attempt to address the "node identity" question; no effort
- * is made to prevent the creation of multiple proxies referring to a single
- * DTM node. Users can create a mechanism for managing this, or relinquish the
- * use of "==" and use the .sameNodeAs() mechanism, which is under
- * consideration for future versions of the DOM.
- * <p>
- * DTMNodeProxy may be subclassed further to present specific DOM node types.
- *
- * @see org.w3c.dom
- */
-public class DTMNodeProxy
-        implements Node, Document, Text, Element, Attr,
-                   ProcessingInstruction, Comment, DocumentFragment
-{
-
-  /** The DTM for this node. */
-  public DTM dtm;
-
-  /** The DTM node handle. */
-  int node;
-
-  /**
-   * Create a DTMNodeProxy Node representing a specific Node in a DTM
-   *
-   * @param dtm The DTM Reference, must be non-null.
-   * @param node The DTM node handle.
-   */
-  DTMNodeProxy(DTM dtm, int node)
-  {
-    this.dtm = dtm;
-    this.node = node;
-  }
-
-  /**
-   * NON-DOM: Return the DTM model
-   *
-   * @return The DTM that this proxy is a representative for.
-   */
-  public final DTM getDTM()
-  {
-    return dtm;
-  }
-
-  /**
-   * NON-DOM: Return the DTM node number
-   *
-   * @return The DTM node handle.
-   */
-  public final int getDTMNodeNumber()
-  {
-    return node;
-  }
-
-  /**
-   * Test for equality based on node number.
-   *
-   * @param node A DTM node proxy reference.
-   *
-   * @return true if the given node has the same handle as this node.
-   */
-  public final boolean equals(Node node)
-  {
-
-    try
-    {
-      DTMNodeProxy dtmp = (DTMNodeProxy) node;
-
-      // return (dtmp.node == this.node);
-      // Patch attributed to Gary L Peskin <garyp@firstech.com>
-      return (dtmp.node == this.node) && (dtmp.dtm == this.dtm);
-    }
-    catch (ClassCastException cce)
-    {
-      return false;
-    }
-  }
-
-  /**
-   * Test for equality based on node number.
-   *
-   * @param node A DTM node proxy reference.
-   *
-   * @return true if the given node has the same handle as this node.
-   */
-  public final boolean equals(Object node)
-  {
-
-    try
-    {
-
-      // DTMNodeProxy dtmp = (DTMNodeProxy)node;
-      // return (dtmp.node == this.node);
-      // Patch attributed to Gary L Peskin <garyp@firstech.com>
-      return equals((Node) node);
-    }
-    catch (ClassCastException cce)
-    {
-      return false;
-    }
-  }
-
-  /**
-   * FUTURE DOM: Test node identity, in lieu of Node==Node
-   *
-   * @param other
-   *
-   * @return true if the given node has the same handle as this node.
-   */
-  public final boolean sameNodeAs(Node other)
-  {
-
-    if (!(other instanceof DTMNodeProxy))
-      return false;
-
-    DTMNodeProxy that = (DTMNodeProxy) other;
-
-    return this.dtm == that.dtm && this.node == that.node;
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final String getNodeName()
-  {
-    return dtm.getNodeName(node);
-  }
-
-  /**
-   * A PI's "target" states what processor channel the PI's data
-   * should be directed to. It is defined differently in HTML and XML.
-   * <p>
-   * In XML, a PI's "target" is the first (whitespace-delimited) token
-   * following the "<?" token that begins the PI.
-   * <p>
-   * In HTML, target is always null.
-   * <p>
-   * Note that getNodeName is aliased to getTarget.
-   *
-   * @return
-   */
-  public final String getTarget()
-  {
-    return dtm.getNodeName(node);
-  }  // getTarget():String
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node as of DOM Level 2
-   */
-  public final String getLocalName()
-  {
-    return dtm.getLocalName(node);
-  }
-
-  /**
-   * @return The prefix for this node.
-   * @see org.w3c.dom.Node as of DOM Level 2
-   */
-  public final String getPrefix()
-  {
-    return dtm.getPrefix(node);
-  }
-
-  /**
-   *
-   * @param prefix
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node as of DOM Level 2 -- DTMNodeProxy is read-only
-   */
-  public final void setPrefix(String prefix) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node as of DOM Level 2
-   */
-  public final String getNamespaceURI()
-  {
-    return dtm.getNamespaceURI(node);
-  }
-
-  /**
-   *
-   * @param feature
-   * @param version
-   *
-   * @return
-   * @see org.w3c.dom.Node as of DOM Level 2
-   */
-  public final boolean supports(String feature, String version)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param feature
-   * @param version
-   *
-   * @return
-   * @see org.w3c.dom.Node as of DOM Level 2
-   */
-  public final boolean isSupported(String feature, String version)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node
-   */
-  public final String getNodeValue() throws DOMException
-  {
-
-//    // ***** ASSUMPTION: ATTRIBUTES HAVE SINGLE TEXT-NODE CHILD.
-//    // (SIMILAR ASSUMPTION CURRENTLY MADE IN DTM; BE SURE TO
-//    // REVISIT THIS IF THAT CHANGES!)
-//    if (getNodeType() == Node.ATTRIBUTE_NODE)
-//      return dtm.getNodeValue(node + 1);
-
-    return dtm.getNodeValue(node);
-  }
-
-  /**
-   *
-   * @param nodeValue
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
-   */
-  public final void setNodeValue(String nodeValue) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final short getNodeType()
-  {
-    return (short) dtm.getNodeType(node);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Node getParentNode()
-  {
-
-    if (getNodeType() == Node.ATTRIBUTE_NODE)
-      return null;
-
-    int newnode = dtm.getParent(node);
-
-    return (newnode == -1) ? null : dtm.getNode(newnode);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Node getOwnerNode()
-  {
-
-    int newnode = dtm.getParent(node);
-
-    return (newnode == -1) ? null : dtm.getNode(newnode);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final NodeList getChildNodes()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Node getFirstChild()
-  {
-
-    int newnode = dtm.getFirstChild(node);
-
-    return (newnode == -1) ? null : dtm.getNode(newnode);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Node getLastChild()
-  {
-
-    int newnode = dtm.getLastChild(node);
-
-    return (newnode == -1) ? null : dtm.getNode(newnode);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Node getPreviousSibling()
-  {
-
-    int newnode = dtm.getPreviousSibling(node);
-
-    return (newnode == -1) ? null : dtm.getNode(newnode);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Node getNextSibling()
-  {
-
-    // Attr's Next is defined at DTM level, but not at DOM level.
-    if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE)
-      return null;
-
-    int newnode = dtm.getNextSibling(node);
-
-    return (newnode == -1) ? null : dtm.getNode(newnode);
-  }
-
-  // DTMNamedNodeMap m_attrs;
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final NamedNodeMap getAttributes()
-  {
-
-    return new DTMNamedNodeMap(dtm, node);
-  }
-
-  /**
-   * Method hasAttribute
-   *
-   *
-   * @param name
-   *
-   * (hasAttribute) @return
-   */
-  public boolean hasAttribute(String name)
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-
-    // return false;
-  }
-
-  /**
-   * Method hasAttributeNS
-   *
-   *
-   * @param name
-   * @param x
-   *
-   * (hasAttributeNS) @return
-   */
-  public boolean hasAttributeNS(String name, String x)
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-
-    // return false;
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final Document getOwnerDocument()
-  {
-    return new DTMNodeProxy(dtm, dtm.getDocument());
-  }
-
-  /**
-   *
-   * @param newChild
-   * @param refChild
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
-   */
-  public final Node insertBefore(Node newChild, Node refChild)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @param newChild
-   * @param oldChild
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
-   */
-  public final Node replaceChild(Node newChild, Node oldChild)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @param oldChild
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
-   */
-  public final Node removeChild(Node oldChild) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @param newChild
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
-   */
-  public final Node appendChild(Node newChild) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Node
-   */
-  public final boolean hasChildNodes()
-  {
-    return (-1 != dtm.getFirstChild(node));
-  }
-
-  /**
-   *
-   * @param deep
-   *
-   * @return
-   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
-   */
-  public final Node cloneNode(boolean deep)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final DocumentType getDoctype()
-  {
-    return null;
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final DOMImplementation getImplementation()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final Element getDocumentElement()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param tagName
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document
-   */
-  public final Element createElement(String tagName) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final DocumentFragment createDocumentFragment()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param data
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final Text createTextNode(String data)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param data
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final Comment createComment(String data)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param data
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document
-   */
-  public final CDATASection createCDATASection(String data)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param target
-   * @param data
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document
-   */
-  public final ProcessingInstruction createProcessingInstruction(
-          String target, String data) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param name
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document
-   */
-  public final Attr createAttribute(String name) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param name
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document
-   */
-  public final EntityReference createEntityReference(String name)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param tagname
-   *
-   * @return
-   * @see org.w3c.dom.Document
-   */
-  public final NodeList getElementsByTagName(String tagname)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param importedNode
-   * @param deep
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document as of DOM Level 2 -- DTMNodeProxy is read-only
-   */
-  public final Node importNode(Node importedNode, boolean deep)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param qualifiedName
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document as of DOM Level 2
-   */
-  public final Element createElementNS(
-          String namespaceURI, String qualifiedName) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param qualifiedName
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Document as of DOM Level 2
-   */
-  public final Attr createAttributeNS(
-          String namespaceURI, String qualifiedName) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param localName
-   *
-   * @return
-   * @see org.w3c.dom.Document as of DOM Level 2
-   */
-  public final NodeList getElementsByTagNameNS(String namespaceURI,
-          String localName)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param elementId
-   *
-   * @return
-   * @see org.w3c.dom.Document as of DOM Level 2
-   */
-  public final Element getElementById(String elementId)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param offset
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Text
-   */
-  public final Text splitText(int offset) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final String getData() throws DOMException
-  {
-    return dtm.getNodeValue(node);
-  }
-
-  /**
-   *
-   * @param data
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final void setData(String data) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.CharacterData
-   */
-  public final int getLength()
-  {
-
-    // %%FIX: This should do something smarter?
-    return dtm.getNodeValue(node).length();
-  }
-
-  /**
-   *
-   * @param offset
-   * @param count
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final String substringData(int offset, int count) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param arg
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final void appendData(String arg) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param offset
-   * @param arg
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final void insertData(int offset, String arg) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param offset
-   * @param count
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final void deleteData(int offset, int count) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param offset
-   * @param count
-   * @param arg
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.CharacterData
-   */
-  public final void replaceData(int offset, int count, String arg)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Element
-   */
-  public final String getTagName()
-  {
-    return dtm.getNodeName(node);
-  }
-
-  /**
-   *
-   * @param name
-   *
-   * @return
-   * @see org.w3c.dom.Element
-   */
-  public final String getAttribute(String name)
-  {
-
-    DTMNamedNodeMap  map = new DTMNamedNodeMap(dtm, node);
-    Node node = map.getNamedItem(name);
-    return (null == node) ? null : node.getNodeValue();
-  }
-
-  /**
-   *
-   * @param name
-   * @param value
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final void setAttribute(String name, String value)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param name
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final void removeAttribute(String name) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param name
-   *
-   * @return
-   * @see org.w3c.dom.Element
-   */
-  public final Attr getAttributeNode(String name)
-  {
-
-    DTMNamedNodeMap  map = new DTMNamedNodeMap(dtm, node);
-    return (Attr)map.getNamedItem(name);
-  }
-
-  /**
-   *
-   * @param newAttr
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final Attr setAttributeNode(Attr newAttr) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param oldAttr
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final Attr removeAttributeNode(Attr oldAttr) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * Introduced in DOM Level 2.
-   *
-   * @return
-   */
-  public boolean hasAttributes()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /** @see org.w3c.dom.Element */
-  public final void normalize()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param localName
-   *
-   * @return
-   * @see org.w3c.dom.Element
-   */
-  public final String getAttributeNS(String namespaceURI, String localName)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param qualifiedName
-   * @param value
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final void setAttributeNS(
-          String namespaceURI, String qualifiedName, String value)
-            throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param localName
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final void removeAttributeNS(String namespaceURI, String localName)
-          throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param namespaceURI
-   * @param localName
-   *
-   * @return
-   * @see org.w3c.dom.Element
-   */
-  public final Attr getAttributeNodeNS(String namespaceURI, String localName)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @param newAttr
-   *
-   * @return
-   *
-   * @throws DOMException
-   * @see org.w3c.dom.Element
-   */
-  public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Attr
-   */
-  public final String getName()
-  {
-    return dtm.getNodeName(node);
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Attr
-   */
-  public final boolean getSpecified()
-  {
-
-    // %%FIX
-    return true;
-  }
-
-  /**
-   *
-   * @return
-   * @see org.w3c.dom.Attr
-   */
-  public final String getValue()
-  {
-    return dtm.getNodeValue(node);
-  }
-
-  /**
-   *
-   * @param value
-   * @see org.w3c.dom.Attr
-   */
-  public final void setValue(String value)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * Get the owner element of an attribute.
-   *
-   * @return
-   * @see org.w3c.dom.Attr as of DOM Level 2
-   */
-  public final Element getOwnerElement()
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * NEEDSDOC Method adoptNode 
-   *
-   *
-   * NEEDSDOC @param source
-   *
-   * NEEDSDOC (adoptNode) @return
-   *
-   * @throws DOMException
-   */
-  public Node adoptNode(Node source) throws DOMException
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the encoding
-   * of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public String getEncoding()
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the encoding
-   * of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param encoding
-   */
-  public void setEncoding(String encoding)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, whether this
-   * document is standalone.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public boolean getStandalone()
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, whether this
-   * document is standalone.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param standalone
-   */
-  public void setStandalone(boolean standalone)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying whether errors checking is enforced or not.
-   * When set to <code>false</code>, the implementation is free to not
-   * test every possible error case normally defined on DOM operations,
-   * and not raise any <code>DOMException</code>. In case of error, the
-   * behavior is undefined. This attribute is <code>true</code> by
-   * defaults.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public boolean getStrictErrorChecking()
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying whether errors checking is enforced or not.
-   * When set to <code>false</code>, the implementation is free to not
-   * test every possible error case normally defined on DOM operations,
-   * and not raise any <code>DOMException</code>. In case of error, the
-   * behavior is undefined. This attribute is <code>true</code> by
-   * defaults.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param strictErrorChecking
-   */
-  public void setStrictErrorChecking(boolean strictErrorChecking)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the version
-   * number of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public String getVersion()
-  {
-
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the version
-   * number of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param version
-   */
-  public void setVersion(String version)
-  {
-    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMSafeStringPool.java b/src/org/apache/xml/dtm/ref/DTMSafeStringPool.java
deleted file mode 100644
index 979e502..0000000
--- a/src/org/apache/xml/dtm/ref/DTMSafeStringPool.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-import java.util.Vector;
-
-/** <p>Like DTMStringPool, but threadsafe. It's been proposed that DTMs
- * share their string pool(s); that raises threadsafety issues which
- * this addresses. Of course performance is inferior to that of the
- * bare-bones version.</p>
- *
- * <p>Status: Passed basic test in main().</p>
- * */
-public class DTMSafeStringPool
-extends DTMStringPool
-{
-  public synchronized void removeAllElements()
-    {
-      super.removeAllElements();
-    }
-
-  /** @return string whose value is uniquely identified by this integer index.
-   * @throws java.lang.ArrayIndexOutOfBoundsException
-   *  if index doesn't map to a string.
-   * */ 
-  public synchronized String indexToString(int i)
-    throws java.lang.ArrayIndexOutOfBoundsException
-    {
-      return super.indexToString(i);
-    }
-
-  /** @return integer index uniquely identifying the value of this string. */ 
-  public synchronized int stringToIndex(String s)
-    {
-      return super.stringToIndex(s);
-    }
-
-  /** Command-line unit test driver. This test relies on the fact that
-   * this version of the pool assigns indices consecutively, starting
-   * from zero, as new unique strings are encountered.
-   */
-  public static void main(String[] args)
-  {
-    String[] word={
-      "Zero","One","Two","Three","Four","Five",
-      "Six","Seven","Eight","Nine","Ten",
-      "Eleven","Twelve","Thirteen","Fourteen","Fifteen",
-      "Sixteen","Seventeen","Eighteen","Nineteen","Twenty",
-      "Twenty-One","Twenty-Two","Twenty-Three","Twenty-Four",
-      "Twenty-Five","Twenty-Six","Twenty-Seven","Twenty-Eight",
-      "Twenty-Nine","Thirty","Thirty-One","Thirty-Two",
-      "Thirty-Three","Thirty-Four","Thirty-Five","Thirty-Six",
-      "Thirty-Seven","Thirty-Eight","Thirty-Nine"};
-
-    DTMStringPool pool=new DTMSafeStringPool();
-
-    System.out.println("If no complaints are printed below, we passed initial test.");
-
-    for(int pass=0;pass<=1;++pass)
-      {
-        int i;
-
-        for(i=0;i<word.length;++i)
-          {
-            int j=pool.stringToIndex(word[i]);
-            if(j!=i)
-              System.out.println("\tMismatch populating pool: assigned "+
-                                 j+" for create "+i);
-          }
-
-        for(i=0;i<word.length;++i)
-          {
-            int j=pool.stringToIndex(word[i]);
-            if(j!=i)
-              System.out.println("\tMismatch in stringToIndex: returned "+
-                                 j+" for lookup "+i);
-          }
-
-        for(i=0;i<word.length;++i)
-          {
-            String w=pool.indexToString(i);
-            if(!word[i].equals(w))
-              System.out.println("\tMismatch in indexToString: returned"+
-                                 w+" for lookup "+i);
-          }
-        
-        pool.removeAllElements();
-        
-        System.out.println("\nPass "+pass+" complete\n");
-      } // end pass loop
-  }
-} // DTMSafeStringPool
diff --git a/src/org/apache/xml/dtm/ref/DTMStringPool.java b/src/org/apache/xml/dtm/ref/DTMStringPool.java
deleted file mode 100644
index ec56d8b..0000000
--- a/src/org/apache/xml/dtm/ref/DTMStringPool.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-// %REVIEW% Should this be based on SuballocatedIntVector instead?
-// (Unclear. Pools will rarely be huge. But if they ever are...)
-import org.apache.xml.utils.IntVector;
-import java.util.Vector;
-
-/** <p>DTMStringPool is an "interning" mechanism for strings. It will
- * create a stable 1:1 mapping between a set of string values and a set of
- * integer index values, so the integers can be used to reliably and
- * uniquely identify (and when necessary retrieve) the strings.</p>
- *
- * <p>Design Priorities:
- * <ul>
- * <li>String-to-index lookup speed is critical.</li>
- * <li>Index-to-String lookup speed is slightly less so.</li>
- * <li>Threadsafety is not guaranteed at this level.
- * Enforce that in the application if needed.</li>
- * <li>Storage efficiency is an issue but not a huge one.
- * It is expected that string pools won't exceed about 2000 entries.</li>
- * </ul>
- * </p>
- *
- * <p>Implementation detail: A standard Hashtable is relatively
- * inefficient when looking up primitive int values, especially when
- * we're already maintaining an int-to-string vector.  So I'm
- * maintaining a simple hash chain within this class.</p>
- *
- * <p>NOTE: There is nothing in the code that has a real dependency upon
- * String. It would work with any object type that implements reliable
- * .hashCode() and .equals() operations. The API enforces Strings because
- * it's safer that way, but this could trivially be turned into a general
- * ObjectPool if one was needed.</p>
- *
- * <p>Status: Passed basic test in main().</p>
- * */
-public class DTMStringPool
-{
-  Vector m_intToString;
-  static final int HASHPRIME=101;
-  int[] m_hashStart=new int[HASHPRIME];
-  IntVector m_hashChain;
-  public static final int NULL=-1;
-
-  public DTMStringPool()
-    {
-      m_intToString=new Vector();
-      m_hashChain=new IntVector(512);
-      removeAllElements();
-      
-      // -sb Add this to force empty strings to be index 0.
-      stringToIndex("");
-    }
-  
-  public void removeAllElements()
-    {
-      m_intToString.removeAllElements();
-      for(int i=0;i<HASHPRIME;++i)
-        m_hashStart[i]=NULL;
-      m_hashChain.removeAllElements();
-    }
-
-  /** @return string whose value is uniquely identified by this integer index.
-   * @throws java.lang.ArrayIndexOutOfBoundsException
-   *  if index doesn't map to a string.
-   * */ 
-  public String indexToString(int i)
-    throws java.lang.ArrayIndexOutOfBoundsException
-    {
-      if(i==NULL) return null;
-      return (String) m_intToString.elementAt(i);
-    }
-
-  /** @return integer index uniquely identifying the value of this string. */ 
-  public int stringToIndex(String s)
-    {
-      if(s==null) return NULL;
-      
-      int hashslot=s.hashCode()%HASHPRIME;
-      if(hashslot<0) hashslot=-hashslot;
-
-      // Is it one we already know?
-      int hashlast=m_hashStart[hashslot];
-      int hashcandidate=hashlast;
-      while(hashcandidate!=NULL)
-        {
-          if(m_intToString.elementAt(hashcandidate).equals(s))
-            return hashcandidate;
-
-          hashlast=hashcandidate;
-          hashcandidate=m_hashChain.elementAt(hashcandidate);
-        }
-      
-      // New value. Add to tables.
-      int newIndex=m_intToString.size();
-      m_intToString.addElement(s);
-
-      m_hashChain.addElement(NULL);	// Initialize to no-following-same-hash
-      if(hashlast==NULL)  // First for this hash
-        m_hashStart[hashslot]=newIndex;
-      else // Link from previous with same hash
-        m_hashChain.setElementAt(newIndex,hashlast);
-
-      return newIndex;
-    }
-
-  /** Command-line unit test driver. This test relies on the fact that
-   * this version of the pool assigns indices consecutively, starting
-   * from zero, as new unique strings are encountered.
-   */
-  public static void main(String[] args)
-  {
-    String[] word={
-      "Zero","One","Two","Three","Four","Five",
-      "Six","Seven","Eight","Nine","Ten",
-      "Eleven","Twelve","Thirteen","Fourteen","Fifteen",
-      "Sixteen","Seventeen","Eighteen","Nineteen","Twenty",
-      "Twenty-One","Twenty-Two","Twenty-Three","Twenty-Four",
-      "Twenty-Five","Twenty-Six","Twenty-Seven","Twenty-Eight",
-      "Twenty-Nine","Thirty","Thirty-One","Thirty-Two",
-      "Thirty-Three","Thirty-Four","Thirty-Five","Thirty-Six",
-      "Thirty-Seven","Thirty-Eight","Thirty-Nine"};
-
-    DTMStringPool pool=new DTMStringPool();
-
-    System.out.println("If no complaints are printed below, we passed initial test.");
-
-    for(int pass=0;pass<=1;++pass)
-      {
-        int i;
-
-        for(i=0;i<word.length;++i)
-          {
-            int j=pool.stringToIndex(word[i]);
-            if(j!=i)
-              System.out.println("\tMismatch populating pool: assigned "+
-                                 j+" for create "+i);
-          }
-
-        for(i=0;i<word.length;++i)
-          {
-            int j=pool.stringToIndex(word[i]);
-            if(j!=i)
-              System.out.println("\tMismatch in stringToIndex: returned "+
-                                 j+" for lookup "+i);
-          }
-
-        for(i=0;i<word.length;++i)
-          {
-            String w=pool.indexToString(i);
-            if(!word[i].equals(w))
-              System.out.println("\tMismatch in indexToString: returned"+
-                                 w+" for lookup "+i);
-          }
-        
-        pool.removeAllElements();
-        
-        System.out.println("\nPass "+pass+" complete\n");
-      } // end pass loop
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/DTMTreeWalker.java b/src/org/apache/xml/dtm/ref/DTMTreeWalker.java
deleted file mode 100644
index 340e5d9..0000000
--- a/src/org/apache/xml/dtm/ref/DTMTreeWalker.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.apache.xml.utils.NodeConsumer;
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class does a pre-order walk of the DTM tree, calling a ContentHandler
- * interface as it goes. As such, it's more like the Visitor design pattern
- * than like the DOM's TreeWalker.
- *
- * I think normally this class should not be needed, because 
- * of DTM#dispatchToEvents.
- */
-public class DTMTreeWalker
-{
-
-  /** Local reference to a ContentHandler          */
-  private ContentHandler m_contentHandler = null;
-
-  /** DomHelper for this TreeWalker          */
-  protected DTM m_dtm;
-  
-  /**
-   * Set the DTM to be traversed.
-   * 
-   * @param dtm The Document Table Model to be used.
-   */
-  public void setDTM(DTM dtm)
-  {
-    m_dtm = dtm;
-  }
-
-  /**
-   * Get the ContentHandler used for the tree walk.
-   *
-   * @return the ContentHandler used for the tree walk
-   */
-  public ContentHandler getcontentHandler()
-  {
-    return m_contentHandler;
-  }
-  
-  /**
-   * Set the ContentHandler used for the tree walk.
-   *
-   * @param ch the ContentHandler to be the result of the tree walk.
-   */
-  public void setcontentHandler(ContentHandler ch)
-  {
-    m_contentHandler = ch;
-  }
-
-  
-  /**
-   * Constructor.
-   * @param   contentHandler The implemention of the
-   * contentHandler operation (toXMLString, digest, ...)
-   */
-  public DTMTreeWalker()
-  {
-  }
-  
-  /**
-   * Constructor.
-   * @param   contentHandler The implemention of the
-   * contentHandler operation (toXMLString, digest, ...)
-   */
-  public DTMTreeWalker(ContentHandler contentHandler, DTM dtm)
-  {
-    this.m_contentHandler = contentHandler;
-    m_dtm = dtm;
-  }
-  
-  /** Perform a non-recursive pre-order/post-order traversal,
-   * operating as a Visitor. startNode (preorder) and endNode
-   * (postorder) are invoked for each node as we traverse over them,
-   * with the result that the node is written out to m_contentHandler.
-   *
-   * @param pos Node in the tree at which to start (and end) traversal --
-   * in other words, the root of the subtree to traverse over.
-   *
-   * @throws TransformerException */
-  public void traverse(int pos) throws org.xml.sax.SAXException
-  {
-    // %REVIEW% Why isn't this just traverse(pos,pos)?
-
-    int top = pos;		// Remember the root of this subtree
-
-    while (DTM.NULL != pos)
-    {
-      startNode(pos);
-      int nextNode = m_dtm.getFirstChild(pos);
-      while (DTM.NULL == nextNode)
-      {
-        endNode(pos);
-
-        if (top == pos)
-          break;
-
-        nextNode = m_dtm.getNextSibling(pos);
-
-        if (DTM.NULL == nextNode)
-        {
-          pos = m_dtm.getParent(pos);
-
-          if ((DTM.NULL == pos) || (top == pos))
-          {
-            // %REVIEW% This condition isn't tested in traverse(pos,top)
-            // -- bug?
-            if (DTM.NULL != pos)
-              endNode(pos);
-
-            nextNode = DTM.NULL;
-
-            break;
-          }
-        }
-      }
-
-      pos = nextNode;
-    }
-  }
-
-  /** Perform a non-recursive pre-order/post-order traversal,
-   * operating as a Visitor. startNode (preorder) and endNode
-   * (postorder) are invoked for each node as we traverse over them,
-   * with the result that the node is written out to m_contentHandler.
-   *
-   * @param pos Node in the tree where to start traversal
-   * @param top Node in the tree where to end traversal.
-   * If top==DTM.NULL, run through end of document.
-   *
-   * @throws TransformerException
-   */
-  public void traverse(int pos, int top) throws org.xml.sax.SAXException
-  {
-    // %OPT% Can we simplify the loop conditionals by adding:
-    //		if(top==DTM.NULL) top=0
-    // -- or by simply ignoring this case and relying on the fact that
-    // pos will never equal DTM.NULL until we're ready to exit?
-
-    while (DTM.NULL != pos)
-    {
-      startNode(pos);
-      int nextNode = m_dtm.getFirstChild(pos);
-      while (DTM.NULL == nextNode)
-      {
-        endNode(pos);
-
-        if ((DTM.NULL != top) && top == pos)
-          break;
-
-        nextNode = m_dtm.getNextSibling(pos);
-
-        if (DTM.NULL == nextNode)
-        {
-          pos = m_dtm.getParent(pos);
-
-          if ((DTM.NULL == pos) || ((DTM.NULL != top) && (top == pos)))
-          {
-            nextNode = DTM.NULL;
-
-            break;
-          }
-        }
-      }
-
-      pos = nextNode;
-    }
-  }
-
-  /** Flag indicating whether following text to be processed is raw text          */
-  boolean nextIsRaw = false;
-  
-  /**
-   * Optimized dispatch of characters.
-   */
-  private final void dispatachChars(int node)
-     throws org.xml.sax.SAXException
-  {
-    m_dtm.dispatchCharactersEvents(node, m_contentHandler, false);
-  }
-
-  /**
-   * Start processing given node
-   *
-   *
-   * @param node Node to process
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void startNode(int node) throws org.xml.sax.SAXException
-  {
-
-    if (m_contentHandler instanceof NodeConsumer)
-    {
-      // %TBD%
-//      ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
-    }
-
-    switch (m_dtm.getNodeType(node))
-    {
-    case DTM.COMMENT_NODE :
-    {
-      XMLString data = m_dtm.getStringValue(node);
-
-      if (m_contentHandler instanceof LexicalHandler)
-      {
-        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-        data.dispatchAsComment(lh);
-      }
-    }
-    break;
-    case DTM.DOCUMENT_FRAGMENT_NODE :
-
-      // ??;
-      break;
-    case DTM.DOCUMENT_NODE :
-      this.m_contentHandler.startDocument();
-      break;
-    case DTM.ELEMENT_NODE :
-      DTM dtm = m_dtm;           
-
-      for (int nsn = dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
-           nsn = dtm.getNextNamespaceNode(node, nsn, true))
-      {
-        // String prefix = dtm.getPrefix(nsn);
-        String prefix = dtm.getNodeNameX(nsn);
-
-        this.m_contentHandler.startPrefixMapping(prefix, dtm.getNodeValue(nsn));
-        
-      }
-
-      // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node));
-      // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node));
-      String ns = dtm.getNamespaceURI(node);
-      if(null == ns)
-        ns = "";
-        
-      // %OPT% !!
-      org.xml.sax.helpers.AttributesImpl attrs = 
-                            new org.xml.sax.helpers.AttributesImpl();
-              
-      for (int i = dtm.getFirstAttribute(node); 
-           i != DTM.NULL; 
-           i = dtm.getNextAttribute(i)) 
-      {
-        attrs.addAttribute(dtm.getNamespaceURI(i), 
-                           dtm.getLocalName(i), 
-                           dtm.getNodeName(i), 
-                           "CDATA", 
-                           dtm.getNodeValue(i));
-      }
-      
-        
-      this.m_contentHandler.startElement(ns,
-                                         m_dtm.getLocalName(node),
-                                         m_dtm.getNodeName(node),
-                                         attrs);
-      break;
-    case DTM.PROCESSING_INSTRUCTION_NODE :
-    {
-      String name = m_dtm.getNodeName(node);
-
-      // String data = pi.getData();
-      if (name.equals("xslt-next-is-raw"))
-      {
-        nextIsRaw = true;
-      }
-      else
-      {
-        this.m_contentHandler.processingInstruction(name,
-                                                    m_dtm.getNodeValue(node));
-      }
-    }
-    break;
-    case DTM.CDATA_SECTION_NODE :
-    {
-      boolean isLexH = (m_contentHandler instanceof LexicalHandler);
-      LexicalHandler lh = isLexH
-                          ? ((LexicalHandler) this.m_contentHandler) : null;
-
-      if (isLexH)
-      {
-        lh.startCDATA();
-      }
-      
-      dispatachChars(node);
-
-      {
-        if (isLexH)
-        {
-          lh.endCDATA();
-        }
-      }
-    }
-    break;
-    case DTM.TEXT_NODE :
-    {
-      if (nextIsRaw)
-      {
-        nextIsRaw = false;
-
-        m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
-        dispatachChars(node);
-        m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
-      }
-      else
-      {
-        dispatachChars(node);
-      }
-    }
-    break;
-    case DTM.ENTITY_REFERENCE_NODE :
-    {
-      if (m_contentHandler instanceof LexicalHandler)
-      {
-        ((LexicalHandler) this.m_contentHandler).startEntity(
-          m_dtm.getNodeName(node));
-      }
-      else
-      {
-
-        // warning("Can not output entity to a pure SAX ContentHandler");
-      }
-    }
-    break;
-    default :
-    }
-  }
-
-  /**
-   * End processing of given node 
-   *
-   *
-   * @param node Node we just finished processing
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void endNode(int node) throws org.xml.sax.SAXException
-  {
-
-    switch (m_dtm.getNodeType(node))
-    {
-    case DTM.DOCUMENT_NODE :
-      this.m_contentHandler.endDocument();
-      break;
-    case DTM.ELEMENT_NODE :
-      String ns = m_dtm.getNamespaceURI(node);
-      if(null == ns)
-        ns = "";
-      this.m_contentHandler.endElement(ns,
-                                         m_dtm.getLocalName(node),
-                                         m_dtm.getNodeName(node));
-
-      for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
-           nsn = m_dtm.getNextNamespaceNode(node, nsn, true))
-      {
-        // String prefix = m_dtm.getPrefix(nsn);
-        String prefix = m_dtm.getNodeNameX(nsn);
-
-        this.m_contentHandler.endPrefixMapping(prefix);
-      }
-      break;
-    case DTM.CDATA_SECTION_NODE :
-      break;
-    case DTM.ENTITY_REFERENCE_NODE :
-    {
-      if (m_contentHandler instanceof LexicalHandler)
-      {
-        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
-        lh.endEntity(m_dtm.getNodeName(node));
-      }
-    }
-    break;
-    default :
-    }
-  }
-}  //TreeWalker
-
diff --git a/src/org/apache/xml/dtm/ref/ExpandedNameTable.java b/src/org/apache/xml/dtm/ref/ExpandedNameTable.java
deleted file mode 100644
index 9f146a4..0000000
--- a/src/org/apache/xml/dtm/ref/ExpandedNameTable.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.DTM;
-
-/**
- * This is a default implementation of a table that manages mappings from
- * expanded names to expandedNameIDs.
- *
- * %REVIEW% Note that this is not really a separate table, or a
- * separate pool. Instead, it's an access method build on top of the
- * existing pools, using three pieces of information: the index
- * numbers for a node's namespaceURI, localName, and node type, which
- * are combined to yield a composite index number.
- *
- * %TBD% startup sequence -- how this gets access to the appropriate
- * string pools in the DTMDocument/stylesheet.
- *
- * */
-public class ExpandedNameTable
-{
-
-  /** Probably a reference to static pool.     */
-  private DTMStringPool m_locNamesPool;
-
-  /** Probably a reference to static pool.   */
-  private DTMStringPool m_namespaceNames;
-  
-  public static int BITS_PER_LOCALNAME = 16;
-  public static int BITS_PER_NAMESPACE = 10;
-
-  public static int MASK_LOCALNAME = 0x0000FFFF;
-  public static int MASK_NAMESPACE = 0x03FF0000;
-  public static int MASK_NODETYPE = 0xFC000000;
-  public static int MASK_NODEHANDLE = 0x000FFFFF;
-
-  public static final int ROTAMOUNT_TYPE = (BITS_PER_NAMESPACE+BITS_PER_LOCALNAME);
-  
-  // These are all the types prerotated, for caller convenience.
-  public static final int ELEMENT = ((int)DTM.ELEMENT_NODE) << ROTAMOUNT_TYPE;
-  public static final int ATTRIBUTE = ((int)DTM.ATTRIBUTE_NODE) << ROTAMOUNT_TYPE;
-  public static final int TEXT = ((int)DTM.TEXT_NODE) << ROTAMOUNT_TYPE;
-  public static final int CDATA_SECTION = ((int)DTM.CDATA_SECTION_NODE) << ROTAMOUNT_TYPE;
-  public static final int ENTITY_REFERENCE = ((int)DTM.ENTITY_REFERENCE_NODE) << ROTAMOUNT_TYPE;
-  public static final int ENTITY = ((int)DTM.ENTITY_NODE) << ROTAMOUNT_TYPE;
-  public static final int PROCESSING_INSTRUCTION = ((int)DTM.PROCESSING_INSTRUCTION_NODE) << ROTAMOUNT_TYPE;
-  public static final int COMMENT = ((int)DTM.COMMENT_NODE) << ROTAMOUNT_TYPE;
-  public static final int DOCUMENT = ((int)DTM.DOCUMENT_NODE) << ROTAMOUNT_TYPE;
-  public static final int DOCUMENT_TYPE = ((int)DTM.DOCUMENT_TYPE_NODE) << ROTAMOUNT_TYPE;
-  public static final int DOCUMENT_FRAGMENT =((int)DTM.DOCUMENT_FRAGMENT_NODE) << ROTAMOUNT_TYPE;
-  public static final int NOTATION = ((int)DTM.NOTATION_NODE) << ROTAMOUNT_TYPE;
-  public static final int NAMESPACE = ((int)DTM.NAMESPACE_NODE) << ROTAMOUNT_TYPE;
-
-  /**
-   * Create an expanded name table that uses private string pool lookup.
-   */
-  public ExpandedNameTable()
-  {
-    m_locNamesPool = new DTMSafeStringPool();
-    m_namespaceNames = new DTMSafeStringPool();
-  }
-
-  /**
-   * Constructor ExpandedNameTable
-   *
-   * @param locNamesPool Local element names lookup.
-   * @param namespaceNames Namespace values lookup.
-   */
-  public ExpandedNameTable(DTMStringPool locNamesPool,
-                           DTMStringPool namespaceNames)
-  {
-    m_locNamesPool = locNamesPool;
-    m_namespaceNames = namespaceNames;
-  }
-
-  /**
-   * Given an expanded name, return an ID.  If the expanded-name does not
-   * exist in the internal tables, the entry will be created, and the ID will
-   * be returned.  Any additional nodes that are created that have this
-   * expanded name will use this ID.
-   *
-   * @param namespace
-   * @param localName
-   *
-   * @return the expanded-name id of the node.
-   */
-  public int getExpandedTypeID(String namespace, String localName, int type)
-  {
-    int nsID = (null != namespace) ? m_namespaceNames.stringToIndex(namespace) : 0;
-    int lnID = m_locNamesPool.stringToIndex(localName);
-    
-    int expandedTypeID = (type << (BITS_PER_NAMESPACE+BITS_PER_LOCALNAME)) 
-                       | (nsID << BITS_PER_LOCALNAME) | lnID;
-
-    return expandedTypeID;
-  }
-  
-  /**
-   * Given a type, return an expanded name ID.Any additional nodes that are 
-   * created that have this expanded name will use this ID.
-   *
-   * @param namespace
-   * @param localName
-   *
-   * @return the expanded-name id of the node.
-   */
-  public int getExpandedTypeID(int type)
-  {
-    int expandedTypeID = (type << (BITS_PER_NAMESPACE+BITS_PER_LOCALNAME));
-
-    return expandedTypeID;
-  }
-
-  /**
-   * Given an expanded-name ID, return the local name part.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return String Local name of this node, or null if the node has no name.
-   */
-  public String getLocalName(int ExpandedNameID)
-  {
-    return m_locNamesPool.indexToString(ExpandedNameID & MASK_LOCALNAME);
-  }
-  
-  /**
-   * Given an expanded-name ID, return the local name ID.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return The id of this local name.
-   */
-  public static final int getLocalNameID(int ExpandedNameID)
-  {
-    return (ExpandedNameID & MASK_LOCALNAME);
-  }
-
-
-  /**
-   * Given an expanded-name ID, return the namespace URI part.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public String getNamespace(int ExpandedNameID)
-  {
-
-    int id = (ExpandedNameID & MASK_NAMESPACE) >> BITS_PER_LOCALNAME;
-    return (0 == id) ? null : m_namespaceNames.indexToString(id);
-  }
-  
-  /**
-   * Given an expanded-name ID, return the namespace URI ID.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return The id of this namespace.
-   */
-  public static final int getNamespaceID(int ExpandedNameID)
-  {
-    return (ExpandedNameID & MASK_NAMESPACE) >> BITS_PER_LOCALNAME;
-  }
-  
-  /**
-   * Given an expanded-name ID, return the local name ID.
-   *
-   * @param ExpandedNameID an ID that represents an expanded-name.
-   * @return The id of this local name.
-   */
-  public static final short getType(int ExpandedNameID)
-  {
-    return (short)(ExpandedNameID >> ROTAMOUNT_TYPE);
-  }
-  
-}
diff --git a/src/org/apache/xml/dtm/ref/IncrementalSAXSource.java b/src/org/apache/xml/dtm/ref/IncrementalSAXSource.java
deleted file mode 100644
index deec276..0000000
--- a/src/org/apache/xml/dtm/ref/IncrementalSAXSource.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.XMLReader;
-
-/** <p>IncrementalSAXSource is an API that delivers a small number of
- * SAX events each time a request is made from a "controller"
- * coroutine.  See IncrementalSAXFilter and IncrementalSAXFilter_Xerces
- * for examples.
- * 
- * Note that interaction is via the deliverMoreNodes
- * method, and therefore coroutine support is not exposed
- * here.</p>
- * */
-public interface IncrementalSAXSource
-{
-  // ------------------------------------------------------------------
-  // SAX Output API
-  // ------------------------------------------------------------------
-
-  /** Register a SAX-style content handler for us to output to
-   */
-  public void setContentHandler(ContentHandler handler);
-
-  /**  Register a SAX-style lexical handler for us to output to
-   */
-  public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler);
-
-  // ------------------------------------------------------------------
-  // Command Input API
-  // ------------------------------------------------------------------
-
-  /** deliverMoreNodes() is a simple API which tells the thread in which the
-   * IncrementalSAXSource is running to deliver more events (true),
-   * or stop delivering events and close out its input (false).
-   *
-   * This is intended to be called from one of our partner coroutines,
-   * and serves to encapsulate the coroutine communication protocol.
-   *
-   * @param parsemore If true, tells the incremental SAX stream to deliver
-   * another chunk of events. If false, finishes out the stream.
-   *
-   * @return Boolean.TRUE if the IncrementalSAXSource believes more data
-   * may be available for further parsing. Boolean.FALSE if parsing
-   * ran to completion, or was ended by deliverMoreNodes(false).
-   * */
-  public Object deliverMoreNodes (boolean parsemore);
-
-  // ------------------------------------------------------------------
-  // Parse Thread Convenience API
-  // ------------------------------------------------------------------
-
-  /** Launch an XMLReader's parsing operation, feeding events to this
-   * IncrementalSAXSource. In some implementations, this may launch a
-   * thread which runs the previously supplied XMLReader's parse() operation.
-   * In others, it may do other forms of initialization.
-   *
-   * @throws SAXException is parse thread is already in progress
-   * or parsing can not be started.
-   * */
-  public void startParse(InputSource source) throws SAXException;
-    
-} // class IncrementalSAXSource
diff --git a/src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java b/src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
deleted file mode 100644
index 6b64c49..0000000
--- a/src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
+++ /dev/null
@@ -1,813 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.XMLReader;
-import java.io.IOException;
-import org.apache.xml.dtm.ref.IncrementalSAXSource;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/** <p>IncrementalSAXSource_Filter implements IncrementalSAXSource, using a
- * standard SAX2 event source as its input and parcelling out those
- * events gradually in reponse to deliverMoreNodes() requests.  Output from the
- * filter will be passed along to a SAX handler registered as our
- * listener, but those callbacks will pass through a counting stage
- * which periodically yields control back to the controller coroutine.
- * </p>
- *
- * <p>%REVIEW%: This filter is not currenly intended to be reusable
- * for parsing additional streams/documents. We may want to consider
- * making it resettable at some point in the future. But it's a 
- * small object, so that'd be mostly a convenience issue; the cost
- * of allocating each time is trivial compared to the cost of processing
- * any nontrival stream.</p>
- *
- * <p>For a brief usage example, see the unit-test main() method.</p>
- *
- * <p>This is a simplification of the old CoroutineSAXParser, focusing
- * specifically on filtering. The resulting controller protocol is _far_
- * simpler and less error-prone; the only controller operation is deliverMoreNodes(),
- * and the only requirement is that deliverMoreNodes(false) be called if you want to
- * discard the rest of the stream and the previous deliverMoreNodes() didn't return
- * false.
- * */
-public class IncrementalSAXSource_Filter
-implements IncrementalSAXSource, ContentHandler, LexicalHandler, ErrorHandler, Runnable
-{
-  boolean DEBUG=false; //Internal status report
-
-  //
-  // Data
-  //
-  private CoroutineManager fCoroutineManager = null;
-  private int fControllerCoroutineID = -1;
-  private int fSourceCoroutineID = -1;
-
-  private ContentHandler clientContentHandler=null; // %REVIEW% support multiple?
-  private LexicalHandler clientLexicalHandler=null; // %REVIEW% support multiple?
-  private ErrorHandler clientErrorHandler=null; // %REVIEW% support multiple?
-  private int eventcounter;
-  private int frequency=5;
-
-  // Flag indicating that no more events should be delivered -- either
-  // because input stream ran to completion (endDocument), or because
-  // the user requested an early stop via deliverMoreNodes(false).
-  private boolean fNoMoreEvents=false;
-
-  // Support for startParse()
-  private XMLReader fXMLReader=null;
-  private InputSource fXMLReaderInputSource=null;
-
-  //
-  // Constructors
-  //
-
-  public IncrementalSAXSource_Filter() {
-    this.init( new CoroutineManager(), -1, -1);
-  }
-  
-  /** Create a IncrementalSAXSource_Filter which is not yet bound to a specific
-   * SAX event source.
-   * */
-  public IncrementalSAXSource_Filter(CoroutineManager co, int controllerCoroutineID)
-  {
-    this.init( co, controllerCoroutineID, -1 );
-  }
-
-  //
-  // Factories
-  //
-  static public IncrementalSAXSource createIncrementalSAXSource(CoroutineManager co, int controllerCoroutineID) {
-    return new IncrementalSAXSource_Filter(co, controllerCoroutineID);
-  }
-
-  //
-  // Public methods
-  //
-
-  public void init( CoroutineManager co, int controllerCoroutineID,
-                    int sourceCoroutineID)
-  {
-    if(co==null)
-      co = new CoroutineManager();
-    fCoroutineManager = co;
-    fControllerCoroutineID = co.co_joinCoroutineSet(controllerCoroutineID);
-    fSourceCoroutineID = co.co_joinCoroutineSet(sourceCoroutineID);
-    if (fControllerCoroutineID == -1 || fSourceCoroutineID == -1)
-      throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_COJOINROUTINESET_FAILED, null)); //"co_joinCoroutineSet() failed");
-
-    fNoMoreEvents=false;
-    eventcounter=frequency;
-  }
-    
-  /** Bind our input streams to an XMLReader.
-   *
-   * Just a convenience routine; obviously you can explicitly register
-   * this as a listener with the same effect.
-   * */
-  public void setXMLReader(XMLReader eventsource)
-  {
-    fXMLReader=eventsource;
-    eventsource.setContentHandler(this);
-    eventsource.setErrorHandler(this); // to report fatal errors in filtering mode
-
-    // Not supported by all SAX2 filters:
-    try 
-    {
-      eventsource.
-        setProperty("http://xml.org/sax/properties/lexical-handler",
-                    this);
-    }
-    catch(SAXNotRecognizedException e)
-    {
-      // Nothing we can do about it
-    }
-    catch(SAXNotSupportedException e)
-    {
-      // Nothing we can do about it
-    }
-
-    // Should we also bind as other varieties of handler?
-    // (DTDHandler and so on)
-  }
-
-  // Register a content handler for us to output to
-  public void setContentHandler(ContentHandler handler)
-  {
-    clientContentHandler=handler;
-  }
-  // Register a lexical handler for us to output to
-  // Not all filters support this...
-  // ??? Should we register directly on the filter?
-  // NOTE NAME -- subclassing issue in the Xerces version
-  public void setLexicalHandler(LexicalHandler handler)
-  {
-    clientLexicalHandler=handler;
-  }
-  // Register an error handler for us to output to
-  // NOTE NAME -- subclassing issue in the Xerces version
-  public void setErrHandler(ErrorHandler handler)
-  {
-    clientErrorHandler=handler;
-  }
-
-  // Set the number of events between resumes of our coroutine
-  // Immediately resets number of events before _next_ resume as well.
-  public void setReturnFrequency(int events)
-  {
-    if(events<1) events=1;
-    frequency=eventcounter=events;
-  }
-  
-  //
-  // ContentHandler methods
-  // These  pass the data to our client ContentHandler...
-  // but they also count the number of events passing through,
-  // and resume our coroutine each time that counter hits zero and
-  // is reset.
-  //
-  // Note that for everything except endDocument and fatalError, we do the count-and-yield
-  // BEFORE passing the call along. I'm hoping that this will encourage JIT
-  // compilers to realize that these are tail-calls, reducing the expense of
-  // the additional layer of data flow.
-  //
-  // %REVIEW% Glenn suggests that pausing after endElement, endDocument,
-  // and characters may be sufficient. I actually may not want to
-  // stop after characters, since in our application these wind up being
-  // concatenated before they're processed... but that risks huge blocks of
-  // text causing greater than usual readahead. (Unlikely? Consider the
-  // possibility of a large base-64 block in a SOAP stream.)
-  //
-  public void characters(char[] ch, int start, int length)
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.characters(ch,start,length);
-  }
-  public void endDocument() 
-       throws org.xml.sax.SAXException
-  {
-    // EXCEPTION: In this case we need to run the event BEFORE we yield.
-    if(clientContentHandler!=null)
-      clientContentHandler.endDocument();
-
-    eventcounter=0;     
-    co_yield(false);
-  }
-  public void endElement(java.lang.String namespaceURI, java.lang.String localName,
-      java.lang.String qName) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.endElement(namespaceURI,localName,qName);
-  }
-  public void endPrefixMapping(java.lang.String prefix) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.endPrefixMapping(prefix);
-  }
-  public void ignorableWhitespace(char[] ch, int start, int length) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.ignorableWhitespace(ch,start,length);
-  }
-  public void processingInstruction(java.lang.String target, java.lang.String data) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.processingInstruction(target,data);
-  }
-  public void setDocumentLocator(Locator locator) 
-  {
-    if(--eventcounter<=0)
-      {
-        // This can cause a hang.  -sb
-        // co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.setDocumentLocator(locator);
-  }
-  public void skippedEntity(java.lang.String name) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.skippedEntity(name);
-  }
-  public void startDocument() 
-       throws org.xml.sax.SAXException
-  {
-    co_entry_pause();
-
-    // Otherwise, begin normal event delivery
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.startDocument();
-  }
-  public void startElement(java.lang.String namespaceURI, java.lang.String localName,
-      java.lang.String qName, Attributes atts) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.startElement(namespaceURI, localName, qName, atts);
-  }
-  public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) 
-       throws org.xml.sax.SAXException
-  {
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-    if(clientContentHandler!=null)
-      clientContentHandler.startPrefixMapping(prefix,uri);
-  }
-
-  //
-  // LexicalHandler support. Not all SAX2 filters support these events
-  // but we may want to pass them through when they exist...
-  //
-  // %REVIEW% These do NOT currently affect the eventcounter; I'm asserting
-  // that they're rare enough that it makes little or no sense to
-  // pause after them. As such, it may make more sense for folks who
-  // actually want to use them to register directly with the filter.
-  // But I want 'em here for now, to remind us to recheck this assertion!
-  //
-  public void comment(char[] ch, int start, int length) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.comment(ch,start,length);
-  }
-  public void endCDATA() 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.endCDATA();
-  }
-  public void endDTD() 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.endDTD();
-  }
-  public void endEntity(java.lang.String name) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.endEntity(name);
-  }
-  public void startCDATA() 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.startCDATA();
-  }
-  public void startDTD(java.lang.String name, java.lang.String publicId,
-      java.lang.String systemId) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler. startDTD(name, publicId, systemId);
-  }
-  public void startEntity(java.lang.String name) 
-       throws org.xml.sax.SAXException
-  {
-    if(null!=clientLexicalHandler)
-      clientLexicalHandler.startEntity(name);
-  }
-
-  //
-  // ErrorHandler support.
-  //
-  // PROBLEM: Xerces is apparently _not_ calling the ErrorHandler for
-  // exceptions thrown by the ContentHandler, which prevents us from
-  // handling this properly when running in filtering mode with Xerces
-  // as our event source.  It's unclear whether this is a Xerces bug
-  // or a SAX design flaw.
-  // 
-  // %REVIEW% Current solution: In filtering mode, it is REQUIRED that
-  // event source make sure this method is invoked if the event stream
-  // abends before endDocument is delivered. If that means explicitly calling
-  // us in the exception handling code because it won't be delivered as part
-  // of the normal SAX ErrorHandler stream, that's fine; Not Our Problem.
-  //
-  public void error(SAXParseException exception) throws SAXException
-  {
-    if(null!=clientErrorHandler)
-      clientErrorHandler.error(exception);
-  }
-  
-  public void fatalError(SAXParseException exception) throws SAXException
-  {
-    // EXCEPTION: In this case we need to run the event BEFORE we yield --
-    // just as with endDocument, this terminates the event stream.
-    if(null!=clientErrorHandler)
-      clientErrorHandler.error(exception);
-
-    eventcounter=0;     
-    co_yield(false);
-
-  }
-  
-  public void warning(SAXParseException exception) throws SAXException
-  {
-    if(null!=clientErrorHandler)
-      clientErrorHandler.error(exception);
-  }
-  
-
-  //
-  // coroutine support
-  //
-
-  public int getSourceCoroutineID() {
-    return fSourceCoroutineID;
-  }
-  public int getControllerCoroutineID() {
-    return fControllerCoroutineID;
-  }
-
-  /** @return the CoroutineManager this CoroutineFilter object is bound to.
-   * If you're using the do...() methods, applications should only
-   * need to talk to the CoroutineManager once, to obtain the
-   * application's Coroutine ID.
-   * */
-  public CoroutineManager getCoroutineManager()
-  {
-    return fCoroutineManager;
-  }
-
-  /** <p>In the SAX delegation code, I've inlined the count-down in
-   * the hope of encouraging compilers to deliver better
-   * performance. However, if we subclass (eg to directly connect the
-   * output to a DTM builder), that would require calling super in
-   * order to run that logic... which seems inelegant.  Hence this
-   * routine for the convenience of subclasses: every [frequency]
-   * invocations, issue a co_yield.</p>
-   *
-   * @param moreExepected Should always be true unless this is being called
-   * at the end of endDocument() handling.
-   * */
-  protected void count_and_yield(boolean moreExpected) throws SAXException
-  {
-    if(!moreExpected) eventcounter=0;
-    
-    if(--eventcounter<=0)
-      {
-        co_yield(true);
-        eventcounter=frequency;
-      }
-  }
-
-  /**
-   * co_entry_pause is called in startDocument() before anything else
-   * happens. It causes the filter to wait for a "go ahead" request
-   * from the controller before delivering any events. Note that
-   * the very first thing the controller tells us may be "I don't
-   * need events after all"!
-   */
-  private void co_entry_pause() throws SAXException
-  {
-    if(fCoroutineManager==null)
-    {
-      // Nobody called init()? Do it now...
-      init(null,-1,-1);
-    }
-
-    try
-    {
-      Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID);
-      if(arg==Boolean.FALSE)
-        co_yield(false);
-    }
-    catch(NoSuchMethodException e)
-    {
-      // Coroutine system says we haven't registered. That's an
-      // application coding error, and is unrecoverable.
-      if(DEBUG) e.printStackTrace();
-      throw new SAXException(e);
-    }
-  }
-
-  /**
-   * Co_Yield handles coroutine interactions while a parse is in progress.
-   *
-   * When moreRemains==true, we are pausing after delivering events, to
-   * ask if more are needed. We will resume the controller thread with 
-   *   co_resume(Boolean.TRUE, ...)
-   * When control is passed back it may indicate
-   *      Boolean.TRUE    indication to continue delivering events
-   *      Boolean.FALSE   indication to discontinue events and shut down.
-   * 
-   * When moreRemains==false, we shut down immediately without asking the
-   * controller's permission. Normally this means end of document has been
-   * reached.
-   *
-   * Shutting down a IncrementalSAXSource_Filter requires terminating the incoming
-   * SAX event stream. If we are in control of that stream (if it came
-   * from an XMLReader passed to our startReader() method), we can do so
-   * very quickly by throwing a reserved exception to it. If the stream is
-   * coming from another source, we can't do that because its caller may
-   * not be prepared for this "normal abnormal exit", and instead we put
-   * ourselves in a "spin" mode where events are discarded.
-   */
-  private void co_yield(boolean moreRemains) throws SAXException
-  {
-    // Horrendous kluge to run filter to completion. See below.
-    if(fNoMoreEvents)
-      return;
-
-    try // Coroutine manager might throw no-such.
-    {
-      Object arg=Boolean.FALSE;
-      if(moreRemains)
-      {
-        // Yield control, resume parsing when done
-        arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID,
-                                          fControllerCoroutineID);
-        
-      }
-
-      // If we're at end of document or were told to stop early
-      if(arg==Boolean.FALSE)
-      {
-        fNoMoreEvents=true;
-        
-        if(fXMLReader!=null)    // Running under startParseThread()
-          throw new StopException(); // We'll co_exit from there.
-        
-        // Yield control. We do NOT expect anyone to ever ask us again.
-        fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID,
-                                     fControllerCoroutineID);
-      }
-    }
-    catch(NoSuchMethodException e)
-    {
-      // Shouldn't happen unless we've miscoded our coroutine logic
-      // "Shut down the garbage smashers on the detention level!"
-      fNoMoreEvents=true;
-      fCoroutineManager.co_exit(fSourceCoroutineID);
-      throw new SAXException(e);
-    }
-  }
-
-  //
-  // Convenience: Run an XMLReader in a thread
-  //
-
-  /** Launch a thread that will run an XMLReader's parse() operation within
-   *  a thread, feeding events to this IncrementalSAXSource_Filter. Mostly a convenience
-   *  routine, but has the advantage that -- since we invoked parse() --
-   *  we can halt parsing quickly via a StopException rather than waiting
-   *  for the SAX stream to end by itself.
-   *
-   * @throws SAXException is parse thread is already in progress
-   * or parsing can not be started.
-   * */
-  public void startParse(InputSource source) throws SAXException
-  {
-    if(fNoMoreEvents)
-      throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable.");
-    if(fXMLReader==null)
-      throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request");
-
-    fXMLReaderInputSource=source;
-    
-    // Xalan thread pooling...
-    org.apache.xalan.transformer.TransformerImpl.runTransformThread(this);
-  }
-  
-  /* Thread logic to support startParseThread()
-   */
-  public void run()
-  {
-    // Guard against direct invocation of start().
-    if(fXMLReader==null) return;
-
-    if(DEBUG)System.out.println("IncrementalSAXSource_Filter parse thread launched");
-
-    // Initially assume we'll run successfully.
-    Object arg=Boolean.FALSE;
-
-    // For the duration of this operation, all coroutine handshaking
-    // will occur in the co_yield method. That's the nice thing about
-    // coroutines; they give us a way to hand off control from the
-    // middle of a synchronous method.
-    try
-    {
-      fXMLReader.parse(fXMLReaderInputSource);
-    }
-    catch(IOException ex)
-    {
-      arg=ex;
-    }
-    catch (SAXException ex)
-    {
-      Exception inner=ex.getException();
-      if(inner instanceof StopException){
-        // Expected and harmless
-        if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
-      }
-      else
-      {
-        // Unexpected malfunction
-        if(DEBUG)
-        {
-          System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner);
-          inner.printStackTrace();
-        }                
-        arg=ex;
-      }
-    } // end parse
-    
-    // Mark as no longer running in thread.
-    fXMLReader=null;
-
-    try
-    {
-      // Mark as done and yield control to the controller coroutine
-      fNoMoreEvents=true;
-      fCoroutineManager.co_exit_to(arg, fSourceCoroutineID,
-                                   fControllerCoroutineID);
-    }
-    catch(java.lang.NoSuchMethodException e)
-    {
-      // Shouldn't happen unless we've miscoded our coroutine logic
-      // "CPO, shut down the garbage smashers on the detention level!"
-      e.printStackTrace(System.err);
-      fCoroutineManager.co_exit(fSourceCoroutineID);
-    }
-  }
-
-  /** Used to quickly terminate parse when running under a
-      startParse() thread. Only its type is important. */
-  class StopException extends RuntimeException
-  {
-  }
-
-  /** deliverMoreNodes() is a simple API which tells the coroutine
-   * parser that we need more nodes.  This is intended to be called
-   * from one of our partner routines, and serves to encapsulate the
-   * details of how incremental parsing has been achieved.
-   *
-   * @param parsemore If true, tells the incremental filter to generate
-   * another chunk of output. If false, tells the filter that we're
-   * satisfied and it can terminate parsing of this document.
-   *
-   * @return Boolean.TRUE if there may be more events available by invoking
-   * deliverMoreNodes() again. Boolean.FALSE if parsing has run to completion (or been
-   * terminated by deliverMoreNodes(false). Or an exception object if something
-   * malfunctioned. %REVIEW% We _could_ actually throw the exception, but
-   * that would require runinng deliverMoreNodes() in a try/catch... and for many
-   * applications, exception will be simply be treated as "not TRUE" in
-   * any case.
-   * */
-  public Object deliverMoreNodes(boolean parsemore)
-  {
-    // If parsing is already done, we can immediately say so
-    if(fNoMoreEvents)
-      return Boolean.FALSE;
-
-    try 
-    {
-      Object result =
-        fCoroutineManager.co_resume(parsemore?Boolean.TRUE:Boolean.FALSE,
-                                    fControllerCoroutineID, fSourceCoroutineID);
-      if(result==Boolean.FALSE)
-        fCoroutineManager.co_exit(fControllerCoroutineID);
-
-      return result;
-    }
-      
-    // SHOULD NEVER OCCUR, since the coroutine number and coroutine manager
-    // are those previously established for this IncrementalSAXSource_Filter...
-    // So I'm just going to return it as a parsing exception, for now.
-    catch(NoSuchMethodException e)
-      {
-        return e;
-      }
-  }
-  
-
-  //================================================================
-  /** Simple unit test. Attempt coroutine parsing of document indicated
-   * by first argument (as a URI), report progress.
-   */
-    /*
-  public static void main(String args[])
-  {
-    System.out.println("Starting...");
-
-    org.xml.sax.XMLReader theSAXParser=
-      new org.apache.xerces.parsers.SAXParser();
-  
-
-    for(int arg=0;arg<args.length;++arg)
-    {
-      // The filter is not currently designed to be restartable
-      // after a parse has ended. Generate a new one each time.
-      IncrementalSAXSource_Filter filter=
-        new IncrementalSAXSource_Filter();
-      // Use a serializer as our sample output
-      org.apache.xml.serialize.XMLSerializer trace;
-      trace=new org.apache.xml.serialize.XMLSerializer(System.out,null);
-      filter.setContentHandler(trace);
-      filter.setLexicalHandler(trace);
-
-      try
-      {
-        InputSource source = new InputSource(args[arg]);
-        Object result=null;
-        boolean more=true;
-
-        // init not issued; we _should_ automagically Do The Right Thing
-
-        // Bind parser, kick off parsing in a thread
-        filter.setXMLReader(theSAXParser);
-        filter.startParse(source);
-      
-        for(result = filter.deliverMoreNodes(more);
-            (result instanceof Boolean && ((Boolean)result)==Boolean.TRUE);
-            result = filter.deliverMoreNodes(more))
-        {
-          System.out.println("\nSome parsing successful, trying more.\n");
-          
-          // Special test: Terminate parsing early.
-          if(arg+1<args.length && "!".equals(args[arg+1]))
-          {
-            ++arg;
-            more=false;
-          }
-          
-        }
-      
-        if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
-        {
-          System.out.println("\nFilter ended (EOF or on request).\n");
-        }
-        else if (result == null) {
-          System.out.println("\nUNEXPECTED: Filter says shut down prematurely.\n");
-        }
-        else if (result instanceof Exception) {
-          System.out.println("\nFilter threw exception:");
-          ((Exception)result).printStackTrace();
-        }
-      
-      }
-      catch(SAXException e)
-      {
-        e.printStackTrace();
-      }
-    } // end for
-  }
-    */  
-} // class IncrementalSAXSource_Filter
diff --git a/src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java b/src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
deleted file mode 100644
index 2f6195d..0000000
--- a/src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import java.io.IOException;
-import org.apache.xerces.parsers.SAXParser;
-import org.xml.sax.XMLReader;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/** <p>IncrementalSAXSource_Xerces takes advantage of the fact that Xerces
- * incremental mode is already a coroutine of sorts, and just wraps our
- * IncrementalSAXSource API around it.</p>
- *
- * <p>Usage example: See main().</p>
- *
- * <p>Status: Passes simple main() unit-test. NEEDS JAVADOC.</p>
- * */
-public class IncrementalSAXSource_Xerces
-  implements IncrementalSAXSource
-{
-  SAXParser fIncrementalParser;
-
-  //
-  // Data
-  //
-
-  private boolean fParseInProgress=false;
-
-  //
-  // Constructors
-  //
-
-  /** Create a IncrementalSAXSource_Xerces, and create a SAXParsre
-   * to go with it
-   * */
-  public IncrementalSAXSource_Xerces() {
-    fIncrementalParser=new SAXParser();
-  }
-
-  /** Create a IncrementalSAXSource_Xerces wrapped around
-   * an existing SAXParser
-   * */
-  public IncrementalSAXSource_Xerces(SAXParser parser) {
-    fIncrementalParser=parser;
-  }
-
-  //
-  // Factories
-  //
-  static public IncrementalSAXSource createIncrementalSAXSource() {
-    return new IncrementalSAXSource_Xerces();
-  }
-  static public IncrementalSAXSource
-  createIncrementalSAXSource(SAXParser parser) {
-    return new IncrementalSAXSource_Xerces(parser);
-  }
-
-  //
-  // Public methods
-  //
-
-  // Register handler directly with the incremental parser
-  public void setContentHandler(org.xml.sax.ContentHandler handler)
-  {
-    fIncrementalParser.setContentHandler(handler);
-  }
-
-  // Note name, needed to dodge the inherited Xerces setLexicalHandler
-  // which isn't public.
-  public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
-  {
-    // Not supported by all SAX2 parsers but should work in Xerces:
-    try 
-    {
-      fIncrementalParser.setProperty("http://xml.org/sax/properties/lexical-handler",
-                                     handler);
-    }
-    catch(org.xml.sax.SAXNotRecognizedException e)
-    {
-      // Nothing we can do about it
-    }
-    catch(org.xml.sax.SAXNotSupportedException e)
-    {
-      // Nothing we can do about it
-    }
-  }
-  
-  //================================================================
-  /** startParse() is a simple API which tells the IncrementalSAXSource
-   * to begin reading a document.
-   *
-   * @throws SAXException is parse thread is already in progress
-   * or parsing can not be started.
-   * */
-  public void startParse(InputSource source) throws SAXException
-  {
-    if (fIncrementalParser==null)
-      throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser.");
-    if (fParseInProgress)
-      throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing.");
-
-    boolean ok=false;
-
-    try
-    {
-      ok = fIncrementalParser.parseSomeSetup(source);
-    }
-    catch(Exception ex)
-    {
-      throw new SAXException(ex);
-    }
-    
-    if(!ok)
-      throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with");
-  }
-
-  
-  /** deliverMoreNodes() is a simple API which tells the coroutine
-   * parser that we need more nodes.  This is intended to be called
-   * from one of our partner routines, and serves to encapsulate the
-   * details of how incremental parsing has been achieved.
-   *
-   * @param parsemore If true, tells the incremental parser to generate
-   * another chunk of output. If false, tells the parser that we're
-   * satisfied and it can terminate parsing of this document.
-   * @return Boolean.TRUE if the CoroutineParser believes more data may be available
-   * for further parsing. Boolean.FALSE if parsing ran to completion.
-   * Exception if the parser objected for some reason.
-   * */
-  public Object deliverMoreNodes (boolean parsemore)
-  {
-    if(!parsemore)
-    {
-      fParseInProgress=false;
-      return Boolean.FALSE;
-    }
-
-    Object arg;
-    try {
-      boolean keepgoing = fIncrementalParser.parseSome();
-      arg = keepgoing ? Boolean.TRUE : Boolean.FALSE;
-    } catch (SAXException ex) {
-      arg = ex;
-    } catch (IOException ex) {
-      arg = ex;
-    } catch (Exception ex) {
-      arg = new SAXException(ex);
-    }
-    return arg;
-  }
-
-  //================================================================
-  /** Simple unit test. Attempt coroutine parsing of document indicated
-   * by first argument (as a URI), report progress.
-   */
-  public static void main(String args[])
-  {
-    System.out.println("Starting...");
-
-    CoroutineManager co = new CoroutineManager();
-    int appCoroutineID = co.co_joinCoroutineSet(-1);
-    if (appCoroutineID == -1)
-    {
-      System.out.println("ERROR: Couldn't allocate coroutine number.\n");
-      return;
-    }
-    IncrementalSAXSource_Xerces parser=
-      new IncrementalSAXSource_Xerces();
-
-    // Use a serializer as our sample output
-    org.apache.xml.serialize.XMLSerializer trace;
-    trace=new org.apache.xml.serialize.XMLSerializer(System.out,null);
-    parser.setContentHandler(trace);
-    parser.setLexicalHandler(trace);
-
-    // Tell coroutine to begin parsing, run while parsing is in progress
-
-    for(int arg=0;arg<args.length;++arg)
-    {
-      try
-      {
-        InputSource source = new InputSource(args[arg]);
-        Object result=null;
-        boolean more=true;
-        parser.startParse(source);
-        for(result = parser.deliverMoreNodes(more);
-            result==Boolean.TRUE;
-            result = parser.deliverMoreNodes(more))
-        {
-          System.out.println("\nSome parsing successful, trying more.\n");
-            
-          // Special test: Terminate parsing early.
-          if(arg+1<args.length && "!".equals(args[arg+1]))
-          {
-            ++arg;
-            more=false;
-          }
-            
-        }
-        
-        if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
-        {
-          System.out.println("\nParser ended (EOF or on request).\n");
-        }
-        else if (result == null) {
-          System.out.println("\nUNEXPECTED: Parser says shut down prematurely.\n");
-        }
-        else if (result instanceof Exception) {
-          throw new org.apache.xml.utils.WrappedRuntimeException((Exception)result);
-          //          System.out.println("\nParser threw exception:");
-          //          ((Exception)result).printStackTrace();
-        }
-        
-      }
-
-      catch(SAXException e)
-      {
-        e.printStackTrace();
-      }
-    }
-    
-  }
-
-  
-} // class IncrementalSAXSource_Xerces
diff --git a/src/org/apache/xml/dtm/ref/NodeLocator.java b/src/org/apache/xml/dtm/ref/NodeLocator.java
deleted file mode 100644
index 344c906..0000000
--- a/src/org/apache/xml/dtm/ref/NodeLocator.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by Ovidiu
- * Predescu <ovidiu@cup.hp.com> on behalf of the Apache Software
- * Foundation and was originally developed at Hewlett Packard Company.
- * For more information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package org.apache.xml.dtm.ref;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * <code>NodeLocator</code> maintains information on an XML source
- * node.
- *
- * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
- * @since May 23, 2001
- */
-public class NodeLocator implements SourceLocator
-{
-  protected String m_publicId;
-  protected String m_systemId;
-  protected int m_lineNumber;
-  protected int m_columnNumber;
-
-  /**
-   * Creates a new <code>NodeLocator</code> instance.
-   *
-   * @param publicId a <code>String</code> value
-   * @param systemId a <code>String</code> value
-   * @param lineNumber an <code>int</code> value
-   * @param columnNumber an <code>int</code> value
-   */
-  public NodeLocator(String publicId, String systemId,
-                     int lineNumber, int columnNumber)
-  {
-    this.m_publicId = publicId;
-    this.m_systemId = systemId;
-    this.m_lineNumber = lineNumber;
-    this.m_columnNumber = columnNumber;
-  }
-
-  /**
-   * <code>getPublicId</code> returns the public ID of the node.
-   *
-   * @return a <code>String</code> value
-   */
-  public String getPublicId()
-  {
-    return m_publicId;
-  }
-
-  /**
-   * <code>getSystemId</code> returns the system ID of the node.
-   *
-   * @return a <code>String</code> value
-   */
-  public String getSystemId()
-  {
-    return m_systemId;
-  }
-
-  /**
-   * <code>getLineNumber</code> returns the line number of the node.
-   *
-   * @return an <code>int</code> value
-   */
-  public int getLineNumber()
-  {
-    return m_lineNumber;
-  }
-
-  /**
-   * <code>getColumnNumber</code> returns the column number of the
-   * node.
-   *
-   * @return an <code>int</code> value
-   */
-  public int getColumnNumber()
-  {
-    return m_columnNumber;
-  }
-
-  /**
-   * <code>toString</code> returns a string representation of this
-   * NodeLocator instance.
-   *
-   * @return a <code>String</code> value
-   */
-  public String toString()
-  {
-    return "file '" + m_systemId
-      + "', line #" + m_lineNumber
-      + ", column #" + m_columnNumber;
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/TestDTM.java b/src/org/apache/xml/dtm/ref/TestDTM.java
deleted file mode 100644
index cdd48c6..0000000
--- a/src/org/apache/xml/dtm/ref/TestDTM.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.ref.DTMDocumentImpl;
-import org.apache.xml.dtm.ref.TestDTMNodes;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Tests the DTM by creating
- *
- * REWRITTEN to use SAX2 ContentHandler APIs -- original draft used
- * an incomplete/incorrect version of SAX1 DocumentHandler, which is
- * being phased out as quickly as we can possibly manage it.
- *
- * %TBD% I _think_ the SAX convention is that "no namespace" is expressed
- * as "" rather than as null (which is the DOM's convention). What should 
- * DTM expect? What should it do with the other?
- */
-public class TestDTM {
-
-  public static void main(String argv[]) {
-    String text;
-
-    /*  <?xml version="1.0"?>
-     *  <top>
-     *   <A>
-     *    <B hat="new" car="Honda" dog="Boxer">Life is good</B>
-     *   </A>
-     *   <C>My Anaconda<D/>Words</C>
-     *  </top> */
-
-    DTMDocumentImpl doc = new DTMDocumentImpl(null, 0, null, 
-                    org.apache.xpath.objects.XMLStringFactoryImpl.getFactory());
-
-    try
-      {
-        doc.startDocument();
-
-        doc.startElement("", "top", "top", null);
-
-        doc.startElement("", "A", "A", null);
-
-        AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute("", "", "hat", "CDATA", "new");
-        atts.addAttribute("", "", "car", "CDATA", "Honda");
-        atts.addAttribute("", "", "dog", "CDATA", "Boxer");
-        doc.startElement("","B","B", atts);
-        text="Life is good";
-        doc.characters(text.toCharArray(),0,text.length());
-        doc.endElement("","B","B");
-
-        doc.endElement("","A","A");
-        doc.startElement("","C","C", null);
-
-        text="My Anaconda";
-        doc.characters(text.toCharArray(),0,text.length());
-        doc.startElement("","D","D",null);
-        doc.endElement("","D","D");
-        text="Words";
-        doc.characters(text.toCharArray(),0,text.length());
-
-        doc.endElement("", "C", "C");
-
-        boolean BUILDPURCHASEORDER=false;
-        if(BUILDPURCHASEORDER)
-          {
-            int root, h, c1, c2, c3, c4, c1_text, c2_text, c3_text, c4_text;
-
-            doc.startElement(null,"PurchaseOrderList","PurchaseOrderList", null);
-
-            for (int i = 0; i < 10; i++) {
-
-              doc.startElement("","PurchaseOrder","PurchaseOrder", null);
-
-              doc.startElement("","Item","Item", null);
-              text="Basketball" + " - " + i;
-              doc.characters(text.toCharArray(),0,text.length());
-                      
-              doc.endElement("", "Item", "Item");
-
-              doc.startElement("","Description","Description", null);
-              // c2.createAttribute();
-              text="Professional Leather Michael Jordan Signatured Basketball";
-              doc.characters(text.toCharArray(),0,text.length());
-                      
-              doc.endElement("", "Description", "Description");
-
-              doc.startElement("","UnitPrice","UnitPrice", null);
-              text="$12.99";
-              doc.characters(text.toCharArray(),0,text.length());
-                      
-              doc.endElement("", "UnitPrice", "UnitPrice");
-
-              doc.startElement("","Quantity","Quantity", null);
-              text="50";
-              doc.characters(text.toCharArray(),0,text.length());
-                      
-              doc.endElement("", "Quantity", "Quantity");
-
-              doc.endElement("", "PurchaseOrder", "PurchaseOrder");
-            }
-
-            doc.endElement("", "PurchaseOrderList", "PurchaseOrderList");
-          } // if(BUILDPURCHASEORDER)
-
-        doc.endElement("", "top", "top");
-        doc.endDocument();
-      }
-    catch(org.xml.sax.SAXException e)
-      {
-        e.printStackTrace();
-      }
-                
-
-    TestDTMNodes.printNodeTable(doc);
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/TestDTMNodes.java b/src/org/apache/xml/dtm/ref/TestDTMNodes.java
deleted file mode 100644
index 584939f..0000000
--- a/src/org/apache/xml/dtm/ref/TestDTMNodes.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.xml.dtm.ref;
-
-import org.apache.xml.dtm.*;
-import org.apache.xml.dtm.ref.ChunkedIntArray;
-
-/** Debugging dump routine for DTMDocumentImpl. Note that it directly accesses
- * that class's internal data... which probably shouldn't be exposed.
- */
-public class TestDTMNodes {
-
-  public static void printNodeTable(DTMDocumentImpl doc) {
-    int length = doc.nodes.slotsUsed(), slot[] = new int[4];
-    for (int i=0; i <= length; i++) {
-      doc.nodes.readSlot(i, slot);
-
-      // Word0 is shown as its two halfwords
-      short high = (short) (slot[0] >> 16);
-      short low = (short) (slot[0] & 0xFFFF);
-
-      System.out.println(i + ": (" + high + ") (" + low +
-                         ") " + slot[1] + " " + slot[2] +
-                         " " +slot[3] +
-                         "\n\tName: " +  doc.getNodeName(i) +
-                         " Value: " + doc.getNodeValue(i) +
-                         " Parent: " + doc.getParent(i) +
-                         " FirstAttr: " + doc.getFirstAttribute(i) +
-                         " FirstChild: " + doc.getFirstChild(i) +
-                         " NextSib: " + doc.getNextSibling(i)
-                         ); 
-    }
-
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java b/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
deleted file mode 100644
index 93f3471..0000000
--- a/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
+++ /dev/null
@@ -1,1652 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref.dom2dtm;
-
-import org.apache.xml.dtm.ref.*;
-import org.apache.xml.dtm.*;
-import org.apache.xml.utils.SuballocatedIntVector;
-import org.apache.xml.utils.IntStack;
-import org.apache.xml.utils.BoolStack;
-import org.apache.xml.utils.StringBufferPool;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xml.utils.TreeWalker;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-
-import org.w3c.dom.*;
-
-import java.util.Vector;
-
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.SourceLocator;
-import org.xml.sax.ContentHandler;
-
-import org.apache.xml.utils.NodeVector;
-
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-
-/** The <code>DOM2DTM</code> class serves up a DOM's contents via the
- * DTM API.
- *
- * Note that it doesn't necessarily represent a full Document
- * tree. You can wrap a DOM2DTM around a specific node and its subtree
- * and the right things should happen. (I don't _think_ we currently
- * support DocumentFrgment nodes as roots, though that might be worth
- * considering.)
- *
- * Note too that we do not currently attempt to track document
- * mutation. If you alter the DOM after wrapping DOM2DTM around it,
- * all bets are off.
- * */
-public class DOM2DTM extends DTMDefaultBaseIterators
-{
-  static final boolean JJK_DEBUG=false;
-  
-  /** The current position in the DOM tree. Last node examined for
-   * possible copying to DTM. */
-  transient private Node m_pos;
-  /** The current position in the DTM tree. Who children get appended to. */
-  private int m_last_parent=0;
-  /** The current position in the DTM tree. Who children reference as their 
-   * previous sib. */
-  private int m_last_kid=NULL;
-
-  /** The top of the subtree.
-   * %REVIEW%: 'may not be the same as m_context if "//foo" pattern.'
-   * */
-  transient private Node m_root;
-
-  /** true if ALL the nodes in the m_root subtree have been processed;
-   * false if our incremental build has not yet finished scanning the
-   * DOM tree.  */
-  transient private boolean m_nodesAreProcessed;
-
-  /** The node objects.  The instance part of the handle indexes
-   * directly into this vector.  Each DTM node may actually be
-   * composed of several DOM nodes (for example, if logically-adjacent
-   * Text/CDATASection nodes in the DOM have been coalesced into a
-   * single DTM Text node); this table points only to the first in
-   * that sequence. */
-  protected Vector m_nodes = new Vector();
-
-  /**
-   * Construct a DOM2DTM object from a DOM node.
-   *
-   * @param mgr The DTMManager who owns this DTM.
-   * @param domSource the DOM source that this DTM will wrap.
-   * @param dtmIdentity The DTM identity ID for this DTM.
-   * @param whiteSpaceFilter The white space filter for this DTM, which may 
-   *                         be null.
-   * @param xstringfactory XMLString factory for creating character content.
-   * @param doIndexing true if the caller considers it worth it to use 
-   *                   indexing schemes.
-   */
-  public DOM2DTM(DTMManager mgr, DOMSource domSource, 
-                 int dtmIdentity, DTMWSFilter whiteSpaceFilter,
-                 XMLStringFactory xstringfactory,
-                 boolean doIndexing)
-  {
-    super(mgr, domSource, dtmIdentity, whiteSpaceFilter, 
-          xstringfactory, doIndexing);
-
-    // Initialize DOM navigation
-    m_pos=m_root = domSource.getNode();
-    // Initialize DTM navigation
-    m_last_parent=m_last_kid=NULL;
-    m_last_kid=addNode(m_root, m_last_parent,m_last_kid, NULL);
-
-    // Apparently the domSource root may not actually be the
-    // Document node. If it's an Element node, we need to immediately
-    // add its attributes. Adapted from nextNode().
-    // %REVIEW% Move this logic into addNode and recurse? Cleaner!
-    //
-    // (If it's an EntityReference node, we're probably scrod. For now
-    // I'm just hoping nobody is ever quite that foolish... %REVIEW%)
-    if(ELEMENT_NODE == m_root.getNodeType())
-    {
-      NamedNodeMap attrs=m_root.getAttributes();
-      int attrsize=(attrs==null) ? 0 : attrs.getLength();
-      if(attrsize>0)
-      {
-        int attrIndex=NULL; // start with no previous sib
-        for(int i=0;i<attrsize;++i)
-        {
-          // No need to force nodetype in this case;
-          // addNode() will take care of switching it from
-          // Attr to Namespace if necessary.
-          attrIndex=addNode(attrs.item(i),0,attrIndex,NULL);
-          m_firstch.setElementAt(DTM.NULL,attrIndex);
-        }
-        // Terminate list of attrs, and make sure they aren't
-        // considered children of the element
-        m_nextsib.setElementAt(DTM.NULL,attrIndex);
-
-        // IMPORTANT: This does NOT change m_last_parent or m_last_kid!
-      } // if attrs exist
-    } //if(ELEMENT_NODE)
-
-    // Initialize DTM-completed status 
-    m_nodesAreProcessed = false;
-  }
-
-  /**
-   * Construct the node map from the node.
-   *
-   * @param node The node that is to be added to the DTM.
-   * @param parentIndex The current parent index.
-   * @param previousSibling The previous sibling index.
-   * @param forceNodeType If not DTM.NULL, overrides the DOM node type.
-   *	Used to force nodes to Text rather than CDATASection when their
-   *	coalesced value includes ordinary Text nodes (current DTM behavior).
-   *
-   * @return The index identity of the node that was added.
-   */
-  protected int addNode(Node node, int parentIndex,
-                        int previousSibling, int forceNodeType)
-  {
-    int nodeIndex = m_nodes.size();
-    m_size++;
-    // ensureSize(nodeIndex);
-    
-    int type;
-    if(NULL==forceNodeType)
-        type = node.getNodeType();
-    else
-        type=forceNodeType;
-        
-    // %REVIEW% The Namespace Spec currently says that Namespaces are
-    // processed in a non-namespace-aware manner, by matching the
-    // QName, even though there is in fact a namespace assigned to
-    // these nodes in the DOM. If and when that changes, we will have
-    // to consider whether we check the namespace-for-namespaces
-    // rather than the node name.
-    //
-    // %TBD% Note that the DOM does not necessarily explicitly declare
-    // all the namespaces it uses. DOM Level 3 will introduce a
-    // namespace-normalization operation which reconciles that, and we
-    // can request that users invoke it or otherwise ensure that the
-    // tree is namespace-well-formed before passing the DOM to Xalan.
-    // But if they don't, what should we do about it? We probably
-    // don't want to alter the source DOM (and may not be able to do
-    // so if it's read-only). The best available answer might be to
-    // synthesize additional DTM Namespace Nodes that don't correspond
-    // to DOM Attr Nodes.
-    if (Node.ATTRIBUTE_NODE == type)
-    {
-      String name = node.getNodeName();
-
-      if (name.startsWith("xmlns:") || name.equals("xmlns"))
-      {
-        type = DTM.NAMESPACE_NODE;
-      }
-    }
-    
-    m_nodes.addElement(node);
-    
-    m_firstch.setElementAt(NOTPROCESSED,nodeIndex);
-    m_nextsib.setElementAt(NOTPROCESSED,nodeIndex);
-    m_prevsib.setElementAt(previousSibling,nodeIndex);
-    m_parent.setElementAt(parentIndex,nodeIndex);
-    
-    if(DTM.NULL != parentIndex && 
-       type != DTM.ATTRIBUTE_NODE && 
-       type != DTM.NAMESPACE_NODE)
-    {
-      // If the DTM parent had no children, this becomes its first child.
-      if(NOTPROCESSED == m_firstch.elementAt(parentIndex))
-        m_firstch.setElementAt(nodeIndex,parentIndex);
-    }
-    
-    String nsURI = node.getNamespaceURI();
-
-    // Deal with the difference between Namespace spec and XSLT
-    // definitions of local name. (The former says PIs don't have
-    // localnames; the latter says they do.)
-    String localName =  (type == Node.PROCESSING_INSTRUCTION_NODE) ? 
-                         node.getNodeName() :
-                         node.getLocalName();
-                         
-    // Hack to make DOM1 sort of work...
-    if(((type == Node.ELEMENT_NODE) || (type == Node.ATTRIBUTE_NODE)) 
-        && null == localName)
-      localName = node.getNodeName(); // -sb
-      
-    ExpandedNameTable exnt = m_expandedNameTable;
-
-    // %TBD% Nodes created with the old non-namespace-aware DOM
-    // calls createElement() and createAttribute() will never have a
-    // localname. That will cause their expandedNameID to be just the
-    // nodeType... which will keep them from being matched
-    // successfully by name. Since the DOM makes no promise that
-    // those will participate in namespace processing, this is
-    // officially accepted as Not Our Fault. But it might be nice to
-    // issue a diagnostic message!
-    if(node.getLocalName()==null &&
-       (type==Node.ELEMENT_NODE || type==Node.ATTRIBUTE_NODE))
-      {
-        // warning("DOM 'level 1' node "+node.getNodeName()+" won't be mapped properly in DOM2DTM.");
-      }
-    
-    int expandedNameID = (null != localName) 
-       ? exnt.getExpandedTypeID(nsURI, localName, type) :
-         exnt.getExpandedTypeID(type);
-
-    m_exptype.setElementAt(expandedNameID,nodeIndex);
-    
-    indexNode(expandedNameID, nodeIndex);
-
-    if (DTM.NULL != previousSibling)
-      m_nextsib.setElementAt(nodeIndex,previousSibling);
-
-    // This should be done after m_exptype has been set, and probably should
-    // always be the last thing we do
-    if (type == DTM.NAMESPACE_NODE)
-        declareNamespaceInContext(parentIndex,nodeIndex);
-
-    return nodeIndex;
-  }
-  
-  /**
-   * Get the number of nodes that have been added.
-   */
-  protected int getNumberOfNodes()
-  {
-    return m_nodes.size();
-  }
-  
- /**
-   * This method iterates to the next node that will be added to the table.
-   * Each call to this method adds a new node to the table, unless the end
-   * is reached, in which case it returns null.
-   *
-   * @return The true if a next node is found or false if 
-   *         there are no more nodes.
-   */
-  protected boolean nextNode()
-  {
-    // Non-recursive one-fetch-at-a-time depth-first traversal with 
-    // attribute/namespace nodes and white-space stripping.
-    // Navigating the DOM is simple, navigating the DTM is simple;
-    // keeping track of both at once is a trifle baroque but at least
-    // we've avoided most of the special cases.
-    if (m_nodesAreProcessed)
-      return false;
-        
-    // %REVIEW% Is this local copy Really Useful from a performance
-    // point of view?  Or is this a false microoptimization?
-    Node pos=m_pos; 
-    Node next=null;
-    int nexttype=NULL;
-
-    // Navigate DOM tree
-    do
-      {
-        // Look down to first child.
-        if (pos.hasChildNodes()) 
-          {
-            next = pos.getFirstChild();
-
-            // %REVIEW% There's probably a more elegant way to skip
-            // the doctype. (Just let it go and Suppress it?
-            if(next!=null && DOCUMENT_TYPE_NODE==next.getNodeType())
-              next=next.getNextSibling();
-
-            // Push DTM context -- except for children of Entity References, 
-            // which have no DTM equivalent and cause no DTM navigation.
-            if(ENTITY_REFERENCE_NODE!=pos.getNodeType())
-              {
-                m_last_parent=m_last_kid;
-                m_last_kid=NULL;
-                // Whitespace-handler context stacking
-                if(null != m_wsfilter)
-                {
-                  short wsv =
-                    m_wsfilter.getShouldStripSpace(m_last_parent|m_dtmIdent,this);
-                  boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) 
-                    ? getShouldStripWhitespace() 
-                    : (DTMWSFilter.STRIP == wsv);
-                  pushShouldStripWhitespace(shouldStrip);
-                } // if(m_wsfilter)
-              }
-          }
-
-        // If that fails, look up and right (but not past root!)
-        else 
-          {
-            if(m_last_kid!=NULL)
-              {
-                // Last node posted at this level had no more children
-                // If it has _no_ children, we need to record that.
-                if(m_firstch.elementAt(m_last_kid)==NOTPROCESSED)
-                  m_firstch.setElementAt(NULL,m_last_kid);
-              }
-                        
-            while(m_last_parent != NULL)
-              {
-                // %REVIEW% There's probably a more elegant way to
-                // skip the doctype. (Just let it go and Suppress it?
-                next = pos.getNextSibling();
-                if(next!=null && DOCUMENT_TYPE_NODE==next.getNodeType())
-                  next=next.getNextSibling();
-
-                if(next!=null)
-                  break; // Found it!
-                
-                // No next-sibling found. Pop the DOM.
-                pos=pos.getParentNode();
-                if(pos==null)
-                  {
-                    // %TBD% Should never arise, but I want to be sure of that...
-                    if(JJK_DEBUG)
-                      {
-                        System.out.println("***** DOM2DTM Pop Control Flow problem");
-                        for(;;); // Freeze right here!
-                      }
-                  }
-                
-                // The only parents in the DTM are Elements.  However,
-                // the DOM could contain EntityReferences.  If we
-                // encounter one, pop it _without_ popping DTM.
-                if(pos!=null && ENTITY_REFERENCE_NODE == pos.getNodeType())
-                  {
-                    // Nothing needs doing
-                    if(JJK_DEBUG)
-                      System.out.println("***** DOM2DTM popping EntRef");
-                  }
-                else
-                  {
-                    popShouldStripWhitespace();
-                    // Fix and pop DTM
-                    if(m_last_kid==NULL)
-                      m_firstch.setElementAt(NULL,m_last_parent); // Popping from an element
-                    else
-                      m_nextsib.setElementAt(NULL,m_last_kid); // Popping from anything else
-                    m_last_parent=m_parent.elementAt(m_last_kid=m_last_parent);
-                  }
-              }
-            if(m_last_parent==NULL)
-              next=null;
-          }
-                
-        if(next!=null)
-          nexttype=next.getNodeType();
-                
-        // If it's an entity ref, advance past it.
-        //
-        // %REVIEW% Should we let this out the door and just suppress it?
-        // More work, but simpler code, more likely to be correct, and
-        // it doesn't happen very often. We'd get rid of the loop too.
-        if (ENTITY_REFERENCE_NODE == nexttype)
-          pos=next;
-      }
-    while (ENTITY_REFERENCE_NODE == nexttype); 
-        
-    // Did we run out of the tree?
-    if(next==null)
-      {
-        m_nextsib.setElementAt(NULL,0);
-        m_nodesAreProcessed = true;
-        m_pos=null;
-                
-        if(JJK_DEBUG)
-          {
-            System.out.println("***** DOM2DTM Crosscheck:");
-            for(int i=0;i<m_nodes.size();++i)
-              System.out.println(i+":\t"+m_firstch.elementAt(i)+"\t"+m_nextsib.elementAt(i));
-          }
-                
-        return false;
-      }
-
-    // Text needs some special handling:
-    //
-    // DTM may skip whitespace. This is handled by the suppressNode flag, which
-    // when true will keep the DTM node from being created.
-    //
-    // DTM only directly records the first DOM node of any logically-contiguous
-    // sequence. The lastTextNode value will be set to the last node in the 
-    // contiguous sequence, and -- AFTER the DTM addNode -- can be used to 
-    // advance next over this whole block. Should be simpler than special-casing
-    // the above loop for "Was the logically-preceeding sibling a text node".
-    // 
-    // Finally, a DTM node should be considered a CDATASection only if all the
-    // contiguous text it covers is CDATASections. The first Text should
-    // force DTM to Text.
-        
-    boolean suppressNode=false;
-    Node lastTextNode=null;
-
-    nexttype=next.getNodeType();
-        
-    // nexttype=pos.getNodeType();
-    if(TEXT_NODE == nexttype || CDATA_SECTION_NODE == nexttype)
-      {
-        // If filtering, initially assume we're going to suppress the node
-        suppressNode=((null != m_wsfilter) && getShouldStripWhitespace());
-
-        // Scan logically contiguous text (siblings, plus "flattening"
-        // of entity reference boundaries).
-        Node n=next;
-        while(n!=null)
-          {
-            lastTextNode=n;
-            // Any Text node means DTM considers it all Text
-            if(TEXT_NODE == n.getNodeType())
-              nexttype=TEXT_NODE;
-            // Any non-whitespace in this sequence blocks whitespace
-            // suppression
-            suppressNode &=
-              XMLCharacterRecognizer.isWhiteSpace(n.getNodeValue());
-                        
-            n=logicalNextDOMTextNode(n);
-          }
-      }
-        
-    // Special handling for PIs: Some DOMs represent the XML
-    // Declaration as a PI. This is officially incorrect, per the DOM
-    // spec, but is considered a "wrong but tolerable" temporary
-    // workaround pending proper handling of these fields in DOM Level
-    // 3. We want to recognize and reject that case.
-    else if(PROCESSING_INSTRUCTION_NODE==nexttype)
-      {
-        suppressNode = (pos.getNodeName().toLowerCase().equals("xml"));
-      }
-        
-        
-    if(!suppressNode)
-      {
-        // Inserting next. NOTE that we force the node type; for
-        // coalesced Text, this records CDATASections adjacent to
-        // ordinary Text as Text.
-	int nextindex=addNode(next,m_last_parent,m_last_kid,
-			      nexttype);
-	
-        m_last_kid=nextindex;
-
-        if(ELEMENT_NODE == nexttype)
-          {
-            // Process attributes _now_, rather than waiting.
-            // Simpler control flow, makes NS cache available immediately.
-            NamedNodeMap attrs=next.getAttributes();
-            int attrsize=(attrs==null) ? 0 : attrs.getLength();
-            if(attrsize>0)
-              {
-                int attrIndex=NULL; // start with no previous sib
-                for(int i=0;i<attrsize;++i)
-                  {
-                    // No need to force nodetype in this case;
-                    // addNode() will take care of switching it from
-                    // Attr to Namespace if necessary.
-                    attrIndex=addNode(attrs.item(i),
-                                      nextindex,attrIndex,NULL);
-                    m_firstch.setElementAt(DTM.NULL,attrIndex);
-                  }
-                // Terminate list of attrs, and make sure they aren't
-                // considered children of the element
-                m_nextsib.setElementAt(DTM.NULL,attrIndex);
-              } // if attrs exist
-          } //if(ELEMENT_NODE)
-      } // (if !suppressNode)
-
-    // Text postprocessing: Act on values stored above
-    if(TEXT_NODE == nexttype || CDATA_SECTION_NODE == nexttype)
-      {
-        // %TBD% If nexttype was forced to TEXT, patch the DTM node
-                
-        next=lastTextNode;      // Advance the DOM cursor over contiguous text
-      }
-        
-    // Remember where we left off.
-    m_pos=next;
-    return true;
-  }  
-
-
-  /**
-   * Return an DOM node for the given node.
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A node representation of the DTM node.
-   */
-  public Node getNode(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-
-    return (Node) m_nodes.elementAt(identity);
-  }
-
-  /**
-   * Get a Node from an identity index.
-   *
-   * NEEDSDOC @param nodeIdentity
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  protected Node lookupNode(int nodeIdentity)
-  {
-    return (Node) m_nodes.elementAt(nodeIdentity);
-  }
-
-  /**
-   * Get the next node identity value in the list, and call the iterator
-   * if it hasn't been added yet.
-   *
-   * @param identity The node identity (index).
-   * @return identity+1, or DTM.NULL.
-   */
-  protected int getNextNodeIdentity(int identity)
-  {
-
-    identity += 1;
-
-    if (identity >= m_nodes.size())
-    {
-      if (!nextNode())
-        identity = DTM.NULL;
-    }
-
-    return identity;
-  }
-
-  /**
-   * Get the handle from a Node.
-   * <p>%OPT% This will be pretty slow.</p>
-   *
-   * <p>%OPT% An XPath-like search (walk up DOM to root, tracking path;
-   * walk down DTM reconstructing path) might be considerably faster
-   * on later nodes in large documents. That might also imply improving
-   * this call to handle nodes which would be in this DTM but
-   * have not yet been built, which might or might not be a Good Thing.</p>
-   * 
-   * %REVIEW% This relies on being able to test node-identity via
-   * object-identity. DTM2DOM proxying is a great example of a case where
-   * that doesn't work. DOM Level 3 will provide the isSameNode() method
-   * to fix that, but until then this is going to be flaky.
-   *
-   * @param node A node, which may be null.
-   *
-   * @return The node handle or <code>DTM.NULL</code>.
-   */
-  private int getHandleFromNode(Node node)
-  {
-    if (null != node)
-    {
-      int len = m_nodes.size();        
-      boolean isMore;
-      int i = 0;
-      do
-      {          
-        for (; i < len; i++)
-        {
-          if (m_nodes.elementAt(i) == node)
-            return i | m_dtmIdent;         
-        }
-
-        isMore = nextNode();
-  
-        len = m_nodes.size();
-            
-      } 
-      while(isMore || i < len);
-    }
-    
-    return DTM.NULL;
-  }
-
-  /** Get the handle from a Node. This is a more robust version of
-   * getHandleFromNode, intended to be usable by the public.
-   *
-   * <p>%OPT% This will be pretty slow.</p>
-   * 
-   * %REVIEW% This relies on being able to test node-identity via
-   * object-identity. DTM2DOM proxying is a great example of a case where
-   * that doesn't work. DOM Level 3 will provide the isSameNode() method
-   * to fix that, but until then this is going to be flaky.
-   *
-   * @param node A node, which may be null.
-   *
-   * @return The node handle or <code>DTM.NULL</code>.  */
-  public int getHandleOfNode(Node node)
-  {
-    if (null != node)
-    {
-      // Is Node actually within the same document? If not, don't search!
-      // This would be easier if m_root was always the Document node, but
-      // we decided to allow wrapping a DTM around a subtree.
-      if((m_root==node) ||
-         (m_root.getNodeType()==DOCUMENT_NODE &&
-          m_root==node.getOwnerDocument()) ||
-         (m_root.getNodeType()!=DOCUMENT_NODE &&
-          m_root.getOwnerDocument()==node.getOwnerDocument())
-         )
-        {
-          // If node _is_ in m_root's tree, find its handle
-          //
-          // %OPT% This check may be improved significantly when DOM
-          // Level 3 nodeKey and relative-order tests become
-          // available!
-          for(Node cursor=node;
-              cursor!=null;
-              cursor=
-                (cursor.getNodeType()!=ATTRIBUTE_NODE)
-                ? cursor.getParentNode()
-                : ((org.w3c.dom.Attr)cursor).getOwnerElement())
-            {
-              if(cursor==m_root)
-                // We know this node; find its handle.
-                return getHandleFromNode(node); 
-            } // for ancestors of node
-        } // if node and m_root in same Document
-    } // if node!=null
-
-    return DTM.NULL;
-  }
-
-  /**
-   * Retrieves an attribute node by by qualified name and namespace URI.
-   *
-   * @param nodeHandle int Handle of the node upon which to look up this attribute..
-   * @param namespaceURI The namespace URI of the attribute to
-   *   retrieve, or null.
-   * @param name The local name of the attribute to
-   *   retrieve.
-   * @return The attribute node handle with the specified name (
-   *   <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
-   *   attribute.
-   */
-  public int getAttributeNode(int nodeHandle, String namespaceURI,
-                              String name)
-  {
-
-    // %OPT% This is probably slower than it needs to be.
-    if (null == namespaceURI)
-      namespaceURI = "";
-
-    int type = getNodeType(nodeHandle);
-
-    if (DTM.ELEMENT_NODE == type)
-    {
-
-      // Assume that attributes immediately follow the element.
-      int identity = nodeHandle & m_mask;
-
-      while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
-      {
-        // Assume this can not be null.
-        type = getNodeType(identity);
-
-        if (type == DTM.ATTRIBUTE_NODE)
-        {
-          Node node = lookupNode(identity);
-          String nodeuri = node.getNamespaceURI();
-
-          if (null == nodeuri)
-            nodeuri = "";
-
-          String nodelocalname = node.getLocalName();
-
-          if (nodeuri.equals(namespaceURI) && name.equals(nodelocalname))
-            return identity | m_dtmIdent;
-        }
-        else if (DTM.NAMESPACE_NODE != type)
-        {
-          break;
-        }
-      }
-    }
-
-    return DTM.NULL;
-  }
-
-  /**
-   * Get the string-value of a node as a String object
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A string object that represents the string-value of the given node.
-   */
-  public XMLString getStringValue(int nodeHandle)
-  {
-
-    int type = getNodeType(nodeHandle);
-    Node node = getNode(nodeHandle);
-    // %TBD% If an element only has one text node, we should just use it 
-    // directly.
-    if(DTM.ELEMENT_NODE == type || DTM.DOCUMENT_NODE == type 
-    || DTM.DOCUMENT_FRAGMENT_NODE == type)
-    {
-      FastStringBuffer buf = StringBufferPool.get();
-      String s;
-  
-      try
-      {
-        getNodeData(node, buf);
-  
-        s = (buf.length() > 0) ? buf.toString() : "";
-      }
-      finally
-      {
-        StringBufferPool.free(buf);
-      }
-  
-      return m_xstrf.newstr( s );
-    }
-    else if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
-    {
-      // If this is a DTM text node, it may be made of multiple DOM text
-      // nodes -- including navigating into Entity References. DOM2DTM
-      // records the first node in the sequence and requires that we
-      // pick up the others when we retrieve the DTM node's value.
-      //
-      // %REVIEW% DOM Level 3 is expected to add a "whole text"
-      // retrieval method which performs this function for us.
-      FastStringBuffer buf = StringBufferPool.get();
-      while(node!=null)
-      {
-        buf.append(node.getNodeValue());
-        node=logicalNextDOMTextNode(node);
-      }
-      String s=(buf.length() > 0) ? buf.toString() : "";
-      StringBufferPool.free(buf);
-      return m_xstrf.newstr( s );
-    }
-    else
-      return m_xstrf.newstr( node.getNodeValue() );
-  }
-  
-  /**
-   * Retrieve the text content of a DOM subtree, appending it into a
-   * user-supplied FastStringBuffer object. Note that attributes are
-   * not considered part of the content of an element.
-   * <p>
-   * There are open questions regarding whitespace stripping. 
-   * Currently we make no special effort in that regard, since the standard
-   * DOM doesn't yet provide DTD-based information to distinguish
-   * whitespace-in-element-context from genuine #PCDATA. Note that we
-   * should probably also consider xml:space if/when we address this.
-   * DOM Level 3 may solve the problem for us.
-   * <p>
-   * %REVIEW% Actually, since this method operates on the DOM side of the
-   * fence rather than the DTM side, it SHOULDN'T do
-   * any special handling. The DOM does what the DOM does; if you want
-   * DTM-level abstractions, use DTM-level methods.
-   *
-   * @param node Node whose subtree is to be walked, gathering the
-   * contents of all Text or CDATASection nodes.
-   * @param buf FastStringBuffer into which the contents of the text
-   * nodes are to be concatenated.
-   */
-  protected static void getNodeData(Node node, FastStringBuffer buf)
-  {
-
-    switch (node.getNodeType())
-    {
-    case Node.DOCUMENT_FRAGMENT_NODE :
-    case Node.DOCUMENT_NODE :
-    case Node.ELEMENT_NODE :
-    {
-      for (Node child = node.getFirstChild(); null != child;
-              child = child.getNextSibling())
-      {
-        getNodeData(child, buf);
-      }
-    }
-    break;
-    case Node.TEXT_NODE :
-    case Node.CDATA_SECTION_NODE :
-    case Node.ATTRIBUTE_NODE :	// Never a child but might be our starting node
-      buf.append(node.getNodeValue());
-      break;
-    case Node.PROCESSING_INSTRUCTION_NODE :
-      // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);        
-      break;
-    default :
-      // ignore
-      break;
-    }
-  }
-
-  /**
-   * Given a node handle, return its DOM-style node name. This will
-   * include names such as #text or #document.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   * %REVIEW% Document when empty string is possible...
-   * %REVIEW-COMMENT% It should never be empty, should it?
-   */
-  public String getNodeName(int nodeHandle)
-  {
-
-    Node node = getNode(nodeHandle);
-
-    // Assume non-null.
-    return node.getNodeName();
-  }
-
-  /**
-   * Given a node handle, return the XPath node name.  This should be
-   * the name as described by the XPath data model, NOT the DOM-style
-   * name.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   */
-  public String getNodeNameX(int nodeHandle)
-  {
-
-    String name;
-    short type = getNodeType(nodeHandle);
-
-    switch (type)
-    {
-    case DTM.NAMESPACE_NODE :
-    {
-      Node node = getNode(nodeHandle);
-
-      // assume not null.
-      name = node.getNodeName();
-      if(name.startsWith("xmlns:"))
-      {
-        name = QName.getLocalPart(name);
-      }
-      else if(name.equals("xmlns"))
-      {
-        name = "";
-      }
-    }
-    break;
-    case DTM.ATTRIBUTE_NODE :
-    case DTM.ELEMENT_NODE :
-    case DTM.ENTITY_REFERENCE_NODE :
-    case DTM.PROCESSING_INSTRUCTION_NODE :
-    {
-      Node node = getNode(nodeHandle);
-
-      // assume not null.
-      name = node.getNodeName();
-    }
-    break;
-    default :
-      name = "";
-    }
-
-    return name;
-  }
-
-  /**
-   * Given a node handle, return its XPath-style localname.
-   * (As defined in Namespaces, this is the portion of the name after any
-   * colon character).
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Local name of this node.
-   */
-  public String getLocalName(int nodeHandle)
-  {
-
-    String name;
-    short type = getNodeType(nodeHandle);
-
-    switch (type)
-    {
-    case DTM.ATTRIBUTE_NODE :
-    case DTM.ELEMENT_NODE :
-    case DTM.ENTITY_REFERENCE_NODE :
-    case DTM.NAMESPACE_NODE :
-    case DTM.PROCESSING_INSTRUCTION_NODE :
-    {
-      Node node = getNode(nodeHandle);
-
-      // assume not null.
-      name = node.getLocalName();
-
-      if (null == name)
-      {
-        String qname = node.getNodeName();
-        int index = qname.indexOf(':');
-
-        name = (index < 0) ? qname : qname.substring(index + 1);
-      }
-    }
-    break;
-    default :
-      name = "";
-    }
-
-    return name;
-  }
-
-  /**
-   * Given a namespace handle, return the prefix that the namespace decl is
-   * mapping.
-   * Given a node handle, return the prefix used to map to the namespace.
-   *
-   * <p> %REVIEW% Are you sure you want "" for no prefix?  </p>
-   * <p> %REVIEW-COMMENT% I think so... not totally sure. -sb  </p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String prefix of this node's name, or "" if no explicit
-   * namespace prefix was given.
-   */
-  public String getPrefix(int nodeHandle)
-  {
-
-    String prefix;
-    short type = getNodeType(nodeHandle);
-
-    switch (type)
-    {
-    case DTM.NAMESPACE_NODE :
-    {
-      Node node = getNode(nodeHandle);
-
-      // assume not null.
-      String qname = node.getNodeName();
-      int index = qname.indexOf(':');
-
-      prefix = (index < 0) ? "" : qname.substring(index + 1);
-    }
-    break;
-    case DTM.ATTRIBUTE_NODE :
-    case DTM.ELEMENT_NODE :
-    {
-      Node node = getNode(nodeHandle);
-
-      // assume not null.
-      String qname = node.getNodeName();
-      int index = qname.indexOf(':');
-
-      prefix = (index < 0) ? "" : qname.substring(0, index);
-    }
-    break;
-    default :
-      prefix = "";
-    }
-
-    return prefix;
-  }
-
-  /**
-   * Given a node handle, return its DOM-style namespace URI
-   * (As defined in Namespaces, this is the declared URI which this node's
-   * prefix -- or default in lieu thereof -- was mapped to.)
-   *
-   * <p>%REVIEW% Null or ""? -sb</p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public String getNamespaceURI(int nodeHandle)
-  {
-
-    String nsuri;
-    short type = getNodeType(nodeHandle);
-
-    switch (type)
-    {
-    case DTM.ATTRIBUTE_NODE :
-    case DTM.ELEMENT_NODE :
-    case DTM.ENTITY_REFERENCE_NODE :
-    case DTM.NAMESPACE_NODE :
-    case DTM.PROCESSING_INSTRUCTION_NODE :
-    {
-      Node node = getNode(nodeHandle);
-
-      // assume not null.
-      nsuri = node.getNamespaceURI();
-
-      // %TBD% Handle DOM1?
-    }
-    break;
-    default :
-      nsuri = null;
-    }
-
-    return nsuri;
-  }
-  
-  /** Utility function: Given a DOM Text node, determine whether it is
-   * logically followed by another Text or CDATASection node. This may
-   * involve traversing into Entity References.
-   * 
-   * %REVIEW% DOM Level 3 is expected to add functionality which may 
-   * allow us to retire this.
-   */
-  private Node logicalNextDOMTextNode(Node n)
-  {
-        Node p=n.getNextSibling();
-        if(p==null)
-        {
-                // Walk out of any EntityReferenceNodes that ended with text
-                for(n=n.getParentNode();
-                        n!=null && ENTITY_REFERENCE_NODE == n.getNodeType();
-                        n=n.getParentNode())
-                {
-                        p=n.getNextSibling();
-                        if(p!=null)
-                                break;
-                }
-        }
-        n=p;
-        while(n!=null && ENTITY_REFERENCE_NODE == n.getNodeType())
-        {
-                // Walk into any EntityReferenceNodes that start with text
-                if(n.hasChildNodes())
-                        n=n.getFirstChild();
-                else
-                        n=n.getNextSibling();
-        }
-        if(n!=null)
-        {
-                // Found a logical next sibling. Is it text?
-                int ntype=n.getNodeType();
-                if(TEXT_NODE != ntype && CDATA_SECTION_NODE != ntype)
-                        n=null;
-        }
-        return n;
-  }
-
-  /**
-   * Given a node handle, return its node value. This is mostly
-   * as defined by the DOM, but may ignore some conveniences.
-   * <p>
-   *
-   * @param nodeHandle The node id.
-   * @return String Value of this node, or null if not
-   * meaningful for this node type.
-   */
-  public String getNodeValue(int nodeHandle)
-  {
-    int type=_type(nodeHandle);
-    if(TEXT_NODE!=type && CDATA_SECTION_NODE!=type)
-      return getNode(nodeHandle).getNodeValue();
-    
-    // If this is a DTM text node, it may be made of multiple DOM text
-    // nodes -- including navigating into Entity References. DOM2DTM
-    // records the first node in the sequence and requires that we
-    // pick up the others when we retrieve the DTM node's value.
-    //
-    // %REVIEW% DOM Level 3 is expected to add a "whole text"
-    // retrieval method which performs this function for us.
-    Node node = getNode(nodeHandle);
-    Node n=logicalNextDOMTextNode(node);
-    if(n==null)
-      return node.getNodeValue();
-    
-    FastStringBuffer buf = StringBufferPool.get();
-        buf.append(node.getNodeValue());
-    while(n!=null)
-    {
-      buf.append(n.getNodeValue());
-      n=logicalNextDOMTextNode(n);
-    }
-    String s = (buf.length() > 0) ? buf.toString() : "";
-    StringBufferPool.free(buf);
-    return s;
-  }
-
-  /**
-   *   A document type declaration information item has the following properties:
-   *
-   *     1. [system identifier] The system identifier of the external subset, if
-   *        it exists. Otherwise this property has no value.
-   *
-   * @return the system identifier String object, or null if there is none.
-   */
-  public String getDocumentTypeDeclarationSystemIdentifier()
-  {
-
-    Document doc;
-
-    if (m_root.getNodeType() == Node.DOCUMENT_NODE)
-      doc = (Document) m_root;
-    else
-      doc = m_root.getOwnerDocument();
-
-    if (null != doc)
-    {
-      DocumentType dtd = doc.getDoctype();
-
-      if (null != dtd)
-      {
-        return dtd.getSystemId();
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * Return the public identifier of the external subset,
-   * normalized as described in 4.2.2 External Entities [XML]. If there is
-   * no external subset or if it has no public identifier, this property
-   * has no value.
-   *
-   * @param the document type declaration handle
-   *
-   * @return the public identifier String object, or null if there is none.
-   */
-  public String getDocumentTypeDeclarationPublicIdentifier()
-  {
-
-    Document doc;
-
-    if (m_root.getNodeType() == Node.DOCUMENT_NODE)
-      doc = (Document) m_root;
-    else
-      doc = m_root.getOwnerDocument();
-
-    if (null != doc)
-    {
-      DocumentType dtd = doc.getDoctype();
-
-      if (null != dtd)
-      {
-        return dtd.getPublicId();
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * Returns the <code>Element</code> whose <code>ID</code> is given by
-   * <code>elementId</code>. If no such element exists, returns
-   * <code>DTM.NULL</code>. Behavior is not defined if more than one element
-   * has this <code>ID</code>. Attributes (including those
-   * with the name "ID") are not of type ID unless so defined by DTD/Schema
-   * information available to the DTM implementation.
-   * Implementations that do not know whether attributes are of type ID or
-   * not are expected to return <code>DTM.NULL</code>.
-   *
-   * <p>%REVIEW% Presumably IDs are still scoped to a single document,
-   * and this operation searches only within a single document, right?
-   * Wouldn't want collisions between DTMs in the same process.</p>
-   *
-   * @param elementId The unique <code>id</code> value for an element.
-   * @return The handle of the matching element.
-   */
-  public int getElementById(String elementId)
-  {
-
-    Document doc = (m_root.getNodeType() == Node.DOCUMENT_NODE) 
-        ? (Document) m_root : m_root.getOwnerDocument();
-        
-    if(null != doc)
-    {
-      Node elem = doc.getElementById(elementId);
-      if(null != elem)
-      {
-        int elemHandle = getHandleFromNode(elem);
-        
-        if(DTM.NULL == elemHandle)
-        {
-          int identity = m_nodes.size()-1;
-          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
-          {
-            Node node = getNode(identity);
-            if(node == elem)
-            {
-              elemHandle = getHandleFromNode(elem);
-              break;
-            }
-           }
-        }
-        
-        return elemHandle;
-      }
-    
-    }
-    return DTM.NULL;
-  }
-
-  /**
-   * The getUnparsedEntityURI function returns the URI of the unparsed
-   * entity with the specified name in the same document as the context
-   * node (see [3.3 Unparsed Entities]). It returns the empty string if
-   * there is no such entity.
-   * <p>
-   * XML processors may choose to use the System Identifier (if one
-   * is provided) to resolve the entity, rather than the URI in the
-   * Public Identifier. The details are dependent on the processor, and
-   * we would have to support some form of plug-in resolver to handle
-   * this properly. Currently, we simply return the System Identifier if
-   * present, and hope that it a usable URI or that our caller can
-   * map it to one.
-   * TODO: Resolve Public Identifiers... or consider changing function name.
-   * <p>
-   * If we find a relative URI
-   * reference, XML expects it to be resolved in terms of the base URI
-   * of the document. The DOM doesn't do that for us, and it isn't
-   * entirely clear whether that should be done here; currently that's
-   * pushed up to a higher level of our application. (Note that DOM Level
-   * 1 didn't store the document's base URI.)
-   * TODO: Consider resolving Relative URIs.
-   * <p>
-   * (The DOM's statement that "An XML processor may choose to
-   * completely expand entities before the structure model is passed
-   * to the DOM" refers only to parsed entities, not unparsed, and hence
-   * doesn't affect this function.)
-   *
-   * @param name A string containing the Entity Name of the unparsed
-   * entity.
-   *
-   * @return String containing the URI of the Unparsed Entity, or an
-   * empty string if no such entity exists.
-   */
-  public String getUnparsedEntityURI(String name)
-  {
-
-    String url = "";
-    Document doc = (m_root.getNodeType() == Node.DOCUMENT_NODE) 
-        ? (Document) m_root : m_root.getOwnerDocument();
-
-    if (null != doc)
-    {
-      DocumentType doctype = doc.getDoctype();
-  
-      if (null != doctype)
-      {
-        NamedNodeMap entities = doctype.getEntities();
-        if(null == entities)
-          return url;
-        Entity entity = (Entity) entities.getNamedItem(name);
-        if(null == entity)
-          return url;
-        
-        String notationName = entity.getNotationName();
-  
-        if (null != notationName)  // then it's unparsed
-        {
-          // The draft says: "The XSLT processor may use the public 
-          // identifier to generate a URI for the entity instead of the URI 
-          // specified in the system identifier. If the XSLT processor does 
-          // not use the public identifier to generate the URI, it must use 
-          // the system identifier; if the system identifier is a relative 
-          // URI, it must be resolved into an absolute URI using the URI of 
-          // the resource containing the entity declaration as the base 
-          // URI [RFC2396]."
-          // So I'm falling a bit short here.
-          url = entity.getSystemId();
-  
-          if (null == url)
-          {
-            url = entity.getPublicId();
-          }
-          else
-          {
-            // This should be resolved to an absolute URL, but that's hard 
-            // to do from here.
-          }        
-        }
-      }
-    }
-
-    return url;
-  }
-
-  /**
-   *     5. [specified] A flag indicating whether this attribute was actually
-   *        specified in the start-tag of its element, or was defaulted from the
-   *        DTD.
-   *
-   * @param the attribute handle
-   *
-   * NEEDSDOC @param attributeHandle
-   * @return <code>true</code> if the attribute was specified;
-   *         <code>false</code> if it was defaulted.
-   */
-  public boolean isAttributeSpecified(int attributeHandle)
-  {
-    int type = getNodeType(attributeHandle);
-
-    if (DTM.ATTRIBUTE_NODE == type)
-    {
-      Attr attr = (Attr)getNode(attributeHandle);
-      return attr.getSpecified();
-    }
-    return false;
-  }
-
-  /** Bind an IncrementalSAXSource to this DTM. NOT RELEVANT for DOM2DTM, since
-   * we're wrapped around an existing DOM.
-   *
-   * @param source The IncrementalSAXSource that we want to recieve events from
-   * on demand.
-   */
-  public void setIncrementalSAXSource(IncrementalSAXSource source)
-  {
-  }
-  
-  /** getContentHandler returns "our SAX builder" -- the thing that
-   * someone else should send SAX events to in order to extend this
-   * DTM model.
-   *
-   * @return null if this model doesn't respond to SAX events,
-   * "this" if the DTM object has a built-in SAX ContentHandler,
-   * the IncrmentalSAXSource if we're bound to one and should receive
-   * the SAX stream via it for incremental build purposes...
-   * */
-  public org.xml.sax.ContentHandler getContentHandler()
-  {
-      return null;
-  }
-  
-  /**
-   * Return this DTM's lexical handler.
-   *
-   * %REVIEW% Should this return null if constrution already done/begun?
-   *
-   * @return null if this model doesn't respond to lexical SAX events,
-   * "this" if the DTM object has a built-in SAX ContentHandler,
-   * the IncrementalSAXSource if we're bound to one and should receive
-   * the SAX stream via it for incremental build purposes...
-   */
-  public org.xml.sax.ext.LexicalHandler getLexicalHandler()
-  {
-
-    return null;
-  }
-
-  
-  /**
-   * Return this DTM's EntityResolver.
-   *
-   * @return null if this model doesn't respond to SAX entity ref events.
-   */
-  public org.xml.sax.EntityResolver getEntityResolver()
-  {
-
-    return null;
-  }
-  
-  /**
-   * Return this DTM's DTDHandler.
-   *
-   * @return null if this model doesn't respond to SAX dtd events.
-   */
-  public org.xml.sax.DTDHandler getDTDHandler()
-  {
-
-    return null;
-  }
-
-  /**
-   * Return this DTM's ErrorHandler.
-   *
-   * @return null if this model doesn't respond to SAX error events.
-   */
-  public org.xml.sax.ErrorHandler getErrorHandler()
-  {
-
-    return null;
-  }
-  
-  /**
-   * Return this DTM's DeclHandler.
-   *
-   * @return null if this model doesn't respond to SAX Decl events.
-   */
-  public org.xml.sax.ext.DeclHandler getDeclHandler()
-  {
-
-    return null;
-  }  
-
-  /** @return true iff we're building this model incrementally (eg
-   * we're partnered with a IncrementalSAXSource) and thus require that the
-   * transformation and the parse run simultaneously. Guidance to the
-   * DTMManager.
-   * */
-  public boolean needsTwoThreads()
-  {
-    return false;
-  }
-
-  // ========== Direct SAX Dispatch, for optimization purposes ========
-  
-  /**
-   * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
-   * of whitespace.  Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
-   * the definition of <CODE>S</CODE></A> for details.
-   * @param   ch      Character to check as XML whitespace.
-   * @return          =true if <var>ch</var> is XML whitespace; otherwise =false.
-   */
-  private static boolean isSpace(char ch)
-  {
-    return XMLCharacterRecognizer.isWhiteSpace(ch);  // Take the easy way out for now.
-  }
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value). Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(
-          int nodeHandle, org.xml.sax.ContentHandler ch, 
-          boolean normalize)
-            throws org.xml.sax.SAXException
-  {
-    if(normalize)
-    {
-      XMLString str = getStringValue(nodeHandle);
-      str = str.fixWhiteSpace(true, true, false);
-      str.dispatchCharactersEvents(ch);
-    }
-    else
-    {
-      int type = getNodeType(nodeHandle);
-      Node node = getNode(nodeHandle);
-      dispatchNodeData(node, ch, 0);
-          // Text coalition -- a DTM text node may represent multiple
-          // DOM nodes.
-          if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
-          {
-                  while( null != (node=logicalNextDOMTextNode(node)) )
-                  {
-                      dispatchNodeData(node, ch, 0);
-                  }
-          }
-    }
-  }
-  
-  /**
-   * Retrieve the text content of a DOM subtree, appending it into a
-   * user-supplied FastStringBuffer object. Note that attributes are
-   * not considered part of the content of an element.
-   * <p>
-   * There are open questions regarding whitespace stripping. 
-   * Currently we make no special effort in that regard, since the standard
-   * DOM doesn't yet provide DTD-based information to distinguish
-   * whitespace-in-element-context from genuine #PCDATA. Note that we
-   * should probably also consider xml:space if/when we address this.
-   * DOM Level 3 may solve the problem for us.
-   * <p>
-   * %REVIEW% Note that as a DOM-level operation, it can be argued that this
-   * routine _shouldn't_ perform any processing beyond what the DOM already
-   * does, and that whitespace stripping and so on belong at the DTM level.
-   * If you want a stripped DOM view, wrap DTM2DOM around DOM2DTM.
-   *
-   * @param node Node whose subtree is to be walked, gathering the
-   * contents of all Text or CDATASection nodes.
-   * @param buf FastStringBuffer into which the contents of the text
-   * nodes are to be concatenated.
-   */
-  protected static void dispatchNodeData(Node node, 
-                                         org.xml.sax.ContentHandler ch, 
-                                         int depth)
-            throws org.xml.sax.SAXException
-  {
-
-    switch (node.getNodeType())
-    {
-    case Node.DOCUMENT_FRAGMENT_NODE :
-    case Node.DOCUMENT_NODE :
-    case Node.ELEMENT_NODE :
-    {
-      for (Node child = node.getFirstChild(); null != child;
-              child = child.getNextSibling())
-      {
-        dispatchNodeData(child, ch, depth+1);
-      }
-    }
-    break;
-    case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW%
-    case Node.COMMENT_NODE :
-      if(0 != depth)
-        break;
-        // NOTE: Because this operation works in the DOM space, it does _not_ attempt
-        // to perform Text Coalition. That should only be done in DTM space. 
-    case Node.TEXT_NODE :
-    case Node.CDATA_SECTION_NODE :
-    case Node.ATTRIBUTE_NODE :
-      String str = node.getNodeValue();
-      if(ch instanceof CharacterNodeHandler)
-      {
-        ((CharacterNodeHandler)ch).characters(node);
-      }
-      else
-      {
-        ch.characters(str.toCharArray(), 0, str.length());
-      }
-      break;
-//    /* case Node.PROCESSING_INSTRUCTION_NODE :
-//      // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);        
-//      break; */
-    default :
-      // ignore
-      break;
-    }
-  }
-  
-  TreeWalker m_walker = new TreeWalker(null);
-  
-  /**
-   * Directly create SAX parser events from a subtree.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
-          throws org.xml.sax.SAXException
-  {
-    TreeWalker treeWalker = m_walker;
-    ContentHandler prevCH = treeWalker.getContentHandler();
-    
-    if(null != prevCH)
-    {
-      treeWalker = new TreeWalker(null);
-    }
-    treeWalker.setContentHandler(ch);
-    
-    try
-    {
-      Node node = getNode(nodeHandle);
-      treeWalker.traverse(node);
-    }
-    finally
-    {
-      treeWalker.setContentHandler(null);
-    }
-  }
-  
-  public interface CharacterNodeHandler
-  {
-    public void characters(Node node)
-            throws org.xml.sax.SAXException;
-  }
-
-  /**
-   * For the moment all the run time properties are ignored by this
-   * class.
-   *
-   * @param property a <code>String</code> value
-   * @param value an <code>Object</code> value
-   */
-  public void setProperty(String property, Object value)
-  {
-  }
-  
-  /**
-   * No source information is available for DOM2DTM, so return
-   * <code>null</code> here.
-   *
-   * @param node an <code>int</code> value
-   * @return null
-   */
-  public SourceLocator getSourceLocatorFor(int node)
-  {
-    return null;
-  }
-}
diff --git a/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java b/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
deleted file mode 100644
index fec9adb..0000000
--- a/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
+++ /dev/null
@@ -1,2230 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.dtm.ref.sax2dtm;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import javax.xml.transform.Source;
-import javax.xml.transform.SourceLocator;
-import org.apache.xalan.transformer.XalanProperties;
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-import org.apache.xml.dtm.*;
-import org.apache.xml.dtm.ref.*;
-import org.apache.xml.utils.StringVector;
-import org.apache.xml.utils.IntVector;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xml.utils.IntStack;
-import org.apache.xml.utils.SuballocatedIntVector;
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xml.utils.WrappedRuntimeException;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-
-/**
- * This class implements a DTM that tends to be optimized more for speed than
- * for compactness, that is constructed via SAX2 ContentHandler events.
- */
-public class SAX2DTM extends DTMDefaultBaseIterators
-        implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler,
-                   DeclHandler, LexicalHandler
-{
-  /** simple DEBUG flag, for dumping diagnostics info. */
-  private static final boolean DEBUG = false;
-
-  /**
-   * If we're building the model incrementally on demand, we need to
-   * be able to tell the source when to send us more data.
-   *
-   * Note that if this has not been set, and you attempt to read ahead
-   * of the current build point, we'll probably throw a null-pointer
-   * exception. We could try to wait-and-retry instead, as a very poor
-   * fallback, but that has all the known problems with multithreading
-   * on multiprocessors and we Don't Want to Go There.
-   *
-   * @see setIncrementalSAXSource
-   */
-  private IncrementalSAXSource m_incrementalSAXSource = null;
-
-  /**
-   * All the character content, including attribute values, are stored in
-   * this buffer.
-   * %REVIEW% Should this have an option of being shared?
-   */
-  private FastStringBuffer m_chars = new FastStringBuffer(13, 13);
-
-  /** This vector holds offset and length data. */
-  protected SuballocatedIntVector m_data;
-
-  /** The parent stack, needed only for construction. */
-  transient private IntStack m_parents = new IntStack();
-
-  /** The current previous node, needed only for construction time. */
-  transient private int m_previous = 0;
-
-  /** Namespace support, only relevent at construction time. */
-  transient private java.util.Vector m_prefixMappings =
-    new java.util.Vector();
-
-  /** Namespace support, only relevent at construction time. */
-  transient private IntStack m_contextIndexes = new IntStack();
-
-  /** Type of next characters() event within text block in prgress. */
-  transient private int m_textType = DTM.TEXT_NODE;
-
-  /**
-   * Type of coalesced text block. See logic in the characters()
-   * method.
-   */
-  transient private int m_coalescedTextType = DTM.TEXT_NODE;
-
-  /** The SAX Document locator */
-  transient private Locator m_locator = null;
-
-  /** We are inside the DTD.  This is used for ignoring comments.  */
-  transient private boolean m_insideDTD = false;
-
-  /** Tree Walker for dispatchToEvents. */
-  protected DTMTreeWalker m_walker = new DTMTreeWalker();
-
-  /** pool of string values that come as strings. */
-  private DTMStringPool m_valuesOrPrefixes = new DTMStringPool();
-
-  /** End document has been reached. */
-  private boolean m_endDocumentOccured = false;
-
-  /** Data or qualified name values, one array element for each node. */
-  protected SuballocatedIntVector m_dataOrQName;
-
-  /**
-   * This table holds the ID string to node associations, for
-   * XML IDs.
-   */
-  protected Hashtable m_idAttributes = new Hashtable();
-
-  /**
-   * fixed dom-style names.
-   */
-  static final String[] m_fixednames = { null, null,  // nothing, Element
-                                         null, "#text",  // Attr, Text
-                                         "#cdata_section", null,  // CDATA, EntityReference
-                                         null, null,  // Entity, PI
-                                         "#comment", "#document",  // Comment, Document
-                                         null, "#document-fragment",  // Doctype, DocumentFragment
-                                         null };  // Notation
-
-  /**
-   * Vector of entities.  Each record is composed of four Strings:
-   *  publicId, systemID, notationName, and name.
-   */
-  private Vector m_entities = null;
-
-  /** m_entities public ID offset. */
-  private static final int ENTITY_FIELD_PUBLICID = 0;
-
-  /** m_entities system ID offset. */
-  private static final int ENTITY_FIELD_SYSTEMID = 1;
-
-  /** m_entities notation name offset. */
-  private static final int ENTITY_FIELD_NOTATIONNAME = 2;
-
-  /** m_entities name offset. */
-  private static final int ENTITY_FIELD_NAME = 3;
-
-  /** Number of entries per record for m_entities. */
-  private static final int ENTITY_FIELDS_PER = 4;
-
-  /**
-   * The starting offset within m_chars for the text or
-   * CDATA_SECTION node currently being acumulated,
-   * or -1 if there is no text node in progress
-   */
-  private int m_textPendingStart = -1;
-
-  /**
-   * Describes whether information about document source location
-   * should be maintained or not.
-   */
-  private boolean m_useSourceLocationProperty = false;
-
-  private StringVector m_sourceSystemId;
-  private IntVector m_sourceLine;
-  private IntVector m_sourceColumn;
-  
-  /**
-   * Construct a SAX2DTM object ready to be constructed from SAX2
-   * ContentHandler events.
-   *
-   * @param mgr The DTMManager who owns this DTM.
-   * @param source the JAXP 1.1 Source object for this DTM.
-   * @param dtmIdentity The DTM identity ID for this DTM.
-   * @param whiteSpaceFilter The white space filter for this DTM, which may
-   *                         be null.
-   * @param xstringfactory XMLString factory for creating character content.
-   * @param doIndexing true if the caller considers it worth it to use 
-   *                   indexing schemes.
-   */
-  public SAX2DTM(DTMManager mgr, Source source, int dtmIdentity,
-                 DTMWSFilter whiteSpaceFilter,
-                 XMLStringFactory xstringfactory,
-                 boolean doIndexing)
-  {
-
-    super(mgr, source, dtmIdentity, whiteSpaceFilter, 
-          xstringfactory, doIndexing);
-          
-    m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024);
-    m_data.addElement(0);   // Need placeholder in case index into here must be <0.
-
-    m_dataOrQName = new SuballocatedIntVector(m_initialblocksize);
-  }
-
-  /**
-   * Get the data or qualified name for the given node identity.
-   *
-   * @param identity The node identity.
-   *
-   * @return The data or qualified name, or DTM.NULL.
-   */
-  protected int _dataOrQName(int identity)
-  {
-
-    if (identity < m_size)
-      return m_dataOrQName.elementAt(identity);
-
-    // Check to see if the information requested has been processed, and, 
-    // if not, advance the iterator until we the information has been 
-    // processed.
-    while (true)
-    {
-      boolean isMore = nextNode();
-
-      if (!isMore)
-        return NULL;
-      else if (identity < m_size)
-        return m_dataOrQName.elementAt(identity);
-    }
-  }
-
-  /**
-   * Ask the CoRoutine parser to doTerminate and clear the reference.
-   */
-  public void clearCoRoutine()
-  {
-    clearCoRoutine(true);
-  }
-
-  /**
-   * Ask the CoRoutine parser to doTerminate and clear the reference. If
-   * the CoRoutine parser has already been cleared, this will have no effect.
-   *
-   * @param callDoTerminate true of doTerminate should be called on the
-   * coRoutine parser.
-   */
-  public void clearCoRoutine(boolean callDoTerminate)
-  {
-
-    if (null != m_incrementalSAXSource)
-    {
-      if (callDoTerminate)
-        m_incrementalSAXSource.deliverMoreNodes(false);
-
-      m_incrementalSAXSource = null;
-    }
-  }
-
-  /**
-   * Bind a IncrementalSAXSource to this DTM. If we discover we need nodes
-   * that have not yet been built, we will ask this object to send us more
-   * events, and it will manage interactions with its data sources.
-   *
-   * Note that we do not actually build the IncrementalSAXSource, since we don't
-   * know what source it's reading from, what thread that source will run in,
-   * or when it will run.
-   *
-   * @param incrementalSAXSource The parser that we want to recieve events from
-   * on demand.
-   * @param appCoRID The CoRoutine ID for the application.
-   */
-  public void setIncrementalSAXSource(IncrementalSAXSource incrementalSAXSource)
-  {
-
-    // Establish coroutine link so we can request more data
-    //
-    // Note: It's possible that some versions of IncrementalSAXSource may
-    // not actually use a CoroutineManager, and hence may not require
-    // that we obtain an Application Coroutine ID. (This relies on the
-    // coroutine transaction details having been encapsulated in the
-    // IncrementalSAXSource.do...() methods.)
-    m_incrementalSAXSource = incrementalSAXSource;
-
-    // Establish SAX-stream link so we can receive the requested data
-    incrementalSAXSource.setContentHandler(this);
-    incrementalSAXSource.setLexicalHandler(this);
-
-    // Are the following really needed? incrementalSAXSource doesn't yet
-    // support them, and they're mostly no-ops here...
-    //incrementalSAXSource.setErrorHandler(this);
-    //incrementalSAXSource.setDTDHandler(this);
-    //incrementalSAXSource.setDeclHandler(this);
-  }
-
-  /**
-   * getContentHandler returns "our SAX builder" -- the thing that
-   * someone else should send SAX events to in order to extend this
-   * DTM model.
-   *
-   * %REVIEW% Should this return null if constrution already done/begun?
-   *
-   * @return null if this model doesn't respond to SAX events,
-   * "this" if the DTM object has a built-in SAX ContentHandler,
-   * the IncrementalSAXSource if we're bound to one and should receive
-   * the SAX stream via it for incremental build purposes...
-   */
-  public ContentHandler getContentHandler()
-  {
-
-    if (m_incrementalSAXSource instanceof IncrementalSAXSource_Filter)
-      return (ContentHandler) m_incrementalSAXSource;
-    else
-      return this;
-  }
-
-  /**
-   * Return this DTM's lexical handler.
-   *
-   * %REVIEW% Should this return null if constrution already done/begun?
-   *
-   * @return null if this model doesn't respond to lexical SAX events,
-   * "this" if the DTM object has a built-in SAX ContentHandler,
-   * the IncrementalSAXSource if we're bound to one and should receive
-   * the SAX stream via it for incremental build purposes...
-   */
-  public LexicalHandler getLexicalHandler()
-  {
-
-    if (m_incrementalSAXSource instanceof IncrementalSAXSource_Filter)
-      return (LexicalHandler) m_incrementalSAXSource;
-    else
-      return this;
-  }
-
-  /**
-   * Return this DTM's EntityResolver.
-   *
-   * @return null if this model doesn't respond to SAX entity ref events.
-   */
-  public EntityResolver getEntityResolver()
-  {
-    return this;
-  }
-
-  /**
-   * Return this DTM's DTDHandler.
-   *
-   * @return null if this model doesn't respond to SAX dtd events.
-   */
-  public DTDHandler getDTDHandler()
-  {
-    return this;
-  }
-
-  /**
-   * Return this DTM's ErrorHandler.
-   *
-   * @return null if this model doesn't respond to SAX error events.
-   */
-  public ErrorHandler getErrorHandler()
-  {
-    return this;
-  }
-
-  /**
-   * Return this DTM's DeclHandler.
-   *
-   * @return null if this model doesn't respond to SAX Decl events.
-   */
-  public DeclHandler getDeclHandler()
-  {
-    return this;
-  }
-
-  /**
-   * @return true iff we're building this model incrementally (eg
-   * we're partnered with a IncrementalSAXSource) and thus require that the
-   * transformation and the parse run simultaneously. Guidance to the
-   * DTMManager.
-   */
-  public boolean needsTwoThreads()
-  {
-    return null != m_incrementalSAXSource;
-  }
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value). Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   * @param normalize true if the content should be normalized according to 
-   * the rules for the XPath
-   * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
-   * function.
-   *
-   * @throws SAXException
-   */
-  public void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, 
-                                       boolean normalize)
-          throws SAXException
-  {
-
-    int identity = nodeHandle & m_mask;
-    int type = _type(identity);
-
-    if (isTextType(type))
-    {
-      int dataIndex = m_dataOrQName.elementAt(identity);
-      int offset = m_data.elementAt(dataIndex);
-      int length = m_data.elementAt(dataIndex + 1);
-      
-      if(normalize)
-        m_chars.sendNormalizedSAXcharacters(ch, offset, length);
-      else
-        m_chars.sendSAXcharacters(ch, offset, length);
-    }
-    else
-    {
-      int firstChild = _firstch(identity);
-
-      if (DTM.NULL != firstChild)
-      {
-        int offset = -1;
-        int length = 0;
-        int level = _level(identity);
-
-        identity = firstChild;
-
-        while (DTM.NULL != identity && (_level(identity) > level))
-        {
-          type = getNodeType(identity);
-
-          if (isTextType(type))
-          {
-            int dataIndex = _dataOrQName(identity);
-
-            if (-1 == offset)
-            {
-              offset = m_data.elementAt(dataIndex);
-            }
-
-            length += m_data.elementAt(dataIndex + 1);
-          }
-
-          identity = getNextNodeIdentity(identity);
-        }
-
-        if (length > 0)
-        {
-          if(normalize)
-            m_chars.sendNormalizedSAXcharacters(ch, offset, length);
-          else
-            m_chars.sendSAXcharacters(ch, offset, length);
-        }
-      }
-      else if(type != DTM.ELEMENT_NODE)
-      {
-        int dataIndex = _dataOrQName(identity);
-
-        if (dataIndex < 0)
-        {
-          dataIndex = -dataIndex;
-          dataIndex = m_data.elementAt(dataIndex + 1);
-        }
-
-        String str = m_valuesOrPrefixes.indexToString(dataIndex);
-
-          if(normalize)
-            FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 
-                                                         0, str.length(), ch);
-          else
-            ch.characters(str.toCharArray(), 0, str.length());
-      }
-    }
-  }
-
-
-  /**
-   * Given a node handle, return its DOM-style node name. This will
-   * include names such as #text or #document.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   * %REVIEW% Document when empty string is possible...
-   * %REVIEW-COMMENT% It should never be empty, should it?
-   */
-  public String getNodeName(int nodeHandle)
-  {
-
-    int expandedTypeID = getExpandedTypeID(nodeHandle);
-    // If just testing nonzero, no need to shift...
-    //int namespaceID = (expandedTypeID & ExpandedNameTable.MASK_NAMESPACE)
-    //                  >> ExpandedNameTable.BITS_PER_LOCALNAME;
-    int namespaceID = (expandedTypeID & ExpandedNameTable.MASK_NAMESPACE);
-
-    if (0 == namespaceID)
-    {
-      // Don't retrieve name until/unless needed
-      // String name = m_expandedNameTable.getLocalName(expandedTypeID);
-      int type = getNodeType(nodeHandle);
-
-      if (type == DTM.NAMESPACE_NODE)
-      {
-        if (null == m_expandedNameTable.getLocalName(expandedTypeID))
-          return "xmlns";
-        else
-          return "xmlns:" + m_expandedNameTable.getLocalName(expandedTypeID);
-      }
-      else if (0 == m_expandedNameTable.getLocalNameID(expandedTypeID))
-      {
-        return m_fixednames[type];
-      }
-      else
-        return m_expandedNameTable.getLocalName(expandedTypeID);
-    }
-    else
-    {
-      int qnameIndex = m_dataOrQName.elementAt(nodeHandle & m_mask);
-
-      if (qnameIndex < 0)
-      {
-        qnameIndex = -qnameIndex;
-        qnameIndex = m_data.elementAt(qnameIndex);
-      }
-
-      return m_valuesOrPrefixes.indexToString(qnameIndex);
-    }
-  }
-
-  /**
-   * Given a node handle, return the XPath node name.  This should be
-   * the name as described by the XPath data model, NOT the DOM-style
-   * name.
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Name of this node, which may be an empty string.
-   */
-  public String getNodeNameX(int nodeHandle)
-  {
-
-    int expandedTypeID = getExpandedTypeID(nodeHandle);
-    int namespaceID = (expandedTypeID & ExpandedNameTable.MASK_NAMESPACE)
-                      >> ExpandedNameTable.BITS_PER_LOCALNAME;
-
-    if (0 == namespaceID)
-    {
-      String name = m_expandedNameTable.getLocalName(expandedTypeID);
-
-      if (name == null)
-        return "";
-      else
-        return name;
-    }
-    else
-    {
-      int qnameIndex = m_dataOrQName.elementAt(nodeHandle & m_mask);
-
-      if (qnameIndex < 0)
-      {
-        qnameIndex = -qnameIndex;
-        qnameIndex = m_data.elementAt(qnameIndex);
-      }
-
-      return m_valuesOrPrefixes.indexToString(qnameIndex);
-    }
-  }
-
-  /**
-   *     5. [specified] A flag indicating whether this attribute was actually
-   *        specified in the start-tag of its element, or was defaulted from the
-   *        DTD.
-   *
-   * @param the attribute handle
-   *
-   * @param attributeHandle Must be a valid handle to an attribute node.
-   * @return <code>true</code> if the attribute was specified;
-   *         <code>false</code> if it was defaulted.
-   */
-  public boolean isAttributeSpecified(int attributeHandle)
-  {
-
-    // I'm not sure if I want to do anything with this...
-    return true;  // ??
-  }
-
-  /**
-   *   A document type declaration information item has the following properties:
-   *
-   *     1. [system identifier] The system identifier of the external subset, if
-   *        it exists. Otherwise this property has no value.
-   *
-   * @return the system identifier String object, or null if there is none.
-   */
-  public String getDocumentTypeDeclarationSystemIdentifier()
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMDefaultBase abstract method */
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
-
-    return null;
-  }
-
-  /**
-   * Get the next node identity value in the list, and call the iterator
-   * if it hasn't been added yet.
-   *
-   * @param identity The node identity (index).
-   * @return identity+1, or DTM.NULL.
-   */
-  protected int getNextNodeIdentity(int identity)
-  {
-
-    identity += 1;
-
-    while (identity >= m_size)
-    {
-      if (null == m_incrementalSAXSource)
-        return DTM.NULL;
-
-      nextNode();
-    }
-
-    return identity;
-  }
-
-  /**
-   * Directly create SAX parser events from a subtree.
-   *
-   * @param nodeHandle The node ID.
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
-          throws org.xml.sax.SAXException
-  {
-
-    DTMTreeWalker treeWalker = m_walker;
-    ContentHandler prevCH = treeWalker.getcontentHandler();
-
-    if (null != prevCH)
-    {
-      treeWalker = new DTMTreeWalker();
-    }
-
-    treeWalker.setcontentHandler(ch);
-    treeWalker.setDTM(this);
-
-    try
-    {
-      treeWalker.traverse(nodeHandle);
-    }
-    finally
-    {
-      treeWalker.setcontentHandler(null);
-    }
-  }
-
-  /**
-   * Get the number of nodes that have been added.
-   *
-   * @return The number of that are currently in the tree.
-   */
-  protected int getNumberOfNodes()
-  {
-    return m_size;
-  }
-
-  /**
-   * This method should try and build one or more nodes in the table.
-   *
-   * @return The true if a next node is found or false if
-   *         there are no more nodes.
-   */
-  protected boolean nextNode()
-  {
-
-    if (null == m_incrementalSAXSource)
-      return false;
-
-    if (m_endDocumentOccured)
-    {
-      clearCoRoutine();
-
-      return false;
-    }
-
-    Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);
-
-    // gotMore may be a Boolean (TRUE if still parsing, FALSE if
-    // EOF) or an exception if IncrementalSAXSource malfunctioned
-    // (code error rather than user error).
-    //
-    // %REVIEW% Currently the ErrorHandlers sketched herein are
-    // no-ops, so I'm going to initially leave this also as a
-    // no-op.
-    if (!(gotMore instanceof Boolean))
-    {
-      if(gotMore instanceof RuntimeException)
-      {
-        throw (RuntimeException)gotMore;
-      }
-      else if(gotMore instanceof Exception)
-      {
-        throw new WrappedRuntimeException((Exception)gotMore);
-      }
-      // for now...
-      clearCoRoutine();
-
-      return false;
-
-      // %TBD% 
-    }
-
-    if (gotMore != Boolean.TRUE)
-    {
-
-      // EOF reached without satisfying the request
-      clearCoRoutine();  // Drop connection, stop trying
-
-      // %TBD% deregister as its listener?
-    }
-
-    return true;
-  }
-
-  /**
-   * Bottleneck determination of text type.
-   *
-   * @param type oneof DTM.XXX_NODE.
-   *
-   * @return true if this is a text or cdata section.
-   */
-  private final boolean isTextType(int type)
-  {
-    return (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type);
-  }
-
-//    /**
-//     * Ensure that the size of the information arrays can hold another entry
-//     * at the given index.
-//     *
-//     * @param on exit from this function, the information arrays sizes must be
-//     * at least index+1.
-//     *
-//     * NEEDSDOC @param index
-//     */
-//    protected void ensureSize(int index)
-//    {
-//          // dataOrQName is an SuballocatedIntVector and hence self-sizing.
-//          // But DTMDefaultBase may need fixup.
-//        super.ensureSize(index);
-//    }
-
-  /**
-   * Construct the node map from the node.
-   *
-   * @param type raw type ID, one of DTM.XXX_NODE.
-   * @param expandedTypeID The expended type ID.
-   * @param parentIndex The current parent index.
-   * @param previousSibling The previous sibling index.
-   * @param dataOrPrefix index into m_data table, or string handle.
-   * @param canHaveFirstChild true if the node can have a first child, false
-   *                          if it is atomic.
-   *
-   * @return The index identity of the node that was added.
-   */
-  protected int addNode(int type, int expandedTypeID,
-                        int parentIndex, int previousSibling,
-                        int dataOrPrefix, boolean canHaveFirstChild)
-  {
-
-    // Common to all nodes:
-    int nodeIndex = m_size++;
-    m_firstch.addElement(canHaveFirstChild ? NOTPROCESSED : DTM.NULL);
-    m_nextsib.addElement(NOTPROCESSED);
-    m_prevsib.addElement(previousSibling);
-    m_parent.addElement(parentIndex);
-    m_exptype.addElement(expandedTypeID);
-    m_dataOrQName.addElement(dataOrPrefix);    
-
-    if (DTM.NULL != previousSibling)
-      m_nextsib.setElementAt(nodeIndex,previousSibling);
-
-    // Note that nextSibling is not processed until charactersFlush()
-    // is called, to handle successive characters() events.
-
-    // Special handling by type: Declare namespaces, attach first child
-    switch(type)
-    {
-    case DTM.NAMESPACE_NODE:
-      declareNamespaceInContext(parentIndex,nodeIndex);
-      break;
-    case DTM.ATTRIBUTE_NODE:
-      break;
-    default:
-      if (DTM.NULL != parentIndex &&
-	  NOTPROCESSED == m_firstch.elementAt(parentIndex))
-        m_firstch.setElementAt(nodeIndex,parentIndex);
-      break;
-    }
-
-    return nodeIndex;
-  }
-
-  /**
-   * Given a node handle, return its node value. This is mostly
-   * as defined by the DOM, but may ignore some conveniences.
-   * <p>
-   *
-   * @param nodeHandle The node id.
-   * @return String Value of this node, or null if not
-   * meaningful for this node type.
-   */
-  public String getNodeValue(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int type = getNodeType(identity);
-
-    if (isTextType(type))
-    {
-      int dataIndex = _dataOrQName(identity);
-      int offset = m_data.elementAt(dataIndex);
-      int length = m_data.elementAt(dataIndex + 1);
-
-      // %OPT% We should cache this, I guess.
-      return m_chars.getString(offset, length);
-    }
-    else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
-             || DTM.DOCUMENT_NODE == type)
-    {
-      return null;
-    }
-    else
-    {
-      int dataIndex = _dataOrQName(identity);
-
-      if (dataIndex < 0)
-      {
-        dataIndex = -dataIndex;
-        dataIndex = m_data.elementAt(dataIndex + 1);
-      }
-
-      return m_valuesOrPrefixes.indexToString(dataIndex);
-    }
-  }
-
-  /**
-   * Given a node handle, return its XPath-style localname.
-   * (As defined in Namespaces, this is the portion of the name after any
-   * colon character).
-   *
-   * @param nodeHandle the id of the node.
-   * @return String Local name of this node.
-   */
-  public String getLocalName(int nodeHandle)
-  {
-    return m_expandedNameTable.getLocalName(_exptype(nodeHandle & m_mask));
-  }
-
-  /**
-   * The getUnparsedEntityURI function returns the URI of the unparsed
-   * entity with the specified name in the same document as the context
-   * node (see [3.3 Unparsed Entities]). It returns the empty string if
-   * there is no such entity.
-   * <p>
-   * XML processors may choose to use the System Identifier (if one
-   * is provided) to resolve the entity, rather than the URI in the
-   * Public Identifier. The details are dependent on the processor, and
-   * we would have to support some form of plug-in resolver to handle
-   * this properly. Currently, we simply return the System Identifier if
-   * present, and hope that it a usable URI or that our caller can
-   * map it to one.
-   * TODO: Resolve Public Identifiers... or consider changing function name.
-   * <p>
-   * If we find a relative URI
-   * reference, XML expects it to be resolved in terms of the base URI
-   * of the document. The DOM doesn't do that for us, and it isn't
-   * entirely clear whether that should be done here; currently that's
-   * pushed up to a higher level of our application. (Note that DOM Level
-   * 1 didn't store the document's base URI.)
-   * TODO: Consider resolving Relative URIs.
-   * <p>
-   * (The DOM's statement that "An XML processor may choose to
-   * completely expand entities before the structure model is passed
-   * to the DOM" refers only to parsed entities, not unparsed, and hence
-   * doesn't affect this function.)
-   *
-   * @param name A string containing the Entity Name of the unparsed
-   * entity.
-   *
-   * @return String containing the URI of the Unparsed Entity, or an
-   * empty string if no such entity exists.
-   */
-  public String getUnparsedEntityURI(String name)
-  {
-
-    String url = "";
-
-    if (null == m_entities)
-      return url;
-
-    int n = m_entities.size();
-
-    for (int i = 0; i < n; i += ENTITY_FIELDS_PER)
-    {
-      String ename = (String) m_entities.elementAt(i + ENTITY_FIELD_NAME);
-
-      if (null != ename && ename.equals(name))
-      {
-        String nname = (String) m_entities.elementAt(i
-                         + ENTITY_FIELD_NOTATIONNAME);
-
-        if (null != nname)
-        {
-
-          // The draft says: "The XSLT processor may use the public 
-          // identifier to generate a URI for the entity instead of the URI 
-          // specified in the system identifier. If the XSLT processor does 
-          // not use the public identifier to generate the URI, it must use 
-          // the system identifier; if the system identifier is a relative 
-          // URI, it must be resolved into an absolute URI using the URI of 
-          // the resource containing the entity declaration as the base 
-          // URI [RFC2396]."
-          // So I'm falling a bit short here.
-          url = (String) m_entities.elementAt(i + ENTITY_FIELD_SYSTEMID);
-
-          if (null == url)
-          {
-            url = (String) m_entities.elementAt(i + ENTITY_FIELD_PUBLICID);
-          }
-        }
-
-        break;
-      }
-    }
-
-    return url;
-  }
-
-  /**
-   * Given a namespace handle, return the prefix that the namespace decl is
-   * mapping.
-   * Given a node handle, return the prefix used to map to the namespace.
-   *
-   * <p> %REVIEW% Are you sure you want "" for no prefix?  </p>
-   * <p> %REVIEW-COMMENT% I think so... not totally sure. -sb  </p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String prefix of this node's name, or "" if no explicit
-   * namespace prefix was given.
-   */
-  public String getPrefix(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int type = getNodeType(identity);
-
-    if (DTM.ELEMENT_NODE == type)
-    {
-      int prefixIndex = _dataOrQName(identity);
-
-      if (0 == prefixIndex)
-        return "";
-      else
-      {
-        String qname = m_valuesOrPrefixes.indexToString(prefixIndex);
-
-        return getPrefix(qname, null);
-      }
-    }
-    else if (DTM.ATTRIBUTE_NODE == type)
-    {
-      int prefixIndex = _dataOrQName(identity);
-
-      if (prefixIndex < 0)
-      {
-        prefixIndex = m_data.elementAt(-prefixIndex);
-
-        String qname = m_valuesOrPrefixes.indexToString(prefixIndex);
-
-        return getPrefix(qname, null);
-      }
-    }
-
-    return "";
-  }
-
-  /**
-   * Retrieves an attribute node by by qualified name and namespace URI.
-   *
-   * @param nodeHandle int Handle of the node upon which to look up this attribute..
-   * @param namespaceURI The namespace URI of the attribute to
-   *   retrieve, or null.
-   * @param name The local name of the attribute to
-   *   retrieve.
-   * @return The attribute node handle with the specified name (
-   *   <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
-   *   attribute.
-   */
-  public int getAttributeNode(int nodeHandle, String namespaceURI,
-                              String name)
-  {
-
-    for (int attrH = getFirstAttribute(nodeHandle); DTM.NULL != attrH;
-            attrH = getNextAttribute(attrH))
-    {
-      String attrNS = getNamespaceURI(attrH);
-      String attrName = getLocalName(attrH);
-      boolean nsMatch = namespaceURI == attrNS
-                        || (namespaceURI != null
-                            && namespaceURI.equals(attrNS));
-
-      if (nsMatch && name.equals(attrName))
-        return attrH;
-    }
-
-    return DTM.NULL;
-  }
-
-  /**
-   * Return the public identifier of the external subset,
-   * normalized as described in 4.2.2 External Entities [XML]. If there is
-   * no external subset or if it has no public identifier, this property
-   * has no value.
-   *
-   * @param the document type declaration handle
-   *
-   * @return the public identifier String object, or null if there is none.
-   */
-  public String getDocumentTypeDeclarationPublicIdentifier()
-  {
-
-    /** @todo: implement this org.apache.xml.dtm.DTMDefaultBase abstract method */
-    error(XSLMessages.createMessage(XSLTErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
-
-    return null;
-  }
-
-  /**
-   * Given a node handle, return its DOM-style namespace URI
-   * (As defined in Namespaces, this is the declared URI which this node's
-   * prefix -- or default in lieu thereof -- was mapped to.)
-   *
-   * <p>%REVIEW% Null or ""? -sb</p>
-   *
-   * @param nodeHandle the id of the node.
-   * @return String URI value of this node's namespace, or null if no
-   * namespace was resolved.
-   */
-  public String getNamespaceURI(int nodeHandle)
-  {
-
-    return m_expandedNameTable.getNamespace(_exptype(nodeHandle & m_mask));
-  }
-
-  /**
-   * Get the string-value of a node as a String object
-   * (see http://www.w3.org/TR/xpath#data-model
-   * for the definition of a node's string-value).
-   *
-   * @param nodeHandle The node ID.
-   *
-   * @return A string object that represents the string-value of the given node.
-   */
-  public XMLString getStringValue(int nodeHandle)
-  {
-
-    int identity = nodeHandle & m_mask;
-    int type = getNodeType(identity);
-
-    if (isTextType(type))
-    {
-      int dataIndex = _dataOrQName(identity);
-      int offset = m_data.elementAt(dataIndex);
-      int length = m_data.elementAt(dataIndex + 1);
-
-      return m_xstrf.newstr(m_chars, offset, length);
-    }
-    else
-    {
-      int firstChild = _firstch(identity);
-
-      if (DTM.NULL != firstChild)
-      {
-        int offset = -1;
-        int length = 0;
-        int level = _level(identity);
-
-        identity = firstChild;
-
-        while (DTM.NULL != identity && (_level(identity) > level))
-        {
-          type = getNodeType(identity);
-
-          if (isTextType(type))
-          {
-            int dataIndex = _dataOrQName(identity);
-
-            if (-1 == offset)
-            {
-              offset = m_data.elementAt(dataIndex);
-            }
-
-            length += m_data.elementAt(dataIndex + 1);
-          }
-
-          identity = getNextNodeIdentity(identity);
-        }
-
-        if (length > 0)
-        {
-          return m_xstrf.newstr(m_chars, offset, length);
-        }
-      }
-      else if(type != DTM.ELEMENT_NODE)
-      {
-        int dataIndex = _dataOrQName(identity);
-
-        if (dataIndex < 0)
-        {
-          dataIndex = -dataIndex;
-          dataIndex = m_data.elementAt(dataIndex + 1);
-        }
-        return m_xstrf.newstr(m_valuesOrPrefixes.indexToString(dataIndex));
-      }
-    }
-
-    return m_xstrf.emptystr();
-  }
-
-  /**
-   * Returns the <code>Element</code> whose <code>ID</code> is given by
-   * <code>elementId</code>. If no such element exists, returns
-   * <code>DTM.NULL</code>. Behavior is not defined if more than one element
-   * has this <code>ID</code>. Attributes (including those
-   * with the name "ID") are not of type ID unless so defined by DTD/Schema
-   * information available to the DTM implementation.
-   * Implementations that do not know whether attributes are of type ID or
-   * not are expected to return <code>DTM.NULL</code>.
-   *
-   * <p>%REVIEW% Presumably IDs are still scoped to a single document,
-   * and this operation searches only within a single document, right?
-   * Wouldn't want collisions between DTMs in the same process.</p>
-   *
-   * @param elementId The unique <code>id</code> value for an element.
-   * @return The handle of the matching element.
-   */
-  public int getElementById(String elementId)
-  {
-
-    Integer intObj;
-    boolean isMore = true;
-
-    do
-    {
-      intObj = (Integer) m_idAttributes.get(elementId);
-
-      if (null != intObj)
-        return intObj.intValue() | m_dtmIdent;
-
-      if (!isMore || m_endDocumentOccured)
-        break;
-
-      isMore = nextNode();
-    }
-    while (null == intObj);
-
-    return DTM.NULL;
-  }
-
-  /**
-   * Get a prefix either from the qname or from the uri mapping, or just make
-   * one up!
-   *
-   * @param qname The qualified name, which may be null.
-   * @param uri The namespace URI, which may be null.
-   *
-   * @return The prefix if there is one, or null.
-   */
-  private String getPrefix(String qname, String uri)
-  {
-
-    String prefix;
-    int uriIndex = -1;
-
-    if (null != uri && uri.length() > 0)
-    {
-
-      do
-      {
-        uriIndex = m_prefixMappings.indexOf(uri, ++uriIndex);
-      } while ( (uriIndex & 0x01) == 0);
-
-      if (uriIndex >= 0)
-      {
-        prefix = (String) m_prefixMappings.elementAt(uriIndex - 1);
-      }
-      else if (null != qname)
-      {
-        int indexOfNSSep = qname.indexOf(':');
-
-        if (qname.equals("xmlns"))
-          prefix = "";
-        else if (qname.startsWith("xmlns:"))
-          prefix = qname.substring(indexOfNSSep + 1);
-        else
-          prefix = (indexOfNSSep > 0)
-                   ? qname.substring(0, indexOfNSSep) : null;
-      }
-      else
-      {
-        prefix = null;  // ??
-      }
-    }
-    else if (null != qname)
-    {
-      int indexOfNSSep = qname.indexOf(':');
-
-      if (qname.equals("xmlns"))
-        prefix = "";
-      else if (qname.startsWith("xmlns:"))
-        prefix = qname.substring(indexOfNSSep + 1);
-      else
-        prefix = (indexOfNSSep > 0) ? qname.substring(0, indexOfNSSep) : null;
-    }
-    else
-    {
-      prefix = null;
-    }
-
-    return prefix;
-  }
-
-  /**
-   * Set an ID string to node association in the ID table.
-   *
-   * @param id The ID string.
-   * @param elem The associated element handle.
-   */
-  public void setIDAttribute(String id, int elem)
-  {
-    m_idAttributes.put(id, new Integer(elem));
-  }
-
-  /**
-   * Check whether accumulated text should be stripped; if not,
-   * append the appropriate flavor of text/cdata node.
-   */
-  protected void charactersFlush()
-  {
-
-    if (m_textPendingStart >= 0)  // -1 indicates no-text-in-progress
-    {
-      int length = m_chars.size() - m_textPendingStart;
-      boolean doStrip = false;
-
-      if (getShouldStripWhitespace())
-      {
-        doStrip = m_chars.isWhitespace(m_textPendingStart, length);
-      }
-
-      if (doStrip)
-        m_chars.setLength(m_textPendingStart);  // Discard accumulated text
-      else
-      {
-        int exName = m_expandedNameTable.getExpandedTypeID(DTM.TEXT_NODE);
-        int dataIndex = m_data.size();
-
-        m_previous = addNode(m_coalescedTextType, exName,
-                             m_parents.peek(), m_previous, dataIndex, false);
-
-        m_data.addElement(m_textPendingStart);
-        m_data.addElement(length);
-      }
-
-      // Reset for next text block
-      m_textPendingStart = -1;
-      m_textType = m_coalescedTextType = DTM.TEXT_NODE;
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of the EntityResolver interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Resolve an external entity.
-   *
-   * <p>Always return null, so that the parser will use the system
-   * identifier provided in the XML document.  This method implements
-   * the SAX default behaviour: application writers can override it
-   * in a subclass to do special translations such as catalog lookups
-   * or URI redirection.</p>
-   *
-   * @param publicId The public identifer, or null if none is
-   *                 available.
-   * @param systemId The system identifier provided in the XML
-   *                 document.
-   * @return The new input source, or null to require the
-   *         default behaviour.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.EntityResolver#resolveEntity
-   *
-   * @throws SAXException
-   */
-  public InputSource resolveEntity(String publicId, String systemId)
-          throws SAXException
-  {
-    return null;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of DTDHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive notification of a notation declaration.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass if they wish to keep track of the notations
-   * declared in a document.</p>
-   *
-   * @param name The notation name.
-   * @param publicId The notation public identifier, or null if not
-   *                 available.
-   * @param systemId The notation system identifier.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.DTDHandler#notationDecl
-   *
-   * @throws SAXException
-   */
-  public void notationDecl(String name, String publicId, String systemId)
-          throws SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Receive notification of an unparsed entity declaration.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to keep track of the unparsed entities
-   * declared in a document.</p>
-   *
-   * @param name The entity name.
-   * @param publicId The entity public identifier, or null if not
-   *                 available.
-   * @param systemId The entity system identifier.
-   * @param notationName The name of the associated notation.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   *
-   * @throws SAXException
-   */
-  public void unparsedEntityDecl(
-          String name, String publicId, String systemId, String notationName)
-            throws SAXException
-  {
-
-    if (null == m_entities)
-    {
-      m_entities = new Vector();
-    }
-
-    try
-    {
-      systemId = SystemIDResolver.getAbsoluteURI(systemId,
-                                                 getDocumentBaseURI());
-    }
-    catch (Exception e)
-    {
-      throw new org.xml.sax.SAXException(e);
-    }
-
-    //  private static final int ENTITY_FIELD_PUBLICID = 0;
-    m_entities.addElement(publicId);
-
-    //  private static final int ENTITY_FIELD_SYSTEMID = 1;
-    m_entities.addElement(systemId);
-
-    //  private static final int ENTITY_FIELD_NOTATIONNAME = 2;
-    m_entities.addElement(notationName);
-
-    //  private static final int ENTITY_FIELD_NAME = 3;
-    m_entities.addElement(name);
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of ContentHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive a Locator object for document events.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass if they wish to store the locator for use
-   * with other document events.</p>
-   *
-   * @param locator A locator for all SAX document events.
-   * @see org.xml.sax.ContentHandler#setDocumentLocator
-   * @see org.xml.sax.Locator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-    m_locator = locator;
-  }
-
-  /**
-   * Receive notification of the beginning of the document.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the beginning
-   * of a document (such as allocating the root node of a tree or
-   * creating an output file).</p>
-   *
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startDocument
-   */
-  public void startDocument() throws SAXException
-  {
-    int doc = addNode(DTM.DOCUMENT_NODE,
-                      m_expandedNameTable.getExpandedTypeID(DTM.DOCUMENT_NODE),
-                      DTM.NULL, DTM.NULL, 0, true);
-
-    m_parents.push(doc);
-
-    m_previous = DTM.NULL;
-
-    m_contextIndexes.push(m_prefixMappings.size());  // for the next element.
-  }
-
-  /**
-   * Receive notification of the end of the document.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the end
-   * of a document (such as finalising a tree or closing an output
-   * file).</p>
-   *
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#endDocument
-   */
-  public void endDocument() throws SAXException
-  {
-    charactersFlush();
-
-    m_nextsib.setElementAt(NULL,0);
-
-    if (m_firstch.elementAt(0) == NOTPROCESSED)
-      m_firstch.setElementAt(NULL,0);
-
-    if (DTM.NULL != m_previous)
-      m_nextsib.setElementAt(DTM.NULL,m_previous);
-
-    m_parents = null;
-    m_prefixMappings = null;
-    m_contextIndexes = null;
-
-    m_endDocumentOccured = true;
-  }
-
-  /**
-   * Receive notification of the start of a Namespace mapping.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the start of
-   * each Namespace prefix scope (such as storing the prefix mapping).</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI mapped to the prefix.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startPrefixMapping
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("startPrefixMapping: prefix: " + prefix + ", uri: "
-                         + uri);
-
-    if(null == prefix)
-      prefix = "";
-    m_prefixMappings.addElement(prefix);  // JDK 1.1.x compat -sc
-    m_prefixMappings.addElement(uri);  // JDK 1.1.x compat -sc
-  }
-
-  /**
-   * Receive notification of the end of a Namespace mapping.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the end of
-   * each prefix mapping.</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#endPrefixMapping
-   */
-  public void endPrefixMapping(String prefix) throws SAXException
-  {
-
-    if (DEBUG)
-      System.out.println("endPrefixMapping: prefix: " + prefix);
-
-    if(null == prefix)
-      prefix = "";
-
-    int index = m_contextIndexes.peek() - 1;
-
-    do
-    {
-      index = m_prefixMappings.indexOf(prefix, ++index);
-    } while ( (index >= 0) && ((index & 0x01) == 0x01) );
-
-
-    if (index > -1)
-    {
-      m_prefixMappings.setElementAt("%@$#^@#", index);
-      m_prefixMappings.setElementAt("%@$#^@#", index + 1);
-    }
-
-    // no op
-  }
-
-  /**
-   * Check if a declaration has already been made for a given prefix.
-   *
-   * @param prefix non-null prefix string.
-   *
-   * @return true if the declaration has already been declared in the
-   *         current context.
-   */
-  protected boolean declAlreadyDeclared(String prefix)
-  {
-
-    int startDecls = m_contextIndexes.peek();
-    java.util.Vector prefixMappings = m_prefixMappings;
-    int nDecls = prefixMappings.size();
-
-    for (int i = startDecls; i < nDecls; i += 2)
-    {
-      String prefixDecl = (String) prefixMappings.elementAt(i);
-
-      if (prefixDecl == null)
-        continue;
-
-      if (prefixDecl.equals(prefix))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Receive notification of the start of an element.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the start of
-   * each element (such as allocating a new tree node or writing
-   * output to a file).</p>
-   *
-   * @param name The element type name.
-   *
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param qName The qualified name (with prefix), or the
-   *        empty string if qualified names are not available.
-   * @param attributes The specified or defaulted attributes.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#startElement
-   */
-  public void startElement(
-          String uri, String localName, String qName, Attributes attributes)
-            throws SAXException
-  {
-    charactersFlush();
-
-    int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE);
-    String prefix = getPrefix(qName, uri);
-    int prefixIndex = (null != prefix)
-                      ? m_valuesOrPrefixes.stringToIndex(qName) : 0;
-    int elemNode = addNode(DTM.ELEMENT_NODE, exName,
-                           m_parents.peek(), m_previous, prefixIndex, true);
-
-    indexNode(exName, elemNode);
-    
-    m_parents.push(elemNode);
-
-    int startDecls = m_contextIndexes.peek();
-    int nDecls = m_prefixMappings.size();
-    int prev = DTM.NULL;
-
-    for (int i = startDecls; i < nDecls; i += 2)
-    {
-      prefix = (String) m_prefixMappings.elementAt(i);
-
-      if (prefix == null)
-        continue;
-
-      String declURL = (String) m_prefixMappings.elementAt(i + 1);
-
-      exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE);
-
-      int val = m_valuesOrPrefixes.stringToIndex(declURL);
-
-      prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode,
-                     prev, val, false);
-    }
-
-    int n = attributes.getLength();
-
-    for (int i = 0; i < n; i++)
-    {
-      String attrUri = attributes.getURI(i);
-      String attrQName = attributes.getQName(i);
-      String valString = attributes.getValue(i);
-
-      prefix = getPrefix(attrQName, attrUri);
-
-      int nodeType;
-
-      if ((null != attrQName)
-              && (attrQName.equals("xmlns")
-                  || attrQName.startsWith("xmlns:")))
-      {
-        if (declAlreadyDeclared(prefix))
-          continue;  // go to the next attribute.
-
-        nodeType = DTM.NAMESPACE_NODE;
-      }
-      else
-      {
-        nodeType = DTM.ATTRIBUTE_NODE;
-
-        if (attributes.getType(i).equalsIgnoreCase("ID"))
-          setIDAttribute(valString, elemNode);
-      }
-      
-      // Bit of a hack... if somehow valString is null, stringToIndex will 
-      // return -1, which will make things very unhappy.
-      if(null == valString)
-        valString = "";
-
-      int val = m_valuesOrPrefixes.stringToIndex(valString);
-      String attrLocalName = attributes.getLocalName(i);
-
-      if (null != prefix)
-      {
-        
-        prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName);
-
-        int dataIndex = m_data.size();
-
-        m_data.addElement(prefixIndex);
-        m_data.addElement(val);
-
-        val = -dataIndex;
-      }
-
-      exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType);
-      prev = addNode(nodeType, exName, elemNode, prev, val,
-                     false);
-    }
-
-    if (DTM.NULL != prev)
-      m_nextsib.setElementAt(DTM.NULL,prev);
-
-    if (null != m_wsfilter)
-    {
-      short wsv = m_wsfilter.getShouldStripSpace(elemNode | m_dtmIdent, this);
-      boolean shouldStrip = (DTMWSFilter.INHERIT == wsv)
-                            ? getShouldStripWhitespace()
-                            : (DTMWSFilter.STRIP == wsv);
-
-      pushShouldStripWhitespace(shouldStrip);
-    }
-
-    m_previous = DTM.NULL;
-
-    m_contextIndexes.push(m_prefixMappings.size());  // for the children.
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions at the end of
-   * each element (such as finalising a tree node or writing
-   * output to a file).</p>
-   *
-   * @param name The element type name.
-   * @param attributes The specified or defaulted attributes.
-   *
-   * @param uri The Namespace URI, or the empty string if the
-   *        element has no Namespace URI or if Namespace
-   *        processing is not being performed.
-   * @param localName The local name (without prefix), or the
-   *        empty string if Namespace processing is not being
-   *        performed.
-   * @param qName The qualified XML 1.0 name (with prefix), or the
-   *        empty string if qualified names are not available.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#endElement
-   */
-  public void endElement(String uri, String localName, String qName)
-          throws SAXException
-  {
-
-    charactersFlush();
-
-    // If no one noticed, startPrefixMapping is a drag.
-    // Pop the context for the last child (the one pushed by startElement)
-    m_prefixMappings.setSize(m_contextIndexes.pop());
-
-    // Do it again for this one (the one pushed by the last endElement).
-    m_prefixMappings.setSize(m_contextIndexes.pop());
-    m_contextIndexes.push(m_prefixMappings.size());  // for the next element.
-
-    int lastNode = m_previous;
-
-    m_previous = m_parents.pop();
-
-    if (NOTPROCESSED == m_firstch.elementAt(m_previous))
-      m_firstch.setElementAt(DTM.NULL,m_previous);
-    else if (DTM.NULL != lastNode)
-      m_nextsib.setElementAt(DTM.NULL,lastNode);
-
-    popShouldStripWhitespace();
-  }
-
-  /**
-   * Receive notification of character data inside an element.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method to take specific actions for each chunk of character data
-   * (such as adding the data to a node or buffer, or printing it to
-   * a file).</p>
-   *
-   * @param ch The characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#characters
-   */
-  public void characters(char ch[], int start, int length) throws SAXException
-  {
-
-    if (m_textPendingStart == -1)  // First one in this block
-    {
-      m_textPendingStart = m_chars.size();
-      m_coalescedTextType = m_textType;
-    }
-
-    m_chars.append(ch, start, length);
-
-    // Type logic: If all adjacent text is CDATASections, the
-    // concatentated text is treated as a single CDATASection (see
-    // initialization above).  If any were ordinary Text, the whole
-    // thing is treated as Text. This may be worth %REVIEW%ing.
-    if (m_textType == DTM.TEXT_NODE)
-      m_coalescedTextType = DTM.TEXT_NODE;
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method to take specific actions for each chunk of ignorable
-   * whitespace (such as adding data to a node or buffer, or printing
-   * it to a file).</p>
-   *
-   * @param ch The whitespace characters.
-   * @param start The start position in the character array.
-   * @param length The number of characters to use from the
-   *               character array.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#ignorableWhitespace
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws SAXException
-  {
-
-    // %OPT% We can probably take advantage of the fact that we know this 
-    // is whitespace.
-    characters(ch, start, length);
-  }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions for each
-   * processing instruction, such as setting status variables or
-   * invoking other methods.</p>
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *             none is supplied.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   */
-  public void processingInstruction(String target, String data)
-          throws SAXException
-  {
-
-    charactersFlush();
-
-    int exName = m_expandedNameTable.getExpandedTypeID(null, target,
-                                         DTM.PROCESSING_INSTRUCTION_NODE);
-    int dataIndex = m_valuesOrPrefixes.stringToIndex(data);
-
-    m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, exName,
-                         m_parents.peek(), m_previous,
-                         dataIndex, false);
-  }
-
-  /**
-   * Receive notification of a skipped entity.
-   *
-   * <p>By default, do nothing.  Application writers may override this
-   * method in a subclass to take specific actions for each
-   * processing instruction, such as setting status variables or
-   * invoking other methods.</p>
-   *
-   * @param name The name of the skipped entity.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ContentHandler#processingInstruction
-   */
-  public void skippedEntity(String name) throws SAXException
-  {
-
-    // %REVIEW% What should be done here?
-    // no op
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of the ErrorHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Receive notification of a parser warning.
-   *
-   * <p>The default implementation does nothing.  Application writers
-   * may override this method in a subclass to take specific actions
-   * for each warning, such as inserting the message in a log file or
-   * printing it to the console.</p>
-   *
-   * @param e The warning information encoded as an exception.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ErrorHandler#warning
-   * @see org.xml.sax.SAXParseException
-   */
-  public void warning(SAXParseException e) throws SAXException
-  {
-
-    // %REVIEW% Is there anyway to get the JAXP error listener here?
-    System.err.println(e.getMessage());
-  }
-
-  /**
-   * Receive notification of a recoverable parser error.
-   *
-   * <p>The default implementation does nothing.  Application writers
-   * may override this method in a subclass to take specific actions
-   * for each error, such as inserting the message in a log file or
-   * printing it to the console.</p>
-   *
-   * @param e The warning information encoded as an exception.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ErrorHandler#warning
-   * @see org.xml.sax.SAXParseException
-   */
-  public void error(SAXParseException e) throws SAXException
-  {
-    throw e;
-  }
-
-  /**
-   * Report a fatal XML parsing error.
-   *
-   * <p>The default implementation throws a SAXParseException.
-   * Application writers may override this method in a subclass if
-   * they need to take specific actions for each fatal error (such as
-   * collecting all of the errors into a single report): in any case,
-   * the application must stop all regular processing when this
-   * method is invoked, since the document is no longer reliable, and
-   * the parser may no longer report parsing events.</p>
-   *
-   * @param e The error information encoded as an exception.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see org.xml.sax.ErrorHandler#fatalError
-   * @see org.xml.sax.SAXParseException
-   */
-  public void fatalError(SAXParseException e) throws SAXException
-  {
-    throw e;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of the DeclHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Report an element type declaration.
-   *
-   * <p>The content model will consist of the string "EMPTY", the
-   * string "ANY", or a parenthesised group, optionally followed
-   * by an occurrence indicator.  The model will be normalized so
-   * that all whitespace is removed,and will include the enclosing
-   * parentheses.</p>
-   *
-   * @param name The element type name.
-   * @param model The content model as a normalized string.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void elementDecl(String name, String model) throws SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Report an attribute type declaration.
-   *
-   * <p>Only the effective (first) declaration for an attribute will
-   * be reported.  The type will be one of the strings "CDATA",
-   * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
-   * "ENTITIES", or "NOTATION", or a parenthesized token group with
-   * the separator "|" and all whitespace removed.</p>
-   *
-   * @param eName The name of the associated element.
-   * @param aName The name of the attribute.
-   * @param type A string representing the attribute type.
-   * @param valueDefault A string representing the attribute default
-   *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
-   *        none of these applies.
-   * @param value A string representing the attribute's default value,
-   *        or null if there is none.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void attributeDecl(
-          String eName, String aName, String type, String valueDefault, String value)
-            throws SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Report an internal entity declaration.
-   *
-   * <p>Only the effective (first) declaration for each entity
-   * will be reported.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @param value The replacement text of the entity.
-   * @throws SAXException The application may raise an exception.
-   * @see #externalEntityDecl
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void internalEntityDecl(String name, String value)
-          throws SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Report a parsed external entity declaration.
-   *
-   * <p>Only the effective (first) declaration for each entity
-   * will be reported.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @param publicId The declared public identifier of the entity, or
-   *        null if none was declared.
-   * @param systemId The declared system identifier of the entity.
-   * @throws SAXException The application may raise an exception.
-   * @see #internalEntityDecl
-   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
-   */
-  public void externalEntityDecl(
-          String name, String publicId, String systemId) throws SAXException
-  {
-
-    // no op
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // Implementation of the LexicalHandler interface.
-  ////////////////////////////////////////////////////////////////////
-
-  /**
-   * Report the start of DTD declarations, if any.
-   *
-   * <p>Any declarations are assumed to be in the internal subset
-   * unless otherwise indicated by a {@link #startEntity startEntity}
-   * event.</p>
-   *
-   * <p>Note that the start/endDTD events will appear within
-   * the start/endDocument events from ContentHandler and
-   * before the first startElement event.</p>
-   *
-   * @param name The document type name.
-   * @param publicId The declared public identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @param systemId The declared system identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @throws SAXException The application may raise an
-   *            exception.
-   * @see #endDTD
-   * @see #startEntity
-   */
-  public void startDTD(String name, String publicId, String systemId)
-          throws SAXException
-  {
-
-    m_insideDTD = true;
-  }
-
-  /**
-   * Report the end of DTD declarations.
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #startDTD
-   */
-  public void endDTD() throws SAXException
-  {
-
-    m_insideDTD = false;
-  }
-
-  /**
-   * Report the beginning of an entity in content.
-   *
-   * <p><strong>NOTE:</entity> entity references in attribute
-   * values -- and the start and end of the document entity --
-   * are never reported.</p>
-   *
-   * <p>The start and end of the external DTD subset are reported
-   * using the pseudo-name "[dtd]".  All other events must be
-   * properly nested within start/end entity events.</p>
-   *
-   * <p>Note that skipped entities will be reported through the
-   * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
-   * event, which is part of the ContentHandler interface.</p>
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @throws SAXException The application may raise an exception.
-   * @see #endEntity
-   * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
-   * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
-   */
-  public void startEntity(String name) throws SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Report the end of an entity.
-   *
-   * @param name The name of the entity that is ending.
-   * @throws SAXException The application may raise an exception.
-   * @see #startEntity
-   */
-  public void endEntity(String name) throws SAXException
-  {
-
-    // no op
-  }
-
-  /**
-   * Report the start of a CDATA section.
-   *
-   * <p>The contents of the CDATA section will be reported through
-   * the regular {@link org.xml.sax.ContentHandler#characters
-   * characters} event.</p>
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #endCDATA
-   */
-  public void startCDATA() throws SAXException
-  {
-    m_textType = DTM.CDATA_SECTION_NODE;
-  }
-
-  /**
-   * Report the end of a CDATA section.
-   *
-   * @throws SAXException The application may raise an exception.
-   * @see #startCDATA
-   */
-  public void endCDATA() throws SAXException
-  {
-    m_textType = DTM.TEXT_NODE;
-  }
-
-  /**
-   * Report an XML comment anywhere in the document.
-   *
-   * <p>This callback will be used for comments inside or outside the
-   * document element, including comments in the external DTD
-   * subset (if read).</p>
-   *
-   * @param ch An array holding the characters in the comment.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   * @throws SAXException The application may raise an exception.
-   */
-  public void comment(char ch[], int start, int length) throws SAXException
-  {
-
-    if (m_insideDTD)      // ignore comments if we're inside the DTD
-      return;
-
-    charactersFlush();
-
-    int exName = m_expandedNameTable.getExpandedTypeID(DTM.COMMENT_NODE);
-
-    // For now, treat comments as strings...  I guess we should do a 
-    // seperate FSB buffer instead.
-    int dataIndex = m_valuesOrPrefixes.stringToIndex(new String(ch, start,
-                      length));
-
-    m_previous = addNode(DTM.COMMENT_NODE, exName, 
-                         m_parents.peek(), m_previous, dataIndex, false);
-  }
-
-  /**
-   * Set a run time property for this DTM instance.
-   *
-   * @param property a <code>String</code> value
-   * @param value an <code>Object</code> value
-   */
-  public void setProperty(String property, Object value)
-  {
-    if (property.equals(XalanProperties.SOURCE_LOCATION)) {
-      if (!(value instanceof Boolean))
-        throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_PROPERTY_VALUE_BOOLEAN, new Object[]{XalanProperties.SOURCE_LOCATION})); //"Value for property "
-                                  // + XalanProperties.SOURCE_LOCATION
-                                  // + " should be a Boolean instance");
-      m_useSourceLocationProperty = ((Boolean)value).booleanValue();
-      m_sourceSystemId = new StringVector();
-      m_sourceLine = new IntVector();
-      m_sourceColumn = new IntVector();
-    }
-  }
-
-  public SourceLocator getSourceLocatorFor(int node)
-  {
-    if (m_useSourceLocationProperty)
-    {
-      node = node & ExpandedNameTable.MASK_NODEHANDLE;
-      
-      return new NodeLocator(null,
-                             m_sourceSystemId.elementAt(node),
-                             m_sourceLine.elementAt(node),
-                             m_sourceColumn.elementAt(node));
-    }
-    return null;
-  }
-}
diff --git a/src/org/apache/xml/utils/AttList.java b/src/org/apache/xml/utils/AttList.java
deleted file mode 100644
index a4d162b..0000000
--- a/src/org/apache/xml/utils/AttList.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.DOM2Helper;
-
-/**
- * <meta name="usage" content="internal"/>
- * Wraps a DOM attribute list in a SAX Attributes.
- */
-public class AttList implements Attributes
-{
-
-  /** List of attribute nodes          */
-  NamedNodeMap m_attrs;
-
-  /** Index of last attribute node          */
-  int m_lastIndex;
-
-  // ARGHH!!  JAXP Uses Xerces without setting the namespace processing to ON!
-  // DOM2Helper m_dh = new DOM2Helper();
-
-  /** Local reference to DOMHelper          */
-  DOMHelper m_dh;
-
-//  /**
-//   * Constructor AttList
-//   *
-//   *
-//   * @param attrs List of attributes this will contain
-//   */
-//  public AttList(NamedNodeMap attrs)
-//  {
-//
-//    m_attrs = attrs;
-//    m_lastIndex = m_attrs.getLength() - 1;
-//    m_dh = new DOM2Helper();
-//  }
-
-  /**
-   * Constructor AttList
-   *
-   *
-   * @param attrs List of attributes this will contain
-   * @param dh DOMHelper 
-   */
-  public AttList(NamedNodeMap attrs, DOMHelper dh)
-  {
-
-    m_attrs = attrs;
-    m_lastIndex = m_attrs.getLength() - 1;
-    m_dh = dh;
-  }
-
-  /**
-   * Get the number of attribute nodes in the list 
-   *
-   *
-   * @return number of attribute nodes
-   */
-  public int getLength()
-  {
-    return m_attrs.getLength();
-  }
-
-  /**
-   * Look up an attribute's Namespace URI by index.
-   *
-   * @param index The attribute index (zero-based).
-   * @return The Namespace URI, or the empty string if none
-   *         is available, or null if the index is out of
-   *         range.
-   */
-  public String getURI(int index)
-  {
-    String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
-    if(null == ns)
-      ns = "";
-    return ns;
-  }
-
-  /**
-   * Look up an attribute's local name by index.
-   *
-   * @param index The attribute index (zero-based).
-   * @return The local name, or the empty string if Namespace
-   *         processing is not being performed, or null
-   *         if the index is out of range.
-   */
-  public String getLocalName(int index)
-  {
-    return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
-  }
-
-  /**
-   * Look up an attribute's qualified name by index.
-   *
-   *
-   * @param index The attribute index (zero-based).
-   *
-   * @return The attribute's qualified name
-   */
-  public String getQName(int i)
-  {
-    return ((Attr) m_attrs.item(i)).getName();
-  }
-
-  /**
-   * Get the attribute's node type by index
-   *
-   *
-   * @param index The attribute index (zero-based)
-   *
-   * @return the attribute's node type
-   */
-  public String getType(int i)
-  {
-    return "CDATA";  // for the moment
-  }
-
-  /**
-   * Get the attribute's node value by index
-   *
-   *
-   * @param index The attribute index (zero-based)
-   *
-   * @return the attribute's node value
-   */
-  public String getValue(int i)
-  {
-    return ((Attr) m_attrs.item(i)).getValue();
-  }
-
-  /**
-   * Get the attribute's node type by name
-   *
-   *
-   * @param name Attribute name
-   *
-   * @return the attribute's node type
-   */
-  public String getType(String name)
-  {
-    return "CDATA";  // for the moment
-  }
-
-  /**
-   * Look up an attribute's type by Namespace name.
-   *
-   * @param uri The Namespace URI, or the empty String if the
-   *        name has no Namespace URI.
-   * @param localName The local name of the attribute.
-   * @return The attribute type as a string, or null if the
-   *         attribute is not in the list or if Namespace
-   *         processing is not being performed.
-   */
-  public String getType(String uri, String localName)
-  {
-    return "CDATA";  // for the moment
-  }
-
-  /**
-   * Look up an attribute's value by name.
-   *
-   *
-   * @param name The attribute node's name
-   *
-   * @return The attribute node's value
-   */
-  public String getValue(String name)
-  {
-    Attr attr = ((Attr) m_attrs.getNamedItem(name));
-    return (null != attr) 
-          ? attr.getValue() : null;
-  }
-
-  /**
-   * Look up an attribute's value by Namespace name.
-   *
-   * @param uri The Namespace URI, or the empty String if the
-   *        name has no Namespace URI.
-   * @param localName The local name of the attribute.
-   * @return The attribute value as a string, or null if the
-   *         attribute is not in the list.
-   */
-  public String getValue(String uri, String localName)
-  {
-    return ((Attr) m_attrs.getNamedItem(localName)).getValue();
-  }
-
-  /**
-   * Look up the index of an attribute by Namespace name.
-   *
-   * @param uri The Namespace URI, or the empty string if
-   *        the name has no Namespace URI.
-   * @param localPart The attribute's local name.
-   * @return The index of the attribute, or -1 if it does not
-   *         appear in the list.
-   */
-  public int getIndex(String uri, String localPart)
-  {
-    return 0;
-  }
-
-  /**
-   * Look up the index of an attribute by raw XML 1.0 name.
-   *
-   * @param rawName The raw (prefixed) name.
-   * @return The index of the attribute, or -1 if it does not
-   *         appear in the list.
-   */
-  public int getIndex(String rawName)
-  {
-    return 0;
-  }
-}
diff --git a/src/org/apache/xml/utils/BoolStack.java b/src/org/apache/xml/utils/BoolStack.java
deleted file mode 100644
index 3a754e7..0000000
--- a/src/org/apache/xml/utils/BoolStack.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.EmptyStackException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Simple stack for boolean values.
- */
-public final class BoolStack implements Cloneable
-{
-
-  /** Array of boolean values          */
-  private boolean m_values[];
-
-  /** Array size allocated           */
-  private int m_allocatedSize;
-
-  /** Index into the array of booleans          */
-  private int m_index;
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public BoolStack()
-  {
-    this(32);
-  }
-
-  /**
-   * Construct a IntVector, using the given block size.
-   *
-   * @param size array size to allocate
-   */
-  public BoolStack(int size)
-  {
-
-    m_allocatedSize = size;
-    m_values = new boolean[size];
-    m_index = -1;
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Current length of the list
-   */
-  public final int size()
-  {
-    return m_index + 1;
-  }
-
-  /**
-   * Pushes an item onto the top of this stack.
-   *
-   *
-   * @param val the boolean to be pushed onto this stack.
-   * @return  the <code>item</code> argument.
-   */
-  public final boolean push(boolean val)
-  {
-
-    if (m_index == m_allocatedSize - 1)
-      grow();
-
-    return (m_values[++m_index] = val);
-  }
-
-  /**
-   * Removes the object at the top of this stack and returns that
-   * object as the value of this function.
-   *
-   * @return     The object at the top of this stack.
-   * @throws  EmptyStackException  if this stack is empty.
-   */
-  public final boolean pop()
-  {
-    return m_values[m_index--];
-  }
-
-  /**
-   * Removes the object at the top of this stack and returns the
-   * next object at the top as the value of this function.
-   *
-   *
-   * @return Next object to the top or false if none there
-   */
-  public final boolean popAndTop()
-  {
-
-    m_index--;
-
-    return (m_index >= 0) ? m_values[m_index] : false;
-  }
-
-  /**
-   * Set the item at the top of this stack  
-   *
-   *
-   * @param b Object to set at the top of this stack
-   */
-  public final void setTop(boolean b)
-  {
-    m_values[m_index] = b;
-  }
-
-  /**
-   * Looks at the object at the top of this stack without removing it
-   * from the stack.
-   *
-   * @return     the object at the top of this stack.
-   * @throws  EmptyStackException  if this stack is empty.
-   */
-  public final boolean peek()
-  {
-    return m_values[m_index];
-  }
-
-  /**
-   * Looks at the object at the top of this stack without removing it
-   * from the stack.  If the stack is empty, it returns false.
-   *
-   * @return     the object at the top of this stack.
-   */
-  public final boolean peekOrFalse()
-  {
-    return (m_index > -1) ? m_values[m_index] : false;
-  }
-
-  /**
-   * Looks at the object at the top of this stack without removing it
-   * from the stack.  If the stack is empty, it returns true.
-   *
-   * @return     the object at the top of this stack.
-   */
-  public final boolean peekOrTrue()
-  {
-    return (m_index > -1) ? m_values[m_index] : true;
-  }
-
-  /**
-   * Tests if this stack is empty.
-   *
-   * @return  <code>true</code> if this stack is empty;
-   *          <code>false</code> otherwise.
-   */
-  public boolean isEmpty()
-  {
-    return (m_index == -1);
-  }
-
-  /**
-   * Grows the size of the stack
-   *
-   */
-  private void grow()
-  {
-
-    m_allocatedSize *= 2;
-
-    boolean newVector[] = new boolean[m_allocatedSize];
-
-    System.arraycopy(m_values, 0, newVector, 0, m_index + 1);
-
-    m_values = newVector;
-  }
-  
-  public Object clone() 
-    throws CloneNotSupportedException
-  {
-    return super.clone();
-  }
-
-}
diff --git a/src/org/apache/xml/utils/CharKey.java b/src/org/apache/xml/utils/CharKey.java
deleted file mode 100644
index a839f8a..0000000
--- a/src/org/apache/xml/utils/CharKey.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * Simple class for fast lookup of char values, when used with
- * hashtables.  You can set the char, then use it as a key.
- */
-public class CharKey extends Object
-{
-
-  /** String value          */
-  private char m_char;
-
-  /**
-   * Constructor CharKey
-   *
-   * @param key char value of this object.
-   */
-  public CharKey(char key)
-  {
-    m_char = key;
-  }
-  
-  /**
-   * Default constructor for a CharKey.
-   *
-   * @param key char value of this object.
-   */
-  public CharKey()
-  {
-  }
-  
-  /**
-   * Get the hash value of the character.  
-   *
-   * @return hash value of the character.
-   */
-  public final void setChar(char c)
-  {
-    m_char = c;
-  }
-
-
-
-  /**
-   * Get the hash value of the character.  
-   *
-   * @return hash value of the character.
-   */
-  public final int hashCode()
-  {
-    return (int)m_char;
-  }
-
-  /**
-   * Override of equals() for this object 
-   *
-   * @param obj to compare to
-   *
-   * @return True if this object equals this string value 
-   */
-  public final boolean equals(Object obj)
-  {
-    return ((CharKey)obj).m_char == m_char;
-  }
-}
\ No newline at end of file
diff --git a/src/org/apache/xml/utils/DOMBuilder.java b/src/org/apache/xml/utils/DOMBuilder.java
deleted file mode 100644
index e0f7645..0000000
--- a/src/org/apache/xml/utils/DOMBuilder.java
+++ /dev/null
@@ -1,756 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xml.utils.NodeVector;
-import java.util.Stack;
-
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-
-import org.w3c.dom.*;  // we pretty much use everything in the DOM here.
-
-/**
- * <meta name="usage" content="general"/>
- * This class takes SAX events (in addition to some extra events
- * that SAX doesn't handle yet) and adds the result to a document
- * or document fragment.
- */
-public class DOMBuilder
-        implements ContentHandler, LexicalHandler
-{
-
-  /** Root document          */
-  public Document m_doc;
-
-  /** Current node           */
-  protected Node m_currentNode = null;
-
-  /** First node of document fragment or null if not a DocumentFragment     */
-  public DocumentFragment m_docFrag = null;
-
-  /** Vector of element nodes          */
-  protected Stack m_elemStack = new Stack();
-
-  /**
-   * DOMBuilder instance constructor... it will add the DOM nodes
-   * to the document fragment.
-   *
-   * @param doc Root document
-   * @param node Current node
-   */
-  public DOMBuilder(Document doc, Node node)
-  {
-    m_doc = doc;
-    m_currentNode = node;
-  }
-
-  /**
-   * DOMBuilder instance constructor... it will add the DOM nodes
-   * to the document fragment.
-   *
-   * @param doc Root document
-   * @param docFrag Document fragment
-   */
-  public DOMBuilder(Document doc, DocumentFragment docFrag)
-  {
-    m_doc = doc;
-    m_docFrag = docFrag;
-  }
-
-  /**
-   * DOMBuilder instance constructor... it will add the DOM nodes
-   * to the document.
-   *
-   * @param doc Root document
-   */
-  public DOMBuilder(Document doc)
-  {
-    m_doc = doc;
-  }
-
-  /**
-   * Get the root node of the DOM being created.  This
-   * is either a Document or a DocumentFragment.
-   *
-   * @return The root document or document fragment if not null
-   */
-  public Node getRootNode()
-  {
-    return (null != m_docFrag) ? (Node) m_docFrag : (Node) m_doc;
-  }
-
-  /**
-   * Get the node currently being processed.
-   *
-   * @return the current node being processed
-   */
-  public Node getCurrentNode()
-  {
-    return m_currentNode;
-  }
-
-  /**
-   * Return null since there is no Writer for this class.
-   *
-   * @return null
-   */
-  public java.io.Writer getWriter()
-  {
-    return null;
-  }
-
-  /**
-   * Append a node to the current container.
-   *
-   * @param newNode New node to append
-   */
-  protected void append(Node newNode) throws org.xml.sax.SAXException
-  {
-
-    Node currentNode = m_currentNode;
-
-    if (null != currentNode)
-    {
-      currentNode.appendChild(newNode);
-
-      // System.out.println(newNode.getNodeName());
-    }
-    else if (null != m_docFrag)
-    {
-      m_docFrag.appendChild(newNode);
-    }
-    else
-    {
-      boolean ok = true;
-      short type = newNode.getNodeType();
-
-      if (type == Node.TEXT_NODE)
-      {
-        String data = newNode.getNodeValue();
-
-        if ((null != data) && (data.trim().length() > 0))
-        {
-          throw new org.xml.sax.SAXException(
-            XSLMessages.createXPATHMessage(
-              XPATHErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null));  //"Warning: can't output text before document element!  Ignoring...");
-        }
-
-        ok = false;
-      }
-      else if (type == Node.ELEMENT_NODE)
-      {
-        if (m_doc.getDocumentElement() != null)
-        {
-          throw new org.xml.sax.SAXException(
-            XSLMessages.createXPATHMessage(
-              XPATHErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null));  //"Can't have more than one root on a DOM!");
-        }
-      }
-
-      if (ok)
-        m_doc.appendChild(newNode);
-    }
-  }
-
-  /**
-   * Receive an object for locating the origin of SAX document events.
-   *
-   * <p>SAX parsers are strongly encouraged (though not absolutely
-   * required) to supply a locator: if it does so, it must supply
-   * the locator to the application by invoking this method before
-   * invoking any of the other methods in the ContentHandler
-   * interface.</p>
-   *
-   * <p>The locator allows the application to determine the end
-   * position of any document-related event, even if the parser is
-   * not reporting an error.  Typically, the application will
-   * use this information for reporting its own errors (such as
-   * character content that does not match an application's
-   * business rules).  The information returned by the locator
-   * is probably not sufficient for use with a search engine.</p>
-   *
-   * <p>Note that the locator will return correct information only
-   * during the invocation of the events in this interface.  The
-   * application should not attempt to use it at any other time.</p>
-   *
-   * @param locator An object that can return the location of
-   *                any SAX document event.
-   * @see org.xml.sax.Locator
-   */
-  public void setDocumentLocator(Locator locator)
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of the beginning of a document.
-   *
-   * <p>The SAX parser will invoke this method only once, before any
-   * other methods in this interface or in DTDHandler (except for
-   * setDocumentLocator).</p>
-   */
-  public void startDocument() throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of the end of a document.
-   *
-   * <p>The SAX parser will invoke this method only once, and it will
-   * be the last method invoked during the parse.  The parser shall
-   * not invoke this method until it has either abandoned parsing
-   * (because of an unrecoverable error) or reached the end of
-   * input.</p>
-   */
-  public void endDocument() throws org.xml.sax.SAXException
-  {
-
-    // No action for the moment.
-  }
-
-  /**
-   * Receive notification of the beginning of an element.
-   *
-   * <p>The Parser will invoke this method at the beginning of every
-   * element in the XML document; there will be a corresponding
-   * endElement() event for every startElement() event (even when the
-   * element is empty). All of the element's content will be
-   * reported, in order, before the corresponding endElement()
-   * event.</p>
-   *
-   * <p>If the element name has a namespace prefix, the prefix will
-   * still be attached.  Note that the attribute list provided will
-   * contain only attributes with explicit values (specified or
-   * defaulted): #IMPLIED attributes will be omitted.</p>
-   *
-   *
-   * @param ns The namespace of the node
-   * @param localName The local part of the qualified name 
-   * @param name The element name.
-   * @param atts The attributes attached to the element, if any.
-   * @see #endElement
-   * @see org.xml.sax.Attributes
-   */
-  public void startElement(
-          String ns, String localName, String name, Attributes atts)
-            throws org.xml.sax.SAXException
-  {
-
-    Element elem;
-
-    if ((null == ns) || (ns.length() == 0))
-      elem = m_doc.createElement(name);
-    else
-      elem = m_doc.createElementNS(ns, name);
-
-    append(elem);
-
-    try
-    {
-      int nAtts = atts.getLength();
-  
-      if (0 != nAtts)
-      {
-        for (int i = 0; i < nAtts; i++)
-        {
-  
-          //System.out.println("type " + atts.getType(i) + " name " + atts.getLocalName(i) );
-          // First handle a possible ID attribute
-          if (atts.getType(i).equalsIgnoreCase("ID"))
-            setIDAttribute(atts.getValue(i), elem);
-  
-          String attrNS = atts.getURI(i);
-          
-          if(attrNS == null)
-            attrNS = ""; // defensive, shouldn't have to do this.
-  
-          // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i)
-          //                   +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i));
-          // Crimson won't let us set an xmlns: attribute on the DOM.
-          String attrQName = atts.getQName(i);
-          if ((attrNS.length() == 0) /* || attrQName.startsWith("xmlns:") || attrQName.equals("xmlns") */)
-            elem.setAttribute(attrQName, atts.getValue(i));
-          else
-          {
-  
-            // elem.setAttributeNS(atts.getURI(i), atts.getLocalName(i), atts.getValue(i));
-            elem.setAttributeNS(attrNS, attrQName, atts.getValue(i));
-          }
-        }
-      }
-      
-      // append(elem);
-  
-      m_elemStack.push(elem);
-  
-      m_currentNode = elem;
-      
-      // append(elem);
-    }
-    catch(java.lang.Exception de)
-    {
-      // de.printStackTrace();
-      throw new org.xml.sax.SAXException(de);
-    }
-    
-  }
-
-  /**
-   * Receive notification of the end of an element.
-   *
-   * <p>The SAX parser will invoke this method at the end of every
-   * element in the XML document; there will be a corresponding
-   * startElement() event for every endElement() event (even when the
-   * element is empty).</p>
-   *
-   * <p>If the element name has a namespace prefix, the prefix will
-   * still be attached to the name.</p>
-   *
-   *
-   * @param ns the namespace of the element
-   * @param localName The local part of the qualified name of the element
-   * @param name The element name
-   */
-  public void endElement(String ns, String localName, String name)
-          throws org.xml.sax.SAXException
-  {
-    m_elemStack.pop();
-    m_currentNode = m_elemStack.isEmpty() ? null : (Node)m_elemStack.peek();
-  }
-
-  /**
-   * Set an ID string to node association in the ID table.
-   *
-   * @param id The ID string.
-   * @param elem The associated ID.
-   */
-  public void setIDAttribute(String id, Element elem)
-  {
-
-    // Do nothing. This method is meant to be overiden.
-  }
-
-  /**
-   * Receive notification of character data.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   */
-  public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException
-  {
-    if(isOutsideDocElem()
-       && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
-      return;  // avoid DOM006 Hierarchy request error
-
-    if (m_inCData)
-    {
-      cdata(ch, start, length);
-
-      return;
-    }
-
-    String s = new String(ch, start, length);
-    Text text = m_doc.createTextNode(s);
-
-    append(text);
-  }
-
-  /**
-   * If available, when the disable-output-escaping attribute is used,
-   * output raw text without escaping.  A PI will be inserted in front
-   * of the node with the name "lotusxsl-next-is-raw" and a value of
-   * "formatter-to-dom".
-   *
-   * @param ch Array containing the characters
-   * @param start Index to start of characters in the array
-   * @param length Number of characters in the array 
-   */
-  public void charactersRaw(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-    if(isOutsideDocElem()  
-       && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
-      return;  // avoid DOM006 Hierarchy request error
-
-
-    String s = new String(ch, start, length);
-
-    append(m_doc.createProcessingInstruction("xslt-next-is-raw",
-                                             "formatter-to-dom"));
-    append(m_doc.createTextNode(s));
-  }
-
-  /**
-   * Report the beginning of an entity.
-   *
-   * The start and end of the document entity are not reported.
-   * The start and end of the external DTD subset are reported
-   * using the pseudo-name "[dtd]".  All other events must be
-   * properly nested within start/end entity events.
-   *
-   * @param name The name of the entity.  If it is a parameter
-   *        entity, the name will begin with '%'.
-   * @see #endEntity
-   * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
-   * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
-   */
-  public void startEntity(String name) throws org.xml.sax.SAXException
-  {
-
-    // Almost certainly the wrong behavior...
-    // entityReference(name);
-  }
-
-  /**
-   * Report the end of an entity.
-   *
-   * @param name The name of the entity that is ending.
-   * @see #startEntity
-   */
-  public void endEntity(String name) throws org.xml.sax.SAXException{}
-
-  /**
-   * Receive notivication of a entityReference.
-   *
-   * @param name name of the entity reference
-   */
-  public void entityReference(String name) throws org.xml.sax.SAXException
-  {
-    append(m_doc.createEntityReference(name));
-  }
-
-  /**
-   * Receive notification of ignorable whitespace in element content.
-   *
-   * <p>Validating Parsers must use this method to report each chunk
-   * of ignorable whitespace (see the W3C XML 1.0 recommendation,
-   * section 2.10): non-validating parsers may also use this method
-   * if they are capable of parsing and using content models.</p>
-   *
-   * <p>SAX parsers may return all contiguous whitespace in a single
-   * chunk, or they may split it into several chunks; however, all of
-   * the characters in any single event must come from the same
-   * external entity, so that the Locator provides useful
-   * information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @see #characters
-   */
-  public void ignorableWhitespace(char ch[], int start, int length)
-          throws org.xml.sax.SAXException
-  {
-    if(isOutsideDocElem())
-      return;  // avoid DOM006 Hierarchy request error
-
-    String s = new String(ch, start, length);
-
-    append(m_doc.createTextNode(s));
-  }
-  
-  /**
-   * Tell if the current node is outside the document element.
-   * 
-   * @return true if the current node is outside the document element.
-   */
-   private boolean isOutsideDocElem()
-   {
-      return (null == m_docFrag) && m_elemStack.size() == 0 && (null == m_currentNode || m_currentNode.getNodeType() == Node.DOCUMENT_NODE);
-   }
-
-  /**
-   * Receive notification of a processing instruction.
-   *
-   * <p>The Parser will invoke this method once for each processing
-   * instruction found: note that processing instructions may occur
-   * before or after the main document element.</p>
-   *
-   * <p>A SAX parser should never report an XML declaration (XML 1.0,
-   * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
-   * using this method.</p>
-   *
-   * @param target The processing instruction target.
-   * @param data The processing instruction data, or null if
-   *        none was supplied.
-   */
-  public void processingInstruction(String target, String data)
-          throws org.xml.sax.SAXException
-  {
-    append(m_doc.createProcessingInstruction(target, data));
-  }
-
-  /**
-   * Report an XML comment anywhere in the document.
-   *
-   * This callback will be used for comments inside or outside the
-   * document element, including comments in the external DTD
-   * subset (if read).
-   *
-   * @param ch An array holding the characters in the comment.
-   * @param start The starting position in the array.
-   * @param length The number of characters to use from the array.
-   */
-  public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException
-  {
-    append(m_doc.createComment(new String(ch, start, length)));
-  }
-
-  /** Flag indicating that we are processing a CData section          */
-  protected boolean m_inCData = false;
-
-  /**
-   * Report the start of a CDATA section.
-   *
-   * @see #endCDATA
-   */
-  public void startCDATA() throws org.xml.sax.SAXException
-  {
-    m_inCData = true;
-  }
-
-  /**
-   * Report the end of a CDATA section.
-   *
-   * @see #startCDATA
-   */
-  public void endCDATA() throws org.xml.sax.SAXException
-  {
-    m_inCData = false;
-  }
-
-  /**
-   * Receive notification of cdata.
-   *
-   * <p>The Parser will call this method to report each chunk of
-   * character data.  SAX parsers may return all contiguous character
-   * data in a single chunk, or they may split it into several
-   * chunks; however, all of the characters in any single event
-   * must come from the same external entity, so that the Locator
-   * provides useful information.</p>
-   *
-   * <p>The application must not attempt to read from the array
-   * outside of the specified range.</p>
-   *
-   * <p>Note that some parsers will report whitespace using the
-   * ignorableWhitespace() method rather than this one (validating
-   * parsers must do so).</p>
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * @see #ignorableWhitespace
-   * @see org.xml.sax.Locator
-   */
-  public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException
-  {
-    if(isOutsideDocElem()  
-       && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
-      return;  // avoid DOM006 Hierarchy request error
-
-    String s = new String(ch, start, length);
-
-    append(m_doc.createCDATASection(s));
-  }
-
-  /**
-   * Report the start of DTD declarations, if any.
-   *
-   * Any declarations are assumed to be in the internal subset
-   * unless otherwise indicated.
-   *
-   * @param name The document type name.
-   * @param publicId The declared public identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @param systemId The declared system identifier for the
-   *        external DTD subset, or null if none was declared.
-   * @see #endDTD
-   * @see #startEntity
-   */
-  public void startDTD(String name, String publicId, String systemId)
-          throws org.xml.sax.SAXException
-  {
-
-    // Do nothing for now.
-  }
-
-  /**
-   * Report the end of DTD declarations.
-   *
-   * @see #startDTD
-   */
-  public void endDTD() throws org.xml.sax.SAXException
-  {
-
-    // Do nothing for now.
-  }
-
-  /**
-   * Begin the scope of a prefix-URI Namespace mapping.
-   *
-   * <p>The information from this event is not necessary for
-   * normal Namespace processing: the SAX XML reader will
-   * automatically replace prefixes for element and attribute
-   * names when the http://xml.org/sax/features/namespaces
-   * feature is true (the default).</p>
-   *
-   * <p>There are cases, however, when applications need to
-   * use prefixes in character data or in attribute values,
-   * where they cannot safely be expanded automatically; the
-   * start/endPrefixMapping event supplies the information
-   * to the application to expand prefixes in those contexts
-   * itself, if necessary.</p>
-   *
-   * <p>Note that start/endPrefixMapping events are not
-   * guaranteed to be properly nested relative to each-other:
-   * all startPrefixMapping events will occur before the
-   * corresponding startElement event, and all endPrefixMapping
-   * events will occur after the corresponding endElement event,
-   * but their order is not guaranteed.</p>
-   *
-   * @param prefix The Namespace prefix being declared.
-   * @param uri The Namespace URI the prefix is mapped to.
-   * @see #endPrefixMapping
-   * @see #startElement
-   */
-  public void startPrefixMapping(String prefix, String uri)
-          throws org.xml.sax.SAXException
-  {
-
-    /*
-    // Not sure if this is needed or wanted
-    // Also, it fails in the stree.
-    if((null != m_currentNode)
-       && (m_currentNode.getNodeType() == Node.ELEMENT_NODE))
-    {
-      String qname;
-      if(((null != prefix) && (prefix.length() == 0))
-         || (null == prefix))
-        qname = "xmlns";
-      else
-        qname = "xmlns:"+prefix;
-
-      Element elem = (Element)m_currentNode;
-      String val = elem.getAttribute(qname);
-      if(val == null)
-      {
-        elem.setAttributeNS("http://www.w3.org/XML/1998/namespace",
-                            qname, uri);
-      }
-    }
-    */
-  }
-
-  /**
-   * End the scope of a prefix-URI mapping.
-   *
-   * <p>See startPrefixMapping for details.  This event will
-   * always occur after the corresponding endElement event,
-   * but the order of endPrefixMapping events is not otherwise
-   * guaranteed.</p>
-   *
-   * @param prefix The prefix that was being mapping.
-   * @see #startPrefixMapping
-   * @see #endElement
-   */
-  public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException{}
-
-  /**
-   * Receive notification of a skipped entity.
-   *
-   * <p>The Parser will invoke this method once for each entity
-   * skipped.  Non-validating processors may skip entities if they
-   * have not seen the declarations (because, for example, the
-   * entity was declared in an external DTD subset).  All processors
-   * may skip external entities, depending on the values of the
-   * http://xml.org/sax/features/external-general-entities and the
-   * http://xml.org/sax/features/external-parameter-entities
-   * properties.</p>
-   *
-   * @param name The name of the skipped entity.  If it is a
-   *        parameter entity, the name will begin with '%'.
-   */
-  public void skippedEntity(String name) throws org.xml.sax.SAXException{}
-}
diff --git a/src/org/apache/xml/utils/DefaultErrorHandler.java b/src/org/apache/xml/utils/DefaultErrorHandler.java
deleted file mode 100644
index c6caaab..0000000
--- a/src/org/apache/xml/utils/DefaultErrorHandler.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.xml.sax.*;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.SourceLocator;
-import java.io.PrintWriter;
-import java.io.PrintStream;
-
-
-/**
- * <meta name="usage" content="general"/>
- * Implement SAX error handler for default reporting.
- */
-public class DefaultErrorHandler implements ErrorHandler, ErrorListener
-{
-  PrintWriter m_pw;
-
-  /**
-   * Constructor DefaultErrorHandler
-   */
-  public DefaultErrorHandler(PrintWriter pw)
-  {
-    m_pw = pw;
-  }
-  
-  /**
-   * Constructor DefaultErrorHandler
-   */
-  public DefaultErrorHandler(PrintStream pw)
-  {
-    m_pw = new PrintWriter(pw, true);
-  }
-  
-  /**
-   * Constructor DefaultErrorHandler
-   */
-  public DefaultErrorHandler()
-  {
-    m_pw = new PrintWriter(System.err, true);
-  }
-
-
-  /**
-   * Receive notification of a warning.
-   *
-   * <p>SAX parsers will use this method to report conditions that
-   * are not errors or fatal errors as defined by the XML 1.0
-   * recommendation.  The default behaviour is to take no action.</p>
-   *
-   * <p>The SAX parser must continue to provide normal parsing events
-   * after invoking this method: it should still be possible for the
-   * application to process the document through to the end.</p>
-   *
-   * @param exception The warning information encapsulated in a
-   *                  SAX parse exception.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void warning(SAXParseException exception) throws SAXException
-  {
-    printLocation(m_pw, exception);
-    m_pw.println("Parser warning: " + exception.getMessage());
-  }
-
-  /**
-   * Receive notification of a recoverable error.
-   *
-   * <p>This corresponds to the definition of "error" in section 1.2
-   * of the W3C XML 1.0 Recommendation.  For example, a validating
-   * parser would use this callback to report the violation of a
-   * validity constraint.  The default behaviour is to take no
-   * action.</p>
-   *
-   * <p>The SAX parser must continue to provide normal parsing events
-   * after invoking this method: it should still be possible for the
-   * application to process the document through to the end.  If the
-   * application cannot do so, then the parser should report a fatal
-   * error even if the XML 1.0 recommendation does not require it to
-   * do so.</p>
-   *
-   * @param exception The error information encapsulated in a
-   *                  SAX parse exception.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void error(SAXParseException exception) throws SAXException
-  {
-    // printLocation(exception);
-    // m_pw.println(exception.getMessage());
-
-    throw exception;
-  }
-
-  /**
-   * Receive notification of a non-recoverable error.
-   *
-   * <p>This corresponds to the definition of "fatal error" in
-   * section 1.2 of the W3C XML 1.0 Recommendation.  For example, a
-   * parser would use this callback to report the violation of a
-   * well-formedness constraint.</p>
-   *
-   * <p>The application must assume that the document is unusable
-   * after the parser has invoked this method, and should continue
-   * (if at all) only for the sake of collecting addition error
-   * messages: in fact, SAX parsers are free to stop reporting any
-   * other events once this method has been invoked.</p>
-   *
-   * @param exception The error information encapsulated in a
-   *                  SAX parse exception.
-   * @throws SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public void fatalError(SAXParseException exception) throws SAXException
-  {
-    // printLocation(exception);
-    // m_pw.println(exception.getMessage());
-
-    throw exception;
-  }
-  
-  /**
-   * Receive notification of a warning.
-   *
-   * <p>SAX parsers will use this method to report conditions that
-   * are not errors or fatal errors as defined by the XML 1.0
-   * recommendation.  The default behaviour is to take no action.</p>
-   *
-   * <p>The SAX parser must continue to provide normal parsing events
-   * after invoking this method: it should still be possible for the
-   * application to process the document through to the end.</p>
-   *
-   * @param exception The warning information encapsulated in a
-   *                  SAX parse exception.
-   * @throws javax.xml.transform.TransformerException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see javax.xml.transform.TransformerException
-   */
-  public void warning(TransformerException exception) throws TransformerException
-  {
-    printLocation(m_pw, exception);
-
-    m_pw.println(exception.getMessage());
-  }
-
-  /**
-   * Receive notification of a recoverable error.
-   *
-   * <p>This corresponds to the definition of "error" in section 1.2
-   * of the W3C XML 1.0 Recommendation.  For example, a validating
-   * parser would use this callback to report the violation of a
-   * validity constraint.  The default behaviour is to take no
-   * action.</p>
-   *
-   * <p>The SAX parser must continue to provide normal parsing events
-   * after invoking this method: it should still be possible for the
-   * application to process the document through to the end.  If the
-   * application cannot do so, then the parser should report a fatal
-   * error even if the XML 1.0 recommendation does not require it to
-   * do so.</p>
-   *
-   * @param exception The error information encapsulated in a
-   *                  SAX parse exception.
-   * @throws javax.xml.transform.TransformerException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see javax.xml.transform.TransformerException
-   */
-  public void error(TransformerException exception) throws TransformerException
-  {
-    // printLocation(exception);
-    // ensureLocationSet(exception);
-
-    throw exception;
-  }
-
-  /**
-   * Receive notification of a non-recoverable error.
-   *
-   * <p>This corresponds to the definition of "fatal error" in
-   * section 1.2 of the W3C XML 1.0 Recommendation.  For example, a
-   * parser would use this callback to report the violation of a
-   * well-formedness constraint.</p>
-   *
-   * <p>The application must assume that the document is unusable
-   * after the parser has invoked this method, and should continue
-   * (if at all) only for the sake of collecting addition error
-   * messages: in fact, SAX parsers are free to stop reporting any
-   * other events once this method has been invoked.</p>
-   *
-   * @param exception The error information encapsulated in a
-   *                  SAX parse exception.
-   * @throws javax.xml.transform.TransformerException Any SAX exception, possibly
-   *            wrapping another exception.
-   * @see javax.xml.transform.TransformerException
-   */
-  public void fatalError(TransformerException exception) throws TransformerException
-  {
-    // printLocation(exception);
-    // ensureLocationSet(exception);
-
-    throw exception;
-  }
-  
-  public static void ensureLocationSet(TransformerException exception)
-  {
-    // SourceLocator locator = exception.getLocator();
-    SourceLocator locator = null;
-    Throwable cause = exception;
-    
-    // Try to find the locator closest to the cause.
-    do
-    {
-      if(cause instanceof SAXParseException)
-      {
-        locator = new SAXSourceLocator((SAXParseException)cause);
-      }
-      else if (cause instanceof TransformerException)
-      {
-        SourceLocator causeLocator = ((TransformerException)cause).getLocator();
-        if(null != causeLocator)
-          locator = causeLocator;
-      }
-      
-      if(cause instanceof TransformerException)
-        cause = ((TransformerException)cause).getCause();
-      else if(cause instanceof SAXException)
-        cause = ((SAXException)cause).getException();
-      else
-        cause = null;
-    }
-    while(null != cause);
-    
-    exception.setLocator(locator);
-  }
-  
-  public static void printLocation(PrintStream pw, TransformerException exception)
-  {
-    printLocation(new PrintWriter(pw), exception);
-  }
-  
-  public static void printLocation(PrintWriter pw, Throwable exception)
-  {
-    SourceLocator locator = null;
-    Throwable cause = exception;
-    
-    // Try to find the locator closest to the cause.
-    do
-    {
-      if(cause instanceof SAXParseException)
-      {
-        locator = new SAXSourceLocator((SAXParseException)cause);
-      }
-      else if (cause instanceof TransformerException)
-      {
-        SourceLocator causeLocator = ((TransformerException)cause).getLocator();
-        if(null != causeLocator)
-          locator = causeLocator;
-      }
-      if(cause instanceof TransformerException)
-        cause = ((TransformerException)cause).getCause();
-      else if(cause instanceof WrappedRuntimeException)
-        cause = ((WrappedRuntimeException)cause).getException();
-      else if(cause instanceof SAXException)
-        cause = ((SAXException)cause).getException();
-      else
-        cause = null;
-    }
-    while(null != cause);
-        
-    if(null != locator)
-    {
-      // m_pw.println("Parser fatal error: "+exception.getMessage());
-      String id = (locator.getPublicId() != locator.getPublicId())
-                  ? locator.getPublicId()
-                    : (null != locator.getSystemId())
-                      ? locator.getSystemId() : "SystemId Unknown";
-
-      pw.print(id + "; Line " + locator.getLineNumber()
-                         + "; Column " + locator.getColumnNumber()+"; ");
-    }
-    else
-      pw.print("(Location of error unknown)");
-  }
-}
diff --git a/src/org/apache/xml/utils/ElemDesc.java b/src/org/apache/xml/utils/ElemDesc.java
deleted file mode 100644
index 4d2a3fe..0000000
--- a/src/org/apache/xml/utils/ElemDesc.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.Hashtable;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class is in support of SerializerToHTML, and acts as a sort
- * of element representative for HTML elements.
- */
-class ElemDesc
-{
-
-  /** Table of attributes for the element */
-  Hashtable m_attrs = null;
-
-  /** Element's flags, describing the role this element plays during
-   * formatting of the document. This is used as a bitvector; more than one flag
-   * may be set at a time, bitwise-ORed together. Mnemonic and bits
-   * have been assigned to the flag values. NOTE: Some bits are
-   * currently assigned multiple mnemonics; it is the caller's
-   * responsibility to disambiguate these if necessary. */
-  int m_flags;
-
-  /** Defines mnemonic and bit-value for the EMPTY flag */
-  static final int EMPTY = (1 << 1);
-
-  /** Defines mnemonic and bit-value for the FLOW flag  */
-  static final int FLOW = (1 << 2);
-
-  /** Defines mnemonic and bit-value for the BLOCK flag          */
-  static final int BLOCK = (1 << 3);
-
-  /** Defines mnemonic and bit-value for the BLOCKFORM  flag         */
-  static final int BLOCKFORM = (1 << 4);
-
-  /** Defines mnemonic and bit-value for the BLOCKFORMFIELDSET flag          */
-  static final int BLOCKFORMFIELDSET = (1 << 5);
-
-  /** Defines mnemonic and bit-value for the CDATA flag         */
-  static final int CDATA = (1 << 6);
-
-  /** Defines mnemonic and bit-value for the PCDATA flag          */
-  static final int PCDATA = (1 << 7);
-
-  /** Defines mnemonic and bit-value for the RAW flag         */
-  static final int RAW = (1 << 8);
-
-  /** Defines mnemonic and bit-value for the INLINE flag          */
-  static final int INLINE = (1 << 9);
-
-  /** Defines mnemonic and bit-value for the INLINEA flag          */
-  static final int INLINEA = (1 << 10);
-
-  /** Defines mnemonic and bit-value for the INLINELABEL flag          */
-  static final int INLINELABEL = (1 << 11);
-
-  /** Defines mnemonic and bit-value for the FONTSTYLE flag          */
-  static final int FONTSTYLE = (1 << 12);
-
-  /** Defines mnemonic and bit-value for the PHRASE flag          */
-  static final int PHRASE = (1 << 13);
-
-  /** Defines mnemonic and bit-value for the FORMCTRL flag         */
-  static final int FORMCTRL = (1 << 14);
-
-  /** Defines mnemonic and bit-value for the SPECIAL flag         */
-  static final int SPECIAL = (1 << 15);
-
-  /** Defines mnemonic and bit-value for the ASPECIAL flag         */
-  static final int ASPECIAL = (1 << 16);
-
-  /** Defines mnemonic and bit-value for the HEADMISC flag         */
-  static final int HEADMISC = (1 << 17);
-
-  /** Defines mnemonic and bit-value for the HEAD flag         */
-  static final int HEAD = (1 << 18);
-
-  /** Defines mnemonic and bit-value for the LIST flag         */
-  static final int LIST = (1 << 19);
-
-  /** Defines mnemonic and bit-value for the PREFORMATTED flag         */
-  static final int PREFORMATTED = (1 << 20);
-
-  /** Defines mnemonic and bit-value for the WHITESPACESENSITIVE flag         */
-  static final int WHITESPACESENSITIVE = (1 << 21);
-
-  /** Defines mnemonic and bit-value for the ATTRURL flag         */
-  static final int ATTRURL = (1 << 1);
-
-  /** Defines mnemonic and bit-value for the ATTREMPTY flag         */
-  static final int ATTREMPTY = (1 << 2);
-
-  /**
-   * Construct an ElementDescription with an initial set of flags.
-   *
-   * @param flags Element flags
-   * @see m_flags
-   */
-  ElemDesc(int flags)
-  {
-    m_flags = flags;
-  }
-
-  /**
-   * "is (this element described by these flags)".
-   * 
-   * This might more properly be called areFlagsSet(). It accepts an
-   * integer (being used as a bitvector) and checks whether all the 
-   * corresponding bits are set in our internal flags. Note that this
-   * test is performed as a bitwise AND, not an equality test, so a
-   * 0 bit in the input means "don't test", not "must be set false".
-   *
-   * @param flags Vector of flags to compare against this element's flags
-   *
-   * @return true if the flags set in the parameter are also set in the
-   * element's stored flags.
-   * 
-   * @see m_flags
-   * @see isAttrFlagSet
-   */
-  boolean is(int flags)
-  {
-    // int which = (m_flags & flags);
-    return (m_flags & flags) != 0;
-  }
-
-  /**
-   * Set a new attribute for this element 
-   *
-   *
-   * @param name Attribute name
-   * @param flags Attibute flags
-   */
-  void setAttr(String name, int flags)
-  {
-
-    if (null == m_attrs)
-      m_attrs = new Hashtable();
-
-    m_attrs.put(name, new Integer(flags));
-  }
-
-  /**
-   * Find out if a flag is set in a given attribute of this element 
-   *
-   *
-   * @param name Attribute name
-   * @param flags Flag to check
-   *
-   * @return True if the flag is set in the attribute. Returns false
-   * if the attribute is not found 
-   * @see m_flags
-   */
-  boolean isAttrFlagSet(String name, int flags)
-  {
-
-    if (null != m_attrs)
-    {
-      Integer _flags = (Integer) m_attrs.get(name);
-
-      if (null != _flags)
-      {
-        return (_flags.intValue() & flags) != 0;
-      }
-    }
-
-    return false;
-  }
-}
diff --git a/src/org/apache/xml/utils/FastStringBuffer.java b/src/org/apache/xml/utils/FastStringBuffer.java
deleted file mode 100644
index b10a93e..0000000
--- a/src/org/apache/xml/utils/FastStringBuffer.java
+++ /dev/null
@@ -1,1206 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * Bare-bones, unsafe, fast string buffer. No thread-safety, no
- * parameter range checking, exposed fields. Note that in typical
- * applications, thread-safety of a StringBuffer is a somewhat
- * dubious concept in any case.
- * <p>
- * Note that Stree is using a single FastStringBuffer as a string pool,
- * by recording start and length indices within a single buffer. This
- * minimizes heap overhead, but of course requires more work when retrieving
- * the data.
- * <p>
- * This has been recoded to operate as a "chunked buffer". Doing so
- * reduces the need to recopy existing information when an append
- * exceeds the space available; we just allocate another chunk and
- * flow across to it. (The array of chunks may need to grow,
- * admittedly, but that's a much smaller object.) Some excess
- * recopying may arise when we extract Strings which cross chunk
- * boundaries; larger chunks make that less frequent.
- * <p>
- * The size values are parameterized, to allow tuning this code. In
- * theory, RTFs might want to be tuned differently from the main
- * document's text.
- * <p>
- */
-public class FastStringBuffer
-{
-  // If nonzero, forces the inial chunk size.
-  /**/static final int DEBUG_FORCE_INIT_BITS=0;
-
-  /**
-   * Field m_chunkBits sets our chunking strategy, by saying how many
-   * bits of index can be used within a single chunk before flowing over
-   * to the next chunk. For example, if m_chunkbits is set to 15, each
-   * chunk can contain up to 2^15 (32K) characters  
-   */
-  int m_chunkBits = 15;
-
-  /**
-   * Field m_maxChunkBits affects our chunk-growth strategy, by saying what
-   * the largest permissible chunk size is in this particular FastStringBuffer
-   * hierarchy. 
-   */
-  int m_maxChunkBits = 15;
-
-  /**
-   * Field m_rechunkBits affects our chunk-growth strategy, by saying how
-   * many chunks should be allocated at one size before we encapsulate them
-   * into the first chunk of the next size up. For example, if m_rechunkBits
-   * is set to 3, then after 8 chunks at a given size we will rebundle
-   * them as the first element of a FastStringBuffer using a chunk size
-   * 8 times larger (chunkBits shifted left three bits).
-   */
-  int m_rebundleBits = 2;
-
-  /**
-   * Field m_chunkSize establishes the maximum size of one chunk of the array
-   * as 2**chunkbits characters.
-   * (Which may also be the minimum size if we aren't tuning for storage) 
-   */
-  int m_chunkSize;  // =1<<(m_chunkBits-1);
-
-  /**
-   * Field m_chunkMask is m_chunkSize-1 -- in other words, m_chunkBits
-   * worth of low-order '1' bits, useful for shift-and-mask addressing
-   * within the chunks. 
-   */
-  int m_chunkMask;  // =m_chunkSize-1;
-
-  /**
-   * Field m_array holds the string buffer's text contents, using an
-   * array-of-arrays. Note that this array, and the arrays it contains, may be
-   * reallocated when necessary in order to allow the buffer to grow;
-   * references to them should be considered to be invalidated after any
-   * append. However, the only time these arrays are directly exposed
-   * is in the sendSAXcharacters call.
-   */
-  char[][] m_array;
-
-  /**
-   * Field m_lastChunk is an index into m_array[], pointing to the last
-   * chunk of the Chunked Array currently in use. Note that additional
-   * chunks may actually be allocated, eg if the FastStringBuffer had
-   * previously been truncated or if someone issued an ensureSpace request.
-   * <p>
-   * The insertion point for append operations is addressed by the combination
-   * of m_lastChunk and m_firstFree.
-   */
-  int m_lastChunk = 0;
-
-  /**
-   * Field m_firstFree is an index into m_array[m_lastChunk][], pointing to
-   * the first character in the Chunked Array which is not part of the
-   * FastStringBuffer's current content. Since m_array[][] is zero-based,
-   * the length of that content can be calculated as
-   * (m_lastChunk<<m_chunkBits) + m_firstFree 
-   */
-  int m_firstFree = 0;
-
-  /**
-   * Field m_innerFSB, when non-null, is a FastStringBuffer whose total
-   * length equals m_chunkSize, and which replaces m_array[0]. This allows
-   * building a hierarchy of FastStringBuffers, where early appends use
-   * a smaller chunkSize (for less wasted memory overhead) but later
-   * ones use a larger chunkSize (for less heap activity overhead).
-   */
-  FastStringBuffer m_innerFSB = null;
-
-  /**
-   * Construct a FastStringBuffer, with allocation policy as per parameters.
-   * <p>
-   * For coding convenience, I've expressed both allocation sizes in terms of
-   * a number of bits. That's needed for the final size of a chunk,
-   * to permit fast and efficient shift-and-mask addressing. It's less critical
-   * for the inital size, and may be reconsidered.
-   * <p>
-   * An alternative would be to accept integer sizes and round to powers of two;
-   * that really doesn't seem to buy us much, if anything.
-   *
-   * @param initChunkBits Length in characters of the initial allocation
-   * of a chunk, expressed in log-base-2. (That is, 10 means allocate 1024
-   * characters.) Later chunks will use larger allocation units, to trade off
-   * allocation speed of large document against storage efficiency of small
-   * ones.
-   * @param maxChunkBits Number of character-offset bits that should be used for
-   * addressing within a chunk. Maximum length of a chunk is 2^chunkBits
-   * characters.
-   * @param rebundleBits Number of character-offset bits that addressing should
-   * advance before we attempt to take a step from initChunkBits to maxChunkBits
-   */
-  public FastStringBuffer(int initChunkBits, int maxChunkBits,
-                          int rebundleBits)
-  {
-    if(DEBUG_FORCE_INIT_BITS!=0) initChunkBits=DEBUG_FORCE_INIT_BITS;
-
-    m_array = new char[16][];
-
-    // Don't bite off more than we're prepared to swallow!
-    if (initChunkBits > maxChunkBits)
-      initChunkBits = maxChunkBits;
-
-    m_chunkBits = initChunkBits;
-    m_maxChunkBits = maxChunkBits;
-    m_rebundleBits = rebundleBits;
-    m_chunkSize = 1 << (initChunkBits);
-    m_chunkMask = m_chunkSize - 1;
-    m_array[0] = new char[m_chunkSize];
-  }
-
-  /**
-   * Construct a FastStringBuffer, using a default rebundleBits value.
-   *
-   * NEEDSDOC @param initChunkBits
-   * NEEDSDOC @param maxChunkBits
-   */
-  public FastStringBuffer(int initChunkBits, int maxChunkBits)
-  {
-    this(initChunkBits, maxChunkBits, 2);
-  }
-
-  /**
-   * Construct a FastStringBuffer, using default maxChunkBits and
-   * rebundleBits values.
-   * <p>
-   * ISSUE: Should this call assert initial size, or fixed size?
-   * Now configured as initial, with a default for fixed.
-   *
-   * @param
-   *
-   * NEEDSDOC @param initChunkBits
-   */
-  public FastStringBuffer(int initChunkBits)
-  {
-    this(initChunkBits, 15, 2);
-  }
-
-  /**
-   * Construct a FastStringBuffer, using a default allocation policy.
-   */
-  public FastStringBuffer()
-  {
-
-    // 10 bits is 1K. 15 bits is 32K. Remember that these are character
-    // counts, so actual memory allocation unit is doubled for UTF-16 chars.
-    //
-    // For reference: In the original FastStringBuffer, we simply
-    // overallocated by blocksize (default 1KB) on each buffer-growth.
-    this(10, 15, 2);
-  }
-
-  /**
-   * Get the length of the list. Synonym for length().
-   *
-   * @return the number of characters in the FastStringBuffer's content.
-   */
-  public final int size()
-  {
-    return (m_lastChunk << m_chunkBits) + m_firstFree;
-  }
-
-  /**
-   * Get the length of the list. Synonym for size().
-   *
-   * @return the number of characters in the FastStringBuffer's content.
-   */
-  public final int length()
-  {
-    return (m_lastChunk << m_chunkBits) + m_firstFree;
-  }
-
-  /**
-   * Discard the content of the FastStringBuffer, and most of the memory
-   * that was allocated by it, restoring the initial state. Note that this
-   * may eventually be different from setLength(0), which see.
-   */
-  public final void reset()
-  {
-
-    m_lastChunk = 0;
-    m_firstFree = 0;
-
-    // Recover the original chunk size
-    FastStringBuffer innermost = this;
-
-    while (innermost.m_innerFSB != null)
-    {
-      innermost = innermost.m_innerFSB;
-    }
-
-    m_chunkBits = innermost.m_chunkBits;
-    m_chunkSize = innermost.m_chunkSize;
-    m_chunkMask = innermost.m_chunkMask;
-
-    // Discard the hierarchy
-    m_innerFSB = null;
-    m_array = new char[16][0];
-    m_array[0] = new char[m_chunkSize];
-  }
-
-  /**
-   * Directly set how much of the FastStringBuffer's storage is to be
-   * considered part of its content. This is a fast but hazardous
-   * operation. It is not protected against negative values, or values
-   * greater than the amount of storage currently available... and even
-   * if additional storage does exist, its contents are unpredictable.
-   * The only safe use for our setLength() is to truncate the FastStringBuffer
-   * to a shorter string.
-   * <p>
-   * TODO: %REVEIW% Current setLength code is probably not the best solution.
-   * It releases memory that in theory we shouldn retain and
-   * reuse. Holding onto that would require recursive truncation of
-   * the inner FSB, and extending the append operations to recurse
-   * into the inner FSB when space exists within them. Could be done,
-   * but nontrivial change and adds some overhead to the append
-   * operation. Consider alternatives. 
-   *
-   * @param l New length. If l<0 or l>=getLength(), this operation will
-   * not report an error but future operations will almost certainly fail.
-   */
-  public final void setLength(int l)
-  {
-
-    m_lastChunk = l >>> m_chunkBits;
-
-    if (m_lastChunk == 0 && m_innerFSB != null)
-    {
-      m_innerFSB.setLength(l, this);
-    }
-    else
-    {
-      m_firstFree = l & m_chunkMask;
-    }
-  }
-
-  /**
-   * Subroutine for the public setLength() method. Deals with the fact
-   * that truncation may require restoring one of the innerFSBs
-   *
-   * NEEDSDOC @param l
-   * NEEDSDOC @param rootFSB
-   */
-  private final void setLength(int l, FastStringBuffer rootFSB)
-  {
-
-    m_lastChunk = l >>> m_chunkBits;
-
-    if (m_lastChunk == 0 && m_innerFSB != null)
-    {
-      m_innerFSB.setLength(l, rootFSB);
-    }
-    else
-    {
-
-      // Undo encapsulation -- pop the innerFSB data back up to root.
-      rootFSB.m_chunkBits = m_chunkBits;
-      rootFSB.m_maxChunkBits = m_maxChunkBits;
-      rootFSB.m_rebundleBits = m_rebundleBits;
-      rootFSB.m_chunkSize = m_chunkSize;
-      rootFSB.m_chunkMask = m_chunkMask;
-      rootFSB.m_array = m_array;
-      rootFSB.m_innerFSB = m_innerFSB;
-      rootFSB.m_lastChunk = m_lastChunk;
-
-      // Finally, truncate this sucker.
-      rootFSB.m_firstFree = l & m_chunkMask;
-    }
-  }
-
-  /**
-   * Note that this operation has been somewhat deoptimized by the shift to a
-   * chunked array, as there is no factory method to produce a String object
-   * directly from an array of arrays and hence a double copy is needed.
-   * By using ensureCapacity we hope to minimize the heap overhead of building
-   * the intermediate StringBuffer.
-   * <p>
-   * (It really is a pity that Java didn't design String as a final subclass
-   * of MutableString, rather than having StringBuffer be a separate hierarchy.
-   * We'd avoid a <strong>lot</strong> of double-buffering.)
-   *
-   * @return the contents of the FastStringBuffer as a standard Java string.
-   */
-  public final String toString()
-  {
-
-    int length = (m_lastChunk << m_chunkBits) + m_firstFree;
-
-    return getString(new StringBuffer(length), 0, 0, length).toString();
-  }
-
-  /**
-   * Append a single character onto the FastStringBuffer, growing the
-   * storage if necessary.
-   * <p>
-   * NOTE THAT after calling append(), previously obtained
-   * references to m_array[][] may no longer be valid....
-   * though in fact they should be in this instance.
-   *
-   * @param value character to be appended.
-   */
-  public final void append(char value)
-  {
-
-    char[] chunk;
-
-    // We may have preallocated chunks. If so, all but last should
-    // be at full size.
-    boolean lastchunk = (m_lastChunk + 1 == m_array.length);
-
-    if (m_firstFree < m_chunkSize)  // Simplified test single-character-fits
-      chunk = m_array[m_lastChunk];
-    else
-    {
-
-      // Extend array?
-      int i = m_array.length;
-
-      if (m_lastChunk + 1 == i)
-      {
-        char[][] newarray = new char[i + 16][];
-
-        System.arraycopy(m_array, 0, newarray, 0, i);
-
-        m_array = newarray;
-      }
-
-      // Advance one chunk
-      chunk = m_array[++m_lastChunk];
-
-      if (chunk == null)
-      {
-
-        // Hierarchical encapsulation
-        if (m_lastChunk == 1 << m_rebundleBits
-                && m_chunkBits < m_maxChunkBits)
-        {
-
-          // Should do all the work of both encapsulating
-          // existing data and establishing new sizes/offsets
-          m_innerFSB = new FastStringBuffer(this);
-        }
-
-        // Add a chunk.
-        chunk = m_array[m_lastChunk] = new char[m_chunkSize];
-      }
-
-      m_firstFree = 0;
-    }
-
-    // Space exists in the chunk. Append the character.
-    chunk[m_firstFree++] = value;
-  }
-
-  /**
-   * Append the contents of a String onto the FastStringBuffer,
-   * growing the storage if necessary.
-   * <p>
-   * NOTE THAT after calling append(), previously obtained
-   * references to m_array[] may no longer be valid.
-   *
-   * @param value String whose contents are to be appended.
-   */
-  public final void append(String value)
-  {
-
-    int strlen = value.length();
-
-    if (0 == strlen)
-      return;
-
-    int copyfrom = 0;
-    char[] chunk = m_array[m_lastChunk];
-    int available = m_chunkSize - m_firstFree;
-
-    // Repeat while data remains to be copied
-    while (strlen > 0)
-    {
-
-      // Copy what fits
-      if (available > strlen)
-        available = strlen;
-
-      value.getChars(copyfrom, copyfrom + available, m_array[m_lastChunk],
-                     m_firstFree);
-
-      strlen -= available;
-      copyfrom += available;
-
-      // If there's more left, allocate another chunk and continue
-      if (strlen > 0)
-      {
-
-        // Extend array?
-        int i = m_array.length;
-
-        if (m_lastChunk + 1 == i)
-        {
-          char[][] newarray = new char[i + 16][];
-
-          System.arraycopy(m_array, 0, newarray, 0, i);
-
-          m_array = newarray;
-        }
-
-        // Advance one chunk
-        chunk = m_array[++m_lastChunk];
-
-        if (chunk == null)
-        {
-
-          // Hierarchical encapsulation
-          if (m_lastChunk == 1 << m_rebundleBits
-                  && m_chunkBits < m_maxChunkBits)
-          {
-
-            // Should do all the work of both encapsulating
-            // existing data and establishing new sizes/offsets
-            m_innerFSB = new FastStringBuffer(this);
-          }
-
-          // Add a chunk. 
-          chunk = m_array[m_lastChunk] = new char[m_chunkSize];
-        }
-
-        available = m_chunkSize;
-        m_firstFree = 0;
-      }
-    }
-
-    // Adjust the insert point in the last chunk, when we've reached it.
-    m_firstFree += available;
-  }
-
-  /**
-   * Append the contents of a StringBuffer onto the FastStringBuffer,
-   * growing the storage if necessary.
-   * <p>
-   * NOTE THAT after calling append(), previously obtained
-   * references to m_array[] may no longer be valid.
-   *
-   * @param value StringBuffer whose contents are to be appended.
-   */
-  public final void append(StringBuffer value)
-  {
-
-    int strlen = value.length();
-
-    if (0 == strlen)
-      return;
-
-    int copyfrom = 0;
-    char[] chunk = m_array[m_lastChunk];
-    int available = m_chunkSize - m_firstFree;
-
-    // Repeat while data remains to be copied
-    while (strlen > 0)
-    {
-
-      // Copy what fits
-      if (available > strlen)
-        available = strlen;
-
-      value.getChars(copyfrom, copyfrom + available, m_array[m_lastChunk],
-                     m_firstFree);
-
-      strlen -= available;
-      copyfrom += available;
-
-      // If there's more left, allocate another chunk and continue
-      if (strlen > 0)
-      {
-
-        // Extend array?
-        int i = m_array.length;
-
-        if (m_lastChunk + 1 == i)
-        {
-          char[][] newarray = new char[i + 16][];
-
-          System.arraycopy(m_array, 0, newarray, 0, i);
-
-          m_array = newarray;
-        }
-
-        // Advance one chunk
-        chunk = m_array[++m_lastChunk];
-
-        if (chunk == null)
-        {
-
-          // Hierarchical encapsulation
-          if (m_lastChunk == 1 << m_rebundleBits
-                  && m_chunkBits < m_maxChunkBits)
-          {
-
-            // Should do all the work of both encapsulating
-            // existing data and establishing new sizes/offsets
-            m_innerFSB = new FastStringBuffer(this);
-          }
-
-          // Add a chunk.
-          chunk = m_array[m_lastChunk] = new char[m_chunkSize];
-        }
-
-        available = m_chunkSize;
-        m_firstFree = 0;
-      }
-    }
-
-    // Adjust the insert point in the last chunk, when we've reached it.
-    m_firstFree += available;
-  }
-
-  /**
-   * Append part of the contents of a Character Array onto the
-   * FastStringBuffer,  growing the storage if necessary.
-   * <p>
-   * NOTE THAT after calling append(), previously obtained
-   * references to m_array[] may no longer be valid.
-   *
-   * @param chars character array from which data is to be copied
-   * @param start offset in chars of first character to be copied,
-   * zero-based.
-   * @param length number of characters to be copied
-   */
-  public final void append(char[] chars, int start, int length)
-  {
-
-    int strlen = length;
-
-    if (0 == strlen)
-      return;
-
-    int copyfrom = start;
-    char[] chunk = m_array[m_lastChunk];
-    int available = m_chunkSize - m_firstFree;
-
-    // Repeat while data remains to be copied
-    while (strlen > 0)
-    {
-
-      // Copy what fits
-      if (available > strlen)
-        available = strlen;
-
-      System.arraycopy(chars, copyfrom, m_array[m_lastChunk], m_firstFree,
-                       available);
-
-      strlen -= available;
-      copyfrom += available;
-
-      // If there's more left, allocate another chunk and continue
-      if (strlen > 0)
-      {
-
-        // Extend array?
-        int i = m_array.length;
-
-        if (m_lastChunk + 1 == i)
-        {
-          char[][] newarray = new char[i + 16][];
-
-          System.arraycopy(m_array, 0, newarray, 0, i);
-
-          m_array = newarray;
-        }
-
-        // Advance one chunk
-        chunk = m_array[++m_lastChunk];
-
-        if (chunk == null)
-        {
-
-          // Hierarchical encapsulation
-          if (m_lastChunk == 1 << m_rebundleBits
-                  && m_chunkBits < m_maxChunkBits)
-          {
-
-            // Should do all the work of both encapsulating
-            // existing data and establishing new sizes/offsets
-            m_innerFSB = new FastStringBuffer(this);
-          }
-
-          // Add a chunk.
-          chunk = m_array[m_lastChunk] = new char[m_chunkSize];
-        }
-
-        available = m_chunkSize;
-        m_firstFree = 0;
-      }
-    }
-
-    // Adjust the insert point in the last chunk, when we've reached it.
-    m_firstFree += available;
-  }
-
-  /**
-   * Append the contents of another FastStringBuffer onto
-   * this FastStringBuffer, growing the storage if necessary.
-   * <p>
-   * NOTE THAT after calling append(), previously obtained
-   * references to m_array[] may no longer be valid.
-   *
-   * @param value FastStringBuffer whose contents are
-   * to be appended.
-   */
-  public final void append(FastStringBuffer value)
-  {
-
-    // Complicating factor here is that the two buffers may use
-    // different chunk sizes, and even if they're the same we're
-    // probably on a different alignment due to previously appended
-    // data. We have to work through the source in bite-sized chunks.
-    int strlen = value.length();
-
-    if (0 == strlen)
-      return;
-
-    int copyfrom = 0;
-    char[] chunk = m_array[m_lastChunk];
-    int available = m_chunkSize - m_firstFree;
-
-    // Repeat while data remains to be copied
-    while (strlen > 0)
-    {
-
-      // Copy what fits
-      if (available > strlen)
-        available = strlen;
-
-      int sourcechunk = (copyfrom + value.m_chunkSize - 1)
-                        >>> value.m_chunkBits;
-      int sourcecolumn = copyfrom & value.m_chunkMask;
-      int runlength = value.m_chunkSize - sourcecolumn;
-
-      if (runlength > available)
-        runlength = available;
-
-      System.arraycopy(value.m_array[sourcechunk], sourcecolumn,
-                       m_array[m_lastChunk], m_firstFree, runlength);
-
-      if (runlength != available)
-        System.arraycopy(value.m_array[sourcechunk + 1], 0,
-                         m_array[m_lastChunk], m_firstFree + runlength,
-                         available - runlength);
-
-      strlen -= available;
-      copyfrom += available;
-
-      // If there's more left, allocate another chunk and continue
-      if (strlen > 0)
-      {
-
-        // Extend array?
-        int i = m_array.length;
-
-        if (m_lastChunk + 1 == i)
-        {
-          char[][] newarray = new char[i + 16][];
-
-          System.arraycopy(m_array, 0, newarray, 0, i);
-
-          m_array = newarray;
-        }
-
-        // Advance one chunk
-        chunk = m_array[++m_lastChunk];
-
-        if (chunk == null)
-        {
-
-          // Hierarchical encapsulation
-          if (m_lastChunk == 1 << m_rebundleBits
-                  && m_chunkBits < m_maxChunkBits)
-          {
-
-            // Should do all the work of both encapsulating
-            // existing data and establishing new sizes/offsets
-            m_innerFSB = new FastStringBuffer(this);
-          }
-
-          // Add a chunk. 
-          chunk = m_array[m_lastChunk] = new char[m_chunkSize];
-        }
-
-        available = m_chunkSize;
-        m_firstFree = 0;
-      }
-    }
-
-    // Adjust the insert point in the last chunk, when we've reached it.
-    m_firstFree += available;
-  }
-
-  /**
-   * @return true if the specified range of characters are all whitespace,
-   * as defined by XMLCharacterRecognizer.
-   * <p>
-   * CURRENTLY DOES NOT CHECK FOR OUT-OF-RANGE.
-   *
-   * @param start Offset of first character in the range.
-   * @param length Number of characters to send.
-   */
-  public boolean isWhitespace(int start, int length)
-  {
-
-    int sourcechunk = start >>> m_chunkBits;
-    int sourcecolumn = start & m_chunkMask;
-    int available = m_chunkSize - sourcecolumn;
-    boolean chunkOK;
-
-    while (length > 0)
-    {
-      int runlength = (length <= available) ? length : available;
-
-      if (sourcechunk == 0 && m_innerFSB != null)
-        chunkOK = m_innerFSB.isWhitespace(sourcecolumn, runlength);
-      else
-        chunkOK = org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(
-          m_array[sourcechunk], sourcecolumn, runlength);
-
-      if (!chunkOK)
-        return false;
-
-      length -= runlength;
-
-      ++sourcechunk;
-
-      sourcecolumn = 0;
-      available = m_chunkSize;
-    }
-
-    return true;
-  }
-
-  /**
-   * @param start Offset of first character in the range.
-   * @param length Number of characters to send.
-   * @return a new String object initialized from the specified range of
-   * characters.
-   */
-  public String getString(int start, int length)
-  {
-    return getString(new StringBuffer(length), start >>> m_chunkBits,
-                     start & m_chunkMask, length).toString();
-  }
-
-  /**
-   * @param sb StringBuffer to be appended to
-   * @param start Offset of first character in the range.
-   * @param length Number of characters to send.
-   * @return sb with the requested text appended to it
-   */
-  StringBuffer getString(StringBuffer sb, int start, int length)
-  {
-    return getString(sb, start >>> m_chunkBits, start & m_chunkMask, length);
-  }
-
-  /**
-   * Internal support for toString() and getString().
-   * PLEASE NOTE SIGNATURE CHANGE from earlier versions; it now appends into
-   * and returns a StringBuffer supplied by the caller. This simplifies
-   * m_innerFSB support.
-   * <p>
-   * Note that this operation has been somewhat deoptimized by the shift to a
-   * chunked array, as there is no factory method to produce a String object
-   * directly from an array of arrays and hence a double copy is needed.
-   * By presetting length we hope to minimize the heap overhead of building
-   * the intermediate StringBuffer.
-   * <p>
-   * (It really is a pity that Java didn't design String as a final subclass
-   * of MutableString, rather than having StringBuffer be a separate hierarchy.
-   * We'd avoid a <strong>lot</strong> of double-buffering.)
-   *
-   *
-   * @param sb
-   * @param startChunk
-   * @param startColumn
-   * @param length
-   * 
-   * @return the contents of the FastStringBuffer as a standard Java string.
-   */
-  StringBuffer getString(StringBuffer sb, int startChunk, int startColumn,
-                         int length)
-  {
-
-    int stop = (startChunk << m_chunkBits) + startColumn + length;
-    int stopChunk = stop >>> m_chunkBits;
-    int stopColumn = stop & m_chunkMask;
-
-    // Factored out
-    //StringBuffer sb=new StringBuffer(length);
-    for (int i = startChunk; i < stopChunk; ++i)
-    {
-      if (i == 0 && m_innerFSB != null)
-        m_innerFSB.getString(sb, startColumn, m_chunkSize - startColumn);
-      else
-        sb.append(m_array[i], startColumn, m_chunkSize - startColumn);
-
-      startColumn = 0;  // after first chunk
-    }
-
-    if (stopChunk == 0 && m_innerFSB != null)
-      m_innerFSB.getString(sb, startColumn, stopColumn - startColumn);
-    else if (stopColumn > startColumn)
-      sb.append(m_array[stopChunk], startColumn, stopColumn - startColumn);
-
-    return sb;
-  }
-
-  /**
-   * Get a single character from the string buffer.
-   *
-   *
-   * @param pos character position requested.
-   * @return A character from the requested position.
-   */
-  public char charAt(int pos)
-  {
-    int startChunk = pos >>> m_chunkBits;
-
-    if (startChunk == 0 && m_innerFSB != null)
-      return m_innerFSB.charAt(pos & m_chunkMask);
-    else
-      return m_array[startChunk][pos & m_chunkMask];
-  }
-
-  /**
-   * Sends the specified range of characters as one or more SAX characters()
-   * events.
-   * Note that the buffer reference passed to the ContentHandler may be
-   * invalidated if the FastStringBuffer is edited; it's the user's
-   * responsibility to manage access to the FastStringBuffer to prevent this
-   * problem from arising.
-   * <p>
-   * Note too that there is no promise that the output will be sent as a
-   * single call. As is always true in SAX, one logical string may be split
-   * across multiple blocks of memory and hence delivered as several
-   * successive events.
-   *
-   * @param ch SAX ContentHandler object to receive the event.
-   * @param start Offset of first character in the range.
-   * @param length Number of characters to send.
-   * @exception org.xml.sax.SAXException may be thrown by handler's
-   * characters() method.
-   */
-  public void sendSAXcharacters(
-          org.xml.sax.ContentHandler ch, int start, int length)
-            throws org.xml.sax.SAXException
-  {
-
-    int stop = start + length;
-    int startChunk = start >>> m_chunkBits;
-    int startColumn = start & m_chunkMask;
-    int stopChunk = stop >>> m_chunkBits;
-    int stopColumn = stop & m_chunkMask;
-
-    for (int i = startChunk; i < stopChunk; ++i)
-    {
-      if (i == 0 && m_innerFSB != null)
-        m_innerFSB.sendSAXcharacters(ch, startColumn,
-                                     m_chunkSize - startColumn);
-      else
-        ch.characters(m_array[i], startColumn, m_chunkSize - startColumn);
-
-      startColumn = 0;  // after first chunk
-    }
-
-    // Last, or only, chunk
-    if (stopChunk == 0 && m_innerFSB != null)
-      m_innerFSB.sendSAXcharacters(ch, startColumn, stopColumn - startColumn);
-    else if (stopColumn > startColumn)
-      ch.characters(m_array[stopChunk], startColumn,
-                    stopColumn - startColumn);
-  }
-  
-  /**
-   * Sends the specified range of characters as one or more SAX characters()
-   * events, normalizing the characters according to XSLT rules.
-   *
-   * @param ch SAX ContentHandler object to receive the event.
-   * @param start Offset of first character in the range.
-   * @param length Number of characters to send.
-   * @exception org.xml.sax.SAXException may be thrown by handler's
-   * characters() method.
-   */
-  public void sendNormalizedSAXcharacters(
-          org.xml.sax.ContentHandler ch, int start, int length)
-            throws org.xml.sax.SAXException
-  {
-
-    int stop = start + length;
-    int startChunk = start >>> m_chunkBits;
-    int startColumn = start & m_chunkMask;
-    int stopChunk = stop >>> m_chunkBits;
-    int stopColumn = stop & m_chunkMask;
-
-    for (int i = startChunk; i < stopChunk; ++i)
-    {
-      if (i == 0 && m_innerFSB != null)
-        m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn,
-                                     m_chunkSize - startColumn);
-      else
-        sendNormalizedSAXcharacters(m_array[i], startColumn, 
-                                    m_chunkSize - startColumn, ch);
-
-      startColumn = 0;  // after first chunk
-    }
-
-    // Last, or only, chunk
-    if (stopChunk == 0 && m_innerFSB != null)
-      m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn, stopColumn - startColumn);
-    else if (stopColumn > startColumn)
-    {
-      sendNormalizedSAXcharacters(m_array[stopChunk], startColumn,
-                    stopColumn - startColumn, ch);
-    }
-  }
-  
-  static char[] m_oneChar = {' '};
-  
-  /**
-   * Directly normalize and dispatch the character array.
-   *
-   * @param ch The characters from the XML document.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   * 
-   * @exception org.xml.sax.SAXException Any SAX exception, possibly
-   *            wrapping another exception.
-   */
-  public static void sendNormalizedSAXcharacters(char ch[], 
-             int start, int length, 
-             org.xml.sax.ContentHandler handler)
-          throws org.xml.sax.SAXException
-  {
-    int end = length + start;
-    int s;
-    for (s = start; s < end; s++)
-    {
-      char c = ch[s];
-      if(!XMLCharacterRecognizer.isWhiteSpace(c))
-        break;
-    }
-
-    boolean whiteSpaceFound = false;
-    boolean needToFlushSpace = false;
-    int d = s;
-    for (; s < end; s++)
-    {
-      char c = ch[s];
-
-      if (XMLCharacterRecognizer.isWhiteSpace(c))
-      {
-        if (!whiteSpaceFound)
-        {
-          whiteSpaceFound = true;
-          if(c != ' ')
-          {
-            int len = (s-d);
-            if( len > 0)
-            {
-              if(needToFlushSpace)
-                handler.characters(m_oneChar, 0, 1);
-                
-              handler.characters(ch, d, len);
-              needToFlushSpace = true;
-              // handler.characters(m_oneChar, 0, 1);
-            }
-            d = s+1;
-          }
-        }
-        else
-        {
-          int z;
-          for (z = s+1; z < end; z++)
-          {
-            c = ch[z];
-            if(!XMLCharacterRecognizer.isWhiteSpace(c))
-              break;
-          }
-
-          int len = (s-d);
-
-          if(z == end)
-          {
-            end = s;
-            break; // Let the flush at the end handle it.
-          }
-          if(len > 0)
-          {
-            if(needToFlushSpace)
-            {
-              handler.characters(m_oneChar, 0, 1);
-              needToFlushSpace = false;
-            }
-              
-            handler.characters(ch, d, len);
-          }
-
-          whiteSpaceFound = false;
-          d = s = z;
-        }
-      }
-      else
-      {
-        whiteSpaceFound = false;
-      }
-    }
-
-    if (whiteSpaceFound)
-      s--;
-    
-    int len = (s-d);
-    
-    if(len > 0)
-    {
-      if(needToFlushSpace)
-        handler.characters(m_oneChar, 0, 1);
-      handler.characters(ch, d, len);
-    }
-  }
-  
-  /**
-   * Sends the specified range of characters as sax Comment.
-   * <p>
-   * Note that, unlike sendSAXcharacters, this has to be done as a single 
-   * call to LexicalHandler#comment.
-   *
-   * @param ch SAX LexicalHandler object to receive the event.
-   * @param start Offset of first character in the range.
-   * @param length Number of characters to send.
-   * @exception org.xml.sax.SAXException may be thrown by handler's
-   * characters() method.
-   */
-  public void sendSAXComment(
-          org.xml.sax.ext.LexicalHandler ch, int start, int length)
-            throws org.xml.sax.SAXException
-  {
-
-    // %OPT% Do it this way for now...
-    String comment = getString(start, length);
-    ch.comment(comment.toCharArray(), 0, length);
-  }
-
-  /**
-   * Copies characters from this string into the destination character
-   * array.
-   *
-   * @param      srcBegin   index of the first character in the string
-   *                        to copy.
-   * @param      srcEnd     index after the last character in the string
-   *                        to copy.
-   * @param      dst        the destination array.
-   * @param      dstBegin   the start offset in the destination array.
-   * @exception IndexOutOfBoundsException If any of the following
-   *            is true:
-   *            <ul><li><code>srcBegin</code> is negative.
-   *            <li><code>srcBegin</code> is greater than <code>srcEnd</code>
-   *            <li><code>srcEnd</code> is greater than the length of this
-   *                string
-   *            <li><code>dstBegin</code> is negative
-   *            <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
-   *                <code>dst.length</code></ul>
-   * @exception NullPointerException if <code>dst</code> is <code>null</code>
-   */
-  private void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
-  {
-    // %TBD% Joe needs to write this function.  Make public when implemented.
-  }
-
-  /**
-   * Encapsulation c'tor. After this is called, the source FastStringBuffer
-   * will be reset to use the new object as its m_innerFSB, and will have
-   * had its chunk size reset appropriately. IT SHOULD NEVER BE CALLED
-   * EXCEPT WHEN source.length()==1<<(source.m_chunkBits+source.m_rebundleBits)
-   *
-   * NEEDSDOC @param source
-   */
-  private FastStringBuffer(FastStringBuffer source)
-  {
-
-    // Copy existing information into new encapsulation
-    m_chunkBits = source.m_chunkBits;
-    m_maxChunkBits = source.m_maxChunkBits;
-    m_rebundleBits = source.m_rebundleBits;
-    m_chunkSize = source.m_chunkSize;
-    m_chunkMask = source.m_chunkMask;
-    m_array = source.m_array;
-    m_innerFSB = source.m_innerFSB;
-
-    // These have to be adjusted because we're calling just at the time
-    // when we would be about to allocate another chunk
-    m_lastChunk = source.m_lastChunk - 1;
-    m_firstFree = source.m_chunkSize;
-
-    // Establish capsule as the Inner FSB, reset chunk sizes/addressing
-    source.m_array = new char[16][];
-    source.m_innerFSB = this;
-
-    // Since we encapsulated just as we were about to append another
-    // chunk, return ready to create the chunk after the innerFSB
-    // -- 1, not 0.
-    source.m_lastChunk = 1;
-    source.m_firstFree = 0;
-    source.m_chunkBits += m_rebundleBits;
-    source.m_chunkSize = 1 << (source.m_chunkBits);
-    source.m_chunkMask = source.m_chunkSize - 1;
-  }
-}
diff --git a/src/org/apache/xml/utils/IntStack.java b/src/org/apache/xml/utils/IntStack.java
deleted file mode 100644
index 4205934..0000000
--- a/src/org/apache/xml/utils/IntStack.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.EmptyStackException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Implement a stack of simple integers.
- *
- * %OPT%
- * This is currently based on IntVector, which permits fast acess but pays a
- * heavy recopying penalty if/when its size is increased. If we expect deep
- * stacks, we should consider a version based on ChunkedIntVector.
- */
-public class IntStack extends IntVector
-{
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public IntStack()
-  {
-    super();
-  }
-
-  /**
-   * Construct a IntVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public IntStack(int blocksize)
-  {
-    super(blocksize);
-  }
-
-  /**
-   * Pushes an item onto the top of this stack.
-   *
-   * @param   i   the int to be pushed onto this stack.
-   * @return  the <code>item</code> argument.
-   */
-  public int push(int i)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    m_map[m_firstFree] = i;
-
-    m_firstFree++;
-
-    return i;
-  }
-
-  /**
-   * Removes the object at the top of this stack and returns that
-   * object as the value of this function.
-   *
-   * @return     The object at the top of this stack.
-   */
-  public int pop()
-  {
-    return m_map[--m_firstFree];
-  }
-
-  /**
-   * Quickly pops a number of items from the stack.
-   */
-
-  public void quickPop(int n)
-  {
-    m_firstFree -= n;
-  }
-
-  /**
-   * Looks at the object at the top of this stack without removing it
-   * from the stack.
-   *
-   * @return     the object at the top of this stack.
-   * @throws  EmptyStackException  if this stack is empty.
-   */
-  public int peek()
-  {
-    return m_map[m_firstFree - 1];
-  }
-
-  /**
-   * Looks at the object at the position the stack counting down n items.
-   *
-   * @param n The number of items down, indexed from zero.
-   * @return     the object at n items down.
-   * @throws  EmptyStackException  if this stack is empty.
-   */
-  public int peek(int n)
-  {
-    return m_map[m_firstFree-(1+n)];
-  }
-
-  /**
-   * Sets an object at a the top of the statck
-   *
-   *
-   * @param val object to set at the top
-   * @throws  EmptyStackException  if this stack is empty.
-   */
-  public void setTop(int val)
-  {
-    m_map[m_firstFree - 1] = val;
-  }
-
-  /**
-   * Tests if this stack is empty.
-   *
-   * @return  <code>true</code> if this stack is empty;
-   *          <code>false</code> otherwise.
-   * @since   JDK1.0
-   */
-  public boolean empty()
-  {
-    return m_firstFree == 0;
-  }
-
-  /**
-   * Returns where an object is on this stack.
-   *
-   * @param   o   the desired object.
-   * @return  the distance from the top of the stack where the object is]
-   *          located; the return value <code>-1</code> indicates that the
-   *          object is not on the stack.
-   * @since   JDK1.0
-   */
-  public int search(int o)
-  {
-
-    int i = lastIndexOf(o);
-
-    if (i >= 0)
-    {
-      return size() - i;
-    }
-
-    return -1;
-  }
-}
diff --git a/src/org/apache/xml/utils/IntVector.java b/src/org/apache/xml/utils/IntVector.java
deleted file mode 100644
index 337bce4..0000000
--- a/src/org/apache/xml/utils/IntVector.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple table that stores a list of int.
- *
- * This version is based on a "realloc" strategy -- a simle array is
- * used, and when more storage is needed, a larger array is obtained
- * and all existing data is recopied into it. As a result, read/write
- * access to existing nodes is O(1) fast but appending may be O(N**2)
- * slow. See also SuballocatedIntVector.
- */
-public class IntVector
-{
-
-  /** Size of blocks to allocate          */
-  protected int m_blocksize;
-
-  /** Array of ints          */
-  protected int m_map[]; // IntStack is trying to see this directly
-
-  /** Number of ints in array          */
-  protected int m_firstFree = 0;
-
-  /** Size of array          */
-  protected int m_mapSize;
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public IntVector()
-  {
-
-    m_blocksize = 32;
-    m_mapSize = m_blocksize;
-    m_map = new int[m_blocksize];
-  }
-
-  /**
-   * Construct a IntVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public IntVector(int blocksize)
-  {
-
-    m_blocksize = blocksize;
-    m_mapSize = blocksize;
-    m_map = new int[blocksize];
-  }
-  
-  /**
-   * Construct a IntVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public IntVector(int blocksize, int increaseSize)
-  {
-
-    m_blocksize = increaseSize;
-    m_mapSize = blocksize;
-    m_map = new int[blocksize];
-  }
-
-
-  /**
-   * Get the length of the list.
-   *
-   * @return length of the list
-   */
-  public final int size()
-  {
-    return m_firstFree;
-  }
-  
-  /**
-   * Get the length of the list.
-   *
-   * @return length of the list
-   */
-  public final void setSize(int sz)
-  {
-    m_firstFree = sz;
-  }
-
-
-  /**
-   * Append a int onto the vector.
-   *
-   * @param value Int to add to the list 
-   */
-  public final void addElement(int value)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    m_map[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-  
-  /**
-   * Append several int values onto the vector.
-   *
-   * @param value Int to add to the list 
-   */
-  public final void addElements(int value, int numberOfElements)
-  {
-
-    if ((m_firstFree + numberOfElements) >= m_mapSize)
-    {
-      m_mapSize += (m_blocksize+numberOfElements);
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    for (int i = 0; i < numberOfElements; i++) 
-    {
-      m_map[m_firstFree] = value;
-      m_firstFree++;
-    }
-  }
-  
-  /**
-   * Append several slots onto the vector, but do not set the values.
-   *
-   * @param value Int to add to the list 
-   */
-  public final void addElements(int numberOfElements)
-  {
-
-    if ((m_firstFree + numberOfElements) >= m_mapSize)
-    {
-      m_mapSize += (m_blocksize+numberOfElements);
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-    
-    m_firstFree += numberOfElements;
-  }
-  
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   *
-   * @param value Int to insert
-   * @param at Index of where to insert 
-   */
-  public final void insertElementAt(int value, int at)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    if (at <= (m_firstFree - 1))
-    {
-      System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
-    }
-
-    m_map[at] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   */
-  public final void removeAllElements()
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      m_map[i] = java.lang.Integer.MIN_VALUE;
-    }
-
-    m_firstFree = 0;
-  }
-
-  /**
-   * Removes the first occurrence of the argument from this vector.
-   * If the object is found in this vector, each component in the vector
-   * with an index greater or equal to the object's index is shifted
-   * downward to have an index one smaller than the value it had
-   * previously.
-   *
-   * @param s Int to remove from array
-   *
-   * @return True if the int was removed, false if it was not found
-   */
-  public final boolean removeElement(int s)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i] == s)
-      {
-        if ((i + 1) < m_firstFree)
-          System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
-        else
-          m_map[i] = java.lang.Integer.MIN_VALUE;
-
-        m_firstFree--;
-
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  /**
-   * Deletes the component at the specified index. Each component in
-   * this vector with an index greater or equal to the specified
-   * index is shifted downward to have an index one smaller than
-   * the value it had previously.
-   *
-   * @param i index of where to remove and int
-   */
-  public final void removeElementAt(int i)
-  {
-
-    if (i > m_firstFree)
-      System.arraycopy(m_map, i + 1, m_map, i, m_firstFree);
-    else
-      m_map[i] = java.lang.Integer.MIN_VALUE;
-
-    m_firstFree--;
-  }
-
-  /**
-   * Sets the component at the specified index of this vector to be the
-   * specified object. The previous component at that position is discarded.
-   *
-   * The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.
-   *
-   * @param node object to set
-   * @param index Index of where to set the object
-   */
-  public final void setElementAt(int value, int index)
-  {
-    m_map[index] = value;
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i index of object to get
-   *
-   * @return object at given index
-   */
-  public final int elementAt(int i)
-  {
-    return m_map[i];
-  }
-
-  /**
-   * Tell if the table contains the given node.
-   *
-   * @param s object to look for
-   *
-   * @return true if the object is in the list
-   */
-  public final boolean contains(int s)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i] == s)
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem object to look for
-   * @param index Index of where to begin search
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public final int indexOf(int elem, int index)
-  {
-
-    for (int i = index; i < m_firstFree; i++)
-    {
-      if (m_map[i] == elem)
-        return i;
-    }
-
-    return java.lang.Integer.MIN_VALUE;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem object to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public final int indexOf(int elem)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i] == elem)
-        return i;
-    }
-
-    return java.lang.Integer.MIN_VALUE;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Object to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public final int lastIndexOf(int elem)
-  {
-
-    for (int i = (m_firstFree - 1); i >= 0; i--)
-    {
-      if (m_map[i] == elem)
-        return i;
-    }
-
-    return java.lang.Integer.MIN_VALUE;
-  }
-}
diff --git a/src/org/apache/xml/utils/MutableAttrListImpl.java b/src/org/apache/xml/utils/MutableAttrListImpl.java
deleted file mode 100644
index 5e09580..0000000
--- a/src/org/apache/xml/utils/MutableAttrListImpl.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.apache.xml.utils.StringVector;
-
-import org.xml.sax.Attributes;
-
-import java.io.Serializable;
-
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Mutable version of AttributesImpl.
- */
-public class MutableAttrListImpl extends AttributesImpl
-        implements Serializable
-{
-
-/**
- * Construct a new, empty AttributesImpl object.
- */
-
-public MutableAttrListImpl()
-  {
-    super();
-  }
-
-  /**
-   * Copy an existing Attributes object.
-   *
-   * <p>This constructor is especially useful inside a start
-   * element event.</p>
-   *
-   * @param atts The existing Attributes object.
-   */
-  public MutableAttrListImpl(Attributes atts)
-  {
-    super(atts);
-  }
-
-  /**
-   * Add an attribute to the end of the list.
-   *
-   * <p>For the sake of speed, this method does no checking
-   * to see if the attribute is already in the list: that is
-   * the responsibility of the application.</p>
-   *
-   * @param uri The Namespace URI, or the empty string if
-   *        none is available or Namespace processing is not
-   *        being performed.
-   * @param localName The local name, or the empty string if
-   *        Namespace processing is not being performed.
-   * @param qName The qualified (prefixed) name, or the empty string
-   *        if qualified names are not available.
-   * @param type The attribute type as a string.
-   * @param value The attribute value.
-   */
-  public void addAttribute(String uri, String localName, String qName,
-                           String type, String value)
-  {
-
-    if (null == uri)
-      uri = "";
-
-    // getIndex(qName) seems to be more reliable than getIndex(uri, localName), 
-    // in the case of the xmlns attribute anyway.
-    int index = this.getIndex(qName);
-    // int index = this.getIndex(uri, localName);
-   
-    // System.out.println("MutableAttrListImpl#addAttribute: "+uri+":"+localName+", "+index+", "+qName+", "+this);
-
-    if (index >= 0)
-      this.setAttribute(index, uri, localName, qName, type, value);
-    else
-      super.addAttribute(uri, localName, qName, type, value);
-  }
-
-  /**
-   * Add the contents of the attribute list to this list.
-   *
-   * @param atts List of attributes to add to this list
-   */
-  public void addAttributes(Attributes atts)
-  {
-
-    int nAtts = atts.getLength();
-
-    for (int i = 0; i < nAtts; i++)
-    {
-      String uri = atts.getURI(i);
-
-      if (null == uri)
-        uri = "";
-
-      String localName = atts.getLocalName(i);
-      String qname = atts.getQName(i);
-      int index = this.getIndex(uri, localName);
-      // System.out.println("MutableAttrListImpl#addAttributes: "+uri+":"+localName+", "+index+", "+atts.getQName(i)+", "+this);
-      if (index >= 0)
-        this.setAttribute(index, uri, localName, qname, atts.getType(i),
-                          atts.getValue(i));
-      else
-        addAttribute(uri, localName, qname, atts.getType(i),
-                     atts.getValue(i));
-    }
-  }
-
-  /**
-   * Return true if list contains the given (raw) attribute name.
-   *
-   * @param name Raw name of attribute to look for 
-   *
-   * @return true if an attribute is found with this name
-   */
-  public boolean contains(String name)
-  {
-    return getValue(name) != null;
-  }
-}
-
-// end of MutableAttrListImpl.java
diff --git a/src/org/apache/xml/utils/NSInfo.java b/src/org/apache/xml/utils/NSInfo.java
deleted file mode 100644
index 7d4f1b6..0000000
--- a/src/org/apache/xml/utils/NSInfo.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class holds information about the namespace info
- * of a node.  It is used to optimize namespace lookup in
- * a generic DOM.
- */
-public class NSInfo
-{
-
-  /**
-   * Constructor NSInfo
-   *
-   *
-   * @param hasProcessedNS Flag indicating whether namespaces
-   * have been processed for this node 
-   * @param hasXMLNSAttrs Flag indicating whether this node
-   * has XMLNS attributes. 
-   */
-  public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs)
-  {
-
-    m_hasProcessedNS = hasProcessedNS;
-    m_hasXMLNSAttrs = hasXMLNSAttrs;
-    m_namespace = null;
-    m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
-  }
-
-  // Unused at the moment
-
-  /**
-   * Constructor NSInfo
-   *
-   *
-   * @param hasProcessedNS Flag indicating whether namespaces
-   * have been processed for this node 
-   * @param hasXMLNSAttrs Flag indicating whether this node
-   * has XMLNS attributes. 
-   * @param hasXMLNSAttrs Flag indicating whether one of this node's
-   * ancestor has XMLNS attributes.
-   */
-  public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs,
-                int ancestorHasXMLNSAttrs)
-  {
-
-    m_hasProcessedNS = hasProcessedNS;
-    m_hasXMLNSAttrs = hasXMLNSAttrs;
-    m_ancestorHasXMLNSAttrs = ancestorHasXMLNSAttrs;
-    m_namespace = null;
-  }
-
-  /**
-   * Constructor NSInfo
-   *
-   *
-   * @param namespace The namespace URI 
-   * @param hasXMLNSAttrs Flag indicating whether this node
-   * has XMLNS attributes.
-   */
-  public NSInfo(String namespace, boolean hasXMLNSAttrs)
-  {
-
-    m_hasProcessedNS = true;
-    m_hasXMLNSAttrs = hasXMLNSAttrs;
-    m_namespace = namespace;
-    m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
-  }
-
-  /** The namespace URI          */
-  public String m_namespace;
-
-  /** Flag indicating whether this node has an XMLNS attribute          */
-  public boolean m_hasXMLNSAttrs;
-
-  /** Flag indicating whether namespaces have been processed for this node */
-  public boolean m_hasProcessedNS;
-
-  /** Flag indicating whether one of this node's ancestor has an XMLNS attribute          */
-  public int m_ancestorHasXMLNSAttrs;
-
-  /** Constant for ancestors XMLNS atributes not processed          */
-  public static final int ANCESTORXMLNSUNPROCESSED = 0;
-
-  /** Constant indicating an ancestor has an XMLNS attribute           */
-  public static final int ANCESTORHASXMLNS = 1;
-
-  /** Constant indicating ancestors don't have an XMLNS attribute           */
-  public static final int ANCESTORNOXMLNS = 2;
-}
diff --git a/src/org/apache/xml/utils/NameSpace.java b/src/org/apache/xml/utils/NameSpace.java
deleted file mode 100644
index 10391e7..0000000
--- a/src/org/apache/xml/utils/NameSpace.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.io.Serializable;
-
-/**
- * <meta name="usage" content="advanced"/>
- * A representation of a namespace.  One of these will
- * be pushed on the namespace stack for each
- * element.
- */
-public class NameSpace implements Serializable
-{
-
-  /** Next NameSpace element on the stack.
-   *  @serial             */
-  public NameSpace m_next = null;
-
-  /** Prefix of this NameSpace element.
-   *  @serial          */
-  public String m_prefix;
-
-  /** Namespace URI of this NameSpace element.
-   *  @serial           */
-  public String m_uri;  // if null, then Element namespace is empty.
-
-  /**
-   * Construct a namespace for placement on the
-   * result tree namespace stack.
-   *
-   * @param prefix Prefix of this element
-   * @param uri URI of  this element
-   */
-  public NameSpace(String prefix, String uri)
-  {
-    m_prefix = prefix;
-    m_uri = uri;
-  }
-}
diff --git a/src/org/apache/xml/utils/NamespaceSupport2.java b/src/org/apache/xml/utils/NamespaceSupport2.java
deleted file mode 100644
index 6a916cd..0000000
--- a/src/org/apache/xml/utils/NamespaceSupport2.java
+++ /dev/null
@@ -1,785 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.EmptyStackException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * Encapsulate Namespace tracking logic for use by SAX drivers.
- *
- * <p>This class is an attempt to rewrite the SAX NamespaceSupport
- * "helper" class for improved efficiency. It can be used to track the
- * namespace declarations currently in scope, providing lookup
- * routines to map prefixes to URIs and vice versa.</p>
- *
- * <p>ISSUE: For testing purposes, I've extended NamespaceSupport even
- * though I'm completely reasserting all behaviors and fields.
- * Wasteful.... But SAX did not put an interface under that object and
- * we seem to have written that SAX class into our APIs... and I don't
- * want to argue with it right now. </p>
- *
- * @see org.xml.sax.helpers.NamespaceSupport
- * */
-public class NamespaceSupport2
-    extends org.xml.sax.helpers.NamespaceSupport
-{
-    ////////////////////////////////////////////////////////////////////
-    // Internal state.
-    ////////////////////////////////////////////////////////////////////
-
-    private Context2 currentContext; // Current point on the double-linked stack
-
-
-    ////////////////////////////////////////////////////////////////////
-    // Constants.
-    ////////////////////////////////////////////////////////////////////
-
-
-    /**
-     * The XML Namespace as a constant.
-     *
-     * <p>This is the Namespace URI that is automatically mapped
-     * to the "xml" prefix.</p>
-     */
-    public final static String XMLNS =
-        "http://www.w3.org/XML/1998/namespace";
-
-
-    ////////////////////////////////////////////////////////////////////
-    // Constructor.
-    ////////////////////////////////////////////////////////////////////
-
-
-    /**
-     * Create a new Namespace support object.
-     */
-    public NamespaceSupport2 ()
-    {
-        reset();
-    }
-
-
-    ////////////////////////////////////////////////////////////////////
-    // Context management.
-    ////////////////////////////////////////////////////////////////////
-
-
-    /**
-     * Reset this Namespace support object for reuse.
-     *
-     * <p>It is necessary to invoke this method before reusing the
-     * Namespace support object for a new session.</p>
-     */
-    public void reset ()
-    {
-        // JJK: Discarding the whole stack doesn't save us a lot versus
-        // creating a new NamespaceSupport. Do we care, or should we
-        // change this to just reset the root context?
-        currentContext = new Context2(null);
-        currentContext.declarePrefix("xml", XMLNS);
-    }
-
-
-    /**
-     * Start a new Namespace context.
-     *
-     * <p>Normally, you should push a new context at the beginning
-     * of each XML element: the new context will automatically inherit
-     * the declarations of its parent context, but it will also keep
-     * track of which declarations were made within this context.</p>
-     *
-     * <p>The Namespace support object always starts with a base context
-     * already in force: in this context, only the "xml" prefix is
-     * declared.</p>
-     *
-     * @see #popContext
-     */
-    public void pushContext ()
-    {
-        // JJK: Context has a parent pointer.
-        // That means we don't need a stack to pop.
-        // We may want to retain for reuse, but that can be done via
-        // a child pointer.
-
-        Context2 parentContext=currentContext;
-        currentContext = parentContext.getChild();
-        if (currentContext == null){
-                currentContext = new Context2(parentContext);
-            }
-        else{
-            // JJK: This will wipe out any leftover data
-            // if we're reusing a previously allocated Context.
-            currentContext.setParent(parentContext);
-        }
-    }
-
-
-    /**
-     * Revert to the previous Namespace context.
-     *
-     * <p>Normally, you should pop the context at the end of each
-     * XML element.  After popping the context, all Namespace prefix
-     * mappings that were previously in force are restored.</p>
-     *
-     * <p>You must not attempt to declare additional Namespace
-     * prefixes after popping a context, unless you push another
-     * context first.</p>
-     *
-     * @see #pushContext
-     */
-    public void popContext ()
-    {
-        Context2 parentContext=currentContext.getParent();
-        if(parentContext==null)
-            throw new EmptyStackException();
-        else
-            currentContext = parentContext;
-    }
-
-
-
-    ////////////////////////////////////////////////////////////////////
-    // Operations within a context.
-    ////////////////////////////////////////////////////////////////////
-
-
-    /**
-     * Declare a Namespace prefix.
-     *
-     * <p>This method declares a prefix in the current Namespace
-     * context; the prefix will remain in force until this context
-     * is popped, unless it is shadowed in a descendant context.</p>
-     *
-     * <p>To declare a default Namespace, use the empty string.  The
-     * prefix must not be "xml" or "xmlns".</p>
-     *
-     * <p>Note that you must <em>not</em> declare a prefix after
-     * you've pushed and popped another Namespace.</p>
-     *
-     * <p>Note that there is an asymmetry in this library: while {@link
-     * #getPrefix getPrefix} will not return the default "" prefix,
-     * even if you have declared one; to check for a default prefix,
-     * you have to look it up explicitly using {@link #getURI getURI}.
-     * This asymmetry exists to make it easier to look up prefixes
-     * for attribute names, where the default prefix is not allowed.</p>
-     *
-     * @param prefix The prefix to declare, or null for the empty
-     *        string.
-     * @param uri The Namespace URI to associate with the prefix.
-     * @return true if the prefix was legal, false otherwise
-     * @see #processName
-     * @see #getURI
-     * @see #getPrefix
-     */
-    public boolean declarePrefix (String prefix, String uri)
-    {
-        if (prefix.equals("xml") || prefix.equals("xmlns")) {
-            return false;
-        } else {
-            currentContext.declarePrefix(prefix, uri);
-            return true;
-        }
-    }
-
-
-    /**
-     * Process a raw XML 1.0 name.
-     *
-     * <p>This method processes a raw XML 1.0 name in the current
-     * context by removing the prefix and looking it up among the
-     * prefixes currently declared.  The return value will be the
-     * array supplied by the caller, filled in as follows:</p>
-     *
-     * <dl>
-     * <dt>parts[0]</dt>
-     * <dd>The Namespace URI, or an empty string if none is
-     *  in use.</dd>
-     * <dt>parts[1]</dt>
-     * <dd>The local name (without prefix).</dd>
-     * <dt>parts[2]</dt>
-     * <dd>The original raw name.</dd>
-     * </dl>
-     *
-     * <p>All of the strings in the array will be internalized.  If
-     * the raw name has a prefix that has not been declared, then
-     * the return value will be null.</p>
-     *
-     * <p>Note that attribute names are processed differently than
-     * element names: an unprefixed element name will received the
-     * default Namespace (if any), while an unprefixed element name
-     * will not.</p>
-     *
-     * @param qName The raw XML 1.0 name to be processed.
-     * @param parts A string array supplied by the caller, capable of
-     *        holding at least three members.
-     * @param isAttribute A flag indicating whether this is an
-     *        attribute name (true) or an element name (false).
-     * @return The supplied array holding three internalized strings 
-     *        representing the Namespace URI (or empty string), the
-     *        local name, and the raw XML 1.0 name; or null if there
-     *        is an undeclared prefix.
-     * @see #declarePrefix
-     * @see java.lang.String#intern */
-    public String [] processName (String qName, String[] parts,
-                                  boolean isAttribute)
-    {
-        String[] name=currentContext.processName(qName, isAttribute);
-        if(name==null)
-            return null;
-
-        // JJK: This recopying is required because processName may return
-        // a cached result. I Don't Like It. *****
-        System.arraycopy(name,0,parts,0,3);
-        return parts;
-    }
-
-
-    /**
-     * Look up a prefix and get the currently-mapped Namespace URI.
-     *
-     * <p>This method looks up the prefix in the current context.
-     * Use the empty string ("") for the default Namespace.</p>
-     *
-     * @param prefix The prefix to look up.
-     * @return The associated Namespace URI, or null if the prefix
-     *         is undeclared in this context.
-     * @see #getPrefix
-     * @see #getPrefixes
-     */
-    public String getURI (String prefix)
-    {
-        return currentContext.getURI(prefix);
-    }
-
-
-    /**
-     * Return an enumeration of all prefixes currently declared.
-     *
-     * <p><strong>Note:</strong> if there is a default prefix, it will not be
-     * returned in this enumeration; check for the default prefix
-     * using the {@link #getURI getURI} with an argument of "".</p>
-     *
-     * @return An enumeration of all prefixes declared in the
-     *         current context except for the empty (default)
-     *         prefix.
-     * @see #getDeclaredPrefixes
-     * @see #getURI
-     */
-    public Enumeration getPrefixes ()
-    {
-        return currentContext.getPrefixes();
-    }
-
-
-    /**
-     * Return one of the prefixes mapped to a Namespace URI.
-     *
-     * <p>If more than one prefix is currently mapped to the same
-     * URI, this method will make an arbitrary selection; if you
-     * want all of the prefixes, use the {@link #getPrefixes}
-     * method instead.</p>
-     *
-     * <p><strong>Note:</strong> this will never return the empty
-     * (default) prefix; to check for a default prefix, use the {@link
-     * #getURI getURI} method with an argument of "".</p>
-     *
-     * @param uri The Namespace URI.
-     * @return One of the prefixes currently mapped to the URI supplied,
-     *         or null if none is mapped or if the URI is assigned to
-     *         the default Namespace.
-     * @see #getPrefixes(java.lang.String)
-     * @see #getURI */
-    public String getPrefix (String uri)
-    {
-        return currentContext.getPrefix(uri);
-    }
-
-
-    /**
-     * Return an enumeration of all prefixes currently declared for a URI.
-     *
-     * <p>This method returns prefixes mapped to a specific Namespace
-     * URI.  The xml: prefix will be included.  If you want only one
-     * prefix that's mapped to the Namespace URI, and you don't care 
-     * which one you get, use the {@link #getPrefix getPrefix}
-     *  method instead.</p>
-     *
-     * <p><strong>Note:</strong> the empty (default) prefix is
-     * <em>never</em> included in this enumeration; to check for the
-     * presence of a default Namespace, use the {@link #getURI getURI}
-     * method with an argument of "".</p>
-     *
-     * @param uri The Namespace URI.
-     * @return An enumeration of all prefixes declared in the
-     *         current context.
-     * @see #getPrefix
-     * @see #getDeclaredPrefixes
-     * @see #getURI */
-    public Enumeration getPrefixes (String uri)
-    {
-        // JJK: The old code involved creating a vector, filling it
-        // with all the matching prefixes, and then getting its
-        // elements enumerator. Wastes storage, wastes cycles if we
-        // don't actually need them all. Better to either implement
-        // a specific enumerator for these prefixes... or a filter
-        // around the all-prefixes enumerator, which comes out to
-        // roughly the same thing.
-        //
-        // **** Currently a filter. That may not be most efficient
-        // when I'm done restructuring storage!
-        return new PrefixForUriEnumerator(this,uri,getPrefixes());       
-    }
-    
-
-    /**
-     * Return an enumeration of all prefixes declared in this context.
-     *
-     * <p>The empty (default) prefix will be included in this 
-     * enumeration; note that this behaviour differs from that of
-     * {@link #getPrefix} and {@link #getPrefixes}.</p>
-     *
-     * @return An enumeration of all prefixes declared in this
-     *         context.
-     * @see #getPrefixes
-     * @see #getURI
-     */
-    public Enumeration getDeclaredPrefixes ()
-    {
-        return currentContext.getDeclaredPrefixes();
-    }
-
-
-
-}
-
-////////////////////////////////////////////////////////////////////
-// Local classes.
-// These were _internal_ classes... but in fact they don't have to be,
-// and may be more efficient if they aren't. 
-////////////////////////////////////////////////////////////////////
-
-/**
- * Implementation of Enumeration filter, wrapped
- * aroung the get-all-prefixes version of the operation. This is NOT
- * necessarily the most efficient approach; finding the URI and then asking
- * what prefixes apply to it might make much more sense.
- */
-class PrefixForUriEnumerator implements Enumeration
-{
-    private Enumeration allPrefixes;
-    private String uri;
-    private String lookahead=null;
-    private NamespaceSupport2 nsup;
-     
-    // Kluge: Since one can't do a constructor on an
-    // anonymous class (as far as I know)...
-    PrefixForUriEnumerator(NamespaceSupport2 nsup,String uri, Enumeration allPrefixes)
-    {
-	this.nsup=nsup;
-        this.uri=uri;
-        this.allPrefixes=allPrefixes;
-    }
-        
-    public boolean hasMoreElements()
-    {
-        if(lookahead!=null)
-            return true;
-            
-        while(allPrefixes.hasMoreElements())
-            {
-                String prefix=(String)allPrefixes.nextElement();
-                if(uri.equals(nsup.getURI(prefix)))
-                    {
-                        lookahead=prefix;
-                        return true;
-                    }
-            }
-        return false;
-    }
-        
-    public Object nextElement()
-    {
-        if(hasMoreElements())
-            {
-                String tmp=lookahead;
-                lookahead=null;
-                return tmp;
-            }
-        else
-            throw new java.util.NoSuchElementException();
-    }
-}
-
-/**
- * Internal class for a single Namespace context.
- *
- * <p>This module caches and reuses Namespace contexts, so the number allocated
- * will be equal to the element depth of the document, not to the total
- * number of elements (i.e. 5-10 rather than tens of thousands).</p>
- */
-final class Context2 {
-
-    ////////////////////////////////////////////////////////////////
-    // Manefest Constants
-    ////////////////////////////////////////////////////////////////
-        
-    /**
-     * An empty enumeration.
-     */
-    private final static Enumeration EMPTY_ENUMERATION =
-        new Vector().elements();
-
-    ////////////////////////////////////////////////////////////////
-    // Protected state.
-    ////////////////////////////////////////////////////////////////
-        
-    Hashtable prefixTable;
-    Hashtable uriTable;
-    Hashtable elementNameTable;
-    Hashtable attributeNameTable;
-    String defaultNS = null;
-
-    ////////////////////////////////////////////////////////////////
-    // Internal state.
-    ////////////////////////////////////////////////////////////////
-        
-    private Vector declarations = null;
-    private boolean tablesDirty = false;
-    private Context2 parent = null;
-    private Context2 child = null;
-
-    /**
-     * Create a new Namespace context.
-     */
-    Context2 (Context2 parent)
-    {
-        if(parent==null)
-            {
-                prefixTable = new Hashtable();
-                uriTable = new Hashtable();
-                elementNameTable=null; 
-                attributeNameTable=null; 
-            }
-        else
-            setParent(parent);
-    }
-
-        
-    /**
-     * @returns The child Namespace context object, or null if this
-     * is the last currently on the chain.
-     */
-    Context2 getChild()
-    {
-        return child;
-    }
-        
-    /**
-     * @returns The parent Namespace context object, or null if this
-     * is the root.
-     */
-    Context2 getParent()
-    {
-        return parent;
-    }
-        
-    /**
-     * (Re)set the parent of this Namespace context.
-     * This is separate from the c'tor because it's re-applied
-     * when a Context2 is reused by push-after-pop.
-     *
-     * @param context The parent Namespace context object.
-     */
-    void setParent (Context2 parent)
-    {
-        this.parent = parent;
-        parent.child = this;        // JJK: Doubly-linked
-        declarations = null;
-        prefixTable = parent.prefixTable;
-        uriTable = parent.uriTable;
-        elementNameTable = parent.elementNameTable;
-        attributeNameTable = parent.attributeNameTable;
-        defaultNS = parent.defaultNS;
-        tablesDirty = false;
-    }
-        
-        
-    /**
-     * Declare a Namespace prefix for this context.
-     *
-     * @param prefix The prefix to declare.
-     * @param uri The associated Namespace URI.
-     * @see org.xml.sax.helpers.NamespaceSupport2#declarePrefix
-     */
-    void declarePrefix (String prefix, String uri)
-    {
-                                // Lazy processing...
-        if (!tablesDirty) {
-            copyTables();
-        }
-        if (declarations == null) {
-            declarations = new Vector();
-        }
-            
-        prefix = prefix.intern();
-        uri = uri.intern();
-        if ("".equals(prefix)) {
-            if ("".equals(uri)) {
-                defaultNS = null;
-            } else {
-                defaultNS = uri;
-            }
-        } else {
-            prefixTable.put(prefix, uri);
-            uriTable.put(uri, prefix); // may wipe out another prefix
-        }
-        declarations.addElement(prefix);
-    }
-
-
-    /**
-     * Process a raw XML 1.0 name in this context.
-     *
-     * @param qName The raw XML 1.0 name.
-     * @param isAttribute true if this is an attribute name.
-     * @return An array of three strings containing the
-     *         URI part (or empty string), the local part,
-     *         and the raw name, all internalized, or null
-     *         if there is an undeclared prefix.
-     * @see org.xml.sax.helpers.NamespaceSupport2#processName
-     */
-    String [] processName (String qName, boolean isAttribute)
-    {
-        String name[];
-        Hashtable table;
-            
-                                // Select the appropriate table.
-        if (isAttribute) {
-            if(elementNameTable==null)
-                elementNameTable=new Hashtable();
-            table = elementNameTable;
-        } else {
-            if(attributeNameTable==null)
-                attributeNameTable=new Hashtable();
-            table = attributeNameTable;
-        }
-            
-                                // Start by looking in the cache, and
-                                // return immediately if the name
-                                // is already known in this content
-        name = (String[])table.get(qName);
-        if (name != null) {
-            return name;
-        }
-            
-                                // We haven't seen this name in this
-                                // context before.
-        name = new String[3];
-        int index = qName.indexOf(':');
-            
-            
-                                // No prefix.
-        if (index == -1) {
-            if (isAttribute || defaultNS == null) {
-                name[0] = "";
-            } else {
-                name[0] = defaultNS;
-            }
-            name[1] = qName.intern();
-            name[2] = name[1];
-        }
-            
-                                // Prefix
-        else {
-            String prefix = qName.substring(0, index);
-            String local = qName.substring(index+1);
-            String uri;
-            if ("".equals(prefix)) {
-                uri = defaultNS;
-            } else {
-                uri = (String)prefixTable.get(prefix);
-            }
-            if (uri == null) {
-                return null;
-            }
-            name[0] = uri;
-            name[1] = local.intern();
-            name[2] = qName.intern();
-        }
-            
-                                // Save in the cache for future use.
-        table.put(name[2], name);
-        tablesDirty = true;
-        return name;
-    }
-        
-
-    /**
-     * Look up the URI associated with a prefix in this context.
-     *
-     * @param prefix The prefix to look up.
-     * @return The associated Namespace URI, or null if none is
-     *         declared.    
-     * @see org.xml.sax.helpers.NamespaceSupport2#getURI
-     */
-    String getURI (String prefix)
-    {
-        if ("".equals(prefix)) {
-            return defaultNS;
-        } else if (prefixTable == null) {
-            return null;
-        } else {
-            return (String)prefixTable.get(prefix);
-        }
-    }
-
-
-    /**
-     * Look up one of the prefixes associated with a URI in this context.
-     *
-     * <p>Since many prefixes may be mapped to the same URI,
-     * the return value may be unreliable.</p>
-     *
-     * @param uri The URI to look up.
-     * @return The associated prefix, or null if none is declared.
-     * @see org.xml.sax.helpers.NamespaceSupport2#getPrefix
-     */
-    String getPrefix (String uri)
-    {
-        if (uriTable == null) {
-            return null;
-        } else {
-            return (String)uriTable.get(uri);
-        }
-    }
-        
-        
-    /**
-     * Return an enumeration of prefixes declared in this context.
-     *
-     * @return An enumeration of prefixes (possibly empty).
-     * @see org.xml.sax.helpers.NamespaceSupport2#getDeclaredPrefixes
-     */
-    Enumeration getDeclaredPrefixes ()
-    {
-        if (declarations == null) {
-            return EMPTY_ENUMERATION;
-        } else {
-            return declarations.elements();
-        }
-    }
-        
-        
-    /**
-     * Return an enumeration of all prefixes currently in force.
-     *
-     * <p>The default prefix, if in force, is <em>not</em>
-     * returned, and will have to be checked for separately.</p>
-     *
-     * @return An enumeration of prefixes (never empty).
-     * @see org.xml.sax.helpers.NamespaceSupport2#getPrefixes
-     */
-    Enumeration getPrefixes ()
-    {
-        if (prefixTable == null) {
-            return EMPTY_ENUMERATION;
-        } else {
-            return prefixTable.keys();
-        }
-    }
-        
-    ////////////////////////////////////////////////////////////////
-    // Internal methods.
-    ////////////////////////////////////////////////////////////////
-
-    /**
-     * Copy on write for the internal tables in this context.
-     *
-     * <p>This class is optimized for the normal case where most
-     * elements do not contain Namespace declarations. In that case,
-     * the Context2 will share data structures with its parent.
-     * New tables are obtained only when new declarations are issued,
-     * so they can be popped off the stack.</p>
-     *
-     * <p> JJK: **** Alternative: each Context2 might declare
-     *  _only_ its local bindings, and delegate upward if not found.</p>
-     */     
-    private void copyTables ()
-    {
-        // Start by copying our parent's bindings
-        prefixTable = (Hashtable)prefixTable.clone();
-        uriTable = (Hashtable)uriTable.clone();
-
-        // Replace the caches with empty ones, rather than
-        // trying to determine which bindings should be flushed.
-        // As far as I can tell, these caches are never actually
-        // used in Xalan... More efficient to remove the whole
-        // cache system? ****
-        if(elementNameTable!=null)
-            elementNameTable=new Hashtable(); 
-        if(attributeNameTable!=null)
-            attributeNameTable=new Hashtable(); 
-        tablesDirty = true;
-    }
-
-}
-
-
-// end of NamespaceSupport2.java
diff --git a/src/org/apache/xml/utils/NodeConsumer.java b/src/org/apache/xml/utils/NodeConsumer.java
deleted file mode 100644
index 0e2588b..0000000
--- a/src/org/apache/xml/utils/NodeConsumer.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.w3c.dom.Node;
-
-/**
- * The tree walker will test for this interface, and call
- * setOriginatingNode before calling the SAX event.  For creating
- * DOM backpointers for things that are normally created via
- * SAX events.
- */
-public interface NodeConsumer
-{
-
-  /**
-   * Set the node that is originating the SAX event.
-   *
-   * @param n Reference to node that originated the current event.
-   */
-  public void setOriginatingNode(Node n);
-}
diff --git a/src/org/apache/xml/utils/NodeVector.java b/src/org/apache/xml/utils/NodeVector.java
deleted file mode 100644
index ccf0fbc..0000000
--- a/src/org/apache/xml/utils/NodeVector.java
+++ /dev/null
@@ -1,775 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.io.Serializable;
-
-import org.apache.xml.dtm.DTM;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple table that stores a list of Nodes.
- */
-public class NodeVector implements Serializable, Cloneable
-{
-
-  /**
-   * Size of blocks to allocate.
-   *  @serial          
-   */
-  private int m_blocksize;
-
-  /**
-   * Array of nodes this points to.
-   *  @serial          
-   */
-  private int m_map[];
-
-  /**
-   * Number of nodes in this NodeVector.
-   *  @serial          
-   */
-  protected int m_firstFree = 0;
-
-  /**
-   * Size of the array this points to.
-   *  @serial           
-   */
-  private int m_mapSize;  // lazy initialization
-
-  /**
-   * Default constructor.
-   */
-  public NodeVector()
-  {
-    m_blocksize = 32;
-    m_mapSize = 0;
-  }
-
-  /**
-   * Construct a NodeVector, using the given block size.
-   *
-   * @param blocksize Size of blocks to allocate
-   */
-  public NodeVector(int blocksize)
-  {
-    m_blocksize = blocksize;
-    m_mapSize = 0;
-  }
-
-  /**
-   * Get a cloned LocPathIterator.
-   *
-   * @return A clone of this
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    NodeVector clone = (NodeVector) super.clone();
-
-    if ((null != this.m_map) && (this.m_map == clone.m_map))
-    {
-      clone.m_map = new int[this.m_map.length];
-
-      System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length);
-    }
-
-    return clone;
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of nodes in this NodeVector
-   */
-  public int size()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Append a Node onto the vector.
-   *
-   * @param value Node to add to the vector
-   */
-  public void addElement(int value)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      if (null == m_map)
-      {
-        m_map = new int[m_blocksize];
-        m_mapSize = m_blocksize;
-      }
-      else
-      {
-        m_mapSize += m_blocksize;
-
-        int newMap[] = new int[m_mapSize];
-
-        System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-        m_map = newMap;
-      }
-    }
-
-    m_map[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Append a Node onto the vector.
-   *
-   * @param value Node to add to the vector
-   */
-  public final void push(int value)
-  {
-
-    int ff = m_firstFree;
-
-    if ((ff + 1) >= m_mapSize)
-    {
-      if (null == m_map)
-      {
-        m_map = new int[m_blocksize];
-        m_mapSize = m_blocksize;
-      }
-      else
-      {
-        m_mapSize += m_blocksize;
-
-        int newMap[] = new int[m_mapSize];
-
-        System.arraycopy(m_map, 0, newMap, 0, ff + 1);
-
-        m_map = newMap;
-      }
-    }
-
-    m_map[ff] = value;
-
-    ff++;
-
-    m_firstFree = ff;
-  }
-
-  /**
-   * Pop a node from the tail of the vector and return the result.
-   *
-   * @return the node at the tail of the vector
-   */
-  public final int pop()
-  {
-
-    m_firstFree--;
-
-    int n = m_map[m_firstFree];
-
-    m_map[m_firstFree] = DTM.NULL;
-
-    return n;
-  }
-
-  /**
-   * Pop a node from the tail of the vector and return the
-   * top of the stack after the pop.
-   *
-   * @return The top of the stack after it's been popped
-   */
-  public final int popAndTop()
-  {
-
-    m_firstFree--;
-
-    m_map[m_firstFree] = DTM.NULL;
-
-    return (m_firstFree == 0) ? DTM.NULL : m_map[m_firstFree - 1];
-  }
-
-  /**
-   * Pop a node from the tail of the vector.
-   */
-  public final void popQuick()
-  {
-
-    m_firstFree--;
-
-    m_map[m_firstFree] = DTM.NULL;
-  }
-
-  /**
-   * Return the node at the top of the stack without popping the stack.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @return Node at the top of the stack or null if stack is empty.
-   */
-  public final int peepOrNull()
-  {
-    return ((null != m_map) && (m_firstFree > 0))
-           ? m_map[m_firstFree - 1] : DTM.NULL;
-  }
-
-  /**
-   * Push a pair of nodes into the stack.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @param v1 First node to add to vector
-   * @param v2 Second node to add to vector
-   */
-  public final void pushPair(int v1, int v2)
-  {
-
-    if (null == m_map)
-    {
-      m_map = new int[m_blocksize];
-      m_mapSize = m_blocksize;
-    }
-    else
-    {
-      if ((m_firstFree + 2) >= m_mapSize)
-      {
-        m_mapSize += m_blocksize;
-
-        int newMap[] = new int[m_mapSize];
-
-        System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
-
-        m_map = newMap;
-      }
-    }
-
-    m_map[m_firstFree] = v1;
-    m_map[m_firstFree + 1] = v2;
-    m_firstFree += 2;
-  }
-
-  /**
-   * Pop a pair of nodes from the tail of the stack.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   */
-  public final void popPair()
-  {
-
-    m_firstFree -= 2;
-    m_map[m_firstFree] = DTM.NULL;
-    m_map[m_firstFree + 1] = DTM.NULL;
-  }
-
-  /**
-   * Set the tail of the stack to the given node.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @param n Node to set at the tail of vector
-   */
-  public final void setTail(int n)
-  {
-    m_map[m_firstFree - 1] = n;
-  }
-
-  /**
-   * Set the given node one position from the tail.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @param n Node to set
-   */
-  public final void setTailSub1(int n)
-  {
-    m_map[m_firstFree - 2] = n;
-  }
-
-  /**
-   * Return the node at the tail of the vector without popping
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @return Node at the tail of the vector
-   */
-  public final int peepTail()
-  {
-    return m_map[m_firstFree - 1];
-  }
-
-  /**
-   * Return the node one position from the tail without popping.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @return Node one away from the tail
-   */
-  public final int peepTailSub1()
-  {
-    return m_map[m_firstFree - 2];
-  }
-
-  /**
-   * Insert a node in order in the list.
-   *
-   * @param value Node to insert
-   */
-  public void insertInOrder(int value)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (value < m_map[i])
-      {
-        insertElementAt(value, i);
-
-        return;
-      }
-    }
-
-    addElement(value);
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   *
-   * @param value Node to insert
-   * @param at Position where to insert
-   */
-  public void insertElementAt(int value, int at)
-  {
-
-    if (null == m_map)
-    {
-      m_map = new int[m_blocksize];
-      m_mapSize = m_blocksize;
-    }
-    else if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    if (at <= (m_firstFree - 1))
-    {
-      System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
-    }
-
-    m_map[at] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Append the nodes to the list.
-   *
-   * @param nodes NodeVector to append to this list
-   */
-  public void appendNodes(NodeVector nodes)
-  {
-
-    int nNodes = nodes.size();
-
-    if (null == m_map)
-    {
-      m_mapSize = nNodes + m_blocksize;
-      m_map = new int[m_mapSize];
-    }
-    else if ((m_firstFree + nNodes) >= m_mapSize)
-    {
-      m_mapSize += (nNodes + m_blocksize);
-
-      int newMap[] = new int[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + nNodes);
-
-      m_map = newMap;
-    }
-
-    System.arraycopy(nodes.m_map, 0, m_map, m_firstFree, nNodes);
-
-    m_firstFree += nNodes;
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   */
-  public void removeAllElements()
-  {
-
-    if (null == m_map)
-      return;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      m_map[i] = DTM.NULL;
-    }
-
-    m_firstFree = 0;
-  }
-  
-  /**
-   * Set the length to zero, but don't clear the array.
-   */
-  public void RemoveAllNoClear()
-  {
-
-    if (null == m_map)
-      return;
-
-    m_firstFree = 0;
-  }
-
-  /**
-   * Removes the first occurrence of the argument from this vector.
-   * If the object is found in this vector, each component in the vector
-   * with an index greater or equal to the object's index is shifted
-   * downward to have an index one smaller than the value it had
-   * previously.
-   *
-   * @param s Node to remove from the list
-   *
-   * @return True if the node was successfully removed
-   */
-  public boolean removeElement(int s)
-  {
-
-    if (null == m_map)
-      return false;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      int node = m_map[i];
-
-      if (node == s)
-      {
-        if (i > m_firstFree)
-          System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
-        else
-          m_map[i] = DTM.NULL;
-
-        m_firstFree--;
-
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  /**
-   * Deletes the component at the specified index. Each component in
-   * this vector with an index greater or equal to the specified
-   * index is shifted downward to have an index one smaller than
-   * the value it had previously.
-   *
-   * @param i Index of node to remove
-   */
-  public void removeElementAt(int i)
-  {
-
-    if (null == m_map)
-      return;
-
-    if (i > m_firstFree)
-      System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
-    else
-      m_map[i] = DTM.NULL;
-  }
-
-  /**
-   * Sets the component at the specified index of this vector to be the
-   * specified object. The previous component at that position is discarded.
-   *
-   * The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.
-   *
-   * @param node Node to set
-   * @param index Index of where to set the node
-   */
-  public void setElementAt(int node, int index)
-  {
-
-    if (null == m_map)
-    {
-      m_map = new int[m_blocksize];
-      m_mapSize = m_blocksize;
-    }
-
-    m_map[index] = node;
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i Index of node to get
-   *
-   * @return Node at specified index
-   */
-  public int elementAt(int i)
-  {
-
-    if (null == m_map)
-      return DTM.NULL;
-
-    return m_map[i];
-  }
-
-  /**
-   * Tell if the table contains the given node.
-   *
-   * @param s Node to look for
-   *
-   * @return True if the given node was found.
-   */
-  public boolean contains(int s)
-  {
-
-    if (null == m_map)
-      return false;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      int node = m_map[i];
-
-      if (node == s)
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Node to look for
-   * @param index Index of where to start the search
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(int elem, int index)
-  {
-
-    if (null == m_map)
-      return -1;
-
-    for (int i = index; i < m_firstFree; i++)
-    {
-      int node = m_map[i];
-
-      if (node == elem)
-        return i;
-    }
-
-    return -1;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Node to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(int elem)
-  {
-
-    if (null == m_map)
-      return -1;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      int node = m_map[i];
-
-      if (node == elem)
-        return i;
-    }
-
-    return -1;
-  }
-
-  /**
-   * Sort an array using a quicksort algorithm.
-   *
-   * @param a The array to be sorted.
-   * @param lo0  The low index.
-   * @param hi0  The high index.
-   *
-   * @throws Exception
-   */
-  public void sort(int a[], int lo0, int hi0) throws Exception
-  {
-
-    int lo = lo0;
-    int hi = hi0;
-
-    // pause(lo, hi);
-    if (lo >= hi)
-    {
-      return;
-    }
-    else if (lo == hi - 1)
-    {
-
-      /*
-       *  sort a two element list by swapping if necessary
-       */
-      if (a[lo] > a[hi])
-      {
-        int T = a[lo];
-
-        a[lo] = a[hi];
-        a[hi] = T;
-      }
-
-      return;
-    }
-
-    /*
-     *  Pick a pivot and move it out of the way
-     */
-    int pivot = a[(lo + hi) / 2];
-
-    a[(lo + hi) / 2] = a[hi];
-    a[hi] = pivot;
-
-    while (lo < hi)
-    {
-
-      /*
-       *  Search forward from a[lo] until an element is found that
-       *  is greater than the pivot or lo >= hi
-       */
-      while (a[lo] <= pivot && lo < hi)
-      {
-        lo++;
-      }
-
-      /*
-       *  Search backward from a[hi] until element is found that
-       *  is less than the pivot, or lo >= hi
-       */
-      while (pivot <= a[hi] && lo < hi)
-      {
-        hi--;
-      }
-
-      /*
-       *  Swap elements a[lo] and a[hi]
-       */
-      if (lo < hi)
-      {
-        int T = a[lo];
-
-        a[lo] = a[hi];
-        a[hi] = T;
-
-        // pause();
-      }
-
-      // if (stopRequested) {
-      //    return;
-      // }
-    }
-
-    /*
-     *  Put the median in the "center" of the list
-     */
-    a[hi0] = a[hi];
-    a[hi] = pivot;
-
-    /*
-     *  Recursive calls, elements a[lo0] to a[lo-1] are less than or
-     *  equal to pivot, elements a[hi+1] to a[hi0] are greater than
-     *  pivot.
-     */
-    sort(a, lo0, lo - 1);
-    sort(a, hi + 1, hi0);
-  }
-
-  /**
-   * Sort an array using a quicksort algorithm.
-   *
-   * @param a The array to be sorted.
-   * @param lo0  The low index.
-   * @param hi0  The high index.
-   *
-   * @throws Exception
-   */
-  public void sort() throws Exception
-  {
-    sort(m_map, 0, m_firstFree - 1);
-  }
-}
diff --git a/src/org/apache/xml/utils/ObjectPool.java b/src/org/apache/xml/utils/ObjectPool.java
deleted file mode 100644
index 56e1931..0000000
--- a/src/org/apache/xml/utils/ObjectPool.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.*;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * <meta name="usage" content="internal"/>
- * Pool of object of a given type to pick from to help memory usage
- */
-public class ObjectPool implements java.io.Serializable
-{
-
-  /** Type of objects in this pool.
-   *  @serial          */
-  private final Class objectType;
-
-  /** Vector of given objects this points to.
-   *  @serial          */
-  private final Vector freeStack;
-
-  /**
-   * Constructor ObjectPool
-   *
-   * @param type Type of objects for this pool
-   */
-  public ObjectPool(Class type)
-  {
-    objectType = type;
-    freeStack = new Vector();
-  }
-  
-  /**
-   * Constructor ObjectPool
-   *
-   * @param className Fully qualified name of the type of objects for this pool.
-   */
-  public ObjectPool(String className)
-  {
-    try
-    {
-      objectType = Class.forName(className);
-    }
-    catch(ClassNotFoundException cnfe)
-    {
-      throw new WrappedRuntimeException(cnfe);
-    }
-    freeStack = new Vector();
-  }
-
-
-  /**
-   * Constructor ObjectPool
-   *
-   *
-   * @param type Type of objects for this pool
-   * @param size Size of vector to allocate
-   */
-  public ObjectPool(Class type, int size)
-  {
-    objectType = type;
-    freeStack = new Vector(size);
-  }
-
-  /**
-   * Constructor ObjectPool
-   *
-   */
-  public ObjectPool()
-  {
-    objectType = null;
-    freeStack = new Vector();
-  }
-
-  /**
-   * Get an instance of the given object in this pool if available
-   *
-   *
-   * @return an instance of the given object if available or null
-   */
-  public synchronized Object getInstanceIfFree()
-  {
-
-    // Check if the pool is empty.
-    if (!freeStack.isEmpty())
-    {
-
-      // Remove object from end of free pool.
-      Object result = freeStack.lastElement();
-
-      freeStack.setSize(freeStack.size() - 1);
-
-      return result;
-    }
-
-    return null;
-  }
-
-  /**
-   * Get an instance of the given object in this pool 
-   *
-   *
-   * @return An instance of the given object
-   */
-  public synchronized Object getInstance()
-  {
-
-    // Check if the pool is empty.
-    if (freeStack.isEmpty())
-    {
-
-      // Create a new object if so.
-      try
-      {
-        return objectType.newInstance();
-      }
-      catch (InstantiationException ex){}
-      catch (IllegalAccessException ex){}
-
-      // Throw unchecked exception for error in pool configuration.
-      throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_EXCEPTION_CREATING_POOL, null)); //"exception creating new instance for pool");
-    }
-    else
-    {
-
-      // Remove object from end of free pool.
-      Object result = freeStack.lastElement();
-
-      freeStack.setSize(freeStack.size() - 1);
-
-      return result;
-    }
-  }
-
-  /**
-   * Add an instance of the given object to the pool  
-   *
-   *
-   * @param obj Object to add.
-   */
-  public synchronized void freeInstance(Object obj)
-  {
-
-    // Make sure the object is of the correct type.
-    // Remove safety.  -sb
-    // if (objectType.isInstance(obj))
-    // {
-    freeStack.addElement(obj);
-    // }
-    // else
-    // {
-    //  throw new IllegalArgumentException("argument type invalid for pool");
-    // }
-  }
-}
diff --git a/src/org/apache/xml/utils/PrefixResolver.java b/src/org/apache/xml/utils/PrefixResolver.java
deleted file mode 100644
index 6f612da..0000000
--- a/src/org/apache/xml/utils/PrefixResolver.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="advanced"/>
- * The class that implements this interface can resolve prefixes to
- * namespaces. Examples would include resolving the meaning of a
- * prefix at a particular point in a document, or mapping the prefixes
- * used in an XPath expression.
- */
-public interface PrefixResolver
-{
-
-  /**
-   * Given a namespace, get the corrisponding prefix.  This assumes that
-   * the PrefixResolver holds its own namespace context, or is a namespace
-   * context itself.
-   *
-   * @param prefix The prefix to look up, which may be an empty string ("") for the default Namespace.
-   *
-   * @return The associated Namespace URI, or null if the prefix
-   *         is undeclared in this context.
-   */
-  String getNamespaceForPrefix(String prefix);
-
-  /**
-   * Given a namespace, get the corresponding prefix, based on the context node.
-   *
-   * @param prefix The prefix to look up, which may be an empty string ("") for the default Namespace.
-   * @param context The node context from which to look up the URI.
-   *
-   * @return The associated Namespace URI as a string, or null if the prefix
-   *         is undeclared in this context.
-   */
-  String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context);
-
-  /**
-   * Return the base identifier.
-   *
-   * @return The base identifier from where relative URIs should be absolutized, or null 
-   * if the base ID is unknown.
-   * <p>
-   * CAVEAT: Note that the base URI in an XML document may vary with where
-   * you are in the document, if part of the doc's contents were brought in
-   * via an external entity reference or if mechanisms such as xml:base have
-   * been used. Unless this PrefixResolver is bound to a specific portion of
-   * the document, or has been kept up to date via some other mechanism, it
-   * may not accurately reflect that context information.
-   */
-  public String getBaseIdentifier();
-}
diff --git a/src/org/apache/xml/utils/PrefixResolverDefault.java b/src/org/apache/xml/utils/PrefixResolverDefault.java
deleted file mode 100644
index 4b2c847..0000000
--- a/src/org/apache/xml/utils/PrefixResolverDefault.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * <meta name="usage" content="general"/>
- * This class implements a generic PrefixResolver that
- * can be used to perform prefix-to-namespace lookup
- * for the XPath object.
- */
-public class PrefixResolverDefault implements PrefixResolver
-{
-
-  /**
-   * The context to resolve the prefix from, if the context
-   * is not given.
-   */
-  Node m_context;
-
-  /**
-   * The URI for the XML namespace.
-   * (Duplicate of that found in org.apache.xpath.XPathContext).
-   */
-  public static final String S_XMLNAMESPACEURI =
-    "http://www.w3.org/XML/1998/namespace";
-
-  /**
-   * Construct a PrefixResolverDefault object.
-   * @param xpathExpressionContext The context from
-   * which XPath expression prefixes will be resolved.
-   * Warning: This will not work correctly if xpathExpressionContext
-   * is an attribute node.
-   * @param xpathExpressionContext Node from which to start searching for a
-   * xmlns attribute that binds a prefix to a namespace (when the namespace
-   * context is not specified in the getNamespaceForPrefix call).
-   */
-  public PrefixResolverDefault(Node xpathExpressionContext)
-  {
-    m_context = xpathExpressionContext;
-  }
-
-  /**
-   * Given a namespace, get the corrisponding prefix.  This assumes that
-   * the PrevixResolver hold's it's own namespace context, or is a namespace
-   * context itself.
-   * @param prefix Prefix to resolve.
-   * @return Namespace that prefix resolves to, or null if prefix
-   * is not bound.
-   */
-  public String getNamespaceForPrefix(String prefix)
-  {
-    return getNamespaceForPrefix(prefix, m_context);
-  }
-
-  /**
-   * Given a namespace, get the corrisponding prefix.
-   * Warning: This will not work correctly if namespaceContext
-   * is an attribute node.
-   * @param prefix Prefix to resolve.
-   * @param namespaceContext Node from which to start searching for a
-   * xmlns attribute that binds a prefix to a namespace.
-   * @return Namespace that prefix resolves to, or null if prefix
-   * is not bound.
-   */
-  public String getNamespaceForPrefix(String prefix,
-                                      org.w3c.dom.Node namespaceContext)
-  {
-
-    Node parent = namespaceContext;
-    String namespace = null;
-
-    if (prefix.equals("xml"))
-    {
-      namespace = S_XMLNAMESPACEURI;
-    }
-    else
-    {
-      int type;
-
-      while ((null != parent) && (null == namespace)
-             && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
-                 || (type == Node.ENTITY_REFERENCE_NODE)))
-      {
-        if (type == Node.ELEMENT_NODE)
-        {
-          NamedNodeMap nnm = parent.getAttributes();
-
-          for (int i = 0; i < nnm.getLength(); i++)
-          {
-            Node attr = nnm.item(i);
-            String aname = attr.getNodeName();
-            boolean isPrefix = aname.startsWith("xmlns:");
-
-            if (isPrefix || aname.equals("xmlns"))
-            {
-              int index = aname.indexOf(':');
-              String p = isPrefix ? aname.substring(index + 1) : "";
-
-              if (p.equals(prefix))
-              {
-                namespace = attr.getNodeValue();
-
-                break;
-              }
-            }
-          }
-        }
-
-        parent = parent.getParentNode();
-      }
-    }
-
-    return namespace;
-  }
-
-  /**
-   * Return the base identifier.
-   *
-   * @return null
-   */
-  public String getBaseIdentifier()
-  {
-    return null;
-  }
-}
diff --git a/src/org/apache/xml/utils/QName.java b/src/org/apache/xml/utils/QName.java
deleted file mode 100644
index 17821d6..0000000
--- a/src/org/apache/xml/utils/QName.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-import org.w3c.dom.Element;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * <meta name="usage" content="general"/>
- * Class to represent a qualified name: "The name of an internal XSLT object,
- * specifically a named template (see [7 Named Templates]), a mode (see [6.7 Modes]),
- * an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2 Keys]),
- * a locale (see [14.3 Number Formatting]), a variable or a parameter (see
- * [12 Variables and Parameters]) is specified as a QName. If it has a prefix,
- * then the prefix is expanded into a URI reference using the namespace declarations
- * in effect on the attribute in which the name occurs. The expanded name
- * consisting of the local part of the name and the possibly null URI reference
- * is used as the name of the object. The default namespace is not used for
- * unprefixed names."
- */
-public class QName implements java.io.Serializable
-{
-
-  /**
-   * The local name.
-   * @serial
-   */
-  protected String _localName;
-
-  /**
-   * The namespace URI.
-   * @serial
-   */
-  protected String _namespaceURI;
-
-  /**
-   * The namespace prefix.
-   * @serial
-   */
-  protected String _prefix;
-
-  /**
-   * The XML namespace.
-   */
-  public static final String S_XMLNAMESPACEURI =
-    "http://www.w3.org/XML/1998/namespace";
-
-  /**
-   * The cached hashcode, which is calculated at construction time.
-   * @serial
-   */
-  private int m_hashCode;
-
-  /**
-   * Constructs an empty QName.
-   * 20001019: Try making this public, to support Serializable? -- JKESS
-   */
-  public QName(){}
-
-  /**
-   * Constructs a new QName with the specified namespace URI and
-   * local name.
-   *
-   * @param namespaceURI The namespace URI if known, or null
-   * @param localName The local name
-   */
-  public QName(String namespaceURI, String localName)
-  {
-
-    if (localName == null)
-      throw new IllegalArgumentException(XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");
-
-    _namespaceURI = namespaceURI;
-    _localName = localName;
-    m_hashCode = toString().hashCode();
-  }
-
-  /**
-   * Constructs a new QName with the specified namespace URI, prefix
-   * and local name.
-   *
-   * @param namespaceURI The namespace URI if known, or null
-   * @param prefix The namespace prefix is known, or null
-   * @param localName The local name
-   */
-  public QName(String namespaceURI, String prefix, String localName)
-  {
-
-    if (localName == null)
-      throw new IllegalArgumentException(XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");
-
-    _namespaceURI = namespaceURI;
-    _prefix = prefix;
-    _localName = localName;
-    m_hashCode = toString().hashCode();
-  }
-
-  /**
-   * Construct a QName from a string, without namespace resolution.  Good
-   * for a few odd cases.
-   *
-   * @param localName Local part of qualified name
-   */
-  public QName(String localName)
-  {
-
-    if (localName == null)
-      throw new IllegalArgumentException(XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");
-
-    _namespaceURI = null;
-    _localName = localName;
-    m_hashCode = toString().hashCode();
-  }
-
-  /**
-   * Construct a QName from a string, resolving the prefix
-   * using the given namespace stack. The default namespace is
-   * not resolved.
-   *
-   * @param qname Qualified name to resolve
-   * @param namespaces Namespace stack to use to resolve namespace
-   */
-  public QName(String qname, Stack namespaces)
-  {
-
-    String namespace = null;
-    String prefix = null;
-    int indexOfNSSep = qname.indexOf(':');
-
-    if (indexOfNSSep > 0)
-    {
-      prefix = qname.substring(0, indexOfNSSep);
-
-      if (prefix.equals("xml"))
-      {
-        namespace = S_XMLNAMESPACEURI;
-      }
-      else if (prefix.equals("xmlns"))
-      {
-        return;
-      }
-      else
-      {
-        int depth = namespaces.size();
-
-        for (int i = depth - 1; i >= 0; i--)
-        {
-          NameSpace ns = (NameSpace) namespaces.elementAt(i);
-
-          while (null != ns)
-          {
-            if ((null != ns.m_prefix) && prefix.equals(ns.m_prefix))
-            {
-              namespace = ns.m_uri;
-              i = -1;
-
-              break;
-            }
-
-            ns = ns.m_next;
-          }
-        }
-      }
-
-      if (null == namespace)
-      {
-        throw new RuntimeException(
-          XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
-            new Object[]{ prefix }));  //"Prefix must resolve to a namespace: "+prefix);
-      }
-    }
-
-    _localName = (indexOfNSSep < 0)
-                 ? qname : qname.substring(indexOfNSSep + 1);
-    _namespaceURI = namespace;
-    _prefix = prefix;
-    m_hashCode = toString().hashCode();
-  }
-
-  /**
-   * Construct a QName from a string, resolving the prefix
-   * using the given namespace context and prefix resolver. 
-   * The default namespace is not resolved.
-   * 
-   * @param qname Qualified name to resolve
-   * @param namespaceContext Namespace Context to use
-   * @param resolver Prefix resolver for this context
-   */
-  public QName(String qname, Element namespaceContext,
-               PrefixResolver resolver)
-  {
-
-    _namespaceURI = null;
-
-    int indexOfNSSep = qname.indexOf(':');
-
-    if (indexOfNSSep > 0)
-    {
-      if (null != namespaceContext)
-      {
-        String prefix = qname.substring(0, indexOfNSSep);
-
-        _prefix = prefix;
-
-        if (prefix.equals("xml"))
-        {
-          _namespaceURI = S_XMLNAMESPACEURI;
-        }
-        else
-        {
-          _namespaceURI = resolver.getNamespaceForPrefix(prefix,
-                  namespaceContext);
-        }
-
-        if (null == _namespaceURI)
-        {
-          throw new RuntimeException(
-            XSLMessages.createXPATHMessage(
-              XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
-              new Object[]{ prefix }));  //"Prefix must resolve to a namespace: "+prefix);
-        }
-      }
-      else
-      {
-
-        // TODO: error or warning...
-      }
-    }
-
-    _localName = (indexOfNSSep < 0)
-                 ? qname : qname.substring(indexOfNSSep + 1);
-    m_hashCode = toString().hashCode();
-  }
-
-  /**
-   * Construct a QName from a string, resolving the prefix
-   * using the given namespace stack. The default namespace is
-   * not resolved.
-   *
-   * @param qname Qualified name to resolve
-   * @param resolver Prefix resolver for this context
-   */
-  public QName(String qname, PrefixResolver resolver)
-  {
-
-    _namespaceURI = null;
-
-    int indexOfNSSep = qname.indexOf(':');
-
-    if (indexOfNSSep > 0)
-    {
-      String prefix = qname.substring(0, indexOfNSSep);
-
-      if (prefix.equals("xml"))
-      {
-        _namespaceURI = S_XMLNAMESPACEURI;
-      }
-      else
-      {
-        _namespaceURI = resolver.getNamespaceForPrefix(prefix);
-      }
-
-      if (null == _namespaceURI)
-      {
-        throw new RuntimeException(
-          XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
-            new Object[]{ prefix }));  //"Prefix must resolve to a namespace: "+prefix);
-      }
-    }
-
-    _localName = (indexOfNSSep < 0)
-                 ? qname : qname.substring(indexOfNSSep + 1);
-    m_hashCode = toString().hashCode();
-  }
-
-  /**
-   * Returns the namespace URI. Returns null if the namespace URI
-   * is not known.
-   *
-   * @return The namespace URI, or null
-   */
-  public String getNamespaceURI()
-  {
-    return _namespaceURI;
-  }
-
-  /**
-   * Returns the namespace prefix. Returns null if the namespace
-   * prefix is not known.
-   *
-   * @return The namespace prefix, or null
-   */
-  public String getPrefix()
-  {
-    return _prefix;
-  }
-
-  /**
-   * Returns the local part of the qualified name.
-   *
-   * @return The local part of the qualified name
-   */
-  public String getLocalName()
-  {
-    return _localName;
-  }
-
-  /**
-   * Return the string representation of the qualified name, using the 
-   * prefix if available, or the '{ns}foo' notation if not. Performs
-   * string concatenation, so beware of performance issues.
-   *
-   * @return the string representation of the namespace
-   */
-  public String toString()
-  {
-
-    return _prefix != null
-           ? (_prefix + ":" + _localName)
-           : (_namespaceURI != null
-              ? ("{"+_namespaceURI + "}" + _localName) : _localName);
-  }
-  
-  /**
-   * Return the string representation of the qualified name using the 
-   * the '{ns}foo' notation. Performs
-   * string concatenation, so beware of performance issues.
-   *
-   * @return the string representation of the namespace
-   */
-  public String toNamespacedString()
-  {
-
-    return (_namespaceURI != null
-              ? ("{"+_namespaceURI + "}" + _localName) : _localName);
-  }
-
-
-  /**
-   * Get the namespace of the qualified name.
-   *
-   * @return the namespace URI of the qualified name
-   */
-  public String getNamespace()
-  {
-    return getNamespaceURI();
-  }
-
-  /**
-   * Get the local part of the qualified name.
-   *
-   * @return the local part of the qualified name
-   */
-  public String getLocalPart()
-  {
-    return getLocalName();
-  }
-
-  /**
-   * Return the cached hashcode of the qualified name.
-   *
-   * @return the cached hashcode of the qualified name
-   */
-  public int hashCode()
-  {
-    return m_hashCode;
-  }
-
-  /**
-   * Override equals and agree that we're equal if
-   * the passed object is a string and it matches
-   * the name of the arg.
-   *
-   * @param ns Namespace URI to compare to
-   * @param localPart Local part of qualified name to compare to 
-   *
-   * @return True if the local name and uri match 
-   */
-  public boolean equals(String ns, String localPart)
-  {
-
-    String thisnamespace = getNamespaceURI();
-
-    return getLocalName().equals(localPart)
-           && (((null != thisnamespace) && (null != ns))
-               ? thisnamespace.equals(ns)
-               : ((null == thisnamespace) && (null == ns)));
-  }
-
-  /**
-   * Override equals and agree that we're equal if
-   * the passed object is a QName and it matches
-   * the name of the arg.
-   *
-   * @param qname Qualified name to compare to 
-   *
-   * @return True if the qualified names are equal
-   */
-  public boolean equals(Object object)
-  {
-
-    if (object == this)
-      return true;
-
-    if (object instanceof QName) {
-      QName qname = (QName) object;
-      String thisnamespace = getNamespaceURI();
-      String thatnamespace = qname.getNamespaceURI();
-
-      return getLocalName().equals(qname.getLocalName())
-             && (((null != thisnamespace) && (null != thatnamespace))
-                 ? thisnamespace.equals(thatnamespace)
-                 : ((null == thisnamespace) && (null == thatnamespace)));
-    }
-    else
-      return false;
-  }
-
-  /**
-   * Given a string, create and return a QName object  
-   *
-   *
-   * @param name String to use to create QName
-   *
-   * @return a QName object
-   */
-  public static QName getQNameFromString(String name)
-  {
-
-    StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
-    QName qname;
-    String s1 = tokenizer.nextToken();
-    String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
-
-    if (null == s2)
-      qname = new QName(null, s1);
-    else
-      qname = new QName(s1, s2);
-
-    return qname;
-  }
-
-  /**
-   * This function tells if a raw attribute name is a
-   * xmlns attribute.
-   *
-   * @param attRawName Raw name of attribute
-   *
-   * @return True if the attribute starts with or is equal to xmlns 
-   */
-  public static boolean isXMLNSDecl(String attRawName)
-  {
-
-    return (attRawName.startsWith("xmlns")
-            && (attRawName.equals("xmlns")
-                || attRawName.startsWith("xmlns:")));
-  }
-
-  /**
-   * This function tells if a raw attribute name is a
-   * xmlns attribute.
-   *
-   * @param attRawName Raw name of attribute
-   *
-   * @return Prefix of attribute
-   */
-  public static String getPrefixFromXMLNSDecl(String attRawName)
-  {
-
-    int index = attRawName.indexOf(':');
-
-    return (index >= 0) ? attRawName.substring(index + 1) : "";
-  }
-
-  /**
-   * Returns the local name of the given node.
-   *
-   * @param qname Input name
-   *
-   * @return Local part of the name if prefixed, or the given name if not
-   */
-  public static String getLocalPart(String qname)
-  {
-
-    int index = qname.indexOf(':');
-
-    return (index < 0) ? qname : qname.substring(index + 1);
-  }
-
-  /**
-   * Returns the local name of the given node.
-   *
-   * @param qname Input name 
-   *
-   * @return Prefix of name or empty string if none there   
-   */
-  public static String getPrefixPart(String qname)
-  {
-
-    int index = qname.indexOf(':');
-
-    return (index >= 0) ? qname.substring(0, index) : "";
-  }
-}
diff --git a/src/org/apache/xml/utils/RawCharacterHandler.java b/src/org/apache/xml/utils/RawCharacterHandler.java
deleted file mode 100644
index 2f41979..0000000
--- a/src/org/apache/xml/utils/RawCharacterHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="advanced"/>
- * An interface that a Serializer/ContentHandler/ContentHandler must
- * implement in order for disable-output-escaping to work.
- */
-public interface RawCharacterHandler
-{
-
-  /**
-   * Serialize the characters without escaping.
-   *
-   * @param ch Array of characters
-   * @param start Start index of characters in the array
-   * @param length Number of characters in the array
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void charactersRaw(char ch[], int start, int length)
-    throws javax.xml.transform.TransformerException;
-}
diff --git a/src/org/apache/xml/utils/SAXSourceLocator.java b/src/org/apache/xml/utils/SAXSourceLocator.java
deleted file mode 100644
index da798ed..0000000
--- a/src/org/apache/xml/utils/SAXSourceLocator.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import javax.xml.transform.SourceLocator;
-
-import org.xml.sax.helpers.LocatorImpl;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
-
-import java.io.Serializable;
-
-/**
- * Class SAXSourceLocator extends org.xml.sax.helpers.LocatorImpl
- * for the purpose of implementing the SourceLocator interface, 
- * and thus can be both a SourceLocator and a SAX Locator.
- */
-public class SAXSourceLocator extends LocatorImpl
-        implements SourceLocator, Serializable
-{
-  /** The SAX Locator object.
-   *  @serial
-   */
-  Locator m_locator;
-
-  /**
-   * Constructor SAXSourceLocator
-   *
-   */
-  public SAXSourceLocator(){}
-
-  /**
-   * Constructor SAXSourceLocator
-   *
-   *
-   * @param locator Source locator
-   */
-  public SAXSourceLocator(Locator locator)
-  {
-    m_locator = locator;
-    this.setColumnNumber(locator.getColumnNumber());
-    this.setLineNumber(locator.getLineNumber());
-    this.setPublicId(locator.getPublicId());
-    this.setSystemId(locator.getSystemId());
-  }
-  
-  /**
-   * Constructor SAXSourceLocator
-   *
-   *
-   * @param spe SAXParseException exception.
-   */
-  public SAXSourceLocator(SAXParseException spe)
-  {
-    this.setLineNumber( spe.getLineNumber() );
-    this.setColumnNumber( spe.getColumnNumber() );
-    this.setPublicId( spe.getPublicId() );
-    this.setSystemId( spe.getSystemId() );
-  }
-  
-  /**
-   * Return the public identifier for the current document event.
-   *
-   * <p>The return value is the public identifier of the document
-   * entity or of the external parsed entity in which the markup
-   * triggering the event appears.</p>
-   *
-   * @return A string containing the public identifier, or
-   *         null if none is available.
-   * @see #getSystemId
-   */
-  public String getPublicId()
-  {
-    return (null == m_locator) ? super.getPublicId() : m_locator.getPublicId();
-  }
-
-  /**
-   * Return the system identifier for the current document event.
-   *
-   * <p>The return value is the system identifier of the document
-   * entity or of the external parsed entity in which the markup
-   * triggering the event appears.</p>
-   *
-   * <p>If the system identifier is a URL, the parser must resolve it
-   * fully before passing it to the application.</p>
-   *
-   * @return A string containing the system identifier, or null
-   *         if none is available.
-   * @see #getPublicId
-   */
-  public String getSystemId()
-  {
-    return (null == m_locator) ? super.getSystemId() : m_locator.getSystemId();
-  }
-  
-  /**
-   * Return the line number where the current document event ends.
-   *
-   * <p><strong>Warning:</strong> The return value from the method
-   * is intended only as an approximation for the sake of error
-   * reporting; it is not intended to provide sufficient information
-   * to edit the character content of the original XML document.</p>
-   *
-   * <p>The return value is an approximation of the line number
-   * in the document entity or external parsed entity where the
-   * markup triggering the event appears.</p>
-   *
-   * @return The line number, or -1 if none is available.
-   * @see #getColumnNumber
-   */
-  public int getLineNumber()
-  {
-    return (null == m_locator) ? super.getLineNumber() : m_locator.getLineNumber();
-  }
-
-  /**
-   * Return the column number where the current document event ends.
-   *
-   * <p><strong>Warning:</strong> The return value from the method
-   * is intended only as an approximation for the sake of error
-   * reporting; it is not intended to provide sufficient information
-   * to edit the character content of the original XML document.</p>
-   *
-   * <p>The return value is an approximation of the column number
-   * in the document entity or external parsed entity where the
-   * markup triggering the event appears.</p>
-   *
-   * @return The column number, or -1 if none is available.
-   * @see #getLineNumber
-   */
-  public int getColumnNumber()
-  {
-    return (null == m_locator) ? super.getColumnNumber() : m_locator.getColumnNumber();
-  }
-}
diff --git a/src/org/apache/xml/utils/SerializableLocatorImpl.java b/src/org/apache/xml/utils/SerializableLocatorImpl.java
deleted file mode 100644
index ecf60f1..0000000
--- a/src/org/apache/xml/utils/SerializableLocatorImpl.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-
-/**
- * The standard SAX implementation of LocatorImpl is not serializable,
- * limiting its utility as "a persistent snapshot of a locator".
- * This is a quick hack to make it so. Note that it makes more sense
- * in many cases to set up fields to hold this data rather than pointing
- * at another object... but that decision should be made on architectural
- * grounds rather than serializability.
- *<p>
- * It isn't clear whether subclassing LocatorImpl and adding serialization
- * methods makes more sense than copying it and just adding Serializable
- * to its interface. Since it's so simple, I've taken the latter approach
- * for now.
- *
- * @see org.xml.sax.helpers.LocatorImpl
- * @see org.xml.sax.Locator Locator
- * @since XalanJ2
- * @author Joe Kesselman
- * @version 1.0
- */
-public class SerializableLocatorImpl
-implements org.xml.sax.Locator, java.io.Serializable
-
-{
-    /**
-     * Zero-argument constructor.
-     *
-     * <p>SAX says "This will not normally be useful, since the main purpose
-     * of this class is to make a snapshot of an existing Locator." In fact,
-     * it _is_ sometimes useful when you want to construct a new Locator
-     * pointing to a specific location... which, after all, is why the
-     * setter methods are provided.
-     * </p>
-     */
-    public SerializableLocatorImpl ()
-    {
-    }
-    
-    
-    /**
-     * Copy constructor.
-     *
-     * <p>Create a persistent copy of the current state of a locator.
-     * When the original locator changes, this copy will still keep
-     * the original values (and it can be used outside the scope of
-     * DocumentHandler methods).</p>
-     *
-     * @param locator The locator to copy.
-     */
-    public SerializableLocatorImpl (org.xml.sax.Locator locator)
-    {
-        setPublicId(locator.getPublicId());
-        setSystemId(locator.getSystemId());
-        setLineNumber(locator.getLineNumber());
-        setColumnNumber(locator.getColumnNumber());
-    }
-    
-    
-    ////////////////////////////////////////////////////////////////////
-    // Implementation of org.xml.sax.Locator
-    ////////////////////////////////////////////////////////////////////
-    
-    
-    /**
-     * Return the saved public identifier.
-     *
-     * @return The public identifier as a string, or null if none
-     *         is available.
-     * @see org.xml.sax.Locator#getPublicId
-     * @see #setPublicId
-     */
-    public String getPublicId ()
-    {
-        return publicId;
-    }
-    
-    
-    /**
-     * Return the saved system identifier.
-     *
-     * @return The system identifier as a string, or null if none
-     *         is available.
-     * @see org.xml.sax.Locator#getSystemId
-     * @see #setSystemId
-     */
-    public String getSystemId ()
-    {
-        return systemId;
-    }
-    
-    
-    /**
-     * Return the saved line number (1-based).
-     *
-     * @return The line number as an integer, or -1 if none is available.
-     * @see org.xml.sax.Locator#getLineNumber
-     * @see #setLineNumber
-     */
-    public int getLineNumber ()
-    {
-        return lineNumber;
-    }
-    
-    
-    /**
-     * Return the saved column number (1-based).
-     *
-     * @return The column number as an integer, or -1 if none is available.
-     * @see org.xml.sax.Locator#getColumnNumber
-     * @see #setColumnNumber
-     */
-    public int getColumnNumber ()
-    {
-        return columnNumber;
-    }
-    
-    
-    ////////////////////////////////////////////////////////////////////
-    // Setters for the properties (not in org.xml.sax.Locator)
-    ////////////////////////////////////////////////////////////////////
-    
-    
-    /**
-     * Set the public identifier for this locator.
-     *
-     * @param publicId The new public identifier, or null 
-     *        if none is available.
-     * @see #getPublicId
-     */
-    public void setPublicId (String publicId)
-    {
-        this.publicId = publicId;
-    }
-    
-    
-    /**
-     * Set the system identifier for this locator.
-     *
-     * @param systemId The new system identifier, or null 
-     *        if none is available.
-     * @see #getSystemId
-     */
-    public void setSystemId (String systemId)
-    {
-        this.systemId = systemId;
-    }
-    
-    
-    /**
-     * Set the line number for this locator (1-based).
-     *
-     * @param lineNumber The line number, or -1 if none is available.
-     * @see #getLineNumber
-     */
-    public void setLineNumber (int lineNumber)
-    {
-        this.lineNumber = lineNumber;
-    }
-    
-    
-    /**
-     * Set the column number for this locator (1-based).
-     *
-     * @param columnNumber The column number, or -1 if none is available.
-     * @see #getColumnNumber
-     */
-    public void setColumnNumber (int columnNumber)
-    {
-        this.columnNumber = columnNumber;
-    }
-    
-    
-    ////////////////////////////////////////////////////////////////////
-    // Internal state.
-    ////////////////////////////////////////////////////////////////////
-    
-    /**
-     * The public ID.
-     * @serial
-     */
-    private String publicId;
-    
-    /**
-     * The system ID.
-     * @serial
-     */
-    private String systemId;
-    
-    /**
-     * The line number.
-     * @serial
-     */
-    private int lineNumber;
-    
-    /**
-     * The column number.
-     * @serial
-     */
-    private int columnNumber;
-    
-}
-
-// end of LocatorImpl.java
diff --git a/src/org/apache/xml/utils/StringBufferPool.java b/src/org/apache/xml/utils/StringBufferPool.java
deleted file mode 100644
index f0add51..0000000
--- a/src/org/apache/xml/utils/StringBufferPool.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class pools string buffers, since they are reused so often.
- * String buffers are good candidates for pooling, because of 
- * their supporting character arrays.
- */
-public class StringBufferPool
-{
-
-  /** The global pool of string buffers.   */
-  private static ObjectPool m_stringBufPool =
-    new ObjectPool(org.apache.xml.utils.FastStringBuffer.class);
-
-  /**
-   * Get the first free instance of a string buffer, or create one 
-   * if there are no free instances.
-   *
-   * @return A string buffer ready for use.
-   */
-  public synchronized static FastStringBuffer get()
-  {
-    return (FastStringBuffer) m_stringBufPool.getInstance();
-  }
-
-  /**
-   * Return a string buffer back to the pool.
-   *
-   * @param sb Must be a non-null reference to a string buffer.
-   */
-  public synchronized static void free(FastStringBuffer sb)
-  {
-    // Since this isn't synchronized, setLength must be 
-    // done before the instance is freed.
-    // Fix attributed to Peter Speck <speck@ruc.dk>.
-    sb.setLength(0);
-    m_stringBufPool.freeInstance(sb);
-  }
-}
diff --git a/src/org/apache/xml/utils/StringToIntTable.java b/src/org/apache/xml/utils/StringToIntTable.java
deleted file mode 100644
index 16888c1..0000000
--- a/src/org/apache/xml/utils/StringToIntTable.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple lookup table that stores a list of strings, the even
- * number strings being keys, and the odd number strings being values.
- */
-public class StringToIntTable
-{
-
-  /** Block size to allocate          */
-  private int m_blocksize;
-
-  /** Array of strings this table points to. Associated with ints
-   * in m_values         */
-  private String m_map[];
-
-  /** Array of ints this table points. Associated with strings from
-   * m_map.         */
-  private int m_values[];
-
-  /** Number of ints in the table          */
-  private int m_firstFree = 0;
-
-  /** Size of this table         */
-  private int m_mapSize;
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public StringToIntTable()
-  {
-
-    m_blocksize = 8;
-    m_mapSize = m_blocksize;
-    m_map = new String[m_blocksize];
-    m_values = new int[m_blocksize];
-  }
-
-  /**
-   * Construct a StringToIntTable, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public StringToIntTable(int blocksize)
-  {
-
-    m_blocksize = blocksize;
-    m_mapSize = blocksize;
-    m_map = new String[blocksize];
-    m_values = new int[m_blocksize];
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return the length of the list 
-   */
-  public final int getLength()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Append a string onto the vector.
-   *
-   * @param key String to append
-   * @param value The int value of the string
-   */
-  public final void put(String key, int value)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      String newMap[] = new String[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-
-      int newValues[] = new int[m_mapSize];
-
-      System.arraycopy(m_values, 0, newValues, 0, m_firstFree + 1);
-
-      m_values = newValues;
-    }
-
-    m_map[m_firstFree] = key;
-    m_values[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param key String to look for
-   *
-   * @return The String's int value or a bogus value if not found 
-   */
-  public final int get(String key)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i].equals(key))
-        return m_values[i];
-    }
-
-    return -10000;  // Bogus value, needs to throw exception.
-  }
-
-  /**
-   * Tell if the table contains the given string. Ignore case.
-   *
-   * @param key String to look for
-   *
-   * @return The string's int value, or a bogus value if not found
-   */
-  public final int getIgnoreCase(String key)
-  {
-
-    if (null == key)
-      return -10000;  // Bogus value, needs to throw exception.
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i].equalsIgnoreCase(key))
-        return m_values[i];
-    }
-
-    return -10000;  // Bogus value, needs to throw exception.
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param key String to look for
-   *
-   * @return True if the string is in the table
-   */
-  public final boolean contains(String key)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i].equals(key))
-        return true;
-    }
-
-    return false;
-  }
-}
diff --git a/src/org/apache/xml/utils/StringToStringTable.java b/src/org/apache/xml/utils/StringToStringTable.java
deleted file mode 100644
index 6f1a35c..0000000
--- a/src/org/apache/xml/utils/StringToStringTable.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple lookup table that stores a list of strings, the even
- * number strings being keys, and the odd number strings being values.
- */
-public class StringToStringTable
-{
-
-  /** Size of blocks to allocate          */
-  private int m_blocksize;
-
-  /** Array of strings this contains          */
-  private String m_map[];
-
-  /** Number of strings this contains           */
-  private int m_firstFree = 0;
-
-  /** Size of this table           */
-  private int m_mapSize;
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public StringToStringTable()
-  {
-
-    m_blocksize = 16;
-    m_mapSize = m_blocksize;
-    m_map = new String[m_blocksize];
-  }
-
-  /**
-   * Construct a StringToStringTable, using the given block size.
-   *
-   * @param blocksize Size of blocks to allocate 
-   */
-  public StringToStringTable(int blocksize)
-  {
-
-    m_blocksize = blocksize;
-    m_mapSize = blocksize;
-    m_map = new String[blocksize];
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of strings in the list
-   */
-  public final int getLength()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Append a string onto the vector.
-   * The strings go to the even locations in the array 
-   * and the values in the odd. 
-   *
-   * @param key String to add to the list 
-   * @param value Value of the string
-   */
-  public final void put(String key, String value)
-  {
-
-    if ((m_firstFree + 2) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      String newMap[] = new String[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    m_map[m_firstFree] = key;
-
-    m_firstFree++;
-
-    m_map[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param key String to look up
-   *
-   * @return return the value of the string or null if not found. 
-   */
-  public final String get(String key)
-  {
-
-    for (int i = 0; i < m_firstFree; i += 2)
-    {
-      if (m_map[i].equals(key))
-        return m_map[i + 1];
-    }
-
-    return null;
-  }
-
-  /**
-   * Remove the given string and its value from this table.
-   *
-   * @param key String to remove from the table
-   */
-  public final void remove(String key)
-  {
-
-    for (int i = 0; i < m_firstFree; i += 2)
-    {
-      if (m_map[i].equals(key))
-      {
-        if ((i + 2) < m_firstFree)
-          System.arraycopy(m_map, i + 2, m_map, i, m_firstFree - (i + 2));
-
-        m_firstFree -= 2;
-        m_map[m_firstFree] = null;
-        m_map[m_firstFree + 1] = null;
-
-        break;
-      }
-    }
-  }
-
-  /**
-   * Tell if the table contains the given string. Ignore case
-   *
-   * @param key String to look up
-   *
-   * @return The value of the string or null if not found
-   */
-  public final String getIgnoreCase(String key)
-  {
-
-    if (null == key)
-      return null;
-
-    for (int i = 0; i < m_firstFree; i += 2)
-    {
-      if (m_map[i].equalsIgnoreCase(key))
-        return m_map[i + 1];
-    }
-
-    return null;
-  }
-
-  /**
-   * Tell if the table contains the given string in the value.
-   *
-   * @param val Value of the string to look up
-   *
-   * @return the string associated with the given value or null if not found
-   */
-  public final String getByValue(String val)
-  {
-
-    for (int i = 1; i < m_firstFree; i += 2)
-    {
-      if (m_map[i].equals(val))
-        return m_map[i - 1];
-    }
-
-    return null;
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i index of the string to look up.
-   *
-   * @return The string at the given index.
-   */
-  public final String elementAt(int i)
-  {
-    return m_map[i];
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param key String to look up
-   *
-   * @return True if the given string is in this table 
-   */
-  public final boolean contains(String key)
-  {
-
-    for (int i = 0; i < m_firstFree; i += 2)
-    {
-      if (m_map[i].equals(key))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param val value to look up
-   *
-   * @return True if the given value is in the table.
-   */
-  public final boolean containsValue(String val)
-  {
-
-    for (int i = 1; i < m_firstFree; i += 2)
-    {
-      if (m_map[i].equals(val))
-        return true;
-    }
-
-    return false;
-  }
-}
diff --git a/src/org/apache/xml/utils/StringToStringTableVector.java b/src/org/apache/xml/utils/StringToStringTableVector.java
deleted file mode 100644
index 43b6eeb..0000000
--- a/src/org/apache/xml/utils/StringToStringTableVector.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple table that stores a list of StringToStringTables, optimized
- * for small lists.
- */
-public class StringToStringTableVector
-{
-
-  /** Size of blocks to allocate         */
-  private int m_blocksize;
-
-  /** Array of StringToStringTable objects          */
-  private StringToStringTable m_map[];
-
-  /** Number of StringToStringTable objects in this array          */
-  private int m_firstFree = 0;
-
-  /** Size of this array          */
-  private int m_mapSize;
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public StringToStringTableVector()
-  {
-
-    m_blocksize = 8;
-    m_mapSize = m_blocksize;
-    m_map = new StringToStringTable[m_blocksize];
-  }
-
-  /**
-   * Construct a StringToStringTableVector, using the given block size.
-   *
-   * @param blocksize Size of blocks to allocate 
-   */
-  public StringToStringTableVector(int blocksize)
-  {
-
-    m_blocksize = blocksize;
-    m_mapSize = blocksize;
-    m_map = new StringToStringTable[blocksize];
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of StringToStringTable objects in the list
-   */
-  public final int getLength()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of StringToStringTable objects in the list
-   */
-  public final int size()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Append a StringToStringTable object onto the vector.
-   *
-   * @param value StringToStringTable object to add
-   */
-  public final void addElement(StringToStringTable value)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      StringToStringTable newMap[] = new StringToStringTable[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    m_map[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Given a string, find the last added occurance value
-   * that matches the key.
-   *
-   * @param key String to look up
-   *
-   * @return the last added occurance value that matches the key
-   * or null if not found.
-   */
-  public final String get(String key)
-  {
-
-    for (int i = m_firstFree - 1; i >= 0; --i)
-    {
-      String nsuri = m_map[i].get(key);
-
-      if (nsuri != null)
-        return nsuri;
-    }
-
-    return null;
-  }
-
-  /**
-   * Given a string, find out if there is a value in this table
-   * that matches the key.
-   *
-   * @param key String to look for  
-   *
-   * @return True if the string was found in table, null if not
-   */
-  public final boolean containsKey(String key)
-  {
-
-    for (int i = m_firstFree - 1; i >= 0; --i)
-    {
-      if (m_map[i].get(key) != null)
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Remove the last element.
-   */
-  public final void removeLastElem()
-  {
-
-    if (m_firstFree > 0)
-    {
-      m_map[m_firstFree] = null;
-
-      m_firstFree--;
-    }
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i Index of element to find
-   *
-   * @return The StringToStringTable object at the given index
-   */
-  public final StringToStringTable elementAt(int i)
-  {
-    return m_map[i];
-  }
-
-  /**
-   * Tell if the table contains the given StringToStringTable.
-   *
-   * @param s The StringToStringTable to find
-   *
-   * @return True if the StringToStringTable is found
-   */
-  public final boolean contains(StringToStringTable s)
-  {
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i].equals(s))
-        return true;
-    }
-
-    return false;
-  }
-}
diff --git a/src/org/apache/xml/utils/StringVector.java b/src/org/apache/xml/utils/StringVector.java
deleted file mode 100644
index df4b4f0..0000000
--- a/src/org/apache/xml/utils/StringVector.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple table that stores a list of strings, optimized
- * for small lists.
- */
-public class StringVector implements java.io.Serializable
-{
-
-  /** @serial Size of blocks to allocate           */
-  protected int m_blocksize;
-
-  /** @serial Array of strings this contains          */
-  protected String m_map[];
-
-  /** @serial Number of strings this contains          */
-  protected int m_firstFree = 0;
-
-  /** @serial Size of the array          */
-  protected int m_mapSize;
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public StringVector()
-  {
-
-    m_blocksize = 8;
-    m_mapSize = m_blocksize;
-    m_map = new String[m_blocksize];
-  }
-
-  /**
-   * Construct a StringVector, using the given block size.
-   *
-   * @param blocksize Size of the blocks to allocate 
-   */
-  public StringVector(int blocksize)
-  {
-
-    m_blocksize = blocksize;
-    m_mapSize = blocksize;
-    m_map = new String[blocksize];
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of strings in the list 
-   */
-  public int getLength()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of strings in the list
-   */
-  public final int size()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Append a string onto the vector.
-   *
-   * @param value Sting to add to the vector
-   */
-  public final void addElement(String value)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      String newMap[] = new String[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    m_map[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i Index of string to find
-   *
-   * @return String at given index
-   */
-  public final String elementAt(int i)
-  {
-    return m_map[i];
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param s String to look for
-   *
-   * @return True if the string is in this table  
-   */
-  public final boolean contains(String s)
-  {
-
-    if (null == s)
-      return false;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i].equals(s))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Tell if the table contains the given string. Ignore case.
-   *
-   * @param s String to find
-   *
-   * @return True if the String is in this vector
-   */
-  public final boolean containsIgnoreCase(String s)
-  {
-
-    if (null == s)
-      return false;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      if (m_map[i].equalsIgnoreCase(s))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Tell if the table contains the given string.
-   *
-   * @param s String to push into the vector
-   */
-  public final void push(String s)
-  {
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      String newMap[] = new String[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    m_map[m_firstFree] = s;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Pop the tail of this vector.
-   *
-   * @return The String last added to this vector or null not found.
-   * The string is removed from the vector.
-   */
-  public final String pop()
-  {
-
-    if (m_firstFree <= 0)
-      return null;
-
-    m_firstFree--;
-
-    String s = m_map[m_firstFree];
-
-    m_map[m_firstFree] = null;
-
-    return s;
-  }
-
-  /**
-   * Get the string at the tail of this vector without popping.
-   *
-   * @return The string at the tail of this vector.
-   */
-  public final String peek()
-  {
-    return (m_firstFree <= 0) ? null : m_map[m_firstFree - 1];
-  }
-}
diff --git a/src/org/apache/xml/utils/SuballocatedByteVector.java b/src/org/apache/xml/utils/SuballocatedByteVector.java
deleted file mode 100644
index b910e1c..0000000
--- a/src/org/apache/xml/utils/SuballocatedByteVector.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple table that stores a list of byte. Very similar API to our
- * IntVector class (same API); different internal storage.
- * 
- * This version uses an array-of-arrays solution. Read/write access is thus
- * a bit slower than the simple IntVector, and basic storage is a trifle
- * higher due to the top-level array -- but appending is O(1) fast rather
- * than O(N**2) slow, which will swamp those costs in situations where
- * long vectors are being built up.
- * 
- * Known issues:
- * 
- * Some methods are private because they haven't yet been tested properly.
- * 
- * If an element has not been set (because we skipped it), its value will
- * initially be 0. Shortening the vector does not clear old storage; if you
- * then skip values and setElementAt a higher index again, you may see old data
- * reappear in the truncated-and-restored section. Doing anything else would
- * have performance costs.
- */
-public class SuballocatedByteVector
-{
-  /** Size of blocks to allocate          */
-  protected int m_blocksize;
-  
-  /** Number of blocks to (over)allocate by */
-  protected  int m_numblocks=32;
-  
-  /** Array of arrays of bytes          */
-  protected byte m_map[][];
-
-  /** Number of bytes in array          */
-  protected int m_firstFree = 0;
-
-  /** "Shortcut" handle to m_map[0] */
-  protected byte m_map0[];
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public SuballocatedByteVector()
-  {
-    this(2048);
-  }
-
-  /**
-   * Construct a ByteVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public SuballocatedByteVector(int blocksize)
-  {
-    m_blocksize = blocksize;
-    m_map0=new byte[blocksize];
-    m_map = new byte[m_numblocks][];
-    m_map[0]=m_map0;
-  }
-  
-  /**
-   * Construct a ByteVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public SuballocatedByteVector(int blocksize, int increaseSize)
-  {
-    // increaseSize not currently used.
-    this(blocksize);
-  }
-
-
-  /**
-   * Get the length of the list.
-   *
-   * @return length of the list
-   */
-  public int size()
-  {
-    return m_firstFree;
-  }
-  
-  /**
-   * Set the length of the list.
-   *
-   * @return length of the list
-   */
-  private  void setSize(int sz)
-  {
-    if(m_firstFree<sz)
-      m_firstFree = sz;
-  }
-
-  /**
-   * Append a byte onto the vector.
-   *
-   * @param value Byte to add to the list 
-   */
-  public  void addElement(byte value)
-  {
-    if(m_firstFree<m_blocksize)
-      m_map0[m_firstFree++]=value;
-    else
-    {
-      int index=m_firstFree/m_blocksize;
-      int offset=m_firstFree%m_blocksize;
-      ++m_firstFree;
-
-      if(index>=m_map.length)
-      {
-        int newsize=index+m_numblocks;
-        byte[][] newMap=new byte[newsize][];
-        System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-        m_map=newMap;
-      }
-      byte[] block=m_map[index];
-      if(null==block)
-        block=m_map[index]=new byte[m_blocksize];
-      block[offset]=value;
-    }
-  }
-  
-  /**
-   * Append several byte values onto the vector.
-   *
-   * @param value Byte to add to the list 
-   */
-  private  void addElements(byte value, int numberOfElements)
-  {
-    if(m_firstFree+numberOfElements<m_blocksize)
-      for (int i = 0; i < numberOfElements; i++) 
-      {
-        m_map0[m_firstFree++]=value;
-      }
-    else
-    {
-      int index=m_firstFree/m_blocksize;
-      int offset=m_firstFree%m_blocksize;
-      m_firstFree+=numberOfElements;
-      while( numberOfElements>0)
-      {
-        if(index>=m_map.length)
-        {
-          int newsize=index+m_numblocks;
-          byte[][] newMap=new byte[newsize][];
-          System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-          m_map=newMap;
-        }
-        byte[] block=m_map[index];
-        if(null==block)
-          block=m_map[index]=new byte[m_blocksize];
-        int copied=(m_blocksize-offset < numberOfElements)
-          ? m_blocksize-offset : numberOfElements;
-        numberOfElements-=copied;
-        while(copied-- > 0)
-          block[offset++]=value;
-
-        ++index;offset=0;
-      }
-    }
-  }
-  
-  /**
-   * Append several slots onto the vector, but do not set the values.
-   * Note: "Not Set" means the value is unspecified.
-   *
-   * @param value Byte to add to the list 
-   */
-  private  void addElements(int numberOfElements)
-  {
-    int newlen=m_firstFree+numberOfElements;
-    if(newlen>m_blocksize)
-    {
-      int index=m_firstFree%m_blocksize;
-      int newindex=(m_firstFree+numberOfElements)%m_blocksize;
-      for(int i=index+1;i<=newindex;++i)
-        m_map[i]=new byte[m_blocksize];
-    }
-    m_firstFree=newlen;
-  }
-  
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   *
-   * Insertion may be an EXPENSIVE operation!
-   *
-   * @param value Byte to insert
-   * @param at Index of where to insert 
-   */
-  private  void insertElementAt(byte value, int at)
-  {
-    if(at==m_firstFree)
-      addElement(value);
-    else if (at>m_firstFree)
-    {
-      int index=at/m_blocksize;
-      if(index>=m_map.length)
-      {
-        int newsize=index+m_numblocks;
-        byte[][] newMap=new byte[newsize][];
-        System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-        m_map=newMap;
-      }
-      byte[] block=m_map[index];
-      if(null==block)
-        block=m_map[index]=new byte[m_blocksize];
-      int offset=at%m_blocksize;
-      block[offset]=value;
-      m_firstFree=offset+1;
-    }
-    else
-    {
-      int index=at/m_blocksize;
-      int maxindex=m_firstFree+1/m_blocksize;
-      ++m_firstFree;
-      int offset=at%m_blocksize;
-      byte push;
-      
-      // ***** Easier to work down from top?
-      while(index<=maxindex)
-      {
-        int copylen=m_blocksize-offset-1;
-        byte[] block=m_map[index];
-        if(null==block)
-        {
-          push=0;
-          block=m_map[index]=new byte[m_blocksize];
-        }
-        else
-        {
-          push=block[m_blocksize-1];
-          System.arraycopy(block, offset , block, offset+1, copylen);
-        }
-        block[offset]=value;
-        value=push;
-        offset=0;
-        ++index;
-      }
-    }
-  }
-
-  /**
-   * Wipe it out. 
-   */
-  public void removeAllElements()
-  {
-    m_firstFree = 0;
-  }
-
-  /**
-   * Removes the first occurrence of the argument from this vector.
-   * If the object is found in this vector, each component in the vector
-   * with an index greater or equal to the object's index is shifted
-   * downward to have an index one smaller than the value it had
-   * previously.
-   *
-   * @param s Byte to remove from array
-   *
-   * @return True if the byte was removed, false if it was not found
-   */
-  private  boolean removeElement(byte s)
-  {
-    int at=indexOf(s,0);
-    if(at<0)
-      return false;
-    removeElementAt(at);
-    return true;
-  }
-
-  /**
-   * Deletes the component at the specified index. Each component in
-   * this vector with an index greater or equal to the specified
-   * index is shifted downward to have an index one smaller than
-   * the value it had previously.
-   *
-   * @param at index of where to remove a byte
-   */
-  private  void removeElementAt(int at)
-  {
-    // No point in removing elements that "don't exist"...  
-    if(at<m_firstFree)
-    {
-      int index=at/m_blocksize;
-      int maxindex=m_firstFree/m_blocksize;
-      int offset=at%m_blocksize;
-      
-      while(index<=maxindex)
-      {
-        int copylen=m_blocksize-offset-1;
-        byte[] block=m_map[index];
-        if(null==block)
-          block=m_map[index]=new byte[m_blocksize];
-        else
-          System.arraycopy(block, offset+1, block, offset, copylen);
-        if(index<maxindex)
-        {
-          byte[] next=m_map[index+1];
-          if(next!=null)
-            block[m_blocksize-1]=(next!=null) ? next[0] : 0;
-        }
-        else
-          block[m_blocksize-1]=0;
-        offset=0;
-        ++index;
-      }
-    }
-    --m_firstFree;
-  }
-
-  /**
-   * Sets the component at the specified index of this vector to be the
-   * specified object. The previous component at that position is discarded.
-   *
-   * The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.
-   *
-   * @param node object to set
-   * @param index Index of where to set the object
-   */
-  public void setElementAt(byte value, int at)
-  {
-    if(at<m_blocksize)
-    {
-      m_map0[at]=value;
-      return;
-    }
-
-    int index=at/m_blocksize;
-    int offset=at%m_blocksize;
-        
-    if(index>=m_map.length)
-    {
-      int newsize=index+m_numblocks;
-      byte[][] newMap=new byte[newsize][];
-      System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-      m_map=newMap;
-    }
-
-    byte[] block=m_map[index];
-    if(null==block)
-      block=m_map[index]=new byte[m_blocksize];
-    block[offset]=value;
-
-    if(at>=m_firstFree)
-      m_firstFree=at+1;
-  }
-
-  /**
-   * Get the nth element. This is often at the innermost loop of an
-   * application, so performance is critical.
-   *
-   * @param i index of value to get
-   *
-   * @return value at given index. If that value wasn't previously set,
-   * the result is undefined for performance reasons. It may throw an
-   * exception (see below), may return zero, or (if setSize has previously
-   * been used) may return stale data.
-   *
-   * @throw ArrayIndexOutOfBoundsException if the index was _clearly_
-   * unreasonable (negative, or past the highest block).
-   *
-   * @throw NullPointerException if the index points to a block that could
-   * have existed (based on the highest index used) but has never had anything
-   * set into it.
-   * %REVIEW% Could add a catch to create the block in that case, or return 0.
-   * Try/Catch is _supposed_ to be nearly free when not thrown to. Do we
-   * believe that? Should we have a separate safeElementAt?
-   */
-  public byte elementAt(int i)
-  {
-    // %OPT% Does this really buy us anything? Test versus division for small,
-    // test _plus_ division for big docs.
-    if(i<m_blocksize)
-      return m_map0[i];
-
-    return m_map[i/m_blocksize][i%m_blocksize];
-  }
-
-  /**
-   * Tell if the table contains the given node.
-   *
-   * @param s object to look for
-   *
-   * @return true if the object is in the list
-   */
-  private  boolean contains(byte s)
-  {
-    return (indexOf(s,0) >= 0);
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem object to look for
-   * @param index Index of where to begin search
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(byte elem, int index)
-  {
-    if(index>=m_firstFree)
-      return -1;
-          
-    int bindex=index/m_blocksize;
-    int boffset=index%m_blocksize;
-    int maxindex=m_firstFree/m_blocksize;
-    byte[] block;
-    
-    for(;bindex<maxindex;++bindex)
-    {
-      block=m_map[bindex];
-      if(block!=null)
-        for(int offset=boffset;offset<m_blocksize;++offset)
-          if(block[offset]==elem)
-            return offset+bindex*m_blocksize;
-      boffset=0; // after first
-    }
-    // Last block may need to stop before end
-    int maxoffset=m_firstFree%m_blocksize;
-    block=m_map[maxindex];
-    for(int offset=boffset;offset<maxoffset;++offset)
-      if(block[offset]==elem)
-        return offset+maxindex*m_blocksize;
-
-    return -1;    
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem object to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(byte elem)
-  {
-    return indexOf(elem,0);
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Object to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  private  int lastIndexOf(byte elem)
-  {
-    int boffset=m_firstFree%m_blocksize;
-    for(int index=m_firstFree/m_blocksize;
-        index>=0;
-        --index)
-    {
-      byte[] block=m_map[index];
-      if(block!=null)
-        for(int offset=boffset; offset>=0; --offset)
-          if(block[offset]==elem)
-            return offset+index*m_blocksize;
-      boffset=0; // after first
-    }
-    return -1;
-  }
-
-}
diff --git a/src/org/apache/xml/utils/SuballocatedIntVector.java b/src/org/apache/xml/utils/SuballocatedIntVector.java
deleted file mode 100644
index 7d7256a..0000000
--- a/src/org/apache/xml/utils/SuballocatedIntVector.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A very simple table that stores a list of int. Very similar API to our
- * IntVector class (same API); different internal storage.
- * 
- * This version uses an array-of-arrays solution. Read/write access is thus
- * a bit slower than the simple IntVector, and basic storage is a trifle
- * higher due to the top-level array -- but appending is O(1) fast rather
- * than O(N**2) slow, which will swamp those costs in situations where
- * long vectors are being built up.
- * 
- * Known issues:
- *
- * Current chunking is based on /%. Shift/mask _should_ be faster, if
- * power-of-two chunksizes are acceptable. (Would be in a real language,
- * anyway...) Some compilers _may_ be smart enough to convert the former
- * to the latter if the block size is a constant power of two... so we have
- * our choice of locking in a specific size, or converting to shift/mask,
- * or both...
- * 
- * Some methods are private because they haven't yet been tested properly.
- *
- * Retrieval performance is critical, since this is used at the core
- * of the DTM model. (Construction performance is almost as
- * important.) That's pushing me toward just letting reads of unset
- * indices throw exceptions or return stale data; safer behavior would
- * have performance costs. */
-public class SuballocatedIntVector
-{
-  /** Size of blocks to allocate          */
-  protected int m_blocksize;
-  
-  /** Number of blocks to (over)allocate by */
-  protected  int m_numblocks=32;
-  
-  /** Array of arrays of ints          */
-  protected int m_map[][];
-
-  /** Number of ints in array          */
-  protected int m_firstFree = 0;
-
-  /** "Shortcut" handle to m_map[0] */
-  protected int m_map0[];
-
-  /**
-   * Default constructor.  Note that the default
-   * block size is very small, for small lists.
-   */
-  public SuballocatedIntVector()
-  {
-    this(2048);
-  }
-
-  /**
-   * Construct a IntVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public SuballocatedIntVector(int blocksize)
-  {
-    m_blocksize = blocksize;
-    m_map0=new int[blocksize];
-    m_map = new int[m_numblocks][];
-    m_map[0]=m_map0;
-  }
-  
-  /**
-   * Construct a IntVector, using the given block size.
-   *
-   * @param blocksize Size of block to allocate
-   */
-  public SuballocatedIntVector(int blocksize, int increaseSize)
-  {
-    // increaseSize not currently used.
-    this(blocksize);
-  }
-
-
-  /**
-   * Get the length of the list.
-   *
-   * @return length of the list
-   */
-  public int size()
-  {
-    return m_firstFree;
-  }
-  
-  /**
-   * Set the length of the list.
-   *
-   * @return length of the list
-   */
-  private  void setSize(int sz)
-  {
-    if(m_firstFree<sz)
-      m_firstFree = sz;
-  }
-
-  /**
-   * Append a int onto the vector.
-   *
-   * @param value Int to add to the list 
-   */
-  public  void addElement(int value)
-  {
-    if(m_firstFree<m_blocksize)
-      m_map0[m_firstFree++]=value;
-    else
-    {
-      // Growing the outer array should be rare. We initialize to a
-      // total of m_blocksize squared elements, which at the default
-      // size is 4M integers... and we grow by at least that much each
-      // time.  However, attempts to microoptimize for this (assume
-      // long enough and catch exceptions) yield no noticable
-      // improvement.
-
-      int index=m_firstFree/m_blocksize;
-      int offset=m_firstFree%m_blocksize;
-
-      if(index>=m_map.length)
-      {
-	int newsize=index+m_numblocks;
-	int[][] newMap=new int[newsize][];
-	System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-	m_map=newMap;
-      }
-      int[] block=m_map[index];
-      if(null==block)
-	block=m_map[index]=new int[m_blocksize];
-      block[offset]=value;
-
-      ++m_firstFree;
-    }
-  }
-  
-  /**
-   * Append several int values onto the vector.
-   *
-   * @param value Int to add to the list 
-   */
-  private  void addElements(int value, int numberOfElements)
-  {
-    if(m_firstFree+numberOfElements<m_blocksize)
-      for (int i = 0; i < numberOfElements; i++) 
-      {
-        m_map0[m_firstFree++]=value;
-      }
-    else
-    {
-      int index=m_firstFree/m_blocksize;
-      int offset=m_firstFree%m_blocksize;
-      m_firstFree+=numberOfElements;
-      while( numberOfElements>0)
-      {
-        if(index>=m_map.length)
-        {
-          int newsize=index+m_numblocks;
-          int[][] newMap=new int[newsize][];
-          System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-          m_map=newMap;
-        }
-        int[] block=m_map[index];
-        if(null==block)
-          block=m_map[index]=new int[m_blocksize];
-        int copied=(m_blocksize-offset < numberOfElements)
-          ? m_blocksize-offset : numberOfElements;
-        numberOfElements-=copied;
-        while(copied-- > 0)
-          block[offset++]=value;
-
-        ++index;offset=0;
-      }
-    }
-  }
-  
-  /**
-   * Append several slots onto the vector, but do not set the values.
-   * Note: "Not Set" means the value is unspecified.
-   *
-   * @param value Int to add to the list 
-   */
-  private  void addElements(int numberOfElements)
-  {
-    int newlen=m_firstFree+numberOfElements;
-    if(newlen>m_blocksize)
-    {
-      int index=m_firstFree%m_blocksize;
-      int newindex=(m_firstFree+numberOfElements)%m_blocksize;
-      for(int i=index+1;i<=newindex;++i)
-        m_map[i]=new int[m_blocksize];
-    }
-    m_firstFree=newlen;
-  }
-  
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   *
-   * Insertion may be an EXPENSIVE operation!
-   *
-   * @param value Int to insert
-   * @param at Index of where to insert 
-   */
-  private  void insertElementAt(int value, int at)
-  {
-    if(at==m_firstFree)
-      addElement(value);
-    else if (at>m_firstFree)
-    {
-      int index=at/m_blocksize;
-      if(index>=m_map.length)
-      {
-        int newsize=index+m_numblocks;
-        int[][] newMap=new int[newsize][];
-        System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-        m_map=newMap;
-      }
-      int[] block=m_map[index];
-      if(null==block)
-        block=m_map[index]=new int[m_blocksize];
-      int offset=at%m_blocksize;
-          block[offset]=value;
-          m_firstFree=offset+1;
-        }
-    else
-    {
-      int index=at/m_blocksize;
-      int maxindex=m_firstFree/m_blocksize; // %REVIEW% (m_firstFree+1?)
-      ++m_firstFree;
-      int offset=at%m_blocksize;
-      int push;
-      
-      // ***** Easier to work down from top?
-      while(index<=maxindex)
-      {
-        int copylen=m_blocksize-offset-1;
-        int[] block=m_map[index];
-        if(null==block)
-        {
-          push=0;
-          block=m_map[index]=new int[m_blocksize];
-        }
-        else
-        {
-          push=block[m_blocksize-1];
-          System.arraycopy(block, offset , block, offset+1, copylen);
-        }
-        block[offset]=value;
-        value=push;
-        offset=0;
-        ++index;
-      }
-    }
-  }
-
-  /**
-   * Wipe it out. Currently defined as equivalent to setSize(0).
-   */
-  public void removeAllElements()
-  {
-    m_firstFree = 0;
-  }
-
-  /**
-   * Removes the first occurrence of the argument from this vector.
-   * If the object is found in this vector, each component in the vector
-   * with an index greater or equal to the object's index is shifted
-   * downward to have an index one smaller than the value it had
-   * previously.
-   *
-   * @param s Int to remove from array
-   *
-   * @return True if the int was removed, false if it was not found
-   */
-  private  boolean removeElement(int s)
-  {
-    int at=indexOf(s,0);
-    if(at<0)
-      return false;
-    removeElementAt(at);
-    return true;
-  }
-
-  /**
-   * Deletes the component at the specified index. Each component in
-   * this vector with an index greater or equal to the specified
-   * index is shifted downward to have an index one smaller than
-   * the value it had previously.
-   *
-   * @param i index of where to remove and int
-   */
-  private  void removeElementAt(int at)
-  {
-        // No point in removing elements that "don't exist"...  
-    if(at<m_firstFree)
-    {
-      int index=at/m_blocksize;
-      int maxindex=m_firstFree/m_blocksize;
-      int offset=at%m_blocksize;
-      
-      while(index<=maxindex)
-      {
-        int copylen=m_blocksize-offset-1;
-        int[] block=m_map[index];
-        if(null==block)
-          block=m_map[index]=new int[m_blocksize];
-        else
-          System.arraycopy(block, offset+1, block, offset, copylen);
-        if(index<maxindex)
-        {
-          int[] next=m_map[index+1];
-          if(next!=null)
-            block[m_blocksize-1]=(next!=null) ? next[0] : 0;
-        }
-        else
-          block[m_blocksize-1]=0;
-        offset=0;
-        ++index;
-      }
-    }
-    --m_firstFree;
-  }
-
-  /**
-   * Sets the component at the specified index of this vector to be the
-   * specified object. The previous component at that position is discarded.
-   *
-   * The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.
-   *
-   * @param node object to set
-   * @param index Index of where to set the object
-   */
-  public void setElementAt(int value, int at)
-  {
-    if(at<m_blocksize)
-      m_map0[at]=value;
-    else
-    {
-      int index=at/m_blocksize;
-      int offset=at%m_blocksize;
-        
-      if(index>=m_map.length)
-      {
-	int newsize=index+m_numblocks;
-	int[][] newMap=new int[newsize][];
-	System.arraycopy(m_map, 0, newMap, 0, m_map.length);
-	m_map=newMap;
-      }
-
-      int[] block=m_map[index];
-      if(null==block)
-	block=m_map[index]=new int[m_blocksize];
-      block[offset]=value;
-    }
-
-    if(at>=m_firstFree)
-      m_firstFree=at+1;
-  }
-  
-
-  /**
-   * Get the nth element. This is often at the innermost loop of an
-   * application, so performance is critical.
-   *
-   * @param i index of value to get
-   *
-   * @return value at given index. If that value wasn't previously set,
-   * the result is undefined for performance reasons. It may throw an
-   * exception (see below), may return zero, or (if setSize has previously
-   * been used) may return stale data.
-   *
-   * @throw ArrayIndexOutOfBoundsException if the index was _clearly_
-   * unreasonable (negative, or past the highest block).
-   *
-   * @throw NullPointerException if the index points to a block that could
-   * have existed (based on the highest index used) but has never had anything
-   * set into it.
-   * %REVIEW% Could add a catch to create the block in that case, or return 0.
-   * Try/Catch is _supposed_ to be nearly free when not thrown to. Do we
-   * believe that? Should we have a separate safeElementAt?
-   */
-  public int elementAt(int i)
-  {
-    // %OPT% Seems to buy us some very slight performance gains.
-    if(i<m_blocksize)
-      return m_map0[i];
-
-    return m_map[i/m_blocksize][i%m_blocksize];
-  }
-
-  /**
-   * Tell if the table contains the given node.
-   *
-   * @param s object to look for
-   *
-   * @return true if the object is in the list
-   */
-  private  boolean contains(int s)
-  {
-    return (indexOf(s,0) >= 0);
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem object to look for
-   * @param index Index of where to begin search
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(int elem, int index)
-  {
-        if(index>=m_firstFree)
-                return -1;
-          
-    int bindex=index/m_blocksize;
-    int boffset=index%m_blocksize;
-    int maxindex=m_firstFree/m_blocksize;
-    int[] block;
-    
-    for(;bindex<maxindex;++bindex)
-    {
-      block=m_map[bindex];
-      if(block!=null)
-        for(int offset=boffset;offset<m_blocksize;++offset)
-          if(block[offset]==elem)
-            return offset+bindex*m_blocksize;
-      boffset=0; // after first
-    }
-    // Last block may need to stop before end
-    int maxoffset=m_firstFree%m_blocksize;
-    block=m_map[maxindex];
-    for(int offset=boffset;offset<maxoffset;++offset)
-      if(block[offset]==elem)
-        return offset+maxindex*m_blocksize;
-
-    return -1;    
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem object to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(int elem)
-  {
-    return indexOf(elem,0);
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Object to look for
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  private  int lastIndexOf(int elem)
-  {
-    int boffset=m_firstFree%m_blocksize;
-    for(int index=m_firstFree/m_blocksize;
-        index>=0;
-        --index)
-    {
-      int[] block=m_map[index];
-      if(block!=null)
-        for(int offset=boffset; offset>=0; --offset)
-          if(block[offset]==elem)
-            return offset+index*m_blocksize;
-      boffset=0; // after first
-    }
-    return -1;
-  }
-
-}
diff --git a/src/org/apache/xml/utils/SystemIDResolver.java b/src/org/apache/xml/utils/SystemIDResolver.java
deleted file mode 100644
index 7a0bf64..0000000
--- a/src/org/apache/xml/utils/SystemIDResolver.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.URI;
-import org.apache.xml.utils.URI.MalformedURIException;
-
-import java.io.*;
-
-import java.lang.StringBuffer;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class is used to resolve relative URIs and SystemID 
- * strings into absolute URIs.
- */
-public class SystemIDResolver
-{
-
-  /**
-   * Get absolute URI from a given relative URI. 
-   * The URI is resolved relative to the system property "user.dir"
-   *
-   *
-   * @param uri Relative URI to resolve
-   *
-   * @return Resolved absolute URI or the input relative URI if 
-   * it could not be resolved.
-   */
-  public static String getAbsoluteURIFromRelative(String uri)
-  {
-
-    String curdir = System.getProperty("user.dir");
-
-    if (null != curdir)
-    {
-      String base;
-      if (curdir.startsWith(File.separator))
-        base = "file://" + curdir;
-      else
-        base = "file:///" + curdir;
-      if (uri != null)
-        uri = base + System.getProperty("file.separator") + uri;
-      else
-        uri = base + System.getProperty("file.separator");
-    }
-
-    if (null != uri && (uri.indexOf('\\') > -1))
-      uri = uri.replace('\\', '/');
-
-    return uri;
-  }
-  
-  /**
-   * Take a SystemID string and try and turn it into a good absolute URL.
-   *
-   * @param urlString url A URL string, which may be relative or absolute.
-   *
-   * @return The resolved absolute URI
-   * @throws TransformerException thrown if the string can't be turned into a URL.
-   */
-  public static String getAbsoluteURI(String url)
-          throws TransformerException
-  {
-    if (url.startsWith(".."))
-      url = new File(url).getAbsolutePath();
-    if (url.startsWith(File.separator))
-      url = "file://" + url;
-    else if (url.indexOf(':') < 0)
-    {
-      url = getAbsoluteURIFromRelative(url);
-    }
-    else if (url.startsWith("file:") && url.charAt(5) != '/') 
-    {
-      url = getAbsoluteURIFromRelative(url.substring(5));
-    }
-    return url;
-  }
-
-
-  /**
-   * Take a SystemID string and try and turn it into a good absolute URL.
-   *
-   * @param urlString SystemID string
-   * @param base Base URI to use to resolve the given systemID
-   *
-   * @return The resolved absolute URI
-   * @throws TransformerException thrown if the string can't be turned into a URL.
-   */
-  public static String getAbsoluteURI(String urlString, String base)
-          throws TransformerException
-  {
-    boolean isAbsouteUrl = false;
-    boolean needToResolve = false;    
- 
-    if(urlString.startsWith("file:") && urlString.charAt(5) != '/') 
-    {
-      needToResolve = true;
-    }
-    else if (urlString.indexOf(':') > 0)
-      isAbsouteUrl = true;
-    else if (urlString.startsWith(File.separator))
-    {
-      urlString = "file://" + urlString;
-      isAbsouteUrl = true;
-    }
-
-    if ((!isAbsouteUrl) && ((null == base)
-            || (base.indexOf(':') < 0)))
-    {
-      if (base != null && base.startsWith(File.separator))
-        base = "file://" + base;
-      else
-        base = getAbsoluteURIFromRelative(base);
-    }
-
-    // bit of a hack here.  Need to talk to URI person to see if this can be fixed.
-    if ((null != base) && needToResolve) 
-         
-    {
-      if(base.equals(urlString))
-      {
-        base = "";
-      }
-      else
-      {
-        urlString = urlString.substring(5);
-        isAbsouteUrl = false;
-      }
-    }   
-
-    // This is probably a bad idea, we should at least check for quotes...
-    if (null != base && (base.indexOf('\\') > -1))
-      base = base.replace('\\', '/');
-
-    if (null != urlString && (urlString.indexOf('\\') > -1))
-      urlString = urlString.replace('\\', '/');
-
-    URI uri;
-
-    try
-    {
-      if ((null == base) || (base.length() == 0) || (isAbsouteUrl))
-      {
-        uri = new URI(urlString);
-      }
-      else
-      {
-        URI baseURI = new URI(base);
-
-        uri = new URI(baseURI, urlString);
-      }
-    }
-    catch (MalformedURIException mue)
-    {
-      throw new TransformerException(mue);
-    }
-
-    String uriStr = uri.toString();
-    return uriStr;
-  }
-}
diff --git a/src/org/apache/xml/utils/TreeWalker.java b/src/org/apache/xml/utils/TreeWalker.java
deleted file mode 100644
index d854893..0000000
--- a/src/org/apache/xml/utils/TreeWalker.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.w3c.dom.*;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.LocatorImpl;
-
-import org.apache.xpath.DOM2Helper;
-import org.apache.xpath.DOMHelper;
-import org.apache.xml.utils.NodeConsumer;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class does a pre-order walk of the DOM tree, calling a ContentHandler
- * interface as it goes.
- */
-public class TreeWalker
-{
-
-  /** Local reference to a ContentHandler          */
-  private ContentHandler m_contentHandler = null;
-
-  // ARGHH!!  JAXP Uses Xerces without setting the namespace processing to ON!
-  // DOM2Helper m_dh = new DOM2Helper();
-
-  /** DomHelper for this TreeWalker          */
-  protected DOMHelper m_dh;
-        
-        /** Locator object for this TreeWalker          */
-        private LocatorImpl m_locator = new LocatorImpl();
-
-  /**
-   * Get the ContentHandler used for the tree walk.
-   *
-   * @return the ContentHandler used for the tree walk
-   */
-  public ContentHandler getContentHandler()
-  {
-    return m_contentHandler;
-  }
-
-  /**
-   * Get the ContentHandler used for the tree walk.
-   *
-   * @return the ContentHandler used for the tree walk
-   */
-  public void setContentHandler(ContentHandler ch)
-  {
-    m_contentHandler = ch;
-  }
-        
-        /**
-   * Constructor.
-   * @param   contentHandler The implemention of the
-   * @param   systemId System identifier for the document.
-   * contentHandler operation (toXMLString, digest, ...)
-   */
-  public TreeWalker(ContentHandler contentHandler, DOMHelper dh, String systemId)
-  {
-    this.m_contentHandler = contentHandler;
-                m_contentHandler.setDocumentLocator(m_locator);
-                if (systemId != null)
-                        m_locator.setSystemId(systemId);
-                else
-                        m_locator.setSystemId(System.getProperty("user.dir"));
-    m_dh = dh;
-  }
-
-  /**
-   * Constructor.
-   * @param   contentHandler The implemention of the
-   * contentHandler operation (toXMLString, digest, ...)
-   */
-  public TreeWalker(ContentHandler contentHandler, DOMHelper dh)
-  {
-    this.m_contentHandler = contentHandler;
-                m_contentHandler.setDocumentLocator(m_locator);
-                m_locator.setSystemId(System.getProperty("user.dir"));
-    m_dh = dh;
-  }
-  
-  /**
-   * Constructor.
-   * @param   contentHandler The implemention of the
-   * contentHandler operation (toXMLString, digest, ...)
-   */
-  public TreeWalker(ContentHandler contentHandler)
-  {
-    this.m_contentHandler = contentHandler;
-                if (m_contentHandler != null)
-                        m_contentHandler.setDocumentLocator(m_locator);
-                m_locator.setSystemId(System.getProperty("user.dir"));
-    m_dh = new org.apache.xpath.DOM2Helper();
-  }
-
-  /**
-   * Perform a pre-order traversal non-recursive style.
-   *
-   * @param pos Node in the tree where to start traversal
-   *
-   * @throws TransformerException
-   */
-  public void traverse(Node pos) throws org.xml.sax.SAXException
-  {
-
-    Node top = pos;
-
-    while (null != pos)
-    {
-      startNode(pos);
-
-      Node nextNode = pos.getFirstChild();
-
-      while (null == nextNode)
-      {
-        endNode(pos);
-
-        if (top.equals(pos))
-          break;
-
-        nextNode = pos.getNextSibling();
-
-        if (null == nextNode)
-        {
-          pos = pos.getParentNode();
-
-          if ((null == pos) || (top.equals(pos)))
-          {
-            if (null != pos)
-              endNode(pos);
-
-            nextNode = null;
-
-            break;
-          }
-        }
-      }
-
-      pos = nextNode;
-    }
-  }
-
-  /**
-   * Perform a pre-order traversal non-recursive style.
-   *
-   * @param pos Node in the tree where to start traversal
-   * @param top Node in the tree where to end traversal
-   *
-   * @throws TransformerException
-   */
-  public void traverse(Node pos, Node top) throws org.xml.sax.SAXException
-  {
-
-    while (null != pos)
-    {
-      startNode(pos);
-
-      Node nextNode = pos.getFirstChild();
-
-      while (null == nextNode)
-      {
-        endNode(pos);
-
-        if ((null != top) && top.equals(pos))
-          break;
-
-        nextNode = pos.getNextSibling();
-
-        if (null == nextNode)
-        {
-          pos = pos.getParentNode();
-
-          if ((null == pos) || ((null != top) && top.equals(pos)))
-          {
-            nextNode = null;
-
-            break;
-          }
-        }
-      }
-
-      pos = nextNode;
-    }
-  }
-
-  /** Flag indicating whether following text to be processed is raw text          */
-  boolean nextIsRaw = false;
-  
-  /**
-   * Optimized dispatch of characters.
-   */
-  private final void dispatachChars(Node node)
-     throws org.xml.sax.SAXException
-  {
-    if(m_contentHandler instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)
-    {
-      ((org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)m_contentHandler).characters(node);
-    }
-    else
-    {
-      String data = ((Text) node).getData();
-      this.m_contentHandler.characters(data.toCharArray(), 0, data.length());
-    }
-  }
-
-  /**
-   * Start processing given node
-   *
-   *
-   * @param node Node to process
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void startNode(Node node) throws org.xml.sax.SAXException
-  {
-
-    if (m_contentHandler instanceof NodeConsumer)
-    {
-      ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
-    }
-                
-                if (node instanceof Locator)
-                {
-                        Locator loc = (Locator)node;
-                        m_locator.setColumnNumber(loc.getColumnNumber());
-                        m_locator.setLineNumber(loc.getLineNumber());
-                        m_locator.setPublicId(loc.getPublicId());
-                        m_locator.setSystemId(loc.getSystemId());
-                }
-                else
-                {
-                        m_locator.setColumnNumber(0);
-      m_locator.setLineNumber(0);
-                }
-
-    switch (node.getNodeType())
-    {
-    case Node.COMMENT_NODE :
-    {
-      String data = ((Comment) node).getData();
-
-      if (m_contentHandler instanceof LexicalHandler)
-      {
-        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
-        lh.comment(data.toCharArray(), 0, data.length());
-      }
-    }
-    break;
-    case Node.DOCUMENT_FRAGMENT_NODE :
-
-      // ??;
-      break;
-    case Node.DOCUMENT_NODE :
-      this.m_contentHandler.startDocument();
-      break;
-    case Node.ELEMENT_NODE :
-      NamedNodeMap atts = ((Element) node).getAttributes();
-      int nAttrs = atts.getLength();
-      // System.out.println("TreeWalker#startNode: "+node.getNodeName());
-
-      for (int i = 0; i < nAttrs; i++)
-      {
-        Node attr = atts.item(i);
-        String attrName = attr.getNodeName();
-
-        // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
-        if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
-        {
-          // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
-          int index;
-          // Use "" instead of null, as Xerces likes "" for the 
-          // name of the default namespace.  Fix attributed 
-          // to "Steven Murray" <smurray@ebt.com>.
-          String prefix = (index = attrName.indexOf(":")) < 0
-                          ? "" : attrName.substring(index + 1);
-
-          this.m_contentHandler.startPrefixMapping(prefix,
-                                                   attr.getNodeValue());
-        }
-        
-      }
-
-      // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node));
-      // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node));
-      String ns = m_dh.getNamespaceOfNode(node);
-      if(null == ns)
-        ns = "";
-      this.m_contentHandler.startElement(ns,
-                                         m_dh.getLocalNameOfNode(node),
-                                         node.getNodeName(),
-                                         new AttList(atts, m_dh));
-      break;
-    case Node.PROCESSING_INSTRUCTION_NODE :
-    {
-      ProcessingInstruction pi = (ProcessingInstruction) node;
-      String name = pi.getNodeName();
-
-      // String data = pi.getData();
-      if (name.equals("xslt-next-is-raw"))
-      {
-        nextIsRaw = true;
-      }
-      else
-      {
-        this.m_contentHandler.processingInstruction(pi.getNodeName(),
-                                                    pi.getData());
-      }
-    }
-    break;
-    case Node.CDATA_SECTION_NODE :
-    {
-      boolean isLexH = (m_contentHandler instanceof LexicalHandler);
-      LexicalHandler lh = isLexH
-                          ? ((LexicalHandler) this.m_contentHandler) : null;
-
-      if (isLexH)
-      {
-        lh.startCDATA();
-      }
-      
-      dispatachChars(node);
-
-      {
-        if (isLexH)
-        {
-          lh.endCDATA();
-        }
-      }
-    }
-    break;
-    case Node.TEXT_NODE :
-    {
-      //String data = ((Text) node).getData();
-
-      if (nextIsRaw)
-      {
-        nextIsRaw = false;
-
-        m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
-        dispatachChars(node);
-        m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
-      }
-      else
-      {
-        dispatachChars(node);
-      }
-    }
-    break;
-    case Node.ENTITY_REFERENCE_NODE :
-    {
-      EntityReference eref = (EntityReference) node;
-
-      if (m_contentHandler instanceof LexicalHandler)
-      {
-        ((LexicalHandler) this.m_contentHandler).startEntity(
-          eref.getNodeName());
-      }
-      else
-      {
-
-        // warning("Can not output entity to a pure SAX ContentHandler");
-      }
-    }
-    break;
-    default :
-    }
-  }
-
-  /**
-   * End processing of given node 
-   *
-   *
-   * @param node Node we just finished processing
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  protected void endNode(Node node) throws org.xml.sax.SAXException
-  {
-
-    switch (node.getNodeType())
-    {
-    case Node.DOCUMENT_NODE :
-      this.m_contentHandler.endDocument();
-      break;
-    case Node.ELEMENT_NODE :
-      String ns = m_dh.getNamespaceOfNode(node);
-      if(null == ns)
-        ns = "";
-      this.m_contentHandler.endElement(ns,
-                                         m_dh.getLocalNameOfNode(node),
-                                         node.getNodeName());
-
-      NamedNodeMap atts = ((Element) node).getAttributes();
-      int nAttrs = atts.getLength();
-
-      for (int i = 0; i < nAttrs; i++)
-      {
-        Node attr = atts.item(i);
-        String attrName = attr.getNodeName();
-
-        if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
-        {
-          int index;
-          // Use "" instead of null, as Xerces likes "" for the 
-          // name of the default namespace.  Fix attributed 
-          // to "Steven Murray" <smurray@ebt.com>.
-          String prefix = (index = attrName.indexOf(":")) < 0
-                          ? "" : attrName.substring(index + 1);
-
-          this.m_contentHandler.endPrefixMapping(prefix);
-        }
-      }
-      break;
-    case Node.CDATA_SECTION_NODE :
-      break;
-    case Node.ENTITY_REFERENCE_NODE :
-    {
-      EntityReference eref = (EntityReference) node;
-
-      if (m_contentHandler instanceof LexicalHandler)
-      {
-        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
-        lh.endEntity(eref.getNodeName());
-      }
-    }
-    break;
-    default :
-    }
-  }
-}  //TreeWalker
-
diff --git a/src/org/apache/xml/utils/Trie.java b/src/org/apache/xml/utils/Trie.java
deleted file mode 100644
index 3de3e40..0000000
--- a/src/org/apache/xml/utils/Trie.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * A digital search trie for 7-bit ASCII text
- * The API is a subset of java.util.Hashtable
- * The key must be a 7-bit ASCII string
- * The value may be any Java Object
- */
-public class Trie
-{
-
-  /** Size of the m_nextChar array.  */
-  public static final int ALPHA_SIZE = 128;
-
-  /** The root node of the tree.    */
-  Node m_Root;
-
-  /**
-   * Construct the trie.
-   */
-  public Trie()
-  {
-    m_Root = new Node();
-  }
-
-  /**
-   * Put an object into the trie for lookup.
-   *
-   * @param key must be a 7-bit ASCII string
-   * @param value any java object.
-   *
-   * @return The old object that matched key, or null.
-   */
-  public Object put(String key, Object value)
-  {
-
-    final int len = key.length();
-    Node node = m_Root;
-
-    for (int i = 0; i < len; i++)
-    {
-      Node nextNode = node.m_nextChar[Character.toUpperCase(key.charAt(i))];
-
-      if (nextNode != null)
-      {
-        node = nextNode;
-      }
-      else
-      {
-        for (; i < len; i++)
-        {
-          Node newNode = new Node();
-
-          node.m_nextChar[Character.toUpperCase(key.charAt(i))] = newNode;
-          node = newNode;
-        }
-
-        break;
-      }
-    }
-
-    Object ret = node.m_Value;
-
-    node.m_Value = value;
-
-    return ret;
-  }
-
-  /**
-   * Get an object that matches the key.
-   *
-   * @param key must be a 7-bit ASCII string
-   *
-   * @return The object that matches the key, or null.
-   */
-  public Object get(String key)
-  {
-
-    final int len = key.length();
-    Node node = m_Root;
-
-    for (int i = 0; i < len; i++)
-    {
-      try
-      {
-        node = node.m_nextChar[Character.toUpperCase(key.charAt(i))];
-      }
-      catch (ArrayIndexOutOfBoundsException e)
-      {
-
-        // the key is not 7-bit ASCII so we won't find it here
-        node = null;
-      }
-
-      if (node == null)
-        return null;
-    }
-
-    return node.m_Value;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * The node representation for the trie.
-   */
-  class Node
-  {
-
-    /**
-     * Constructor, creates a Node[ALPHA_SIZE].
-     */
-    Node()
-    {
-      m_nextChar = new Node[ALPHA_SIZE];
-      m_Value = null;
-    }
-
-    /** The next nodes.   */
-    Node m_nextChar[];
-
-    /** The value.   */
-    Object m_Value;
-  }
-}
diff --git a/src/org/apache/xml/utils/URI.java b/src/org/apache/xml/utils/URI.java
deleted file mode 100644
index 30b142f..0000000
--- a/src/org/apache/xml/utils/URI.java
+++ /dev/null
@@ -1,1690 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * A class to represent a Uniform Resource Identifier (URI). This class
- * is designed to handle the parsing of URIs and provide access to
- * the various components (scheme, host, port, userinfo, path, query
- * string and fragment) that may constitute a URI.
- * <p>
- * Parsing of a URI specification is done according to the URI
- * syntax described in RFC 2396
- * <http://www.ietf.org/rfc/rfc2396.txt?number=2396>. Every URI consists
- * of a scheme, followed by a colon (':'), followed by a scheme-specific
- * part. For URIs that follow the "generic URI" syntax, the scheme-
- * specific part begins with two slashes ("//") and may be followed
- * by an authority segment (comprised of user information, host, and
- * port), path segment, query segment and fragment. Note that RFC 2396
- * no longer specifies the use of the parameters segment and excludes
- * the "user:password" syntax as part of the authority segment. If
- * "user:password" appears in a URI, the entire user/password string
- * is stored as userinfo.
- * <p>
- * For URIs that do not follow the "generic URI" syntax (e.g. mailto),
- * the entire scheme-specific part is treated as the "path" portion
- * of the URI.
- * <p>
- * Note that, unlike the java.net.URL class, this class does not provide
- * any built-in network access functionality nor does it provide any
- * scheme-specific functionality (for example, it does not know a
- * default port for a specific scheme). Rather, it only knows the
- * grammar and basic set of operations that can be applied to a URI.
- *
- * @version  $Id$
- *
- */
-public class URI implements Serializable
-{
-
-  /**
-   * MalformedURIExceptions are thrown in the process of building a URI
-   * or setting fields on a URI when an operation would result in an
-   * invalid URI specification.
-   *
-   */
-  public static class MalformedURIException extends IOException
-  {
-
-    /**
-     * Constructs a <code>MalformedURIException</code> with no specified
-     * detail message.
-     */
-    public MalformedURIException()
-    {
-      super();
-    }
-
-    /**
-     * Constructs a <code>MalformedURIException</code> with the
-     * specified detail message.
-     *
-     * @param p_msg the detail message.
-     */
-    public MalformedURIException(String p_msg)
-    {
-      super(p_msg);
-    }
-  }
-
-  /** reserved characters */
-  private static final String RESERVED_CHARACTERS = ";/?:@&=+$,";
-
-  /**
-   * URI punctuation mark characters - these, combined with
-   *   alphanumerics, constitute the "unreserved" characters 
-   */
-  private static final String MARK_CHARACTERS = "-_.!~*'() ";
-
-  /** scheme can be composed of alphanumerics and these characters */
-  private static final String SCHEME_CHARACTERS = "+-.";
-
-  /**
-   * userinfo can be composed of unreserved, escaped and these
-   *   characters 
-   */
-  private static final String USERINFO_CHARACTERS = ";:&=+$,";
-
-  /** Stores the scheme (usually the protocol) for this URI.
-   *  @serial */
-  private String m_scheme = null;
-
-  /** If specified, stores the userinfo for this URI; otherwise null.
-   *  @serial */
-  private String m_userinfo = null;
-
-  /** If specified, stores the host for this URI; otherwise null.
-   *  @serial */
-  private String m_host = null;
-
-  /** If specified, stores the port for this URI; otherwise -1.
-   *  @serial */
-  private int m_port = -1;
-
-  /** If specified, stores the path for this URI; otherwise null.
-   *  @serial */
-  private String m_path = null;
-
-  /**
-   * If specified, stores the query string for this URI; otherwise
-   *   null. 
-   * @serial 
-   */
-  private String m_queryString = null;
-
-  /** If specified, stores the fragment for this URI; otherwise null.
-   *  @serial */
-  private String m_fragment = null;
-
-  /** Indicate whether in DEBUG mode          */
-  private static boolean DEBUG = false;
-
-  /**
-   * Construct a new and uninitialized URI.
-   */
-  public URI(){}
-
-  /**
-   * Construct a new URI from another URI. All fields for this URI are
-   * set equal to the fields of the URI passed in.
-   *
-   * @param p_other the URI to copy (cannot be null)
-   */
-  public URI(URI p_other)
-  {
-    initialize(p_other);
-  }
-
-  /**
-   * Construct a new URI from a URI specification string. If the
-   * specification follows the "generic URI" syntax, (two slashes
-   * following the first colon), the specification will be parsed
-   * accordingly - setting the scheme, userinfo, host,port, path, query
-   * string and fragment fields as necessary. If the specification does
-   * not follow the "generic URI" syntax, the specification is parsed
-   * into a scheme and scheme-specific part (stored as the path) only.
-   *
-   * @param p_uriSpec the URI specification string (cannot be null or
-   *                  empty)
-   *
-   * @throws MalformedURIException if p_uriSpec violates any syntax
-   *                                   rules
-   */
-  public URI(String p_uriSpec) throws MalformedURIException
-  {
-    this((URI) null, p_uriSpec);
-  }
-
-  /**
-   * Construct a new URI from a base URI and a URI specification string.
-   * The URI specification string may be a relative URI.
-   *
-   * @param p_base the base URI (cannot be null if p_uriSpec is null or
-   *               empty)
-   * @param p_uriSpec the URI specification string (cannot be null or
-   *                  empty if p_base is null)
-   *
-   * @throws MalformedURIException if p_uriSpec violates any syntax
-   *                                  rules
-   */
-  public URI(URI p_base, String p_uriSpec) throws MalformedURIException
-  {
-    initialize(p_base, p_uriSpec);
-  }
-
-  /**
-   * Construct a new URI that does not follow the generic URI syntax.
-   * Only the scheme and scheme-specific part (stored as the path) are
-   * initialized.
-   *
-   * @param p_scheme the URI scheme (cannot be null or empty)
-   * @param p_schemeSpecificPart the scheme-specific part (cannot be
-   *                             null or empty)
-   *
-   * @throws MalformedURIException if p_scheme violates any
-   *                                  syntax rules
-   */
-  public URI(String p_scheme, String p_schemeSpecificPart)
-          throws MalformedURIException
-  {
-
-    if (p_scheme == null || p_scheme.trim().length() == 0)
-    {
-      throw new MalformedURIException(
-        "Cannot construct URI with null/empty scheme!");
-    }
-
-    if (p_schemeSpecificPart == null
-            || p_schemeSpecificPart.trim().length() == 0)
-    {
-      throw new MalformedURIException(
-        "Cannot construct URI with null/empty scheme-specific part!");
-    }
-
-    setScheme(p_scheme);
-    setPath(p_schemeSpecificPart);
-  }
-
-  /**
-   * Construct a new URI that follows the generic URI syntax from its
-   * component parts. Each component is validated for syntax and some
-   * basic semantic checks are performed as well.  See the individual
-   * setter methods for specifics.
-   *
-   * @param p_scheme the URI scheme (cannot be null or empty)
-   * @param p_host the hostname or IPv4 address for the URI
-   * @param p_path the URI path - if the path contains '?' or '#',
-   *               then the query string and/or fragment will be
-   *               set from the path; however, if the query and
-   *               fragment are specified both in the path and as
-   *               separate parameters, an exception is thrown
-   * @param p_queryString the URI query string (cannot be specified
-   *                      if path is null)
-   * @param p_fragment the URI fragment (cannot be specified if path
-   *                   is null)
-   *
-   * @throws MalformedURIException if any of the parameters violates
-   *                                  syntax rules or semantic rules
-   */
-  public URI(String p_scheme, String p_host, String p_path, String p_queryString, String p_fragment)
-          throws MalformedURIException
-  {
-    this(p_scheme, null, p_host, -1, p_path, p_queryString, p_fragment);
-  }
-
-  /**
-   * Construct a new URI that follows the generic URI syntax from its
-   * component parts. Each component is validated for syntax and some
-   * basic semantic checks are performed as well.  See the individual
-   * setter methods for specifics.
-   *
-   * @param p_scheme the URI scheme (cannot be null or empty)
-   * @param p_userinfo the URI userinfo (cannot be specified if host
-   *                   is null)
-   * @param p_host the hostname or IPv4 address for the URI
-   * @param p_port the URI port (may be -1 for "unspecified"; cannot
-   *               be specified if host is null)
-   * @param p_path the URI path - if the path contains '?' or '#',
-   *               then the query string and/or fragment will be
-   *               set from the path; however, if the query and
-   *               fragment are specified both in the path and as
-   *               separate parameters, an exception is thrown
-   * @param p_queryString the URI query string (cannot be specified
-   *                      if path is null)
-   * @param p_fragment the URI fragment (cannot be specified if path
-   *                   is null)
-   *
-   * @throws MalformedURIException if any of the parameters violates
-   *                                  syntax rules or semantic rules
-   */
-  public URI(String p_scheme, String p_userinfo, String p_host, int p_port, String p_path, String p_queryString, String p_fragment)
-          throws MalformedURIException
-  {
-
-    if (p_scheme == null || p_scheme.trim().length() == 0)
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_SCHEME_REQUIRED, null)); //"Scheme is required!");
-    }
-
-    if (p_host == null)
-    {
-      if (p_userinfo != null)
-      {
-        throw new MalformedURIException(
-          XSLMessages.createMessage(XSLTErrorResources.ER_NO_USERINFO_IF_NO_HOST, null)); //"Userinfo may not be specified if host is not specified!");
-      }
-
-      if (p_port != -1)
-      {
-        throw new MalformedURIException(
-          XSLMessages.createMessage(XSLTErrorResources.ER_NO_PORT_IF_NO_HOST, null)); //"Port may not be specified if host is not specified!");
-      }
-    }
-
-    if (p_path != null)
-    {
-      if (p_path.indexOf('?') != -1 && p_queryString != null)
-      {
-        throw new MalformedURIException(
-          XSLMessages.createMessage(XSLTErrorResources.ER_NO_QUERY_STRING_IN_PATH, null)); //"Query string cannot be specified in path and query string!");
-      }
-
-      if (p_path.indexOf('#') != -1 && p_fragment != null)
-      {
-        throw new MalformedURIException(
-          XSLMessages.createMessage(XSLTErrorResources.ER_NO_FRAGMENT_STRING_IN_PATH, null)); //"Fragment cannot be specified in both the path and fragment!");
-      }
-    }
-
-    setScheme(p_scheme);
-    setHost(p_host);
-    setPort(p_port);
-    setUserinfo(p_userinfo);
-    setPath(p_path);
-    setQueryString(p_queryString);
-    setFragment(p_fragment);
-  }
-
-  /**
-   * Initialize all fields of this URI from another URI.
-   *
-   * @param p_other the URI to copy (cannot be null)
-   */
-  private void initialize(URI p_other)
-  {
-
-    m_scheme = p_other.getScheme();
-    m_userinfo = p_other.getUserinfo();
-    m_host = p_other.getHost();
-    m_port = p_other.getPort();
-    m_path = p_other.getPath();
-    m_queryString = p_other.getQueryString();
-    m_fragment = p_other.getFragment();
-  }
-
-  /**
-   * Initializes this URI from a base URI and a URI specification string.
-   * See RFC 2396 Section 4 and Appendix B for specifications on parsing
-   * the URI and Section 5 for specifications on resolving relative URIs
-   * and relative paths.
-   *
-   * @param p_base the base URI (may be null if p_uriSpec is an absolute
-   *               URI)
-   * @param p_uriSpec the URI spec string which may be an absolute or
-   *                  relative URI (can only be null/empty if p_base
-   *                  is not null)
-   *
-   * @throws MalformedURIException if p_base is null and p_uriSpec
-   *                                  is not an absolute URI or if
-   *                                  p_uriSpec violates syntax rules
-   */
-  private void initialize(URI p_base, String p_uriSpec)
-          throws MalformedURIException
-  {
-
-    if (p_base == null
-            && (p_uriSpec == null || p_uriSpec.trim().length() == 0))
-    {
-      throw new MalformedURIException(
-        XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters.");
-    }
-
-    // just make a copy of the base if spec is empty
-    if (p_uriSpec == null || p_uriSpec.trim().length() == 0)
-    {
-      initialize(p_base);
-
-      return;
-    }
-
-    String uriSpec = p_uriSpec.trim();
-    int uriSpecLen = uriSpec.length();
-    int index = 0;
-
-    // check for scheme
-    if (uriSpec.indexOf(':') == -1)
-    {
-      if (p_base == null)
-      {
-        throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec);
-      }
-    }
-    else
-    {
-      initializeScheme(uriSpec);
-
-      index = m_scheme.length() + 1;
-    }
-
-    // two slashes means generic URI syntax, so we get the authority
-    if (((index + 1) < uriSpecLen)
-            && (uriSpec.substring(index).startsWith("//")))
-    {
-      index += 2;
-
-      int startPos = index;
-
-      // get authority - everything up to path, query or fragment
-      char testChar = '\0';
-
-      while (index < uriSpecLen)
-      {
-        testChar = uriSpec.charAt(index);
-
-        if (testChar == '/' || testChar == '?' || testChar == '#')
-        {
-          break;
-        }
-
-        index++;
-      }
-
-      // if we found authority, parse it out, otherwise we set the
-      // host to empty string
-      if (index > startPos)
-      {
-        initializeAuthority(uriSpec.substring(startPos, index));
-      }
-      else
-      {
-        m_host = "";
-      }
-    }
-
-    initializePath(uriSpec.substring(index));
-
-    // Resolve relative URI to base URI - see RFC 2396 Section 5.2
-    // In some cases, it might make more sense to throw an exception
-    // (when scheme is specified is the string spec and the base URI
-    // is also specified, for example), but we're just following the
-    // RFC specifications 
-    if (p_base != null)
-    {
-
-      // check to see if this is the current doc - RFC 2396 5.2 #2
-      // note that this is slightly different from the RFC spec in that
-      // we don't include the check for query string being null
-      // - this handles cases where the urispec is just a query
-      // string or a fragment (e.g. "?y" or "#s") - 
-      // see <http://www.ics.uci.edu/~fielding/url/test1.html> which
-      // identified this as a bug in the RFC
-      if (m_path.length() == 0 && m_scheme == null && m_host == null)
-      {
-        m_scheme = p_base.getScheme();
-        m_userinfo = p_base.getUserinfo();
-        m_host = p_base.getHost();
-        m_port = p_base.getPort();
-        m_path = p_base.getPath();
-
-        if (m_queryString == null)
-        {
-          m_queryString = p_base.getQueryString();
-        }
-
-        return;
-      }
-
-      // check for scheme - RFC 2396 5.2 #3
-      // if we found a scheme, it means absolute URI, so we're done
-      if (m_scheme == null)
-      {
-        m_scheme = p_base.getScheme();
-      }
-      else
-      {
-        return;
-      }
-
-      // check for authority - RFC 2396 5.2 #4
-      // if we found a host, then we've got a network path, so we're done
-      if (m_host == null)
-      {
-        m_userinfo = p_base.getUserinfo();
-        m_host = p_base.getHost();
-        m_port = p_base.getPort();
-      }
-      else
-      {
-        return;
-      }
-
-      // check for absolute path - RFC 2396 5.2 #5
-      if (m_path.length() > 0 && m_path.startsWith("/"))
-      {
-        return;
-      }
-
-      // if we get to this point, we need to resolve relative path
-      // RFC 2396 5.2 #6
-      String path = new String();
-      String basePath = p_base.getPath();
-
-      // 6a - get all but the last segment of the base URI path
-      if (basePath != null)
-      {
-        int lastSlash = basePath.lastIndexOf('/');
-
-        if (lastSlash != -1)
-        {
-          path = basePath.substring(0, lastSlash + 1);
-        }
-      }
-
-      // 6b - append the relative URI path
-      path = path.concat(m_path);
-
-      // 6c - remove all "./" where "." is a complete path segment
-      index = -1;
-
-      while ((index = path.indexOf("/./")) != -1)
-      {
-        path = path.substring(0, index + 1).concat(path.substring(index + 3));
-      }
-
-      // 6d - remove "." if path ends with "." as a complete path segment
-      if (path.endsWith("/."))
-      {
-        path = path.substring(0, path.length() - 1);
-      }
-
-      // 6e - remove all "<segment>/../" where "<segment>" is a complete 
-      // path segment not equal to ".."
-      index = -1;
-
-      int segIndex = -1;
-      String tempString = null;
-
-      while ((index = path.indexOf("/../")) > 0)
-      {
-        tempString = path.substring(0, path.indexOf("/../"));
-        segIndex = tempString.lastIndexOf('/');
-
-        if (segIndex != -1)
-        {
-          if (!tempString.substring(segIndex++).equals(".."))
-          {
-            path = path.substring(0, segIndex).concat(path.substring(index
-                    + 4));
-          }
-        }
-      }
-
-      // 6f - remove ending "<segment>/.." where "<segment>" is a 
-      // complete path segment
-      if (path.endsWith("/.."))
-      {
-        tempString = path.substring(0, path.length() - 3);
-        segIndex = tempString.lastIndexOf('/');
-
-        if (segIndex != -1)
-        {
-          path = path.substring(0, segIndex + 1);
-        }
-      }
-
-      m_path = path;
-    }
-  }
-
-  /**
-   * Initialize the scheme for this URI from a URI string spec.
-   *
-   * @param p_uriSpec the URI specification (cannot be null)
-   *
-   * @throws MalformedURIException if URI does not have a conformant
-   *                                  scheme
-   */
-  private void initializeScheme(String p_uriSpec) throws MalformedURIException
-  {
-
-    int uriSpecLen = p_uriSpec.length();
-    int index = 0;
-    String scheme = null;
-    char testChar = '\0';
-
-    while (index < uriSpecLen)
-    {
-      testChar = p_uriSpec.charAt(index);
-
-      if (testChar == ':' || testChar == '/' || testChar == '?'
-              || testChar == '#')
-      {
-        break;
-      }
-
-      index++;
-    }
-
-    scheme = p_uriSpec.substring(0, index);
-
-    if (scheme.length() == 0)
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI.");
-    }
-    else
-    {
-      setScheme(scheme);
-    }
-  }
-
-  /**
-   * Initialize the authority (userinfo, host and port) for this
-   * URI from a URI string spec.
-   *
-   * @param p_uriSpec the URI specification (cannot be null)
-   *
-   * @throws MalformedURIException if p_uriSpec violates syntax rules
-   */
-  private void initializeAuthority(String p_uriSpec)
-          throws MalformedURIException
-  {
-
-    int index = 0;
-    int start = 0;
-    int end = p_uriSpec.length();
-    char testChar = '\0';
-    String userinfo = null;
-
-    // userinfo is everything up @
-    if (p_uriSpec.indexOf('@', start) != -1)
-    {
-      while (index < end)
-      {
-        testChar = p_uriSpec.charAt(index);
-
-        if (testChar == '@')
-        {
-          break;
-        }
-
-        index++;
-      }
-
-      userinfo = p_uriSpec.substring(start, index);
-
-      index++;
-    }
-
-    // host is everything up to ':'
-    String host = null;
-
-    start = index;
-
-    while (index < end)
-    {
-      testChar = p_uriSpec.charAt(index);
-
-      if (testChar == ':')
-      {
-        break;
-      }
-
-      index++;
-    }
-
-    host = p_uriSpec.substring(start, index);
-
-    int port = -1;
-
-    if (host.length() > 0)
-    {
-
-      // port
-      if (testChar == ':')
-      {
-        index++;
-
-        start = index;
-
-        while (index < end)
-        {
-          index++;
-        }
-
-        String portStr = p_uriSpec.substring(start, index);
-
-        if (portStr.length() > 0)
-        {
-          for (int i = 0; i < portStr.length(); i++)
-          {
-            if (!isDigit(portStr.charAt(i)))
-            {
-              throw new MalformedURIException(
-                portStr + " is invalid. Port should only contain digits!");
-            }
-          }
-
-          try
-          {
-            port = Integer.parseInt(portStr);
-          }
-          catch (NumberFormatException nfe)
-          {
-
-            // can't happen
-          }
-        }
-      }
-    }
-
-    setHost(host);
-    setPort(port);
-    setUserinfo(userinfo);
-  }
-
-  /**
-   * Initialize the path for this URI from a URI string spec.
-   *
-   * @param p_uriSpec the URI specification (cannot be null)
-   *
-   * @throws MalformedURIException if p_uriSpec violates syntax rules
-   */
-  private void initializePath(String p_uriSpec) throws MalformedURIException
-  {
-
-    if (p_uriSpec == null)
-    {
-      throw new MalformedURIException(
-        "Cannot initialize path from null string!");
-    }
-
-    int index = 0;
-    int start = 0;
-    int end = p_uriSpec.length();
-    char testChar = '\0';
-
-    // path - everything up to query string or fragment
-    while (index < end)
-    {
-      testChar = p_uriSpec.charAt(index);
-
-      if (testChar == '?' || testChar == '#')
-      {
-        break;
-      }
-
-      // check for valid escape sequence
-      if (testChar == '%')
-      {
-        if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
-                ||!isHex(p_uriSpec.charAt(index + 2)))
-        {
-          throw new MalformedURIException(
-            XSLMessages.createMessage(XSLTErrorResources.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!");
-        }
-      }
-      else if (!isReservedCharacter(testChar)
-               &&!isUnreservedCharacter(testChar))
-      {
-        if ('\\' != testChar)
-          throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: "
-                                          //+ testChar);
-      }
-
-      index++;
-    }
-
-    m_path = p_uriSpec.substring(start, index);
-
-    // query - starts with ? and up to fragment or end
-    if (testChar == '?')
-    {
-      index++;
-
-      start = index;
-
-      while (index < end)
-      {
-        testChar = p_uriSpec.charAt(index);
-
-        if (testChar == '#')
-        {
-          break;
-        }
-
-        if (testChar == '%')
-        {
-          if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
-                  ||!isHex(p_uriSpec.charAt(index + 2)))
-          {
-            throw new MalformedURIException(
-              "Query string contains invalid escape sequence!");
-          }
-        }
-        else if (!isReservedCharacter(testChar)
-                 &&!isUnreservedCharacter(testChar))
-        {
-          throw new MalformedURIException(
-            "Query string contains invalid character:" + testChar);
-        }
-
-        index++;
-      }
-
-      m_queryString = p_uriSpec.substring(start, index);
-    }
-
-    // fragment - starts with #
-    if (testChar == '#')
-    {
-      index++;
-
-      start = index;
-
-      while (index < end)
-      {
-        testChar = p_uriSpec.charAt(index);
-
-        if (testChar == '%')
-        {
-          if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
-                  ||!isHex(p_uriSpec.charAt(index + 2)))
-          {
-            throw new MalformedURIException(
-              "Fragment contains invalid escape sequence!");
-          }
-        }
-        else if (!isReservedCharacter(testChar)
-                 &&!isUnreservedCharacter(testChar))
-        {
-          throw new MalformedURIException(
-            "Fragment contains invalid character:" + testChar);
-        }
-
-        index++;
-      }
-
-      m_fragment = p_uriSpec.substring(start, index);
-    }
-  }
-
-  /**
-   * Get the scheme for this URI.
-   *
-   * @return the scheme for this URI
-   */
-  public String getScheme()
-  {
-    return m_scheme;
-  }
-
-  /**
-   * Get the scheme-specific part for this URI (everything following the
-   * scheme and the first colon). See RFC 2396 Section 5.2 for spec.
-   *
-   * @return the scheme-specific part for this URI
-   */
-  public String getSchemeSpecificPart()
-  {
-
-    StringBuffer schemespec = new StringBuffer();
-
-    if (m_userinfo != null || m_host != null || m_port != -1)
-    {
-      schemespec.append("//");
-    }
-
-    if (m_userinfo != null)
-    {
-      schemespec.append(m_userinfo);
-      schemespec.append('@');
-    }
-
-    if (m_host != null)
-    {
-      schemespec.append(m_host);
-    }
-
-    if (m_port != -1)
-    {
-      schemespec.append(':');
-      schemespec.append(m_port);
-    }
-
-    if (m_path != null)
-    {
-      schemespec.append((m_path));
-    }
-
-    if (m_queryString != null)
-    {
-      schemespec.append('?');
-      schemespec.append(m_queryString);
-    }
-
-    if (m_fragment != null)
-    {
-      schemespec.append('#');
-      schemespec.append(m_fragment);
-    }
-
-    return schemespec.toString();
-  }
-
-  /**
-   * Get the userinfo for this URI.
-   *
-   * @return the userinfo for this URI (null if not specified).
-   */
-  public String getUserinfo()
-  {
-    return m_userinfo;
-  }
-
-  /**
-   * Get the host for this URI.
-   *
-   * @return the host for this URI (null if not specified).
-   */
-  public String getHost()
-  {
-    return m_host;
-  }
-
-  /**
-   * Get the port for this URI.
-   *
-   * @return the port for this URI (-1 if not specified).
-   */
-  public int getPort()
-  {
-    return m_port;
-  }
-
-  /**
-   * Get the path for this URI (optionally with the query string and
-   * fragment).
-   *
-   * @param p_includeQueryString if true (and query string is not null),
-   *                             then a "?" followed by the query string
-   *                             will be appended
-   * @param p_includeFragment if true (and fragment is not null),
-   *                             then a "#" followed by the fragment
-   *                             will be appended
-   *
-   * @return the path for this URI possibly including the query string
-   *         and fragment
-   */
-  public String getPath(boolean p_includeQueryString,
-                        boolean p_includeFragment)
-  {
-
-    StringBuffer pathString = new StringBuffer(m_path);
-
-    if (p_includeQueryString && m_queryString != null)
-    {
-      pathString.append('?');
-      pathString.append(m_queryString);
-    }
-
-    if (p_includeFragment && m_fragment != null)
-    {
-      pathString.append('#');
-      pathString.append(m_fragment);
-    }
-
-    return pathString.toString();
-  }
-
-  /**
-   * Get the path for this URI. Note that the value returned is the path
-   * only and does not include the query string or fragment.
-   *
-   * @return the path for this URI.
-   */
-  public String getPath()
-  {
-    return m_path;
-  }
-
-  /**
-   * Get the query string for this URI.
-   *
-   * @return the query string for this URI. Null is returned if there
-   *         was no "?" in the URI spec, empty string if there was a
-   *         "?" but no query string following it.
-   */
-  public String getQueryString()
-  {
-    return m_queryString;
-  }
-
-  /**
-   * Get the fragment for this URI.
-   *
-   * @return the fragment for this URI. Null is returned if there
-   *         was no "#" in the URI spec, empty string if there was a
-   *         "#" but no fragment following it.
-   */
-  public String getFragment()
-  {
-    return m_fragment;
-  }
-
-  /**
-   * Set the scheme for this URI. The scheme is converted to lowercase
-   * before it is set.
-   *
-   * @param p_scheme the scheme for this URI (cannot be null)
-   *
-   * @throws MalformedURIException if p_scheme is not a conformant
-   *                                  scheme name
-   */
-  public void setScheme(String p_scheme) throws MalformedURIException
-  {
-
-    if (p_scheme == null)
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!");
-    }
-
-    if (!isConformantSchemeName(p_scheme))
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant.");
-    }
-
-    m_scheme = p_scheme.toLowerCase();
-  }
-
-  /**
-   * Set the userinfo for this URI. If a non-null value is passed in and
-   * the host value is null, then an exception is thrown.
-   *
-   * @param p_userinfo the userinfo for this URI
-   *
-   * @throws MalformedURIException if p_userinfo contains invalid
-   *                                  characters
-   */
-  public void setUserinfo(String p_userinfo) throws MalformedURIException
-  {
-
-    if (p_userinfo == null)
-    {
-      m_userinfo = null;
-    }
-    else
-    {
-      if (m_host == null)
-      {
-        throw new MalformedURIException(
-          "Userinfo cannot be set when host is null!");
-      }
-
-      // userinfo can contain alphanumerics, mark characters, escaped
-      // and ';',':','&','=','+','$',','
-      int index = 0;
-      int end = p_userinfo.length();
-      char testChar = '\0';
-
-      while (index < end)
-      {
-        testChar = p_userinfo.charAt(index);
-
-        if (testChar == '%')
-        {
-          if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1))
-                  ||!isHex(p_userinfo.charAt(index + 2)))
-          {
-            throw new MalformedURIException(
-              "Userinfo contains invalid escape sequence!");
-          }
-        }
-        else if (!isUnreservedCharacter(testChar)
-                 && USERINFO_CHARACTERS.indexOf(testChar) == -1)
-        {
-          throw new MalformedURIException(
-            "Userinfo contains invalid character:" + testChar);
-        }
-
-        index++;
-      }
-    }
-
-    m_userinfo = p_userinfo;
-  }
-
-  /**
-   * Set the host for this URI. If null is passed in, the userinfo
-   * field is also set to null and the port is set to -1.
-   *
-   * @param p_host the host for this URI
-   *
-   * @throws MalformedURIException if p_host is not a valid IP
-   *                                  address or DNS hostname.
-   */
-  public void setHost(String p_host) throws MalformedURIException
-  {
-
-    if (p_host == null || p_host.trim().length() == 0)
-    {
-      m_host = p_host;
-      m_userinfo = null;
-      m_port = -1;
-    }
-    else if (!isWellFormedAddress(p_host))
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
-    }
-
-    m_host = p_host;
-  }
-
-  /**
-   * Set the port for this URI. -1 is used to indicate that the port is
-   * not specified, otherwise valid port numbers are  between 0 and 65535.
-   * If a valid port number is passed in and the host field is null,
-   * an exception is thrown.
-   *
-   * @param p_port the port number for this URI
-   *
-   * @throws MalformedURIException if p_port is not -1 and not a
-   *                                  valid port number
-   */
-  public void setPort(int p_port) throws MalformedURIException
-  {
-
-    if (p_port >= 0 && p_port <= 65535)
-    {
-      if (m_host == null)
-      {
-        throw new MalformedURIException(
-          XSLMessages.createMessage(XSLTErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!");
-      }
-    }
-    else if (p_port != -1)
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!");
-    }
-
-    m_port = p_port;
-  }
-
-  /**
-   * Set the path for this URI. If the supplied path is null, then the
-   * query string and fragment are set to null as well. If the supplied
-   * path includes a query string and/or fragment, these fields will be
-   * parsed and set as well. Note that, for URIs following the "generic
-   * URI" syntax, the path specified should start with a slash.
-   * For URIs that do not follow the generic URI syntax, this method
-   * sets the scheme-specific part.
-   *
-   * @param p_path the path for this URI (may be null)
-   *
-   * @throws MalformedURIException if p_path contains invalid
-   *                                  characters
-   */
-  public void setPath(String p_path) throws MalformedURIException
-  {
-
-    if (p_path == null)
-    {
-      m_path = null;
-      m_queryString = null;
-      m_fragment = null;
-    }
-    else
-    {
-      initializePath(p_path);
-    }
-  }
-
-  /**
-   * Append to the end of the path of this URI. If the current path does
-   * not end in a slash and the path to be appended does not begin with
-   * a slash, a slash will be appended to the current path before the
-   * new segment is added. Also, if the current path ends in a slash
-   * and the new segment begins with a slash, the extra slash will be
-   * removed before the new segment is appended.
-   *
-   * @param p_addToPath the new segment to be added to the current path
-   *
-   * @throws MalformedURIException if p_addToPath contains syntax
-   *                                  errors
-   */
-  public void appendPath(String p_addToPath) throws MalformedURIException
-  {
-
-    if (p_addToPath == null || p_addToPath.trim().length() == 0)
-    {
-      return;
-    }
-
-    if (!isURIString(p_addToPath))
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!");
-    }
-
-    if (m_path == null || m_path.trim().length() == 0)
-    {
-      if (p_addToPath.startsWith("/"))
-      {
-        m_path = p_addToPath;
-      }
-      else
-      {
-        m_path = "/" + p_addToPath;
-      }
-    }
-    else if (m_path.endsWith("/"))
-    {
-      if (p_addToPath.startsWith("/"))
-      {
-        m_path = m_path.concat(p_addToPath.substring(1));
-      }
-      else
-      {
-        m_path = m_path.concat(p_addToPath);
-      }
-    }
-    else
-    {
-      if (p_addToPath.startsWith("/"))
-      {
-        m_path = m_path.concat(p_addToPath);
-      }
-      else
-      {
-        m_path = m_path.concat("/" + p_addToPath);
-      }
-    }
-  }
-
-  /**
-   * Set the query string for this URI. A non-null value is valid only
-   * if this is an URI conforming to the generic URI syntax and
-   * the path value is not null.
-   *
-   * @param p_queryString the query string for this URI
-   *
-   * @throws MalformedURIException if p_queryString is not null and this
-   *                                  URI does not conform to the generic
-   *                                  URI syntax or if the path is null
-   */
-  public void setQueryString(String p_queryString)
-          throws MalformedURIException
-  {
-
-    if (p_queryString == null)
-    {
-      m_queryString = null;
-    }
-    else if (!isGenericURI())
-    {
-      throw new MalformedURIException(
-        "Query string can only be set for a generic URI!");
-    }
-    else if (getPath() == null)
-    {
-      throw new MalformedURIException(
-        "Query string cannot be set when path is null!");
-    }
-    else if (!isURIString(p_queryString))
-    {
-      throw new MalformedURIException(
-        "Query string contains invalid character!");
-    }
-    else
-    {
-      m_queryString = p_queryString;
-    }
-  }
-
-  /**
-   * Set the fragment for this URI. A non-null value is valid only
-   * if this is a URI conforming to the generic URI syntax and
-   * the path value is not null.
-   *
-   * @param p_fragment the fragment for this URI
-   *
-   * @throws MalformedURIException if p_fragment is not null and this
-   *                                  URI does not conform to the generic
-   *                                  URI syntax or if the path is null
-   */
-  public void setFragment(String p_fragment) throws MalformedURIException
-  {
-
-    if (p_fragment == null)
-    {
-      m_fragment = null;
-    }
-    else if (!isGenericURI())
-    {
-      throw new MalformedURIException(
-        XSLMessages.createMessage(XSLTErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!");
-    }
-    else if (getPath() == null)
-    {
-      throw new MalformedURIException(
-        XSLMessages.createMessage(XSLTErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!");
-    }
-    else if (!isURIString(p_fragment))
-    {
-      throw new MalformedURIException(XSLMessages.createMessage(XSLTErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!");
-    }
-    else
-    {
-      m_fragment = p_fragment;
-    }
-  }
-
-  /**
-   * Determines if the passed-in Object is equivalent to this URI.
-   *
-   * @param p_test the Object to test for equality.
-   *
-   * @return true if p_test is a URI with all values equal to this
-   *         URI, false otherwise
-   */
-  public boolean equals(Object p_test)
-  {
-
-    if (p_test instanceof URI)
-    {
-      URI testURI = (URI) p_test;
-
-      if (((m_scheme == null && testURI.m_scheme == null) || (m_scheme != null && testURI.m_scheme != null && m_scheme.equals(
-              testURI.m_scheme))) && ((m_userinfo == null && testURI.m_userinfo == null) || (m_userinfo != null && testURI.m_userinfo != null && m_userinfo.equals(
-              testURI.m_userinfo))) && ((m_host == null && testURI.m_host == null) || (m_host != null && testURI.m_host != null && m_host.equals(
-              testURI.m_host))) && m_port == testURI.m_port && ((m_path == null && testURI.m_path == null) || (m_path != null && testURI.m_path != null && m_path.equals(
-              testURI.m_path))) && ((m_queryString == null && testURI.m_queryString == null) || (m_queryString != null && testURI.m_queryString != null && m_queryString.equals(
-              testURI.m_queryString))) && ((m_fragment == null && testURI.m_fragment == null) || (m_fragment != null && testURI.m_fragment != null && m_fragment.equals(
-              testURI.m_fragment))))
-      {
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  /**
-   * Get the URI as a string specification. See RFC 2396 Section 5.2.
-   *
-   * @return the URI string specification
-   */
-  public String toString()
-  {
-
-    StringBuffer uriSpecString = new StringBuffer();
-
-    if (m_scheme != null)
-    {
-      uriSpecString.append(m_scheme);
-      uriSpecString.append(':');
-    }
-
-    uriSpecString.append(getSchemeSpecificPart());
-
-    return uriSpecString.toString();
-  }
-
-  /**
-   * Get the indicator as to whether this URI uses the "generic URI"
-   * syntax.
-   *
-   * @return true if this URI uses the "generic URI" syntax, false
-   *         otherwise
-   */
-  public boolean isGenericURI()
-  {
-
-    // presence of the host (whether valid or empty) means 
-    // double-slashes which means generic uri
-    return (m_host != null);
-  }
-
-  /**
-   * Determine whether a scheme conforms to the rules for a scheme name.
-   * A scheme is conformant if it starts with an alphanumeric, and
-   * contains only alphanumerics, '+','-' and '.'.
-   *
-   *
-   * @param p_scheme The sheme name to check
-   * @return true if the scheme is conformant, false otherwise
-   */
-  public static boolean isConformantSchemeName(String p_scheme)
-  {
-
-    if (p_scheme == null || p_scheme.trim().length() == 0)
-    {
-      return false;
-    }
-
-    if (!isAlpha(p_scheme.charAt(0)))
-    {
-      return false;
-    }
-
-    char testChar;
-
-    for (int i = 1; i < p_scheme.length(); i++)
-    {
-      testChar = p_scheme.charAt(i);
-
-      if (!isAlphanum(testChar) && SCHEME_CHARACTERS.indexOf(testChar) == -1)
-      {
-        return false;
-      }
-    }
-
-    return true;
-  }
-
-  /**
-   * Determine whether a string is syntactically capable of representing
-   * a valid IPv4 address or the domain name of a network host. A valid
-   * IPv4 address consists of four decimal digit groups separated by a
-   * '.'. A hostname consists of domain labels (each of which must
-   * begin and end with an alphanumeric but may contain '-') separated
-   * & by a '.'. See RFC 2396 Section 3.2.2.
-   *
-   *
-   * @param p_address The address string to check
-   * @return true if the string is a syntactically valid IPv4 address
-   *              or hostname
-   */
-  public static boolean isWellFormedAddress(String p_address)
-  {
-
-    if (p_address == null)
-    {
-      return false;
-    }
-
-    String address = p_address.trim();
-    int addrLength = address.length();
-
-    if (addrLength == 0 || addrLength > 255)
-    {
-      return false;
-    }
-
-    if (address.startsWith(".") || address.startsWith("-"))
-    {
-      return false;
-    }
-
-    // rightmost domain label starting with digit indicates IP address
-    // since top level domain label can only start with an alpha
-    // see RFC 2396 Section 3.2.2
-    int index = address.lastIndexOf('.');
-
-    if (address.endsWith("."))
-    {
-      index = address.substring(0, index).lastIndexOf('.');
-    }
-
-    if (index + 1 < addrLength && isDigit(p_address.charAt(index + 1)))
-    {
-      char testChar;
-      int numDots = 0;
-
-      // make sure that 1) we see only digits and dot separators, 2) that
-      // any dot separator is preceded and followed by a digit and 
-      // 3) that we find 3 dots
-      for (int i = 0; i < addrLength; i++)
-      {
-        testChar = address.charAt(i);
-
-        if (testChar == '.')
-        {
-          if (!isDigit(address.charAt(i - 1))
-                  || (i + 1 < addrLength &&!isDigit(address.charAt(i + 1))))
-          {
-            return false;
-          }
-
-          numDots++;
-        }
-        else if (!isDigit(testChar))
-        {
-          return false;
-        }
-      }
-
-      if (numDots != 3)
-      {
-        return false;
-      }
-    }
-    else
-    {
-
-      // domain labels can contain alphanumerics and '-"
-      // but must start and end with an alphanumeric
-      char testChar;
-
-      for (int i = 0; i < addrLength; i++)
-      {
-        testChar = address.charAt(i);
-
-        if (testChar == '.')
-        {
-          if (!isAlphanum(address.charAt(i - 1)))
-          {
-            return false;
-          }
-
-          if (i + 1 < addrLength &&!isAlphanum(address.charAt(i + 1)))
-          {
-            return false;
-          }
-        }
-        else if (!isAlphanum(testChar) && testChar != '-')
-        {
-          return false;
-        }
-      }
-    }
-
-    return true;
-  }
-
-  /**
-   * Determine whether a char is a digit.
-   *
-   *
-   * @param p_char the character to check
-   * @return true if the char is betweeen '0' and '9', false otherwise
-   */
-  private static boolean isDigit(char p_char)
-  {
-    return p_char >= '0' && p_char <= '9';
-  }
-
-  /**
-   * Determine whether a character is a hexadecimal character.
-   *
-   *
-   * @param p_char the character to check
-   * @return true if the char is betweeen '0' and '9', 'a' and 'f'
-   *         or 'A' and 'F', false otherwise
-   */
-  private static boolean isHex(char p_char)
-  {
-    return (isDigit(p_char) || (p_char >= 'a' && p_char <= 'f')
-            || (p_char >= 'A' && p_char <= 'F'));
-  }
-
-  /**
-   * Determine whether a char is an alphabetic character: a-z or A-Z
-   *
-   *
-   * @param p_char the character to check
-   * @return true if the char is alphabetic, false otherwise
-   */
-  private static boolean isAlpha(char p_char)
-  {
-    return ((p_char >= 'a' && p_char <= 'z')
-            || (p_char >= 'A' && p_char <= 'Z'));
-  }
-
-  /**
-   * Determine whether a char is an alphanumeric: 0-9, a-z or A-Z
-   *
-   *
-   * @param p_char the character to check
-   * @return true if the char is alphanumeric, false otherwise
-   */
-  private static boolean isAlphanum(char p_char)
-  {
-    return (isAlpha(p_char) || isDigit(p_char));
-  }
-
-  /**
-   * Determine whether a character is a reserved character:
-   * ';', '/', '?', ':', '@', '&', '=', '+', '$' or ','
-   *
-   *
-   * @param p_char the character to check
-   * @return true if the string contains any reserved characters
-   */
-  private static boolean isReservedCharacter(char p_char)
-  {
-    return RESERVED_CHARACTERS.indexOf(p_char) != -1;
-  }
-
-  /**
-   * Determine whether a char is an unreserved character.
-   *
-   *
-   * @param p_char the character to check
-   * @return true if the char is unreserved, false otherwise
-   */
-  private static boolean isUnreservedCharacter(char p_char)
-  {
-    return (isAlphanum(p_char) || MARK_CHARACTERS.indexOf(p_char) != -1);
-  }
-
-  /**
-   * Determine whether a given string contains only URI characters (also
-   * called "uric" in RFC 2396). uric consist of all reserved
-   * characters, unreserved characters and escaped characters.
-   *
-   *
-   * @param p_uric URI string
-   * @return true if the string is comprised of uric, false otherwise
-   */
-  private static boolean isURIString(String p_uric)
-  {
-
-    if (p_uric == null)
-    {
-      return false;
-    }
-
-    int end = p_uric.length();
-    char testChar = '\0';
-
-    for (int i = 0; i < end; i++)
-    {
-      testChar = p_uric.charAt(i);
-
-      if (testChar == '%')
-      {
-        if (i + 2 >= end ||!isHex(p_uric.charAt(i + 1))
-                ||!isHex(p_uric.charAt(i + 2)))
-        {
-          return false;
-        }
-        else
-        {
-          i += 2;
-
-          continue;
-        }
-      }
-
-      if (isReservedCharacter(testChar) || isUnreservedCharacter(testChar))
-      {
-        continue;
-      }
-      else
-      {
-        return false;
-      }
-    }
-
-    return true;
-  }
-}
diff --git a/src/org/apache/xml/utils/UnImplNode.java b/src/org/apache/xml/utils/UnImplNode.java
deleted file mode 100644
index d188d6e..0000000
--- a/src/org/apache/xml/utils/UnImplNode.java
+++ /dev/null
@@ -1,1305 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import org.w3c.dom.*;
-
-import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * <meta name="usage" content="internal"/>
- * To be subclassed by classes that wish to fake being nodes.
- */
-public class UnImplNode implements Node, Element, NodeList, Document
-{
-
-  /**
-   * Constructor UnImplNode
-   *
-   */
-  public UnImplNode(){}
-
-  /**
-   * Throw an error.
-   *
-   * @param msg Message code for the error
-   */
-  public void error(int msg)
-  {
-
-    System.out.println("DOM ERROR! class: " + this.getClass().getName());
-
-    throw new RuntimeException(XSLMessages.createMessage(msg, null));
-  }
-
-  /**
-   * Throw an error.
-   *
-   * @param msg Message code for the error
-   * @param args Array of arguments to be used in the error message
-   */
-  public void error(int msg, Object[] args)
-  {
-
-    System.out.println("DOM ERROR! class: " + this.getClass().getName());
-
-    throw new RuntimeException(XSLMessages.createMessage(msg, args));  //"UnImplNode error: "+msg);
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param newChild New node to append to the list of this node's children
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Node appendChild(Node newChild) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"appendChild not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return false
-   */
-  public boolean hasChildNodes()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"hasChildNodes not supported!");
-
-    return false;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return 0
-   */
-  public short getNodeType()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getNodeType not supported!");
-
-    return 0;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Node getParentNode()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getParentNode not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public NodeList getChildNodes()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getChildNodes not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Node getFirstChild()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getFirstChild not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Node getLastChild()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getLastChild not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Node getNextSibling()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getNextSibling not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.NodeList
-   *
-   * @return 0
-   */
-  public int getLength()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getLength not supported!");
-
-    return 0;
-  }  // getLength():int
-
-  /**
-   * Unimplemented. See org.w3c.dom.NodeList
-   *
-   * @param index index of a child of this node in its list of children
-   *
-   * @return null
-   */
-  public Node item(int index)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"item not supported!");
-
-    return null;
-  }  // item(int):Node
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Document getOwnerDocument()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getOwnerDocument not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public String getTagName()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getTagName not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public String getNodeName()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getNodeName not supported!");
-
-    return null;
-  }
-
-  /** Unimplemented. See org.w3c.dom.Node */
-  public void normalize()
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"normalize not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param name Name of the element
-   *
-   * @return null
-   */
-  public NodeList getElementsByTagName(String name)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getElementsByTagName not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param oldAttr Attribute to be removed from this node's list of attributes
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Attr removeAttributeNode(Attr oldAttr) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"removeAttributeNode not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param newAttr Attribute node to be added to this node's list of attributes
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Attr setAttributeNode(Attr newAttr) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setAttributeNode not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   *
-   * @param name Name of an attribute
-   *
-   * @return false
-   */
-  public boolean hasAttribute(String name)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"hasAttribute not supported!");
-
-    return false;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   *
-   * @param name
-   * @param x
-   *
-   * @return false
-   */
-  public boolean hasAttributeNS(String name, String x)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"hasAttributeNS not supported!");
-
-    return false;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   *
-   * @param name Attribute node name
-   *
-   * @return null
-   */
-  public Attr getAttributeNode(String name)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getAttributeNode not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param name Attribute node name to remove from list of attributes
-   *
-   * @throws DOMException
-   */
-  public void removeAttribute(String name) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"removeAttribute not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param name Name of attribute to set
-   * @param value Value of attribute
-   *
-   * @throws DOMException
-   */
-  public void setAttribute(String name, String value) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setAttribute not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param name Name of attribute to get
-   *
-   * @return null
-   */
-  public String getAttribute(String name)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getAttribute not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. Introduced in DOM Level 2.
-   *
-   * @return false
-   */
-  public boolean hasAttributes()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"hasAttributes not supported!");
-
-    return false;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param namespaceURI Namespace URI of the element
-   * @param localName Local part of qualified name of the element
-   *
-   * @return null
-   */
-  public NodeList getElementsByTagNameNS(String namespaceURI,
-                                         String localName)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getElementsByTagNameNS not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param newAttr Attribute to set
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setAttributeNodeNS not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param namespaceURI Namespace URI of attribute node to get
-   * @param localName Local part of qualified name of attribute node to get
-   *
-   * @return null
-   */
-  public Attr getAttributeNodeNS(String namespaceURI, String localName)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getAttributeNodeNS not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param namespaceURI Namespace URI of attribute node to remove
-   * @param localName Local part of qualified name of attribute node to remove
-   *
-   * @throws DOMException
-   */
-  public void removeAttributeNS(String namespaceURI, String localName)
-          throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"removeAttributeNS not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param namespaceURI Namespace URI of attribute node to set
-   * @param localName Local part of qualified name of attribute node to set
-   * NEEDSDOC @param qualifiedName
-   * @param value value of attribute
-   *
-   * @throws DOMException
-   */
-  public void setAttributeNS(
-          String namespaceURI, String qualifiedName, String value)
-            throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setAttributeNS not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Element
-   *
-   * @param namespaceURI Namespace URI of attribute node to get
-   * @param localName Local part of qualified name of attribute node to get
-   *
-   * @return null
-   */
-  public String getAttributeNS(String namespaceURI, String localName)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getAttributeNS not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Node getPreviousSibling()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getPreviousSibling not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param deep Flag indicating whether to clone deep (clone member variables)
-   *
-   * @return null
-   */
-  public Node cloneNode(boolean deep)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"cloneNode not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public String getNodeValue() throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getNodeValue not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param nodeValue Value to set this node to
-   *
-   * @throws DOMException
-   */
-  public void setNodeValue(String nodeValue) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setNodeValue not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   *
-   * NEEDSDOC @param value
-   * @return value Node value
-   *
-   * @throws DOMException
-   */
-
-  // public String getValue ()
-  // {      
-  //  error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getValue not supported!");
-  //  return null;
-  // } 
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param value Value to set this node to
-   *
-   * @throws DOMException
-   */
-  public void setValue(String value) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setValue not supported!");
-  }
-
-  /**
-   *  Returns the name of this attribute.
-   *
-   * @return the name of this attribute.
-   */
-
-  // public String getName()
-  // {
-  //  return this.getNodeName();
-  // }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public Element getOwnerElement()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getOwnerElement not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return False
-   */
-  public boolean getSpecified()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setValue not supported!");
-
-    return false;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public NamedNodeMap getAttributes()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getAttributes not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param newChild New child node to insert
-   * @param refChild Insert in front of this child
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Node insertBefore(Node newChild, Node refChild) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"insertBefore not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param newChild Replace existing child with this one
-   * @param oldChild Existing child to be replaced
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Node replaceChild(Node newChild, Node oldChild) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"replaceChild not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param oldChild Child to be removed
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Node removeChild(Node oldChild) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"replaceChild not supported!");
-
-    return null;
-  }
-
-  /**
-   * Tests whether the DOM implementation implements a specific feature and
-   * that feature is supported by this node.
-   * @param featureThe name of the feature to test. This is the same name
-   *   which can be passed to the method <code>hasFeature</code> on
-   *   <code>DOMImplementation</code>.
-   * @param versionThis is the version number of the feature to test. In
-   *   Level 2, version 1, this is the string "2.0". If the version is not
-   *   specified, supporting any version of the feature will cause the
-   *   method to return <code>true</code>.
-   *
-   * NEEDSDOC @param feature
-   * NEEDSDOC @param version
-   * @return Returns <code>false</code>
-   * @since DOM Level 2
-   */
-  public boolean isSupported(String feature, String version)
-  {
-    return false;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public String getNamespaceURI()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getNamespaceURI not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public String getPrefix()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getPrefix not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @param prefix Prefix to set for this node
-   *
-   * @throws DOMException
-   */
-  public void setPrefix(String prefix) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"setPrefix not supported!");
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Node
-   *
-   * @return null
-   */
-  public String getLocalName()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getLocalName not supported!");
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @return null
-   */
-  public DocumentType getDoctype()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @return null
-   */
-  public DOMImplementation getImplementation()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @return null
-   */
-  public Element getDocumentElement()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param tagName Element tag name
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Element createElement(String tagName) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @return null
-   */
-  public DocumentFragment createDocumentFragment()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param data Data for text node
-   *
-   * @return null
-   */
-  public Text createTextNode(String data)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param data Data for comment
-   *
-   * @return null
-   */
-  public Comment createComment(String data)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param data Data for CDATA section
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public CDATASection createCDATASection(String data) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param target Target for Processing instruction
-   * @param data Data for Processing instruction
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public ProcessingInstruction createProcessingInstruction(
-          String target, String data) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param name Attribute name
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Attr createAttribute(String name) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param name Entity Reference name
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public EntityReference createEntityReference(String name)
-          throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param importedNodeThe node to import.
-   * @param deepIf <code>true</code>, recursively import the subtree under
-   *   the specified node; if <code>false</code>, import only the node
-   *   itself, as explained above. This has no effect on <code>Attr</code>
-   *   , <code>EntityReference</code>, and <code>Notation</code> nodes.
-   *
-   * NEEDSDOC @param importedNode
-   * NEEDSDOC @param deep
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Node importNode(Node importedNode, boolean deep) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param namespaceURI Namespace URI for the element
-   * @param qualifiedName Qualified name of the element
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Element createElementNS(String namespaceURI, String qualifiedName)
-          throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param namespaceURI Namespace URI of the attribute
-   * @param qualifiedName Qualified name of the attribute
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public Attr createAttributeNS(String namespaceURI, String qualifiedName)
-          throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented. See org.w3c.dom.Document
-   *
-   * @param elementId ID of the element to get
-   *
-   * @return null
-   */
-  public Element getElementById(String elementId)
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Set Node data
-   *
-   *
-   * @param data data to set for this node
-   *
-   * @throws DOMException
-   */
-  public void setData(String data) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * Unimplemented.
-   *
-   * @param offset Start offset of substring to extract.
-   * @param count The length of the substring to extract.
-   *
-   * @return null
-   *
-   * @throws DOMException
-   */
-  public String substringData(int offset, int count) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * Unimplemented.
-   *
-   * @param arg String data to append
-   *
-   * @throws DOMException
-   */
-  public void appendData(String arg) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * Unimplemented.
-   *
-   * @param offset Start offset of substring to insert.
-   * @param count The length of the substring to insert.
-   * NEEDSDOC @param arg
-   *
-   * @throws DOMException
-   */
-  public void insertData(int offset, String arg) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * Unimplemented.
-   *
-   * @param offset Start offset of substring to delete.
-   * @param count The length of the substring to delete.
-   *
-   * @throws DOMException
-   */
-  public void deleteData(int offset, int count) throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * Unimplemented.
-   *
-   * @param offset Start offset of substring to replace.
-   * @param count The length of the substring to replace.
-   * @param arg substring to replace with
-   *
-   * @throws DOMException
-   */
-  public void replaceData(int offset, int count, String arg)
-          throws DOMException
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * Unimplemented.
-   *
-   * @param offset Offset into text to split
-   *
-   * @return null, unimplemented
-   *
-   * @throws DOMException
-   */
-  public Text splitText(int offset) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * NEEDSDOC Method adoptNode 
-   *
-   *
-   * NEEDSDOC @param source
-   *
-   * NEEDSDOC (adoptNode) @return
-   *
-   * @throws DOMException
-   */
-  public Node adoptNode(Node source) throws DOMException
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the encoding
-   * of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public String getEncoding()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the encoding
-   * of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param encoding
-   */
-  public void setEncoding(String encoding)
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, whether this
-   * document is standalone.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public boolean getStandalone()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return false;
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, whether this
-   * document is standalone.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param standalone
-   */
-  public void setStandalone(boolean standalone)
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying whether errors checking is enforced or not.
-   * When set to <code>false</code>, the implementation is free to not
-   * test every possible error case normally defined on DOM operations,
-   * and not raise any <code>DOMException</code>. In case of error, the
-   * behavior is undefined. This attribute is <code>true</code> by
-   * defaults.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public boolean getStrictErrorChecking()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return false;
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying whether errors checking is enforced or not.
-   * When set to <code>false</code>, the implementation is free to not
-   * test every possible error case normally defined on DOM operations,
-   * and not raise any <code>DOMException</code>. In case of error, the
-   * behavior is undefined. This attribute is <code>true</code> by
-   * defaults.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param strictErrorChecking
-   */
-  public void setStrictErrorChecking(boolean strictErrorChecking)
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the version
-   * number of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC ($objectName$) @return
-   */
-  public String getVersion()
-  {
-
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
-    return null;
-  }
-
-  /**
-   * <p>EXPERIMENTAL! Based on the <a
-   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
-   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
-   * <p>
-   * An attribute specifying, as part of the XML declaration, the version
-   * number of this document. This is <code>null</code> when unspecified.
-   * @since DOM Level 3
-   *
-   * NEEDSDOC @param version
-   */
-  public void setVersion(String version)
-  {
-    error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-  }
-}
diff --git a/src/org/apache/xml/utils/WrappedRuntimeException.java b/src/org/apache/xml/utils/WrappedRuntimeException.java
deleted file mode 100644
index cd057a5..0000000
--- a/src/org/apache/xml/utils/WrappedRuntimeException.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * This class is for throwing important checked exceptions
- * over non-checked methods.  It should be used with care,
- * and in limited circumstances.
- */
-public class WrappedRuntimeException extends RuntimeException
-{
-
-  /** Primary checked exception.
-   *  @serial          */
-  private Exception m_exception;
-
-  /**
-   * Construct a WrappedRuntimeException from a
-   * checked exception.
-   *
-   * @param e Primary checked exception
-   */
-  public WrappedRuntimeException(Exception e)
-  {
-
-    super(e.getMessage());
-
-    m_exception = e;
-  }
-
-  /**
-   * Constructor WrappedRuntimeException
-   *
-   *
-   * @param msg Exception information.
-   * @param e Primary checked exception
-   */
-  public WrappedRuntimeException(String msg, Exception e)
-  {
-
-    super(msg);
-
-    m_exception = e;
-  }
-  
-  /**
-   * Get the checked exception that this runtime exception wraps.
-   *
-   * @return The primary checked exception
-   */
-  public Exception getException()
-  {
-    return m_exception;
-  }
-}
diff --git a/src/org/apache/xml/utils/WrongParserException.java b/src/org/apache/xml/utils/WrongParserException.java
deleted file mode 100644
index 18c7966..0000000
--- a/src/org/apache/xml/utils/WrongParserException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="general"/>
- * Certain functions may throw this error if they are paired with
- * the incorrect parser.
- */
-public class WrongParserException extends RuntimeException
-{
-
-  /**
-   * Create a WrongParserException object.
-   * @param message The error message that should be reported to the user.
-   */
-  public WrongParserException(String message)
-  {
-    super(message);
-  }
-}
diff --git a/src/org/apache/xml/utils/XMLCharacterRecognizer.java b/src/org/apache/xml/utils/XMLCharacterRecognizer.java
deleted file mode 100644
index 4adfa8c..0000000
--- a/src/org/apache/xml/utils/XMLCharacterRecognizer.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class used to verify whether the specified <var>ch</var> 
- * conforms to the XML 1.0 definition of whitespace. 
- */
-public class XMLCharacterRecognizer
-{
-
-  /**
-   * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
-   * of whitespace.  Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
-   * the definition of <CODE>S</CODE></A> for details.
-   * @param ch Character to check as XML whitespace.
-   * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
-   */
-  public static boolean isWhiteSpace(char ch)
-  {
-    return (ch == 0x20) || (ch == 0x09) || (ch == 0xD) || (ch == 0xA);
-  }
-
-  /**
-   * Tell if the string is whitespace.
-   *
-   * @param ch Character array to check as XML whitespace.
-   * @param start Start index of characters in the array
-   * @param length Number of characters in the array 
-   * @return True if the characters in the array are 
-   * XML whitespace; otherwise, false.
-   */
-  public static boolean isWhiteSpace(char ch[], int start, int length)
-  {
-
-    int end = start + length;
-
-    for (int s = start; s < end; s++)
-    {
-      if (!isWhiteSpace(ch[s]))
-        return false;
-    }
-
-    return true;
-  }
-
-  /**
-   * Tell if the string is whitespace.
-   *
-   * @param buf StringBuffer to check as XML whitespace.
-   * @return True if characters in buffer are XML whitespace, false otherwise
-   */
-  public static boolean isWhiteSpace(StringBuffer buf)
-  {
-
-    int n = buf.length();
-
-    for (int i = 0; i < n; i++)
-    {
-      if (!isWhiteSpace(buf.charAt(i)))
-        return false;
-    }
-
-    return true;
-  }
-  
-  /**
-   * Tell if the string is whitespace.
-   *
-   * @param buf StringBuffer to check as XML whitespace.
-   * @return True if characters in buffer are XML whitespace, false otherwise
-   */
-  public static boolean isWhiteSpace(String s)
-  {
-
-    if(null != s)
-    {
-      int n = s.length();
-  
-      for (int i = 0; i < n; i++)
-      {
-        if (!isWhiteSpace(s.charAt(i)))
-          return false;
-      }
-    }
-
-    return true;
-  }
-
-}
diff --git a/src/org/apache/xml/utils/XMLString.java b/src/org/apache/xml/utils/XMLString.java
deleted file mode 100644
index e91ba96..0000000
--- a/src/org/apache/xml/utils/XMLString.java
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-import java.util.Locale;
-
-/**
- * This class is meant to be an interface to character strings, whether they
- * be java Strings or <code>org.apache.xml.utils.FastStringBuffer</code>s, or
- * other character data.  By using XMLString, character copies can be reduced
- * in the XML pipeline.
- */
-public interface XMLString
-{
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value. Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public abstract void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
-    throws org.xml.sax.SAXException;
-
-  /**
-   * Directly call the
-   * comment method on the passed LexicalHandler for the
-   * string-value.
-   *
-   * @param lh A non-null reference to a LexicalHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public abstract void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
-    throws org.xml.sax.SAXException;
-    
-  /**
-   * Conditionally trim all leading and trailing whitespace in the specified String.
-   * All strings of white space are
-   * replaced by a single space character (#x20), except spaces after punctuation which
-   * receive double spaces if doublePunctuationSpaces is true.
-   * This function may be useful to a formatter, but to get first class
-   * results, the formatter should probably do it's own white space handling
-   * based on the semantics of the formatting object.
-   * 
-   * @param   trimHead    Trim leading whitespace?
-   * @param   trimTail    Trim trailing whitespace?
-   * @param   doublePunctuationSpaces    Use double spaces for punctuation?
-   * @return              The trimmed string.
-   */
-  public XMLString fixWhiteSpace(boolean trimHead,
-                                 boolean trimTail,
-                                 boolean doublePunctuationSpaces);
-
-  /**
-   * Returns the length of this string.
-   *
-   * @return  the length of the sequence of characters represented by this
-   *          object.
-   */
-  public abstract int length();
-
-  /**
-   * Returns the character at the specified index. An index ranges
-   * from <code>0</code> to <code>length() - 1</code>. The first character
-   * of the sequence is at index <code>0</code>, the next at index
-   * <code>1</code>, and so on, as for array indexing.
-   *
-   * @param      index   the index of the character.
-   * @return     the character at the specified index of this string.
-   *             The first character is at index <code>0</code>.
-   * @exception  IndexOutOfBoundsException  if the <code>index</code>
-   *             argument is negative or not less than the length of this
-   *             string.
-   */
-  public abstract char charAt(int index);
-
-  /**
-   * Copies characters from this string into the destination character
-   * array.
-   *
-   * @param      srcBegin   index of the first character in the string
-   *                        to copy.
-   * @param      srcEnd     index after the last character in the string
-   *                        to copy.
-   * @param      dst        the destination array.
-   * @param      dstBegin   the start offset in the destination array.
-   * @exception IndexOutOfBoundsException If any of the following
-   *            is true:
-   *            <ul><li><code>srcBegin</code> is negative.
-   *            <li><code>srcBegin</code> is greater than <code>srcEnd</code>
-   *            <li><code>srcEnd</code> is greater than the length of this
-   *                string
-   *            <li><code>dstBegin</code> is negative
-   *            <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
-   *                <code>dst.length</code></ul>
-   * @exception NullPointerException if <code>dst</code> is <code>null</code>
-   */
-  public abstract void getChars(int srcBegin, int srcEnd, char dst[],
-                                int dstBegin);
-                                
-  /**
-   * Compares this string to the specified object.
-   * The result is <code>true</code> if and only if the argument is not
-   * <code>null</code> and is a <code>String</code> object that represents
-   * the same sequence of characters as this object.
-   *
-   * @param   anObject   the object to compare this <code>String</code>
-   *                     against.
-   * @return  <code>true</code> if the <code>String </code>are equal;
-   *          <code>false</code> otherwise.
-   * @see     java.lang.String#compareTo(java.lang.String)
-   * @see     java.lang.String#equalsIgnoreCase(java.lang.String)
-   */
-  public abstract boolean equals(XMLString anObject);
-
-
-  /**
-   * Compares this string to the specified object.
-   * The result is <code>true</code> if and only if the argument is not
-   * <code>null</code> and is a <code>String</code> object that represents
-   * the same sequence of characters as this object.
-   *
-   * @param   anObject   the object to compare this <code>String</code>
-   *                     against.
-   * @return  <code>true</code> if the <code>String </code>are equal;
-   *          <code>false</code> otherwise.
-   * @see     java.lang.String#compareTo(java.lang.String)
-   * @see     java.lang.String#equalsIgnoreCase(java.lang.String)
-   */
-  public abstract boolean equals(Object anObject);
-
-  /**
-   * Compares this <code>String</code> to another <code>String</code>,
-   * ignoring case considerations.  Two strings are considered equal
-   * ignoring case if they are of the same length, and corresponding
-   * characters in the two strings are equal ignoring case.
-   *
-   * @param   anotherString   the <code>String</code> to compare this
-   *                          <code>String</code> against.
-   * @return  <code>true</code> if the argument is not <code>null</code>
-   *          and the <code>String</code>s are equal,
-   *          ignoring case; <code>false</code> otherwise.
-   * @see     #equals(Object)
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see java.lang.Character#toUpperCase(char)
-   */
-  public abstract boolean equalsIgnoreCase(String anotherString);
-
-  /**
-   * Compares two strings lexicographically.
-   *
-   * @param   anotherString   the <code>String</code> to be compared.
-   * @return  the value <code>0</code> if the argument string is equal to
-   *          this string; a value less than <code>0</code> if this string
-   *          is lexicographically less than the string argument; and a
-   *          value greater than <code>0</code> if this string is
-   *          lexicographically greater than the string argument.
-   * @exception java.lang.NullPointerException if <code>anotherString</code>
-   *          is <code>null</code>.
-   */
-  public abstract int compareTo(XMLString anotherString);
-
-  /**
-   * Compares two strings lexicographically, ignoring case considerations.
-   * This method returns an integer whose sign is that of
-   * <code>this.toUpperCase().toLowerCase().compareTo(
-   * str.toUpperCase().toLowerCase())</code>.
-   * <p>
-   * Note that this method does <em>not</em> take locale into account,
-   * and will result in an unsatisfactory ordering for certain locales.
-   * The java.text package provides <em>collators</em> to allow
-   * locale-sensitive ordering.
-   *
-   * @param   str   the <code>String</code> to be compared.
-   * @return  a negative integer, zero, or a positive integer as the
-   *          the specified String is greater than, equal to, or less
-   *          than this String, ignoring case considerations.
-   * @see     java.text.Collator#compare(String, String)
-   * @since   1.2
-   */
-  public abstract int compareToIgnoreCase(XMLString str);
-
-  /**
-   * Tests if this string starts with the specified prefix beginning
-   * a specified index.
-   *
-   * @param   prefix    the prefix.
-   * @param   toffset   where to begin looking in the string.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the substring of this object starting
-   *          at index <code>toffset</code>; <code>false</code> otherwise.
-   *          The result is <code>false</code> if <code>toffset</code> is
-   *          negative or greater than the length of this
-   *          <code>String</code> object; otherwise the result is the same
-   *          as the result of the expression
-   *          <pre>
-   *          this.subString(toffset).startsWith(prefix)
-   *          </pre>
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public abstract boolean startsWith(String prefix, int toffset);
-
-  /**
-   * Tests if this string starts with the specified prefix beginning
-   * a specified index.
-   *
-   * @param   prefix    the prefix.
-   * @param   toffset   where to begin looking in the string.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the substring of this object starting
-   *          at index <code>toffset</code>; <code>false</code> otherwise.
-   *          The result is <code>false</code> if <code>toffset</code> is
-   *          negative or greater than the length of this
-   *          <code>String</code> object; otherwise the result is the same
-   *          as the result of the expression
-   *          <pre>
-   *          this.subString(toffset).startsWith(prefix)
-   *          </pre>
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public abstract boolean startsWith(XMLString prefix, int toffset);
-
-  /**
-   * Tests if this string starts with the specified prefix.
-   *
-   * @param   prefix   the prefix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the character sequence represented by
-   *          this string; <code>false</code> otherwise.
-   *          Note also that <code>true</code> will be returned if the
-   *          argument is an empty string or is equal to this
-   *          <code>String</code> object as determined by the
-   *          {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   * @since   JDK1. 0
-   */
-  public abstract boolean startsWith(String prefix);
-
-  /**
-   * Tests if this string starts with the specified prefix.
-   *
-   * @param   prefix   the prefix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the character sequence represented by
-   *          this string; <code>false</code> otherwise.
-   *          Note also that <code>true</code> will be returned if the
-   *          argument is an empty string or is equal to this
-   *          <code>String</code> object as determined by the
-   *          {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   * @since   JDK1. 0
-   */
-  public abstract boolean startsWith(XMLString prefix);
-
-  /**
-   * Tests if this string ends with the specified suffix.
-   *
-   * @param   suffix   the suffix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a suffix of the character sequence represented by
-   *          this object; <code>false</code> otherwise. Note that the
-   *          result will be <code>true</code> if the argument is the
-   *          empty string or is equal to this <code>String</code> object
-   *          as determined by the {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>suffix</code> is
-   *          <code>null</code>.
-   */
-  public abstract boolean endsWith(String suffix);
-
-  /**
-   * Returns a hashcode for this string. The hashcode for a
-   * <code>String</code> object is computed as
-   * <blockquote><pre>
-   * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
-   * </pre></blockquote>
-   * using <code>int</code> arithmetic, where <code>s[i]</code> is the
-   * <i>i</i>th character of the string, <code>n</code> is the length of
-   * the string, and <code>^</code> indicates exponentiation.
-   * (The hash value of the empty string is zero.)
-   *
-   * @return  a hash code value for this object.
-   */
-  public abstract int hashCode();
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified character. If a character with value <code>ch</code> occurs
-   * in the character sequence represented by this <code>String</code>
-   * object, then the index of the first such occurrence is returned --
-   * that is, the smallest value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.charAt(<i>k</i>) == ch
-   * </pre></blockquote>
-   * is <code>true</code>. If no such character occurs in this string,
-   * then <code>-1</code> is returned.
-   *
-   * @param   ch   a character.
-   * @return  the index of the first occurrence of the character in the
-   *          character sequence represented by this object, or
-   *          <code>-1</code> if the character does not occur.
-   */
-  public abstract int indexOf(int ch);
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified character, starting the search at the specified index.
-   * <p>
-   * If a character with value <code>ch</code> occurs in the character
-   * sequence represented by this <code>String</code> object at an index
-   * no smaller than <code>fromIndex</code>, then the index of the first
-   * such occurrence is returned--that is, the smallest value <i>k</i>
-   * such that:
-   * <blockquote><pre>
-   * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
-   * </pre></blockquote>
-   * is true. If no such character occurs in this string at or after
-   * position <code>fromIndex</code>, then <code>-1</code> is returned.
-   * <p>
-   * There is no restriction on the value of <code>fromIndex</code>. If it
-   * is negative, it has the same effect as if it were zero: this entire
-   * string may be searched. If it is greater than the length of this
-   * string, it has the same effect as if it were equal to the length of
-   * this string: <code>-1</code> is returned.
-   *
-   * @param   ch          a character.
-   * @param   fromIndex   the index to start the search from.
-   * @return  the index of the first occurrence of the character in the
-   *          character sequence represented by this object that is greater
-   *          than or equal to <code>fromIndex</code>, or <code>-1</code>
-   *          if the character does not occur.
-   */
-  public abstract int indexOf(int ch, int fromIndex);
-
-  /**
-   * Returns the index within this string of the last occurrence of the
-   * specified character. That is, the index returned is the largest
-   * value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.charAt(<i>k</i>) == ch
-   * </pre></blockquote>
-   * is true.
-   * The String is searched backwards starting at the last character.
-   *
-   * @param   ch   a character.
-   * @return  the index of the last occurrence of the character in the
-   *          character sequence represented by this object, or
-   *          <code>-1</code> if the character does not occur.
-   */
-  public abstract int lastIndexOf(int ch);
-
-  /**
-   * Returns the index within this string of the last occurrence of the
-   * specified character, searching backward starting at the specified
-   * index. That is, the index returned is the largest value <i>k</i>
-   * such that:
-   * <blockquote><pre>
-   * this.charAt(k) == ch) && (k <= fromIndex)
-   * </pre></blockquote>
-   * is true.
-   *
-   * @param   ch          a character.
-   * @param   fromIndex   the index to start the search from. There is no
-   *          restriction on the value of <code>fromIndex</code>. If it is
-   *          greater than or equal to the length of this string, it has
-   *          the same effect as if it were equal to one less than the
-   *          length of this string: this entire string may be searched.
-   *          If it is negative, it has the same effect as if it were -1:
-   *          -1 is returned.
-   * @return  the index of the last occurrence of the character in the
-   *          character sequence represented by this object that is less
-   *          than or equal to <code>fromIndex</code>, or <code>-1</code>
-   *          if the character does not occur before that point.
-   */
-  public abstract int lastIndexOf(int ch, int fromIndex);
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified substring. The integer returned is the smallest value
-   * <i>k</i> such that:
-   * <blockquote><pre>
-   * this.startsWith(str, <i>k</i>)
-   * </pre></blockquote>
-   * is <code>true</code>.
-   *
-   * @param   str   any string.
-   * @return  if the string argument occurs as a substring within this
-   *          object, then the index of the first character of the first
-   *          such substring is returned; if it does not occur as a
-   *          substring, <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public abstract int indexOf(String str);
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified substring. The integer returned is the smallest value
-   * <i>k</i> such that:
-   * <blockquote><pre>
-   * this.startsWith(str, <i>k</i>)
-   * </pre></blockquote>
-   * is <code>true</code>.
-   *
-   * @param   str   any string.
-   * @return  if the string argument occurs as a substring within this
-   *          object, then the index of the first character of the first
-   *          such substring is returned; if it does not occur as a
-   *          substring, <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public abstract int indexOf(XMLString str);
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified substring, starting at the specified index. The integer
-   * returned is the smallest value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.startsWith(str, <i>k</i>) && (<i>k</i> >= fromIndex)
-   * </pre></blockquote>
-   * is <code>true</code>.
-   * <p>
-   * There is no restriction on the value of <code>fromIndex</code>. If
-   * it is negative, it has the same effect as if it were zero: this entire
-   * string may be searched. If it is greater than the length of this
-   * string, it has the same effect as if it were equal to the length of
-   * this string: <code>-1</code> is returned.
-   *
-   * @param   str         the substring to search for.
-   * @param   fromIndex   the index to start the search from.
-   * @return  If the string argument occurs as a substring within this
-   *          object at a starting index no smaller than
-   *          <code>fromIndex</code>, then the index of the first character
-   *          of the first such substring is returned. If it does not occur
-   *          as a substring starting at <code>fromIndex</code> or beyond,
-   *          <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>
-   */
-  public abstract int indexOf(String str, int fromIndex);
-
-  /**
-   * Returns the index within this string of the rightmost occurrence
-   * of the specified substring.  The rightmost empty string "" is
-   * considered to occur at the index value <code>this.length()</code>.
-   * The returned index is the largest value <i>k</i> such that
-   * <blockquote><pre>
-   * this.startsWith(str, k)
-   * </pre></blockquote>
-   * is true.
-   *
-   * @param   str   the substring to search for.
-   * @return  if the string argument occurs one or more times as a substring
-   *          within this object, then the index of the first character of
-   *          the last such substring is returned. If it does not occur as
-   *          a substring, <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException  if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public abstract int lastIndexOf(String str);
-
-  /**
-   * Returns the index within this string of the last occurrence of
-   * the specified substring.
-   *
-   * @param   str         the substring to search for.
-   * @param   fromIndex   the index to start the search from. There is no
-   *          restriction on the value of fromIndex. If it is greater than
-   *          the length of this string, it has the same effect as if it
-   *          were equal to the length of this string: this entire string
-   *          may be searched. If it is negative, it has the same effect
-   *          as if it were -1: -1 is returned.
-   * @return  If the string argument occurs one or more times as a substring
-   *          within this object at a starting index no greater than
-   *          <code>fromIndex</code>, then the index of the first character of
-   *          the last such substring is returned. If it does not occur as a
-   *          substring starting at <code>fromIndex</code> or earlier,
-   *          <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public abstract int lastIndexOf(String str, int fromIndex);
-
-  /**
-   * Returns a new string that is a substring of this string. The
-   * substring begins with the character at the specified index and
-   * extends to the end of this string. <p>
-   * Examples:
-   * <blockquote><pre>
-   * "unhappy".substring(2) returns "happy"
-   * "Harbison".substring(3) returns "bison"
-   * "emptiness".substring(9) returns "" (an empty string)
-   * </pre></blockquote>
-   *
-   * @param      beginIndex   the beginning index, inclusive.
-   * @return     the specified substring.
-   * @exception  IndexOutOfBoundsException  if
-   *             <code>beginIndex</code> is negative or larger than the
-   *             length of this <code>String</code> object.
-   */
-  public abstract XMLString substring(int beginIndex);
-
-  /**
-   * Returns a new string that is a substring of this string. The
-   * substring begins at the specified <code>beginIndex</code> and
-   * extends to the character at index <code>endIndex - 1</code>.
-   * Thus the length of the substring is <code>endIndex-beginIndex</code>.
-   *
-   * @param      beginIndex   the beginning index, inclusive.
-   * @param      endIndex     the ending index, exclusive.
-   * @return     the specified substring.
-   * @exception  IndexOutOfBoundsException  if the
-   *             <code>beginIndex</code> is negative, or
-   *             <code>endIndex</code> is larger than the length of
-   *             this <code>String</code> object, or
-   *             <code>beginIndex</code> is larger than
-   *             <code>endIndex</code>.
-   */
-  public abstract XMLString substring(int beginIndex, int endIndex);
-
-  /**
-   * Concatenates the specified string to the end of this string.
-   *
-   * @param   str   the <code>String</code> that is concatenated to the end
-   *                of this <code>String</code>.
-   * @return  a string that represents the concatenation of this object's
-   *          characters followed by the string argument's characters.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public abstract XMLString concat(String str);
-
-  /**
-   * Converts all of the characters in this <code>String</code> to lower
-   * case using the rules of the given <code>Locale</code>.
-   *
-   * @param locale use the case transformation rules for this locale
-   * @return the String, converted to lowercase.
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see     java.lang.String#toUpperCase(Locale)
-   */
-  public abstract XMLString toLowerCase(Locale locale);
-
-  /**
-   * Converts all of the characters in this <code>String</code> to lower
-   * case using the rules of the default locale, which is returned
-   * by <code>Locale.getDefault</code>.
-   * <p>
-   *
-   * @return  the string, converted to lowercase.
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see     java.lang.String#toLowerCase(Locale)
-   */
-  public abstract XMLString toLowerCase();
-
-  /**
-   * Converts all of the characters in this <code>String</code> to upper
-   * case using the rules of the given locale.
-   * @param locale use the case transformation rules for this locale
-   * @return the String, converted to uppercase.
-   * @see     java.lang.Character#toUpperCase(char)
-   * @see     java.lang.String#toLowerCase(Locale)
-   */
-  public abstract XMLString toUpperCase(Locale locale);
-
-  /**
-   * Converts all of the characters in this <code>String</code> to upper
-   * case using the rules of the default locale, which is returned
-   * by <code>Locale.getDefault</code>.
-   *
-   * <p>
-   * If no character in this string has a different uppercase version,
-   * based on calling the <code>toUpperCase</code> method defined by
-   * <code>Character</code>, then the original string is returned.
-   * <p>
-   * Otherwise, this method creates a new <code>String</code> object
-   * representing a character sequence identical in length to the
-   * character sequence represented by this <code>String</code> object and
-   * with every character equal to the result of applying the method
-   * <code>Character.toUpperCase</code> to the corresponding character of
-   * this <code>String</code> object. <p>
-   * Examples:
-   * <blockquote><pre>
-   * "Fahrvergnügen".toUpperCase() returns "FAHRVERGNÜGEN"
-   * "Visit Ljubinje!".toUpperCase() returns "VISIT LJUBINJE!"
-   * </pre></blockquote>
-   *
-   * @return  the string, converted to uppercase.
-   * @see     java.lang.Character#toUpperCase(char)
-   * @see     java.lang.String#toUpperCase(Locale)
-   */
-  public abstract XMLString toUpperCase();
-
-  /**
-   * Removes white space from both ends of this string.
-   * <p>
-   * If this <code>String</code> object represents an empty character
-   * sequence, or the first and last characters of character sequence
-   * represented by this <code>String</code> object both have codes
-   * greater than <code>'&#92;u0020'</code> (the space character), then a
-   * reference to this <code>String</code> object is returned.
-   * <p>
-   * Otherwise, if there is no character with a code greater than
-   * <code>'&#92;u0020'</code> in the string, then a new
-   * <code>String</code> object representing an empty string is created
-   * and returned.
-   * <p>
-   * Otherwise, let <i>k</i> be the index of the first character in the
-   * string whose code is greater than <code>'&#92;u0020'</code>, and let
-   * <i>m</i> be the index of the last character in the string whose code
-   * is greater than <code>'&#92;u0020'</code>. A new <code>String</code>
-   * object is created, representing the substring of this string that
-   * begins with the character at index <i>k</i> and ends with the
-   * character at index <i>m</i>-that is, the result of
-   * <code>this.substring(<i>k</i>,&nbsp;<i>m</i>+1)</code>.
-   * <p>
-   * This method may be used to trim
-   * {@link Character#isSpace(char) whitespace} from the beginning and end
-   * of a string; in fact, it trims all ASCII control characters as well.
-   *
-   * @return  this string, with white space removed from the front and end.
-   */
-  public abstract XMLString trim();
-
-  /**
-   * This object (which is already a string!) is itself returned.
-   *
-   * @return  the string itself.
-   */
-  public abstract String toString();
-  
-  /**
-   * Tell if this object contains a java String object.
-   * 
-   * @return true if this XMLString can return a string without creating one.
-   */
-  public abstract boolean hasString();
-  
-  /**
-   * Convert a string to a double -- Allowed input is in fixed
-   * notation ddd.fff.
-   *
-   * @return A double value representation of the string, or return Double.NaN 
-   * if the string can not be converted.
-   */
-  public double toDouble();
-}
diff --git a/src/org/apache/xml/utils/XMLStringFactory.java b/src/org/apache/xml/utils/XMLStringFactory.java
deleted file mode 100644
index 8675597..0000000
--- a/src/org/apache/xml/utils/XMLStringFactory.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils;
-
-/**
- * A concrete class that implements this interface creates XMLString objects.
- */
-public abstract class XMLStringFactory
-{
-
-  /**
-   * Create a new XMLString from a Java string.
-   *
-   *
-   * @param string Java String reference, which must be non-null.
-   *
-   * @return An XMLString object that wraps the String reference.
-   */
-  public abstract XMLString newstr(String string);
-
-  /**
-   * Create a XMLString from a FastStringBuffer.
-   *
-   *
-   * @param string FastStringBuffer reference, which must be non-null.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   *
-   * @return An XMLString object that wraps the FastStringBuffer reference.
-   */
-  public abstract XMLString newstr(FastStringBuffer string, int start, 
-                                   int length);
-
-  /**
-   * Create a XMLString from a FastStringBuffer.
-   *
-   *
-   * @param string FastStringBuffer reference, which must be non-null.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   *
-   * @return An XMLString object that wraps the FastStringBuffer reference.
-   */
-  public abstract XMLString newstr(char[] string, int start, 
-                                   int length);
-                                   
-  /**
-   * Get a cheap representation of an empty string.
-   * 
-   * @return An non-null reference to an XMLString that represents "".
-   */
-  public abstract XMLString emptystr();
-}
diff --git a/src/org/apache/xml/utils/package.html b/src/org/apache/xml/utils/package.html
deleted file mode 100644
index 3c5fe69..0000000
--- a/src/org/apache/xml/utils/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <title>Xalan utilities.</title>
-  <body>
-    <p>Implementation of Xalan utility classes.  This package is also shared by XPath.
-       There *should* be no outward dependencies to XPath or Xalan by classes in this package.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xml/utils/res/XResourceBundle.java b/src/org/apache/xml/utils/res/XResourceBundle.java
deleted file mode 100644
index 14d7d3a..0000000
--- a/src/org/apache/xml/utils/res/XResourceBundle.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundleBase;
-
-import java.util.*;
-
-/**
- * <meta name="usage" content="internal"/>
- * The default (english) resource bundle.
- */
-public class XResourceBundle extends ListResourceBundle
-{
-
-  /** Error resource constants */
-  public static final String ERROR_RESOURCES =
-    "org.apache.xalan.res.XSLTErrorResources", XSLT_RESOURCE =
-    "org.apache.xml.utils.res.XResourceBundle", LANG_BUNDLE_NAME =
-    "org.apache.xml.utils.res.XResources", MULT_ORDER =
-    "multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS =
-    "follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT =
-    "rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING =
-    "numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD =
-    "multiplicative-additive", LANG_MULTIPLIER =
-    "multiplier", LANG_MULTIPLIER_CHAR =
-    "multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES =
-    "tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET = "tradAlphabet";
-
-  /**
-   * Return a named ResourceBundle for a particular locale.  This method mimics the behavior
-   * of ResourceBundle.getBundle().
-   *
-   * @param className Name of local-specific subclass.
-   * @param locale the locale to prefer when searching for the bundle
-   */
-  public static final XResourceBundle loadResourceBundle(
-          String className, Locale locale) throws MissingResourceException
-  {
-
-    String suffix = getResourceSuffix(locale);
-
-    //System.out.println("resource " + className + suffix);
-    try
-    {
-      
-      // first try with the given locale
-      String resourceName = className + suffix;
-      return (XResourceBundle) ResourceBundle.getBundle(resourceName, locale);
-    }
-    catch (MissingResourceException e)
-    {
-      try  // try to fall back to en_US if we can't load
-      {
-
-        // Since we can't find the localized property file,
-        // fall back to en_US.
-        return (XResourceBundle) ResourceBundle.getBundle(
-          XSLT_RESOURCE, new Locale("en", "US"));
-      }
-      catch (MissingResourceException e2)
-      {
-
-        // Now we are really in trouble.
-        // very bad, definitely very bad...not going to get very far
-        throw new MissingResourceException(
-          "Could not load any resource bundles.", className, "");
-      }
-    }
-  }
-
-  /**
-   * Return the resource file suffic for the indicated locale
-   * For most locales, this will be based the language code.  However
-   * for Chinese, we do distinguish between Taiwan and PRC
-   *
-   * @param locale the locale
-   * @return an String suffix which canbe appended to a resource name
-   */
-  private static final String getResourceSuffix(Locale locale)
-  {
-
-    String lang = locale.getLanguage();
-    String country = locale.getCountry();
-    String variant = locale.getVariant();
-    String suffix = "_" + locale.getLanguage();
-
-    if (lang.equals("zh"))
-      suffix += "_" + country;
-
-    if (country.equals("JP"))
-      suffix += "_" + country + "_" + variant;
-
-    return suffix;
-  }
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list. */
-  static final Object[][] contents =
-  {
-    { "ui_language", "en" }, { "help_language", "en" }, { "language", "en" },
-    { "alphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "additive" },
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResourceBundleBase.java b/src/org/apache/xml/utils/res/XResourceBundleBase.java
deleted file mode 100644
index bad46c6..0000000
--- a/src/org/apache/xml/utils/res/XResourceBundleBase.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * <meta name="usage" content="internal"/>
- * This is an interface for error messages.  This class is misnamed,
- * and should be called XalanResourceBundle, or some such.
- */
-abstract public class XResourceBundleBase extends ListResourceBundle
-{
-
-  /**
-   * Get the error string associated with the error code
-   *
-   * @param errorCode Error code
-   *
-   * @return error string associated with the given error code
-   */
-  abstract public String getMessageKey(int errorCode);
-
-  /**
-   * Get the warning string associated with the error code
-   *
-   * @param errorCode Error code
-   * 
-   * @return warning string associated with the given error code
-   */
-  abstract public String getWarningKey(int errorCode);
-}
diff --git a/src/org/apache/xml/utils/res/XResources_cy.java b/src/org/apache/xml/utils/res/XResources_cy.java
deleted file mode 100644
index 663708a..0000000
--- a/src/org/apache/xml/utils/res/XResources_cy.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-
-
-/**
- * <meta name="usage" content="internal"/>
- * The Cyrillic resource bundle.
- */
-public class XResources_cy extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
- /** The association list. */
-  static final Object[][] contents =
-  {
-    { "ui_language", "cy" }, { "help_language", "cy" }, { "language", "cy" },
-    { "alphabet",
-      new char[]{ 0x0430, 0x0432, 0x0433, 0x0434, 0x0435, 0x0437, 0x0438,
-                  0x0439, 0x04A9, 0x0457, 0x043A, 0x043B, 0x043C, 0x043D,
-                  0x046F, 0x043E, 0x043F, 0x0447, 0x0440, 0x0441, 0x0442,
-                  0x0443, 0x0444, 0x0445, 0x0470, 0x0460, 0x0446 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering 
-    //{"numbering", "additive"},
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "precedes" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer(10000000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 100, 10, 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier", new int[]{ 1000 } },
-    { "multiplierChar", new char[]{ 0x03D9 } },
-
-    // chinese only??
-    { "zero", new char[0] },
-
-    //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
-    { "digits",
-      new char[]{ 0x0430, 0x0432, 0x0433, 0x0434, 0x0435, 0x0437, 0x0438,
-                  0x0439, 0x04A9 } },
-    { "tens",
-      new char[]{ 0x0457, 0x043A, 0x043B, 0x043C, 0x043D, 0x046F, 0x043E,
-                  0x043F, 0x0447 } },
-    { "hundreds",
-      new char[]{ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0470,
-                  0x0460, 0x0446 } },
-    { "tables", new String[]{ "hundreds", "tens", "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_el.java b/src/org/apache/xml/utils/res/XResources_el.java
deleted file mode 100644
index 2cca602..0000000
--- a/src/org/apache/xml/utils/res/XResources_el.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Greek resource bundle.
- */
-public class XResources_el extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.          */
-  static final Object[][] contents =
-  {
-    { "ui_language", "el" }, { "help_language", "el" }, { "language", "el" },
-    { "alphabet",
-      new char[]{ 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
-                  0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be,
-                  0x03bf, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5,
-                  0x03c6, 0x03c7, 0x03c8, 0x03c9 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering 
-    //{"numbering", "additive"},
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "precedes" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer()},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 100, 10, 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier", new int[]{ 1000 } },
-    { "multiplierChar", new char[]{ 0x03d9 } },
-
-    // chinese only??
-    { "zero", new char[0] },
-
-    //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
-    { "digits",
-      new char[]{ 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03db, 0x03b6,
-                  0x03b7, 0x03b8 } },
-    { "tens",
-      new char[]{ 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
-                  0x03c0, 0x03df } },
-    { "hundreds",
-      new char[]{ 0x03c1, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8,
-                  0x03c9, 0x03e1 } },
-
-    //{"thousands", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},  
-    //hundreds, etc...
-    { "tables", new String[]{ "hundreds", "tens", "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_en.java b/src/org/apache/xml/utils/res/XResources_en.java
deleted file mode 100644
index a6cd352..0000000
--- a/src/org/apache/xml/utils/res/XResources_en.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The English resource bundle.
- */
-public class XResources_en extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.         */
-  static final Object[][] contents =
-  {
-    { "ui_language", "en" }, { "help_language", "en" }, { "language", "en" },
-    { "alphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "additive" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer()},
-    //These would not be used for EN. Only used for traditional numbering   
-    //{"numberGroups", new int[]{10,1}},
-    //These only used for mutiplicative-additive numbering
-    //{"multiplier", "10"},
-    //{"multiplierChar", "M"}, 
-    //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
-    //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
-    //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},  
-    //hundreds, etc...
-    //{"tables", new String[]{"tens", "digits"}}
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_he.java b/src/org/apache/xml/utils/res/XResources_he.java
deleted file mode 100644
index 54e9642..0000000
--- a/src/org/apache/xml/utils/res/XResources_he.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Hebrew resource bundle.
- */
-public class XResources_he extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.          */
-  static final Object[][] contents =
-  {
-    { "ui_language", "he" }, { "help_language", "he" }, { "language", "he" },
-    { "alphabet",
-      new char[]{ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6,
-                  0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD,
-                  0x05DE, 0x05DF, 0x05E0, 0x05E1 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "RightToLeft" },
-
-    //language numbering   
-    { "numbering", "additive" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer()},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 10, 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    //{"multiplier", "10"},
-    //{"multiplierChar", "M"}, 
-    //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
-    { "digits",
-      new char[]{ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6,
-                  0x05D7, 0x05D8 } },
-    { "tens",
-      new char[]{ 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
-                  0x05E0, 0x05E1 } },
-
-    //hundreds, etc...
-    { "tables", new String[]{ "tens", "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_hy.java b/src/org/apache/xml/utils/res/XResources_hy.java
deleted file mode 100644
index 2bb4063..0000000
--- a/src/org/apache/xml/utils/res/XResources_hy.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Armenian resource bundle.
- */
-public class XResources_hy extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.          */
-  static final Object[][] contents =
-  {
-    { "ui_language", "hy" }, { "help_language", "hy" }, { "language", "hy" },
-    { "alphabet",
-      new char[]{ 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
-                  0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E,
-                  0x056F, 0x0567, 0x0568, 0x0572, 0x0573, 0x0574, 0x0575,
-                  0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C,
-                  0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582, 0x0583,
-                  0x0584 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "additive" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer()},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1000, 100, 10, 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    //{"multiplier", "10"},
-    //{"multiplierChar", "M"}, 
-    //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
-    { "digits",
-      new char[]{ 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
-                  0x0568, 0x0569 } },
-    { "tens",
-      new char[]{ 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, 0x0567,
-                  0x0568, 0x0572 } },
-    { "hundreds",
-      new char[]{ 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579,
-                  0x057A, 0x057B } },
-    { "thousands",
-      new char[]{ 0x057C, 0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582,
-                  0x0583, 0x0584 } },
-    { "tables", new String[]{ "thousands", "hundreds", "tens", "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_ja_JP_A.java b/src/org/apache/xml/utils/res/XResources_ja_JP_A.java
deleted file mode 100644
index 09b17a7..0000000
--- a/src/org/apache/xml/utils/res/XResources_ja_JP_A.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Japanese (Katakana) resource bundle.
- */
-public class XResources_ja_JP_A extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.         */
-  static final Object[][] contents =
-  {
-    { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
-    { "alphabet",
-      new char[]{ 0x30a2, 0x30a4, 0x30a6, 0x30a8, 0x30aa, 0x30ab, 0x30ad,
-                  0x30af, 0x30b1, 0x30b3, 0x30b5, 0x30b7, 0x30b9, 0x30bb,
-                  0x30bd, 0x30bf, 0x30c1, 0x30c4, 0x30c6, 0x30c8, 0x30ca,
-                  0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d2, 0x30d5,
-                  0x30d8, 0x30db, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2,
-                  0x30e4, 0x30e6, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec,
-                  0x30ed, 0x30ef, 0x30f0, 0x30f1, 0x30f2, 0x30f3 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation 
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "follows" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer(10000000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier",
-      new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
-    { "multiplierChar",
-      new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
-
-    // chinese only? 
-    { "zero", new char[0] },
-    { "digits",
-      new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
-                  0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_ja_JP_HA.java b/src/org/apache/xml/utils/res/XResources_ja_JP_HA.java
deleted file mode 100644
index 720caee..0000000
--- a/src/org/apache/xml/utils/res/XResources_ja_JP_HA.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Japanese (Hiragana) resource bundle.
- */
-public class XResources_ja_JP_HA extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.        */
-  static final Object[][] contents =
-  {
-    { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
-    { "alphabet",
-      new char[]{ 0x3042, 0x3044, 0x3046, 0x3048, 0x304a, 0x304b, 0x304d,
-                  0x304f, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305b,
-                  0x305d, 0x305f, 0x3061, 0x3064, 0x3066, 0x3068, 0x306a,
-                  0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3072, 0x3075,
-                  0x3078, 0x307b, 0x307e, 0x307f, 0x3080, 0x3081, 0x3082,
-                  0x3084, 0x3086, 0x3088, 0x3089, 0x308a, 0x308b, 0x308c,
-                  0x308d, 0x308f, 0x3090, 0x3091, 0x3092, 0x3093 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation 
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "follows" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer(10000000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier",
-      new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
-    { "multiplierChar",
-      new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
-
-    // chinese only? 
-    { "zero", new char[0] },
-    { "digits",
-      new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
-                  0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_ja_JP_HI.java b/src/org/apache/xml/utils/res/XResources_ja_JP_HI.java
deleted file mode 100644
index 14a565b..0000000
--- a/src/org/apache/xml/utils/res/XResources_ja_JP_HI.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Japanese (Hiragana) resource bundle.
- */
-public class XResources_ja_JP_HI extends XResourceBundle
-{
-
-  /**
-   * Get the association table for this resource.
-   *
-   *
-   * @return the association table for this resource.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association table for this resource.  */
-  static final Object[][] contents =
-  {
-    { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
-    { "alphabet",
-      new char[]{ 0x3044, 0x308d, 0x306f, 0x306b, 0x307b, 0x3078, 0x3068,
-                  0x3061, 0x308a, 0x306c, 0x308b, 0x3092, 0x308f, 0x304b,
-                  0x3088, 0x305f, 0x308c, 0x305d, 0x3064, 0x306d, 0x306a,
-                  0x3089, 0x3080, 0x3046, 0x3090, 0x306e, 0x304a, 0x304f,
-                  0x3084, 0x307e, 0x3051, 0x3075, 0x3053, 0x3048, 0x3066,
-                  0x3042, 0x3055, 0x304d, 0x3086, 0x3081, 0x307f, 0x3057,
-                  0x3091, 0x3072, 0x3082, 0x305b, 0x3059 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "follows" },
-
-    // largest numerical value 
-    //{"MaxNumericalValue", new Integer(10000000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier",
-      new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
-    { "multiplierChar",
-      new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
-
-    // chinese only??
-    { "zero", new char[0] },
-    { "digits",
-      new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
-                  0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_ja_JP_I.java b/src/org/apache/xml/utils/res/XResources_ja_JP_I.java
deleted file mode 100644
index 90e9374..0000000
--- a/src/org/apache/xml/utils/res/XResources_ja_JP_I.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Japanese (Katakana) resource bundle.
- */
-public class XResources_ja_JP_I extends XResourceBundle
-{
-
-  /**
-   * Get the association table for this resource.
-   *
-   *
-   * @return the association table for this resource.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association table for this resource.  */
-  static final Object[][] contents =
-  {
-    { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
-    { "alphabet",
-      new char[]{ 0x30a4, 0x30ed, 0x30cf, 0x30cb, 0x30db, 0x30d8, 0x30c8,
-                  0x30c1, 0x30ea, 0x30cc, 0x30eb, 0x30f2, 0x30ef, 0x30ab,
-                  0x30e8, 0x30bf, 0x30ec, 0x30bd, 0x30c4, 0x30cd, 0x30ca,
-                  0x30e9, 0x30e0, 0x30a6, 0x30f0, 0x30ce, 0x30aa, 0x30af,
-                  0x30e4, 0x30de, 0x30b1, 0x30d5, 0x30b3, 0x30a8, 0x30c6,
-                  0x30a2, 0x30b5, 0x30ad, 0x30e6, 0x30e1, 0x30df, 0x30b7,
-                  0x30f1, 0x30d2, 0x30e2, 0x30bb, 0x30b9 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "follows" },
-
-    // largest numerical value 
-    //{"MaxNumericalValue", new Integer(10000000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier",
-      new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
-    { "multiplierChar",
-      new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
-
-    // chinese only??
-    { "zero", new char[0] },
-    { "digits",
-      new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
-                  0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_ka.java b/src/org/apache/xml/utils/res/XResources_ka.java
deleted file mode 100644
index 776ee2c..0000000
--- a/src/org/apache/xml/utils/res/XResources_ka.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Georgian resource bundle.
- */
-public class XResources_ka extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.          */
-  static final Object[][] contents =
-  {
-    { "ui_language", "ka" }, { "help_language", "ka" }, { "language", "ka" },
-    { "alphabet",
-      new char[]{ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6,
-                  0x10f1, 0x10D7, 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC,
-                  0x10f2, 0x10DD, 0x10DE, 0x10DF, 0x10E0, 0x10E1, 0x10E2,
-                  0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, 0x10E8, 0x10E9,
-                  0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10F4, 0x10EF,
-                  0x10F0 } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "additive" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer(10000000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1000, 100, 10, 1 } },
-
-    //These used for additive numbering
-    { "digits",
-      new char[]{ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6,
-                  0x10f1, 0x10D7 } },
-    { "tens",
-      new char[]{ 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10f2, 0x10DD,
-                  0x10DE, 0x10DF } },
-    { "hundreds",
-      new char[]{ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6,
-                  0x10E7, 0x10E8 } },
-    { "thousands",
-      new char[]{ 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10F4,
-                  0x10EF, 0x10F0 } },
-    { "tables", new String[]{ "thousands", "hundreds", "tens", "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_zh_CN.java b/src/org/apache/xml/utils/res/XResources_zh_CN.java
deleted file mode 100644
index 5ea5910..0000000
--- a/src/org/apache/xml/utils/res/XResources_zh_CN.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Chinese resource bundle.
- */
-public class XResources_zh_CN extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.          */
-  static final Object[][] contents =
-  {
-    { "ui_language", "zh" }, { "help_language", "zh" }, { "language", "zh" },
-    { "alphabet",
-      new char[]{ 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
-                  0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e,
-                  0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35,
-                  0xff36, 0xff37, 0xff38, 0xff39, 0xff3a } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation 
-    { "orientation", "LeftToRight" },
-
-    //language numbering   
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "follows" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer(100000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1 } },
-
-    // simplified chinese  
-    { "zero", new char[]{ 0x96f6 } },
-
-    //These only used for mutiplicative-additive numbering
-    { "multiplier", new int[]{ 100000000, 10000, 1000, 100, 10 } },
-    { "multiplierChar",
-      new char[]{ 0x4ebf, 0x4e07, 0x5343, 0x767e, 0x5341 } },
-    { "digits",
-      new char[]{ 0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03,
-                  0x516b, 0x4e5d } }, { "tables", new String[]{ "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/res/XResources_zh_TW.java b/src/org/apache/xml/utils/res/XResources_zh_TW.java
deleted file mode 100644
index d8d0d34..0000000
--- a/src/org/apache/xml/utils/res/XResources_zh_TW.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.res;
-
-import org.apache.xml.utils.res.XResourceBundle;
-
-import java.util.*;
-
-//
-//  LangResources_en.properties
-//
-
-/**
- * <meta name="usage" content="internal"/>
- * The Chinese(Taiwan) resource bundle.
- */
-public class XResources_zh_TW extends XResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.         */
-  static final Object[][] contents =
-  {
-    { "ui_language", "zh" }, { "help_language", "zh" }, { "language", "zh" },
-    { "alphabet",
-      new char[]{ 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
-                  0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e,
-                  0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35,
-                  0xff36, 0xff37, 0xff38, 0xff39, 0xff3a } },
-    { "tradAlphabet",
-      new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                  'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                  'Y', 'Z' } },
-
-    //language orientation 
-    { "orientation", "LeftToRight" },
-
-    //language numbering    
-    { "numbering", "multiplicative-additive" },
-    { "multiplierOrder", "follows" },
-
-    // largest numerical value
-    //{"MaxNumericalValue", new Integer(100000000)},
-    //These would not be used for EN. Only used for traditional numbering   
-    { "numberGroups", new int[]{ 1 } },
-
-    // simplified chinese 
-    { "zero", new char[]{ 0x96f6 } },
-
-    //These only used for mutiplicative-additive numbering 
-    { "multiplier", new int[]{ 100000000, 10000, 1000, 100, 10 } },
-    { "multiplierChar",
-      new char[]{ 0x5104, 0x842c, 0x4edf, 0x4f70, 0x62fe } },
-    { "digits",
-      new char[]{ 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2,
-                  0x634c, 0x7396 } }, { "tables", new String[]{ "digits" } }
-  };
-}
diff --git a/src/org/apache/xml/utils/synthetic/Class.java b/src/org/apache/xml/utils/synthetic/Class.java
deleted file mode 100644
index b1e681e..0000000
--- a/src/org/apache/xml/utils/synthetic/Class.java
+++ /dev/null
@@ -1,2181 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic;
-
-import org.apache.xml.utils.synthetic.SynthesisException;
-import org.apache.xml.utils.synthetic.reflection.Constructor;
-import org.apache.xml.utils.synthetic.reflection.Method;
-import org.apache.xml.utils.synthetic.reflection.Field;
-
-import java.lang.reflect.Modifier;
-
-/* WORK NEEDED:
-    Factories/Libraries: We currently have forClass and
-    forName(request reified, complain if no real class),
-    and declareClass (request unreified, create unreified
-    if it doesn't exist). What about ther user expectations
-    -- should we have a full matrix, rather than asking
-    users to write wrappers?
-
-    Reflection doesn't tell us about deprecation. If we want
-    that info, MFC advises mousing our way into the bytecodes.
-    (Ugh). Should we at least model that for synthetics?
-*/
-
-/**
- * <meta name="usage" content="internal"/>
- * org.apache.xml.utils.synthetic.Class is a mutable equivalent of java.lang.Class.
- * Instances represent classes and interfaces in a running Java
- * application, or class descriptions under construction. In the
- * former case, org.apache.xml.utils.synthetic.Class operates as a proxy for the
- * "real" java.lang.Class object; in the latter, it consults
- * data structures defined in the org.apache.xml.utils.synthetic.reflection.* package.
- * <p>
- * Unlike java.lang.Class, org.apache.xml.utils.synthetic.Class has a pair of factories
- * (fromName and fromClass). It can also be switched from synthetic
- * to proxy operation after construction, by setting the realClass
- * property; this is intended to allow these definitions to be
- * "compiled in place".
- * <p>
- * For convenient use, org.apache.xml.utils.synthetic.Class implements an extended
- * version of the java.lang.Class API -- but is not a subclass
- * thereof, since java.lang.Class is Final (presumably for
- * security reasons).
- * <p>
- * DEVELOPMENT NOTE: Methods not yet implemented will throw
- * IllegalStateException
- * <p>
- *   I've added code to convert primitive names into their TYPEs,
- *   to accept foo[] as a synonym for [Lfoo, and to generate
- *   the right thing on output (getJava[Short]Name).
- *   Useful extension for code generation from Java-like
- *   source. We may want to factor these and toSource out, making
- *   org.apache.xml.utils.synthetic.Class addess only the JVM level and providing
- *   subclasses or access tools that handle language syntax
- *   (Java source, NetRexx source, etc.)
- *
- * @since  2000/2/10
- */
-public class Class extends Object implements java.io.Serializable
-{
-
-  /** Class descriptions currently existing. */
-  private static java.util.Hashtable global_classtable =
-    new java.util.Hashtable();
-
-  /** fully-qualified path.classname.
-   *  @serial */
-  private java.lang.String name;
-
-  /**
-   * Actual Java class object. When present, all interactions
-   * are redirected to it. Allows our Class to function as a
-   * wrapper for the Java version (in lieu of subclassing or
-   * a shared Interface), and allows "in-place compilation"
-   * to replace a generated description with an
-   * directly runnable class.
-   * @serial
-   */
-  private java.lang.Class realclass = null;
-
-  /** Field modifiers: Java language modifiers for this class 
-   * or interface, encoded in an integer.
-   * @serial
-   */
-  private int modifiers;
-
-  /** Field isInterface: True if the Class object represents
-   *  an interface type.
-   * @serial */
-  private boolean isInterface = false;
-
-  /** Field superclass:  If this object represents the class
-   * Object, this is null. Otherwise, the Class object that 
-   * represents the superclass of that class. In proxy mode this
-   * is determined when needed. In synthesis mode it's explicitly
-   * set by the user, and if null the superclass will be assumed
-   * to be Object.
-   * @serial */
-  private Class superclass = null;
-
-  /** Field declaringclass: If this object represents an inner class,
-   * the Class object that represents the class that declared it.
-   * Otherwise null.
-   * @serial
-   * */
-  private Class declaringclass = null;
-
-  /** Field interfaces: A list of all interfaces implemented by the class 
-   * or interface represented by this object.
-   * @serial
-   *  */
-  private Class[] interfaces = new Class[0];
-
-  /** Field allclasses:  an array containing Class objects representing all 
-   * the public classes and interfaces that are members of the class 
-   * represented by this Class object. 
-   * @serial
-   */
-  private Class[] allclasses = new Class[0];
-
-  /** Field declaredclasses: an array of Class objects reflecting all the 
-   * classes and interfaces declared as members of the class represented 
-   * by this Class object. Excludes inherited classes and interfaces.
-   * @serial
-   */
-  private Class[] declaredclasses = new Class[0];
-
-  /** Field allconstructors: an array containing Constructor objects
-   * reflecting all the constructors of the class represented 
-   * by this Class object. An array of length 0 is returned if the
-   * class has no public constructors. In proxy mode only public
-   * constructors will be displayed; in synthesis mode, all declared
-   * constructors will be displayed.
-   * @serial
-   * */
-  private Constructor[] allconstructors = new Constructor[0];
-
-  /** Field declaredconstructors: an array of Constructor objects 
-   * reflecting all the constructors declared by the class 
-   * represented by this Class object. Includes non-public
-   * constructors, but excludes inherited ones.
-   * @serial
-   *  */
-  private Constructor[] declaredconstructors = new Constructor[0];
-
-  /** Field allmethods.
-   *  @serial          */
-  private Method[] allmethods = new Method[0];
-
-  /** Field declaredmethods.
-   *  @serial          */
-  private Method[] declaredmethods = new Method[0];
-
-  /** Field allfields.
-   *  @serial          */
-  private Field[] allfields = new Field[0];
-
-  /** Field declaredfields.
-   *  @serial          */
-  private Field[] declaredfields = new Field[0];
-
-  /** Field innerclasses.
-   *  @serial          */
-  private Class[] innerclasses = new Class[0];
-
-  /**
-   * Construct a synthetic class as proxy/wrapper for an existing
-   * Java Class. Non-public; most folks should use
-   * .forName and .forClass to request these wrappers, so they
-   * get the shared instances.
-   * <p>
-   * Creation date: (12-25-99 12:16:15 PM)
-   * @param realclass java.lang.Class
-   */
-  Class(java.lang.Class realclass)
-  {
-
-    this(realclass.getName());
-
-    try
-    {
-      setRealClass(realclass);
-    }
-    catch (SynthesisException e)
-    {
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Construct a named-but-empty synthetic Class object.
-   * Non-public; most folks should use
-   * .forName and .forClass to request these wrappers, so they
-   * get the shared instances.
-   * <p>
-   * Creation date: (12-25-99 12:15:23 PM)
-   *
-   * @param fullname full name of the class that is synthetized.
-   */
-  Class(String fullname)
-  {
-
-    this.name = fullname;
-
-    global_classtable.put(fullname, this);
-  }
-
-  /**
-   * Returns the synthetic Class object associated with the "real"
-   * class specified, creating one if it didn't already exist.
-   * <p>
-   * For example, the following code fragment returns
-   * the runtime Class descriptor for the class named
-   * mypackage.MyClass.
-   * <code>
-   * Class t =
-   * Class.forName(java.lang.Class.forName("mypackage.MyClass"))
-   * </code>
-   * <p>
-   * Note that if the user has manually created a org.apache.xml.utils.synthetic.Class
-   * with the same name before this call is issued, that object
-   * will be found instead. See also the declareClass call.
-   * <p>
-   *  We need a better way to declare/define array classes,
-   * given a class object (synthetic or not).
-   *
-   * @param cls the desired Java class.
-   * @return the synthetic Class descriptor for the specified class.
-   */
-  public static Class forClass(java.lang.Class cls)
-  {
-
-    if (cls == null)
-      return null;
-
-    Class ret = (Class) (global_classtable.get(cls.getName()));
-
-    if (null == ret)
-      ret = new Class(cls);
-
-    return ret;
-  }
-
-  /**
-   * Like forName, but if the classname doesn't have a package
-   * prefix we first attempt to look it up as one of our own
-   * inner clases. As with forName, if this can not be resolved
-   * we throw an exception.
-   *
-   * @param classname the full or partial class name.
-   *
-   * @return The Class name that matches the argument.
-   *
-   * @throws ClassNotFoundException
-   */
-  public Class forNameInContext(String classname)
-          throws ClassNotFoundException
-  {
-
-    for (int i = innerclasses.length - 1; i >= 0; --i)
-    {
-      if (classname.equals(innerclasses[i].getShortName()))
-        return innerclasses[i];
-    }
-
-    return forName(classname);
-  }
-
-  /**
-   * Returns the synthetic Class object associated with the class
-   * with the given fully-qualified name. If there isn't one, this
-   * method attempts to locate, load and link the standard java Class.
-   * If it succeeds, it returns a wrapped version of the Class object
-   * representing the class. If it fails, the method throws a
-   * ClassNotFoundException.
-   * <p>
-   * For example, the following code fragment returns
-   * the runtime Class descriptor for the class named
-   * mypackage.MyClass -- either as a synthetic or as
-   * a standard Java class.
-   * <code>
-   * Class t =
-   * Class.forName("mypackage.MyClass")
-   * </code>
-   * <p>
-   *  I've added support for arrays -- assuming any name
-   * that ends with ']' is an array. It probably needs to be
-   * made smarter, possibly via a subclass of org.apache.xml.utils.synthetic.Class.
-   *
-   * @param className the fully qualified name of the desired class.
-   * @return the synthetic Class descriptor for the class with the specified name.
-   * @throws ClassNotFoundException if the class could not be found.
-   */
-  public static Class forName(String className) throws ClassNotFoundException
-  {
-
-    // ***** Experimental support for array syntax expressed
-    // per Java source rather than per JVM type formalism.
-    // Simpleminded, asssumes balanced []'s.
-    if (className.endsWith("]"))
-    {
-      StringBuffer arrayname = new StringBuffer();
-
-      for (int i = className.indexOf('['); i != -1;
-              i = className.indexOf('[', i + 1))
-      {
-        arrayname.append('[');
-      }
-
-      // Convert the classname to array-formalism
-      // Primitives have letters; objects are Lname;
-      // (Don't ask why long is spelled with a J and
-      // object is spelled with an L...)
-      String classname = className.substring(0, className.indexOf('['));
-
-      if ("byte".equals(classname))
-        arrayname.append('B');
-      else if ("char".equals(classname))
-        arrayname.append('C');
-      else if ("double".equals(classname))
-        arrayname.append('D');
-      else if ("float".equals(classname))
-        arrayname.append('F');
-      else if ("int".equals(classname))
-        arrayname.append('I');
-      else if ("long".equals(classname))
-        arrayname.append('J');
-      else if ("short".equals(classname))
-        arrayname.append('S');
-      else if ("boolean".equals(classname))
-        arrayname.append('Z');
-      else
-        arrayname.append('L').append(classname).append(';');
-
-      // Tail-call.
-      return forName(arrayname.toString());
-    }
-
-    Class ret = (Class) (global_classtable.get(className));
-
-    if (null == ret)
-    {
-
-      // ***** Experimental support for Java primitives
-      // Seems to me that mapping them into the "Type" is
-      // probably most useful
-      if ("boolean".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Boolean.TYPE;
-      }
-      else if ("byte".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Byte.TYPE;
-      }
-      else if ("char".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Character.TYPE;
-      }
-      else if ("short".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Short.TYPE;
-      }
-      else if ("int".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Integer.TYPE;
-      }
-      else if ("long".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Long.TYPE;
-      }
-      else if ("float".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Float.TYPE;
-      }
-      else if ("double".equals(className))
-      {
-        ret = new Class(className);
-        ret.realclass = java.lang.Double.TYPE;
-      }
-      else if ("void".equals(className))
-      {
-
-        // ***** Void is an "absence of type". We might want to create
-        // a special object to represent it. This is a placeholder.
-        ret = new Class(className);
-        ret.realclass = java.lang.Class.forName("java.lang.Object");
-      }
-
-      // Other classes are just wrappered. Unknown classes throw a
-      // ClassNotFoundException; the user can switch to declareClass()
-      // if they're sure that an unreified class is OK. 
-      else
-        ret = new Class(java.lang.Class.forName(className));
-    }
-
-    return ret;
-  }
-
-  /**
-   * Start to create a synthetic Class with the given fully-qualified
-   * name.  If a Class by that name already exists, and it is not
-   * reified, it will be returned instead. If a reified Class _does_
-   * exist, we throw a synthesis exception.
-   *
-   * @param className the fully qualified name of the desired class.
-   * @return the synthetic Class descriptor for the class with the specified name.
-   * @throws SynthesisException if the class has been reified.  
-   */
-  public static Class declareClass(String className) throws SynthesisException
-  {
-
-    Class ret = (Class) (global_classtable.get(className));
-
-    if (null == ret)
-      ret = new Class(className);
-
-    if (ret.realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    return ret;
-  }
-
-  /**
-   * Start to create a synthetic Class with the given fully-qualified
-   * name.  If a Class by that name already exists,whether reified or
-   * not, it will be removed from the table and replaced by the new synthesis.
-   *
-   *  NOTE THAT the replacement will not affect classes which
-   * have already refernced the old version. We could change that by
-   * having everyone reference everyone else via an indirection table.
-   *
-   * @param className the fully qualified name of the desired class.
-   * @return the synthetic Class descriptor for the class with the specified name.
-   */
-  public static Class reallyDeclareClass(String className)
-  {
-
-    Class ret = (Class) (global_classtable.get(className));
-
-    if (null != ret)
-      global_classtable.remove(ret);
-
-    ret = new Class(className);
-
-    return ret;
-  }
-
-  /**
-   * Returns an array containing Class objects
-   * representing all the public classes and interfaces
-   * that are members of the class represented by this
-   * Class object. This includes public class and
-   * interface members inherited from superclasses and
-   * public class and interface members declared by the
-   * class. Returns an array of length 0 if the class has
-   * no public member classes or interfaces, or if this
-   * Class object represents a primitive type.
-   * <p>
-   * NOTE: In a significant number of existing Java environments,
-   * this method is not implemented by the official Class object
-   * and always returns an empty array. So if you don't get any
-   * useful information from a proxied java.lang.Class, don't
-   * be surprised. I'm not sure if someone decided it was a
-   * potential security issue, or if Sun was lazy and everyone
-   * else followed suit.
-   * <p>
-   * ALSO NOTE: The above spec, as taken from java.lang.Class,
-   * doesn't provide any good way to distinguish the immediate
-   * superclass from all other superclasses. That makes it only
-   * marginally useful, which is no doubt one of the reasons folks
-   * have declined to implement it.
-   *
-   * @return an array of classes.
-   */
-  public Class[] getClasses()
-  {
-
-    if (realclass != null && allclasses == null)
-    {
-      java.lang.Class[] realDE = realclass.getClasses();
-
-      allclasses = new Class[realDE.length];
-
-      for (int i = 0; i < realDE.length; ++i)
-      {
-        allclasses[i] = forClass(realDE[i]);
-      }
-    }
-
-    return allclasses;
-  }
-
-  /**
-   * Determines the class loader for the class.
-   *
-   * the class loader that created the class or
-   * interface represented by this object, or null
-   * if the org.apache.xml.utils.synthetic.Class was not created by a class loader.
-   */
-  public ClassLoader getClassLoader()
-  {
-    return (realclass == null) ? null : realclass.getClassLoader();
-  }
-
-  /**
-   * If this class represents an array type, returns the
-   * Class object representing the component type of
-   * the array; otherwise returns null.
-   * <p>
-   * NOTE: Since org.apache.xml.utils.synthetic.Class doesn't yet attempt to model array
-   * types, this will currently return false unless we are
-   * proxying such a type.
-   *
-   * @return the Class object representing the component type of
-   * the array, otherwise returns null.
-   */
-  public Class getComponentType()
-  {
-    return realclass == null ? null : new Class(realclass.getComponentType());
-  }
-
-  /**
-   * Returns a Constructor object that reflects the
-   * specified public constructor of the class
-   * represented by this Class object. The
-   * parameterTypes parameter is an array of Class
-   * objects that identify the constructor's formal
-   * parameter types, in declared order.
-   * <p>
-   * The constructor to reflect is located by searching
-   * all the constructors of the class represented by this
-   * Class object for a public constructor with the
-   * exactly the same formal parameter types.
-   *
-   *
-   * @param parameterTypes array of Class
-   * objects that identify the constructor's formal
-   * parameter types, in declared order.
-   *
-   * @return a Constructor object that reflects the
-   * specified public constructor of the class
-   * represented by this Class object.
-   * 
-   * @throws NoSuchMethodException
-   * if a matching method is not found.
-   * @throws SecurityException
-   * if access to the information is denied.
-   * @throws SynthesisException
-   */
-  public Constructor getConstructor(Class parameterTypes[])
-          throws NoSuchMethodException, SecurityException, SynthesisException
-  {
-
-    if (realclass == null)
-      throw new SynthesisException(SynthesisException.UNREIFIED);
-
-    java.lang.Class[] real = new java.lang.Class[parameterTypes.length];
-
-    for (int i = 0; i < parameterTypes.length; ++i)
-    {
-      if ((real[i] = parameterTypes[i].getRealClass()) == null)
-        throw new SynthesisException(SynthesisException.UNREIFIED);
-    }
-
-    return new Constructor(realclass.getConstructor(real), this);
-  }
-
-  /**
-   * Returns an array containing Constructor objects
-   * reflecting all the public constructors of the class
-   * represented by this Class object. An array of length
-   * 0 is returned if the class has no public
-   * constructors.
-   *
-   *
-   * @return an array containing Constructor objects
-   * reflecting all the public constructors of the class
-   * represented by this Class object.
-   * 
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Constructor[] getConstructors() throws SecurityException
-  {
-
-    if (realclass != null && allconstructors == null)
-    {
-      java.lang.reflect.Constructor[] realDC = realclass.getConstructors();
-
-      allconstructors = new Constructor[realDC.length];
-
-      for (int i = 0; i < realDC.length; ++i)
-      {
-        allconstructors[i] = new Constructor(realDC[i], this);
-      }
-    }
-
-    return allconstructors;
-  }
-
-  /**
-   * This method is not implemented in VAJAVA 3.0
-   * <p>
-   * Returns an array of Class objects reflecting all the
-   * classes and interfaces declared as members of the
-   * class represented by this Class object. This
-   * includes public, protected, default (package)
-   * access, and private classes and interfaces declared
-   * by the class, but excludes inherited classes and
-   * interfaces. Returns an array of length 0 if the class
-   * declares no classes or interfaces as members, or if
-   * this Class object represents a primitive type.
-   *
-   *
-   * @return an array of Class objects reflecting all the
-   * classes and interfaces declared as members of the
-   * class represented by this Class object.
-   * 
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Class[] getDeclaredClasses() throws SecurityException
-  {
-
-    // ***** This should really be a single class plus declared interfaces.
-    if (realclass != null && declaredclasses == null)
-    {
-      java.lang.Class[] realDE = realclass.getDeclaredClasses();
-
-      declaredclasses = new Class[realDE.length];
-
-      for (int i = 0; i < realDE.length; ++i)
-      {
-        declaredclasses[i] = forClass(realDE[i]);
-
-        if (!realDE[i].isInterface())
-          superclass = declaredclasses[i];
-      }
-    }
-
-    return declaredclasses;
-  }
-
-  /**
-   * Adds an "extends" description for the class or
-   * interface represented by this Class object
-   *
-   * @param newclass The class that this class extends.
-   * @throws SynthesisException
-   * if the class has been reified.
-   */
-  public void addExtends(Class newclass) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    Class[] scratch = new Class[declaredclasses.length + 1];
-
-    System.arraycopy(declaredclasses, 0, scratch, 0, declaredclasses.length);
-
-    scratch[declaredclasses.length] = newclass;
-    declaredclasses = scratch;
-  }
-
-  /**
-   * Returns a Constructor object that reflects the
-   * specified declared constructor of the class or
-   * interface represented by this Class object. The
-   * parameterTypes parameter is an array of Class
-   * objects that identify the constructor's formal
-   * parameter types, in declared order.
-   *
-   *
-   * @param parameterTypes array of Class
-   * objects that identify the constructor's formal
-   * parameter types, in declared order.
-   *
-   * @return a Constructor object that reflects the
-   * specified declared constructor of the class or
-   * interface represented by this Class object.
-   * 
-   * @throws NoSuchMethodException
-   * if a matching method is not found.
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Constructor getDeclaredConstructor(Class parameterTypes[])
-          throws NoSuchMethodException, SecurityException
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Adds a Constructor description for  the class or
-   * interface represented by this Class object
-   *
-   * @return The constructor object.
-   * 
-   * @throws SynthesisException
-   * if the class has been reified.
-   */
-  public Constructor declareConstructor() throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    Constructor newctor = new Constructor(this);
-    Constructor[] scratch = new Constructor[declaredconstructors.length + 1];
-
-    System.arraycopy(declaredconstructors, 0, scratch, 0,
-                     declaredconstructors.length);
-
-    scratch[declaredconstructors.length] = newctor;
-    declaredconstructors = scratch;
-    scratch = new Constructor[allconstructors.length + 1];
-
-    System.arraycopy(allconstructors, 0, scratch, 0, allconstructors.length);
-
-    scratch[allconstructors.length] = newctor;
-    allconstructors = scratch;
-
-    return newctor;
-  }
-
-  /**
-   * State that this class implements a specified interface.
-   * This does not yet update allMethods or otherwise
-   * attempt to inherit data.
-   *
-   * @param newifce org.apache.xml.utils.synthetic.Class representing the interface we want to add.
-   *
-   * @return The new interface class.
-   * 
-   * @throws org.apache.xml.utils.synthetic.SynthesisException if the Class isn't an interface
-   */
-  public Class declareInterface(Class newifce) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    if (!newifce.isInterface())
-      throw new SynthesisException(SynthesisException.SYNTAX,
-                                   newifce.getName() + " isn't an interface");
-
-    Class[] scratch = new Class[interfaces.length + 1];
-
-    System.arraycopy(interfaces, 0, scratch, 0, interfaces.length);
-
-    scratch[interfaces.length] = newifce;
-    interfaces = scratch;
-    scratch = new Class[allclasses.length + 1];
-
-    System.arraycopy(allclasses, 0, scratch, 0, allclasses.length);
-
-    scratch[allclasses.length] = newifce;
-    allclasses = scratch;
-
-    return newifce;
-  }
-
-  /**
-   * Returns an array of Constructor objects reflecting
-   * all the constructors declared by the class
-   * represented by this Class object. These are public,
-   * protected, default (package) access, and private
-   * constructors. Returns an array of length 0 if this
-   * Class object represents an interface or a primitive
-   * type.
-   * <p>
-   * See The Java Language Specification, section 8.2.
-   *
-   *
-   * @return an array of Constructor objects reflecting
-   * all the constructors declared by the class
-   * represented by this Class object.
-   * 
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Constructor[] getDeclaredConstructors() throws SecurityException
-  {
-
-    if (realclass != null && declaredconstructors == null)
-    {
-      java.lang.reflect.Constructor[] realDC =
-        realclass.getDeclaredConstructors();
-
-      declaredconstructors = new Constructor[realDC.length];
-
-      for (int i = 0; i < realDC.length; ++i)
-      {
-        declaredconstructors[i] = new Constructor(realDC[i], this);
-      }
-    }
-
-    return declaredconstructors;
-  }
-
-  /**
-   * Returns a Field object that reflects the specified
-   * declared field of the class or interface represented
-   * by this Class object. The name parameter is a
-   * String that specifies the simple name of the desired
-   * field.
-   *
-   *
-   * @param name String that specifies the simple name of the desired
-   * field.
-   *
-   * @return a Field object that reflects the specified
-   * declared field of the class or interface represented
-   * by this Class object.
-   * 
-   * @throws NoSuchFieldException
-   * if a field with the specified name is not found.
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Field getDeclaredField(String name)
-          throws NoSuchFieldException, SecurityException
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Adds a Field description for  the class or
-   * interface represented by this Class object
-   *
-   *
-   * @param name The name of the field.
-   *
-   * @return The field description.
-   * 
-   * @throws SynthesisException
-   * if the class has been reified.
-   */
-  public Field declareField(String name) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    Field newfield = new Field(name, this);
-    Field[] scratch = new Field[declaredfields.length + 1];
-
-    System.arraycopy(declaredfields, 0, scratch, 0, declaredfields.length);
-
-    scratch[declaredfields.length] = newfield;
-    declaredfields = scratch;
-    scratch = new Field[allfields.length + 1];
-
-    System.arraycopy(allfields, 0, scratch, 0, allfields.length);
-
-    scratch[allfields.length] = newfield;
-    allfields = scratch;
-
-    return newfield;
-  }
-
-  /**
-   * Returns an array of Field objects reflecting all the
-   * fields declared by the class or interface represented
-   * by this Class object. This includes public,
-   * protected, default (package) access, and private
-   * fields, but excludes inherited fields. Returns an
-   * array of length 0 if the class or interface declares
-   * no fields, or if this Class object represents a
-   * primitive type. See The Java Language
-   * Specification, sections 8.2 and 8.3.
-   *
-   *
-   * @return array of Field objects reflecting all the
-   * fields declared by the class or interface represented
-   * by this Class object.
-   * 
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Field[] getDeclaredFields() throws SecurityException
-  {
-
-    if (realclass != null && declaredfields == null)
-    {
-      java.lang.reflect.Field[] realDF = realclass.getDeclaredFields();
-
-      declaredfields = new Field[realDF.length];
-
-      for (int i = 0; i < realDF.length; ++i)
-      {
-        declaredfields[i] = new Field(realDF[i], this);
-      }
-    }
-
-    return declaredfields;
-  }
-
-  /**
-   * Returns a Method object that reflects the specified
-   * declared method of the class or interface
-   * represented by this Class object. The name
-   * parameter is a String that specifies the simple
-   * name of the desired method, and the
-   * parameterTypes parameter is an array of Class
-   * objects that identify the method's formal parameter
-   * types, in declared order.
-   *
-   *
-   * @param name String that specifies the simple
-   * name of the desired method.
-   * 
-   * @param parameterTypes array of Class
-   * objects that identify the method's formal parameter
-   * types, in declared order.
-   *
-   * @return Method object that reflects the specified
-   * declared method of the class or interface
-   * represented by this Class object.
-   * 
-   * @throws NoSuchMethodException
-   * if a matching method is not found.
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Method getDeclaredMethod(String name, Class parameterTypes[])
-          throws NoSuchMethodException, SecurityException
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Adds a Method description for  the class or
-   * interface represented by this Class object
-   *
-   *
-   * @param name Name of method.
-   *
-   * @return The method object.
-   * 
-   * @throws SynthesisException
-   * if the class has been reified.
-   */
-  public Method declareMethod(String name) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    Method newMethod = new Method(name, this);
-    Method[] scratch = new Method[declaredmethods.length + 1];
-
-    System.arraycopy(declaredmethods, 0, scratch, 0, declaredmethods.length);
-
-    scratch[declaredmethods.length] = newMethod;
-    declaredmethods = scratch;
-    scratch = new Method[allmethods.length + 1];
-
-    System.arraycopy(allmethods, 0, scratch, 0, allmethods.length);
-
-    scratch[allmethods.length] = newMethod;
-    allmethods = scratch;
-
-    return newMethod;
-  }
-
-  /**
-   * Returns an array of Method objects reflecting all
-   * the methods declared by the class or interface
-   * represented by this Class object. This includes
-   * public, protected, default (package) access, and
-   * private methods, but excludes inherited methods.
-   * Returns an array of length 0 if the class or interface
-   * declares no methods, or if this Class object
-   * represents a primitive type.
-   * <p>
-   * See The Java Language Specification, section 8.2.
-   *
-   * @return array of Method objects reflecting all
-   * the methods declared by the class or interface
-   * represented by this Class object.
-   * 
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Method[] getDeclaredMethods() throws SecurityException
-  {
-
-    if (realclass != null && declaredmethods == null)
-    {
-      java.lang.reflect.Method[] realDM = realclass.getDeclaredMethods();
-
-      declaredmethods = new Method[realDM.length];
-
-      for (int i = 0; i < realDM.length; ++i)
-      {
-        declaredmethods[i] = new Method(realDM[i], this);
-      }
-    }
-
-    return declaredmethods;
-  }
-
-  /**
-   * This method is not implemented in VAJava 3.0
-   * <p>
-   * If the class or interface represented by this Class
-   * object is a member of another class, returns the
-   * Class object representing the class of which it is a
-   * member (its declaring class). Returns null if this
-   * class or interface is not a member of any other
-   * class.
-   *
-   */
-  public Class getDeclaringClass()
-  {
-
-    if (realclass != null && declaringclass == null)
-    {
-      java.lang.Class dc = realclass.getDeclaringClass();
-
-      if (dc == null)
-        declaringclass = null;
-      else
-        declaringclass = forClass(dc);
-    }
-
-    return declaringclass;
-  }
-
-  /**
-   * Declare that this class is an inner class of another.
-   *
-   * @param newclass
-   *
-   * @throws SynthesisException
-   */
-  private void addInnerClass(Class newclass) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    if (newclass.getDeclaringClass() != this)
-      throw new SynthesisException(SynthesisException.WRONG_OWNER);
-
-    Class[] scratch = new Class[innerclasses.length + 1];
-
-    System.arraycopy(innerclasses, 0, scratch, 0, innerclasses.length);
-
-    scratch[innerclasses.length] = newclass;
-    innerclasses = scratch;
-  }
-
-  /**
-   * Declare a class contained within this class. This doesn't
-   * address anonymous classes (those go inside method bodies
-   * and similar code), just local classes.
-   * <p>
-   * ***** This requires lookup methods that operate in the
-   * context of a specific class, and per-class registries!
-   *
-   * @param className Local name of inner class to create. This should _not_ be a
-   * qualified name, unlike the normal forName() call. Its
-   * hierarchy is established by the class within which it is
-   * created.
-   * @return org.apache.xml.utils.synthetic.Class object for the contained class.
-   * @throws org.apache.xml.utils.synthetic.SynthesisException if class could not be created.
-   * @since 2/2000
-   *
-   * @throws SynthesisException
-   */
-  public Class declareInnerClass(String className) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    String relativeName = getName() + "$" + className;
-    Class newclass = (Class) (global_classtable.get(relativeName));
-
-    if (newclass != null)
-      throw new SynthesisException(SynthesisException.SYNTAX,
-                                   "Inner class " + name + " already exists");
-
-    newclass = new Class(className);
-    newclass.declaringclass = this;
-
-    Class[] scratch = new Class[innerclasses.length + 1];
-
-    System.arraycopy(innerclasses, 0, scratch, 0, innerclasses.length);
-
-    scratch[innerclasses.length] = newclass;
-    innerclasses = scratch;
-
-    return newclass;
-  }
-
-  /**
-   * Fetch a list of classes contained within this class.
-   * This doesn't address anonymous classes (those go
-   * inside method bodies and similar code), just local classes.
-   *
-   * @return org.apache.xml.utils.synthetic.Class[] object for the contained classes.
-   * This may be empty if none such exist, or if the class is
-   * reified (since reflection doesn't report this information).
-   * @since 3/2000
-   */
-  public Class[] getInnerClasses()
-  {
-    return innerclasses;
-  }
-
-  /**
-   * Returns a Field object that reflects the specified
-   * public member field of the class or interface
-   * represented by this Class object. The name
-   * parameter is a String specifying the simple name of
-   * the desired field.
-   * <p>
-   * The field to be reflected is located by searching all
-   * the member fields of the class or interface
-   * represented by this Class object for a public field
-   * with the specified name.
-   * <p>
-   * See The Java Language Specification, sections 8.2
-   * and 8.3.
-   *
-   *
-   * @param name
-   *
-   * @throws NoSuchFieldException
-   * if a field with the specified name is not
-   * found.
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Field getField(String name)
-          throws NoSuchFieldException, SecurityException
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Returns an array containing Field objects
-   * reflecting all the accessible public fields of the
-   * class or interface represented by this Class object.
-   * Returns an array of length 0 if the class or interface
-   * has no accessible public fields, or if it represents
-   * an array type or a primitive type.
-   * <p>
-   * Specifically, if this Class object represents a class,
-   * returns the public fields of this class and of all its
-   * superclasses. If this Class object represents an
-   * interface, returns the fields of this interface and of
-   * all its superinterfaces. If this Class object
-   * represents an array type or a primitive type, returns
-   * an array of length 0.
-   * <p>
-   * The implicit length field for array types is not
-   * reflected by this method. User code should use the
-   * methods of class Array to manipulate arrays.
-   * <p>
-   * See The Java Language Specification, sections 8.2
-   * and 8.3.
-   *
-   *
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Field[] getFields() throws SecurityException
-  {
-
-    if (realclass != null && allfields == null)
-    {
-      java.lang.reflect.Field[] realDF = realclass.getFields();
-
-      allfields = new Field[realDF.length];
-
-      for (int i = 0; i < realDF.length; ++i)
-      {
-        allfields[i] = new Field(realDF[i], this);
-      }
-    }
-
-    return allfields;
-  }
-
-  /**
-   * Determines the interfaces implemented by the
-   * class or interface represented by this object.
-   * <p>
-   * If this object represents a class, the return value is
-   * an array containing objects representing all
-   * interfaces implemented by the class. The order of
-   * the interface objects in the array corresponds to the
-   * order of the interface names in the implements
-   * clause of the declaration of the class represented by
-   * this object.
-   * <p>
-   * If this object represents an interface, the array
-   * contains objects representing all interfaces
-   * extended by the interface. The order of the
-   * interface objects in the array corresponds to the
-   * order of the interface names in the extends clause
-   * of the declaration of the interface represented by
-   * this object.
-   * <p>
-   * If the class or interface implements no interfaces,
-   * the method returns an array of length 0.
-   *
-   * an array of interfaces implemented by this
-   * class.
-   */
-  public Class[] getInterfaces()
-  {
-
-    if (realclass != null && interfaces == null)
-    {
-      java.lang.Class[] realI = realclass.getInterfaces();
-
-      interfaces = new Class[realI.length];
-
-      for (int i = 0; i < realI.length; ++i)
-      {
-        interfaces[i] = forClass(realI[i]);
-      }
-    }
-
-    return interfaces;
-  }
-
-  /**
-   * Adds an "implements" description for the class or
-   * interface represented by this Class object
-   *
-   *
-   * @param newclass
-   * @throws SynthesisException
-   * if the class has been reified.
-   */
-  public void addImplements(Class newclass) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    Class[] scratch = new Class[interfaces.length + 1];
-
-    System.arraycopy(interfaces, 0, scratch, 0, interfaces.length);
-
-    scratch[interfaces.length] = newclass;
-    interfaces = scratch;
-  }
-
-  /**
-   * Returns a Method object that reflects the specified
-   * public member method of the class or interface
-   * represented by this Class object. The name
-   * parameter is a String specifying the simple name
-   * the desired method, and the parameterTypes
-   * parameter is an array of Class objects that identify
-   * the method's formal parameter types, in declared
-   * order.
-   * <p>
-   * The method to reflect is located by searching all
-   * the member methods of the class or interface
-   * represented by this Class object for a public
-   * method with the specified name and exactly the
-   * same formal parameter types.
-   * <p>
-   * See The Java Language Specification, sections 8.2
-   * and 8.4.
-   *
-   *
-   * @param name
-   * @param parameterTypes
-   *
-   * @throws NoSuchMethodException
-   * if a matching method is not found.
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Method getMethod(String name, Class parameterTypes[])
-          throws NoSuchMethodException, SecurityException
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Returns an array containing Method objects
-   * reflecting all the public member methods of the
-   * class or interface represented by this Class object,
-   * including those declared by the class or interface
-   * and and those inherited from superclasses and
-   * superinterfaces. Returns an array of length 0 if the
-   * class or interface has no public member methods.
-   * <p>
-   * See The Java Language Specification, sections 8.2
-   * and 8.4.
-   *
-   *
-   * @throws SecurityException
-   * if access to the information is denied.
-   */
-  public Method[] getMethods() throws SecurityException
-  {
-
-    if (realclass != null && allmethods == null)
-    {
-      java.lang.reflect.Method[] realDM = realclass.getMethods();
-
-      allmethods = new Method[realDM.length];
-
-      for (int i = 0; i < realDM.length; ++i)
-      {
-        allmethods[i] = new Method(realDM[i], this);
-      }
-    }
-
-    return allmethods;
-  }
-
-  /**
-   * Returns the Java language modifiers for this class
-   * or interface, encoded in an integer. The modifiers
-   * consist of the Java Virtual Machine's constants for
-   * public, protected, private, final, and interface; they
-   * should be decoded using the methods of class
-   * Modifier.
-   *
-   * The modifier encodings are defined in The Java
-   * Virtual Machine Specification, table 4.1.
-   *
-   * See Also:
-   * java.lang.reflect.Modifier
-   *
-   */
-  public int getModifiers()
-  {
-    return modifiers;
-  }
-
-  /**
-   *   Set the Java language modifiers for this class
-   *   or interface, encoded in an integer. The modifiers
-   *   consist of the Java Virtual Machine's constants for
-   *   public, protected, private, final, and interface; they
-   *   should be decoded using the methods of class
-   *   Modifier.
-   *
-   *   The modifier encodings are defined in The Java
-   *   Virtual Machine Specification, table 4.1.
-   *
-   *   See Also:
-   *   java.lang.reflect.Modifier
-   *
-   * @param modifiers
-   *
-   * @throws SynthesisException
-   */
-  public void setModifiers(int modifiers) throws SynthesisException
-  {
-
-    if (this.realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.modifiers = modifiers;
-  }
-
-  /**
-   * Retrieve the fully-qualified classname. If it's an array,
-   * it will be returned in JVM syntax, not Java syntax.
-   *
-   * @return java.lang.String
-   * @since 12/95
-   */
-  public java.lang.String getName()
-  {
-    return name;
-  }
-
-  /**
-   * Like getName, but back-convert array notation escapes.
-   * ***** DOESN'T YET HANDLE ARRAYS OF PRIMITIVES!
-   *
-   * @return java.lang.String
-   * @since 3/2000
-   */
-  public java.lang.String getJavaName()
-  {
-
-    if (name.charAt(0) != '[')
-      return name;
-
-    // Object array syntax is [Ltypename; 
-    // add another [ for each level of array
-    int count = name.lastIndexOf('[');
-    StringBuffer jname = new StringBuffer(name.substring(count + 2));
-
-    // Trim the trailing ';'
-    jname.setLength(jname.length() - 1);
-
-    while (count-- >= 0)
-    {
-      jname.append("[]");
-    }
-
-    return jname.toString();
-  }
-
-  /**
-   * Extract just the local name of this class, minus the package
-   * prefix.
-   *
-   * ***** I don't think this handles array types properly yet.
-   *
-   * @return java.lang.String
-   * @since 12/99
-   */
-  public java.lang.String getShortName()
-  {
-
-    int start = name.lastIndexOf(".");
-
-    if (start != 0 || name.charAt(0) == '.')
-      ++start;
-
-    if (declaringclass != null)
-    {
-      int d = name.lastIndexOf('$', start);
-
-      if (d != 0)
-        start = d + 1;
-    }
-
-    return name.substring(start);
-  }
-
-  /**
-   * Like getShortName, but back-convert array notation escapes.
-   * ***** DOESN'T YET HANDLE ARRAYS OF PRIMITIVES!
-   *
-   * @return java.lang.String
-   * @since 3/2000
-   */
-  public java.lang.String getJavaShortName()
-  {
-
-    String shortname = getShortName();
-
-    if (shortname.charAt(0) != '[')
-      return shortname;
-
-    // Object array syntax is [Ltypename; 
-    // add another [ for each level of array
-    int count = shortname.lastIndexOf('[');
-    StringBuffer jname = new StringBuffer(shortname.substring(count + 2));
-
-    // Trim the trailing ';'
-    jname.setLength(jname.length() - 1);
-
-    while (count-- >= 0)
-    {
-      jname.append("[]");
-    }
-
-    return jname.toString();
-  }
-
-  /**
-   * Extract the package name for this class.
-   * ***** I don't think this handles array classes properly yet.
-   *
-   * @return java.lang.String
-   * @since 12/95
-   */
-  public java.lang.String getPackageName()
-  {
-
-    int start = name.lastIndexOf(".");
-
-    return name.substring(0, start);
-  }
-
-  /**
-   * If this synthetic class is a wrapper for a "real"
-   * java.lang.Class -- either because it was instantiated as such
-   * or because it has been compiled -- this method will return
-   * that class. Otherwise it returns null.
-   * Creation date: (12-25-99 12:26:01 PM)
-   * @return org.apache.xml.utils.synthetic.Class
-   */
-  public java.lang.Class getRealClass()
-  {
-    return realclass;
-  }
-
-  /**
-   * This call is intended to allow an existing org.apache.xml.utils.synthetic.Class
-   * to be switched from purely descriptive mode to proxy mode
-   * ("reified").
-   * The primary intent is to allow a org.apache.xml.utils.synthetic.Class to be
-   * "compiled in place"
-   * <p>
-   * This should have the side-effect of limiting further mutation
-   * of the org.apache.xml.utils.synthetic.Class to things which can not be obtained
-   * from the real Class object, to avoid "lying" to the user
-   * <p>
-   * NOTE: Not all information defined by the Java libraries is
-   * in fact available in all Java environments. We assume the
-   * calls will work; if they return null or empty lists, there's
-   * nothing we can do about it. Note that this may mean that a
-   * reified class tells us less about itself than the
-   * synthetic description used to generate it.
-   * <p>
-   * Creation date: (12-25-99 12:26:01 PM)
-   * @param java.lang.class realclass nonsynthetic Class object to proxy
-   *
-   * @param realclass
-   *
-   * @throws SynthesisException
-   */
-  public void setRealClass(java.lang.Class realclass)
-          throws SynthesisException
-  {
-
-    if (this.realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.realclass = realclass;
-    this.modifiers = realclass.getModifiers();
-    this.isInterface = realclass.isInterface();
-
-    // DEFERRED -- set them null now, reconstruct when requested
-    this.declaringclass = null;
-    this.interfaces = null;
-    this.declaredconstructors = null;
-    this.allconstructors = null;
-    this.declaredmethods = null;
-    this.allmethods = null;
-    this.declaredfields = null;
-    this.allfields = null;
-    this.declaredclasses = null;
-    this.allclasses = null;
-    this.superclass = null;
-  }
-
-  /**
-   * Set the superclass for this synthetic class.
-   * Object is equivalent to Null.
-   * Creation date: (12-25-99 12:26:01 PM)
-   *
-   * @param superclass
-   * @return org.apache.xml.utils.synthetic.Class
-   *
-   * @throws SynthesisException
-   */
-  public void setSuperClass(Class superclass) throws SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.superclass = superclass;
-  }
-
-  /**
-   * Set the superclass for this synthetic class.
-   * Creation date: (12-25-99 12:26:01 PM)
-   *
-   * @param superclass
-   * @return org.apache.xml.utils.synthetic.Class
-   *
-   * @throws ClassNotFoundException
-   * @throws SynthesisException
-   */
-  public void setSuperClass(java.lang.Class superclass)
-          throws ClassNotFoundException, SynthesisException
-  {
-
-    if (realclass != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.superclass = Class.forClass(superclass);
-  }
-
-  /**
-   * Finds a resource with the specified name. The
-   * rules for searching for resources associated with a
-   * given class are implemented by the class loader of
-   * the class.
-   * <p>
-   * The Class methods delegate to ClassLoader
-   * methods, after applying a naming convention: if
-   * the resource name starts with "/", it is used as is.
-   * Otherwise, the name of the package is prepended,
-   * after converting "." to "/".
-   *
-   * @param
-   * name - the string representing the resource to
-   * be found.
-   * the URL object having the specified name, or
-   * null if no resource with the specified name
-   * is found.
-   */
-  public java.net.URL getResource(String name)
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Finds a resource with a given name. Will return
-   * null if no resource with this name is found. The
-   * rules for searching a resources associated with a
-   * given class are implemented by the ClassLoader of
-   * the class.
-   * <p>
-   * The Class methods delegate to ClassLoader
-   * methods, after applying a naming convention: if
-   * the resource name starts with "/", it is used as is.
-   * Otherwise, the name of the package is prepended,
-   * after converting "." to "/".
-   *
-   * @param
-   * name - the string representing the resource to
-   * be found
-   * the InputStream object having the
-   * specified name, or null if no resource with
-   * the specified name is found.
-   */
-  public java.io.InputStream getResourceAsStream(String name)
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the signers of this class.
-   *
-   */
-  public Object[] getSigners()
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * If this object represents any class other than the
-   * class Object, then the object that represents the
-   * superclass of that class is returned.
-   * <p>
-   * If this object is the one that represents the class
-   * Object or this object represents an interface, null is
-   * returned.
-   *
-   * the superclass of the class represented by this
-   * object.
-   */
-  public Class getSuperclass()
-  {
-
-    if (realclass != null && superclass == null)
-    {
-      superclass = forClass(realclass.getSuperclass());
-
-      // getDeclaredClasses(); // Sets superclass as a side-effect
-    }
-
-    if (superclass == null)
-      superclass = forClass(Object.class);
-
-    return superclass;
-  }
-
-  /**
-   * If this Class object represents an array type, returns
-   * true, otherwise returns false.
-   *
-   */
-  public boolean isArray()
-  {
-    return realclass != null && realclass.isArray();
-  }
-
-  /**
-   * Determines if the class or interface represented by
-   * this Class object is either the same as, or is a
-   * superclass or superinterface of, the class or
-   * interface represented by the specified Class
-   * parameter. It returns true if so, false otherwise. If
-   * this Class object represents a primitive type,
-   * returns true if the specified Class parameter is
-   * exactly this Class object, false otherwise.
-   * <p>
-   * Specifically, this method tests whether the type
-   * represented by the specified Class parameter can
-   * be converted to the type represented by this Class
-   * object via an identity conversion or via a widening
-   * reference conversion. See The Java Language
-   * Specification, sections 5.1.1 and 5.1.4 , for details.
-   *
-   *
-   * @param cls
-   *
-   * @throws NullPointerException if the specified Class parameter is null.
-   */
-  public boolean isAssignableFrom(Class cls)
-  {
-
-    if (realclass != null && cls.realclass != null)
-      return realclass.isAssignableFrom(cls.realclass);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Determines if the class or interface represented by
-   * this Class object is either the same as, or is a
-   * superclass or superinterface of, the class or
-   * interface represented by the specified Class
-   * parameter. It returns true if so, false otherwise. If
-   * this Class object represents a primitive type,
-   * returns true if the specified Class parameter is
-   * exactly this Class object, false otherwise.
-   * <p>
-   * Specifically, this method tests whether the type
-   * represented by the specified Class parameter can
-   * be converted to the type represented by this Class
-   * object via an identity conversion or via a widening
-   * reference conversion. See The Java Language
-   * Specification, sections 5.1.1 and 5.1.4 , for details.
-   *
-   *
-   * @param cls
-   *
-   * @throws NullPointerException if the specified Class parameter is null.
-   */
-  public boolean isAssignableFrom(java.lang.Class cls)
-  {
-
-    if (realclass != null)
-      return realclass.isAssignableFrom((java.lang.Class) cls);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * This method is the dynamic equivalent of the Java
-   * language instanceof operator. The method
-   * returns true if the specified Object argument is
-   * non-null and can be cast to the reference type
-   * represented by this Class object without raising a
-   * ClassCastException. It returns false otherwise.
-   * <p>
-   * Specifically, if this Class object represents a
-   * declared class, returns true if the specified Object
-   * argument is an instance of the represented class (or
-   * of any of its subclasses); false otherwise. If this
-   * Class object represents an array class, returns true
-   * if the specified Object argument can be converted
-   * to an object of the array type by an identity
-   * conversion or by a widening reference conversion;
-   * false otherwise. If this Class object represents an
-   * interface, returns true if the class or any superclass
-   * of the specified Object argument implements this
-   * interface; false otherwise. If this Class object
-   * represents a primitive type, returns false.
-   *
-   * @param obj The object to check
-   *
-   */
-  public boolean isInstance(Object obj)
-  {
-
-    if (realclass != null)
-      return realclass.isInstance(obj);
-
-    // Scan inheritances? (reliable).
-    // Check name? (not reliable).
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Determines if the specified Class object represents
-   * an interface type.
-   *
-   * true if this object represents an interface;
-   * false otherwise.
-   */
-  public boolean isInterface()
-  {
-    return (realclass != null) ? realclass.isInterface() : isInterface;
-  }
-
-  /**
-   * Assert that the specified Class object represents
-   * an interface type. Can't be changed after real class loaded.
-   *
-   * @param
-   * true if this object represents an interface;
-   * false otherwise.
-   *
-   * @param isInterface
-   *
-   * @throws SynthesisException
-   */
-  public void isInterface(boolean isInterface) throws SynthesisException
-  {
-
-    if (realclass == null)
-      this.isInterface = isInterface;
-    else if (realclass.isInterface() != isInterface)
-      throw new SynthesisException(SynthesisException.REIFIED);
-  }
-
-  /**
-   * Determines if the specified Class object represents
-   * a primitive Java type.
-   * <p>
-   * There are nine predefined Class objects to
-   * represent the eight primitive Java types and void.
-   * These are created by the Java Virtual Machine, and
-   * have the same names as the primitive types that
-   * they represent, namely boolean, byte, char, short,
-   * int, long, float, and double, and void.
-   * <p>
-   * These objects may only be accessed via the
-   * following public static final variables, and are the
-   * only Class objects for which this method returns
-   * true.
-   *
-   */
-  public boolean isPrimitive()
-  {
-    return realclass != null && realclass.isPrimitive();
-  }
-
-  /**
-   * Creates a new instance of a class.
-   *
-   * a newly allocated instance of the class
-   * represented by this object. This is done
-   * exactly as if by a new expression with an
-   * empty argument list.
-   * @throws IllegalAccessException
-   * if the class or initializer is not accessible.
-   * @throws InstantiationException
-   * if an application tries to instantiate an
-   * abstract class or an interface, or if the
-   * instantiation fails for some other reason.
-   */
-  public Object newInstance()
-          throws InstantiationException, IllegalAccessException
-  {
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Converts the object to a string. The string
-   * representation is the string "class" or
-   * "interface" followed by a space and then the
-   * fully qualified name of the class. If this Class
-   * object represents a primitive type, returns the
-   * name of the primitive type.
-   * <p>
-   *  Should this say "synthetic" as well as "class" or
-   * "interface"? Or should that be gated on whether we're proxy
-   * to a realclass?
-   *
-   * @return a string representation of this class object.
-   */
-  public String toString()
-  {
-
-    if (realclass != null)
-      return realclass.toString();
-    else if (isInterface())
-      return "interface " + name;
-    else
-      return "class " + name;
-  }
-
-  /**
-   * Convenience for writing to, eg, System.out 
-   *
-   * @param out
-   * @param depth
-   */
-  public void toSource(java.io.OutputStream out, int depth)
-  {
-
-    java.io.PrintWriter writer = new java.io.PrintWriter(out);
-
-    toSource(writer, depth);
-  }
-
-  /**
-   * Converts the object to a Java code stream. The string
-   * representation is as full a Java definition of the class
-   * as we are able to achieve. If this Class
-   * object represents a primitive type, returns the
-   * name of the primitive type.
-   *
-   * @param out
-   * @param depth
-   */
-  public void toSource(java.io.PrintWriter out, int depth)
-  {
-
-    String tab = tabset(depth);
-
-    if (realclass != null)
-      out.println(
-        tab
-        + "/** Code back-generated from a \"real\" Class; accuracy limited by reflection APIs. */");
-    else
-      out.println(
-        tab
-        + "/** Code generated via org.apache.xml.utils.synthetic.Class */");
-
-    /* Package should not be printed for inner classes */
-    if (getDeclaringClass() == null)
-      out.println(tab + "package " + getPackageName() + ";");
-
-    out.print(tab + Modifier.toString(getModifiers()));
-
-    if (isInterface())
-      out.print(" interface ");
-    else
-      out.print(" class ");
-
-    out.println(getJavaShortName());
-
-    if (superclass != null)
-    {
-      out.print('\n' + tab + " extends " + superclass.getJavaName());
-    }
-
-    Class[] ext = getInterfaces();
-
-    if (ext != null & ext.length > 0)
-    {
-
-      // Interfaces extend other interfaces,
-      // Classes implement interfaces.
-      out.print('\n' + tab + (isInterface ? " extends " : " implements ")
-                + ext[0].getName());
-
-      for (int i = 1; i < ext.length; ++i)
-      {
-        out.print(", " + ext[i].getJavaName());
-      }
-
-      out.print("\n");
-    }
-
-    out.print(tab + "{\n");
-
-    tab = tabset(++depth);
-
-    // Fields--------------------------------
-    Field[] fields = null;
-
-    try
-    {
-      fields = getDeclaredFields();
-    }
-    catch (SecurityException e)
-    {
-      out.println(tab + "//SecurityException retrieving fields");
-    }
-
-    if (fields != null)
-    {
-      for (int i = 0; i < fields.length; ++i)
-      {
-        out.println(tab + fields[i].toSource());
-      }
-    }
-
-    // Constructors--------------------------
-    Constructor[] ctors = null;
-
-    try
-    {
-      ctors = getDeclaredConstructors();
-    }
-    catch (SecurityException e)
-    {
-      out.println(tab + "//SecurityException retrieving ctors");
-    }
-
-    if (ctors != null)
-    {
-      for (int i = 0; i < ctors.length; ++i)
-      {
-        out.print(ctors[i].toSource(tab));
-      }
-    }
-
-    // Methods-------------------------------
-    Method[] methods = null;
-
-    try
-    {
-      methods = getDeclaredMethods();
-    }
-    catch (SecurityException e)
-    {
-      out.println(tab + "//SecurityException retrieving methods");
-    }
-
-    if (methods != null)
-    {
-      for (int i = 0; i < methods.length; ++i)
-      {
-        out.print('\n');
-        out.print(methods[i].toSource(tab));
-      }
-    }
-
-    // Inner classes --------------------------------
-    Class[] inners = getInnerClasses();
-
-    if (inners != null)
-    {
-      for (int i = 0; i < inners.length; ++i)
-      {
-        out.print('\n');
-        inners[i].toSource(out, depth);
-      }
-    }
-
-    // Done------------------------------
-    tab = tabset(--depth);
-
-    out.print(tab + "}\n");
-    out.flush();
-  }
-
-  /**
-   * Method tabset 
-   *
-   *
-   * @param depth
-   *
-   * (tabset) @return
-   */
-  private String tabset(int depth)
-  {
-
-    StringBuffer t = new StringBuffer();
-
-    while (depth-- > 0)
-    {
-      t.append("    ");
-    }
-
-    return t.toString();
-  }
-
-  // Ignores any keywords we don't recognize
-
-  /** Field val          */
-  static final int[] val = { Modifier.ABSTRACT, Modifier.FINAL,
-                             Modifier.INTERFACE, Modifier.NATIVE,
-                             Modifier.PRIVATE, Modifier.PROTECTED,
-                             Modifier.PUBLIC, Modifier.STATIC,
-                             Modifier.SYNCHRONIZED, Modifier.TRANSIENT,
-                             Modifier.VOLATILE };
-
-  /** Field kwd          */
-  static final String[] kwd = { "abstract", "final", "interface", "native",
-                                "private", "protected", "public", "static",
-                                "synchronized", "transient", "volatile" };
-
-  /**
-   * Method modifierFromString 
-   *
-   *
-   * @param t
-   *
-   * (modifierFromString) @return
-   */
-  static public int modifierFromString(String t)
-  {
-
-    for (int i = 0; i < kwd.length; ++i)
-    {
-      if (kwd[i].equals(t))
-        return val[i];
-    }
-
-    return 0;
-  }
-
-  /**
-   * Method modifiersFromString 
-   *
-   *
-   * @param s
-   *
-   * (modifiersFromString) @return
-   */
-  static public int modifiersFromString(String s)
-  {
-
-    int mods = 0;
-    java.util.StringTokenizer parts = new java.util.StringTokenizer(s);
-
-    while (parts.hasMoreTokens())
-    {
-      String t = parts.nextToken();
-
-      mods |= modifierFromString(t);
-    }
-
-    return mods;
-  }
-}
diff --git a/src/org/apache/xml/utils/synthetic/JavaUtils.java b/src/org/apache/xml/utils/synthetic/JavaUtils.java
deleted file mode 100644
index b397454..0000000
--- a/src/org/apache/xml/utils/synthetic/JavaUtils.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * The Apache Software License, Version 1.1 
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>. 
- *
- * $Id$ 
- */
-
-package org.apache.xml.utils.synthetic;
-
-import java.io.IOException;
-
-/** 
- * <meta name="usage" content="internal"/>
- * This class supports invoking Java compilation from within
- * a Java program. Recent versions of the Java environment have
- * provided such an API (in tools.jar). But that isn't available
- * on all platforms, and a fallback to the command line may be needed
- * (though this too may not always be available, eg. for security
- * reasons).
- * <p>
- * There's an additional complication in some environments --
- * such as Microsoft's VJ++ -- where the classpath as seen in
- * the System Properties may not be the one the user expects.
- * The code here is parameterized to try to deal with that.
- */
-public class JavaUtils
-{
-        // One-time flag for whether we could dynamically load compiler API
-        private static boolean cantLoadCompiler=false; 
-
-        // Debug flag - generates debug stuff if true.
-        private static boolean debug = false;
-  
-        /** Control whether compilation occurs with the -g option
-         * (debugging information included in generated classfile).
-         * This is an attribute, rather than a parameter on the compile
-         * method, largely because it tends to be an all-or-nothing decision; 
-         * generally you're either doing program development and want it,
-         * or running in production mode and don't. But that may not match
-         * the needs of future users...
-         * <p>
-         * TODO: Consider whether debug should be a parameter.
-         * 
-         * @param boolean newDebug True to request debugging data,
-         * false to request optimized output. (It's uncommon to
-         * want both or neither!)
-         */ 
-        public static void setDebug(boolean newDebug)
-        {
-            debug=newDebug;
-        }
-
-        /** Try to compile a .java file on disk. This will first attempt to
-         * use the sun.java.tools.javac() method, then (if that is unavailable)
-         * fall back upon shelling out to a command line and running javac
-         * there.
-         * <p>
-         * NOTE: This must be _compiled_ with sun.java.tools.* (tools.jar)
-         * available. We could change that to use reflection instead, if we
-         * accept some overhead... minor compared to the cost of running the
-         * compiler!
-         * <p>
-         * This has complications on some platforms. For example, under 
-         * Microsoft Visual Java ++ (at least, as installed on my test system),
-         * I found that I had to specify paths to both javac and xerces.jar
-         * rather than counting on the shell's path and classpath having
-         * been set to reach these. For that reason I've parameterized this
-         * method with a few system properties, so you can adapt it to your
-         * own system's needs without modifying the code:
-         * <dl>
-         * <dt>org.apache.xml.utils.synthetic.javac
-         * <dd>Command line issued to invoke the compiler. Defaults to "javac",
-         * which should work in most systems. In VJ++, try setting it to
-         * "cmd /c %JAVA_HOME%\\bin\javac.exe"
-         * <dt>org.apache.xml.utils.synthetic.moreclasspath
-         * <dd>Additional classpath, to be prepended to the one retrieved from
-         * java.class.path. Defaults to "" (empty). In VJ++, try setting it to
-         * point to your copy of xerces.jar, which may not be found otherwise.
-         * TODO: Reconsider prepend versus append!
-         * </dl>
-         * 
-         * @param String fileName Which .java file to compile. Note that this may
-         * be relative to the "current directory".
-         * @param String classPath Additional places to look for classes that
-         * this .java file depends upon. Becomes the javac command's
-         * -classpath parameter value.
-         * @return boolean True iff compilation succeeded.
-         */
-        public static boolean JDKcompile(String fileName, String classPath)
-        {
-                String moreClassPath=
-                        System.getProperty("org.apache.xml.utils.synthetic.moreclasspath","")
-                        .trim();
-                if(moreClassPath.length()>0)
-                        classPath=moreClassPath+';'+classPath;
-                                                                                                  
-                if (debug)
-                {
-                        System.err.println ("JavaEngine: Compiling " + fileName);
-                        System.err.println ("JavaEngine: Classpath is " + classPath);
-                }
-    
-                String code_option = debug ? "-g" : "-O";
-
-                // Start by trying Sun's compiler API
-            if(!cantLoadCompiler)
-                {
-                        String args[] = {
-                                code_option,
-                            "-classpath", classPath,
-                                fileName
-                        };
-                                
-//                         try
-// 			    {
-//                                 return new sun.tools.javac.Main(System.err, "javac").compile(args);
-//                         }
-//                         catch (Throwable th)
-//                         {
-//                                 System.err.println("INFORMATIONAL: Unable to load Java compiler API (eg tools.jar).");
-//                                 System.err.println("\tSwitching to command-line invocation.");
-//                                 cantLoadCompiler=true;
-//                         }
-                }
-    
-                // FALLTHRU:
-                // Can't load javac() method; try shelling out to the command
-                // line and invoking it via exec(). 
-                String javac_command=
-                        System.getProperty("org.apache.xml.utils.synthetic.javac","javac");
-            String args[] = {
-                        javac_command,
-                        code_option,
-                        "-classpath", classPath,
-                        fileName
-                        };
-                try
-                {
-                        Process p=java.lang.Runtime.getRuntime().exec(args);
-                        int compileOK=waitHardFor(p); // pause for debugging...
-                        return compileOK==0; //0 == no error reported
-                }
-                catch(IOException e)
-                {
-                        System.err.println("ERROR: IO exception during exec(javac).");
-                }
-                catch(SecurityException e)
-                {
-                        System.err.println("ERROR: Unable to create subprocess to exec(javac).");
-                }
-                
-                // FALLTHRU: All attempts failed.
-                return false;
-        }
-
-  /** Subroutine: Like p.waitFor, but discards the InterruptedException
-   * and goes right back into a wait. I don't want to report compiler
-   * success or failure until it really has succeeded or failed... I think.
-   * @param Process p to be waited for
-   * @return the exitValue() of the process.
-   */
-  static int waitHardFor(java.lang.Process p)
-  {
-    boolean done=false;
-    while(!done)
-        try
-        {
-            p.waitFor();
-            done=true;
-        }
-        catch(InterruptedException e)
-        {
-            System.err.println("(Compiler process wait interrupted and resumed)");
-        }
-     int ev=p.exitValue();  // Pause for debugging...
-     return ev;
-  }
-        
-}
diff --git a/src/org/apache/xml/utils/synthetic/SynthesisException.java b/src/org/apache/xml/utils/synthetic/SynthesisException.java
deleted file mode 100644
index 6355ca3..0000000
--- a/src/org/apache/xml/utils/synthetic/SynthesisException.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class SynthesisException <needs-comment/>
- */
-public class SynthesisException extends Exception
-{
-
-  /** Field code.
-   *  @serial          */
-  int code;
-
-  // Manefest constants
-
-  /** Field SYNTAX          */
-  public static final int SYNTAX = 0;
-
-  /** Field UNSUPPORTED          */
-  public static final int UNSUPPORTED = 1;
-
-  /** Field REIFIED          */
-  public static final int REIFIED = 2;
-
-  /** Field UNREIFIED          */
-  public static final int UNREIFIED = 3;
-
-  /** Field WRONG_OWNER          */
-  public static final int WRONG_OWNER = 4;
-
-  /** Field errToString          */
-  public static final String[] errToString = {
-    "(Syntax error; specific message should be passed in)",
-    "Feature not yet supported",
-    "Can't change features of 'real' class",
-    "Can't yet instantiate/invoke without 'real' class",
-    "Can't add Member to an object other than its declarer", };
-
-  /**
-   * Constructor SynthesisException
-   *
-   *
-   * @param code
-   */
-  public SynthesisException(int code)
-  {
-
-    super(errToString[code]);
-
-    this.code = code;
-  }
-
-  /**
-   * Constructor SynthesisException
-   *
-   *
-   * @param code
-   * @param msg
-   */
-  public SynthesisException(int code, String msg)
-  {
-
-    super(msg);
-
-    this.code = code;
-  }
-
-  /**
-   * Method getCode 
-   *
-   *
-   */
-  int getCode()
-  {
-    return code;
-  }
-}
diff --git a/src/org/apache/xml/utils/synthetic/TestDriver.java b/src/org/apache/xml/utils/synthetic/TestDriver.java
deleted file mode 100644
index 33e6d57..0000000
--- a/src/org/apache/xml/utils/synthetic/TestDriver.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Test driver for org.apache.xml.utils.synthetic.Class and org.apache.xml.utils.synthetic.reflection.
- *   <p>
- *   toSource should probably be factored out into a separate
- *   java generator class, so we could generate other languages as well.
- */
-package org.apache.xml.utils.synthetic;
-
-import org.apache.xml.utils.synthetic.Class;
-import org.apache.xml.utils.synthetic.reflection.*;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class TestDriver <needs-comment/>
- */
-public class TestDriver
-{
-
-  /** Field sampleField          */
-  public static int sampleField = 32;
-
-  /** Field inTest          */
-  private boolean inTest = false;
-
-  /**
-   * Method main 
-   *
-   *
-   * @param args
-   */
-  public static void main(String[] args)
-  {
-
-    // Proxy a class
-    try
-    {
-      System.out.println("Proxying java.awt.Frame...");
-
-      Class myC = Class.forName("java.awt.Frame");
-
-      myC.toSource(System.out, 0);
-      System.out.println(
-        "\nProxying org.apache.xml.utils.synthetic.TestDriver...");
-
-      myC =
-        Class.forName("com.ibm.org.apache.xml.utils.synthetic.TestDriver");
-
-      myC.toSource(System.out, 0);
-    }
-    catch (ClassNotFoundException e)
-    {
-      System.out.println("Couldn't proxy: ");
-      e.printStackTrace();
-    }
-
-    // Start getting serious
-    try
-    {
-      System.out.println("\nBuild a new beast...");
-
-      Class myC = Class.declareClass(
-        "com.ibm.org.apache.xml.utils.synthetic.BuildMe");
-      Class inner = myC.declareInnerClass("island");
-
-      inner.addExtends(Class.forName("java.lang.String"));
-
-      Method m = inner.declareMethod("getValue");
-
-      m.setReturnType(Class.forName("java.lang.String"));
-      m.getBody().append("return toString();");
-      myC.toSource(System.out, 0);
-    }
-    catch (ClassNotFoundException e)
-    {
-      e.printStackTrace();
-    }
-    catch (SynthesisException e)
-    {
-      e.printStackTrace();
-    }
-    catch (IllegalStateException e)
-    {
-      System.out.println("Unwritten function: " + e);
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Method dumpClass 
-   *
-   *
-   * @param C
-   */
-  public static void dumpClass(Class C)
-  {
-
-    System.out.println("toString(): " + C);
-    System.out.println("\tisPrimitive(): " + C.isPrimitive());
-    System.out.println("\tisInterface(): " + C.isInterface());
-    System.out.println("\tisInstance(\"foo\"): " + C.isInstance("foo"));
-    System.out.println("\tisArray(): " + C.isArray());
-    System.out.println("\tgetRealClass(): " + C.getRealClass());
-  }
-
-  /**
-   * Method quickcheck 
-   *
-   */
-  public void quickcheck()
-  {
-
-    Inner a = new Inner();
-
-    a.setTest(!a.getTest());
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Class Inner <needs-comment/>
-   */
-  private class Inner
-  {
-
-    /**
-     * Method getTest 
-     *
-     *
-     * @return
-     */
-    public boolean getTest()
-    {
-      return inTest;
-    }
-
-    /**
-     * Method setTest 
-     *
-     *
-     * @param test
-     */
-    public void setTest(boolean test)
-    {
-      inTest = test;
-    }
-  }
-}
diff --git a/src/org/apache/xml/utils/synthetic/reflection/Constructor.java b/src/org/apache/xml/utils/synthetic/reflection/Constructor.java
deleted file mode 100644
index 43c1580..0000000
--- a/src/org/apache/xml/utils/synthetic/reflection/Constructor.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic.reflection;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.xml.utils.synthetic.SynthesisException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Constructor provides information about, and access to, a
- * single constructor for a class.
- *
- * Constructor permits widening conversions to occur when
- * matching the actual parameters to newInstance() with
- * the underlying constructor's formal parameters, but
- * throws an IllegalArgumentException if a narrowing
- * conversion would occur.
- *
- */
-public class Constructor extends EntryPoint implements Member
-{
-
-  /**
-   * Actual Java class object. When present, all interactions
-   * are redirected to it. Allows our Class to function as a
-   * wrapper for the Java version (in lieu of subclassing or
-   * a shared Interface), and allows "in-place compilation"
-   * to replace a generated description with an
-   * directly runnable class.
-   */
-  private org.apache.xml.utils.synthetic.Class declaringclass = null;
-
-  /** Field realconstructor          */
-  private java.lang.reflect.Constructor realconstructor = null;
-
-  /** Field parametertypes          */
-  private org.apache.xml.utils.synthetic.Class[] parametertypes;
-
-  /** Field parameternames          */
-  private String[] parameternames;
-
-  /** Field exceptiontypes          */
-  private org.apache.xml.utils.synthetic.Class[] exceptiontypes;
-
-  /** Field modifiers          */
-  private int modifiers;
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param declaringclass
-   */
-  public Constructor(org.apache.xml.utils.synthetic.Class declaringclass)
-  {
-    super(declaringclass);
-  }
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param ctor
-   * @param declaringclass
-   */
-  public Constructor(java.lang.reflect.Constructor ctor,
-                     org.apache.xml.utils.synthetic.Class declaringclass)
-  {
-    super(ctor, declaringclass);
-  }
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param realconstructor
-   */
-  public Constructor(java.lang.reflect.Constructor realconstructor)
-  {
-    super(realconstructor);
-  }
-
-  /**
-   * Returns a hashcode for this Constructor. The
-   * hashcode is the same as the hashcode for the
-   * underlying constructor's declaring class name.
-   *
-   * ($objectName$) @return
-   */
-  public int hashCode()
-  {
-    return getDeclaringClass().getName().hashCode();
-  }
-
-  /**
-   * Uses the constructor represented by this
-   * Constructor object to create and initialize a new
-   * instance of the constructor's declaring class, with
-   * the specified initialization parameters. Individual
-   * parameters are automatically unwrapped to match
-   * primitive formal parameters, and both primitive
-   * and reference parameters are subject to widening
-   * conversions as necessary. Returns the newly
-   * created and initialized object.
-   * <p>
-   * Creation proceeds with the following steps, in
-   * order:
-   * <p>
-   * If the class that declares the underlying constructor
-   * represents an abstract class, the creation throws an
-   * InstantiationException.
-   * <p>
-   * If this Constructor object enforces Java language
-   * access control and the underlying constructor is
-   * inaccessible, the creation throws an
-   * IllegalAccessException.
-   * <p>
-   * If the number of actual parameters supplied via
-   * initargs is different from the number of formal
-   * parameters required by the underlying constructor,
-   * the creation throws an IllegalArgumentException.
-   * <p>
-   * A new instance of the constructor's declaring class
-   * is created, and its fields are initialized to their
-   * default initial values.
-   * <p>
-   * For each actual parameter in the supplied initargs
-   * array:
-   * <p>
-   * If the corresponding formal parameter has a
-   * primitive type, an unwrapping conversion is
-   * attempted to convert the object value to a value of
-   * the primitive type. If this attempt fails, the
-   * creation throws an IllegalArgumentException.
-   * <p>
-   *
-   * If, after possible unwrapping, the parameter value
-   * cannot be converted to the corresponding formal
-   * parameter type by an identity or widening
-   * conversion, the creation throws an
-   * IllegalArgumentException.
-   * <p>
-   * Control transfers to the underlying constructor to
-   * initialize the new instance. If the constructor
-   * completes abruptly by throwing an exception, the
-   * exception is placed in an
-   * InvocationTargetException and thrown in turn to
-   * the caller of newInstance.
-   * <p>
-   * If the constructor completes normally, returns the
-   * newly created and initialized instance.
-   *
-   *
-   * @param initargs initialization arguments.
-   *
-   * @return The new instance.
-   * @throws  IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws  IllegalArgumentException
-   * if the number of actual and formal
-   * parameters differ, or if an unwrapping
-   * conversion fails.
-   * @throws  InstantiationException
-   * if the class that declares the underlying
-   * constructor represents an abstract class.
-   * @throws  InvocationTargetException
-   * if the underlying constructor throws an
-   * exception.
-   * @throws java.lang.reflect.InvocationTargetException
-   */
-  public Object newInstance(Object initargs[])
-          throws InstantiationException, IllegalAccessException,
-                 IllegalArgumentException,
-                 java.lang.reflect.InvocationTargetException
-  {
-
-    if (realep != null)
-      return ((java.lang.reflect.Constructor) realep).newInstance(initargs);
-    else
-      throw new InstantiationException(
-        "Un-reified org.apache.xml.utils.synthetic.Class doesn't yet support invocation");
-  }
-}
diff --git a/src/org/apache/xml/utils/synthetic/reflection/EntryPoint.java b/src/org/apache/xml/utils/synthetic/reflection/EntryPoint.java
deleted file mode 100644
index aa1092d..0000000
--- a/src/org/apache/xml/utils/synthetic/reflection/EntryPoint.java
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic.reflection;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.xml.utils.synthetic.SynthesisException;
-
-/*
- * OPEN ISSUES:
- *   Reflection doesn't tell us about deprecation; if we want
- *   that info, MFC advises mousing our way into the class (ugh).
- *   Should we at least model that for synthetics?
- */
-
-/**
- * <meta name="usage" content="internal"/>
- * API/behaviors shared between Constructors and Methods.
- * They're mostly similar, except for what they proxy and
- * a few specific calls (name, invoke/getInstance).
- */
-abstract public class EntryPoint implements Member
-{
-
-  /** Field realep          */
-  protected Object realep;
-
-  /** Field declaringclass          */
-  private org.apache.xml.utils.synthetic.Class declaringclass = null;
-
-  /** Field returntype          */
-  protected org.apache.xml.utils.synthetic.Class returntype = null;
-
-  /** Field parameternames          */
-  private String[] parameternames = new String[0];
-
-  /** Field parametertypes          */
-  private org.apache.xml.utils.synthetic.Class[] parametertypes =
-    new org.apache.xml.utils.synthetic.Class[0];
-
-  /** Field exceptiontypes          */
-  private org.apache.xml.utils.synthetic.Class[] exceptiontypes =
-    new org.apache.xml.utils.synthetic.Class[0];
-  ;
-
-  /** Field modifiers          */
-  private int modifiers;
-
-  /** Field name          */
-  protected String name = null;  // for Methods
-
-  // For synthesis:
-
-  /** Field body          */
-  private StringBuffer body = null;
-
-  /** Field language          */
-  private String language = null;
-
-  // For reifying:
-
-  /** Field realE, realP          */
-  Class[] realE, realP;
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param declaringclass
-   */
-  public EntryPoint(org.apache.xml.utils.synthetic.Class declaringclass)
-  {
-    this.declaringclass = declaringclass;
-  }
-
-  /**
-   * Nonpublic constructor. Wrap this to appropriate "real" type 
-   *
-   * @param ep
-   * @param declaringclass
-   *
-   * @throws IllegalArgumentException
-   */
-  protected EntryPoint(
-          Object ep, org.apache.xml.utils.synthetic.Class declaringclass)
-            throws IllegalArgumentException
-  {
-
-    realep = ep;
-    this.declaringclass = declaringclass;
-
-    if (ep instanceof java.lang.reflect.Method)
-    {
-      java.lang.reflect.Method m = (java.lang.reflect.Method) ep;
-
-      if (declaringclass == null)
-      {
-        declaringclass = org.apache.xml.utils.synthetic.Class.forClass(
-          m.getDeclaringClass());
-      }
-
-      name = m.getName();
-      modifiers = m.getModifiers();
-      returntype =
-        org.apache.xml.utils.synthetic.Class.forClass(m.getReturnType());
-      realP = m.getParameterTypes();
-      realE = m.getExceptionTypes();
-    }
-    else if (ep instanceof java.lang.reflect.Constructor)
-    {
-      java.lang.reflect.Constructor c = (java.lang.reflect.Constructor) ep;
-
-      if (declaringclass == null)
-      {
-        declaringclass = org.apache.xml.utils.synthetic.Class.forClass(
-          c.getDeclaringClass());
-      }
-
-      name = declaringclass.getShortName();
-      modifiers = c.getModifiers();
-      returntype = declaringclass;
-      realP = c.getParameterTypes();
-      realE = c.getExceptionTypes();
-    }
-    else
-      throw new IllegalArgumentException();
-  }
-
-  /**
-   * Nonpublic constructor. Wrap this to appropriate "real" type 
-   *
-   * @param ep
-   *
-   * @throws IllegalArgumentException
-   */
-  protected EntryPoint(Object ep) throws IllegalArgumentException
-  {
-    this(ep, null);
-  }
-
-  /**
-   * Compares this against the specified
-   * object. Returns true if the objects are the same.
-   * Two EntryPoints are the same if they were
-   * declared by the same class, have the same name
-   * (or are both ctors) and have the same
-   * formal parameter types.
-   *
-   * @param obj
-   *
-   */
-  public boolean equals(Object obj)
-  {
-
-    EntryPoint otherep = null;
-
-    if (obj instanceof EntryPoint)
-      otherep = (EntryPoint) obj;
-    else if (obj instanceof java.lang.reflect.Constructor
-             || obj instanceof java.lang.reflect.Method)
-      otherep = (EntryPoint) obj;
-
-    return (otherep != null && ((this instanceof Constructor && otherep instanceof Constructor) || (this instanceof Method && otherep instanceof Method && this.getName().equals(
-      otherep.getName()))) && otherep.getDeclaringClass().equals(
-        declaringclass) && otherep.getParameterTypes().equals(
-        parametertypes));
-  }
-
-  /**
-   * Returns the Class object representing the class that
-   * declares the constructor represented by this
-   * Constructor object.
-   *
-   */
-  public org.apache.xml.utils.synthetic.Class getDeclaringClass()
-  {
-    return declaringclass;
-  }
-
-  /**
-   * Returns the Class object representing the class that
-   * will be returned by this EntryPoint. Needed by the Method
-   * API, but made meaningful for Constructors as well.
-   *
-   */
-  public org.apache.xml.utils.synthetic.Class getReturnType()
-  {
-    return returntype;
-  }
-
-  /**
-   * Returns an array of Class objects that represent the
-   * types of the checked exceptions thrown by the
-   * underlying constructor represented by this
-   * Constructor object. Returns an array of length 0 if
-   * the constructor throws no checked exceptions.
-   *
-   */
-  public org.apache.xml.utils.synthetic.Class[] getExceptionTypes()
-  {
-
-    if (realep != null && exceptiontypes == null)
-    {
-      exceptiontypes =
-        new org.apache.xml.utils.synthetic.Class[realE.length];
-
-      for (int i = 0; i < realE.length; ++i)
-      {
-        exceptiontypes[i] =
-          org.apache.xml.utils.synthetic.Class.forClass(realE[i]);
-      }
-
-      realE = null;
-    }
-
-    return exceptiontypes;
-  }
-
-  /**
-   * Method addExceptionType 
-   *
-   *
-   * @param exception
-   *
-   * @throws SynthesisException
-   */
-  public void addExceptionType(
-          org.apache.xml.utils.synthetic.Class exception)
-            throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    org.apache.xml.utils.synthetic.Class[] e =
-      new org.apache.xml.utils.synthetic.Class[exceptiontypes.length + 1];
-
-    System.arraycopy(exceptiontypes, 0, e, 0, exceptiontypes.length);
-
-    e[exceptiontypes.length] = exception;
-    exceptiontypes = e;
-  }
-
-  /**
-   * Returns the Java language modifiers for the
-   * constructor represented by this Constructor object,
-   * as an integer. The Modifier class should be used to
-   * decode the modifiers.
-   *
-   */
-  public int getModifiers()
-  {
-    return modifiers;
-  }
-
-  /**
-   * Member method. C'tor's name is always that of the defining class.
-   * Methods have a "real" name.
-   * Creation date: (12-25-99 1:32:06 PM)
-   * @return java.lang.String
-   */
-  public java.lang.String getName()
-  {
-
-    if (this instanceof Constructor)
-      return declaringclass.getShortName();
-
-    return name;
-  }
-
-  /**
-   * Member method. C'tor's name is always that of the defining class.
-   * Methods have a "real" name.
-   * Creation date: (12-25-99 1:32:06 PM)
-   *
-   * @param name
-   * @return java.lang.String
-   *
-   * @throws SynthesisException
-   */
-  public void setName(String name) throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.name = name;
-  }
-
-  /**
-   * Returns an array of Class objects that represent the
-   * formal parameter types, in declaration order, of the
-   * constructor represented by this Constructor object.
-   * Returns an array of length 0 if the underlying
-   * constructor takes no parameters.
-   *
-   */
-  public org.apache.xml.utils.synthetic.Class[] getParameterTypes()
-  {
-
-    if (realep != null && parametertypes == null)
-    {
-      parametertypes =
-        new org.apache.xml.utils.synthetic.Class[realP.length];
-
-      for (int i = 0; i < realP.length; ++i)
-      {
-        parametertypes[i] =
-          org.apache.xml.utils.synthetic.Class.forClass(realP[i]);
-      }
-
-      realP = null;
-    }
-
-    return parametertypes;
-  }
-
-  /**
-   * Method getParameterNames 
-   *
-   *
-   * (getParameterNames) @return
-   */
-  public String[] getParameterNames()
-  {
-    return parameternames;
-  }
-
-  /**
-   * Method addParameter 
-   *
-   *
-   * @param type
-   * @param name
-   *
-   * @throws SynthesisException
-   */
-  public void addParameter(
-          org.apache.xml.utils.synthetic.Class type, String name)
-            throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    org.apache.xml.utils.synthetic.Class[] types =
-      new org.apache.xml.utils.synthetic.Class[parametertypes.length + 1];
-
-    System.arraycopy(parametertypes, 0, types, 0, parametertypes.length);
-
-    types[parametertypes.length] = type;
-    parametertypes = types;
-
-    String[] names = new String[parameternames.length + 1];
-
-    System.arraycopy(parameternames, 0, names, 0, parameternames.length);
-
-    names[parameternames.length] = name;
-    parameternames = names;
-  }
-
-  /**
-   * Returns a hashcode for this Constructor. The
-   * hashcode is the same as the hashcode for the
-   * underlying constructor's declaring class name,
-   * xor'ed (for Methods) with the method name.
-   * (Implemented in the subclasses rather than here.)
-   *
-   */
-  abstract public int hashCode();
-
-  /**
-   * Assert the Class object representing the class that
-   * declares the constructor represented by this
-   * Constructor object.
-   *
-   * @param declaringClass
-   *
-   * @throws SynthesisException
-   */
-  public void setDeclaringClass(
-          org.apache.xml.utils.synthetic.Class declaringClass)
-            throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.declaringclass = declaringClass;
-  }
-
-  /**
-   * Should only be accepted before a "real" entrypoint is bound.
-   * Creation date: (12-25-99 1:28:28 PM)
-   * @return int
-   * @param modifiers int
-   *
-   * @throws SynthesisException
-   */
-  public void setModifiers(int modifiers) throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.modifiers = modifiers;
-  }
-
-  /**
-   * Return a string describing this Constructor. The
-   * string is formatted as the constructor access
-   * modifiers, if any, followed by the fully-qualified
-   * name of the declaring class, followed by a
-   * parenthesized, comma-separated list of the
-   * constructor's formal parameter types. For example:
-   * <code>
-   * public java.util.Hashtable(int,float)
-   * </code>
-   * <p>
-   * The only possible modifiers for constructors are
-   * the access modifiers public, protected or
-   * private. Only one of these may appear, or none
-   * if the constructor has default (package) access.
-   * <p>
-   * Methods will also display their checked exceptions.
-   *
-   */
-  public String toString()
-  {
-
-    StringBuffer sb =
-      new StringBuffer(java.lang.reflect.Modifier.toString(getModifiers()));
-
-    if (this instanceof org.apache.xml.utils.synthetic.reflection.Method)
-      sb.append(' ').append(getReturnType()).append(
-        getDeclaringClass().getName()).append('.').append(getName());
-    else
-      sb.append(getDeclaringClass().getName());
-
-    sb.append('(');
-
-    org.apache.xml.utils.synthetic.Class[] p = getParameterTypes();
-
-    if (p != null && p.length > 0)
-    {
-      sb.append(p[0].getName());
-
-      for (int i = 1; i < p.length; ++i)
-      {
-        sb.append(',').append(p[i].getName());
-      }
-    }
-
-    sb.append(')');
-
-    if (this instanceof org.apache.xml.utils.synthetic.reflection.Method)
-    {
-      p = getExceptionTypes();
-
-      if (p != null && p.length > 0)
-      {
-        sb.append(" throws ").append(p[0].getName());
-
-        for (int i = 1; i < p.length; ++i)
-        {
-          sb.append(',').append(p[i].getName());
-        }
-      }
-    }
-
-    return sb.toString();
-  }
-
-  /**
-   * Extension: For synthesis, we need a place to hang a
-   * method body.
-   *
-   * @param language
-   * @param body
-   *
-   * @throws SynthesisException
-   */
-  public void setBody(String language, StringBuffer body)
-          throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.language = language;
-    this.body = body;
-  }
-
-  /**
-   * Extension: For synthesis, we need a place to hang a
-   * method body. Note that this returns a mutable object,
-   * for editing etc. Slightly sloppy first cut.
-   *
-   */
-  public StringBuffer getBody()
-  {
-
-    if (body == null)
-      body = new StringBuffer();
-
-    return body;
-  }
-
-  /**
-   * Extension: For synthesis, we need a place to hang a
-   * method body.
-   *
-   */
-  public String getLanguage()
-  {
-    return language;
-  }
-
-  /**
-   * Generate Java code
-   *
-   * @param basetab
-   *
-   */
-  public String toSource(String basetab)
-  {
-
-    StringBuffer sb = new StringBuffer();
-
-    sb.append(basetab).append(
-      java.lang.reflect.Modifier.toString(getModifiers()));
-
-    if (this instanceof org.apache.xml.utils.synthetic.reflection.Method)
-    {
-      if (returntype != null)
-        sb.append(" ").append(getReturnType().getJavaName());
-      else
-        sb.append(" void");
-    }
-
-    sb.append(" ").append(getName()).append("(");
-
-    org.apache.xml.utils.synthetic.Class[] types = getParameterTypes();
-
-    if (types != null & types.length > 0)
-    {
-      sb.append(types[0].getJavaName());
-
-      if (parameternames != null)
-        sb.append(' ').append(parameternames[0]);
-
-      for (int i = 1; i < types.length; ++i)
-      {
-        sb.append(',').append(types[i].getJavaName());
-
-        if (parameternames != null)
-          sb.append(' ').append(parameternames[i]);
-      }
-    }
-
-    sb.append(')');
-
-    types = getExceptionTypes();
-
-    if (types != null & types.length > 0)
-    {
-      sb.append(" throws ").append(types[0].getJavaName());
-
-      for (int i = 1; i < types.length; ++i)
-      {
-        sb.append(',').append(types[i].getJavaName());
-      }
-    }
-
-    if (body == null)
-      sb.append("; // No method body available\n");
-    else
-    {
-      sb.append("\n" + basetab + "{\n");
-
-      if (language == null || "java".equals(language))
-      {
-        sb.append(basetab + "// ***** Should prettyprint this code...\n");
-        sb.append(basetab + body + "\n");
-      }
-      else
-      {
-        sb.append(basetab + "// ***** Generate BSF invocation!?\n");
-      }
-
-      sb.append(basetab + "}\n");
-    }
-
-    return sb.toString();
-  }
-}
diff --git a/src/org/apache/xml/utils/synthetic/reflection/Field.java b/src/org/apache/xml/utils/synthetic/reflection/Field.java
deleted file mode 100644
index e5713cf..0000000
--- a/src/org/apache/xml/utils/synthetic/reflection/Field.java
+++ /dev/null
@@ -1,834 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic.reflection;
-
-import org.apache.xml.utils.synthetic.Class;
-import org.apache.xml.utils.synthetic.SynthesisException;
-
-/**
- * <meta name="usage" content="internal"/>
- * A Field provides information about, and dynamic access
- * to, a single field of a class or an interface. The reflected
- * field may be a class (static) field or an instance field.
- * <p>
- * A Field permits widening conversions to occur during a
- * get or set access operation, but throws an
- * IllegalArgumentException if a narrowing conversion
- * would occur.
- *
- */
-public class Field extends Object implements Member
-{
-
-  /** Field name, initializer          */
-  public String name, initializer = null;
-
-  /** Field modifiers          */
-  int modifiers;
-
-  /** Field realfield          */
-  java.lang.reflect.Field realfield = null;
-
-  /** Field declaringClass, type          */
-  Class declaringClass, type;
-
-  /**
-   * Proxy constructor 
-   *
-   * @param realfield
-   * @param declaringClass
-   */
-  public Field(java.lang.reflect.Field realfield,
-               org.apache.xml.utils.synthetic.Class declaringClass)
-  {
-
-    this(realfield.getName(), declaringClass);
-
-    this.realfield = realfield;
-    this.type =
-      org.apache.xml.utils.synthetic.Class.forClass(realfield.getType());
-  }
-
-  /**
-   * Synthesis constructor 
-   *
-   * @param name
-   * @param declaringClass
-   */
-  public Field(String name,
-               org.apache.xml.utils.synthetic.Class declaringClass)
-  {
-    this.name = name;
-    this.declaringClass = declaringClass;
-  }
-
-  /**
-   * Compares this Field against the specified object.
-   * Returns true if the objects are the same. Two
-   * Fields are the same if they were declared by the
-   * same class and have the same name and type.
-   *
-   * @param obj
-   *
-   */
-  public boolean equals(Object obj)
-  {
-
-    if (realfield != null)
-      return realfield.equals(obj);
-    else if (obj instanceof Field)
-    {
-      Field objf = (Field) obj;
-
-      return (declaringClass.equals(objf.declaringClass)
-              && name.equals(objf.name) && type.equals(objf.type));
-    }
-    else
-      return false;
-  }
-
-  /**
-   * Returns the value of the field represented by this
-   * Field, on the specified object. The value is
-   * automatically wrapped in an object if it has a
-   * primitive type.
-   * <p>
-   * The underlying field's value is obtained as follows:
-   * <p>
-   * If the underlying field is a static field, the object
-   * argument is ignored; it may be null.
-   * <p>
-   * Otherwise, the underlying field is an instance
-   * field. If the specified object argument is null, the
-   * method throws a NullPointerException. If the
-   * specified object is not an instance of the class or
-   * interface declaring the underlying field, the
-   * method throws an IllegalArgumentException.
-   * <p>
-   * If this Field object enforces Java language access
-   * control, and the underlying field is inaccessible,
-   * the method throws an IllegalAccessException.
-   * <p>
-   * Otherwise, the value is retrieved from the
-   * underlying instance or static field. If the field has a
-   * primitive type, the value is wrapped in an object
-   * before being returned, otherwise it is returned as
-   * is.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field.
-   * @throws NullPointerException
-   * if the specified object is null.
-   */
-  public Object get(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.get(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a boolean on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public boolean getBoolean(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getBoolean(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a byte on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public byte getByte(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getByte(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a char on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public char getChar(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getChar(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Returns the Class object representing the class or
-   * interface that declares the field represented by this
-   * Field object.
-   *
-   */
-  public org.apache.xml.utils.synthetic.Class getDeclaringClass()
-  {
-
-    if (realfield != null)
-      return org.apache.xml.utils.synthetic.Class.forClass(
-        realfield.getDeclaringClass());
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a double on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public double getDouble(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getDouble(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a float on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public float getFloat(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getFloat(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a int on specified object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public int getInt(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getInt(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Get the value of a field as a long on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public long getLong(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getLong(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Returns the Java language modifiers for the field
-   * represented by this Field object, as an integer. The
-   * Modifier class should be used to decode the
-   * modifiers.
-   *
-   */
-  public int getModifiers()
-  {
-
-    if (realfield != null)
-      modifiers = realfield.getModifiers();
-
-    return modifiers;
-  }
-
-  /**
-   * Method getInitializer 
-   *
-   *
-   * (getInitializer) @return
-   */
-  public String getInitializer()
-  {
-    return initializer;
-  }
-
-  /**
-   * Method setInitializer 
-   *
-   *
-   * @param i
-   *
-   * @throws SynthesisException
-   */
-  public void setInitializer(String i) throws SynthesisException
-  {
-
-    if (realfield != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    initializer = i;
-  }
-
-  /**
-   * Insert the method's description here.
-   * Creation date: (12-25-99 2:02:26 PM)
-   * @return java.lang.String
-   */
-  public java.lang.String getName()
-  {
-    return name;
-  }
-
-  /**
-   * Get the value of a field as a short on specified
-   * object.
-   *
-   *
-   * @param obj
-   *
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the field value cannot be converted to the
-   * return type by a widening conversion.
-   */
-  public short getShort(Object obj)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      return realfield.getShort(obj);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Returns a Class object that identifies the declared
-   * type for the field represented by this Field object.
-   *
-   */
-  public Class getType()
-  {
-
-    if (realfield != null)
-      type = Class.forClass(realfield.getType());
-
-    return type;
-  }
-
-  /**
-   * Method setType 
-   *
-   *
-   * @param type
-   *
-   * @throws SynthesisException
-   */
-  public void setType(org.apache.xml.utils.synthetic.Class type)
-          throws SynthesisException
-  {
-
-    if (realfield != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.type = type;
-  }
-
-  /**
-   * Returns a hashcode for this Field. This is
-   * computed as the exclusive-or of the hashcodes for
-   * the underlying field's declaring class name and its
-   * name.
-   *
-   */
-  public int hashCode()
-  {
-
-    if (realfield != null)
-      return realfield.hashCode();
-    else
-      return declaringClass.getName().hashCode() ^ name.hashCode();
-  }
-
-  /**
-   * Sets the field represented by this Field object on
-   * the specified object argument to the specified new
-   * value. The new value is automatically unwrapped
-   * if the underlying field has a primitive type.
-   *
-   * The operation proceeds as follows:
-   *
-   * If the underlying field is static, the object
-   * argument is ignored; it may be null.
-   *
-   * Otherwise the underlying field is an instance field.
-   * If the specified object argument is null, the
-   * method throws a NullPointerException. If the
-   * specified object argument is not an instance of the
-   * class or interface declaring the underlying field,
-   * the method throws an IllegalArgumentException.
-   *
-   * If this Field object enforces Java language access
-   * control, and the underlying field is inaccessible,
-   * the method throws an IllegalAccessException.
-   *
-   * If the underlying field is final, the method throws
-   * an IllegalAccessException.
-   *
-   * If the underlying field is of a primitive type, an
-   * unwrapping conversion is attempted to convert the
-   * new value to a value of a primitive type. If this
-   * attempt fails, the method throws an
-   * IllegalArgumentException.
-   *
-   * If, after possible unwrapping, the new value
-   * cannot be converted to the type of the underlying
-   * field by an identity or widening conversion, the
-   * method throws an IllegalArgumentException.
-   *
-   * The field is set to the possibly unwrapped and
-   * widened new value.
-   *
-   *
-   * @param obj
-   * @param value
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   * @throws NullPointerException
-   * if the specified object is null.
-   */
-  public void set(Object obj, Object value)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.set(obj, value);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Set the value of a field as a boolean on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param z
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setBoolean(Object obj, boolean z)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setBoolean(obj, z);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Set the value of a field as a byte on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param b
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setByte(Object obj, byte b)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setByte(obj, b);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Set the value of a field as a char on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param c
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setChar(Object obj, char c)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setChar(obj, c);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Returns the Class object representing the class that
-   * declares the constructor represented by this
-   * Constructor object.
-   *
-   * @param declaringClass
-   */
-  public void setDeclaringClass(
-          org.apache.xml.utils.synthetic.Class declaringClass)
-  {
-    this.declaringClass = declaringClass;
-  }
-
-  /**
-   * Set the value of a field as a double on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param d
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setDouble(Object obj, double d)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setDouble(obj, d);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Set the value of a field as a float on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param f
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setFloat(Object obj, float f)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setFloat(obj, f);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Set the value of a field as an int on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param i
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setInt(Object obj, int i)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setInt(obj, i);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Set the value of a field as a long on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param l
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setLong(Object obj, long l)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setLong(obj, l);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Insert the method's description here.
-   * Creation date: (12-25-99 1:28:28 PM)
-   * @return int
-   * @param modifiers int
-   *
-   * @throws SynthesisException
-   */
-  public void setModifiers(int modifiers) throws SynthesisException
-  {
-
-    if (realfield != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.modifiers = modifiers;
-  }
-
-  /**
-   * Set the value of a field as a short on specified
-   * object.
-   *
-   *
-   * @param obj
-   * @param s
-   * @throws IllegalAccessException
-   * if the underlying constructor is inaccessible.
-   * @throws IllegalArgumentException
-   * if the specified object is not an instance of
-   * the class or interface declaring the
-   * underlying field, or if an unwrapping
-   * conversion fails.
-   */
-  public void setShort(Object obj, short s)
-          throws IllegalArgumentException, IllegalAccessException
-  {
-
-    if (realfield != null)
-      realfield.setShort(obj, s);
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Return a string describing this Field. The format is
-   * the access modifiers for the field, if any, followed
-   * by the field type, followed by a space, followed by
-   * the fully-qualified name of the class declaring the
-   * field, followed by a period, followed by the name
-   * of the field. For example:
-   * <code>
-   * public static final int java.lang.Thread.MIN_PRIORITY
-   * private int java.io.FileDescriptor.fd
-   * </code>
-   *
-   * The modifiers are placed in canonical order as
-   * specified by "The Java Language Specification".
-   * This is public, protected or private first,
-   * and then other modifiers in the following order:
-   * static, final, transient, volatile.
-   *
-   */
-  public String toString()
-  {
-
-    if (realfield != null)
-      return realfield.toString();
-
-    throw new java.lang.IllegalStateException();
-  }
-
-  /**
-   * Output the Field as Java sourcecode
-   *
-   */
-  public String toSource()
-  {
-
-    StringBuffer sb = new StringBuffer(
-      java.lang.reflect.Modifier.toString(getModifiers())).append(' ').append(
-      getType().getJavaName()).append(' ').append(getName());
-    String i = getInitializer();
-
-    if (i != null && i.length() > 0)
-      sb.append('=').append(i);
-
-    sb.append(';');
-
-    return sb.toString();
-  }
-}
diff --git a/src/org/apache/xml/utils/synthetic/reflection/Member.java b/src/org/apache/xml/utils/synthetic/reflection/Member.java
deleted file mode 100644
index d38c853..0000000
--- a/src/org/apache/xml/utils/synthetic/reflection/Member.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic.reflection;
-
-import org.apache.xml.utils.synthetic.SynthesisException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Member is an interface that reflects identifying
- * information about a single member (a field or a method)
- * or a constructor.
- * <p>
- * Note that this is <strong>not</strong> currently derived from
- * java.lang.reflect.Member, due to questions about how to handle
- * declarignClass.
- *
- * @see org.apache.xml.utils.synthetic.Class
- */
-public interface Member
-{
-
-  /**
-   * Returns the Class object representing the class or
-   * interface that declares the member or constructor
-   * represented by this Member.
-   *
-   */
-  public abstract org.apache.xml.utils.synthetic.Class getDeclaringClass();
-
-  /**
-   * Returns the Java language modifiers for the
-   * member or constructor represented by this
-   * Member, as an integer. The Modifier class should
-   * be used to decode the modifiers in the integer.
-   *
-   */
-  public abstract int getModifiers();
-
-  /**
-   * Returns the Class object representing the class or
-   * interface that declares the member or constructor
-   * represented by this Member.
-   *
-   * @param declaringClass
-   *
-   * @throws SynthesisException
-   */
-  public abstract void setDeclaringClass(
-    org.apache.xml.utils.synthetic.Class declaringClass)
-      throws SynthesisException;
-
-  /**
-   * Returns the Java language modifiers for the
-   * member or constructor represented by this
-   * Member, as an integer. The Modifier class should
-   * be used to decode the modifiers in the integer.
-   *
-   * @param modifiers
-   *
-   * @throws SynthesisException
-   */
-  public abstract void setModifiers(int modifiers) throws SynthesisException;
-}
diff --git a/src/org/apache/xml/utils/synthetic/reflection/Method.java b/src/org/apache/xml/utils/synthetic/reflection/Method.java
deleted file mode 100644
index e96978a..0000000
--- a/src/org/apache/xml/utils/synthetic/reflection/Method.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xml.utils.synthetic.reflection;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.xml.utils.synthetic.SynthesisException;
-
-/**
- * <meta name="usage" content="internal"/>
- * A Method provides information about, and access to, a
- * single method on a class or interface. The reflected
- * method may be a class method or an instance method
- * (including an abstract method).
- * <p>
- * A Method permits widening conversions to occur when
- * matching the actual parameters to invokewith the
- * underlying method's formal parameters, but it throws an
- * IllegalArgumentException if a narrowing conversion
- * would occur.
- * <p>
- *  Need to add method body, a la Matt's codebuffer.
- * That may or may not imply retaining the final return value
- * separately and passing in a how-to-use-it mechanism...?
- *
- */
-public class Method extends EntryPoint implements Member
-{
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param name
-   * @param declaringclass
-   */
-  public Method(String name,
-                org.apache.xml.utils.synthetic.Class declaringclass)
-  {
-
-    super(declaringclass);
-
-    this.name = name;
-  }
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param ctor
-   * @param declaringclass
-   */
-  public Method(java.lang.reflect.Method ctor,
-                org.apache.xml.utils.synthetic.Class declaringclass)
-  {
-    super(ctor, declaringclass);
-  }
-
-  /**
-   * Insert the method's description here.
-   * <p>
-   * Creation date: (12-27-99 2:31:39 PM)
-   * @param realConstructor java.lang.reflect.Constructor
-   *
-   * @param realmethod
-   */
-  public Method(java.lang.reflect.Method realmethod)
-  {
-    super(realmethod);
-  }
-
-  /**
-   * Returns a hashcode for this Method. The hashcode
-   * is computed as the exclusive-or of the hashcodes
-   * for the underlying method's declaring class name
-   * and the method's name.
-   *
-   */
-
-  /**
-   * Returns a hashcode for this Constructor. The
-   * hashcode for a Method is the hashcode for the
-   * underlying constructor's declaring class name,
-   * XORed with the name of this method.
-   */
-  public int hashCode()
-  {
-    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
-  }
-
-  /**
-   * Invokes the underlying method represented by this
-   * Method object, on the specified object with the
-   * specified parameters. Individual parameters are
-   * automatically unwrapped to match primitive
-   * formal parameters, and both primitive and
-   * reference parameters are subject to widening
-   * conversions as necessary. The value returned by
-   * the underlying method is automatically wrapped
-   * in an object if it has a primitive type.
-   *
-   * Method invocation proceeds with the following
-   * steps, in order:
-   *
-   * If the underlying method is static, then the
-   * specified object argument is ignored. It may be
-   * null.
-   *
-   * Otherwise, the method is an instance method. If
-   * the specified object argument is null, the
-   * invocation throws a NullPointerException.
-   * Otherwise, if the specified object argument is not
-   * an instance of the class or interface declaring the
-   * underlying method, the invocation throws an
-   * IllegalArgumentException.
-   *
-   * If this Method object enforces Java language access
-   * control and the underlying method is inaccessible,
-   * the invocation throws an IllegalAccessException.
-   *
-   * If the number of actual parameters supplied via
-   * args is different from the number of formal
-   * parameters required by the underlying method, the
-   * invocation throws an IllegalArgumentException.
-   *
-   * For each actual parameter in the supplied args
-   * array:
-   *
-   * If the corresponding formal parameter has a
-   * primitive type, an unwrapping conversion is
-   * attempted to convert the object value to a value of
-   * a primitive type. If this attempt fails, the
-   * invocation throws an IllegalArgumentException.
-   *
-   * If, after possible unwrapping, the parameter value
-   * cannot be converted to the corresponding formal
-   * parameter type by an identity or widening
-   * conversion, the invocation throws an
-   * IllegalArgumentException.
-   *
-   * If the underlying method is an instance method, it
-   * is invoked using dynamic method lookup as
-   * documented in The Java Language Specification,
-   * section 15.11.4.4; in particular, overriding based
-   * on the runtime type of the target object will occur.
-   *
-   * If the underlying method is static, it is invoked as
-   * exactly the method on the declaring class.
-   *
-   * Control transfers to the underlying method. If the
-   * method completes abruptly by throwing an
-   * exception, the exception is placed in an
-   * InvocationTargetException and thrown in turn to
-   * the caller of invoke.
-   *
-   * If the method completes normally, the value it
-   * returns is returned to the caller of invoke; if the
-   * value has a primitive type, it is first appropriately
-   * wrapped in an object. If the underlying method
-   * return type is void, the invocation returns null.
-   *
-   * Throws: IllegalAccessException
-   * if the underlying method is inaccessible.
-   * Throws: IllegalArgumentException
-   * if the number of actual and formal
-   * parameters differ, or if an unwrapping
-   * conversion fails.
-   * Throws: InvocationTargetException
-   * if the underlying method throws an
-   * exception.
-   * Throws: NullPointerException
-   * if the specified object is null.
-   *
-   * @param obj
-   * @param args
-   *
-   *
-   * @throws IllegalAccessException
-   * @throws IllegalArgumentException
-   * @throws java.lang.reflect.InvocationTargetException
-   */
-  public Object invoke(Object obj, Object args[])
-          throws IllegalAccessException, IllegalArgumentException,
-                 java.lang.reflect.InvocationTargetException
-  {
-
-    if (realep != null)
-      return ((java.lang.reflect.Method) realep).invoke(obj, args);
-    else
-      throw new IllegalAccessException(
-        "Un-reified org.apache.xml.utils.synthetic.Class doesn't yet support invocation");
-  }
-
-  /**
-   * Method setReturnType 
-   *
-   *
-   * @param returntype
-   *
-   * @throws SynthesisException
-   */
-  public void setReturnType(org.apache.xml.utils.synthetic.Class returntype)
-          throws SynthesisException
-  {
-
-    if (realep != null)
-      throw new SynthesisException(SynthesisException.REIFIED);
-
-    this.returntype = returntype;
-  }
-}
diff --git a/src/org/apache/xpath/Arg.java b/src/org/apache/xpath/Arg.java
deleted file mode 100644
index 918184a..0000000
--- a/src/org/apache/xpath/Arg.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import org.apache.xml.utils.QName;
-import org.apache.xpath.objects.XObject;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class holds an instance of an argument on
- * the stack. The value of the argument can be either an
- * XObject or a String containing an expression.
- */
-public class Arg
-{
-
-  /** Field m_qname: The name of this argument, expressed as a QName
-   * (Qualified Name) object.
-   * @see getQName
-   * @see setQName
-   *  */
-  private QName m_qname;
-
-  /**
-   * Get the qualified name for this argument.
-   *
-   * @return QName object containing the qualified name
-   */
-  public final QName getQName()
-  {
-    return m_qname;
-  }
-
-  /**
-   * Set the qualified name for this argument.
-   *
-   * @param name QName object representing the new Qualified Name.
-   */
-  public final void setQName(QName name)
-  {
-    m_qname = name;
-  }
-
-  /** Field m_val: Stored XObject value of this argument
-   * @see #getVal()
-   * @see #setVal()
-   */
-  private XObject m_val;
-
-  /**
-   * Get the value for this argument.
-   *
-   * @return the argument's stored XObject value.
-   * @see #setVal(XObject)
-   */
-  public final XObject getVal()
-  {
-    return m_val;
-  }
-
-  /**
-   * Set the value of this argument.
-   *
-   * @param val an XObject representing the arguments's value.
-   * @see #getVal()
-   */
-  public final void setVal(XObject val)
-  {
-    m_val = val;
-  }
-  
-  /**
-   * Have the object release it's resources.
-   * Call only when the variable or argument is going out of scope.
-   */
-  public void detach()
-  {
-    if(null != m_val)
-    {
-      m_val.allowDetachToRelease(true);
-      m_val.detach();
-    }
-  }
-
-
-  /** Field m_expression: Stored expression value of this argument.
-   * @see #setExpression
-   * @see #getExpression
-   * */
-  private String m_expression;
-
-  /**
-   * Get the value expression for this argument.
-   *
-   * @return String containing the expression previously stored into this
-   * argument
-   * @see #setExpression
-   */
-  public String getExpression()
-  {
-    return m_expression;
-  }
-
-  /**
-   * Set the value expression for this argument.
-   *
-   * @param expr String containing the expression to be stored as this
-   * argument's value.
-   * @see #getExpression
-   */
-  public void setExpression(String expr)
-  {
-    m_expression = expr;
-  }
-
-  /** 
-   * True if this variable was added with an xsl:with-param or
-   * is added via setParameter.
-   */
-  private boolean m_isFromWithParam;
-
-  /**
-   * Tell if this variable is a parameter passed with a with-param or as 
-   * a top-level parameter.
-   */
-   public boolean isFromWithParam()
-   {
-    return m_isFromWithParam;
-   }
-
-  /** 
-   * True if this variable is currently visible.  To be visible,
-   * a variable needs to come either from xsl:variable or be 
-   * a "received" parameter, ie one for which an xsl:param has
-   * been encountered.
-   * Set at the time the object is constructed and updated as needed.
-   */
-  private boolean m_isVisible;
-
-  /**
-   * Tell if this variable is currently visible.
-   */
-   public boolean isVisible()
-   {
-    return m_isVisible;
-   }
-   
-  /**
-   * Update visibility status of this variable.
-   */
-   public void setIsVisible(boolean b)
-   {
-    m_isVisible = b;
-   }
-
-  /**
-   * Construct a dummy parameter argument, with no QName and no
-   * value (either expression string or value XObject). isVisible
-   * defaults to true.
-   */
-  public Arg()
-  {
-
-    m_qname = new QName("");
-    ;  // so that string compares can be done.
-    m_val = null;
-    m_expression = null;
-    m_isVisible = true;
-    m_isFromWithParam = false;
-  }
-
-  /**
-   * Construct a parameter argument that contains an expression.
-   *
-   * @param qname Name of the argument, expressed as a QName object.
-   * @param expression String to be stored as this argument's value expression.
-   * @param isFromWithParam True if this is a parameter variable.
-   */
-  public Arg(QName qname, String expression, boolean isFromWithParam)
-  {
-
-    m_qname = qname;
-    m_val = null;
-    m_expression = expression;
-    m_isFromWithParam = isFromWithParam;
-    m_isVisible = !isFromWithParam;
-  }
-
-  /**
-   * Construct a parameter argument which has an XObject value.
-   * isVisible defaults to true.
-   *
-   * @param qname Name of the argument, expressed as a QName object.
-   * @param val Value of the argument, expressed as an XObject
-   */
-  public Arg(QName qname, XObject val)
-  {
-
-    m_qname = qname;
-    m_val = val;
-    m_isVisible = true;
-    m_isFromWithParam = false;
-    m_expression = null;
-  }
-  
-  /**
-   * Equality function specialized for the variable name.  If the argument 
-   * is not a qname, it will deligate to the super class.
-   * 
-   * @param   obj   the reference object with which to compare.
-   * @return  <code>true</code> if this object is the same as the obj
-   *          argument; <code>false</code> otherwise.
-   */
-  public boolean equals(Object obj) 
-  {
-    if(obj instanceof QName)
-    {
-      return m_qname.equals(obj);
-    }
-    else
-      return super.equals(obj);
-  }
-
-  /**
-   * Construct a parameter argument.
-   *
-   * @param qname Name of the argument, expressed as a QName object.
-   * @param val Value of the argument, expressed as an XObject
-   * @param isFromWithParam True if this is a parameter variable.
-   */
-  public Arg(QName qname, XObject val, boolean isFromWithParam)
-  {
-
-    m_qname = qname;
-    m_val = val;
-    m_isFromWithParam = isFromWithParam;
-    m_isVisible = !isFromWithParam;
-    m_expression = null;
-  }
-}
diff --git a/src/org/apache/xpath/DOM2Helper.java b/src/org/apache/xpath/DOM2Helper.java
deleted file mode 100644
index 29bd046..0000000
--- a/src/org/apache/xpath/DOM2Helper.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import java.io.IOException;
-
-import java.util.StringTokenizer;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.DOMHelper;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.w3c.dom.Attr;
-import org.xml.sax.InputSource;
-import org.xml.sax.Parser;
-
-import javax.xml.parsers.*;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * This class provides a DOM level 2 "helper", which provides services currently 
- * not provided be the DOM standard.
- */
-public class DOM2Helper extends DOMHelper
-{
-
-  /**
-   * Construct an instance.
-   */
-  public DOM2Helper(){}
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Check node to see if it was created by a DOM implementation
-   * that this helper is intended to support. This is currently
-   * disabled, and assumes all nodes are acceptable rather than checking
-   * that they implement org.apache.xerces.dom.NodeImpl.
-   *
-   * @param node The node to be tested.
-   *
-   * @throws TransformerException if the node is not one which this
-   * DOM2Helper can support. If we return without throwing the exception,
-   * the node is compatable.
-   */
-  public void checkNode(Node node) throws TransformerException
-  {
-
-    // if(!(node instanceof org.apache.xerces.dom.NodeImpl))
-    //  throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"DOM2Helper can not handle nodes of type"
-    //+((Object)node).getClass());
-  }
-
-  /**
-   * Returns true if the DOM implementation handled by this helper
-   * supports the SAX ContentHandler interface.
-   *
-   * @return true (since Xerces does).
-   */
-  public boolean supportsSAX()
-  {
-    return true;
-  }
-
-  /** Field m_doc: Document Node for the document this helper is currently
-   * accessing or building
-   * @see #setDocument
-   * @see #getDocument
-   *  */
-  private Document m_doc;
-
-  /**
-   * Specify which document this helper is currently operating on.
-   * 	
-   * @param doc The DOM Document node for this document.
-   * @see #getDocument
-   */
-  public void setDocument(Document doc)
-  {
-    m_doc = doc;
-  }
-
-  /**
-   * Query which document this helper is currently operating on.
-   * 	
-   * @return The DOM Document node for this document.
-   * @see #setDocument
-   */
-  public Document getDocument()
-  {
-    return m_doc;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Parse an XML document.
-   *
-   * <p>Right now the Xerces DOMParser class is used.  This needs
-   * fixing, either via jaxp, or via some other, standard method.</p>
-   *
-   * <p>The application can use this method to instruct the SAX parser
-   * to begin parsing an XML document from any valid input
-   * source (a character stream, a byte stream, or a URI).</p>
-   *
-   * <p>Applications may not invoke this method while a parse is in
-   * progress (they should create a new Parser instead for each
-   * additional XML document).  Once a parse is complete, an
-   * application may reuse the same Parser object, possibly with a
-   * different input source.</p>
-   *
-   * @param source The input source for the top-level of the
-   *        XML document.
-   *
-   * @throws TransformerException if any checked exception is thrown.
-   */
-  public void parse(InputSource source) throws TransformerException
-  {
-
-    try
-    {
-
-      // I guess I should use JAXP factory here... when it's legal.
-      // org.apache.xerces.parsers.DOMParser parser 
-      //  = new org.apache.xerces.parsers.DOMParser();
-      DocumentBuilderFactory builderFactory =
-        DocumentBuilderFactory.newInstance();
-
-      builderFactory.setNamespaceAware(true);
-      builderFactory.setValidating(true);
-
-      DocumentBuilder parser = builderFactory.newDocumentBuilder();
-
-      /*
-      // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true);
-      if(m_useDOM2getNamespaceURI)
-      {
-      parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
-      parser.setFeature("http://xml.org/sax/features/namespaces", true);
-      }
-      else
-      {
-      parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
-      }
-
-      parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true);
-      */
-
-      parser.setErrorHandler(
-        new org.apache.xml.utils.DefaultErrorHandler());
-
-      // if(null != m_entityResolver)
-      // {
-      // System.out.println("Setting the entity resolver.");
-      //  parser.setEntityResolver(m_entityResolver);
-      // }
-      setDocument(parser.parse(source));
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
-    }
-    catch (ParserConfigurationException pce)
-    {
-      throw new TransformerException(pce);
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerException(ioe);
-    }
-
-    // setDocument(((org.apache.xerces.parsers.DOMParser)parser).getDocument());
-  }
-
-  /**
-   * Given an XML ID, return the element. This requires assistance from the
-   * DOM and parser, and is meaningful only in the context of a DTD 
-   * or schema which declares attributes as being of type ID. This
-   * information may or may not be available in all parsers, may or
-   * may not be available for specific documents, and may or may not
-   * be available when validation is not turned on.
-   *
-   * @param id The ID to search for, as a String.
-   * @param doc The document to search within, as a DOM Document node.
-   * @return DOM Element node with an attribute of type ID whose value
-   * uniquely matches the requested id string, or null if there isn't
-   * such an element or if the DOM can't answer the question for other
-   * reasons.
-   */
-  public Element getElementByID(String id, Document doc)
-  {
-    return doc.getElementById(id);
-  }
-
-  /**
-   * Figure out whether node2 should be considered as being later
-   * in the document than node1, in Document Order as defined
-   * by the XPath model. This may not agree with the ordering defined
-   * by other XML applications.
-   * <p>
-   * There are some cases where ordering isn't defined, and neither are
-   * the results of this function -- though we'll generally return true.
-   * <p>
-   * TODO: Make sure this does the right thing with attribute nodes!!!
-   *
-   * @param node1 DOM Node to perform position comparison on.
-   * @param node2 DOM Node to perform position comparison on .
-   * 
-   * @return false if node2 comes before node1, otherwise return true.
-   * You can think of this as 
-   * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
-   */
-  public static boolean isNodeAfter(Node node1, Node node2)
-  {
-
-    // Assume first that the nodes are DTM nodes, since discovering node 
-    // order is massivly faster for the DTM.
-    if(node1 instanceof DOMOrder && node2 instanceof DOMOrder)
-    {
-      int index1 = ((DOMOrder) node1).getUid();
-      int index2 = ((DOMOrder) node2).getUid();
-
-      return index1 <= index2;
-    }
-    else
-    {
-
-      // isNodeAfter will return true if node is after countedNode 
-      // in document order. The base isNodeAfter is sloooow (relatively).
-      return DOMHelper.isNodeAfter(node1, node2);
-    }
-  }
-
-  /**
-   * Get the XPath-model parent of a node.  This version takes advantage
-   * of the DOM Level 2 Attr.ownerElement() method; the base version we
-   * would otherwise inherit is prepared to fall back on exhaustively
-   * walking the document to find an Attr's parent.
-   *
-   * @param node Node to be examined
-   *
-   * @return the DOM parent of the input node, if there is one, or the
-   * ownerElement if the input node is an Attr, or null if the node is
-   * a Document, a DocumentFragment, or an orphan.
-   */
-  public static Node getParentOfNode(Node node)
-  {
-          Node parent=node.getParentNode();
-          if(parent==null && (Node.ATTRIBUTE_NODE == node.getNodeType()) )
-           parent=((Attr) node).getOwnerElement();
-          return parent;
-  }
-
-  /**
-   * Returns the local name of the given node, as defined by the
-   * XML Namespaces specification. This is prepared to handle documents
-   * built using DOM Level 1 methods by falling back upon explicitly
-   * parsing the node name.
-   *
-   * @param n Node to be examined
-   *
-   * @return String containing the local name, or null if the node
-   * was not assigned a Namespace.
-   */
-  public String getLocalNameOfNode(Node n)
-  {
-
-    String name = n.getLocalName();
-
-    return (null == name) ? super.getLocalNameOfNode(n) : name;
-  }
-
-  /**
-   * Returns the Namespace Name (Namespace URI) for the given node.
-   * In a Level 2 DOM, you can ask the node itself. Note, however, that
-   * doing so conflicts with our decision in getLocalNameOfNode not
-   * to trust the that the DOM was indeed created using the Level 2
-   * methods. If Level 1 methods were used, these two functions will
-   * disagree with each other.
-   * <p>
-   * TODO: Reconcile with getLocalNameOfNode.
-   *
-   * @param n Node to be examined
-   *
-   * @return String containing the Namespace URI bound to this DOM node
-   * at the time the Node was created.
-   */
-  public String getNamespaceOfNode(Node n)
-  {
-    return n.getNamespaceURI();
-  }
-
-  /** Field m_useDOM2getNamespaceURI is a compile-time flag which
-   *  gates some of the parser options used to build a DOM -- but 
-   * that code is commented out at this time and nobody else
-   * references it, so I've commented this out as well. */
-  //private boolean m_useDOM2getNamespaceURI = false;
-}
diff --git a/src/org/apache/xpath/DOMHelper.java b/src/org/apache/xpath/DOMHelper.java
deleted file mode 100644
index ad5eb29..0000000
--- a/src/org/apache/xpath/DOMHelper.java
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.w3c.dom.*;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.NSInfo;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.StringBufferPool;
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-
-// Imported JAVA API for XML Parsing 1.0 classes
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * This class provides a front-end to DOM implementations, providing
- * a number of utility functions that either aren't yet standardized
- * by the DOM spec or that are defined in optional DOM modules and
- * hence may not be present in all DOMs.
- */
-public class DOMHelper
-{
-
-  /**
-   * DOM Level 1 did not have a standard mechanism for creating a new
-   * Document object. This function provides a DOM-implementation-independent
-   * abstraction for that for that concept. It's typically used when 
-   * outputting a new DOM as the result of an operation.
-   * <p>
-   * TODO: This isn't directly compatable with DOM Level 2. 
-   * The Level 2 createDocument call also creates the root 
-   * element, and thus requires that you know what that element will be
-   * before creating the Document. We should think about whether we want
-   * to change this code, and the callers, so we can use the DOM's own 
-   * method. (It's also possible that DOM Level 3 may relax this
-   * sequence, but you may give up some intelligence in the DOM by
-   * doing so; the intent was that knowing the document type and root
-   * element might let the DOM automatically switch to a specialized
-   * subclass for particular kinds of documents.)
-   *
-   * @return The newly created DOM Document object, with no children, or
-   * null if we can't find a DOM implementation that permits creating
-   * new empty Documents.
-   */
-  public static Document createDocument()
-  {
-
-    try
-    {
-
-      // Use an implementation of the JAVA API for XML Parsing 1.0 to
-      // create a DOM Document node to contain the result.
-      DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-
-      dfactory.setNamespaceAware(true);
-      dfactory.setValidating(true);
-
-      DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-      Document outNode = docBuilder.newDocument();
-
-      return outNode;
-    }
-    catch (ParserConfigurationException pce)
-    {
-      throw new RuntimeException(
-        XSLMessages.createXPATHMessage(
-          XPATHErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null));  //"createDocument() not supported in XPathContext!");
-
-      // return null;
-    }
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Tells, through the combination of the default-space attribute
-   * on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the
-   * xml:space attribute, whether or not extra whitespace should be stripped
-   * from the node.  Literal elements from template elements should
-   * <em>not</em> be tested with this function.
-   * @param textNode A text node from the source tree.
-   * @return true if the text node should be stripped of extra whitespace.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean shouldStripSourceNode(Node textNode)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // return (null == m_envSupport) ? false : m_envSupport.shouldStripSourceNode(textNode);
-    return false;
-  }
-
-  /**
-   * Supports the XPath function GenerateID by returning a unique
-   * identifier string for any given DOM Node.
-   * <p>
-   * Warning: The base implementation uses the Node object's hashCode(),
-   * which is NOT guaranteed to be unique. If that method hasn't been
-   * overridden in this DOM ipmlementation, most Java implementions will
-   * derive it from the object's address and should be OK... but if
-   * your DOM uses a different definition of hashCode (eg hashing the
-   * contents of the subtree), or if your DOM may have multiple objects
-   * that represent a single Node in the data structure (eg via proxying),
-   * you may need to find another way to assign a unique identifier.
-   * <p>
-   * Also, be aware that if nodes are destroyed and recreated, there is
-   * an open issue regarding whether an ID may be reused. Currently
-   * we're assuming that the input document is stable for the duration
-   * of the XPath/XSLT operation, so this shouldn't arise in this context.
-   * <p>
-   * (DOM Level 3 is investigating providing a unique node "key", but
-   * that won't help Level 1 and Level 2 implementations.)
-   *
-   * @param node whose identifier you want to obtain
-   *
-   * @return a string which should be different for every Node object.
-   */
-  public String getUniqueID(Node node)
-  {
-    return "N" + Integer.toHexString(node.hashCode()).toUpperCase();
-  }
-
-  /**
-   * Figure out whether node2 should be considered as being later
-   * in the document than node1, in Document Order as defined
-   * by the XPath model. This may not agree with the ordering defined
-   * by other XML applications.
-   * <p>
-   * There are some cases where ordering isn't defined, and neither are
-   * the results of this function -- though we'll generally return true.
-   * 
-   * TODO: Make sure this does the right thing with attribute nodes!!!
-   *
-   * @param node1 DOM Node to perform position comparison on.
-   * @param node2 DOM Node to perform position comparison on .
-   * 
-   * @return false if node2 comes before node1, otherwise return true.
-   * You can think of this as 
-   * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
-   */
-  public static boolean isNodeAfter(Node node1, Node node2)
-  {
-    if (node1 == node2)
-      return true;
-
-        // Default return value, if there is no defined ordering
-    boolean isNodeAfter = true;
-        
-    Node parent1 = getParentOfNode(node1);
-    Node parent2 = getParentOfNode(node2);
-
-    // Optimize for most common case
-    if (parent1 == parent2)  // then we know they are siblings
-    {
-      if (null != parent1)
-        isNodeAfter = isNodeAfterSibling(parent1, node1, node2);
-      else
-      {
-                  // If both parents are null, ordering is not defined.
-                  // We're returning a value in lieu of throwing an exception.
-                  // Not a case we expect to arise in XPath, but beware if you
-                  // try to reuse this method.
-                  
-                  // We can just fall through in this case, which allows us
-                  // to hit the debugging code at the end of the function.
-          //return isNodeAfter;
-      }
-    }
-    else
-    {
-
-      // General strategy: Figure out the lengths of the two 
-      // ancestor chains, reconcile the lengths, and look for
-          // the lowest common ancestor. If that ancestor is one of
-          // the nodes being compared, it comes before the other.
-      // Otherwise perform a sibling compare. 
-                //
-                // NOTE: If no common ancestor is found, ordering is undefined
-                // and we return the default value of isNodeAfter.
-                
-      // Count parents in each ancestor chain
-      int nParents1 = 2, nParents2 = 2;  // include node & parent obtained above
-
-      while (parent1 != null)
-      {
-        nParents1++;
-
-        parent1 = getParentOfNode(parent1);
-      }
-
-      while (parent2 != null)
-      {
-        nParents2++;
-
-        parent2 = getParentOfNode(parent2);
-      }
-
-          // Initially assume scan for common ancestor starts with
-          // the input nodes.
-      Node startNode1 = node1, startNode2 = node2;
-
-      // If one ancestor chain is longer, adjust its start point
-          // so we're comparing at the same depths
-      if (nParents1 < nParents2)
-      {
-        // Adjust startNode2 to depth of startNode1
-        int adjust = nParents2 - nParents1;
-
-        for (int i = 0; i < adjust; i++)
-        {
-          startNode2 = getParentOfNode(startNode2);
-        }
-      }
-      else if (nParents1 > nParents2)
-      {
-        // adjust startNode1 to depth of startNode2
-        int adjust = nParents1 - nParents2;
-
-        for (int i = 0; i < adjust; i++)
-        {
-          startNode1 = getParentOfNode(startNode1);
-        }
-      }
-
-      Node prevChild1 = null, prevChild2 = null;  // so we can "back up"
-
-      // Loop up the ancestor chain looking for common parent
-      while (null != startNode1)
-      {
-        if (startNode1 == startNode2)  // common parent?
-        {
-          if (null == prevChild1)  // first time in loop?
-          {
-
-            // Edge condition: one is the ancestor of the other.
-            isNodeAfter = (nParents1 < nParents2) ? true : false;
-
-            break;  // from while loop
-          }
-          else 
-          {
-                        // Compare ancestors below lowest-common as siblings
-            isNodeAfter = isNodeAfterSibling(startNode1, prevChild1,
-                                             prevChild2);
-
-            break;  // from while loop
-          }
-        }  // end if(startNode1 == startNode2)
-
-                // Move up one level and try again
-        prevChild1 = startNode1;
-        startNode1 = getParentOfNode(startNode1);
-        prevChild2 = startNode2;
-        startNode2 = getParentOfNode(startNode2);
-      }  // end while(parents exist to examine)
-    }  // end big else (not immediate siblings)
-        
-        // WARNING: The following diagnostic won't report the early
-        // "same node" case. Fix if/when needed.
-        
-    /* -- please do not remove... very useful for diagnostics --
-    System.out.println("node1 = "+node1.getNodeName()+"("+node1.getNodeType()+")"+
-    ", node2 = "+node2.getNodeName()
-    +"("+node2.getNodeType()+")"+
-    ", isNodeAfter = "+isNodeAfter); */
-    return isNodeAfter;
-  }  // end isNodeAfter(Node node1, Node node2)
-
-  /**
-   * Figure out if child2 is after child1 in document order.
-   * <p>
-   * Warning: Some aspects of "document order" are not well defined.
-   * For example, the order of attributes is considered
-   * meaningless in XML, and the order reported by our model will
-   * be consistant for a given invocation but may not 
-   * match that of either the source file or the serialized output.
-   * 
-   * @param parent Must be the parent of both child1 and child2.
-   * @param child1 Must be the child of parent and not equal to child2.
-   * @param child2 Must be the child of parent and not equal to child1.
-   * @return true if child 2 is after child1 in document order.
-   */
-  private static boolean isNodeAfterSibling(Node parent, Node child1,
-                                            Node child2)
-  {
-
-    boolean isNodeAfterSibling = false;
-    short child1type = child1.getNodeType();
-    short child2type = child2.getNodeType();
-
-    if ((Node.ATTRIBUTE_NODE != child1type)
-            && (Node.ATTRIBUTE_NODE == child2type))
-    {
-
-      // always sort attributes before non-attributes.
-      isNodeAfterSibling = false;
-    }
-    else if ((Node.ATTRIBUTE_NODE == child1type)
-             && (Node.ATTRIBUTE_NODE != child2type))
-    {
-
-      // always sort attributes before non-attributes.
-      isNodeAfterSibling = true;
-    }
-    else if (Node.ATTRIBUTE_NODE == child1type)
-    {
-      NamedNodeMap children = parent.getAttributes();
-      int nNodes = children.getLength();
-      boolean found1 = false, found2 = false;
-
-          // Count from the start until we find one or the other.
-      for (int i = 0; i < nNodes; i++)
-      {
-        Node child = children.item(i);
-
-        if (child1 == child)
-        {
-          if (found2)
-          {
-            isNodeAfterSibling = false;
-
-            break;
-          }
-
-          found1 = true;
-        }
-        else if (child2 == child)
-        {
-          if (found1)
-          {
-            isNodeAfterSibling = true;
-
-            break;
-          }
-
-          found2 = true;
-        }
-      }
-    }
-    else
-    {
-                // TODO: Check performance of alternate solution:
-                // There are two choices here: Count from the start of
-                // the document until we find one or the other, or count
-                // from one until we find or fail to find the other.
-                // Either can wind up scanning all the siblings in the worst
-                // case, which on a wide document can be a lot of work but
-                // is more typically is a short list. 
-                // Scanning from the start involves two tests per iteration,
-                // but it isn't clear that scanning from the middle doesn't
-                // yield more iterations on average. 
-                // We should run some testcases.
-      Node child = parent.getFirstChild();
-      boolean found1 = false, found2 = false;
-
-      while (null != child)
-      {
-
-        // Node child = children.item(i);
-        if (child1 == child)
-        {
-          if (found2)
-          {
-            isNodeAfterSibling = false;
-
-            break;
-          }
-
-          found1 = true;
-        }
-        else if (child2 == child)
-        {
-          if (found1)
-          {
-            isNodeAfterSibling = true;
-
-            break;
-          }
-
-          found2 = true;
-        }
-
-        child = child.getNextSibling();
-      }
-    }
-
-    return isNodeAfterSibling;
-  }  // end isNodeAfterSibling(Node parent, Node child1, Node child2)
-
-  //==========================================================
-  // SECTION: Namespace resolution
-  //==========================================================
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the depth level of this node in the tree (equals 1 for
-   * a parentless node).
-   *
-   * @param n Node to be examined.
-   * @return the number of ancestors, plus one
-   */
-  public short getLevel(Node n)
-  {
-
-    short level = 1;
-
-    while (null != (n = getParentOfNode(n)))
-    {
-      level++;
-    }
-
-    return level;
-  }
-
-  /**
-   * Given an XML Namespace prefix and a context in which the prefix
-   * is to be evaluated, return the Namespace Name this prefix was 
-   * bound to. Note that DOM Level 3 is expected to provide a version of
-   * this which deals with the DOM's "early binding" behavior.
-   * 
-   * Default handling:
-   *
-   * @param prefix String containing namespace prefix to be resolved, 
-   * without the ':' which separates it from the localname when used 
-   * in a Node Name. The empty sting signifies the default namespace
-   * at this point in the document.
-   * @param namespaceContext Element which provides context for resolution.
-   * (We could extend this to work for other nodes by first seeking their
-   * nearest Element ancestor.)
-   *
-   * @return a String containing the Namespace URI which this prefix
-   * represents in the specified context.
-   */
-  public String getNamespaceForPrefix(String prefix, Element namespaceContext)
-  {
-
-    int type;
-    Node parent = namespaceContext;
-    String namespace = null;
-
-    if (prefix.equals("xml"))
-    {
-      namespace = QName.S_XMLNAMESPACEURI; // Hardcoded, per Namespace spec
-    }
-        else if(prefix.equals("xmlns"))
-    {
-          // Hardcoded in the DOM spec, expected to be adopted by
-          // Namespace spec. NOTE: Namespace declarations _must_ use
-          // the xmlns: prefix; other prefixes declared as belonging
-          // to this namespace will not be recognized and should
-          // probably be rejected by parsers as erroneous declarations.
-      namespace = "http://www.w3.org/2000/xmlns/"; 
-    }
-    else
-    {
-          // Attribute name for this prefix's declaration
-          String declname=(prefix=="")
-                        ? "xmlns"
-                        : "xmlns:"+prefix;
-                                           
-          // Scan until we run out of Elements or have resolved the namespace
-      while ((null != parent) && (null == namespace)
-             && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
-                 || (type == Node.ENTITY_REFERENCE_NODE)))
-      {
-        if (type == Node.ELEMENT_NODE)
-        {
-                        
-                        // Look for the appropriate Namespace Declaration attribute,
-                        // either "xmlns:prefix" or (if prefix is "") "xmlns".
-                        // TODO: This does not handle "implicit declarations"
-                        // which may be created when the DOM is edited. DOM Level
-                        // 3 will define how those should be interpreted. But
-                        // this issue won't arise in freshly-parsed DOMs.
-                        
-                // NOTE: declname is set earlier, outside the loop.
-                        Attr attr=((Element)parent).getAttributeNode(declname);
-                        if(attr!=null)
-                        {
-                namespace = attr.getNodeValue();
-                break;
-                        }
-                }
-
-        parent = getParentOfNode(parent);
-      }
-    }
-
-    return namespace;
-  }
-
-  /**
-   * An experiment for the moment.
-   */
-  Hashtable m_NSInfos = new Hashtable();
-
-  /** Object to put into the m_NSInfos table that tells that a node has not been 
-   *  processed, but has xmlns namespace decls.  */
-  protected static final NSInfo m_NSInfoUnProcWithXMLNS = new NSInfo(false,
-                                                            true);
-
-  /** Object to put into the m_NSInfos table that tells that a node has not been 
-   *  processed, but has no xmlns namespace decls.  */
-  protected static final NSInfo m_NSInfoUnProcWithoutXMLNS = new NSInfo(false,
-                                                               false);
-
-  /** Object to put into the m_NSInfos table that tells that a node has not been 
-   *  processed, and has no xmlns namespace decls, and has no ancestor decls.  */
-  protected static final NSInfo m_NSInfoUnProcNoAncestorXMLNS =
-    new NSInfo(false, false, NSInfo.ANCESTORNOXMLNS);
-
-  /** Object to put into the m_NSInfos table that tells that a node has been 
-   *  processed, and has xmlns namespace decls.  */
-  protected static final NSInfo m_NSInfoNullWithXMLNS = new NSInfo(true,
-                                                          true);
-
-  /** Object to put into the m_NSInfos table that tells that a node has been 
-   *  processed, and has no xmlns namespace decls.  */
-  protected static final NSInfo m_NSInfoNullWithoutXMLNS = new NSInfo(true,
-                                                             false);
-
-  /** Object to put into the m_NSInfos table that tells that a node has been 
-   *  processed, and has no xmlns namespace decls. and has no ancestor decls.  */
-  protected static final NSInfo m_NSInfoNullNoAncestorXMLNS =
-    new NSInfo(true, false, NSInfo.ANCESTORNOXMLNS);
-
-  /** Vector of node (odd indexes) and NSInfos (even indexes) that tell if 
-   *  the given node is a candidate for ancestor namespace processing.  */
-  protected Vector m_candidateNoAncestorXMLNS = new Vector();
-
-  /**
-   * Returns the namespace of the given node. Differs from simply getting
-   * the node's prefix and using getNamespaceForPrefix in that it attempts
-   * to cache some of the data in NSINFO objects, to avoid repeated lookup.
-   * TODO: Should we consider moving that logic into getNamespaceForPrefix?
-   *
-   * @param n Node to be examined.
-   *
-   * @return String containing the Namespace Name (uri) for this node.
-   * Note that this is undefined for any nodes other than Elements and
-   * Attributes.
-   */
-  public String getNamespaceOfNode(Node n)
-  {
-
-    String namespaceOfPrefix;
-    boolean hasProcessedNS;
-    NSInfo nsInfo;
-    short ntype = n.getNodeType();
-
-    if (Node.ATTRIBUTE_NODE != ntype)
-    {
-      Object nsObj = m_NSInfos.get(n);  // return value
-
-      nsInfo = (nsObj == null) ? null : (NSInfo) nsObj;
-      hasProcessedNS = (nsInfo == null) ? false : nsInfo.m_hasProcessedNS;
-    }
-    else
-    {
-      hasProcessedNS = false;
-      nsInfo = null;
-    }
-
-    if (hasProcessedNS)
-    {
-      namespaceOfPrefix = nsInfo.m_namespace;
-    }
-    else
-    {
-      namespaceOfPrefix = null;
-
-      String nodeName = n.getNodeName();
-      int indexOfNSSep = nodeName.indexOf(':');
-      String prefix;
-
-      if (Node.ATTRIBUTE_NODE == ntype)
-      {
-        if (indexOfNSSep > 0)
-        {
-          prefix = nodeName.substring(0, indexOfNSSep);
-        }
-        else
-        {
-
-          // Attributes don't use the default namespace, so if 
-          // there isn't a prefix, we're done.
-          return namespaceOfPrefix;
-        }
-      }
-      else
-      {
-        prefix = (indexOfNSSep >= 0)
-                 ? nodeName.substring(0, indexOfNSSep) : "";
-      }
-
-      boolean ancestorsHaveXMLNS = false;
-      boolean nHasXMLNS = false;
-
-      if (prefix.equals("xml"))
-      {
-        namespaceOfPrefix = QName.S_XMLNAMESPACEURI;
-      }
-      else
-      {
-        int parentType;
-        Node parent = n;
-
-        while ((null != parent) && (null == namespaceOfPrefix))
-        {
-          if ((null != nsInfo)
-                  && (nsInfo.m_ancestorHasXMLNSAttrs
-                      == nsInfo.ANCESTORNOXMLNS))
-          {
-            break;
-          }
-
-          parentType = parent.getNodeType();
-
-          if ((null == nsInfo) || nsInfo.m_hasXMLNSAttrs)
-          {
-            boolean elementHasXMLNS = false;
-
-            if (parentType == Node.ELEMENT_NODE)
-            {
-              NamedNodeMap nnm = parent.getAttributes();
-
-              for (int i = 0; i < nnm.getLength(); i++)
-              {
-                Node attr = nnm.item(i);
-                String aname = attr.getNodeName();
-
-                if (aname.charAt(0) == 'x')
-                {
-                  boolean isPrefix = aname.startsWith("xmlns:");
-
-                  if (aname.equals("xmlns") || isPrefix)
-                  {
-                    if (n == parent)
-                      nHasXMLNS = true;
-
-                    elementHasXMLNS = true;
-                    ancestorsHaveXMLNS = true;
-
-                    String p = isPrefix ? aname.substring(6) : "";
-
-                    if (p.equals(prefix))
-                    {
-                      namespaceOfPrefix = attr.getNodeValue();
-
-                      break;
-                    }
-                  }
-                }
-              }
-            }
-
-            if ((Node.ATTRIBUTE_NODE != parentType) && (null == nsInfo)
-                    && (n != parent))
-            {
-              nsInfo = elementHasXMLNS
-                       ? m_NSInfoUnProcWithXMLNS : m_NSInfoUnProcWithoutXMLNS;
-
-              m_NSInfos.put(parent, nsInfo);
-            }
-          }
-
-          if (Node.ATTRIBUTE_NODE == parentType)
-          {
-            parent = getParentOfNode(parent);
-          }
-          else
-          {
-            m_candidateNoAncestorXMLNS.addElement(parent);
-            m_candidateNoAncestorXMLNS.addElement(nsInfo);
-
-            parent = parent.getParentNode();
-          }
-
-          if (null != parent)
-          {
-            Object nsObj = m_NSInfos.get(parent);  // return value
-
-            nsInfo = (nsObj == null) ? null : (NSInfo) nsObj;
-          }
-        }
-
-        int nCandidates = m_candidateNoAncestorXMLNS.size();
-
-        if (nCandidates > 0)
-        {
-          if ((false == ancestorsHaveXMLNS) && (null == parent))
-          {
-            for (int i = 0; i < nCandidates; i += 2)
-            {
-              Object candidateInfo = m_candidateNoAncestorXMLNS.elementAt(i
-                                       + 1);
-
-              if (candidateInfo == m_NSInfoUnProcWithoutXMLNS)
-              {
-                m_NSInfos.put(m_candidateNoAncestorXMLNS.elementAt(i),
-                              m_NSInfoUnProcNoAncestorXMLNS);
-              }
-              else if (candidateInfo == m_NSInfoNullWithoutXMLNS)
-              {
-                m_NSInfos.put(m_candidateNoAncestorXMLNS.elementAt(i),
-                              m_NSInfoNullNoAncestorXMLNS);
-              }
-            }
-          }
-
-          m_candidateNoAncestorXMLNS.removeAllElements();
-        }
-      }
-
-      if (Node.ATTRIBUTE_NODE != ntype)
-      {
-        if (null == namespaceOfPrefix)
-        {
-          if (ancestorsHaveXMLNS)
-          {
-            if (nHasXMLNS)
-              m_NSInfos.put(n, m_NSInfoNullWithXMLNS);
-            else
-              m_NSInfos.put(n, m_NSInfoNullWithoutXMLNS);
-          }
-          else
-          {
-            m_NSInfos.put(n, m_NSInfoNullNoAncestorXMLNS);
-          }
-        }
-        else
-        {
-          m_NSInfos.put(n, new NSInfo(namespaceOfPrefix, nHasXMLNS));
-        }
-      }
-    }
-
-    return namespaceOfPrefix;
-  }
-
-  /**
-   * Returns the local name of the given node. If the node's name begins
-   * with a namespace prefix, this is the part after the colon; otherwise
-   * it's the full node name.
-   *
-   * @param n the node to be examined.
-   *
-   * @return String containing the Local Name
-   */
-  public String getLocalNameOfNode(Node n)
-  {
-
-    String qname = n.getNodeName();
-    int index = qname.indexOf(':');
-
-    return (index < 0) ? qname : qname.substring(index + 1);
-  }
-
-  /**
-   * Returns the element name with the namespace prefix (if any) replaced
-   * by the Namespace URI it was bound to. This is not a standard 
-   * representation of a node name, but it allows convenient 
-   * single-string comparison of the "universal" names of two nodes.
-   *
-   * @param elem Element to be examined.
-   *
-   * @return String in the form "namespaceURI:localname" if the node
-   * belongs to a namespace, or simply "localname" if it doesn't.
-   * @see #getExpandedAttributeName
-   */
-  public String getExpandedElementName(Element elem)
-  {
-
-    String namespace = getNamespaceOfNode(elem);
-
-    return (null != namespace)
-           ? namespace + ":" + getLocalNameOfNode(elem)
-           : getLocalNameOfNode(elem);
-  }
-
-  /**
-   * Returns the attribute name with the namespace prefix (if any) replaced
-   * by the Namespace URI it was bound to. This is not a standard 
-   * representation of a node name, but it allows convenient 
-   * single-string comparison of the "universal" names of two nodes.
-   *
-   * @param attr Attr to be examined
-   *
-   * @return String in the form "namespaceURI:localname" if the node
-   * belongs to a namespace, or simply "localname" if it doesn't.
-   * @see #getExpandedElementName
-   */
-  public String getExpandedAttributeName(Attr attr)
-  {
-
-    String namespace = getNamespaceOfNode(attr);
-
-    return (null != namespace)
-           ? namespace + ":" + getLocalNameOfNode(attr)
-           : getLocalNameOfNode(attr);
-  }
-
-  //==========================================================
-  // SECTION: DOM Helper Functions
-  //==========================================================
-
-  /**
-   * Tell if the node is ignorable whitespace. Note that this can
-   * be determined only in the context of a DTD or other Schema,
-   * and that DOM Level 2 has nostandardized DOM API which can
-   * return that information.
-   * @deprecated
-   *
-   * @param node Node to be examined
-   *
-   * @return CURRENTLY HARDCODED TO FALSE, but should return true if
-   * and only if the node is of type Text, contains only whitespace,
-   * and does not appear as part of the #PCDATA content of an element.
-   * (Note that determining this last may require allowing for 
-   * Entity References.)
-   */
-  public boolean isIgnorableWhitespace(Text node)
-  {
-
-    boolean isIgnorable = false;  // return value
-
-    // TODO: I can probably do something to figure out if this 
-    // space is ignorable from just the information in
-    // the DOM tree.
-        // -- You need to be able to distinguish whitespace
-        // that is #PCDATA from whitespace that isn't.  That requires
-        // DTD support, which won't be standardized until DOM Level 3.
-    return isIgnorable;
-  }
-
-  /**
-   * Get the first unparented node in the ancestor chain.
-   * @deprecated
-   *
-   * @param node Starting node, to specify which chain to chase
-   *
-   * @return the topmost ancestor.
-   */
-  public Node getRoot(Node node)
-  {
-
-    Node root = null;
-
-    while (node != null)
-    {
-      root = node;
-      node = getParentOfNode(node);
-    }
-
-    return root;
-  }
-
-  /**
-   * Get the root node of the document tree, regardless of
-   * whether or not the node passed in is a document node.
-   * <p>
-   * TODO: This doesn't handle DocumentFragments or "orphaned" subtrees
-   * -- it's currently returning ownerDocument even when the tree is
-   * not actually part of the main Document tree. We should either
-   * rewrite the description to say that it finds the Document node,
-   * or change the code to walk up the ancestor chain.
-
-   *
-   * @param n Node to be examined
-   *
-   * @return the Document node. Note that this is not the correct answer
-   * if n was (or was a child of) a DocumentFragment or an orphaned node,
-   * as can arise if the DOM has been edited rather than being generated
-   * by a parser.
-   */
-  public Node getRootNode(Node n)
-  {
-    int nt = n.getNodeType();
-    return ( (Node.DOCUMENT_NODE == nt) || (Node.DOCUMENT_FRAGMENT_NODE == nt) ) 
-           ? n : n.getOwnerDocument();
-  }
-
-  /**
-   * Test whether the given node is a namespace decl node. In DOM Level 2
-   * this can be done in a namespace-aware manner, but in Level 1 DOMs
-   * it has to be done by testing the node name.
-   *
-   * @param n Node to be examined.
-   *
-   * @return boolean -- true iff the node is an Attr whose name is 
-   * "xmlns" or has the "xmlns:" prefix.
-   */
-  public boolean isNamespaceNode(Node n)
-  {
-
-    if (Node.ATTRIBUTE_NODE == n.getNodeType())
-    {
-      String attrName = n.getNodeName();
-
-      return (attrName.startsWith("xmlns:") || attrName.equals("xmlns"));
-    }
-
-    return false;
-  }
-
-  /**
-   * Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
-   * parent for other nodes. 
-   * <p>
-   * Background: The DOM believes that you must be your Parent's
-   * Child, and thus Attrs don't have parents. XPath said that Attrs
-   * do have their owning Element as their parent. This function
-   * bridges the difference, either by using the DOM Level 2 ownerElement
-   * function or by using a "silly and expensive function" in Level 1
-   * DOMs.
-   * <p>
-   * (There's some discussion of future DOMs generalizing ownerElement 
-   * into ownerNode and making it work on all types of nodes. This
-   * still wouldn't help the users of Level 1 or Level 2 DOMs)
-   * <p>
-   *
-   * @param node Node whose XPath parent we want to obtain
-   *
-   * @return the parent of the node, or the ownerElement if it's an
-   * Attr node, or null if the node is an orphan.
-   *
-   * @throws RuntimeException if the Document has no root element.
-   * This can't arise if the Document was created
-   * via the DOM Level 2 factory methods, but is possible if other
-   * mechanisms were used to obtain it
-   */
-  public static Node getParentOfNode(Node node) throws RuntimeException
-  {
-    Node parent;
-    short nodeType = node.getNodeType();
-
-    if (Node.ATTRIBUTE_NODE == nodeType)
-    {
-      Document doc = node.getOwnerDocument();
-          /*
-      TBD:
-      if(null == doc)
-      {
-        throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!");
-      }
-      */
-
-          // Given how expensive the tree walk may be, we should first ask 
-          // whether this DOM can answer the question for us. The additional
-          // test does slow down Level 1 DOMs slightly. DOMHelper2, which
-          // is currently specialized for Xerces, assumes it can use the
-          // Level 2 solution. We might want to have an intermediate stage,
-          // which would assume DOM Level 2 but not assume Xerces.
-          //
-          // (Shouldn't have to check whether impl is null in a compliant DOM,
-          // but let's be paranoid for a moment...)
-          DOMImplementation impl=doc.getImplementation();
-          if(impl!=null && impl.hasFeature("Core","2.0"))
-          {
-                  parent=((Attr)node).getOwnerElement();
-                  return parent;
-          }
-
-          // DOM Level 1 solution, as fallback. Hugely expensive. 
-
-      Element rootElem = doc.getDocumentElement();
-
-      if (null == rootElem)
-      {
-        throw new RuntimeException(
-          XSLMessages.createXPATHMessage(
-            XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
-            null));  //"Attribute child does not have an owner document element!");
-      }
-
-      parent = locateAttrParent(rootElem, node);
-
-        }
-    else
-    {
-      parent = node.getParentNode();
-
-      // if((Node.DOCUMENT_NODE != nodeType) && (null == parent))
-      // {
-      //   throw new RuntimeException("Child does not have parent!");
-      // }
-    }
-
-    return parent;
-  }
-
-  /**
-   * Given an ID, return the element. This can work only if the document
-   * is interpreted in the context of a DTD or Schema, since otherwise
-   * we don't know which attributes are or aren't IDs.
-   * <p>
-   * Note that DOM Level 1 had no ability to retrieve this information.
-   * DOM Level 2 introduced it but does not promise that it will be
-   * supported in all DOMs; those which can't support it will always
-   * return null.
-   * <p>
-   * TODO: getElementByID is currently unimplemented. Support DOM Level 2?
-   *
-   * @param id The unique identifier to be searched for.
-   * @param doc The document to search within.
-   * @return CURRENTLY HARDCODED TO NULL, but it should be:
-   * The node which has this unique identifier, or null if there
-   * is no such node or this DOM can't reliably recognize it.
-   */
-  public Element getElementByID(String id, Document doc)
-  {
-    return null;
-  }
-
-  /**
-   * The getUnparsedEntityURI function returns the URI of the unparsed
-   * entity with the specified name in the same document as the context
-   * node (see [3.3 Unparsed Entities]). It returns the empty string if
-   * there is no such entity.
-   * <p>
-   * XML processors may choose to use the System Identifier (if one
-   * is provided) to resolve the entity, rather than the URI in the
-   * Public Identifier. The details are dependent on the processor, and
-   * we would have to support some form of plug-in resolver to handle
-   * this properly. Currently, we simply return the System Identifier if
-   * present, and hope that it a usable URI or that our caller can
-   * map it to one.
-   * TODO: Resolve Public Identifiers... or consider changing function name.
-   * <p>
-   * If we find a relative URI 
-   * reference, XML expects it to be resolved in terms of the base URI 
-   * of the document. The DOM doesn't do that for us, and it isn't 
-   * entirely clear whether that should be done here; currently that's
-   * pushed up to a higher levelof our application. (Note that DOM Level 
-   * 1 didn't store the document's base URI.)
-   * TODO: Consider resolving Relative URIs.
-   * <p>
-   * (The DOM's statement that "An XML processor may choose to
-   * completely expand entities before the structure model is passed
-   * to the DOM" refers only to parsed entities, not unparsed, and hence
-   * doesn't affect this function.)
-   *
-   * @param name A string containing the Entity Name of the unparsed
-   * entity.
-   * @param doc Document node for the document to be searched.
-   *
-   * @return String containing the URI of the Unparsed Entity, or an
-   * empty string if no such entity exists.
-   */
-  public String getUnparsedEntityURI(String name, Document doc)
-  {
-
-    String url = "";
-    DocumentType doctype = doc.getDoctype();
-
-    if (null != doctype)
-    {
-      NamedNodeMap entities = doctype.getEntities();
-      if(null == entities)
-        return url;
-      Entity entity = (Entity) entities.getNamedItem(name);
-      if(null == entity)
-        return url;
-      
-      String notationName = entity.getNotationName();
-
-      if (null != notationName)  // then it's unparsed
-      {
-        // The draft says: "The XSLT processor may use the public 
-        // identifier to generate a URI for the entity instead of the URI 
-        // specified in the system identifier. If the XSLT processor does 
-        // not use the public identifier to generate the URI, it must use 
-        // the system identifier; if the system identifier is a relative 
-        // URI, it must be resolved into an absolute URI using the URI of 
-        // the resource containing the entity declaration as the base 
-        // URI [RFC2396]."
-        // So I'm falling a bit short here.
-        url = entity.getSystemId();
-
-        if (null == url)
-        {
-          url = entity.getPublicId();
-        }
-        else
-        {
-          // This should be resolved to an absolute URL, but that's hard 
-          // to do from here.
-        }        
-      }
-    }
-
-    return url;
-  }
-
-  /**
-   * Support for getParentOfNode; walks a DOM tree until it finds
-   * the Element which owns the Attr. This is hugely expensive, and
-   * if at all possible you should use the DOM Level 2 Attr.ownerElement()
-   * method instead.
-   *  <p>
-   * The DOM Level 1 developers expected that folks would keep track
-   * of the last Element they'd seen and could recover the info from
-   * that source. Obviously that doesn't work very well if the only
-   * information you've been presented with is the Attr. The DOM Level 2
-   * getOwnerElement() method fixes that, but only for Level 2 and
-   * later DOMs.
-   *
-   * @param elem Element whose subtree is to be searched for this Attr
-   * @param attr Attr whose owner is to be located.
-   *
-   * @return the first Element whose attribute list includes the provided
-   * attr. In modern DOMs, this will also be the only such Element. (Early
-   * DOMs had some hope that Attrs might be sharable, but this idea has
-   * been abandoned.)
-   */
-  private static Node locateAttrParent(Element elem, Node attr)
-  {
-
-    Node parent = null;
-
-        // This should only be called for Level 1 DOMs, so we don't have to
-        // worry about namespace issues. In later levels, it's possible
-        // for a DOM to have two Attrs with the same NodeName but
-        // different namespaces, and we'd need to get getAttributeNodeNS...
-        // but later levels also have Attr.getOwnerElement.
-        Attr check=elem.getAttributeNode(attr.getNodeName());
-        if(check==attr)
-                parent = elem;
-
-    if (null == parent)
-    {
-      for (Node node = elem.getFirstChild(); null != node;
-              node = node.getNextSibling())
-      {
-        if (Node.ELEMENT_NODE == node.getNodeType())
-        {
-          parent = locateAttrParent((Element) node, attr);
-
-          if (null != parent)
-            break;
-        }
-      }
-    }
-
-    return parent;
-  }
-
-  /**
-   * The factory object used for creating nodes
-   * in the result tree.
-   */
-  protected Document m_DOMFactory = null;
-
-  /**
-   * Store the factory object required to create DOM nodes
-   * in the result tree. In fact, that's just the result tree's
-   * Document node...
-   *
-   * @param domFactory The DOM Document Node within whose context
-   * the result tree will be built.
-   */
-  public void setDOMFactory(Document domFactory)
-  {
-    this.m_DOMFactory = domFactory;
-  }
-
-  /**
-   * Retrieve the factory object required to create DOM nodes
-   * in the result tree.
-   *
-   * @return The result tree's DOM Document Node.
-   */
-  public Document getDOMFactory()
-  {
-
-    if (null == this.m_DOMFactory)
-    {
-      this.m_DOMFactory = createDocument();
-    }
-
-    return this.m_DOMFactory;
-  }
-
-  /**
-   * Get the textual contents of the node. See
-   * getNodeData(Node,FastStringBuffer) for discussion of how
-   * whitespace nodes are handled.
-   *
-   * @param node DOM Node to be examined
-   * @return String containing a concatenation of all the 
-   * textual content within that node. 
-   * @see #getNodeData(Node,FastStringBuffer)
-   * 
-   */
-  public static String getNodeData(Node node)
-  {
-
-    FastStringBuffer buf = StringBufferPool.get();
-    String s;
-
-    try
-    {
-      getNodeData(node, buf);
-
-      s = (buf.length() > 0) ? buf.toString() : "";
-    }
-    finally
-    {
-      StringBufferPool.free(buf);
-    }
-
-    return s;
-  }
-
-  /**
-   * Retrieve the text content of a DOM subtree, appending it into a
-   * user-supplied FastStringBuffer object. Note that attributes are
-   * not considered part of the content of an element.
-   * <p>
-   * There are open questions regarding whitespace stripping. 
-   * Currently we make no special effort in that regard, since the standard
-   * DOM doesn't yet provide DTD-based information to distinguish
-   * whitespace-in-element-context from genuine #PCDATA. Note that we
-   * should probably also consider xml:space if/when we address this.
-   * DOM Level 3 may solve the problem for us.
-   *
-   * @param node Node whose subtree is to be walked, gathering the
-   * contents of all Text or CDATASection nodes.
-   * @param buf FastStringBuffer into which the contents of the text
-   * nodes are to be concatenated.
-   */
-  public static void getNodeData(Node node, FastStringBuffer buf)
-  {
-
-    switch (node.getNodeType())
-    {
-    case Node.DOCUMENT_FRAGMENT_NODE :
-    case Node.DOCUMENT_NODE :
-    case Node.ELEMENT_NODE :
-    {
-      for (Node child = node.getFirstChild(); null != child;
-              child = child.getNextSibling())
-      {
-        getNodeData(child, buf);
-      }
-    }
-    break;
-    case Node.TEXT_NODE :
-    case Node.CDATA_SECTION_NODE :
-      buf.append(node.getNodeValue());
-      break;
-    case Node.ATTRIBUTE_NODE :
-      buf.append(node.getNodeValue());
-      break;
-    case Node.PROCESSING_INSTRUCTION_NODE :
-      // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);        
-      break;
-    default :
-      // ignore
-      break;
-    }
-  }
-}
diff --git a/src/org/apache/xpath/DOMOrder.java b/src/org/apache/xpath/DOMOrder.java
deleted file mode 100644
index 6bd8328..0000000
--- a/src/org/apache/xpath/DOMOrder.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * Nodes that implement this index can return a document order index.
- * Eventually, this will be replaced by DOM 3 methods. 
- * (compareDocumentOrder and/or compareTreePosition.)
- */
-public interface DOMOrder
-{
-
-  /**
-   * Get the UID (document order index).
-   *
-   * @return integer whose relative value corresponds to document order
-   * -- that is, if node1.getUid()<node2.getUid(), node1 comes before
-   * node2, and if they're equal node1 and node2 are the same node. No
-   * promises are made beyond that.
-   */
-  public int getUid();
-}
diff --git a/src/org/apache/xpath/Expression.java b/src/org/apache/xpath/Expression.java
deleted file mode 100644
index 21ab37e..0000000
--- a/src/org/apache/xpath/Expression.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-//import org.w3c.dom.Node;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.ErrorListener;
-
-/**
- * This abstract class serves as the base for all expression objects.  An
- * Expression can be executed to return a {@link org.apache.xpath.objects.XObject},
- * normally has a location within a document or DOM, can send error and warning
- * events, and normally do not hold state and are meant to be immutable once
- * construction has completed.  An exception to the immutibility rule is iterators
- * and walkers, which must be cloned in order to be used -- the original must
- * still be immutable.
- */
-public abstract class Expression implements java.io.Serializable
-{
-
-  /**
-   * The location where this expression was built from.  Need for diagnostic
-   *  messages. May be null.
-   *  @serial
-   */
-  protected SourceLocator m_slocator;
-
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-    return false;
-  }
-
-  /**
-   * Set the location where this expression was built from.
-   *
-   *
-   * @param locator the location where this expression was built from, may be
-   *                null.
-   */
-  public void setSourceLocator(SourceLocator locator)
-  {
-    m_slocator = locator;
-  }
-
-  /**
-   * Execute an expression in the XPath runtime context, and return the
-   * result of the expression.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   * @param currentNode The currentNode.
-   *
-   * @return The result of the expression in the form of a <code>XObject</code>.
-   *
-   * @throws javax.xml.transform.TransformerException if a runtime exception
-   *         occurs.
-   */
-  public XObject execute(XPathContext xctxt, int currentNode)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // For now, the current node is already pushed.
-    return execute(xctxt);
-  }
-
-  /**
-   * Execute an expression in the XPath runtime context, and return the
-   * result of the expression.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   * @param currentNode The currentNode.
-   * @param dtm The DTM of the current node.
-   * @param expType The expanded type ID of the current node.
-   *
-   * @return The result of the expression in the form of a <code>XObject</code>.
-   *
-   * @throws javax.xml.transform.TransformerException if a runtime exception
-   *         occurs.
-   */
-  public XObject execute(
-          XPathContext xctxt, int currentNode, DTM dtm, int expType)
-            throws javax.xml.transform.TransformerException
-  {
-
-    // For now, the current node is already pushed.
-    return execute(xctxt);
-  }
-
-  /**
-   * Execute an expression in the XPath runtime context, and return the
-   * result of the expression.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return The result of the expression in the form of a <code>XObject</code>.
-   *
-   * @throws javax.xml.transform.TransformerException if a runtime exception
-   *         occurs.
-   */
-  public abstract XObject execute(XPathContext xctxt)
-    throws javax.xml.transform.TransformerException;
-
-  /**
-   * Evaluate expression to a number.
-   *
-   *
-   * NEEDSDOC @param xctxt
-   * @return 0.0
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return execute(xctxt).num();
-  }
-
-  /**
-   * Evaluate expression to a boolean.
-   *
-   *
-   * NEEDSDOC @param xctxt
-   * @return false
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return execute(xctxt).bool();
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   *
-   * NEEDSDOC @param xctxt
-   * @return The string this wraps or the empty string if null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XMLString xstr(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return execute(xctxt).xstr();
-  }
-
-  /**
-   * Tell if the expression is a nodeset expression.  In other words, tell
-   * if you can execute {@link asNode() asNode} without an exception.
-   * @return true if the expression can be represented as a nodeset.
-   */
-  public boolean isNodesetExpr()
-  {
-    return false;
-  }
-
-  /**
-   * Return the first node out of the nodeset, if this expression is
-   * a nodeset expression.
-   * @param xctxt The XPath runtime context.
-   * @return the first node out of the nodeset, or DTM.NULL.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public int asNode(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return execute(xctxt).iter().nextNode();
-  }
-
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Given an select expression and a context, evaluate the XPath
-   * and return the resulting iterator.
-   *
-   * @param xctxt The execution context.
-   * @param contextNode The node that "." expresses.
-   *
-   *
-   * NEEDSDOC ($objectName$) @return
-   * @throws TransformerException thrown if the active ProblemListener decides
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public DTMIterator asIterator(XPathContext xctxt, int contextNode)
-          throws javax.xml.transform.TransformerException
-  {
-
-    try
-    {
-      xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
-      return execute(xctxt).iter();
-    }
-    finally
-    {
-      xctxt.popCurrentNodeAndExpression();
-    }
-  }
-
-  /**
-   * Execute an expression in the XPath runtime context, and return the
-   * result of the expression.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   * NEEDSDOC @param handler
-   *
-   * @return The result of the expression in the form of a <code>XObject</code>.
-   *
-   * @throws javax.xml.transform.TransformerException if a runtime exception
-   *         occurs.
-   * @throws org.xml.sax.SAXException
-   */
-  public void executeCharsToContentHandler(
-          XPathContext xctxt, ContentHandler handler)
-            throws javax.xml.transform.TransformerException,
-                   org.xml.sax.SAXException
-  {
-
-    XObject obj = execute(xctxt);
-
-    obj.dispatchCharactersEvents(handler);
-  }
-
-  /**
-   * Tell if this expression returns a stable number that will not change during 
-   * iterations within the expression.  This is used to determine if a proximity 
-   * position predicate can indicate that no more searching has to occur.
-   * 
-   *
-   * @return true if the expression represents a stable number.
-   */
-  public boolean isStableNumber()
-  {
-    return false;
-  }
-
-  /**
-   * This function is used to fixup variables from QNames to stack frame
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list
-   * should be searched backwards for the first qualified name that
-   * corresponds to the variable reference qname.  The position of the
-   * QName in the vector from the start of the vector will be its position
-   * in the stack frame (but variables above the globalsTop value will need
-   * to be offset to the current stack frame).
-   * NEEDSDOC @param globalsSize
-   */
-  public abstract void fixupVariables(java.util.Vector vars, int globalsSize);
-
-  /**
-   * Warn the user of an problem.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param msg An error number that corresponds to one of the numbers found
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to
-   *                              throw an exception.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void warn(XPathContext xctxt, int msg, Object[] args)
-          throws javax.xml.transform.TransformerException
-  {
-
-    java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args);
-
-    if (null != xctxt)
-    {
-      ErrorListener eh = xctxt.getErrorListener();
-
-      // TO DO: Need to get stylesheet Locator from here.
-      eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator()));
-    }
-  }
-
-  /**
-   * Tell the user of an assertion error, and probably throw an
-   * exception.
-   *
-   * @param b  If false, a runtime exception will be thrown.
-   * @param msg The assertion message, which should be informative.
-   *
-   * @throws RuntimeException if the b argument is false.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void assertion(boolean b, java.lang.String msg)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (!b)
-    {
-      java.lang.String fMsg = XSLMessages.createXPATHMessage(
-        XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
-        new Object[]{ msg });
-
-      throw new RuntimeException(fMsg);
-    }
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param msg An error number that corresponds to one of the numbers found
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to
-   *                              throw an exception.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void error(XPathContext xctxt, int msg, Object[] args)
-          throws javax.xml.transform.TransformerException
-  {
-
-    java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args);
-
-    if (null != xctxt)
-    {
-      ErrorListener eh = xctxt.getErrorListener();
-      TransformerException te = new TransformerException(fmsg, m_slocator);
-
-      eh.fatalError(te);
-    }
-  }
-}
diff --git a/src/org/apache/xpath/FoundIndex.java b/src/org/apache/xpath/FoundIndex.java
deleted file mode 100644
index 9588150..0000000
--- a/src/org/apache/xpath/FoundIndex.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class to let us know when it's time to do
- * a search from the parent because of indexing.
- */
-public class FoundIndex extends RuntimeException
-{
-
-  /**
-   * Constructor FoundIndex
-   *
-   */
-  public FoundIndex(){}
-}
diff --git a/src/org/apache/xpath/NodeSet.java b/src/org/apache/xpath/NodeSet.java
deleted file mode 100644
index 66dbcab..0000000
--- a/src/org/apache/xpath/NodeSet.java
+++ /dev/null
@@ -1,1409 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.DOMException;
-
-import org.apache.xml.utils.NodeVector;
-import org.apache.xpath.axes.ContextNodeList;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * <meta name="usage" content="advanced"/>
- * <p>The NodeSet class can act as either a NodeVector,
- * NodeList, or NodeIterator.  However, in order for it to
- * act as a NodeVector or NodeList, it's required that
- * setShouldCacheNodes(true) be called before the first
- * nextNode() is called, in order that nodes can be added
- * as they are fetched.  Derived classes that implement iterators
- * must override runTo(int index), in order that they may
- * run the iteration to the given index. </p>
- * 
- * <p>Note that we directly implement the DOM's NodeIterator
- * interface. We do not emulate all the behavior of the
- * standard NodeIterator. In particular, we do not guarantee
- * to present a "live view" of the document ... but in XSLT,
- * the source document should never be mutated, so this should
- * never be an issue.</p>
- * 
- * <p>Thought: Should NodeSet really implement NodeList and NodeIterator,
- * or should there be specific subclasses of it which do so? The
- * advantage of doing it all here is that all NodeSets will respond
- * to the same calls; the disadvantage is that some of them may return
- * less-than-enlightening results when you do so.</p>
- */
-public class NodeSet
-        implements NodeList, NodeIterator, Cloneable, ContextNodeList
-{
-
-  /**
-   * Create an empty nodelist.
-   */
-  public NodeSet()
-  {
-    m_blocksize = 32;
-    m_mapSize = 0;
-  }
-
-  /**
-   * Create an empty, using the given block size.
-   *
-   * @param blocksize Size of blocks to allocate 
-   */
-  public NodeSet(int blocksize)
-  {
-    m_blocksize = blocksize;
-    m_mapSize = 0;
-  }
-
-  /**
-   * Create a NodeSet, and copy the members of the
-   * given nodelist into it.
-   *
-   * @param nodelist List of Nodes to be made members of the new set.
-   */
-  public NodeSet(NodeList nodelist)
-  {
-
-    this(32);
-
-    addNodes(nodelist);
-  }
-
-  /**
-   * Create a NodeSet, and copy the members of the
-   * given NodeSet into it.
-   *
-   * @param nodelist Set of Nodes to be made members of the new set.
-   */
-  public NodeSet(NodeSet nodelist)
-  {
-
-    this(32);
-
-    addNodes((NodeIterator) nodelist);
-  }
-
-  /**
-   * Create a NodeSet, and copy the members of the
-   * given NodeIterator into it.
-   *
-   * @param ni Iterator which yields Nodes to be made members of the new set.
-   */
-  public NodeSet(NodeIterator ni)
-  {
-
-    this(32);
-
-    addNodes(ni);
-  }
-
-  /**
-   * Create a NodeSet which contains the given Node.
-   *
-   * @param node Single node to be added to the new set.
-   */
-  public NodeSet(Node node)
-  {
-
-    this(32);
-
-    addNode(node);
-  }
-
-  /**
-   * @return The root node of the Iterator, as specified when it was created.
-   * For non-Iterator NodeSets, this will be null.
-   */
-  public Node getRoot()
-  {
-    return null;
-  }
-
-  /**
-   * Get a cloned Iterator, and reset its state to the beginning of the
-   * iteration.
-   *
-   * @return a new NodeSet of the same type, having the same state...
-   * except that the reset() operation has been called.
-   *
-   * @throws CloneNotSupportedException if this subclass of NodeSet
-   * does not support the clone() operation.
-   */
-  public NodeIterator cloneWithReset() throws CloneNotSupportedException
-  {
-
-    NodeSet clone = (NodeSet) clone();
-
-    clone.reset();
-
-    return clone;
-  }
-
-  /**
-   * Reset the iterator. May have no effect on non-iterator Nodesets.
-   */
-  public void reset()
-  {
-    m_next = 0;
-  }
-
-  /**
-   *  This attribute determines which node types are presented via the
-   * iterator. The available set of constants is defined in the
-   * <code>NodeFilter</code> interface. For NodeSets, the mask has been
-   * hardcoded to show all nodes except EntityReference nodes, which have
-   * no equivalent in the XPath data model.
-   *
-   * @return integer used as a bit-array, containing flags defined in
-   * the DOM's NodeFilter class. The value will be 
-   * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
-   * only entity references are suppressed.
-   */
-  public int getWhatToShow()
-  {
-    return NodeFilter.SHOW_ALL & ~NodeFilter.SHOW_ENTITY_REFERENCE;
-  }
-
-  /**
-   * The filter object used to screen nodes. Filters are applied to
-   * further reduce (and restructure) the NodeIterator's view of the
-   * document. In our case, we will be using hardcoded filters built
-   * into our iterators... but getFilter() is part of the DOM's 
-   * NodeIterator interface, so we have to support it.
-   *
-   * @return null, which is slightly misleading. True, there is no
-   * user-written filter object, but in fact we are doing some very
-   * sophisticated custom filtering. A DOM purist might suggest
-   * returning a placeholder object just to indicate that this is
-   * not going to return all nodes selected by whatToShow.
-   */
-  public NodeFilter getFilter()
-  {
-    return null;
-  }
-
-  /**
-   *  The value of this flag determines whether the children of entity
-   * reference nodes are visible to the iterator. If false, they will be
-   * skipped over.
-   * <br> To produce a view of the document that has entity references
-   * expanded and does not expose the entity reference node itself, use the
-   * whatToShow flags to hide the entity reference node and set
-   * expandEntityReferences to true when creating the iterator. To produce
-   * a view of the document that has entity reference nodes but no entity
-   * expansion, use the whatToShow flags to show the entity reference node
-   * and set expandEntityReferences to false.
-   *
-   * @return true for all iterators based on NodeSet, meaning that the
-   * contents of EntityRefrence nodes may be returned (though whatToShow
-   * says that the EntityReferences themselves are not shown.)
-   */
-  public boolean getExpandEntityReferences()
-  {
-    return true;
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   * @throws DOMException
-   *    INVALID_STATE_ERR: Raised if this method is called after the
-   *   <code>detach</code> method was invoked.
-   */
-  public Node nextNode() throws DOMException
-  {
-
-    if ((m_next) < this.size())
-    {
-      Node next = this.elementAt(m_next);
-
-      m_next++;
-
-      return next;
-    }
-    else
-      return null;
-  }
-
-  /**
-   *  Returns the previous node in the set and moves the position of the
-   * iterator backwards in the set.
-   * @return  The previous <code>Node</code> in the set being iterated over,
-   *   or<code>null</code> if there are no more members in that set.
-   * @throws DOMException
-   *    INVALID_STATE_ERR: Raised if this method is called after the
-   *   <code>detach</code> method was invoked.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a cached type, and hence doesn't know what the previous node was.
-   */
-  public Node previousNode() throws DOMException
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSet can not iterate to a previous node!");
-
-    if ((m_next - 1) > 0)
-    {
-      m_next--;
-
-      return this.elementAt(m_next);
-    }
-    else
-      return null;
-  }
-
-  /**
-   * Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   * <p>
-   * This operation is a no-op in NodeSet, and will not cause 
-   * INVALID_STATE_ERR to be raised by later operations.
-   * </p>
-   */
-  public void detach(){}
-
-  /**
-   * Tells if this NodeSet is "fresh", in other words, if
-   * the first nextNode() that is called will return the
-   * first node in the set.
-   *
-   * @return true if nextNode() would return the first node in the set,
-   * false if it would return a later one.
-   */
-  public boolean isFresh()
-  {
-    return (m_next == 0);
-  }
-
-  /**
-   * If an index is requested, NodeSet will call this method
-   * to run the iterator to the index.  By default this sets
-   * m_next to the index.  If the index argument is -1, this
-   * signals that the iterator should be run to the end.
-   *
-   * @param index Position to advance (or retreat) to, with
-   * 0 requesting the reset ("fresh") position and -1 (or indeed
-   * any out-of-bounds value) requesting the final position.
-   * @throws RuntimeException thrown if this NodeSet is not
-   * one of the types which supports indexing/counting.
-   */
-  public void runTo(int index)
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSet can not do indexing or counting functions!");
-
-    if ((index >= 0) && (m_next < m_firstFree))
-      m_next = index;
-    else
-      m_next = m_firstFree - 1;
-  }
-
-  /**
-   * Returns the <code>index</code>th item in the collection. If
-   * <code>index</code> is greater than or equal to the number of nodes in
-   * the list, this returns <code>null</code>.
-   * 
-   * TODO: What happens if index is out of range?
-   * 
-   * @param index Index into the collection.
-   * @return The node at the <code>index</code>th position in the
-   *   <code>NodeList</code>, or <code>null</code> if that is not a valid
-   *   index.
-   */
-  public Node item(int index)
-  {
-
-    runTo(index);
-
-    return (Node) this.elementAt(index);
-  }
-
-  /**
-   * The number of nodes in the list. The range of valid child node indices is
-   * 0 to <code>length-1</code> inclusive. Note that this operation requires
-   * finding all the matching nodes, which may defeat attempts to defer
-   * that work.
-   *
-   * @return integer indicating how many nodes are represented by this list.
-   */
-  public int getLength()
-  {
-
-    runTo(-1);
-
-    return this.size();
-  }
-
-  /**
-   * Add a node to the NodeSet. Not all types of NodeSets support this
-   * operation
-   *
-   * @param n Node to be added
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void addNode(Node n)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    this.addElement(n);
-  }
-
-  /**
-   * Insert a node at a given position.
-   *
-   * @param n Node to be added
-   * @param pos Offset at which the node is to be inserted,
-   * with 0 being the first position.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void insertNode(Node n, int pos)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    insertElementAt(n, pos);
-  }
-
-  /**
-   * Remove a node.
-   *
-   * @param n Node to be added
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void removeNode(Node n)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    this.removeElement(n);
-  }
-
-  /**
-   * Copy NodeList members into this nodelist, adding in
-   * document order.  If a node is null, don't add it.
-   *
-   * @param nodelist List of nodes which should now be referenced by
-   * this NodeSet.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void addNodes(NodeList nodelist)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    if (null != nodelist)  // defensive to fix a bug that Sanjiva reported.
-    {
-      int nChildren = nodelist.getLength();
-
-      for (int i = 0; i < nChildren; i++)
-      {
-        Node obj = nodelist.item(i);
-
-        if (null != obj)
-        {
-          addElement(obj);
-        }
-      }
-    }
-
-    // checkDups();
-  }
-
-  /**
-   * <p>Copy NodeList members into this nodelist, adding in
-   * document order.  Only genuine node references will be copied;
-   * nulls appearing in the source NodeSet will
-   * not be added to this one. </p>
-   * 
-   * <p> In case you're wondering why this function is needed: NodeSet
-   * implements both NodeIterator and NodeList. If this method isn't
-   * provided, Java can't decide which of those to use when addNodes()
-   * is invoked. Providing the more-explicit match avoids that
-   * ambiguity.)</p>
-   *
-   * @param ns NodeSet whose members should be merged into this NodeSet.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void addNodes(NodeSet ns)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    addNodes((NodeIterator) ns);
-  }
-
-  /**
-   * Copy NodeList members into this nodelist, adding in
-   * document order.  Null references are not added.
-   *
-   * @param iterator NodeIterator which yields the nodes to be added.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void addNodes(NodeIterator iterator)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    if (null != iterator)  // defensive to fix a bug that Sanjiva reported.
-    {
-      Node obj;
-
-      while (null != (obj = iterator.nextNode()))
-      {
-        addElement(obj);
-      }
-    }
-
-    // checkDups();
-  }
-
-  /**
-   * Copy NodeList members into this nodelist, adding in
-   * document order.  If a node is null, don't add it.
-   *
-   * @param nodelist List of nodes to be added
-   * @param support The XPath runtime context.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    int nChildren = nodelist.getLength();
-
-    for (int i = 0; i < nChildren; i++)
-    {
-      Node node = nodelist.item(i);
-
-      if (null != node)
-      {
-        addNodeInDocOrder(node, support);
-      }
-    }
-  }
-
-  /**
-   * Copy NodeList members into this nodelist, adding in
-   * document order.  If a node is null, don't add it.
-   *
-   * @param iterator NodeIterator which yields the nodes to be added.
-   * @param support The XPath runtime context.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public void addNodesInDocOrder(NodeIterator iterator, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    Node node;
-
-    while (null != (node = iterator.nextNode()))
-    {
-      addNodeInDocOrder(node, support);
-    }
-  }
-
-  /**
-   * Add the node list to this node set in document order.
-   *
-   * @param start index.
-   * @param end index.
-   * @param testIndex index.
-   * @param nodelist The nodelist to add.
-   * @param support The XPath runtime context.
-   *
-   * @return false always.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  private boolean addNodesInDocOrder(int start, int end, int testIndex,
-                                     NodeList nodelist, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    boolean foundit = false;
-    int i;
-    Node node = nodelist.item(testIndex);
-
-    for (i = end; i >= start; i--)
-    {
-      Node child = (Node) elementAt(i);
-
-      if (child == node)
-      {
-        i = -2;  // Duplicate, suppress insert
-
-        break;
-      }
-
-      if (!DOM2Helper.isNodeAfter(node, child))
-      {
-        insertElementAt(node, i + 1);
-
-        testIndex--;
-
-        if (testIndex > 0)
-        {
-          boolean foundPrev = addNodesInDocOrder(0, i, testIndex, nodelist,
-                                                 support);
-
-          if (!foundPrev)
-          {
-            addNodesInDocOrder(i, size() - 1, testIndex, nodelist, support);
-          }
-        }
-
-        break;
-      }
-    }
-
-    if (i == -1)
-    {
-      insertElementAt(node, 0);
-    }
-
-    return foundit;
-  }
-
-  /**
-   * Add the node into a vector of nodes where it should occur in
-   * document order.
-   * @param v Vector of nodes, presumably containing Nodes
-   * @param obj Node object.
-   *
-   * @param node The node to be added.
-   * @param test true if we should test for doc order
-   * @param support The XPath runtime context.
-   * @return insertIndex.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public int addNodeInDocOrder(Node node, boolean test, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    int insertIndex = -1;
-
-    if (test)
-    {
-
-      // This needs to do a binary search, but a binary search 
-      // is somewhat tough because the sequence test involves 
-      // two nodes.
-      int size = size(), i;
-
-      for (i = size - 1; i >= 0; i--)
-      {
-        Node child = (Node) elementAt(i);
-
-        if (child == node)
-        {
-          i = -2;  // Duplicate, suppress insert
-
-          break;
-        }
-
-        if (!DOM2Helper.isNodeAfter(node, child))
-        {
-          break;
-        }
-      }
-
-      if (i != -2)
-      {
-        insertIndex = i + 1;
-
-        insertElementAt(node, insertIndex);
-      }
-    }
-    else
-    {
-      insertIndex = this.size();
-
-      boolean foundit = false;
-
-      for (int i = 0; i < insertIndex; i++)
-      {
-        if (this.item(i).equals(node))
-        {
-          foundit = true;
-
-          break;
-        }
-      }
-
-      if (!foundit)
-        addElement(node);
-    }
-
-    // checkDups();
-    return insertIndex;
-  }  // end addNodeInDocOrder(Vector v, Object obj)
-
-  /**
-   * Add the node into a vector of nodes where it should occur in
-   * document order.
-   * @param v Vector of nodes, presumably containing Nodes
-   * @param obj Node object.
-   *
-   * @param node The node to be added.
-   * @param support The XPath runtime context.
-   *
-   * @return The index where it was inserted.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a mutable type.
-   */
-  public int addNodeInDocOrder(Node node, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    return addNodeInDocOrder(node, true, support);
-  }  // end addNodeInDocOrder(Vector v, Object obj)
-
-
-  /** If this node is being used as an iterator, the next index that nextNode()
-   *  will return.  */
-  transient protected int m_next = 0;
-
-  /**
-   * Get the current position, which is one less than
-   * the next nextNode() call will retrieve.  i.e. if
-   * you call getCurrentPos() and the return is 0, the next
-   * fetch will take place at index 1.
-   *
-   * @return The the current position index.
-   */
-  public int getCurrentPos()
-  {
-    return m_next;
-  }
-
-  /**
-   * Set the current position in the node set.
-   * @param i Must be a valid index.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a cached type, and thus doesn't permit indexed access.
-   */
-  public void setCurrentPos(int i)
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSet can not do indexing or counting functions!");
-
-    m_next = i;
-  }
-
-  /**
-   * Return the last fetched node.  Needed to support the UnionPathIterator.
-   *
-   * @return the last fetched node.
-   * @throws RuntimeException thrown if this NodeSet is not of 
-   * a cached type, and thus doesn't permit indexed access.
-   */
-  public Node getCurrentNode()
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSet can not do indexing or counting functions!");
-
-    int saved = m_next;
-    Node n = (m_next < m_firstFree) ? elementAt(m_next) : null;
-    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
-    return n;
-  }
-
-  /** True if this list can be mutated.  */
-  transient protected boolean m_mutable = true;
-
-  /** True if this list is cached.
-   *  @serial  */
-  transient protected boolean m_cacheNodes = true;
-
-  /**
-   * Get whether or not this is a cached node set.
-   *
-   *
-   * @return True if this list is cached.
-   */
-  public boolean getShouldCacheNodes()
-  {
-    return m_cacheNodes;
-  }
-
-  /**
-   * If setShouldCacheNodes(true) is called, then nodes will
-   * be cached.  They are not cached by default. This switch must
-   * be set before the first call to nextNode is made, to ensure
-   * that all nodes are cached.
-   *
-   * @param b true if this node set should be cached.
-   * @throws RuntimeException thrown if an attempt is made to
-   * request caching after we've already begun stepping through the
-   * nodes in this set.
-  */
-  public void setShouldCacheNodes(boolean b)
-  {
-
-    if (!isFresh())
-      throw new RuntimeException(
-        "Can not call setShouldCacheNodes after nextNode has been called!");
-
-    m_cacheNodes = b;
-    m_mutable = true;
-  }
-  
-  
-  transient private int m_last = 0;
-  
-  public int getLast()
-  {
-    return m_last;
-  }
-  
-  public void setLast(int last)
-  {
-    m_last = last;
-  }
-  
-  /** Size of blocks to allocate.
-   *  @serial          */
-  private int m_blocksize;
-
-  /** Array of nodes this points to.
-   *  @serial          */
-  Node m_map[];
-
-  /** Number of nodes in this NodeVector.
-   *  @serial          */
-  protected int m_firstFree = 0;
-
-  /** Size of the array this points to.
-   *  @serial           */
-  private int m_mapSize;  // lazy initialization
-
-  /**
-   * Get a cloned LocPathIterator.
-   *
-   * @return A clone of this
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    NodeSet clone = (NodeSet) super.clone();
-
-    if ((null != this.m_map) && (this.m_map == clone.m_map))
-    {
-      clone.m_map = new Node[this.m_map.length];
-
-      System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length);
-    }
-
-    return clone;
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return Number of nodes in this NodeVector
-   */
-  public int size()
-  {
-    return m_firstFree;
-  }
-
-  /**
-   * Append a Node onto the vector.
-   *
-   * @param value Node to add to the vector
-   */
-  public void addElement(Node value)
-  {
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    if ((m_firstFree + 1) >= m_mapSize)
-    {
-      if (null == m_map)
-      {
-        m_map = new Node[m_blocksize];
-        m_mapSize = m_blocksize;
-      }
-      else
-      {
-        m_mapSize += m_blocksize;
-
-        Node newMap[] = new Node[m_mapSize];
-
-        System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-        m_map = newMap;
-      }
-    }
-
-    m_map[m_firstFree] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Append a Node onto the vector.
-   *
-   * @param value Node to add to the vector
-   */
-  public final void push(Node value)
-  {
-
-    int ff = m_firstFree;
-
-    if ((ff + 1) >= m_mapSize)
-    {
-      if (null == m_map)
-      {
-        m_map = new Node[m_blocksize];
-        m_mapSize = m_blocksize;
-      }
-      else
-      {
-        m_mapSize += m_blocksize;
-
-        Node newMap[] = new Node[m_mapSize];
-
-        System.arraycopy(m_map, 0, newMap, 0, ff + 1);
-
-        m_map = newMap;
-      }
-    }
-
-    m_map[ff] = value;
-
-    ff++;
-
-    m_firstFree = ff;
-  }
-
-  /**
-   * Pop a node from the tail of the vector and return the result.
-   *
-   * @return the node at the tail of the vector
-   */
-  public final Node pop()
-  {
-
-    m_firstFree--;
-
-    Node n = m_map[m_firstFree];
-
-    m_map[m_firstFree] = null;
-
-    return n;
-  }
-
-  /**
-   * Pop a node from the tail of the vector and return the
-   * top of the stack after the pop.
-   *
-   * @return The top of the stack after it's been popped 
-   */
-  public final Node popAndTop()
-  {
-
-    m_firstFree--;
-
-    m_map[m_firstFree] = null;
-
-    return (m_firstFree == 0) ? null : m_map[m_firstFree - 1];
-  }
-
-  /**
-   * Pop a node from the tail of the vector.
-   */
-  public final void popQuick()
-  {
-
-    m_firstFree--;
-
-    m_map[m_firstFree] = null;
-  }
-
-  /**
-   * Return the node at the top of the stack without popping the stack.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @return Node at the top of the stack or null if stack is empty.  
-   */
-  public final Node peepOrNull()
-  {
-    return ((null != m_map) && (m_firstFree > 0))
-           ? m_map[m_firstFree - 1] : null;
-  }
-
-  /**
-   * Push a pair of nodes into the stack.  
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @param v1 First node to add to vector
-   * @param v2 Second node to add to vector
-   */
-  public final void pushPair(Node v1, Node v2)
-  {
-
-    if (null == m_map)
-    {
-      m_map = new Node[m_blocksize];
-      m_mapSize = m_blocksize;
-    }
-    else
-    {
-      if ((m_firstFree + 2) >= m_mapSize)
-      {
-        m_mapSize += m_blocksize;
-
-        Node newMap[] = new Node[m_mapSize];
-
-        System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
-
-        m_map = newMap;
-      }
-    }
-
-    m_map[m_firstFree] = v1;
-    m_map[m_firstFree + 1] = v2;
-    m_firstFree += 2;
-  }
-
-  /**
-   * Pop a pair of nodes from the tail of the stack. 
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   */
-  public final void popPair()
-  {
-
-    m_firstFree -= 2;
-    m_map[m_firstFree] = null;
-    m_map[m_firstFree + 1] = null;
-  }
-
-  /**
-   * Set the tail of the stack to the given node.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @param n Node to set at the tail of vector
-   */
-  public final void setTail(Node n)
-  {
-    m_map[m_firstFree - 1] = n;
-  }
-
-  /**
-   * Set the given node one position from the tail.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @param n Node to set
-   */
-  public final void setTailSub1(Node n)
-  {
-    m_map[m_firstFree - 2] = n;
-  }
-
-  /**
-   * Return the node at the tail of the vector without popping
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @return Node at the tail of the vector
-   */
-  public final Node peepTail()
-  {
-    return m_map[m_firstFree - 1];
-  }
-
-  /**
-   * Return the node one position from the tail without popping.
-   * Special purpose method for TransformerImpl, pushElemTemplateElement.
-   * Performance critical.
-   *
-   * @return Node one away from the tail
-   */
-  public final Node peepTailSub1()
-  {
-    return m_map[m_firstFree - 2];
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   *
-   * @param value Node to insert
-   * @param at Position where to insert
-   */
-  public void insertElementAt(Node value, int at)
-  {
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    if (null == m_map)
-    {
-      m_map = new Node[m_blocksize];
-      m_mapSize = m_blocksize;
-    }
-    else if ((m_firstFree + 1) >= m_mapSize)
-    {
-      m_mapSize += m_blocksize;
-
-      Node newMap[] = new Node[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
-      m_map = newMap;
-    }
-
-    if (at <= (m_firstFree - 1))
-    {
-      System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
-    }
-
-    m_map[at] = value;
-
-    m_firstFree++;
-  }
-
-  /**
-   * Append the nodes to the list.
-   *
-   * @param nodes NodeVector to append to this list
-   */
-  public void appendNodes(NodeSet nodes)
-  {
-
-    int nNodes = nodes.size();
-
-    if (null == m_map)
-    {
-      m_mapSize = nNodes + m_blocksize;
-      m_map = new Node[m_mapSize];
-    }
-    else if ((m_firstFree + nNodes) >= m_mapSize)
-    {
-      m_mapSize += (nNodes + m_blocksize);
-
-      Node newMap[] = new Node[m_mapSize];
-
-      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + nNodes);
-
-      m_map = newMap;
-    }
-
-    System.arraycopy(nodes.m_map, 0, m_map, m_firstFree, nNodes);
-
-    m_firstFree += nNodes;
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   */
-  public void removeAllElements()
-  {
-
-    if (null == m_map)
-      return;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      m_map[i] = null;
-    }
-
-    m_firstFree = 0;
-  }
-
-  /**
-   * Removes the first occurrence of the argument from this vector.
-   * If the object is found in this vector, each component in the vector
-   * with an index greater or equal to the object's index is shifted
-   * downward to have an index one smaller than the value it had
-   * previously.
-   *
-   * @param s Node to remove from the list
-   *
-   * @return True if the node was successfully removed
-   */
-  public boolean removeElement(Node s)
-  {
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    if (null == m_map)
-      return false;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      Node node = m_map[i];
-
-      if ((null != node) && node.equals(s))
-      {
-        if (i > m_firstFree)
-          System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
-        else
-          m_map[i] = null;
-
-        m_firstFree--;
-
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  /**
-   * Deletes the component at the specified index. Each component in
-   * this vector with an index greater or equal to the specified
-   * index is shifted downward to have an index one smaller than
-   * the value it had previously.
-   *
-   * @param i Index of node to remove
-   */
-  public void removeElementAt(int i)
-  {
-
-    if (null == m_map)
-      return;
-
-    if (i > m_firstFree)
-      System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
-    else
-      m_map[i] = null;
-  }
-
-  /**
-   * Sets the component at the specified index of this vector to be the
-   * specified object. The previous component at that position is discarded.
-   *
-   * The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.
-   *
-   * @param node Node to set
-   * @param index Index of where to set the node
-   */
-  public void setElementAt(Node node, int index)
-  {
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
-    if (null == m_map)
-    {
-      m_map = new Node[m_blocksize];
-      m_mapSize = m_blocksize;
-    }
-
-    m_map[index] = node;
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i Index of node to get
-   *
-   * @return Node at specified index
-   */
-  public Node elementAt(int i)
-  {
-
-    if (null == m_map)
-      return null;
-
-    return m_map[i];
-  }
-
-  /**
-   * Tell if the table contains the given node.
-   *
-   * @param s Node to look for
-   *
-   * @return True if the given node was found.
-   */
-  public boolean contains(Node s)
-  {
-    runTo(-1);
-
-    if (null == m_map)
-      return false;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      Node node = m_map[i];
-
-      if ((null != node) && node.equals(s))
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Node to look for
-   * @param index Index of where to start the search
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(Node elem, int index)
-  {
-    runTo(-1);
-
-    if (null == m_map)
-      return -1;
-
-    for (int i = index; i < m_firstFree; i++)
-    {
-      Node node = m_map[i];
-
-      if ((null != node) && node.equals(elem))
-        return i;
-    }
-
-    return -1;
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Node to look for 
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(Node elem)
-  {
-    runTo(-1);
-
-    if (null == m_map)
-      return -1;
-
-    for (int i = 0; i < m_firstFree; i++)
-    {
-      Node node = m_map[i];
-
-      if ((null != node) && node.equals(elem))
-        return i;
-    }
-
-    return -1;
-  }
-
-}
diff --git a/src/org/apache/xpath/NodeSetDTM.java b/src/org/apache/xpath/NodeSetDTM.java
deleted file mode 100644
index b8e624e..0000000
--- a/src/org/apache/xpath/NodeSetDTM.java
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-//import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.traversal.NodeIterator;
-//import org.w3c.dom.traversal.NodeFilter;
-//import org.w3c.dom.DOMException;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMManager;
-
-import org.apache.xml.utils.NodeVector;
-import org.apache.xpath.axes.ContextNodeList;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-/**
- * <meta name="usage" content="advanced"/>
- * <p>The NodeSetDTM class can act as either a NodeVector,
- * NodeList, or NodeIterator.  However, in order for it to
- * act as a NodeVector or NodeList, it's required that
- * setShouldCacheNodes(true) be called before the first
- * nextNode() is called, in order that nodes can be added
- * as they are fetched.  Derived classes that implement iterators
- * must override runTo(int index), in order that they may
- * run the iteration to the given index. </p>
- * 
- * <p>Note that we directly implement the DOM's NodeIterator
- * interface. We do not emulate all the behavior of the
- * standard NodeIterator. In particular, we do not guarantee
- * to present a "live view" of the document ... but in XSLT,
- * the source document should never be mutated, so this should
- * never be an issue.</p>
- * 
- * <p>Thought: Should NodeSetDTM really implement NodeList and NodeIterator,
- * or should there be specific subclasses of it which do so? The
- * advantage of doing it all here is that all NodeSetDTMs will respond
- * to the same calls; the disadvantage is that some of them may return
- * less-than-enlightening results when you do so.</p>
- */
-public class NodeSetDTM extends NodeVector
-        implements /* NodeList, NodeIterator, */ DTMIterator, 
-        Cloneable
-{
-
-  /**
-   * Create an empty nodelist.
-   */
-  public NodeSetDTM(DTMManager dtmManager)
-  {
-    super();
-    m_manager = dtmManager;
-  }
-
-  /**
-   * Create an empty, using the given block size.
-   *
-   * @param blocksize Size of blocks to allocate 
-   * @param dummy pass zero for right now...
-   */
-  public NodeSetDTM(int blocksize, int dummy, DTMManager dtmManager)
-  {
-    super(blocksize);
-    m_manager = dtmManager;
-  }
-
-  // %TBD%
-//  /**
-//   * Create a NodeSetDTM, and copy the members of the
-//   * given nodelist into it.
-//   *
-//   * @param nodelist List of Nodes to be made members of the new set.
-//   */
-//  public NodeSetDTM(NodeList nodelist)
-//  {
-//
-//    super();
-//
-//    addNodes(nodelist);
-//  }
-
-  /**
-   * Create a NodeSetDTM, and copy the members of the
-   * given NodeSetDTM into it.
-   *
-   * @param nodelist Set of Nodes to be made members of the new set.
-   */
-  public NodeSetDTM(NodeSetDTM nodelist)
-  {
-
-    super();
-    m_manager = nodelist.getDTMManager();
-    m_root = nodelist.getRoot();
-
-    addNodes((DTMIterator) nodelist);
-  }
-
-  /**
-   * Create a NodeSetDTM, and copy the members of the
-   * given DTMIterator into it.
-   *
-   * @param ni Iterator which yields Nodes to be made members of the new set.
-   */
-  public NodeSetDTM(DTMIterator ni)
-  {
-
-    super();
-
-    m_manager = ni.getDTMManager();
-    m_root = ni.getRoot();
-    addNodes(ni);
-  }
-  
-  /**
-   * Create a NodeSetDTM, and copy the members of the
-   * given DTMIterator into it.
-   *
-   * @param ni Iterator which yields Nodes to be made members of the new set.
-   */
-  public NodeSetDTM(NodeIterator iterator, XPathContext xctxt)
-  {
-
-    super();
-
-    Node node;
-    m_manager = xctxt.getDTMManager();
-
-    while (null != (node = iterator.nextNode()))
-    {
-      int handle = xctxt.getDTMHandleFromNode(node);
-      addNodeInDocOrder(handle, xctxt);
-    }
-  }
-  
-  /**
-   * Create a NodeSetDTM, and copy the members of the
-   * given DTMIterator into it.
-   *
-   * @param ni Iterator which yields Nodes to be made members of the new set.
-   */
-  public NodeSetDTM(NodeList nodeList, XPathContext xctxt)
-  {
-
-    super();
-
-    m_manager = xctxt.getDTMManager();
-
-    int n = nodeList.getLength();
-    for (int i = 0; i < n; i++) 
-    {
-      Node node = nodeList.item(i);
-      int handle = xctxt.getDTMHandleFromNode(node);
-      addNodeInDocOrder(handle, xctxt);
-    }
-  }
-
-
-  /**
-   * Create a NodeSetDTM which contains the given Node.
-   *
-   * @param node Single node to be added to the new set.
-   */
-  public NodeSetDTM(int node, DTMManager dtmManager)
-  {
-
-    super();
-    m_manager = dtmManager;
-
-    addNode(node);
-  }
-  
-  /**
-   * Set the environment in which this iterator operates, which should provide:
-   * a node (the context node... same value as "root" defined below) 
-   * a pair of non-zero positive integers (the context position and the context size) 
-   * a set of variable bindings 
-   * a function library 
-   * the set of namespace declarations in scope for the expression.
-   * 
-   * <p>At this time the exact implementation of this environment is application 
-   * dependent.  Probably a proper interface will be created fairly soon.</p>
-   * 
-   * @param environment The environment object.
-   */
-  public void setEnvironment(Object environment)
-  {
-    // no-op
-  }
-
-
-  /**
-   * @return The root node of the Iterator, as specified when it was created.
-   * For non-Iterator NodeSetDTMs, this will be null.
-   */
-  public int getRoot()
-  {
-    if(DTM.NULL == m_root)
-    {
-      if(size() > 0)
-        return item(0);
-      else
-        return DTM.NULL;
-    }
-    else
-      return m_root;
-  }
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    // no-op, I guess...  (-sb)
-  }
-
-  /**
-   * Clone this NodeSetDTM.
-   * At this time, we only expect this to be used with LocPathIterators;
-   * it may not work with other kinds of NodeSetDTMs.
-   *
-   * @return a new NodeSetDTM of the same type, having the same state...
-   * though unless overridden in the subclasses, it may not copy all
-   * the state information.
-   *
-   * @throws CloneNotSupportedException if this subclass of NodeSetDTM
-   * does not support the clone() operation.
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    NodeSetDTM clone = (NodeSetDTM) super.clone();
-
-    return clone;
-  }
-
-  /**
-   * Get a cloned Iterator, and reset its state to the beginning of the
-   * iteration.
-   *
-   * @return a new NodeSetDTM of the same type, having the same state...
-   * except that the reset() operation has been called.
-   *
-   * @throws CloneNotSupportedException if this subclass of NodeSetDTM
-   * does not support the clone() operation.
-   */
-  public DTMIterator cloneWithReset() throws CloneNotSupportedException
-  {
-
-    NodeSetDTM clone = (NodeSetDTM) clone();
-
-    clone.reset();
-
-    return clone;
-  }
-
-  /**
-   * Reset the iterator. May have no effect on non-iterator Nodesets.
-   */
-  public void reset()
-  {
-    m_next = 0;
-  }
-
-  /**
-   *  This attribute determines which node types are presented via the
-   * iterator. The available set of constants is defined in the
-   * <code>DTMFilter</code> interface. For NodeSetDTMs, the mask has been
-   * hardcoded to show all nodes except EntityReference nodes, which have
-   * no equivalent in the XPath data model.
-   *
-   * @return integer used as a bit-array, containing flags defined in
-   * the DOM's DTMFilter class. The value will be 
-   * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
-   * only entity references are suppressed.
-   */
-  public int getWhatToShow()
-  {
-    return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
-  }
-
-  /**
-   * The filter object used to screen nodes. Filters are applied to
-   * further reduce (and restructure) the DTMIterator's view of the
-   * document. In our case, we will be using hardcoded filters built
-   * into our iterators... but getFilter() is part of the DOM's 
-   * DTMIterator interface, so we have to support it.
-   *
-   * @return null, which is slightly misleading. True, there is no
-   * user-written filter object, but in fact we are doing some very
-   * sophisticated custom filtering. A DOM purist might suggest
-   * returning a placeholder object just to indicate that this is
-   * not going to return all nodes selected by whatToShow.
-   */
-  public DTMFilter getFilter()
-  {
-    return null;
-  }
-
-  /**
-   *  The value of this flag determines whether the children of entity
-   * reference nodes are visible to the iterator. If false, they will be
-   * skipped over.
-   * <br> To produce a view of the document that has entity references
-   * expanded and does not expose the entity reference node itself, use the
-   * whatToShow flags to hide the entity reference node and set
-   * expandEntityReferences to true when creating the iterator. To produce
-   * a view of the document that has entity reference nodes but no entity
-   * expansion, use the whatToShow flags to show the entity reference node
-   * and set expandEntityReferences to false.
-   *
-   * @return true for all iterators based on NodeSetDTM, meaning that the
-   * contents of EntityRefrence nodes may be returned (though whatToShow
-   * says that the EntityReferences themselves are not shown.)
-   */
-  public boolean getExpandEntityReferences()
-  {
-    return true;
-  }
-  
-  /**
-   * Get an instance of a DTM that "owns" a node handle.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTM using just the iterator.
-   *
-   * @param nodeHandle the nodeHandle.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(int nodeHandle)
-  {
-    
-    return m_manager.getDTM(nodeHandle);
-  }
-  
-  /* An instance of the DTMManager. */
-  DTMManager m_manager;
-  
-  /**
-   * Get an instance of the DTMManager.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTMManager using just the iterator.
-   *
-   * @return a non-null DTMManager reference.
-   */
-  public DTMManager getDTMManager()
-  {
-    
-    return m_manager;
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a DTMIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   * @throws DOMException
-   *    INVALID_STATE_ERR: Raised if this method is called after the
-   *   <code>detach</code> method was invoked.
-   */
-  public int nextNode()
-  {
-
-    if ((m_next) < this.size())
-    {
-      int next = this.elementAt(m_next);
-
-      m_next++;
-
-      return next;
-    }
-    else
-      return DTM.NULL;
-  }
-
-  /**
-   *  Returns the previous node in the set and moves the position of the
-   * iterator backwards in the set.
-   * @return  The previous <code>Node</code> in the set being iterated over,
-   *   or<code>null</code> if there are no more members in that set.
-   * @throws DOMException
-   *    INVALID_STATE_ERR: Raised if this method is called after the
-   *   <code>detach</code> method was invoked.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a cached type, and hence doesn't know what the previous node was.
-   */
-  public int previousNode()
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not iterate to a previous node!");
-
-    if ((m_next - 1) > 0)
-    {
-      m_next--;
-
-      return this.elementAt(m_next);
-    }
-    else
-      return DTM.NULL;
-  }
-
-  /**
-   * Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   * <p>
-   * This operation is a no-op in NodeSetDTM, and will not cause 
-   * INVALID_STATE_ERR to be raised by later operations.
-   * </p>
-   */
-  public void detach(){}
-  
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   * 
-   * @param allowRelease true if it is OK for detach to release this iterator 
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease)
-  {
-    // no action for right now.
-  }
-
-
-  /**
-   * Tells if this NodeSetDTM is "fresh", in other words, if
-   * the first nextNode() that is called will return the
-   * first node in the set.
-   *
-   * @return true if nextNode() would return the first node in the set,
-   * false if it would return a later one.
-   */
-  public boolean isFresh()
-  {
-    return (m_next == 0);
-  }
-
-  /**
-   * If an index is requested, NodeSetDTM will call this method
-   * to run the iterator to the index.  By default this sets
-   * m_next to the index.  If the index argument is -1, this
-   * signals that the iterator should be run to the end.
-   *
-   * @param index Position to advance (or retreat) to, with
-   * 0 requesting the reset ("fresh") position and -1 (or indeed
-   * any out-of-bounds value) requesting the final position.
-   * @throws RuntimeException thrown if this NodeSetDTM is not
-   * one of the types which supports indexing/counting.
-   */
-  public void runTo(int index)
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not do indexing or counting functions!");
-
-    if ((index >= 0) && (m_next < m_firstFree))
-      m_next = index;
-    else
-      m_next = m_firstFree - 1;
-  }
-
-  /**
-   * Returns the <code>index</code>th item in the collection. If
-   * <code>index</code> is greater than or equal to the number of nodes in
-   * the list, this returns <code>null</code>.
-   * 
-   * TODO: What happens if index is out of range?
-   * 
-   * @param index Index into the collection.
-   * @return The node at the <code>index</code>th position in the
-   *   <code>NodeList</code>, or <code>null</code> if that is not a valid
-   *   index.
-   */
-  public int item(int index)
-  {
-
-    runTo(index);
-
-    return this.elementAt(index);
-  }
-
-  /**
-   * The number of nodes in the list. The range of valid child node indices is
-   * 0 to <code>length-1</code> inclusive. Note that this operation requires
-   * finding all the matching nodes, which may defeat attempts to defer
-   * that work.
-   *
-   * @return integer indicating how many nodes are represented by this list.
-   */
-  public int getLength()
-  {
-
-    runTo(-1);
-
-    return this.size();
-  }
-
-  /**
-   * Add a node to the NodeSetDTM. Not all types of NodeSetDTMs support this
-   * operation
-   *
-   * @param n Node to be added
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void addNode(int n)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    this.addElement(n);
-  }
-
-  /**
-   * Insert a node at a given position.
-   *
-   * @param n Node to be added
-   * @param pos Offset at which the node is to be inserted,
-   * with 0 being the first position.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void insertNode(int n, int pos)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    insertElementAt(n, pos);
-  }
-
-  /**
-   * Remove a node.
-   *
-   * @param n Node to be added
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void removeNode(int n)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    this.removeElement(n);
-  }
-
-  // %TBD%
-//  /**
-//   * Copy NodeList members into this nodelist, adding in
-//   * document order.  If a node is null, don't add it.
-//   *
-//   * @param nodelist List of nodes which should now be referenced by
-//   * this NodeSetDTM.
-//   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-//   * a mutable type.
-//   */
-//  public void addNodes(NodeList nodelist)
-//  {
-//
-//    if (!m_mutable)
-//      throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-//    if (null != nodelist)  // defensive to fix a bug that Sanjiva reported.
-//    {
-//      int nChildren = nodelist.getLength();
-//
-//      for (int i = 0; i < nChildren; i++)
-//      {
-//        int obj = nodelist.item(i);
-//
-//        if (null != obj)
-//        {
-//          addElement(obj);
-//        }
-//      }
-//    }
-//
-//    // checkDups();
-//  }
-
-  // %TBD%
-//  /**
-//   * <p>Copy NodeList members into this nodelist, adding in
-//   * document order.  Only genuine node references will be copied;
-//   * nulls appearing in the source NodeSetDTM will
-//   * not be added to this one. </p>
-//   * 
-//   * <p> In case you're wondering why this function is needed: NodeSetDTM
-//   * implements both DTMIterator and NodeList. If this method isn't
-//   * provided, Java can't decide which of those to use when addNodes()
-//   * is invoked. Providing the more-explicit match avoids that
-//   * ambiguity.)</p>
-//   *
-//   * @param ns NodeSetDTM whose members should be merged into this NodeSetDTM.
-//   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-//   * a mutable type.
-//   */
-//  public void addNodes(NodeSetDTM ns)
-//  {
-//
-//    if (!m_mutable)
-//      throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-//    addNodes((DTMIterator) ns);
-//  }
-
-  /**
-   * Copy NodeList members into this nodelist, adding in
-   * document order.  Null references are not added.
-   *
-   * @param iterator DTMIterator which yields the nodes to be added.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void addNodes(DTMIterator iterator)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    if (null != iterator)  // defensive to fix a bug that Sanjiva reported.
-    {
-      int obj;
-
-      while (DTM.NULL != (obj = iterator.nextNode()))
-      {
-        addElement(obj);
-      }
-    }
-
-    // checkDups();
-  }
-
-  // %TBD%
-//  /**
-//   * Copy NodeList members into this nodelist, adding in
-//   * document order.  If a node is null, don't add it.
-//   *
-//   * @param nodelist List of nodes to be added
-//   * @param support The XPath runtime context.
-//   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-//   * a mutable type.
-//   */
-//  public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
-//  {
-//
-//    if (!m_mutable)
-//      throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-//    int nChildren = nodelist.getLength();
-//
-//    for (int i = 0; i < nChildren; i++)
-//    {
-//      int node = nodelist.item(i);
-//
-//      if (null != node)
-//      {
-//        addNodeInDocOrder(node, support);
-//      }
-//    }
-//  }
-
-  /**
-   * Copy NodeList members into this nodelist, adding in
-   * document order.  If a node is null, don't add it.
-   *
-   * @param iterator DTMIterator which yields the nodes to be added.
-   * @param support The XPath runtime context.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void addNodesInDocOrder(DTMIterator iterator, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    int node;
-
-    while (DTM.NULL != (node = iterator.nextNode()))
-    {
-      addNodeInDocOrder(node, support);
-    }
-  }
-
-  // %TBD%
-//  /**
-//   * Add the node list to this node set in document order.
-//   *
-//   * @param start index.
-//   * @param end index.
-//   * @param testIndex index.
-//   * @param nodelist The nodelist to add.
-//   * @param support The XPath runtime context.
-//   *
-//   * @return false always.
-//   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-//   * a mutable type.
-//   */
-//  private boolean addNodesInDocOrder(int start, int end, int testIndex,
-//                                     NodeList nodelist, XPathContext support)
-//  {
-//
-//    if (!m_mutable)
-//      throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-//    boolean foundit = false;
-//    int i;
-//    int node = nodelist.item(testIndex);
-//
-//    for (i = end; i >= start; i--)
-//    {
-//      int child = elementAt(i);
-//
-//      if (child == node)
-//      {
-//        i = -2;  // Duplicate, suppress insert
-//
-//        break;
-//      }
-//
-//      if (!support.getDOMHelper().isNodeAfter(node, child))
-//      {
-//        insertElementAt(node, i + 1);
-//
-//        testIndex--;
-//
-//        if (testIndex > 0)
-//        {
-//          boolean foundPrev = addNodesInDocOrder(0, i, testIndex, nodelist,
-//                                                 support);
-//
-//          if (!foundPrev)
-//          {
-//            addNodesInDocOrder(i, size() - 1, testIndex, nodelist, support);
-//          }
-//        }
-//
-//        break;
-//      }
-//    }
-//
-//    if (i == -1)
-//    {
-//      insertElementAt(node, 0);
-//    }
-//
-//    return foundit;
-//  }
-
-  /**
-   * Add the node into a vector of nodes where it should occur in
-   * document order.
-   * @param v Vector of nodes, presumably containing Nodes
-   * @param obj Node object.
-   *
-   * @param node The node to be added.
-   * @param test true if we should test for doc order
-   * @param support The XPath runtime context.
-   * @return insertIndex.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public int addNodeInDocOrder(int node, boolean test, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    int insertIndex = -1;
-
-    if (test)
-    {
-
-      // This needs to do a binary search, but a binary search 
-      // is somewhat tough because the sequence test involves 
-      // two nodes.
-      int size = size(), i;
-
-      for (i = size - 1; i >= 0; i--)
-      {
-        int child = elementAt(i);
-
-        if (child == node)
-        {
-          i = -2;  // Duplicate, suppress insert
-
-          break;
-        }
-
-        DTM dtm = support.getDTM(node);
-        if (!dtm.isNodeAfter(node, child))
-        {
-          break;
-        }
-      }
-
-      if (i != -2)
-      {
-        insertIndex = i + 1;
-
-        insertElementAt(node, insertIndex);
-      }
-    }
-    else
-    {
-      insertIndex = this.size();
-
-      boolean foundit = false;
-
-      for (int i = 0; i < insertIndex; i++)
-      {
-        if (i == node)
-        {
-          foundit = true;
-
-          break;
-        }
-      }
-
-      if (!foundit)
-        addElement(node);
-    }
-
-    // checkDups();
-    return insertIndex;
-  }  // end addNodeInDocOrder(Vector v, Object obj)
-
-  /**
-   * Add the node into a vector of nodes where it should occur in
-   * document order.
-   * @param v Vector of nodes, presumably containing Nodes
-   * @param obj Node object.
-   *
-   * @param node The node to be added.
-   * @param support The XPath runtime context.
-   *
-   * @return The index where it was inserted.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public int addNodeInDocOrder(int node, XPathContext support)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    return addNodeInDocOrder(node, true, support);
-  }  // end addNodeInDocOrder(Vector v, Object obj)
-
-  /**
-   * Get the length of the list.
-   *
-   * @return The size of this node set.
-   */
-  public int size()
-  {
-    return super.size();
-  }
-
-  /**
-   * Append a Node onto the vector.
-   *
-   * @param value The node to be added.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void addElement(int value)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.addElement(value);
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   *
-   * @param value The node to be inserted.
-   * @param at The index where the insert should occur.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void insertElementAt(int value, int at)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.insertElementAt(value, at);
-  }
-
-  /**
-   * Append the nodes to the list.
-   *
-   * @param nodes The nodes to be appended to this node set.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void appendNodes(NodeVector nodes)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.appendNodes(nodes);
-  }
-
-  /**
-   * Inserts the specified node in this vector at the specified index.
-   * Each component in this vector with an index greater or equal to
-   * the specified index is shifted upward to have an index one greater
-   * than the value it had previously.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void removeAllElements()
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.removeAllElements();
-  }
-
-  /**
-   * Removes the first occurrence of the argument from this vector.
-   * If the object is found in this vector, each component in the vector
-   * with an index greater or equal to the object's index is shifted
-   * downward to have an index one smaller than the value it had
-   * previously.
-   *
-   * @param s The node to be removed.
-   *
-   * @return True if the node was successfully removed
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public boolean removeElement(int s)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    return super.removeElement(s);
-  }
-
-  /**
-   * Deletes the component at the specified index. Each component in
-   * this vector with an index greater or equal to the specified
-   * index is shifted downward to have an index one smaller than
-   * the value it had previously.
-   *
-   * @param i The index of the node to be removed.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void removeElementAt(int i)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.removeElementAt(i);
-  }
-
-  /**
-   * Sets the component at the specified index of this vector to be the
-   * specified object. The previous component at that position is discarded.
-   *
-   * The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.
-   *
-   * @param node  The node to be set.
-   * @param index The index of the node to be replaced.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void setElementAt(int node, int index)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.setElementAt(node, index);
-  }
-  
-  /**
-   * Same as setElementAt.
-   *
-   * @param node  The node to be set.
-   * @param index The index of the node to be replaced.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a mutable type.
-   */
-  public void setItem(int node, int index)
-  {
-
-    if (!m_mutable)
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
-    super.setElementAt(node, index);
-  }
-
-  /**
-   * Get the nth element.
-   *
-   * @param i The index of the requested node.
-   *
-   * @return Node at specified index.
-   */
-  public int elementAt(int i)
-  {
-
-    runTo(i);
-
-    return super.elementAt(i);
-  }
-  
-  /**
-   * Tell if the table contains the given node.
-   *
-   * @param s Node to look for
-   *
-   * @return True if the given node was found.
-   */
-  public boolean contains(int s)
-  {
-
-    runTo(-1);
-
-    return super.contains(s);
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Node to look for
-   * @param index Index of where to start the search
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(int elem, int index)
-  {
-
-    runTo(-1);
-
-    return super.indexOf(elem, index);
-  }
-
-  /**
-   * Searches for the first occurence of the given argument,
-   * beginning the search at index, and testing for equality
-   * using the equals method.
-   *
-   * @param elem Node to look for 
-   * @return the index of the first occurrence of the object
-   * argument in this vector at position index or later in the
-   * vector; returns -1 if the object is not found.
-   */
-  public int indexOf(int elem)
-  {
-
-    runTo(-1);
-
-    return super.indexOf(elem);
-  }
-
-  /** If this node is being used as an iterator, the next index that nextNode()
-   *  will return.  */
-  transient protected int m_next = 0;
-
-  /**
-   * Get the current position, which is one less than
-   * the next nextNode() call will retrieve.  i.e. if
-   * you call getCurrentPos() and the return is 0, the next
-   * fetch will take place at index 1.
-   *
-   * @return The the current position index.
-   */
-  public int getCurrentPos()
-  {
-    return m_next;
-  }
-
-  /**
-   * Set the current position in the node set.
-   * @param i Must be a valid index.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a cached type, and thus doesn't permit indexed access.
-   */
-  public void setCurrentPos(int i)
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not do indexing or counting functions!");
-
-    m_next = i;
-  }
-
-  /**
-   * Return the last fetched node.  Needed to support the UnionPathIterator.
-   *
-   * @return the last fetched node.
-   * @throws RuntimeException thrown if this NodeSetDTM is not of 
-   * a cached type, and thus doesn't permit indexed access.
-   */
-  public int getCurrentNode()
-  {
-
-    if (!m_cacheNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not do indexing or counting functions!");
-
-    int saved = m_next;
-    int n = (m_next < m_firstFree) ? elementAt(m_next) : DTM.NULL;
-    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
-    return n;
-  }
-
-  /** True if this list can be mutated.  */
-  transient protected boolean m_mutable = true;
-
-  /** True if this list is cached.
-   *  @serial  */
-  transient protected boolean m_cacheNodes = true;
-  
-  /** The root of the iteration, if available. */
-  protected int m_root = DTM.NULL;
-
-  /**
-   * Get whether or not this is a cached node set.
-   *
-   *
-   * @return True if this list is cached.
-   */
-  public boolean getShouldCacheNodes()
-  {
-    return m_cacheNodes;
-  }
-
-  /**
-   * If setShouldCacheNodes(true) is called, then nodes will
-   * be cached.  They are not cached by default. This switch must
-   * be set before the first call to nextNode is made, to ensure
-   * that all nodes are cached.
-   *
-   * @param b true if this node set should be cached.
-   * @throws RuntimeException thrown if an attempt is made to
-   * request caching after we've already begun stepping through the
-   * nodes in this set.
-  */
-  public void setShouldCacheNodes(boolean b)
-  {
-
-    if (!isFresh())
-      throw new RuntimeException(
-        "Can not call setShouldCacheNodes after nextNode has been called!");
-
-    m_cacheNodes = b;
-    m_mutable = true;
-  }
-  
-  /**
-   * Tells if this iterator can have nodes added to it or set via 
-   * the <code>setItem(int node, int index)</code> method.
-   * 
-   * @return True if the nodelist can be mutated.
-   */
-  public boolean isMutable()
-  {
-    return m_mutable;
-  }
-  
-  transient private int m_last = 0;
-  
-  public int getLast()
-  {
-    return m_last;
-  }
-  
-  public void setLast(int last)
-  {
-    m_last = last;
-  }
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * 
-   * @return true as a default.
-   */
-  public boolean isDocOrdered()
-  {
-    return true;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return -1;
-  }
-  
-
-}
diff --git a/src/org/apache/xpath/SourceTree.java b/src/org/apache/xpath/SourceTree.java
deleted file mode 100644
index 9f04629..0000000
--- a/src/org/apache/xpath/SourceTree.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-//import org.w3c.dom.Node;
-
-/**
- * <meta name="usage" content="internal"/>
- * This object represents a Source Tree, and any associated
- * information.
- */
-public class SourceTree
-{
-
-  /**
-   * Constructor SourceTree
-   *
-   *
-   * @param root The root of the source tree, which may or may not be a 
-   * {@link org.w3c.dom.Document} node.
-   * @param url The URI of the source tree.
-   */
-  public SourceTree(int root, String url)
-  {
-    m_root = root;
-    m_url = url;
-  }
-
-  /** The URI of the source tree.   */
-  public String m_url;
-
-  /** The root of the source tree, which may or may not be a 
-   * {@link org.w3c.dom.Document} node.  */
-  public int m_root;
-}
diff --git a/src/org/apache/xpath/SourceTreeManager.java b/src/org/apache/xpath/SourceTreeManager.java
deleted file mode 100644
index 197b61c..0000000
--- a/src/org/apache/xpath/SourceTreeManager.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import java.net.MalformedURLException;
-
-import java.io.File;
-import java.io.IOException;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.apache.xpath.objects.XString;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Document;
-
-import org.apache.xml.dtm.DTM;
-
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.TransformerException;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-
-// import org.xml.sax.Locator;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xml.utils.SystemIDResolver;
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xpath.res.XPATHErrorResources;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.TransformerException;
-
-/**
- * This class bottlenecks all management of source trees.  The methods
- * in this class should allow easy garbage collection of source
- * trees (not yet!), and should centralize parsing for those source trees.
- */
-public class SourceTreeManager
-{
-
-  /** Vector of SourceTree objects that this manager manages. */
-  private Vector m_sourceTree = new Vector();
-
-  /**
-   * Reset the list of SourceTree objects that this manager manages.
-   *
-   */
-  public void reset()
-  {
-    m_sourceTree = new Vector();
-  }
-
-  /** The TrAX URI resolver used to obtain source trees. */
-  URIResolver m_uriResolver;
-
-  /**
-   * Set an object that will be used to resolve URIs used in
-   * document(), etc.
-   * @param resolver An object that implements the URIResolver interface,
-   * or null.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-    m_uriResolver = resolver;
-  }
-
-  /**
-   * Get the object that will be used to resolve URIs used in
-   * document(), etc.
-   * @return An object that implements the URIResolver interface,
-   * or null.
-   */
-  public URIResolver getURIResolver()
-  {
-    return m_uriResolver;
-  }
-
-  /**
-   * Given a document, find the URL associated with that document.
-   * @param owner Document that was previously processed by this liaison.
-   *
-   * @return The base URI of the owner argument.
-   */
-  public String findURIFromDoc(int owner)
-  {
-    int n = m_sourceTree.size();
-
-    for (int i = 0; i < n; i++)
-    {
-      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);
-
-      if (owner == sTree.m_root)
-        return sTree.m_url;
-    }
-
-    return null;
-  }
-
-  /**
-   * This will be called by the processor when it encounters
-   * an xsl:include, xsl:import, or document() function.
-   *
-   * @param base The base URI that should be used.
-   * @param urlString Value from an xsl:import or xsl:include's href attribute,
-   * or a URI specified in the document() function.
-   * 
-   * @return a Source that can be used to process the resource.
-   *
-   * @throws IOException
-   * @throws TransformerException
-   */
-  public Source resolveURI(
-          String base, String urlString, SourceLocator locator)
-            throws TransformerException, IOException
-  {
-
-    Source source = null;
-
-    if (null != m_uriResolver)
-    {
-      source = m_uriResolver.resolve(urlString, base);
-    }
-
-    if (null == source)
-    {
-      String uri = SystemIDResolver.getAbsoluteURI(urlString, base);
-
-      source = new StreamSource(uri);
-    }
-
-    return source;
-  }
-
-  /**
-   * Put the source tree root node in the document cache.
-   * TODO: This function needs to be a LOT more sophisticated.
-   *
-   * @param n The node to cache.
-   * @param source The Source object to cache.
-   */
-  public void putDocumentInCache(int n, Source source)
-  {
-
-    int cachedNode = getNode(source);
-
-    if (DTM.NULL != cachedNode)
-    {
-      if (!(cachedNode == n))
-        throw new RuntimeException(
-          "Programmer's Error!  "
-          + "putDocumentInCache found reparse of doc: "
-          + source.getSystemId());
-      return;
-    }
-    if (null != source.getSystemId())
-    {
-      m_sourceTree.addElement(new SourceTree(n, source.getSystemId()));
-    }
-  }
-
-  /**
-   * Given a Source object, find the node associated with it.
-   *
-   * @param source The Source object to act as the key.
-   *
-   * @return The node that is associated with the Source, or null if not found.
-   */
-  public int getNode(Source source)
-  {
-
-//    if (source instanceof DOMSource)
-//      return ((DOMSource) source).getNode();
-
-    // TODO: Not sure if the BaseID is really the same thing as the ID.
-    String url = source.getSystemId();
-
-    if (null == url)
-      return DTM.NULL;
-
-    int n = m_sourceTree.size();
-
-    // System.out.println("getNode: "+n);
-    for (int i = 0; i < n; i++)
-    {
-      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);
-
-      // System.out.println("getNode -         url: "+url);
-      // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
-      if (url.equals(sTree.m_url))
-        return sTree.m_root;
-    }
-
-    // System.out.println("getNode - returning: "+node);
-    return DTM.NULL;
-  }
-
-  /**
-   * Get the source tree from the a base URL and a URL string.
-   *
-   * @param base The base URI to use if the urlString is relative.
-   * @param urlString An absolute or relative URL string.
-   * @param locator The location of the caller, for diagnostic purposes.
-   *
-   * @return should be a non-null reference to the node identified by the 
-   * base and urlString.
-   *
-   * @throws TransformerException If the URL can not resolve to a node.
-   */
-  public int getSourceTree(
-          String base, String urlString, SourceLocator locator, XPathContext xctxt)
-            throws TransformerException
-  {
-
-    // System.out.println("getSourceTree");
-    try
-    {
-      Source source = this.resolveURI(base, urlString, locator);
-
-      // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId());
-      return getSourceTree(source, locator, xctxt);
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerException(ioe.getMessage(), locator, ioe);
-    }
-
-    /* catch (TransformerException te)
-     {
-       throw new TransformerException(te.getMessage(), locator, te);
-     }*/
-  }
-
-  /**
-   * Get the source tree from the input source.
-   *
-   * @param source The Source object that should identify the desired node.
-   * @param locator The location of the caller, for diagnostic purposes.
-   *
-   * @return non-null reference to a node.
-   *
-   * @throws TransformerException if the Source argument can't be resolved to 
-   *         a node.
-   */
-  public int getSourceTree(Source source, SourceLocator locator, XPathContext xctxt)
-          throws TransformerException
-  {
-
-    int n = getNode(source);
-
-    if (DTM.NULL != n)
-      return n;
-
-    n = parseToNode(source, locator, xctxt);
-
-    if (DTM.NULL != n)
-      putDocumentInCache(n, source);
-
-    return n;
-  }
-
-  /**
-   * Try to create a DOM source tree from the input source.
-   *
-   * @param source The Source object that identifies the source node.
-   * @param locator The location of the caller, for diagnostic purposes.
-   *
-   * @return non-null reference to node identified by the source argument.
-   *
-   * @throws TransformerException if the source argument can not be resolved 
-   *         to a source node.
-   */
-  public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt)
-          throws TransformerException
-  {
-
-    try
-    {      
-      Object xowner = xctxt.getOwnerObject();
-      DTM dtm;
-      if(null != xowner && xowner instanceof org.apache.xml.dtm.DTMWSFilter)
-      {
-        dtm = xctxt.getDTM(source, false, 
-                          (org.apache.xml.dtm.DTMWSFilter)xowner, false, true);
-      }
-      else
-      {
-        dtm = xctxt.getDTM(source, false, null, false, true);
-      }
-      return dtm.getDocument();
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-      throw new TransformerException(e.getMessage(), locator, e);
-    }
-
-  }
-
-  /**
-   * This method returns the SAX2 parser to use with the InputSource
-   * obtained from this URI.
-   * It may return null if any SAX2-conformant XML parser can be used,
-   * or if getInputSource() will also return null. The parser must
-   * be free for use (i.e.
-   * not currently in use for another parse().
-   *
-   * @param inputSource The value returned from the URIResolver.
-   * @returns a SAX2 XMLReader to use to resolve the inputSource argument.
-   * @param locator The location of the original caller, for diagnostic purposes.
-   *
-   * @return non-null XMLReader reference ready to parse.
-   *
-   * @throws TransformerException if the reader can not be created.
-   */
-  public static XMLReader getXMLReader(Source inputSource, SourceLocator locator)
-          throws TransformerException
-  {
-
-    try
-    {
-      XMLReader reader = (inputSource instanceof SAXSource)
-                         ? ((SAXSource) inputSource).getXMLReader() : null;
-                         
-      boolean isUserReader = (reader != null);
-
-      if (null == reader)
-      {
-        try {
-          javax.xml.parsers.SAXParserFactory factory=
-              javax.xml.parsers.SAXParserFactory.newInstance();
-          factory.setNamespaceAware( true );
-          javax.xml.parsers.SAXParser jaxpParser=
-              factory.newSAXParser();
-          reader=jaxpParser.getXMLReader();
-          
-        } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-          throw new org.xml.sax.SAXException( ex );
-        } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-            throw new org.xml.sax.SAXException( ex1.toString() );
-        } catch( NoSuchMethodError ex2 ) {
-        }
-        catch (AbstractMethodError ame){}
-        if(null == reader)
-          reader = XMLReaderFactory.createXMLReader();
-      }
-
-      try
-      {
-        reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                          true);
-        // Commented out as per discussion with Thomas2.Maesing@bgs-ag.de 
-        // about bug 2124.
-//        if(!isUserReader)
-//          reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-//                            true);
-      }
-      catch (org.xml.sax.SAXException se)
-      {
-
-        // What can we do?
-        // TODO: User diagnostics.
-      }
-
-      return reader;
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se.getMessage(), locator, se);
-    }
-  }
-}
diff --git a/src/org/apache/xpath/VariableStack.java b/src/org/apache/xpath/VariableStack.java
deleted file mode 100644
index 1297d9b..0000000
--- a/src/org/apache/xpath/VariableStack.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Defines a class to keep track of a stack for
- * template arguments and variables.
- *
- * <p>This has been changed from the previous incarnations of this
- * class to be fairly low level.</p>
- */
-public final class VariableStack implements Cloneable
-{
-
-  /**
-   * Constructor for a variable stack.
-   */
-  public VariableStack()
-  {
-    reset();
-  }
-
-  /**
-   * Returns a clone of this variable stack.
-   *
-   * @return  a clone of this variable stack.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public synchronized Object clone() throws CloneNotSupportedException
-  {
-
-    VariableStack vs = (VariableStack) super.clone();
-
-    // I *think* I can get away with a shallow clone here?
-    vs._sf = (XObject[]) _sf.clone();
-    vs._links = (int[]) _links.clone();
-
-    return vs;
-  }
-
-  /**
-   * The stack frame where all variables and params will be kept.
-   * @serial
-   */
-  XObject[] _sf = new XObject[XPathContext.RECURSIONLIMIT * 2];
-
-  /**
-   * The top of the stack frame (<code>_sf</code>).
-   * @serial
-   */
-  int _top;
-
-  /**
-   * The bottom index of the current frame (relative to <code>_sf</code>).
-   * @serial
-   */
-  private int _cfb;
-
-  /**
-   * The stack of frame positions.  I call 'em links because of distant
-   * <a href="http://math.millikin.edu/mprogers/Courses/currentCourses/CS481-ComputerArchitecture/cs481.Motorola68000.html">
-   * Motorola 68000 assembler</a> memories.  :-)
-   * @serial
-   */
-  int[] _links = new int[XPathContext.RECURSIONLIMIT];
-
-  /**
-   * The top of the links stack.
-   */
-  int _linksTop;
-
-  /**
-   * Get the element at the given index, regardless of stackframe.
-   *
-   * @param i index from zero.
-   *
-   * @return The item at the given index.
-   */
-  public final XObject elementAt(final int i)
-  {
-    return _sf[i];
-  }
-
-  /**
-   * Get size of the stack.
-   *
-   * @return the total size of the execution stack.
-   */
-  public final int size()
-  {
-    return _top;
-  }
-
-  /**
-   * Reset the stack to a start position.
-   *
-   * @return the total size of the execution stack.
-   */
-  public final void reset()
-  {
-
-    _top = 0;
-    _linksTop = 0;
-
-    // Adding one here to the stack of frame positions will allow us always 
-    // to look one under without having to check if we're at zero.
-    // (As long as the caller doesn't screw up link/unlink.)
-    _links[_linksTop++] = 0;
-  }
-
-  /**
-   * Set the current stack frame.
-   *
-   * @param sf The new stack frame position.
-   */
-  public final void setStackFrame(int sf)
-  {
-    _cfb = sf;
-  }
-
-  /**
-   * Get the position from where the search should start,
-   * which is either the searchStart property, or the top
-   * of the stack if that value is -1.
-   *
-   * @return The current stack frame position.
-   */
-  public final int getStackFrame()
-  {
-    return _cfb;
-  }
-
-  /**
-   * Allocates memory (called a stackframe) on the stack; used to store
-   * local variables and parameter arguments.
-   *
-   * <p>I use the link/unlink concept because of distant
-   * <a href="http://math.millikin.edu/mprogers/Courses/currentCourses/CS481-ComputerArchitecture/cs481.Motorola68000.html">
-   * Motorola 68000 assembler</a> memories.</p>
-   *
-   * @param size The size of the stack frame allocation.  This ammount should
-   * normally be the maximum number of variables that you can have allocated
-   * at one time in the new stack frame.
-   *
-   * @return The bottom of the stack frame, from where local variable addressing
-   * should start from.
-   */
-  public final int link(final int size)
-  {
-
-    _cfb = _top;
-    _top += size;
-
-    if (_top >= _sf.length)
-    {
-      XObject newsf[] = new XObject[_sf.length + (1024 * 4) + size];
-
-      System.arraycopy(_sf, 0, newsf, 0, _sf.length);
-
-      _sf = newsf;
-    }
-
-    if (_linksTop + 1 >= _links.length)
-    {
-      int newlinks[] = new int[_links.length + (1024 * 2)];
-
-      System.arraycopy(_links, 0, newlinks, 0, _links.length);
-
-      _links = newlinks;
-    }
-
-    _links[_linksTop++] = _cfb;
-
-    return _cfb;
-  }
-
-  /**
-   * Free up the stack frame that was last allocated with
-   * {@link link(int size)}.
-   */
-  public final void unlink()
-  {
-    _top = _links[--_linksTop];
-    _cfb = _links[_linksTop - 1];
-  }
-
-  /**
-   * Set a local variable or parameter in the current stack frame.
-   *
-   *
-   * @param index Local variable index relative to the current stack
-   * frame bottom.
-   *
-   * @param val The value of the variable that is being set.
-   */
-  public final void setLocalVariable(int index, XObject val)
-  {
-    _sf[index + _cfb] = val;
-  }
-
-  /**
-   * Set a local variable or parameter in the specified stack frame.
-   *
-   *
-   * @param index Local variable index relative to the current stack
-   * frame bottom.
-   * NEEDSDOC @param stackFrame
-   *
-   * @param val The value of the variable that is being set.
-   */
-  public final void setLocalVariable(int index, XObject val, int stackFrame)
-  {
-    _sf[index + stackFrame] = val;
-  }
-
-  /**
-   * Get a local variable or parameter in the current stack frame.
-   *
-   *
-   * @param xctxt The XPath context, which must be passed in order to
-   * lazy evaluate variables.
-   *
-   * @param index Local variable index relative to the current stack
-   * frame bottom.
-   *
-   * @return The value of the variable.
-   *
-   * @throws TransformerException
-   */
-  public final XObject getLocalVariable(XPathContext xctxt, int index)
-          throws TransformerException
-  {
-
-    index += _cfb;
-
-    XObject val = _sf[index];
-    
-    if(null == val)
-      throw new TransformerException("Variable accessed before it is bound!", xctxt.getSAXLocator());
-
-    // Lazy execution of variables.
-    if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
-      return (_sf[index] = val.execute(xctxt));
-
-    return val;
-  }
-
-  /**
-   * Get a local variable or parameter in the current stack frame.
-   *
-   *
-   * @param index Local variable index relative to the given
-   * frame bottom.
-   * NEEDSDOC @param frame
-   *
-   * @return The value of the variable.
-   *
-   * @throws TransformerException
-   */
-  public final XObject getLocalVariable(int index, int frame)
-          throws TransformerException
-  {
-
-    index += frame;
-
-    XObject val = _sf[index];
-
-    return val;
-  }
-
-  /**
-   * Tell if a local variable has been set or not.
-   *
-   * @param index Local variable index relative to the current stack
-   * frame bottom.
-   *
-   * @return true if the value at the index is not null.
-   *
-   * @throws TransformerException
-   */
-  public final boolean isLocalSet(int index) throws TransformerException
-  {
-    return (_sf[index + _cfb] != null);
-  }
-
-  /** NEEDSDOC Field m_nulls          */
-  private static XObject[] m_nulls = new XObject[1024];
-
-  /**
-   * Use this to clear the variables in a section of the stack.  This is
-   * used to clear the parameter section of the stack, so that default param
-   * values can tell if they've already been set.  It is important to note that
-   * this function has a 1K limitation.
-   *
-   * @param start The start position, relative to the current local stack frame.
-   * @param len The number of slots to be cleared.
-   */
-  public final void clearLocalSlots(int start, int len)
-  {
-
-    start += _cfb;
-
-    System.arraycopy(m_nulls, 0, _sf, start, len);
-  }
-
-  /**
-   * Set a global variable or parameter in the global stack frame.
-   *
-   *
-   * @param index Local variable index relative to the global stack frame
-   * bottom.
-   *
-   * @param val The value of the variable that is being set.
-   */
-  public final void setGlobalVariable(final int index, final XObject val)
-  {
-    _sf[index] = val;
-  }
-
-  /**
-   * Get a global variable or parameter from the global stack frame.
-   *
-   *
-   * @param xctxt The XPath context, which must be passed in order to
-   * lazy evaluate variables.
-   *
-   * @param index Global variable index relative to the global stack
-   * frame bottom.
-   *
-   * @return The value of the variable.
-   *
-   * @throws TransformerException
-   */
-  public final XObject getGlobalVariable(XPathContext xctxt, final int index)
-          throws TransformerException
-  {
-
-    XObject val = _sf[index];
-
-    // Lazy execution of variables.
-    if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
-      return (_sf[index] = val.execute(xctxt));
-
-    return val;
-  }
-
-  /**
-   * Get a variable based on it's qualified name.
-   * This is for external use only.
-   *
-   * @param xctxt The XPath context, which must be passed in order to
-   * lazy evaluate variables.
-   * 
-   * @param qname The qualified name of the variable.
-   *
-   * @return The evaluated value of the variable.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public final XObject getVariableOrParam(
-          XPathContext xctxt, org.apache.xml.utils.QName qname)
-            throws javax.xml.transform.TransformerException
-  {
-
-    org.apache.xml.utils.PrefixResolver prefixResolver =
-      xctxt.getNamespaceContext();
-
-    // Get the current ElemTemplateElement, which must be pushed in as the 
-    // prefix resolver, and then walk backwards in document order, searching 
-    // for an xsl:param element or xsl:variable element that matches our 
-    // qname.  If we reach the top level, use the StylesheetRoot's composed
-    // list of top level variables and parameters.
-
-    if (prefixResolver instanceof org.apache.xalan.templates.ElemTemplateElement)
-    {
-      
-      org.apache.xalan.templates.ElemVariable vvar;
-
-      org.apache.xalan.templates.ElemTemplateElement prev =
-        (org.apache.xalan.templates.ElemTemplateElement) prefixResolver;
-
-      if (!(prev instanceof org.apache.xalan.templates.Stylesheet))
-      {
-        while ( !(prev.getParentNode() instanceof org.apache.xalan.templates.Stylesheet) )
-        {
-          org.apache.xalan.templates.ElemTemplateElement savedprev = prev;
-
-          while (null != (prev = prev.getPreviousSiblingElem()))
-          {
-            if (prev instanceof org.apache.xalan.templates.ElemVariable)
-            {
-              vvar = (org.apache.xalan.templates.ElemVariable) prev;
-
-              if (vvar.getName().equals(qname))
-                return getLocalVariable(xctxt, vvar.getIndex());
-            }
-          }
-          prev = savedprev.getParentElem();
-        }
-      }
-
-      vvar = prev.getStylesheetRoot().getVariableOrParamComposed(qname);
-      if (null != vvar)
-        return getGlobalVariable(xctxt, vvar.getIndex());
-    }
-
-    throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{qname.toString()})); //"Variable not resolvable: " + qname);
-  }
-}  // end VariableStack
-
diff --git a/src/org/apache/xpath/WhitespaceStrippingElementMatcher.java b/src/org/apache/xpath/WhitespaceStrippingElementMatcher.java
deleted file mode 100644
index ceb56e1..0000000
--- a/src/org/apache/xpath/WhitespaceStrippingElementMatcher.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.xpath;
-
-import org.w3c.dom.Element;
-import javax.xml.transform.TransformerException;
-
-/**
- * A class that implements this interface can tell if a given element should 
- * strip whitespace nodes from it's children.
- */
-public interface WhitespaceStrippingElementMatcher
-{
-  /**
-   * Get information about whether or not an element should strip whitespace.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @param support The XPath runtime state.
-   * @param targetElement Element to check
-   *
-   * @return true if the whitespace should be stripped.
-   *
-   * @throws TransformerException
-   */
-  public boolean shouldStripWhiteSpace(
-          XPathContext support, Element targetElement) throws TransformerException;
-  
-  /**
-   * Get information about whether or not whitespace can be stripped.
-   * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
-   *
-   * @return true if the whitespace can be stripped.
-   */
-  public boolean canStripWhiteSpace();
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/XPath.java b/src/org/apache/xpath/XPath.java
deleted file mode 100644
index 1a179f1..0000000
--- a/src/org/apache/xpath/XPath.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Document;
-//import org.w3c.dom.traversal.NodeIterator;
-//import org.w3c.dom.DocumentFragment;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import java.io.Serializable;
-import java.io.ObjectInputStream;
-import java.io.IOException;
-
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.functions.Function;
-
-// import org.apache.xpath.functions.FuncLoader;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xpath.compiler.OpMap;  // temp
-import org.apache.xpath.compiler.OpCodes;  // temp
-import org.apache.xpath.compiler.PsuedoNames;  // temp
-import org.apache.xpath.compiler.FunctionTable;  // temp
-import org.apache.xpath.objects.XObject;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.objects.*;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.ErrorListener;
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xpath.patterns.NodeTest;
-
-/**
- * <meta name="usage" content="advanced"/>
- * The XPath class wraps an expression object and provides general services 
- * for execution of that expression.
- */
-public class XPath implements Serializable
-{
-
-  /** The top of the expression tree. 
-   *  @serial */
-  private Expression m_mainExp;
-
-  /**
-   * Get the raw Expression object that this class wraps.
-   *
-   *
-   * @return the raw Expression object, which should not normally be null.
-   */
-  public Expression getExpression()
-  {
-    return m_mainExp;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    m_mainExp.fixupVariables(vars, globalsSize);
-  }
-
-  /**
-   * Set the raw expression object for this object.
-   *
-   *
-   * @param exp the raw Expression object, which should not normally be null.
-   */
-  public void setExpression(Expression exp)
-  {
-    m_mainExp = exp;
-  }
-
-  /**
-   * Get the SourceLocator on the expression object.
-   *
-   *
-   * @return the SourceLocator on the expression object, which may be null.
-   */
-  public SourceLocator getLocator()
-  {
-    return m_mainExp.m_slocator;
-  }
-
-  /**
-   * Set the SourceLocator on the expression object.
-   *
-   *
-   * @param l the SourceLocator on the expression object, which may be null.
-   */
-  public void setLocator(SourceLocator l)
-  {
-    // Note potential hazards -- l may not be serializable, or may be changed
-      // after being assigned here.
-    m_mainExp.setSourceLocator(l);
-  }
-
-  /** The pattern string, mainly kept around for diagnostic purposes.
-   *  @serial  */
-  String m_patternString;
-
-  /**
-   * Return the XPath string associated with this object.
-   *
-   *
-   * @return the XPath string associated with this object.
-   */
-  public String getPatternString()
-  {
-    return m_patternString;
-  }
-
-  /** Represents a select type expression. */
-  public static final int SELECT = 0;
-
-  /** Represents a match type expression.  */
-  public static final int MATCH = 1;
-
-  /**
-   * Construct an XPath object.  The object must be initialized by the
-   * XPathParser.initXPath method.
-   *
-   * @param exprString The XPath expression.
-   * @param locator The location of the expression, may be null.
-   * @param prefixResolver A prefix resolver to use to resolve prefixes to 
-   *                       namespace URIs.
-   * @param type one of {@link #SELECT} or {@link #MATCH}.
-   * @param errorListener The error listener, or null if default should be used.
-   *
-   * @throws javax.xml.transform.TransformerException if syntax or other error.
-   */
-  public XPath(
-          String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type,
-          ErrorListener errorListener)
-            throws javax.xml.transform.TransformerException
-  {      
-    if(null == errorListener)
-      errorListener = new org.apache.xml.utils.DefaultErrorHandler();
-    
-    m_patternString = exprString;
-
-    XPathParser parser = new XPathParser(errorListener, locator);
-    Compiler compiler = new Compiler(errorListener, locator);
-
-    if (SELECT == type)
-      parser.initXPath(compiler, exprString, prefixResolver);
-    else if (MATCH == type)
-      parser.initMatchPattern(compiler, exprString, prefixResolver);
-    else
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE, new Object[]{Integer.toString(type)})); //"Can not deal with XPath type: " + type);
-
-    // System.out.println("----------------");
-    Expression expr = compiler.compile(0);
-
-    // System.out.println("expr: "+expr);
-    this.setExpression(expr);
-
-  }
-  
-  /**
-   * Construct an XPath object.  The object must be initialized by the
-   * XPathParser.initXPath method.
-   *
-   * @param exprString The XPath expression.
-   * @param locator The location of the expression, may be null.
-   * @param prefixResolver A prefix resolver to use to resolve prefixes to 
-   *                       namespace URIs.
-   * @param type one of {@link #SELECT} or {@link #MATCH}.
-   *
-   * @throws javax.xml.transform.TransformerException if syntax or other error.
-   */
-  public XPath(
-          String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type)
-            throws javax.xml.transform.TransformerException
-  {  
-    this(exprString, locator, prefixResolver, type, null);    
-  }
-
-  /**
-   * Construct an XPath object.
-   *
-   * @param expr The Expression object.
-   *
-   * @throws javax.xml.transform.TransformerException if syntax or other error.
-   */
-  public XPath(Expression expr)
-  {  
-    this.setExpression(expr);   
-  }
-  
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Given an expression and a context, evaluate the XPath
-   * and return the result.
-   * 
-   * @param xctxt The execution context.
-   * @param contextNode The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * XPath are supposed to be expanded.
-   *
-   * @return The result of the XPath or null if callbacks are used.
-   * @throws TransformerException thrown if
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(
-          XPathContext xctxt, org.w3c.dom.Node contextNode, 
-          PrefixResolver namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-    return execute(
-          xctxt, xctxt.getDTMHandleFromNode(contextNode), 
-          namespaceContext);
-  }
-  
-
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Given an expression and a context, evaluate the XPath
-   * and return the result.
-   * 
-   * @param xctxt The execution context.
-   * @param contextNode The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * XPath are supposed to be expanded.
-   * 
-   * @throws TransformerException thrown if the active ProblemListener decides
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(
-          XPathContext xctxt, int contextNode, PrefixResolver namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    xctxt.pushNamespaceContext(namespaceContext);
-
-    xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
-    XObject xobj = null;
-
-    try
-    {
-      xobj = m_mainExp.execute(xctxt);
-    }
-    catch (TransformerException te)
-    {
-      te.setLocator(this.getLocator());
-      ErrorListener el = xctxt.getErrorListener();
-      if(null != el) // defensive, should never happen.
-      {
-        el.error(te);
-      }
-      else
-        throw te;
-    }
-    catch (Exception e)
-    {
-      while (e instanceof org.apache.xml.utils.WrappedRuntimeException)
-      {
-        e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException();
-      }
-      // e.printStackTrace();
-
-      String msg = e.getMessage();
-      msg = (msg == null || msg.length()== 0)? "Unknown error in XPath" : msg;
-      TransformerException te = new TransformerException(msg,
-              getLocator(), e);
-      ErrorListener el = xctxt.getErrorListener();
-      // te.printStackTrace();
-      if(null != el) // defensive, should never happen.
-      {
-        el.fatalError(te);
-      }
-      else
-        throw te;
-    }
-    finally
-    {
-      xctxt.popNamespaceContext();
-
-      xctxt.popCurrentNodeAndExpression();
-    }
-
-    return xobj;
-  }
-  
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Given an expression and a context, evaluate the XPath
-   * and return the result.
-   * 
-   * @param xctxt The execution context.
-   * @param contextNode The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * XPath are supposed to be expanded.
-   * 
-   * @throws TransformerException thrown if the active ProblemListener decides
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool(
-          XPathContext xctxt, int contextNode, PrefixResolver namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    xctxt.pushNamespaceContext(namespaceContext);
-
-    xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
-    try
-    {
-      return m_mainExp.bool(xctxt);
-    }
-    catch (TransformerException te)
-    {
-      te.setLocator(this.getLocator());
-      ErrorListener el = xctxt.getErrorListener();
-      if(null != el) // defensive, should never happen.
-      {
-        el.error(te);
-      }
-      else
-        throw te;
-    }
-    catch (Exception e)
-    {
-      while (e instanceof org.apache.xml.utils.WrappedRuntimeException)
-      {
-        e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException();
-      }
-      // e.printStackTrace();
-
-      String msg = e.getMessage();
-      msg = (msg == null || msg.length()== 0)? "Unknown error in XPath" : msg;
-      TransformerException te = new TransformerException(msg,
-              getLocator(), e);
-      ErrorListener el = xctxt.getErrorListener();
-      // te.printStackTrace();
-      if(null != el) // defensive, should never happen.
-      {
-        el.fatalError(te);
-      }
-      else
-        throw te;
-    }
-    finally
-    {
-      xctxt.popNamespaceContext();
-
-      xctxt.popCurrentNodeAndExpression();
-    }
-
-    return false;
-  }
-
-  /** Set to true to get diagnostic messages about the result of 
-   *  match pattern testing.  */
-  private static final boolean DEBUG_MATCHES = false;
-
-  /**
-   * Get the match score of the given node.
-   *
-   * @param xctxt XPath runtime context.
-   * @param context The current source tree context node.
-   * 
-   * @return score, one of {@link #MATCH_SCORE_NODETEST},
-   * {@link #MATCH_SCORE_NONE}, {@link #MATCH_SCORE_OTHER}, 
-   * or {@link #MATCH_SCORE_QNAME}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double getMatchScore(XPathContext xctxt, int context)
-          throws javax.xml.transform.TransformerException
-  {
-
-    xctxt.pushCurrentNode(context);
-    xctxt.pushCurrentExpressionNode(context);
-
-    try
-    {
-      XObject score = m_mainExp.execute(xctxt);
-
-      if (DEBUG_MATCHES)
-      {
-        DTM dtm = xctxt.getDTM(context);
-        System.out.println("score: " + score.num() + " for "
-                           + dtm.getNodeName(context) + " for xpath "
-                           + this.getPatternString());
-      }
-
-      return score.num();
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-      xctxt.popCurrentExpressionNode();
-    }
-
-    // return XPath.MATCH_SCORE_NONE;
-  }
-
-  /**
-   * Install a built-in function.
-   * @param name The unqualified name of the function.
-   * @param funcIndex The index of the function in the table.
-   * @param func A Implementation of an XPath Function object.
-   * @return the position of the function in the internal index.
-   */
-  public void installFunction(String name, int funcIndex, Function func)
-  {
-    FunctionTable.installFunction(func, funcIndex);
-  }
-
-  /**
-   * Warn the user of an problem.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param sourceNode Not used.
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  public void warn(
-          XPathContext xctxt, int sourceNode, int msg, Object[] args)
-            throws javax.xml.transform.TransformerException
-  {
-
-    String fmsg = XSLMessages.createXPATHWarning(msg, args);
-    ErrorListener ehandler = xctxt.getErrorListener();
-
-    if (null != ehandler)
-    {
-
-      // TO DO: Need to get stylesheet Locator from here.
-      ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator()));
-    }
-  }
-
-  /**
-   * Tell the user of an assertion error, and probably throw an
-   * exception.
-   *
-   * @param b  If false, a runtime exception will be thrown.
-   * @param msg The assertion message, which should be informative.
-   * 
-   * @throws RuntimeException if the b argument is false.
-   */
-  public void assertion(boolean b, String msg)
-  {
-
-    if (!b)
-    {
-      String fMsg = XSLMessages.createXPATHMessage(
-        XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
-        new Object[]{ msg });
-
-      throw new RuntimeException(fMsg);
-    }
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param sourceNode Not used.
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  public void error(
-          XPathContext xctxt, int sourceNode, int msg, Object[] args)
-            throws javax.xml.transform.TransformerException
-  {
-
-    String fmsg = XSLMessages.createXPATHMessage(msg, args);
-    ErrorListener ehandler = xctxt.getErrorListener();
-
-    if (null != ehandler)
-    {
-      ehandler.fatalError(new TransformerException(fmsg,
-                              (SAXSourceLocator)xctxt.getSAXLocator()));
-    }
-    else
-    {
-      SourceLocator slocator = xctxt.getSAXLocator();
-      System.out.println(fmsg + "; file " + slocator.getSystemId()
-                         + "; line " + slocator.getLineNumber() + "; column "
-                         + slocator.getColumnNumber());
-    }
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The match score if no match is made.
-   */
-  public static final double MATCH_SCORE_NONE = Double.NEGATIVE_INFINITY;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The match score if the pattern has the form
-   * of a QName optionally preceded by an @ character.
-   */
-  public static final double MATCH_SCORE_QNAME = 0.0;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The match score if the pattern pattern has the form NCName:*.
-   */
-  public static final double MATCH_SCORE_NSWILD = -0.25;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The match score if the pattern consists of just a NodeTest.
-   */
-  public static final double MATCH_SCORE_NODETEST = -0.5;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * The match score if the pattern consists of something
-   * other than just a NodeTest or just a qname.
-   */
-  public static final double MATCH_SCORE_OTHER = 0.5;
-}
diff --git a/src/org/apache/xpath/XPathAPI.java b/src/org/apache/xpath/XPathAPI.java
deleted file mode 100644
index 5f8c358..0000000
--- a/src/org/apache/xpath/XPathAPI.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.NodeList;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.XPathParser;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolverDefault;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.objects.XObject;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.ref.DTMNodeIterator;
-import org.apache.xml.dtm.ref.DTMNodeList;
-import org.apache.xml.dtm.ref.DTMManagerDefault;
-
-/**
- * The methods in this class are convenience methods into the
- * low-level XPath API.
- * These functions tend to be a little slow, since a number of objects must be
- * created for each evaluation.  A faster way is to precompile the
- * XPaths using the low-level API, and then just use the XPaths
- * over and over.
- * @see <a href="http://www.w3.org/TR/xpath">XPath Specification</a>
- */
-public class XPathAPI
-{
-
-  /**
-   * Use an XPath string to select a single node. XPath namespace
-   * prefixes are resolved from the context node, which may not
-   * be what you want (see the next method).
-   *
-   * @param contextNode The node to start searching from.
-   * @param str A valid XPath string.
-   * @return The first node found that matches the XPath, or null.
-   *
-   * @throws TransformerException
-   */
-  public static Node selectSingleNode(Node contextNode, String str)
-          throws TransformerException
-  {
-    return selectSingleNode(contextNode, str, contextNode);
-  }
-
-  /**
-   * Use an XPath string to select a single node.
-   * XPath namespace prefixes are resolved from the namespaceNode.
-   *
-   * @param contextNode The node to start searching from.
-   * @param str A valid XPath string.
-   * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
-   * @return The first node found that matches the XPath, or null.
-   *
-   * @throws TransformerException
-   */
-  public static Node selectSingleNode(
-          Node contextNode, String str, Node namespaceNode)
-            throws TransformerException
-  {
-
-    // Have the XObject return its result as a NodeSetDTM.
-    NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode);
-
-    // Return the first node, or null
-    return nl.nextNode();
-  }
-
-  /**
-   *  Use an XPath string to select a nodelist.
-   *  XPath namespace prefixes are resolved from the contextNode.
-   *
-   *  @param contextNode The node to start searching from.
-   *  @param str A valid XPath string.
-   *  @return A NodeIterator, should never be null.
-   *
-   * @throws TransformerException
-   */
-  public static NodeIterator selectNodeIterator(Node contextNode, String str)
-          throws TransformerException
-  {
-    return selectNodeIterator(contextNode, str, contextNode);
-  }
-
-  /**
-   *  Use an XPath string to select a nodelist.
-   *  XPath namespace prefixes are resolved from the namespaceNode.
-   *
-   *  @param contextNode The node to start searching from.
-   *  @param str A valid XPath string.
-   *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
-   *  @return A NodeIterator, should never be null.
-   *
-   * @throws TransformerException
-   */
-  public static NodeIterator selectNodeIterator(
-          Node contextNode, String str, Node namespaceNode)
-            throws TransformerException
-  {
-
-    // Execute the XPath, and have it return the result
-    XObject list = eval(contextNode, str, namespaceNode);
-
-    // Have the XObject return its result as a NodeSetDTM.                
-    return list.nodeset();
-  }
-
-  /**
-   *  Use an XPath string to select a nodelist.
-   *  XPath namespace prefixes are resolved from the contextNode.
-   *
-   *  @param contextNode The node to start searching from.
-   *  @param str A valid XPath string.
-   *  @return A NodeIterator, should never be null.
-   *
-   * @throws TransformerException
-   */
-  public static NodeList selectNodeList(Node contextNode, String str)
-          throws TransformerException
-  {
-    return selectNodeList(contextNode, str, contextNode);
-  }
-
-  /**
-   *  Use an XPath string to select a nodelist.
-   *  XPath namespace prefixes are resolved from the namespaceNode.
-   *
-   *  @param contextNode The node to start searching from.
-   *  @param str A valid XPath string.
-   *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
-   *  @return A NodeIterator, should never be null.
-   *
-   * @throws TransformerException
-   */
-  public static NodeList selectNodeList(
-          Node contextNode, String str, Node namespaceNode)
-            throws TransformerException
-  {
-
-    // Execute the XPath, and have it return the result
-    XObject list = eval(contextNode, str, namespaceNode);
-
-    // Return a NodeList.
-    return list.nodelist();
-  }
-
-  /**
-   *  Evaluate XPath string to an XObject.  Using this method,
-   *  XPath namespace prefixes will be resolved from the namespaceNode.
-   *  @param contextNode The node to start searching from.
-   *  @param str A valid XPath string.
-   *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
-   *  @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
-   *  @see org.apache.xpath.objects.XObject
-   *  @see org.apache.xpath.objects.XNull
-   *  @see org.apache.xpath.objects.XBoolean
-   *  @see org.apache.xpath.objects.XNumber
-   *  @see org.apache.xpath.objects.XString
-   *  @see org.apache.xpath.objects.XRTreeFrag
-   *
-   * @throws TransformerException
-   */
-  public static XObject eval(Node contextNode, String str)
-          throws TransformerException
-  {
-    return eval(contextNode, str, contextNode);
-  }
-
-  /**
-   *  Evaluate XPath string to an XObject.
-   *  XPath namespace prefixes are resolved from the namespaceNode.
-   *  The implementation of this is a little slow, since it creates
-   *  a number of objects each time it is called.  This could be optimized
-   *  to keep the same objects around, but then thread-safety issues would arise.
-   *
-   *  @param contextNode The node to start searching from.
-   *  @param str A valid XPath string.
-   *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
-   *  @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
-   *  @see org.apache.xpath.objects.XObject
-   *  @see org.apache.xpath.objects.XNull
-   *  @see org.apache.xpath.objects.XBoolean
-   *  @see org.apache.xpath.objects.XNumber
-   *  @see org.apache.xpath.objects.XString
-   *  @see org.apache.xpath.objects.XRTreeFrag
-   *
-   * @throws TransformerException
-   */
-  public static XObject eval(Node contextNode, String str, Node namespaceNode)
-          throws TransformerException
-  {
-
-    // Since we don't have a XML Parser involved here, install some default support
-    // for things like namespaces, etc.
-    // (Changed from: XPathContext xpathSupport = new XPathContext();
-    //    because XPathContext is weak in a number of areas... perhaps
-    //    XPathContext should be done away with.)
-    XPathContext xpathSupport = new XPathContext();
-
-    // Create an object to resolve namespace prefixes.
-    // XPath namespaces are resolved from the input context node's document element
-    // if it is a root node, or else the current context node (for lack of a better
-    // resolution space, given the simplicity of this sample code).
-    PrefixResolverDefault prefixResolver = new PrefixResolverDefault(
-      (namespaceNode.getNodeType() == Node.DOCUMENT_NODE)
-      ? ((Document) namespaceNode).getDocumentElement() : namespaceNode);
-
-    // Create the XPath object.
-    XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
-
-    // Execute the XPath, and have it return the result
-    // return xpath.execute(xpathSupport, contextNode, prefixResolver);
-    int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
-
-    return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
-  }
-
-  /**
-   *   Evaluate XPath string to an XObject.
-   *   XPath namespace prefixes are resolved from the namespaceNode.
-   *   The implementation of this is a little slow, since it creates
-   *   a number of objects each time it is called.  This could be optimized
-   *   to keep the same objects around, but then thread-safety issues would arise.
-   *
-   *   @param contextNode The node to start searching from.
-   *   @param str A valid XPath string.
-   *   @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
-   *   @param prefixResolver Will be called if the parser encounters namespace
-   *                         prefixes, to resolve the prefixes to URLs.
-   *   @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
-   *   @see org.apache.xpath.objects.XObject
-   *   @see org.apache.xpath.objects.XNull
-   *   @see org.apache.xpath.objects.XBoolean
-   *   @see org.apache.xpath.objects.XNumber
-   *   @see org.apache.xpath.objects.XString
-   *   @see org.apache.xpath.objects.XRTreeFrag
-   *
-   * @throws TransformerException
-   */
-  public static XObject eval(
-          Node contextNode, String str, PrefixResolver prefixResolver)
-            throws TransformerException
-  {
-
-    // Since we don't have a XML Parser involved here, install some default support
-    // for things like namespaces, etc.
-    // (Changed from: XPathContext xpathSupport = new XPathContext();
-    //    because XPathContext is weak in a number of areas... perhaps
-    //    XPathContext should be done away with.)
-    // Create the XPath object.
-    XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
-
-    // Execute the XPath, and have it return the result
-    XPathContext xpathSupport = new XPathContext();
-    int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
-
-    return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
-  }
-}
diff --git a/src/org/apache/xpath/XPathContext.java b/src/org/apache/xpath/XPathContext.java
deleted file mode 100644
index 48a4c45..0000000
--- a/src/org/apache/xpath/XPathContext.java
+++ /dev/null
@@ -1,1152 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-// Java lib imports
-import java.io.File;
-import java.io.IOException;
-
-import java.util.Stack;
-
-import java.lang.reflect.Method;
-
-// Xalan imports
-import org.apache.xml.utils.IntStack;
-import org.apache.xml.utils.NSInfo;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.NodeVector;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.axes.SubContextList;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.objects.XString;
-
-import org.apache.xalan.extensions.ExpressionContext;
-
-// SAX2 imports
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-// import org.xml.sax.Locator;
-
-// TRaX imports
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.dom.DOMSource;
-
-// Temporary!!!
-import org.apache.xalan.extensions.ExtensionsTable;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.Source;
-import javax.xml.transform.ErrorListener;
-
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMWSFilter;
-import org.apache.xml.dtm.Axis;
-
-// Utility imports.
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-
-import org.apache.xpath.axes.DescendantIterator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Default class for the runtime execution context for XPath.
- * 
- * <p>This class extends DTMManager but does not directly implement it.</p>
- */
-public class XPathContext extends DTMManager // implements ExpressionContext
-{
-  /**
-   * Though XPathContext context extends 
-   * the DTMManager, it really is a proxy for this object, which 
-   * is the real DTMManager.
-   */
-  private DTMManager m_dtmManager = DTMManager.newInstance(
-                   org.apache.xpath.objects.XMLStringFactoryImpl.getFactory());
-  
-  /**
-   * Return the DTMManager object.  Though XPathContext context extends 
-   * the DTMManager, it really is a proxy for the real DTMManager.  If a 
-   * caller needs to make a lot of calls to the DTMManager, it is faster 
-   * if it gets the real one from this function.
-   */
-   public DTMManager getDTMManager()
-   {
-     return m_dtmManager;
-   }
-  
-  /**
-   * Get an instance of a DTM, loaded with the content from the
-   * specified source.  If the unique flag is true, a new instance will
-   * always be returned.  Otherwise it is up to the DTMManager to return a
-   * new instance or an instance that it already created and may be being used
-   * by someone else.
-   * (I think more parameters will need to be added for error handling, and entity
-   * resolution).
-   *
-   * @param source the specification of the source object, which may be null, 
-   *               in which case it is assumed that node construction will take 
-   *               by some other means.
-   * @param unique true if the returned DTM must be unique, probably because it
-   * is going to be mutated.
-   * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may 
-   *                         be null.
-   * @param incremental true if the construction should try and be incremental.
-   * @param doIndexing true if the caller considers it worth it to use 
-   *                   indexing schemes.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(javax.xml.transform.Source source, boolean unique, 
-                    DTMWSFilter wsfilter,
-                    boolean incremental,
-                    boolean doIndexing)
-  {
-    return m_dtmManager.getDTM(source, unique, wsfilter, 
-                               incremental, doIndexing);
-  }
-                             
-  /**
-   * Get an instance of a DTM that "owns" a node handle.
-   *
-   * @param nodeHandle the nodeHandle.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(int nodeHandle)
-  {
-    return m_dtmManager.getDTM(nodeHandle);
-  }
-//  
-  /**
-   * Given a W3C DOM node, try and return a DTM handle.
-   * Note: calling this may be non-optimal.
-   * 
-   * @param node Non-null reference to a DOM node.
-   * 
-   * @return a valid DTM handle.
-   */
-  public int getDTMHandleFromNode(org.w3c.dom.Node node)
-  {
-    return m_dtmManager.getDTMHandleFromNode(node);
-  }
-//
-//  
-  /**
-   * %TBD% Doc
-   */
-  public int getDTMIdentity(DTM dtm)
-  {
-    return m_dtmManager.getDTMIdentity(dtm);
-  }
-//  
-  /**
-   * Creates an empty <code>DocumentFragment</code> object. 
-   * @return A new <code>DocumentFragment handle</code>.
-   */
-  public DTM createDocumentFragment()
-  {
-    return m_dtmManager.createDocumentFragment();
-  }
-//  
-  /**
-   * Release a DTM either to a lru pool, or completely remove reference.
-   * DTMs without system IDs are always hard deleted.
-   * State: experimental.
-   * 
-   * @param dtm The DTM to be released.
-   * @param shouldHardDelete True if the DTM should be removed no matter what.
-   * @return true if the DTM was removed, false if it was put back in a lru pool.
-   */
-  public boolean release(DTM dtm, boolean shouldHardDelete)
-  {
-    return m_dtmManager.release(dtm, shouldHardDelete);
-  }
-
-  /**
-   * Create a new <code>DTMIterator</code> based on an XPath
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
-   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
-   *
-   * @param xpathCompiler ??? Somehow we need to pass in a subpart of the
-   * expression.  I hate to do this with strings, since the larger expression
-   * has already been parsed.
-   *
-   * @param pos The position in the expression.
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
-  {
-    return m_dtmManager.createDTMIterator(xpathCompiler, pos);
-  }
-//
-  /**
-   * Create a new <code>DTMIterator</code> based on an XPath
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
-   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
-   *
-   * @param xpathString Must be a valid string expressing a
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
-   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
-   *
-   * @param presolver An object that can resolve prefixes to namespace URLs.
-   *
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public DTMIterator createDTMIterator(String xpathString,
-          PrefixResolver presolver)
-  {
-    return m_dtmManager.createDTMIterator(xpathString, presolver);
-  }
-//
-  /**
-   * Create a new <code>DTMIterator</code> based only on a whatToShow and
-   * a DTMFilter.  The traversal semantics are defined as the descendant
-   * access.
-   *
-   * @param whatToShow This flag specifies which node types may appear in
-   *   the logical view of the tree presented by the iterator. See the
-   *   description of <code>NodeFilter</code> for the set of possible
-   *   <code>SHOW_</code> values.These flags can be combined using
-   *   <code>OR</code>.
-   * @param filter The <code>NodeFilter</code> to be used with this
-   *   <code>TreeWalker</code>, or <code>null</code> to indicate no filter.
-   * @param entityReferenceExpansion The value of this flag determines
-   *   whether entity reference nodes are expanded.
-   *
-   * @return The newly created <code>NodeIterator</code>.
-   */
-  public DTMIterator createDTMIterator(int whatToShow,
-          DTMFilter filter, boolean entityReferenceExpansion)
-  {
-    return m_dtmManager.createDTMIterator(whatToShow, filter, entityReferenceExpansion);
-  }
-  
-  /**
-   * Create a new <code>DTMIterator</code> that holds exactly one node.
-   *
-   * @param node The node handle that the DTMIterator will iterate to.
-   *
-   * @return The newly created <code>DTMIterator</code>.
-   */
-  public DTMIterator createDTMIterator(int node)
-  {
-    // DescendantIterator iter = new DescendantIterator();
-    DTMIterator iter = new org.apache.xpath.axes.OneStepIteratorForward(Axis.SELF);
-    iter.setRoot(node, this);
-    return iter;
-    // return m_dtmManager.createDTMIterator(node);
-  }
-
-  /**
-   * Create an XPathContext instance.
-   */
-  public XPathContext()
-  {
-    m_prefixResolvers[m_prefixResolversTop++] = null;
-    m_currentNodes[m_currentNodesFirstFree++] = DTM.NULL;
-    m_currentNodes[m_currentExpressionNodesFirstFree++] = DTM.NULL;
-    m_saxLocations[m_saxLocationsTop++] = null;
-  }
-
-  /**
-   * Create an XPathContext instance.
-   * @param owner Value that can be retrieved via the getOwnerObject() method.
-   * @see #getOwnerObject
-   */
-  public XPathContext(Object owner)
-  {
-    m_owner = owner;
-    try {
-      m_ownerGetErrorListener = m_owner.getClass().getMethod("getErrorListener", new Class[] {});
-    }
-    catch (NoSuchMethodException nsme) {}
-    m_prefixResolvers[m_prefixResolversTop++] = null;
-    m_currentNodes[m_currentNodesFirstFree++] = DTM.NULL;
-    m_currentNodes[m_currentExpressionNodesFirstFree++] = DTM.NULL;
-    m_saxLocations[m_saxLocationsTop++] = null;
-  }
-
-  /**
-   * Reset for new run.
-   */
-  public void reset()
-  {
-    m_dtmManager = DTMManager.newInstance(
-                   org.apache.xpath.objects.XMLStringFactoryImpl.getFactory());
-  }
-
-  /** The current stylesheet locator. */
-  SourceLocator[] m_saxLocations = new SourceLocator[RECURSIONLIMIT];
-  int m_saxLocationsTop = 0;
-
-  /**
-   * Set the current locater in the stylesheet.
-   *
-   * @param location The location within the stylesheet.
-   */
-  public void setSAXLocator(SourceLocator location)
-  {
-    m_saxLocations[m_saxLocationsTop-1] = location;
-  }
-  
-  /**
-   * Set the current locater in the stylesheet.
-   *
-   * @param location The location within the stylesheet.
-   */
-  public void pushSAXLocator(SourceLocator location)
-  {
-    m_saxLocations[m_saxLocationsTop++] = location;
-  }
-  
-  /**
-   * Push a slot on the locations stack so that setSAXLocator can be 
-   * repeatedly called.
-   *
-   * @param location The location within the stylesheet.
-   */
-  public void pushSAXLocatorNull()
-  {
-    m_saxLocationsTop++;
-  }
-
-
-  /**
-   * Pop the current locater.
-   */
-  public void popSAXLocator()
-  {
-    m_saxLocationsTop--;
-  }
-
-  /**
-   * Get the current locater in the stylesheet.
-   *
-   * @return The location within the stylesheet, or null if not known.
-   */
-  public SourceLocator getSAXLocator()
-  {
-    return m_saxLocations[m_saxLocationsTop-1];
-  }
-
-  /** The owner context of this XPathContext.  In the case of XSLT, this will be a
-   *  Transformer object.
-   */
-  private Object m_owner;
-
-  /** The owner context of this XPathContext.  In the case of XSLT, this will be a
-   *  Transformer object.
-   */
-  private Method m_ownerGetErrorListener;
-
-  /**
-   * Get the "owner" context of this context, which should be,
-   * in the case of XSLT, the Transformer object.  This is needed
-   * so that XSLT functions can get the Transformer.
-   * @return The owner object passed into the constructor, or null.
-   */
-  public Object getOwnerObject()
-  {
-    return m_owner;
-  }
-
-  // ================ extensionsTable ===================
-
-  /**
-   * The table of Extension Handlers.
-   */
-  private ExtensionsTable m_extensionsTable = new ExtensionsTable();
-
-  /**
-   * Get the extensions table object.
-   *
-   * @return The extensions table.
-   */
-  public ExtensionsTable getExtensionsTable()
-  {
-    return m_extensionsTable;
-  }
-
-  /**
-   * Set the extensions table object.
-   *
-   *
-   * @param table The extensions table object.
-   */
-  void setExtensionsTable(ExtensionsTable table)
-  {
-    m_extensionsTable = table;
-  }
-
-  // ================ VarStack ===================
-
-  /**
-   * The stack of Variable stacks.  A VariableStack will be
-   * pushed onto this stack for each template invocation.
-   */
-  private VariableStack m_variableStacks = new VariableStack();
-
-  /**
-   * Get the variable stack, which is in charge of variables and
-   * parameters.
-   *
-   * @return the variable stack, which should not be null.
-   */
-  public final VariableStack getVarStack()
-  {
-    return m_variableStacks;
-  }
-
-  /**
-   * Get the variable stack, which is in charge of variables and
-   * parameters.
-   *
-   * @param varStack non-null reference to the variable stack.
-   */
-  public final void setVarStack(VariableStack varStack)
-  {
-    m_variableStacks = varStack;
-  }
-
-  // ================ SourceTreeManager ===================
-
-  /** The source tree manager, which associates Source objects to source 
-   *  tree nodes. */
-  private SourceTreeManager m_sourceTreeManager = new SourceTreeManager();
-
-  /**
-   * Get the SourceTreeManager associated with this execution context.
-   *
-   * @return the SourceTreeManager associated with this execution context.
-   */
-  public final SourceTreeManager getSourceTreeManager()
-  {
-    return m_sourceTreeManager;
-  }
-
-  /**
-   * Set the SourceTreeManager associated with this execution context.
-   *
-   * @param mgr the SourceTreeManager to be associated with this 
-   *        execution context.
-   */
-  public void setSourceTreeManager(SourceTreeManager mgr)
-  {
-    m_sourceTreeManager = mgr;
-  }
-  
-  // =================================================
-
-  /** The ErrorListener where errors and warnings are to be reported.   */
-  private ErrorListener m_errorListener;
-
-  /** A default ErrorListener in case our m_errorListener was not specified and our
-   *  owner either does not have an ErrorListener or has a null one.
-   */
-  private ErrorListener m_defaultErrorListener;
-
-  /**
-   * Get the ErrorListener where errors and warnings are to be reported.
-   *
-   * @return A non-null ErrorListener reference.
-   */
-  public final ErrorListener getErrorListener()
-  {
-
-    if (null != m_errorListener)
-        return m_errorListener;
-
-    ErrorListener retval = null;
-
-    try {
-      if (null != m_ownerGetErrorListener)
-        retval = (ErrorListener) m_ownerGetErrorListener.invoke(m_owner, new Object[] {});
-    }
-    catch (Exception e) {}
-
-    if (null == retval)
-    {
-      if (null == m_defaultErrorListener) 
-        m_defaultErrorListener = new org.apache.xml.utils.DefaultErrorHandler();
-      retval = m_defaultErrorListener;
-    }
-
-    return retval;
-  }
-
-  /**
-   * Set the ErrorListener where errors and warnings are to be reported.
-   *
-   * @param listener A non-null ErrorListener reference.
-   */
-  public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
-  {
-    if (listener == null) 
-      throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler");
-    m_errorListener = listener;
-  }
-
-
-  // =================================================
-
-  /** The TrAX URI Resolver for resolving URIs from the document(...)
-   *  function to source tree nodes.  */
-  private URIResolver m_uriResolver;
-
-  /**
-   * Get the URIResolver associated with this execution context.
-   *
-   * @return a URI resolver, which may be null.
-   */
-  public final URIResolver getURIResolver()
-  {
-    return m_uriResolver;
-  }
-
-  /**
-   * Set the URIResolver associated with this execution context.
-   *
-   * @param resolver the URIResolver to be associated with this 
-   *        execution context, may be null to clear an already set resolver.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-    m_uriResolver = resolver;
-  }
-
-  // =================================================
-
-  /** The reader of the primary source tree.    */
-  public XMLReader m_primaryReader;
-
-  /**
-   * Get primary XMLReader associated with this execution context.
-   *
-   * @return The reader of the primary source tree.
-   */
-  public final XMLReader getPrimaryReader()
-  {
-    return m_primaryReader;
-  }
-
-  /**
-   * Set primary XMLReader associated with this execution context.
-   *
-   * @param reader The reader of the primary source tree.
-   */
-  public void setPrimaryReader(XMLReader reader)
-  {
-    m_primaryReader = reader;
-  }
-
-  // =================================================
-
-
-  /** Misnamed string manager for XPath messages.  */
-  private static XSLMessages m_XSLMessages = new XSLMessages();
-
-  /**
-   * Tell the user of an assertion error, and probably throw an
-   * exception.
-   *
-   * @param b  If false, a TransformerException will be thrown.
-   * @param msg The assertion message, which should be informative.
-   * 
-   * @throws javax.xml.transform.TransformerException if b is false.
-   */
-  private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException
-  {
-
-    ErrorListener errorHandler = getErrorListener();
-
-    if (errorHandler != null)
-    {
-      errorHandler.fatalError(
-        new TransformerException(
-          m_XSLMessages.createMessage(
-            XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
-            new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator()));
-    }
-  }
-
-  //==========================================================
-  // SECTION: Execution context state tracking
-  //==========================================================
-  
-  /**
-   * The current context node list.
-   */
-  private Stack m_contextNodeLists = new Stack();
-  
-  public Stack getContextNodeListsStack() { return m_contextNodeLists; }
-  public void setContextNodeListsStack(Stack s) { m_contextNodeLists = s; }
-
-  /**
-   * Get the current context node list.
-   *
-   * @return  the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
-   * also refered to here as a <term>context node list</term>.
-   */
-  public final DTMIterator getContextNodeList()
-  {
-
-    if (m_contextNodeLists.size() > 0)
-      return (DTMIterator) m_contextNodeLists.peek();
-    else
-      return null;
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Set the current context node list.
-   *
-   * @param nl the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
-   * also refered to here as a <term>context node list</term>.
-   */
-  public final void pushContextNodeList(DTMIterator nl)
-  {
-    m_contextNodeLists.push(nl);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Pop the current context node list.
-   */
-  public final void popContextNodeList()
-  {
-    m_contextNodeLists.pop();
-  }
-
-  /**
-   * The ammount to use for stacks that record information during the 
-   * recursive execution.
-   */
-  public static final int RECURSIONLIMIT = (1024*4);
-
-  /** The stack of <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a> objects.
-   *  Not to be confused with the current node list.  %REVIEW% Note that there 
-   *  are no bounds check and resize for this stack, so if it is blown, it's all 
-   *  over.  */
-  private int m_currentNodes[] = new int[RECURSIONLIMIT];
-  protected int m_currentNodesFirstFree = 0;
-   
-//  private NodeVector m_currentNodes = new NodeVector();
-  
-  public int[] getCurrentNodeStack() {return m_currentNodes; }
-  public void setCurrentNodeStack(int[] nv) { m_currentNodes = nv; }
-
-  /**
-   * Get the current context node.
-   *
-   * @return the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
-   */
-  public final int getCurrentNode()
-  {
-    return m_currentNodes[m_currentNodesFirstFree-1];
-  }
-  
-  /**
-   * Set the current context node and expression node.
-   *
-   * @param cn the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
-   * @param en the sub-expression context node.
-   */
-  public final void pushCurrentNodeAndExpression(int cn, int en)
-  {
-    m_currentNodes[m_currentNodesFirstFree++] = cn;
-    m_currentExpressionNodes[m_currentExpressionNodesFirstFree++] = cn;
-  }
-
-  /**
-   * Set the current context node.
-   */
-  public final void popCurrentNodeAndExpression()
-  {
-    m_currentNodesFirstFree--;
-    m_currentExpressionNodesFirstFree--;
-  }
-  
-  /**
-   * Push the current context node, expression node, and prefix resolver.
-   *
-   * @param cn the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
-   * @param en the sub-expression context node.
-   * @param nc the namespace context (prefix resolver.
-   */
-  public final void pushExpressionState(int cn, int en, PrefixResolver nc)
-  {
-    m_currentNodes[m_currentNodesFirstFree++] = cn;
-    m_currentExpressionNodes[m_currentExpressionNodesFirstFree++] = cn;
-    m_prefixResolvers[m_prefixResolversTop++] = nc;
-  }
-  
-  /**
-   * Pop the current context node, expression node, and prefix resolver.
-   */
-  public final void popExpressionState()
-  {
-    m_currentNodesFirstFree--;
-    m_currentExpressionNodesFirstFree--;
-    m_prefixResolversTop--;
-  }
-
-
-
-  /**
-   * Set the current context node.
-   *
-   * @param n the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
-   */
-  public final void pushCurrentNode(int n)
-  {
-    m_currentNodes[m_currentNodesFirstFree++] = n;
-  }
-  
-  public int getCurrentNodeFirstFree()
-  {
-    return m_currentNodesFirstFree;
-  }
-
-  /**
-   * Pop the current context node.
-   */
-  public final void popCurrentNode()
-  {
-    m_currentNodesFirstFree--;
-  }
-  
-  /**
-   * Set the current predicate root.
-   */
-  public final void pushPredicateRoot(int n)
-  {
-    m_predicateRoots.push(n);
-  }
-
-  /**
-   * Pop the current predicate root.
-   */
-  public final void popPredicateRoot()
-  {
-    m_predicateRoots.popQuick();
-  }
-
-  /**
-   * Get the current predicate root.
-   */
-  public final int getPredicateRoot()
-  {
-    return m_predicateRoots.peepOrNull();
-  }
-  
-  /**
-   * Set the current location path iterator root.
-   */
-  public final void pushIteratorRoot(int n)
-  {
-    m_iteratorRoots.push(n);
-  }
-
-  /**
-   * Pop the current location path iterator root.
-   */
-  public final void popIteratorRoot()
-  {
-    m_iteratorRoots.popQuick();
-  }
-
-  /**
-   * Get the current location path iterator root.
-   */
-  public final int getIteratorRoot()
-  {
-    return m_iteratorRoots.peepOrNull();
-  }
-  
-  /** A stack of the current sub-expression nodes.  */
-  private NodeVector m_iteratorRoots = new NodeVector();
-
-  
-  /** A stack of the current sub-expression nodes.  */
-  private NodeVector m_predicateRoots = new NodeVector();
-
-  /** A stack of the current sub-expression nodes.  */
-  private int m_currentExpressionNodes[] = new int[RECURSIONLIMIT];
-  protected int m_currentExpressionNodesFirstFree = 0;
-     
-  public int[] getCurrentExpressionNodeStack() { return m_currentExpressionNodes; }
-  public void setCurrentExpressionNodeStack(int[] nv) { m_currentExpressionNodes = nv; }
-  public int getCurrentExpressionNodesFirstFree()
-  {
-    return m_currentExpressionNodesFirstFree;
-  }
-
-  
-  private IntStack m_predicatePos = new IntStack();
-  
-  public final int getPredicatePos()
-  {
-    return m_predicatePos.peek();
-  }
-
-  public final void pushPredicatePos(int n)
-  {
-    m_predicatePos.push(n);
-  }
-
-  public final void popPredicatePos()
-  {
-    m_predicatePos.pop();
-  }
-
-  /**
-   * Get the current node that is the expression's context (i.e. for current() support).
-   *
-   * @return The current sub-expression node.
-   */
-  public final int getCurrentExpressionNode()
-  {
-    return m_currentExpressionNodes[m_currentExpressionNodesFirstFree-1];
-  }
-
-  /**
-   * Set the current node that is the expression's context (i.e. for current() support).
-   *
-   * @param n The sub-expression node to be current.
-   */
-  public final void pushCurrentExpressionNode(int n)
-  {
-    m_currentExpressionNodes[m_currentExpressionNodesFirstFree++] = n;
-  }
-
-  /**
-   * Pop the current node that is the expression's context 
-   * (i.e. for current() support).
-   */
-  public final void popCurrentExpressionNode()
-  {
-    m_currentExpressionNodesFirstFree--;
-  }
-  
-  private PrefixResolver[] m_prefixResolvers 
-                                   = new PrefixResolver[RECURSIONLIMIT];
-  private int m_prefixResolversTop = 0;
-
-  /**
-   * Get the current namespace context for the xpath.
-   *
-   * @return the current prefix resolver for resolving prefixes to 
-   *         namespace URLs.
-   */
-  public final PrefixResolver getNamespaceContext()
-  {
-    return m_prefixResolvers[m_prefixResolversTop-1];
-  }
-
-  /**
-   * Get the current namespace context for the xpath.
-   *
-   * @param pr the prefix resolver to be used for resolving prefixes to 
-   *         namespace URLs.
-   */
-  public final void setNamespaceContext(PrefixResolver pr)
-  {
-    m_prefixResolvers[m_prefixResolversTop-1] = pr;
-  }
-
-  /**
-   * Push a current namespace context for the xpath.
-   *
-   * @param pr the prefix resolver to be used for resolving prefixes to 
-   *         namespace URLs.
-   */
-  public final void pushNamespaceContext(PrefixResolver pr)
-  {
-    m_prefixResolvers[m_prefixResolversTop++] = pr;
-  }
-  
-  /**
-   * Just increment the namespace contest stack, so that setNamespaceContext
-   * can be used on the slot.
-   */
-  public final void pushNamespaceContextNull()
-  {
-    m_prefixResolversTop++;
-  }
-
-  /**
-   * Pop the current namespace context for the xpath.
-   */
-  public final void popNamespaceContext()
-  {
-    m_prefixResolversTop--;
-  }
-
-  //==========================================================
-  // SECTION: Current TreeWalker contexts (for internal use)
-  //==========================================================
-
-  /**
-   * Stack of AxesIterators.
-   */
-  private Stack m_axesIteratorStack = new Stack();
-  
-  public Stack getAxesIteratorStackStacks() { return m_axesIteratorStack; }
-  public void setAxesIteratorStackStacks(Stack s) { m_axesIteratorStack = s; }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Push a TreeWalker on the stack.
-   *
-   * @param iter A sub-context AxesWalker.
-   */
-  public final void pushSubContextList(SubContextList iter)
-  {
-    m_axesIteratorStack.push(iter);
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Pop the last pushed axes iterator.
-   */
-  public final void popSubContextList()
-  {
-    m_axesIteratorStack.pop();
-  }
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the current axes iterator, or return null if none.
-   *
-   * @return the sub-context node list.
-   */
-  public SubContextList getSubContextList()
-  {
-    return m_axesIteratorStack.isEmpty()
-           ? null : (SubContextList) m_axesIteratorStack.peek();
-  }
-  
-  /**
-   * <meta name="usage" content="internal"/>
-   * Get the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a> 
-   * as defined by the XSLT spec.
-   *
-   * @return the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>.
-   */
-  public org.apache.xpath.axes.LocPathIterator getCurrentNodeList()
-  {
-    for (int i = m_axesIteratorStack.size()-1; i >= 0; i--) 
-    {
-      org.apache.xpath.axes.PredicatedNodeTest iter 
-       = (org.apache.xpath.axes.PredicatedNodeTest)m_axesIteratorStack.elementAt(i);
-      org.apache.xpath.axes.LocPathIterator lpi = iter.getLocPathIterator();
-      if(lpi.getIsTopLevel())
-        return lpi;
-    }
-    return null;
-  }
-
-
-  //==========================================================
-  // SECTION: Implementation of ExpressionContext interface
-  //==========================================================
-
-  /**
-   * Get the current context node.
-   * @return The current context node.
-   */
-  public final int getContextNode()
-  {
-    return this.getCurrentNode();
-  }
-
-  /**
-   * Get the current context node list.
-   * @return An iterator for the current context list, as
-   * defined in XSLT.
-   */
-  public final DTMIterator getContextNodes()
-  {
-
-    try
-    {
-      DTMIterator cnl = getContextNodeList();
-
-      if (null != cnl)
-        return cnl.cloneWithReset();
-      else
-        return null;  // for now... this might ought to be an empty iterator.
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      return null;  // error reporting?
-    }
-  }
-  
-  XPathExpressionContext expressionContext = new XPathExpressionContext();
-  
-  /**
-   * The the expression context for extensions for this context.
-   * 
-   * @return An object that implements the ExpressionContext.
-   */
-  public ExpressionContext getExpressionContext()
-  {
-    return expressionContext;
-  }
-  
-  public class XPathExpressionContext implements ExpressionContext
-  {
-    /**
-     * Return the XPathContext associated with this XPathExpressionContext.
-     * Extensions should use this judiciously and only when special processing
-     * requirements cannot be met another way.  Consider requesting an enhancement
-     * to the ExpressionContext interface to avoid having to call this method.
-     * @return the XPathContext associated with this XPathExpressionContext.
-     */
-     public XPathContext getXPathContext()
-     {
-       return XPathContext.this;
-     }
-
-    /**
-     * Return the DTMManager object.  Though XPathContext context extends 
-     * the DTMManager, it really is a proxy for the real DTMManager.  If a 
-     * caller needs to make a lot of calls to the DTMManager, it is faster 
-     * if it gets the real one from this function.
-     */
-     public DTMManager getDTMManager()
-     {
-       return m_dtmManager;
-     }
-    
-    /**
-     * Get the current context node.
-     * @return The current context node.
-     */
-    public org.w3c.dom.Node getContextNode()
-    {
-      int context = getCurrentNode();
-      
-      return getDTM(context).getNode(context);
-    }
-  
-    /**
-     * Get the current context node list.
-     * @return An iterator for the current context list, as
-     * defined in XSLT.
-     */
-    public org.w3c.dom.traversal.NodeIterator getContextNodes()
-    {
-      return new org.apache.xml.dtm.ref.DTMNodeIterator(getContextNodeList());
-    }
-  
-    /**
-     * Get the value of a node as a number.
-     * @param n Node to be converted to a number.  May be null.
-     * @return value of n as a number.
-     */
-    public double toNumber(org.w3c.dom.Node n)
-    {
-      // %REVIEW% You can't get much uglier than this...
-      int nodeHandle = getDTMHandleFromNode(n);
-      DTM dtm = getDTM(nodeHandle);
-      XString xobj = (XString)dtm.getStringValue(nodeHandle);
-      return xobj.num();
-    }
-  
-    /**
-     * Get the value of a node as a string.
-     * @param n Node to be converted to a string.  May be null.
-     * @return value of n as a string, or an empty string if n is null.
-     */
-    public String toString(org.w3c.dom.Node n)
-    {
-      // %REVIEW% You can't get much uglier than this...
-      int nodeHandle = getDTMHandleFromNode(n);
-      DTM dtm = getDTM(nodeHandle);
-      XMLString strVal = dtm.getStringValue(nodeHandle);
-      return strVal.toString();
-    }
-
-    /**
-     * Get a variable based on it's qualified name.
-     * @param qname The qualified name of the variable.
-     * @return The evaluated value of the variable.
-     * @throws javax.xml.transform.TransformerException
-     */
-
-    public final XObject getVariableOrParam(org.apache.xml.utils.QName qname)
-              throws javax.xml.transform.TransformerException
-    {
-      return m_variableStacks.getVariableOrParam(XPathContext.this, qname);
-    }
-
-  }
-
-}
diff --git a/src/org/apache/xpath/XPathException.java b/src/org/apache/xpath/XPathException.java
deleted file mode 100644
index 3dab351..0000000
--- a/src/org/apache/xpath/XPathException.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-import org.w3c.dom.Node;
-
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="general"/>
- * This class implements an exception object that all
- * XPath classes will throw in case of an error.  This class
- * extends TransformerException, and may hold other exceptions. In the
- * case of nested exceptions, printStackTrace will dump
- * all the traces of the nested exceptions, not just the trace
- * of this object.
- */
-public class XPathException extends TransformerException
-{
-
-  /** The home of the expression that caused the error.
-   *  @serial  */
-  Object m_styleNode = null;
-
-  /**
-   * Get the stylesheet node from where this error originated.
-   * @return The stylesheet node from where this error originated, or null.
-   */
-  public Object getStylesheetNode()
-  {
-    return m_styleNode;
-  }
-
-  /** A nested exception.
-   *  @serial   */
-  protected Exception m_exception;
-
-  /**
-   * Create an XPathException object that holds
-   * an error message.
-   * @param message The error message.
-   */
-  public XPathException(String message)
-  {
-    super(message);
-  }
-
-  /**
-   * Create an XPathException object that holds
-   * an error message and the stylesheet node that
-   * the error originated from.
-   * @param message The error message.
-   * @param styleNode The stylesheet node that the error originated from.
-   */
-  public XPathException(String message, Object styleNode)
-  {
-
-    super(message);
-
-    m_styleNode = styleNode;
-  }
-
-  /**
-   * Create an XPathException object that holds
-   * an error message, the stylesheet node that
-   * the error originated from, and another exception
-   * that caused this exception.
-   * @param message The error message.
-   * @param styleNode The stylesheet node that the error originated from.
-   * @param e The exception that caused this exception.
-   */
-  public XPathException(String message, Node styleNode, Exception e)
-  {
-
-    super(message);
-
-    m_styleNode = styleNode;
-    this.m_exception = e;
-  }
-
-  /**
-   * Create an XPathException object that holds
-   * an error message, and another exception
-   * that caused this exception.
-   * @param message The error message.
-   * @param e The exception that caused this exception.
-   */
-  public XPathException(String message, Exception e)
-  {
-
-    super(message);
-
-    this.m_exception = e;
-  }
-
-  /**
-   * Print the the trace of methods from where the error
-   * originated.  This will trace all nested exception
-   * objects, as well as this object.
-   * @param s The stream where the dump will be sent to.
-   */
-  public void printStackTrace(java.io.PrintStream s)
-  {
-
-    if (s == null)
-      s = System.err;
-
-    try
-    {
-      super.printStackTrace(s);
-    }
-    catch (Exception e){}
-
-    Throwable exception = m_exception;
-
-    for (int i = 0; (i < 10) && (null != exception); i++)
-    {
-      s.println("---------");
-      exception.printStackTrace(s);
-
-      if (exception instanceof TransformerException)
-      {
-        TransformerException se = (TransformerException) exception;
-        Throwable prev = exception;
-
-        exception = se.getException();
-
-        if (prev == exception)
-          break;
-      }
-      else
-      {
-        exception = null;
-      }
-    }
-  }
-
-  /**
-   * Find the most contained message.
-   *
-   * @return The error message of the originating exception.
-   */
-  public String getMessage()
-  {
-
-    String lastMessage = super.getMessage();
-    Throwable exception = m_exception;
-
-    while (null != exception)
-    {
-      String nextMessage = exception.getMessage();
-
-      if (null != nextMessage)
-        lastMessage = nextMessage;
-
-      if (exception instanceof TransformerException)
-      {
-        TransformerException se = (TransformerException) exception;
-        Throwable prev = exception;
-
-        exception = se.getException();
-
-        if (prev == exception)
-          break;
-      }
-      else
-      {
-        exception = null;
-      }
-    }
-
-    return (null != lastMessage) ? lastMessage : "";
-  }
-
-  /**
-   * Print the the trace of methods from where the error
-   * originated.  This will trace all nested exception
-   * objects, as well as this object.
-   * @param s The writer where the dump will be sent to.
-   */
-  public void printStackTrace(java.io.PrintWriter s)
-  {
-
-    if (s == null)
-      s = new java.io.PrintWriter(System.err);
-
-    try
-    {
-      super.printStackTrace(s);
-    }
-    catch (Exception e){}
-
-    Throwable exception = m_exception;
-
-    for (int i = 0; (i < 10) && (null != exception); i++)
-    {
-      s.println("---------");
-
-      try
-      {
-        exception.printStackTrace(s);
-      }
-      catch (Exception e)
-      {
-        s.println("Could not print stack trace...");
-      }
-
-      if (exception instanceof TransformerException)
-      {
-        TransformerException se = (TransformerException) exception;
-        Throwable prev = exception;
-
-        exception = se.getException();
-
-        if (prev == exception)
-        {
-          exception = null;
-
-          break;
-        }
-      }
-      else
-      {
-        exception = null;
-      }
-    }
-  }
-
-  /**
-   *  Return the embedded exception, if any.
-   *  Overrides javax.xml.transform.TransformerException.getException().
-   * 
-   *  @return The embedded exception, or null if there is none.
-   */
-  public Throwable getException()
-  {
-    return m_exception;
-  }
-}
diff --git a/src/org/apache/xpath/XPathFactory.java b/src/org/apache/xpath/XPathFactory.java
deleted file mode 100644
index e119868..0000000
--- a/src/org/apache/xpath/XPathFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-// import org.xml.sax.Locator;
-
-import org.apache.xml.utils.PrefixResolver;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Factory class for creating an XPath.  Implementors of XPath derivatives
- * will need to make a derived class of this.
- */
-public interface XPathFactory
-{
-
-  /**
-   * Create an XPath.
-   *
-   * @param exprString The XPath expression string.
-   * @param locator The location of the expression string, mainly for diagnostic
-   *                purposes.
-   * @param prefixResolver This will be called in order to resolve prefixes 
-   *        to namespace URIs.
-   * @param type One of {@link org.apache.xpath.XPath#SELECT} or 
-   *             {@link org.apache.xpath.XPath#MATCH}.
-   *
-   * @return an XPath ready for execution.
-   */
-  XPath create(String exprString, SourceLocator locator,
-               PrefixResolver prefixResolver, int type);
-}
diff --git a/src/org/apache/xpath/XPathProcessorException.java b/src/org/apache/xpath/XPathProcessorException.java
deleted file mode 100644
index 2355484..0000000
--- a/src/org/apache/xpath/XPathProcessorException.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath;
-
-/**
- * <meta name="usage" content="general"/>
- * Derived from XPathException in order that XPath processor
- * exceptions may be specifically caught.
- */
-public class XPathProcessorException extends XPathException
-{
-
-  /**
-   * Create an XPathProcessorException object that holds
-   * an error message.
-   * @param message The error message.
-   */
-  public XPathProcessorException(String message)
-  {
-    super(message);
-  }
-
-  /**
-   * Create an XPathProcessorException object that holds
-   * an error message, and another exception
-   * that caused this exception.
-   * @param message The error message.
-   * @param e The exception that caused this exception.
-   */
-  public XPathProcessorException(String message, Exception e)
-  {
-    super(message, e);
-  }
-}
diff --git a/src/org/apache/xpath/axes/AttributeIterator.java b/src/org/apache/xpath/axes/AttributeIterator.java
deleted file mode 100644
index cc7d26e..0000000
--- a/src/org/apache/xpath/axes/AttributeIterator.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements an optimized iterator for
- * attribute axes patterns.
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class AttributeIterator extends ChildTestIterator
-{
-
-  /**
-   * Create a AttributeIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  AttributeIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-    super(compiler, opPos, analysis);
-  }
-  
-  /**
-   * Get the next node via getFirstAttribute && getNextAttribute.
-   */
-  protected int getNextNode()
-  {
-    m_lastFetched = (DTM.NULL == m_lastFetched)
-                     ? m_cdtm.getFirstAttribute(m_context)
-                     : m_cdtm.getNextAttribute(m_lastFetched);
-    return m_lastFetched;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return org.apache.xml.dtm.Axis.ATTRIBUTE;
-  }
-
-
-
-}
diff --git a/src/org/apache/xpath/axes/AxesWalker.java b/src/org/apache/xpath/axes/AxesWalker.java
deleted file mode 100644
index 474f3e9..0000000
--- a/src/org/apache/xpath/axes/AxesWalker.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import java.util.Stack;
-import java.util.Vector;
-
-// Xalan imports
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.axes.SubContextList;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.Expression;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.patterns.NodeTestFilter;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.Axis;
-
-import org.apache.xml.utils.XMLString;
-
-/**
- * Serves as common interface for axes Walkers, and stores common
- * state variables.
- */
-public class AxesWalker extends PredicatedNodeTest
-        implements Cloneable
-{
-  
-  /**
-   * Construct an AxesWalker using a LocPathIterator.
-   *
-   * @param locPathIterator non-null reference to the parent iterator.
-   */
-  public AxesWalker(LocPathIterator locPathIterator, int axis)
-  {
-    super( locPathIterator );
-    m_axis = axis;
-  }
-  
-  public final WalkingIterator wi()
-  {
-    return (WalkingIterator)m_lpi;
-  }
-
-  /**
-   * Initialize an AxesWalker during the parse of the XPath expression.
-   *
-   * @param compiler The Compiler object that has information about this 
-   *                 walker in the op map.
-   * @param opPos The op code position of this location step.
-   * @param stepType  The type of location step.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void init(Compiler compiler, int opPos, int stepType)
-          throws javax.xml.transform.TransformerException
-  {
-
-    initPredicateInfo(compiler, opPos);
-
-    // int testType = compiler.getOp(nodeTestOpPos);
-  }
-
-  /**
-   * Get a cloned AxesWalker.
-   *
-   * @return A new AxesWalker that can be used without mutating this one.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-    // Do not access the location path itterator during this operation!
-    
-    AxesWalker clone = (AxesWalker) super.clone();
-
-    //clone.setCurrentNode(clone.m_root);
-
-    // clone.m_isFresh = true;
-
-    return clone;
-  }
-  
-  /**
-   * Do a deep clone of this walker, including next and previous walkers.
-   * If the this AxesWalker is on the clone list, don't clone but 
-   * return the already cloned version.
-   * 
-   * @param cloneOwner non-null reference to the cloned location path 
-   *                   iterator to which this clone will be added.
-   * @param cloneList non-null vector of sources in odd elements, and the 
-   *                  corresponding clones in even vectors.
-   * 
-   * @return non-null clone, which may be a new clone, or may be a clone 
-   *         contained on the cloneList.
-   */
-  AxesWalker cloneDeep(WalkingIterator cloneOwner, Vector cloneList)
-     throws CloneNotSupportedException
-  {
-    AxesWalker clone = findClone(this, cloneList);
-    if(null != clone)
-      return clone;
-    clone = (AxesWalker)this.clone();
-    clone.setLocPathIterator(cloneOwner);
-    if(null != cloneList)
-    {
-      cloneList.addElement(this);
-      cloneList.addElement(clone);
-    }
-    
-    if(wi().m_lastUsedWalker == this)
-      cloneOwner.m_lastUsedWalker = clone;
-      
-    if(null != m_nextWalker)
-      clone.m_nextWalker = m_nextWalker.cloneDeep(cloneOwner, cloneList);
-      
-    // If you don't check for the cloneList here, you'll go into an 
-    // recursive infinate loop.  
-    if(null != cloneList)
-    {
-      if(null != m_prevWalker)
-        clone.m_prevWalker = m_prevWalker.cloneDeep(cloneOwner, cloneList);
-    }
-    else
-    {
-      if(null != m_nextWalker)
-        clone.m_nextWalker.m_prevWalker = clone;
-    }
-    return clone;
-  }
-  
-  /**
-   * Find a clone that corresponds to the key argument.
-   * 
-   * @param key The original AxesWalker for which there may be a clone.
-   * @param cloneList vector of sources in odd elements, and the 
-   *                  corresponding clones in even vectors, may be null.
-   * 
-   * @return A clone that corresponds to the key, or null if key not found.
-   */
-  static AxesWalker findClone(AxesWalker key, Vector cloneList)
-  {
-    if(null != cloneList)
-    {
-      // First, look for clone on list.
-      int n = cloneList.size();
-      for (int i = 0; i < n; i+=2) 
-      {
-        if(key == cloneList.elementAt(i))
-          return (AxesWalker)cloneList.elementAt(i+1);
-      }
-    }
-    return null;    
-  }
-  
-  //=============== TreeWalker Implementation ===============
-
-  /**
-   * The root node of the TreeWalker, as specified in setRoot(int root).
-   * Note that this may actually be below the current node.
-   *
-   * @return The context node of the step.
-   */
-  public int getRoot()
-  {
-    return m_root;
-  }
-
-  /**
-   * Set the root node of the TreeWalker.
-   * (Not part of the DOM2 TreeWalker interface).
-   *
-   * @param root The context node of this step.
-   */
-  public void setRoot(int root)
-  {
-    // %OPT% Get this directly from the lpi.
-    m_dtm = wi().getXPathContext().getDTM(root);
-    m_traverser = m_dtm.getAxisTraverser(m_axis);
-    m_isFresh = true;
-    m_foundLast = false;
-    m_root = root;
-    m_currentNode = root;
-
-    if (DTM.NULL == root)
-    {
-      throw new RuntimeException(
-        "\n !!!! Error! Setting the root of a walker to null!!!");
-    }
-
-    resetProximityPositions();
-  }
-
-  /**
-   * The node at which the TreeWalker is currently positioned.
-   * <br> The value must not be null. Alterations to the DOM tree may cause
-   * the current node to no longer be accepted by the TreeWalker's
-   * associated filter. currentNode may also be explicitly set to any node,
-   * whether or not it is within the subtree specified by the root node or
-   * would be accepted by the filter and whatToShow flags. Further
-   * traversal occurs relative to currentNode even if it is not part of the
-   * current view by applying the filters in the requested direction (not
-   * changing currentNode where no traversal is possible).
-   *
-   * @return The node at which the TreeWalker is currently positioned, only null 
-   * if setRoot has not yet been called.
-   */
-  public final int getCurrentNode()
-  {
-    return m_currentNode;
-  }
-
-  /**
-   * Set the next walker in the location step chain.
-   *
-   *
-   * @param walker Reference to AxesWalker derivative, or may be null.
-   */
-  public void setNextWalker(AxesWalker walker)
-  {
-    m_nextWalker = walker;
-  }
-
-  /**
-   * Get the next walker in the location step chain.
-   *
-   *
-   * @return Reference to AxesWalker derivative, or null.
-   */
-  public AxesWalker getNextWalker()
-  {
-    return m_nextWalker;
-  }
-
-  /**
-   * Set or clear the previous walker reference in the location step chain.
-   *
-   *
-   * @param walker Reference to previous walker reference in the location 
-   *               step chain, or null.
-   */
-  public void setPrevWalker(AxesWalker walker)
-  {
-    m_prevWalker = walker;
-  }
-
-  /**
-   * Get the previous walker reference in the location step chain.
-   *
-   *
-   * @return Reference to previous walker reference in the location 
-   *               step chain, or null.
-   */
-  public AxesWalker getPrevWalker()
-  {
-    return m_prevWalker;
-  }
-
-  /**
-   * This is simply a way to bottle-neck the return of the next node, for 
-   * diagnostic purposes.
-   *
-   * @param n Node to return, or null.
-   *
-   * @return The argument.
-   */
-  private int returnNextNode(int n)
-  {
-
-    return n;
-  }
-
-  /**
-   * Get the next node in document order on the axes.
-   *
-   * @return the next node in document order on the axes, or null.
-   */
-  protected int getNextNode()
-  {
-    if (m_foundLast)
-      return DTM.NULL;
-
-    if (m_isFresh)
-    {
-      m_currentNode = m_traverser.first(m_root);
-      m_isFresh = false;
-    }
-    // I shouldn't have to do this the check for current node, I think.
-    // numbering\numbering24.xsl fails if I don't do this.  I think 
-    // it occurs as the walkers are backing up. -sb
-    else if(DTM.NULL != m_currentNode) 
-    {
-      m_currentNode = m_traverser.next(m_root, m_currentNode);
-    }
-
-    if (DTM.NULL == m_currentNode)
-      this.m_foundLast = true;
-
-    return m_currentNode;
-  }
-
-  /**
-   *  Moves the <code>TreeWalker</code> to the next visible node in document
-   * order relative to the current node, and returns the new node. If the
-   * current node has no next node,  or if the search for nextNode attempts
-   * to step upward from the TreeWalker's root node, returns
-   * <code>null</code> , and retains the current node.
-   * @return  The new node, or <code>null</code> if the current node has no
-   *   next node  in the TreeWalker's logical view.
-   */
-  public int nextNode()
-  {
-    int nextNode = DTM.NULL;
-    AxesWalker walker = wi().getLastUsedWalker();
-
-    while (true)
-    {
-      if (null == walker)
-        break;
-
-      nextNode = walker.getNextNode();
-
-      if (DTM.NULL == nextNode)
-      {
-
-        walker = walker.m_prevWalker;
-      }
-      else
-      {
-        if (walker.acceptNode(nextNode) != DTMIterator.FILTER_ACCEPT)
-        {
-          continue;
-        }
-
-        if (null == walker.m_nextWalker)
-        {
-          wi().setLastUsedWalker(walker);
-
-          // return walker.returnNextNode(nextNode);
-          break;
-        }
-        else
-        {
-          AxesWalker prev = walker;
-
-          walker = walker.m_nextWalker;
-
-          walker.setRoot(nextNode);
-
-          walker.m_prevWalker = prev;
-
-          continue;
-        }
-      }  // if(null != nextNode)
-    }  // while(null != walker)
-
-    return nextNode;
-  }
-
-  //============= End TreeWalker Implementation =============
-
-  /**
-   * Get the index of the last node that can be itterated to.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the index of the last node that can be itterated to.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-
-    int pos = getProximityPosition();
-    
-    AxesWalker walker;
-
-    try
-    {
-      walker = (AxesWalker) clone();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      return -1;
-    }
-
-    walker.setPredicateCount(walker.getPredicateCount() - 1);
-    walker.setNextWalker(null);
-    walker.setPrevWalker(null);
-
-    WalkingIterator lpi = wi();
-    AxesWalker savedWalker = lpi.getLastUsedWalker();
-
-    try
-    {
-      lpi.setLastUsedWalker(walker);
-
-      int next;
-
-      while (DTM.NULL != (next = walker.nextNode()))
-      {
-        pos++;
-      }
-
-      // TODO: Should probably save this in the iterator.
-    }
-    finally
-    {
-      lpi.setLastUsedWalker(savedWalker);
-    }
-
-    // System.out.println("pos: "+pos);
-    return pos;
-  }
-  
-  //============= State Data =============
-  
-  /**
-   * The DTM for the root.  This can not be used, or must be changed, 
-   * for the filter walker, or any walker that can have nodes 
-   * from multiple documents.
-   * Never, ever, access this value without going through getDTM(int node).
-   */
-  private DTM m_dtm;
-  
-  /**
-   * Set the DTM for this walker.
-   * 
-   * @param dtm Non-null reference to a DTM.
-   */
-  public void setDefaultDTM(DTM dtm)
-  {
-    m_dtm = dtm;
-  }
-  
-  /**
-   * Get the DTM for this walker.
-   * 
-   * @return Non-null reference to a DTM.
-   */
-  public DTM getDTM(int node)
-  {
-    //
-    return wi().getXPathContext().getDTM(node);
-  }
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * Warning: This can only be called after setRoot has been called!
-   * 
-   * @return true as a default.
-   */
-  public boolean isDocOrdered()
-  {
-    return true;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return m_axis;
-  }
-
-
-  /**
-   *  The root node of the TreeWalker, as specified when it was created.
-   */
-  transient int m_root = DTM.NULL;
-
-  /**
-   *  The node at which the TreeWalker is currently positioned.
-   */
-  private transient int m_currentNode = DTM.NULL;
-  
-  /** True if an itteration has not begun.  */
-  transient boolean m_isFresh;
-
-  /** The next walker in the location step chain.
-   *  @serial  */
-  protected AxesWalker m_nextWalker;
-  
-  /** The previous walker in the location step chain, or null.
-   *  @serial   */
-  AxesWalker m_prevWalker;
-  
-  /** The traversal axis from where the nodes will be filtered. */
-  protected int m_axis = -1;
-
-  /** The DTM inner traversal class, that corresponds to the super axis. */
-  protected DTMAxisTraverser m_traverser;   
-}
diff --git a/src/org/apache/xpath/axes/ChildIterator.java b/src/org/apache/xpath/axes/ChildIterator.java
deleted file mode 100644
index 935d371..0000000
--- a/src/org/apache/xpath/axes/ChildIterator.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolver;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.DOMException;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements an optimized iterator for
- * "node()" patterns, that is, any children of the
- * context node.
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class ChildIterator extends LocPathIterator
-{
-
-  /**
-   * Create a ChildIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   * @param analysis Analysis bits of the entire pattern.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  ChildIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-    super(compiler, opPos, analysis, false);
-  }
-  
-  /**
-   * Return the first node out of the nodeset, if this expression is 
-   * a nodeset expression.  This is the default implementation for 
-   * nodesets.
-   * <p>WARNING: Do not mutate this class from this function!</p>
-   * @param xctxt The XPath runtime context.
-   * @return the first node out of the nodeset, or DTM.NULL.
-   */
-  public int asNode(XPathContext xctxt)
-    throws javax.xml.transform.TransformerException
-  {
-    int current = xctxt.getCurrentNode();
-    
-    DTM dtm = xctxt.getDTM(current);
-    
-    return dtm.getFirstChild(current);
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   *
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))
-    {
-      int next = m_cachedNodes.elementAt(m_next);
-    
-      incrementNextPosition();
-      m_currentContextNode = next;
-
-      return next;
-    }
-
-    if (m_foundLast)
-    {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-    }
-
-    int next;
-
-    m_lastFetched = next = (DTM.NULL == m_lastFetched)
-                           ? m_cdtm.getFirstChild(m_context)
-                           : m_cdtm.getNextSibling(m_lastFetched);
-
-    // m_lastFetched = next;
-    if (DTM.NULL != next)
-    {
-      if (null != m_cachedNodes)
-        m_cachedNodes.addElement(m_lastFetched);
-
-      m_next++;
-
-      return next;
-    }
-    else
-    {
-      m_foundLast = true;
-
-      return DTM.NULL;
-    }
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return org.apache.xml.dtm.Axis.CHILD;
-  }
-
-
-}
diff --git a/src/org/apache/xpath/axes/ChildTestIterator.java b/src/org/apache/xpath/axes/ChildTestIterator.java
deleted file mode 100644
index f41c62f..0000000
--- a/src/org/apache/xpath/axes/ChildTestIterator.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.Axis;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements an optimized iterator for
- * children patterns that have a node test, and possibly a predicate.
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class ChildTestIterator extends LocPathIterator
-{
-  /** The traverser to use to navigate over the descendants. */
-  transient protected DTMAxisTraverser m_traverser;
-  
-  /** The extended type ID, not set until setRoot. */
-//  protected int m_extendedTypeID;
-
-
-  /**
-   * Create a ChildTestIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  ChildTestIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-
-    super(compiler, opPos, analysis, false);
-
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-    int whatToShow = compiler.getWhatToShow(firstStepPos);
-
-    if ((0 == (whatToShow
-               & (DTMFilter.SHOW_ATTRIBUTE 
-               | DTMFilter.SHOW_NAMESPACE 
-               | DTMFilter.SHOW_ELEMENT
-               | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) 
-               || (whatToShow == DTMFilter.SHOW_ALL))
-      initNodeTest(whatToShow);
-    else
-    {
-      initNodeTest(whatToShow, compiler.getStepNS(firstStepPos),
-                              compiler.getStepLocalName(firstStepPos));
-    }
-    initPredicateInfo(compiler, firstStepPos);
-  }
-  
-  /**
-   * Create a ChildTestIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  ChildTestIterator(DTMAxisTraverser traverser)
-  {
-
-    super(null);
-
-    m_traverser = traverser;
-  }
-
-  
-  /**
-   *  Get a cloned Iterator that is reset to the beginning
-   *  of the query.
-   * 
-   *  @return A cloned NodeIterator set of the start of the query.
-   * 
-   *  @throws CloneNotSupportedException
-   */
-  public DTMIterator cloneWithReset() throws CloneNotSupportedException
-  {
-
-    ChildTestIterator clone = (ChildTestIterator) super.cloneWithReset();
-
-    clone.resetProximityPositions();
-
-    return clone;
-  }
-  
-  /**
-   * Get the next node via getNextXXX.  Bottlenecked for derived class override.
-   * @return The next node on the axis, or DTM.NULL.
-   */
-  protected int getNextNode()
-  {                     
-    if(true /* 0 == m_extendedTypeID */)
-    {
-      m_lastFetched = (DTM.NULL == m_lastFetched)
-                   ? m_traverser.first(m_context)
-                   : m_traverser.next(m_context, m_lastFetched);
-    }
-//    else
-//    {
-//      m_lastFetched = (DTM.NULL == m_lastFetched)
-//                   ? m_traverser.first(m_context, m_extendedTypeID)
-//                   : m_traverser.next(m_context, m_lastFetched, 
-//                                      m_extendedTypeID);
-//    }
-
-    return m_lastFetched;
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   *
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))
-    {
-      int next = m_cachedNodes.elementAt(m_next);
-    
-      incrementNextPosition();
-      m_currentContextNode = next;
-
-      return next;
-    }
-
-    if (m_foundLast)
-    {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-    }
-      
-    if(DTM.NULL == m_lastFetched)
-    {
-      resetProximityPositions();
-    }
-
-    int next;
-    
-    org.apache.xpath.VariableStack vars;
-    int savedStart;
-    if (-1 != m_stackFrame)
-    {
-      vars = m_execContext.getVarStack();
-
-      // These three statements need to be combined into one operation.
-      savedStart = vars.getStackFrame();
-
-      vars.setStackFrame(m_stackFrame);
-    }
-    else
-    {
-      // Yuck.  Just to shut up the compiler!
-      vars = null;
-      savedStart = 0;
-    }
-    
-    try
-    {
-      do
-      {
-        next = getNextNode();
-  
-        if (DTM.NULL != next)
-        {
-          if(DTMIterator.FILTER_ACCEPT == acceptNode(next))
-            break;
-          else
-            continue;
-        }
-        else
-          break;
-      }
-      while (next != DTM.NULL);
-  
-      if (DTM.NULL != next)
-      {
-        if (null != m_cachedNodes)
-          m_cachedNodes.addElement(m_lastFetched);
-  
-        m_next++;
-  
-        return next;
-      }
-      else
-      {
-        m_foundLast = true;
-  
-        return DTM.NULL;
-      }
-    }
-    finally
-    {
-      if (-1 != m_stackFrame)
-      {
-        // These two statements need to be combined into one operation.
-        vars.setStackFrame(savedStart);
-      }
-    }
-  }
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    super.setRoot(context, environment);
-    m_traverser = m_cdtm.getAxisTraverser(Axis.CHILD);
-    
-//    String localName = getLocalName();
-//    String namespace = getNamespace();
-//    int what = m_whatToShow;
-//    // System.out.println("what: ");
-//    // NodeTest.debugWhatToShow(what);
-//    if(DTMFilter.SHOW_ALL == what ||
-//       ((DTMFilter.SHOW_ELEMENT & what) == 0)
-//       || localName == NodeTest.WILD
-//       || namespace == NodeTest.WILD)
-//    {
-//      m_extendedTypeID = 0;
-//    }
-//    else
-//    {
-//      int type = getNodeTypeTest(what);
-//      m_extendedTypeID = m_cdtm.getExpandedTypeID(namespace, localName, type);
-//    }
-    
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return org.apache.xml.dtm.Axis.CHILD;
-  }
-
-
-}
diff --git a/src/org/apache/xpath/axes/ContextNodeList.java b/src/org/apache/xpath/axes/ContextNodeList.java
deleted file mode 100644
index 00e94a3..0000000
--- a/src/org/apache/xpath/axes/ContextNodeList.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Classes who implement this interface can be a
- * <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
- * also refered to here as a <term>context node list</term>.
- */
-public interface ContextNodeList
-{
-
-  /**
-   * Get the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
-   *
-   *
-   * @return The current node, or null.
-   */
-  public Node getCurrentNode();
-
-  /**
-   * Get the current position, which is one less than
-   * the next nextNode() call will retrieve.  i.e. if
-   * you call getCurrentPos() and the return is 0, the next
-   * fetch will take place at index 1.
-   *
-   * @return The position of the
-   * <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>
-   * in the  <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>.
-   */
-  public int getCurrentPos();
-
-  /**
-   * Reset the iterator.
-   */
-  public void reset();
-
-  /**
-   * If setShouldCacheNodes(true) is called, then nodes will
-   * be cached.  They are not cached by default.
-   *
-   * @param b true if the nodes should be cached.
-   */
-  public void setShouldCacheNodes(boolean b);
-
-  /**
-   * If an index is requested, NodeSetDTM will call this method
-   * to run the iterator to the index.  By default this sets
-   * m_next to the index.  If the index argument is -1, this
-   * signals that the iterator should be run to the end.
-   *
-   * @param index The index to run to, or -1 if the iterator should be run
-   *              to the end.
-   */
-  public void runTo(int index);
-
-  /**
-   * Set the current position in the node set.
-   * @param i Must be a valid index.
-   */
-  public void setCurrentPos(int i);
-
-  /**
-   * Get the length of the list.
-   *
-   * @return The number of nodes in this node list.
-   */
-  public int size();
-
-  /**
-   * Tells if this NodeSetDTM is "fresh", in other words, if
-   * the first nextNode() that is called will return the
-   * first node in the set.
-   *
-   * @return true if the iteration of this list has not yet begun.
-   */
-  public boolean isFresh();
-
-  /**
-   * Get a cloned Iterator that is reset to the start of the iteration.
-   *
-   * @return A clone of this iteration that has been reset.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public NodeIterator cloneWithReset() throws CloneNotSupportedException;
-
-  /**
-   * Get a clone of this iterator.  Be aware that this operation may be
-   * somewhat expensive.
-   *
-   *
-   * @return A clone of this object.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException;
-
-  /**
-   * Get the index of the last node in this list.
-   *
-   *
-   * @return the index of the last node in this list.
-   */
-  public int getLast();
-
-  /**
-   * Set the index of the last node in this list.
-   *
-   *
-   * @param last the index of the last node in this list.
-   */
-  public void setLast(int last);
-}
diff --git a/src/org/apache/xpath/axes/DescendantIterator.java b/src/org/apache/xpath/axes/DescendantIterator.java
deleted file mode 100644
index 656dc6c..0000000
--- a/src/org/apache/xpath/axes/DescendantIterator.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.XPathContext;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.Axis;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements an optimized iterator for
- * descendant, descendant-or-self, or "//foo" patterns.
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class DescendantIterator extends LocPathIterator
-{
-  /**
-   * Create a DescendantIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  DescendantIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-
-    super(compiler, opPos, analysis, false);
-
-    int ops[] = compiler.getOpMap();
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-    int stepType = ops[firstStepPos];
-
-    boolean orSelf = (OpCodes.FROM_DESCENDANTS_OR_SELF == stepType);
-    boolean fromRoot = false;
-    if (OpCodes.FROM_SELF == stepType)
-    {
-      orSelf = true;
-      // firstStepPos += 8;
-    }
-    else if(OpCodes.FROM_ROOT == stepType)
-    {
-      fromRoot = true;
-      // Ugly code... will go away when AST work is done.
-      int nextStepPos = compiler.getNextStepPos(firstStepPos);
-      if(ops[nextStepPos] == OpCodes.FROM_DESCENDANTS_OR_SELF)
-        orSelf = true;
-      // firstStepPos += 8;
-    }
-    
-    // Find the position of the last step.
-    int nextStepPos = firstStepPos;
-    while(true)
-    {
-      nextStepPos = compiler.getNextStepPos(nextStepPos);
-      if(nextStepPos > 0)
-      {
-        int stepOp = compiler.getOp(nextStepPos);
-        if(OpCodes.ENDOP != stepOp)
-          firstStepPos = nextStepPos;
-        else
-          break;
-      }
-      else
-        break;
-      
-    }
-    
-    // Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1336
-    if((analysis & WalkerFactory.BIT_CHILD) != 0)
-      orSelf = false;
-      
-    if(fromRoot)
-    {
-      if(orSelf)
-        m_axis = Axis.DESCENDANTSORSELFFROMROOT;
-      else
-        m_axis = Axis.DESCENDANTSFROMROOT;
-    }
-    else if(orSelf)
-      m_axis = Axis.DESCENDANTORSELF;
-    else
-      m_axis = Axis.DESCENDANT;
-
-    int whatToShow = compiler.getWhatToShow(firstStepPos);
-
-    if ((0 == (whatToShow
-               & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_ELEMENT
-                  | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) || 
-                   (whatToShow == DTMFilter.SHOW_ALL))
-      initNodeTest(whatToShow);
-    else
-    {
-      initNodeTest(whatToShow, compiler.getStepNS(firstStepPos),
-                              compiler.getStepLocalName(firstStepPos));
-    }
-    initPredicateInfo(compiler, firstStepPos);
-  }
-  
-  /**
-   * Create a DescendantIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public DescendantIterator()
-  {
-    super(null);
-    m_axis = Axis.DESCENDANTSORSELFFROMROOT;
-    int whatToShow = DTMFilter.SHOW_ALL;
-    initNodeTest(whatToShow);
-  }
-
-  
-  /**
-   *  Get a cloned Iterator that is reset to the beginning
-   *  of the query.
-   * 
-   *  @return A cloned NodeIterator set of the start of the query.
-   * 
-   *  @throws CloneNotSupportedException
-   */
-  public DTMIterator cloneWithReset() throws CloneNotSupportedException
-  {
-
-    DescendantIterator clone = (DescendantIterator) super.cloneWithReset();
-
-    clone.resetProximityPositions();
-
-    return clone;
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   *
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   *
-   * @throws DOMException
-   *    INVALID_STATE_ERR: Raised if this method is called after the
-   *   <code>detach</code> method was invoked.
-   */
-  public int nextNode()
-  {
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))
-    {
-      int next = m_cachedNodes.elementAt(m_next);
-    
-      incrementNextPosition();
-      m_currentContextNode = next;
-
-      return next;
-    }
-
-    if (m_foundLast)
-    {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-    }
-      
-    if(DTM.NULL == m_lastFetched)
-    {
-      resetProximityPositions();
-    }
-
-    int next;
-    
-    org.apache.xpath.VariableStack vars;
-    int savedStart;
-    if (-1 != m_stackFrame)
-    {
-      vars = m_execContext.getVarStack();
-
-      // These three statements need to be combined into one operation.
-      savedStart = vars.getStackFrame();
-
-      vars.setStackFrame(m_stackFrame);
-    }
-    else
-    {
-      // Yuck.  Just to shut up the compiler!
-      vars = null;
-      savedStart = 0;
-    }
-    
-    try
-    {
-      do
-      {
-        if(0 == m_extendedTypeID)
-        {
-          next = m_lastFetched = (DTM.NULL == m_lastFetched)
-                       ? m_traverser.first(m_context)
-                       : m_traverser.next(m_context, m_lastFetched);
-        }
-        else
-        {
-          next = m_lastFetched = (DTM.NULL == m_lastFetched)
-                       ? m_traverser.first(m_context, m_extendedTypeID)
-                       : m_traverser.next(m_context, m_lastFetched, 
-                                          m_extendedTypeID);
-        }
-  
-        if (DTM.NULL != next)
-        {
-          if(DTMIterator.FILTER_ACCEPT == acceptNode(next))
-            break;
-          else
-            continue;
-        }
-        else
-          break;
-      }
-      while (next != DTM.NULL);
-  
-      if (DTM.NULL != next)
-      {
-        if (null != m_cachedNodes)
-          m_cachedNodes.addElement(m_lastFetched);
-  
-        m_next++;
-  
-        return next;
-      }
-      else
-      {
-        m_foundLast = true;
-  
-        return DTM.NULL;
-      }
-    }
-    finally
-    {
-      if (-1 != m_stackFrame)
-      {
-        // These two statements need to be combined into one operation.
-        vars.setStackFrame(savedStart);
-      }
-    }
-  }
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    super.setRoot(context, environment);
-    m_traverser = m_cdtm.getAxisTraverser(m_axis);
-    
-    String localName = getLocalName();
-    String namespace = getNamespace();
-    int what = m_whatToShow;
-    // System.out.println("what: ");
-    // NodeTest.debugWhatToShow(what);
-    if(DTMFilter.SHOW_ALL == what
-       || localName == NodeTest.WILD
-       || namespace == NodeTest.WILD)
-    {
-      m_extendedTypeID = 0;
-    }
-    else
-    {
-      int type = getNodeTypeTest(what);
-      m_extendedTypeID = m_cdtm.getExpandedTypeID(namespace, localName, type);
-    }
-    
-  }
-  
-  /**
-   * Return the first node out of the nodeset, if this expression is 
-   * a nodeset expression.  This is the default implementation for 
-   * nodesets.
-   * <p>WARNING: Do not mutate this class from this function!</p>
-   * @param xctxt The XPath runtime context.
-   * @return the first node out of the nodeset, or DTM.NULL.
-   */
-  public int asNode(XPathContext xctxt)
-    throws javax.xml.transform.TransformerException
-  {
-    if(getPredicateCount() > 0)
-      return super.asNode(xctxt);
-
-    int current = xctxt.getCurrentNode();
-    
-    DTM dtm = xctxt.getDTM(current);
-    DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);
-    
-    String localName = getLocalName();
-    String namespace = getNamespace();
-    int what = m_whatToShow;
-    
-    // System.out.print(" (DescendantIterator) ");
-    
-    // System.out.println("what: ");
-    // NodeTest.debugWhatToShow(what);
-    if(DTMFilter.SHOW_ALL == what
-       || localName == NodeTest.WILD
-       || namespace == NodeTest.WILD)
-    {
-      return traverser.first(current);
-    }
-    else
-    {
-      int type = getNodeTypeTest(what);
-      int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
-      return traverser.first(current, extendedType);
-    }
-  }
-  
-  /**
-   *  Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   */
-  public void detach()
-  {    
-    m_traverser = null;    
-    m_extendedTypeID = 0;
-    
-    // Always call the superclass detach last!
-    super.detach();
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return m_axis;
-  }
-
-  
-  /** The traverser to use to navigate over the descendants. */
-  transient protected DTMAxisTraverser m_traverser;
-  
-  /** The axis that we are traversing. */
-  protected int m_axis;
-  
-  /** The extended type ID, not set until setRoot. */
-  protected int m_extendedTypeID;
-  
-}
diff --git a/src/org/apache/xpath/axes/FilterExprWalker.java b/src/org/apache/xpath/axes/FilterExprWalker.java
deleted file mode 100644
index 167335b..0000000
--- a/src/org/apache/xpath/axes/FilterExprWalker.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xpath.XPath;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.objects.XObject;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.patterns.NodeTestFilter;
-
-import java.util.Vector;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.Axis;
-
-/**
- * Walker for the OP_VARIABLE, or OP_EXTFUNCTION, or OP_FUNCTION, or OP_GROUP,
- * op codes.
- * @see <a href="http://www.w3.org/TR/xpath#NT-FilterExpr">XPath FilterExpr descriptions</a>
- */
-public class FilterExprWalker extends AxesWalker
-{
-
-  /**
-   * Construct a FilterExprWalker using a LocPathIterator.
-   *
-   * @param locPathIterator non-null reference to the parent iterator.
-   */
-  FilterExprWalker(WalkingIterator locPathIterator)
-  {
-    super(locPathIterator, Axis.FILTEREDLIST);
-  }
-
-  /**
-   * Init a FilterExprWalker.
-   *
-   * @param compiler non-null reference to the Compiler that is constructing.
-   * @param opPos positive opcode position for this step.
-   * @param stepType The type of step.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void init(Compiler compiler, int opPos, int stepType)
-          throws javax.xml.transform.TransformerException
-  {
-
-    super.init(compiler, opPos, stepType);
-
-    // Smooth over an anomily in the opcode map...
-    switch (stepType)
-    {
-    case OpCodes.OP_VARIABLE :
-    case OpCodes.OP_EXTFUNCTION :
-    case OpCodes.OP_FUNCTION :
-    case OpCodes.OP_GROUP :
-      m_expr = compiler.compile(opPos);
-      break;
-    default :
-      m_expr = compiler.compile(opPos + 2);
-    }
-  }
-
-  /**
-   *  Set the root node of the TreeWalker.
-   *
-   * @param root non-null reference to the root, or starting point of 
-   *        the query.
-   */
-  public void setRoot(int root)
-  {
-
-    // System.out.println("root: "+root);
-    XPathContext xctxt = m_lpi.getXPathContext();
-    PrefixResolver savedResolver = xctxt.getNamespaceContext();
-
-    try
-    {
-      xctxt.pushCurrentNode(root);
-      xctxt.setNamespaceContext(m_lpi.getPrefixResolver());
-      
-      // The setRoot operation can take place with a reset operation, 
-      // and so we may not be in the context of LocPathIterator#nextNode, 
-      // so we have to set up the variable context, execute the expression, 
-      // and then restore the variable context.
-
-      if(m_lpi.getIsTopLevel())
-      {
-        // System.out.println("calling m_expr.execute(m_lpi.getXPathContext())");
-        VariableStack vars = m_lpi.m_execContext.getVarStack();
-        
-        // These three statements need to be combined into one operation.
-        int savedStart = vars.getStackFrame();
-        vars.setStackFrame(m_lpi.m_stackFrame);
-        
-        m_nodeSet = m_expr.asIterator(xctxt, root);
-        
-        // These two statements need to be combined into one operation.
-        vars.setStackFrame(savedStart);
-      }
-      else
-        m_nodeSet = m_expr.asIterator(xctxt, root);
-            
-    }
-    catch (javax.xml.transform.TransformerException se)
-    {
-
-      // TODO: Fix...
-      throw new org.apache.xml.utils.WrappedRuntimeException(se);
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-      xctxt.setNamespaceContext(savedResolver);
-    }
-
-    super.setRoot(root);
-  }
-
-  /**
-   * Get a cloned FilterExprWalker.
-   *
-   * @return A new FilterExprWalker that can be used without mutating this one.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    FilterExprWalker clone = (FilterExprWalker) super.clone();
-
-    // clone.m_expr = (Expression)((Expression)m_expr).clone();
-    if (null != m_nodeSet)
-      clone.m_nodeSet = (DTMIterator) m_nodeSet.clone();
-
-    return clone;
-  }
-
-  /**
-   * This method needs to override AxesWalker.acceptNode because FilterExprWalkers
-   * don't need to, and shouldn't, do a node test.
-   * @param n  The node to check to see if it passes the filter or not.
-   * @return  a constant to determine whether the node is accepted,
-   *   rejected, or skipped, as defined  above .
-   */
-  public short acceptNode(int n)
-  {
-
-    try
-    {
-      if (getPredicateCount() > 0)
-      {
-        countProximityPosition(0);
-
-        if (!executePredicates(n, m_lpi.getXPathContext()))
-          return DTMIterator.FILTER_SKIP;
-      }
-
-      return DTMIterator.FILTER_ACCEPT;
-    }
-    catch (javax.xml.transform.TransformerException se)
-    {
-      throw new RuntimeException(se.getMessage());
-    }
-  }
-
-  /**
-   *  Moves the <code>TreeWalker</code> to the next visible node in document
-   * order relative to the current node, and returns the new node. If the
-   * current node has no next node,  or if the search for nextNode attempts
-   * to step upward from the TreeWalker's root node, returns
-   * <code>null</code> , and retains the current node.
-   * @return  The new node, or <code>null</code> if the current node has no
-   *   next node  in the TreeWalker's logical view.
-   */
-  public int getNextNode()
-  {
-
-    if (null != m_nodeSet)
-       return m_nodeSet.nextNode();
-    else
-      return DTM.NULL;
-  }
-  
-  /**
-   * Get the index of the last node that can be itterated to.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the index of the last node that can be itterated to.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-    return m_nodeSet.getLength();
-  }
-  
-  /** The contained expression. Should be non-null.
-   *  @serial   */
-  private Expression m_expr;
-
-  /** The result of executing m_expr.  Needs to be deep cloned on clone op.  */
-  transient private DTMIterator m_nodeSet;
-
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    super.fixupVariables(vars, globalsSize);
-    m_expr.fixupVariables(vars, globalsSize);
-  }
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * Warning: This can only be called after setRoot has been called!
-   * 
-   * @return true as a default.
-   */
-  public boolean isDocOrdered()
-  {
-    return m_nodeSet.isDocOrdered();
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return m_nodeSet.getAxis();
-  }
-
-
-
-}
diff --git a/src/org/apache/xpath/axes/IteratorPool.java b/src/org/apache/xpath/axes/IteratorPool.java
deleted file mode 100644
index c4a75ac..0000000
--- a/src/org/apache/xpath/axes/IteratorPool.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.apache.xpath.axes;
-
-import java.util.*;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.utils.WrappedRuntimeException;
-
-/**
- * <meta name="usage" content="internal"/>
- * Pool of object of a given type to pick from to help memory usage
- */
-public class IteratorPool implements java.io.Serializable
-{
-
-  /** Type of objects in this pool.
-   *  @serial          */
-  private final DTMIterator m_orig;
-
-  /** Vector of given objects this points to.
-   *  @serial          */
-  private final Vector m_freeStack;
-
-  /**
-   * Constructor IteratorPool
-   *
-   * @param original The original iterator from which all others will be cloned.
-   */
-  public IteratorPool(DTMIterator original)
-  {
-    m_orig = original;
-    m_freeStack = new Vector();
-  }
-  
-  /**
-   * Get an instance of the given object in this pool 
-   *
-   * @return An instance of the given object
-   */
-  public synchronized DTMIterator getInstance()
-  {
-
-    // Check if the pool is empty.
-    if (m_freeStack.isEmpty())
-    {
-
-      // Create a new object if so.
-      try
-      {
-        return (DTMIterator)m_orig.clone();
-      }
-      catch (Exception ex)
-      {
-        throw new WrappedRuntimeException(ex);
-      }
-    }
-    else
-    {
-      // Remove object from end of free pool.
-      DTMIterator result = (DTMIterator)m_freeStack.lastElement();
-
-      m_freeStack.setSize(m_freeStack.size() - 1);
-
-      return result;
-    }
-  }
-
-  /**
-   * Add an instance of the given object to the pool  
-   *
-   *
-   * @param obj Object to add.
-   */
-  public synchronized void freeInstance(DTMIterator obj)
-  {
-    m_freeStack.addElement(obj);
-  }
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/axes/LocPathIterator.java b/src/org/apache/xpath/axes/LocPathIterator.java
deleted file mode 100644
index 2d1a12c..0000000
--- a/src/org/apache/xpath/axes/LocPathIterator.java
+++ /dev/null
@@ -1,1084 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-// Java library imports
-import java.util.Vector;
-import java.util.Stack;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMManager;
-
-// Xalan imports
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.OpMap;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.compiler.PsuedoNames;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xml.utils.IntStack;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.ObjectPool;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.axes.AxesWalker;
-import org.apache.xpath.VariableStack;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class extends NodeSetDTM, which implements NodeIterator,
- * and fetches nodes one at a time in document order based on a XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a>.
- *
- * <p>If setShouldCacheNodes(true) is called,
- * as each node is iterated via nextNode(), the node is also stored
- * in the NodeVector, so that previousNode() can easily be done, except in
- * the case where the LocPathIterator is "owned" by a UnionPathIterator,
- * in which case the UnionPathIterator will cache the nodes.</p>
- */
-public abstract class LocPathIterator extends PredicatedNodeTest
-        implements Cloneable, DTMIterator, java.io.Serializable
-{
-
-  /**
-   * Create a LocPathIterator object.
-   *
-   * @param nscontext The namespace context for this iterator,
-   * should be OK if null.
-   */
-  protected LocPathIterator(PrefixResolver nscontext)
-  {
-
-    setLocPathIterator(this);
-
-    this.m_prefixResolver = nscontext;
-  }
-
-  /**
-   * Create a LocPathIterator object, including creation
-   * of step walkers from the opcode list, and call back
-   * into the Compiler to create predicate expressions.
-   *
-   * @param compiler The Compiler which is creating
-   * this expression.
-   * @param opPos The position of this iterator in the
-   * opcode list from the compiler.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected LocPathIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-    this(compiler, opPos, analysis, true);
-  }
-
-  /**
-   * Create a LocPathIterator object, including creation
-   * of step walkers from the opcode list, and call back
-   * into the Compiler to create predicate expressions.
-   *
-   * @param compiler The Compiler which is creating
-   * this expression.
-   * @param opPos The position of this iterator in the
-   * opcode list from the compiler.
-   * @param shouldLoadWalkers True if walkers should be
-   * loaded, or false if this is a derived iterator and
-   * it doesn't wish to load child walkers.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected LocPathIterator(
-          Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
-            throws javax.xml.transform.TransformerException
-  {
-    setLocPathIterator(this);
-  }
-  
-  /**
-   * Read the object from a serialization stream.
-   *
-   * @param stream Input stream to read from
-   *
-   * @throws java.io.IOException
-   * @throws javax.xml.transform.TransformerException
-   */
-  private void readObject(java.io.ObjectInputStream stream)
-          throws java.io.IOException, javax.xml.transform.TransformerException
-  {
-    try
-    {
-      stream.defaultReadObject();
-      m_clones =  new IteratorPool(this);
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new javax.xml.transform.TransformerException(cnfe);
-    }
-  }
-  
-  /**
-   * Set the environment in which this iterator operates, which should provide:
-   * a node (the context node... same value as "root" defined below) 
-   * a pair of non-zero positive integers (the context position and the context size) 
-   * a set of variable bindings 
-   * a function library 
-   * the set of namespace declarations in scope for the expression.
-   * 
-   * <p>At this time the exact implementation of this environment is application 
-   * dependent.  Probably a proper interface will be created fairly soon.</p>
-   * 
-   * @param environment The environment object.
-   */
-  public void setEnvironment(Object environment)
-  {
-    // no-op for now.
-  }
-  
-  /**
-   * Get an instance of a DTM that "owns" a node handle.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTM using just the iterator.
-   *
-   * @param nodeHandle the nodeHandle.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(int nodeHandle)
-  {
-    // %OPT%
-    return m_execContext.getDTM(nodeHandle);
-  }
-  
-  /**
-   * Get an instance of the DTMManager.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTMManager using just the iterator.
-   *
-   * @return a non-null DTMManager reference.
-   */
-  public DTMManager getDTMManager()
-  {
-    return m_execContext.getDTMManager();
-  }
-
-  /**
-   * Execute this iterator, meaning create a clone that can
-   * store state, and initialize it for fast execution from
-   * the current runtime state.  When this is called, no actual
-   * query from the current context node is performed.
-   *
-   * @param xctxt The XPath execution context.
-   *
-   * @return An XNodeSet reference that holds this iterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    LocPathIterator clone = (LocPathIterator)m_clones.getInstance();
-
-    int current = xctxt.getCurrentNode();
-    clone.setRoot(current, xctxt);
-
-    return new XNodeSet(clone);
-  }
-  
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Given an select expression and a context, evaluate the XPath
-   * and return the resulting iterator.
-   * 
-   * @param xctxt The execution context.
-   * @param contextNode The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * XPath are supposed to be expanded.
-   * 
-   * @throws TransformerException thrown if the active ProblemListener decides
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public DTMIterator asIterator(
-          XPathContext xctxt, int contextNode)
-            throws javax.xml.transform.TransformerException
-  {
-    LocPathIterator clone = (LocPathIterator)m_clones.getInstance();
-    clone.setRoot(contextNode, xctxt);
-    return clone;
-  }
-
-  
-  /**
-   * Tell if the expression is a nodeset expression.  In other words, tell 
-   * if you can execute {@link asNode() asNode} without an exception.
-   * @return true if the expression can be represented as a nodeset.
-   */
-  public boolean isNodesetExpr()
-  {
-    return true;
-  }
-  
-  /**
-   * Return the first node out of the nodeset, if this expression is 
-   * a nodeset expression.  This is the default implementation for 
-   * nodesets.  Derived classes should try and override this and return a 
-   * value without having to do a clone operation.
-   * @param xctxt The XPath runtime context.
-   * @return the first node out of the nodeset, or DTM.NULL.
-   */
-  public int asNode(XPathContext xctxt)
-    throws javax.xml.transform.TransformerException
-  {
-    DTMIterator iter = (DTMIterator)m_clones.getInstance();
-
-    int current = xctxt.getCurrentNode();
-    
-    iter.setRoot(current, xctxt);
-
-    int next = iter.nextNode();
-    // m_clones.freeInstance(iter);
-    iter.detach();
-    return next;
-  }
-  
-  /**
-   * Evaluate this operation directly to a boolean.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a boolean.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return (asNode(xctxt) != DTM.NULL);
-  }
-
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Set if this is an iterator at the upper level of
-   * the XPath.
-   *
-   * @param b true if this location path is at the top level of the
-   *          expression.
-   */
-  public void setIsTopLevel(boolean b)
-  {
-    m_isTopLevel = b;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get if this is an iterator at the upper level of
-   * the XPath.
-   *
-   * @return true if this location path is at the top level of the
-   *          expression.
-   */
-  public boolean getIsTopLevel()
-  {
-    return m_isTopLevel;
-  }
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-
-    m_context = context;
-    XPathContext xctxt = (XPathContext)environment;
-    m_execContext = xctxt;
-    m_cdtm = xctxt.getDTM(context);
-    m_currentContextNode = context;
-    m_prefixResolver = xctxt.getNamespaceContext();
-        
-//    m_lastFetched = DTM.NULL;
-//    m_currentContextNode = DTM.NULL;
-//    m_foundLast = false;
-//    m_last = 0;
-//    m_next = 0;
-
-    if (m_isTopLevel)
-      this.m_stackFrame = xctxt.getVarStack().getStackFrame();
-      
-    reset();
-  }
-
-  /**
-   * Set the next position index of this iterator.
-   *
-   * @param next A value greater than or equal to zero that indicates the next
-   * node position to fetch.
-   */
-  protected void setNextPosition(int next)
-  {
-    m_next = next;
-  }
-
-  /**
-   * Get the current position, which is one less than
-   * the next nextNode() call will retrieve.  i.e. if
-   * you call getCurrentPos() and the return is 0, the next
-   * fetch will take place at index 1.
-   *
-   * @return A value greater than or equal to zero that indicates the next
-   * node position to fetch.
-   */
-  public final int getCurrentPos()
-  {
-    return m_next;
-  }
-
-  /**
-   * Add one to the current node index.
-   */
-  void incrementNextPosition()
-  {
-    m_next++;
-  }
-
-  /**
-   * If setShouldCacheNodes(true) is called, then nodes will
-   * be cached.  They are not cached by default.
-   *
-   * @param b True if this iterator should cache nodes.
-   */
-  public void setShouldCacheNodes(boolean b)
-  {
-
-    if (b)
-    {
-      if(null == m_cachedNodes)
-      {
-        m_cachedNodes = new NodeSetDTM(getDTMManager());
-      }
-    }
-    else
-      m_cachedNodes = null;
-  }
-  
-  /**
-   * Tells if this iterator can have nodes added to it or set via 
-   * the <code>setItem(int node, int index)</code> method.
-   * 
-   * @return True if the nodelist can be mutated.
-   */
-  public boolean isMutable()
-  {
-    return (m_cachedNodes != null);
-  }
-
-
-  /**
-   * Get cached nodes.
-   *
-   * @return Cached nodes.
-   */
-  public NodeSetDTM getCachedNodes()
-  {
-    return m_cachedNodes;
-  }
-
-  /**
-   * Set the current position in the node set.
-   *
-   * @param i Must be a valid index greater
-   * than or equal to zero and less than m_cachedNodes.size().
-   */
-  public void setCurrentPos(int i)
-  {
-
-    // System.out.println("setCurrentPos: "+i);
-    if (null == m_cachedNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not do indexing or counting functions!");
-
-    setNextPosition(i);
-    m_cachedNodes.setCurrentPos(i);
-
-    // throw new RuntimeException("Who's resetting this thing?");
-  }
-
-  /**
-   * Get the length of the cached nodes.
-   *
-   * <p>Note: for the moment at least, this only returns
-   * the size of the nodes that have been fetched to date,
-   * it doesn't attempt to run to the end to make sure we
-   * have found everything.  This should be reviewed.</p>
-   *
-   * @return The size of the current cache list.
-   */
-  public int size()
-  {
-
-    if (null == m_cachedNodes)
-      return 0;
-
-    return m_cachedNodes.size();
-  }
-
-  /**
-   *  Returns the <code>index</code> th item in the collection. If
-   * <code>index</code> is greater than or equal to the number of nodes in
-   * the list, this returns <code>null</code> .
-   * @param index  Index into the collection.
-   * @return  The node at the <code>index</code> th position in the
-   *   <code>NodeList</code> , or <code>null</code> if that is not a valid
-   *   index.
-   */
-  public int item(int index)
-  {
-
-    // resetToCachedList();
-
-    return m_cachedNodes.item(index);
-  }
-  
-  /**
-   * Sets the node at the specified index of this vector to be the
-   * specified node. The previous component at that position is discarded.
-   *
-   * <p>The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.  
-   * The iterator must be in cached mode.</p>
-   * 
-   * <p>Meant to be used for sorted iterators.</p>
-   *
-   * @param node Node to set
-   * @param index Index of where to set the node
-   */
-  public void setItem(int node, int index)
-  {
-    m_cachedNodes.setElementAt(node, index);
-  }
-
-  /**
-   *  The number of nodes in the list. The range of valid child node indices
-   * is 0 to <code>length-1</code> inclusive.
-   *
-   * @return The number of nodes in the list, always greater or equal to zero.
-   */
-  public int getLength()
-  {
-
-    // resetToCachedList();
-    if(m_last > 0)
-      return m_last;
-    else if(null == m_cachedNodes || !m_foundLast)
-    {
-      m_last = getLastPos(m_execContext);
-    }
-    else
-    {
-      m_last = m_cachedNodes.getLength();
-    }
-    return m_last;
-  }
-
-  /**
-   * In order to implement NodeList (for extensions), try to reset
-   * to a cached list for random access.
-   */
-  private void resetToCachedList()
-  {
-    // %REVIEW% ? This doesn't seem to work so well...
-    int pos = this.getCurrentPos();
-
-    if ((null == m_cachedNodes) || (pos != 0))
-      this.setShouldCacheNodes(true);
-
-    runTo(-1);
-    this.setCurrentPos(pos);
-  }
-
-  /**
-   * Tells if this NodeSetDTM is "fresh", in other words, if
-   * the first nextNode() that is called will return the
-   * first node in the set.
-   *
-   * @return true of nextNode has not been called.
-   */
-  public boolean isFresh()
-  {
-    return (m_next == 0);
-  }
-
-  /**
-   *  Returns the previous node in the set and moves the position of the
-   * iterator backwards in the set.
-   * @return  The previous <code>Node</code> in the set being iterated over,
-   *   or<code>null</code> if there are no more members in that set.
-   */
-  public int previousNode()
-  {
-
-    if (null == m_cachedNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not iterate to a previous node!");
-
-    return m_cachedNodes.previousNode();
-  }
-
-  /**
-   * This attribute determines which node types are presented via the
-   * iterator. The available set of constants is defined in the
-   * <code>NodeFilter</code> interface.
-   *
-   * <p>This is somewhat useless at this time, since it doesn't
-   * really return information that tells what this iterator will
-   * show.  It is here only to fullfill the DOM NodeIterator
-   * interface.</p>
-   *
-   * @return For now, always NodeFilter.SHOW_ALL & ~NodeFilter.SHOW_ENTITY_REFERENCE.
-   * @see org.w3c.dom.traversal.NodeIterator
-   */
-  public int getWhatToShow()
-  {
-
-    // TODO: ??
-    return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
-  }
-
-  /**
-   *  The filter used to screen nodes.  Not used at this time,
-   * this is here only to fullfill the DOM NodeIterator
-   * interface.
-   *
-   * @return Always null.
-   * @see org.w3c.dom.traversal.NodeIterator
-   */
-  public DTMFilter getFilter()
-  {
-    return null;
-  }
-
-  /**
-   * The root node of the Iterator, as specified when it was created.
-   *
-   * @return The "root" of this iterator, which, in XPath terms,
-   * is the node context for this iterator.
-   */
-  public int getRoot()
-  {
-    return m_context;
-  }
-
-  /**
-   *  The value of this flag determines whether the children of entity
-   * reference nodes are visible to the iterator. If false, they will be
-   * skipped over.
-   * <br> To produce a view of the document that has entity references
-   * expanded and does not expose the entity reference node itself, use the
-   * whatToShow flags to hide the entity reference node and set
-   * expandEntityReferences to true when creating the iterator. To produce
-   * a view of the document that has entity reference nodes but no entity
-   * expansion, use the whatToShow flags to show the entity reference node
-   * and set expandEntityReferences to false.
-   *
-   * @return Always true, since entity reference nodes are not
-   * visible in the XPath model.
-   */
-  public boolean getExpandEntityReferences()
-  {
-    return true;
-  }
-  
-  /** Control over whether it is OK for detach to reset the iterator. */
-  private boolean m_allowDetach = true;
-  
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   * 
-   * @param allowRelease true if it is OK for detach to release this iterator 
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease)
-  {
-    m_allowDetach = allowRelease;
-  }
-
-  /**
-   *  Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   */
-  public void detach()
-  {    
-    if(m_allowDetach)
-    {
-      m_cachedNodes = null;
-      m_execContext = null;
-      m_prefixResolver = null;
-      m_cdtm = null;
-      
-      m_clones.freeInstance(this);
-    }
-  }
-  
-  /**
-   * Reset the iterator.
-   */
-  public void reset()
-  {
-
-    // super.reset();
-    m_foundLast = false;
-    m_lastFetched = DTM.NULL;
-    m_next = 0;
-    m_last = 0;
-  }
-
-  /**
-   * Get a cloned Iterator that is reset to the beginning
-   * of the query.
-   *
-   * @return A cloned NodeIterator set of the start of the query.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public DTMIterator cloneWithReset() throws CloneNotSupportedException
-  {
-
-    LocPathIterator clone = (LocPathIterator) clone();
-
-    clone.reset();
-
-    return clone;
-  }
-
-//  /**
-//   * Get a cloned LocPathIterator that holds the same
-//   * position as this iterator.
-//   *
-//   * @return A clone of this iterator that holds the same node position.
-//   *
-//   * @throws CloneNotSupportedException
-//   */
-//  public Object clone() throws CloneNotSupportedException
-//  {
-//
-//    LocPathIterator clone = (LocPathIterator) super.clone();
-//
-//    return clone;
-//  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public abstract int nextNode();
-
-  /**
-   * Bottleneck the return of a next node, to make returns
-   * easier from nextNode().
-   *
-   * @param nextNode The next node found, may be null.
-   *
-   * @return The same node that was passed as an argument.
-   */
-  protected int returnNextNode(int nextNode)
-  {
-
-    if (DTM.NULL != nextNode)
-    {
-      if (null != m_cachedNodes)
-        m_cachedNodes.addElement(nextNode);
-
-      this.incrementNextPosition();
-    }
-
-    m_lastFetched = nextNode;
-
-    if (DTM.NULL == nextNode)
-      m_foundLast = true;
-
-    return nextNode;
-  }
-
-  /**
-   * Return the last fetched node.  Needed to support the UnionPathIterator.
-   *
-   * @return The last fetched node, or null if the last fetch was null.
-   */
-  public int getCurrentNode()
-  {
-    return m_lastFetched;
-  }
-
-  /**
-   * If an index is requested, NodeSetDTM will call this method
-   * to run the iterator to the index.  By default this sets
-   * m_next to the index.  If the index argument is -1, this
-   * signals that the iterator should be run to the end.
-   *
-   * @param index The index to run to, or -1 if the iterator
-   * should run to the end.
-   */
-  public void runTo(int index)
-  {
-
-    if (m_foundLast || ((index >= 0) && (index <= getCurrentPos())))
-      return;
-
-    int n;
-
-    if (-1 == index)
-    {
-      while (DTM.NULL != (n = nextNode()));
-    }
-    else
-    {
-      while (DTM.NULL != (n = nextNode()))
-      {
-        if (getCurrentPos() >= index)
-          break;
-      }
-    }
-  }
-
-  /**
-   * Tells if we've found the last node yet.
-   *
-   * @return true if the last nextNode returned null.
-   */
-  public final boolean getFoundLast()
-  {
-    return m_foundLast;
-  }
-
-  /**
-   * The XPath execution context we are operating on.
-   *
-   * @return XPath execution context this iterator is operating on,
-   * or null if setRoot has not been called.
-   */
-  public final XPathContext getXPathContext()
-  {
-    return m_execContext;
-  }
-
-  /**
-   * The node context for the iterator.
-   *
-   * @return The node context, same as getRoot().
-   */
-  public final int getContext()
-  {
-    return m_context;
-  }
-
-  /**
-   * The node context from where the expression is being
-   * executed from (i.e. for current() support).
-   *
-   * @return The top-level node context of the entire expression.
-   */
-  public final int getCurrentContextNode()
-  {
-    return m_currentContextNode;
-  }
-
-  /**
-   * Set the current context node for this iterator.
-   *
-   * @param n Must be a non-null reference to the node context.
-   */
-  public final void setCurrentContextNode(int n)
-  {
-    m_currentContextNode = n;
-  }
-  
-//  /**
-//   * Set the current context node for this iterator.
-//   *
-//   * @param n Must be a non-null reference to the node context.
-//   */
-//  public void setRoot(int n)
-//  {
-//    m_context = n;
-//    m_cdtm = m_execContext.getDTM(n);
-//  }
-
-  /**
-   * Return the saved reference to the prefix resolver that
-   * was in effect when this iterator was created.
-   *
-   * @return The prefix resolver or this iterator, which may be null.
-   */
-  public final PrefixResolver getPrefixResolver()
-  {
-    return m_prefixResolver;
-  }
-
-  /**
-   * Get the index of the last node in the iteration.
-   *
-   *
-   * @return the index of the last node in the iteration.
-   */
-  public int getLast()
-  {
-    return getLength();
-  }
-
-  /**
-   * Set the index of the last node in the iteration.
-   *
-   *
-   * @param last the index of the last node in the iteration.
-   */
-  public void setLast(int last)
-  {
-    m_last = last;
-  }
-
-  /**
-   * Get the index of the last node that can be itterated to.
-   * This probably will need to be overridded by derived classes.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the index of the last node that can be itterated to.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-    int savedPos;
-    if(null != m_cachedNodes)
-      savedPos = m_cachedNodes.getCurrentPos();
-    else 
-      savedPos = -1;
-      
-    int pos = (m_predicateIndex >= 0) ? getProximityPosition() : 
-              ((null != m_cachedNodes) ? m_cachedNodes.getCurrentPos() : m_next);
-              
-    LocPathIterator clone;
-
-    try
-    {
-      // %REVIEW% %OPT%
-      if(0 == pos && m_currentContextNode != DTM.NULL)
-        clone = (LocPathIterator) cloneWithReset();
-      else
-        clone = (LocPathIterator) clone();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      return -1;
-    }
-    // %REVIEW% Commented this out, as it was messing up pos68 test. count-1?
-    // System.out.println("clone.getPredicateCount(): "+clone.getPredicateCount());
-    // clone.setPredicateCount(clone.getPredicateCount() - 1);
-
-    int next;
-
-    while (DTM.NULL != (next = clone.nextNode()))
-    {
-      pos++;
-    }
-    
-    if(-1 != savedPos)
-      m_cachedNodes.setCurrentPos(savedPos);
-
-    return pos;
-  }
-  
-//  /**
-//   * Get the analysis pattern built by the WalkerFactory.
-//   *
-//   * @return The analysis pattern built by the WalkerFactory.
-//   */
-//  int getAnalysis()
-//  {
-//    return m_analysis;
-//  }
-
-//  /**
-//   * Set the analysis pattern built by the WalkerFactory.
-//   *
-//   * @param a The analysis pattern built by the WalkerFactory.
-//   */
-//  void setAnalysis(int a)
-//  {
-//    m_analysis = a;
-//  }
-  
-  //============= State Data =============
-  
-  /** 
-   * The pool for cloned iterators.  Iterators need to be cloned
-   * because the hold running state, and thus the original iterator
-   * expression from the stylesheet pool can not be used.          
-   */
-  transient protected IteratorPool m_clones = new IteratorPool(this);
-  
-  /** 
-   * The dtm of the context node.  Careful about using this... it may not 
-   * be the dtm of the current node.
-   */
-  transient protected DTM m_cdtm;
-  
-  /**
-   * The stack frame index for this iterator.
-   */
-  transient int m_stackFrame = -1;
-
-  /**
-   * Value determined at compile time, indicates that this is an
-   * iterator at the top level of the expression, rather than inside
-   * a predicate.
-   * @serial
-   */
-  private boolean m_isTopLevel = false;
-
-  /** The index of the last node in the iteration. */
-  transient protected int m_last = 0;
-  
-  /** The last node that was fetched, usually by nextNode. */
-  transient public int m_lastFetched = DTM.NULL;
-
-  /**
-   * If this iterator needs to cache nodes that are fetched, they
-   * are stored here.
-   */
-  transient NodeSetDTM m_cachedNodes;
-
-  /**
-   * The context node for this iterator, which doesn't change through
-   * the course of the iteration.
-   */
-  transient protected int m_context = DTM.NULL;
-
-  /**
-   * The node context from where the expression is being
-   * executed from (i.e. for current() support).  Different
-   * from m_context in that this is the context for the entire
-   * expression, rather than the context for the subexpression.
-   */
-  transient protected int m_currentContextNode = DTM.NULL;
-
-  /**
-   * Fast access to the current prefix resolver.  It isn't really
-   * clear that this is needed.
-   * @serial
-   */
-  protected PrefixResolver m_prefixResolver;
-
-  /**
-   * The XPathContext reference, needed for execution of many
-   * operations.
-   */
-  transient protected XPathContext m_execContext;
-
-  /**
-   * The index of the next node to be fetched.  Useful if this
-   * is a cached iterator, and is being used as random access
-   * NodeList.
-   */
-  transient protected int m_next;
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * 
-   * @return true as a default.
-   */
-  public boolean isDocOrdered()
-  {
-    return true;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return -1;
-  }
-
-
-//  /**
-//   * The analysis pattern built by the WalkerFactory.
-//   * TODO: Move to LocPathIterator.
-//   * @see org.apache.xpath.axes.WalkerFactory
-//   * @serial
-//   */
-//  protected int m_analysis = 0x00000000;
-}
diff --git a/src/org/apache/xpath/axes/MatchPatternIterator.java b/src/org/apache/xpath/axes/MatchPatternIterator.java
deleted file mode 100644
index c0138a6..0000000
--- a/src/org/apache/xpath/axes/MatchPatternIterator.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import java.util.Stack;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.axes.SubContextList;
-import org.apache.xpath.compiler.PsuedoNames;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.StepPattern;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.Axis;
-import org.apache.xml.dtm.DTMAxisTraverser;
-
-/**
- * This class treats a 
- * <a href="http://www.w3.org/TR/xpath#location-paths">LocationPath</a> as a 
- * filtered iteration over the tree, evaluating each node in a super axis 
- * traversal against the LocationPath interpreted as a match pattern.  This 
- * class is useful to find nodes in document order that are complex paths 
- * whose steps probably criss-cross each other.
- */
-public class MatchPatternIterator extends LocPathIterator
-{
-
-  /** This is the select pattern, translated into a match pattern. */
-  protected StepPattern m_pattern;
-
-  /** The traversal axis from where the nodes will be filtered. */
-  protected int m_superAxis = -1;
-
-  /** The DTM inner traversal class, that corresponds to the super axis. */
-  protected DTMAxisTraverser m_traverser;
-  
-  /** DEBUG flag for diagnostic dumps. */
-  private static final boolean DEBUG = false;
-  
-//  protected int m_nsElemBase = DTM.NULL;
-
-  /**
-   * Create a LocPathIterator object, including creation
-   * of step walkers from the opcode list, and call back
-   * into the Compiler to create predicate expressions.
-   *
-   * @param compiler The Compiler which is creating
-   * this expression.
-   * @param opPos The position of this iterator in the
-   * opcode list from the compiler.
-   * @param analysis Analysis bits that give general information about the 
-   * LocationPath.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  MatchPatternIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-
-    super(compiler, opPos, analysis, false);
-
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-
-    m_pattern = WalkerFactory.loadSteps(this, compiler, firstStepPos, 0); 
-
-    boolean fromRoot = false;
-    boolean walkBack = false;
-    boolean walkDescendants = false;
-    boolean walkAttributes = false;
-
-    if (0 != (analysis & (WalkerFactory.BIT_ROOT | 
-                          WalkerFactory.BIT_ANY_DESCENDANT_FROM_ROOT)))
-      fromRoot = true;
-      
-    if (0 != (analysis
-              & (WalkerFactory.BIT_ANCESTOR
-                 | WalkerFactory.BIT_ANCESTOR_OR_SELF
-                 | WalkerFactory.BIT_PRECEDING
-                 | WalkerFactory.BIT_PRECEDING_SIBLING 
-                 | WalkerFactory.BIT_FOLLOWING
-                 | WalkerFactory.BIT_FOLLOWING_SIBLING
-                 | WalkerFactory.BIT_PARENT | WalkerFactory.BIT_FILTER)))
-      walkBack = true;
-
-    if (0 != (analysis
-              & (WalkerFactory.BIT_DESCENDANT_OR_SELF
-                 | WalkerFactory.BIT_DESCENDANT
-                 | WalkerFactory.BIT_CHILD)))
-      walkDescendants = true;
-
-    if (0 != (analysis
-              & (WalkerFactory.BIT_ATTRIBUTE | WalkerFactory.BIT_NAMESPACE)))
-      walkAttributes = true;
-      
-    if(false || DEBUG)
-    {
-      System.out.print("analysis: "+Integer.toBinaryString(analysis));
-      System.out.println(", "+WalkerFactory.getAnalysisString(analysis));
-    }
-      
-    if(fromRoot || walkBack)
-    {
-      if(walkAttributes)
-      {
-        m_superAxis = Axis.ALL;
-      }
-      else
-      {
-        m_superAxis = Axis.DESCENDANTSFROMROOT;
-      }
-    }
-    else if(walkDescendants)
-    {
-      if(walkAttributes)
-      {
-        m_superAxis = Axis.ALLFROMNODE;
-      }
-      else
-      {
-        m_superAxis = Axis.DESCENDANTORSELF;
-      }
-    }
-    else
-    {
-      m_superAxis = Axis.ALL;
-    }
-    if(false || DEBUG)
-    {
-      System.out.println("axis: "+Axis.names[m_superAxis]);
-    }
-    
-  }
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    super.setRoot(context, environment);
-    m_traverser = m_cdtm.getAxisTraverser(m_superAxis);
-  }
-  
-  /**
-   * Get the next node via getNextXXX.  Bottlenecked for derived class override.
-   * @return The next node on the axis, or DTM.NULL.
-   */
-  protected int getNextNode()
-  {
-    m_lastFetched = (DTM.NULL == m_lastFetched)
-                     ? m_traverser.first(m_context)
-                     : m_traverser.next(m_context, m_lastFetched);
-    return m_lastFetched;
-  }
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))
-    {
-      int next = m_cachedNodes.elementAt(m_next);
-    
-      incrementNextPosition();
-      m_currentContextNode = next;
-
-      return next;
-    }
-
-    if (m_foundLast)
-    {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-    }
-      
-    int next;
-    
-    org.apache.xpath.VariableStack vars;
-    int savedStart;
-    if (-1 != m_stackFrame)
-    {
-      vars = m_execContext.getVarStack();
-
-      // These three statements need to be combined into one operation.
-      savedStart = vars.getStackFrame();
-
-      vars.setStackFrame(m_stackFrame);
-    }
-    else
-    {
-      // Yuck.  Just to shut up the compiler!
-      vars = null;
-      savedStart = 0;
-    }
-    
-    try
-    {
-      if(DEBUG)
-        System.out.println("m_pattern"+m_pattern.toString());
-
-      do
-      {
-        next = getNextNode();
-  
-        if (DTM.NULL != next)
-        {
-          if(DTMIterator.FILTER_ACCEPT == acceptNode(next, m_execContext))
-            break;
-          else
-            continue;
-        }
-        else
-          break;
-      }
-      while (next != DTM.NULL);
-      
-      if (DTM.NULL != next)
-      {
-        if(DEBUG)
-        {
-          System.out.println("next: "+next);
-          System.out.println("name: "+m_cdtm.getNodeName(next));
-        }
-        if (null != m_cachedNodes)
-          m_cachedNodes.addElement(m_lastFetched);
-  
-        m_next++;
-  
-        return next;
-      }
-      else
-      {
-        m_foundLast = true;
-  
-        return DTM.NULL;
-      }
-    }
-    finally
-    {
-      if (-1 != m_stackFrame)
-      {
-        // These two statements need to be combined into one operation.
-        vars.setStackFrame(savedStart);
-      }
-    }
-
-  }
-  
-  /**
-   *  Test whether a specified node is visible in the logical view of a
-   * TreeWalker or NodeIterator. This function will be called by the
-   * implementation of TreeWalker and NodeIterator; it is not intended to
-   * be called directly from user code.
-   * @param n  The node to check to see if it passes the filter or not.
-   * @return  a constant to determine whether the node is accepted,
-   *   rejected, or skipped, as defined  above .
-   */
-  public short acceptNode(int n, XPathContext xctxt)
-  {
-
-    try
-    {
-      xctxt.pushCurrentNode(n);
-      xctxt.pushIteratorRoot(m_context);
-      if(DEBUG)
-      {
-        System.out.println("traverser: "+m_traverser);
-        System.out.print("node: "+n);
-        System.out.println(", "+m_cdtm.getNodeName(n));
-        // if(m_cdtm.getNodeName(n).equals("near-east"))
-        System.out.println("pattern: "+m_pattern.toString());
-        m_pattern.debugWhatToShow(m_pattern.getWhatToShow());
-      }
-      
-      XObject score = m_pattern.execute(xctxt);
-      
-      if(DEBUG)
-      {
-        // System.out.println("analysis: "+Integer.toBinaryString(m_analysis));
-        System.out.println("score: "+score);
-        System.out.println("skip: "+(score == NodeTest.SCORE_NONE));
-      }
-
-      // System.out.println("\n::acceptNode - score: "+score.num()+"::");
-      return (score == NodeTest.SCORE_NONE) ? DTMIterator.FILTER_SKIP 
-                    : DTMIterator.FILTER_ACCEPT;
-    }
-    catch (javax.xml.transform.TransformerException se)
-    {
-
-      // TODO: Fix this.
-      throw new RuntimeException(se.getMessage());
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-      xctxt.popIteratorRoot();
-    }
-
-  }
-
-}
diff --git a/src/org/apache/xpath/axes/OneStepIterator.java b/src/org/apache/xpath/axes/OneStepIterator.java
deleted file mode 100644
index 86dd021..0000000
--- a/src/org/apache/xpath/axes/OneStepIterator.java
+++ /dev/null
@@ -1,268 +0,0 @@
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.Axis;
-import org.apache.xml.dtm.DTMAxisIterator;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements a general iterator for
- * those LocationSteps with only one step, and perhaps a predicate.
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class OneStepIterator extends ChildTestIterator
-{
-  /** The traversal axis from where the nodes will be filtered. */
-  protected int m_axis = -1;
-
-  /** The DTM inner traversal class, that corresponds to the super axis. */
-  protected DTMAxisIterator m_iterator;
-
-  /**
-   * Create a OneStepIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  OneStepIterator(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-    super(compiler, opPos, analysis);
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-    
-    m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
-    
-  }
-  
-  /**
-   * Create a OneStepIterator object.
-   *
-   * @param iterator The DTM iterator which this iterator will use.
-   * @param axis One of Axis.Child, etc., or -1 if the axis is unknown.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public OneStepIterator(DTMAxisIterator iterator, int axis)
-          throws javax.xml.transform.TransformerException
-  {
-    super(null);
-    
-    m_iterator = iterator;
-    m_axis = axis;
-    int whatToShow = DTMFilter.SHOW_ALL;
-    initNodeTest(whatToShow);
-  }
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    super.setRoot(context, environment);
-    if(m_axis > -1)
-      m_iterator = m_cdtm.getAxisIterator(m_axis);
-    m_iterator.setStartNode(m_context);
-  }
-  
-  /**
-   * Get the next node via getFirstAttribute && getNextAttribute.
-   */
-  protected int getNextNode()
-  {
-    return m_lastFetched = m_iterator.next();
-  }
-  
-  /**
-   * Get a cloned iterator.
-   *
-   * @return A new iterator that can be used without mutating this one.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-    // Do not access the location path itterator during this operation!
-    
-    OneStepIterator clone = (OneStepIterator) super.clone();
-
-    if(m_iterator != null)
-    {
-      clone.m_iterator = m_iterator.cloneIterator();
-    }
-    return clone;
-  }
-
-
-  /**
-   * Tells if this is a reverse axes.  Overrides AxesWalker#isReverseAxes.
-   *
-   * @return true for this class.
-   */
-  public boolean isReverseAxes()
-  {
-    return m_iterator.isReverse();
-  }
-
-  /**
-   * Get the current sub-context position.  In order to do the
-   * reverse axes count, for the moment this re-searches the axes
-   * up to the predicate.  An optimization on this is to cache
-   * the nodes searched, but, for the moment, this case is probably
-   * rare enough that the added complexity isn't worth it.
-   *
-   * @param predicateIndex The predicate index of the proximity position.
-   *
-   * @return The pridicate index, or -1.
-   */
-  protected int getProximityPosition(int predicateIndex)
-  {
-    if(!isReverseAxes())
-      return super.getProximityPosition(predicateIndex);
-      
-    // A negative predicate index seems to occur with
-    // (preceding-sibling::*|following-sibling::*)/ancestor::*[position()]/*[position()]
-    // -sb
-    if(predicateIndex < 0)
-      return -1;
-      
-    if (m_proximityPositions[predicateIndex] <= 0)
-    {
-      XPathContext xctxt = getXPathContext();
-      try
-      {
-        OneStepIterator clone = (OneStepIterator) this.clone();
-        
-        int root = getRoot();
-        xctxt.pushCurrentNode(root);
-        clone.setRoot(root, xctxt);
-
-        clone.setPredicateCount(predicateIndex);
-
-        // Count 'em all
-        int count = 1;
-        int next;
-
-        while (DTM.NULL != (next = clone.nextNode()))
-        {
-          count++;
-        }
-
-        m_proximityPositions[predicateIndex] += count;
-      }
-      catch (CloneNotSupportedException cnse)
-      {
-
-        // can't happen
-      }
-      finally
-      {
-        xctxt.popCurrentNode();
-      }
-    }
-
-    return m_proximityPositions[predicateIndex];
-  }
-
-  /**
-   * Count backwards one proximity position.
-   *
-   * @param i The predicate index.
-   */
-  protected void countProximityPosition(int i)
-  {
-    if(!isReverseAxes())
-      super.countProximityPosition(i);
-    else if (i < m_proximityPositions.length)
-      m_proximityPositions[i]--;
-  }
-
-  /**
-   * Get the number of nodes in this node list.  The function is probably ill
-   * named?
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return the number of nodes in this node list.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-    if(!isReverseAxes())
-      return super.getLastPos(xctxt);
-
-    int count = 0;
-
-    try
-    {
-      OneStepIterator clone = (OneStepIterator) this.clone();
-
-      int root = getRoot();
-      xctxt.pushCurrentNode(root);
-      clone.setRoot(root, xctxt);
-
-      clone.setPredicateCount(this.getPredicateCount() - 1);
-
-      // Count 'em all
-      // count = 1;
-      int next;
-
-      while (DTM.NULL != (next = clone.nextNode()))
-      {
-        count++;
-      }
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-
-      // can't happen
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-    }
-
-    // System.out.println("getLastPos - pos: "+count);
-    // System.out.println("pos (ReverseAxesWalker): "+count);
-    return count;
-  }
-  
-  /**
-   * Reset the iterator.
-   */
-  public void reset()
-  {
-
-    super.reset();
-    if(null != m_iterator)
-      m_iterator.reset();
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return m_axis;
-  }
-
-
-}
diff --git a/src/org/apache/xpath/axes/OneStepIteratorForward.java b/src/org/apache/xpath/axes/OneStepIteratorForward.java
deleted file mode 100644
index edfe596..0000000
--- a/src/org/apache/xpath/axes/OneStepIteratorForward.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.Axis;
-import org.apache.xml.dtm.DTMAxisTraverser;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements a general iterator for
- * those LocationSteps with only one step, and perhaps a predicate, 
- * that only go forward (i.e. it can not be used with ancestors, 
- * preceding, etc.)
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class OneStepIteratorForward extends ChildTestIterator
-{
-  /** The traversal axis from where the nodes will be filtered. */
-  protected int m_axis = -1;
-
-  /**
-   * Create a OneStepIterator object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  OneStepIteratorForward(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-    super(compiler, opPos, analysis);
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-    
-    m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
-    
-  }
-  
-  /**
-   * Create a OneStepIterator object that will just traverse the self axes.
-   * 
-   * @param axis One of the org.apache.xml.dtm.Axis integers.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public OneStepIteratorForward(int axis)
-  {
-    super(null);
-    
-    m_axis = axis;
-    int whatToShow = DTMFilter.SHOW_ALL;
-    initNodeTest(whatToShow);
-  }
-
-  
-
-  
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    super.setRoot(context, environment);
-    m_traverser = m_cdtm.getAxisTraverser(m_axis);
-    
-  }
-  
-//  /**
-//   * Return the first node out of the nodeset, if this expression is 
-//   * a nodeset expression.  This is the default implementation for 
-//   * nodesets.
-//   * <p>WARNING: Do not mutate this class from this function!</p>
-//   * @param xctxt The XPath runtime context.
-//   * @return the first node out of the nodeset, or DTM.NULL.
-//   */
-//  public int asNode(XPathContext xctxt)
-//    throws javax.xml.transform.TransformerException
-//  {
-//    if(getPredicateCount() > 0)
-//      return super.asNode(xctxt);
-//      
-//    int current = xctxt.getCurrentNode();
-//    
-//    DTM dtm = xctxt.getDTM(current);
-//    DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);
-//    
-//    String localName = getLocalName();
-//    String namespace = getNamespace();
-//    int what = m_whatToShow;
-//    
-//    // System.out.println("what: ");
-//    // NodeTest.debugWhatToShow(what);
-//    if(DTMFilter.SHOW_ALL == what
-//       || ((DTMFilter.SHOW_ELEMENT & what) == 0)
-//       || localName == NodeTest.WILD
-//       || namespace == NodeTest.WILD)
-//    {
-//      return traverser.first(current);
-//    }
-//    else
-//    {
-//      int type = getNodeTypeTest(what);
-//      int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
-//      return traverser.first(current, extendedType);
-//    }
-//  }
-  
-  /**
-   * Get the next node via getFirstAttribute && getNextAttribute.
-   */
-  protected int getNextNode()
-  {
-    m_lastFetched = (DTM.NULL == m_lastFetched)
-                     ? m_traverser.first(m_context)
-                     : m_traverser.next(m_context, m_lastFetched);
-    return m_lastFetched;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    return m_axis;
-  }
-
-  
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/axes/PredicatedNodeTest.java b/src/org/apache/xpath/axes/PredicatedNodeTest.java
deleted file mode 100644
index eb46c38..0000000
--- a/src/org/apache/xpath/axes/PredicatedNodeTest.java
+++ /dev/null
@@ -1,525 +0,0 @@
-package org.apache.xpath.axes;
-
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.Expression;
-import org.apache.xpath.axes.SubContextList;
-
-import org.apache.xml.utils.PrefixResolver;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeFilter;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-
-public abstract class PredicatedNodeTest extends NodeTest implements SubContextList
-{
-
-  /**
-   * Construct an AxesWalker using a LocPathIterator.
-   *
-   * @param locPathIterator non-null reference to the parent iterator.
-   */
-  PredicatedNodeTest(LocPathIterator locPathIterator)
-  {
-    m_lpi = locPathIterator;
-  }
-  
-  /**
-   * Construct an AxesWalker.  The location path iterator will have to be set
-   * before use.
-   */
-  PredicatedNodeTest()
-  {
-  }
-  
-  /**
-   * Read the object from a serialization stream.
-   *
-   * @param stream Input stream to read from
-   *
-   * @throws java.io.IOException
-   * @throws javax.xml.transform.TransformerException
-   */
-  private void readObject(java.io.ObjectInputStream stream)
-          throws java.io.IOException, javax.xml.transform.TransformerException
-  {
-    try
-    {
-      stream.defaultReadObject();
-      m_predicateIndex = -1;
-      resetProximityPositions();
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new javax.xml.transform.TransformerException(cnfe);
-    }
-  }
-  
-  /**
-   * Get a cloned PrdicatedNodeTest.
-   *
-   * @return A new PredicatedNodeTest that can be used without mutating this one.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-    // Do not access the location path itterator during this operation!
-    
-    PredicatedNodeTest clone = (PredicatedNodeTest) super.clone();
-
-    if ((null != this.m_proximityPositions)
-            && (this.m_proximityPositions == clone.m_proximityPositions))
-    {
-      clone.m_proximityPositions = new int[this.m_proximityPositions.length];
-
-      System.arraycopy(this.m_proximityPositions, 0,
-                       clone.m_proximityPositions, 0,
-                       this.m_proximityPositions.length);
-    }
-    
-    if(clone.m_lpi == this)
-      clone.m_lpi = (LocPathIterator)clone;
-
-    return clone;
-  }
-
-  /**
-   * Get the number of predicates that this walker has.
-   *
-   * @return the number of predicates that this walker has.
-   */
-  public int getPredicateCount()
-  {
-    return (null == m_predicates) ? 0 : m_predicates.length;
-  }
-
-  /**
-   * Set the number of predicates that this walker has.  This does more 
-   * that one would think, as it creates a new predicate array of the 
-   * size of the count argument, and copies count predicates into the new 
-   * one from the old, and then reassigns the predicates value.  All this 
-   * to keep from having to have a predicate count value.
-   *
-   * @param count The number of predicates, which must be equal or less 
-   *               than the existing count.
-   */
-  public void setPredicateCount(int count)
-  {
-    if(count > 0)
-    {
-      Expression[] newPredicates = new Expression[count];
-      for (int i = 0; i < count; i++) 
-      {
-        newPredicates[i] = m_predicates[i];
-      }
-      m_predicates = newPredicates;
-    }
-    else
-      m_predicates = null;
-    
-  }
-
-  /**
-   * Init predicate info.
-   *
-   * @param compiler The Compiler object that has information about this 
-   *                 walker in the op map.
-   * @param opPos The op code position of this location step.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void initPredicateInfo(Compiler compiler, int opPos)
-          throws javax.xml.transform.TransformerException
-  {
-
-    int pos = compiler.getFirstPredicateOpPos(opPos);
-
-    if(pos > 0)
-      m_predicates = compiler.getCompiledPredicates(pos);
-  }
-
-  /**
-   * Get a predicate expression at the given index.
-   *
-   *
-   * @param index Index of the predicate.
-   *
-   * @return A predicate expression.
-   */
-  Expression getPredicate(int index)
-  {
-    return m_predicates[index];
-  }
-  
-  /**
-   * Get the current sub-context position.
-   *
-   * @return The node position of this walker in the sub-context node list.
-   */
-  public int getProximityPosition()
-  {
-
-    // System.out.println("getProximityPosition - m_predicateIndex: "+m_predicateIndex);
-    return getProximityPosition(m_predicateIndex);
-  }
-
-  /**
-   * Get the current sub-context position.
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return The node position of this walker in the sub-context node list.
-   */
-  public int getProximityPosition(XPathContext xctxt)
-  {
-    return getProximityPosition();
-  }
-  
-  /**
-   * Get the index of the last node that can be itterated to.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the index of the last node that can be itterated to.
-   */
-  public abstract int getLastPos(XPathContext xctxt);
-
-  /**
-   * Get the current sub-context position.
-   *
-   * @param predicateIndex The index of the predicate where the proximity 
-   *                       should be taken from.
-   *
-   * @return The node position of this walker in the sub-context node list.
-   */
-  protected int getProximityPosition(int predicateIndex)
-  {
-    return (predicateIndex >= 0) ? m_proximityPositions[predicateIndex] : 0;
-  }
-
-  /**
-   * Reset the proximity positions counts.
-   */
-  public void resetProximityPositions()
-  {
-    int nPredicates = getPredicateCount();
-    if (nPredicates > 0)
-    {
-      if (null == m_proximityPositions)
-        m_proximityPositions = new int[nPredicates];
-
-      for (int i = 0; i < nPredicates; i++)
-      {
-        try
-        {
-          initProximityPosition(i);
-        }
-        catch(Exception e)
-        {
-          // TODO: Fix this...
-          throw new org.apache.xml.utils.WrappedRuntimeException(e);
-        }
-      }
-    }
-  }
-
-  /**
-   * Init the proximity position to zero for a forward axes.
-   *
-   * @param i The index into the m_proximityPositions array.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void initProximityPosition(int i) throws javax.xml.transform.TransformerException
-  {
-    m_proximityPositions[i] = 0;
-  }
-
-  /**
-   * Count forward one proximity position.
-   *
-   * @param i The index into the m_proximityPositions array, where the increment 
-   *          will occur.
-   */
-  protected void countProximityPosition(int i)
-  {
-    if (i < m_proximityPositions.length)
-      m_proximityPositions[i]++;
-  }
-
-  /**
-   * Tells if this is a reverse axes.
-   *
-   * @return false, unless a derived class overrides.
-   */
-  public boolean isReverseAxes()
-  {
-    return false;
-  }
-
-  /**
-   * Get which predicate is executing.
-   *
-   * @return The current predicate index, or -1 if no predicate is executing.
-   */
-  public int getPredicateIndex()
-  {
-    return m_predicateIndex;
-  }
-
-  /**
-   * Process the predicates.
-   *
-   * @param context The current context node.
-   * @param xctxt The XPath runtime context.
-   *
-   * @return the result of executing the predicate expressions.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  boolean executePredicates(int context, XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    
-    int nPredicates = getPredicateCount();
-    // System.out.println("nPredicates: "+nPredicates);
-    if (nPredicates == 0)
-      return true;
-
-    PrefixResolver savedResolver = xctxt.getNamespaceContext();
-
-    try
-    {
-      m_predicateIndex = 0;
-      xctxt.pushSubContextList(this);
-      xctxt.pushNamespaceContext(m_lpi.getPrefixResolver());
-      xctxt.pushCurrentNode(context);
-
-      for (int i = 0; i < nPredicates; i++)
-      {
-        // System.out.println("Executing predicate expression - waiting count: "+m_lpi.getWaitingCount());
-        XObject pred = m_predicates[i].execute(xctxt);
-        // System.out.println("\nBack from executing predicate expression - waiting count: "+m_lpi.getWaitingCount());
-        // System.out.println("pred.getType(): "+pred.getType());
-        if (XObject.CLASS_NUMBER == pred.getType())
-        {
-          if (DEBUG_PREDICATECOUNTING)
-          {
-            System.out.flush();
-            System.out.println("\n===== start predicate count ========");
-            System.out.println("m_predicateIndex: " + m_predicateIndex);
-            // System.out.println("getProximityPosition(m_predicateIndex): "
-            //                   + getProximityPosition(m_predicateIndex));
-            System.out.println("pred.num(): " + pred.num());
-          }
-
-          int proxPos = this.getProximityPosition(m_predicateIndex);
-          if (proxPos != (int) pred.num())
-          {
-            if (DEBUG_PREDICATECOUNTING)
-            {
-              System.out.println("\nnode context: "+nodeToString(context));
-              System.out.println("index predicate is false: "+proxPos);
-              System.out.println("\n===== end predicate count ========");
-            }
-            return false;
-          }
-          else if (DEBUG_PREDICATECOUNTING)
-          {
-            System.out.println("\nnode context: "+nodeToString(context));
-            System.out.println("index predicate is true: "+proxPos);
-            System.out.println("\n===== end predicate count ========");
-          }
-          
-          // If there is a proximity index that will not change during the 
-          // course of itteration, then we know there can be no more true 
-          // occurances of this predicate, so flag that we're done after 
-          // this.
-          if(m_predicates[i].isStableNumber())
-          {
-            m_foundLast = true;
-          }
-        }
-        else if (!pred.bool())
-          return false;
-
-        countProximityPosition(++m_predicateIndex);
-      }
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-      xctxt.popNamespaceContext();
-      xctxt.popSubContextList();
-      m_predicateIndex = -1;
-    }
-
-    return true;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    super.fixupVariables(vars, globalsSize);
-
-    int nPredicates = getPredicateCount();
-
-    for (int i = 0; i < nPredicates; i++)
-    {
-      m_predicates[i].fixupVariables(vars, globalsSize);
-    }
-  }
-
-  
-  /**
-   * Diagnostics.
-   *
-   * @param n Node to give diagnostic information about, or null.
-   *
-   * @return Informative string about the argument.
-   */
-  protected String nodeToString(int n)
-  {
-    if(DTM.NULL != n)
-    {
-      DTM dtm = m_lpi.getXPathContext().getDTM(n);
-      return dtm.getNodeName(n) + "{" + (n+1) + "}";
-    }
-    else
-    {
-      return "null";
-    }
-  }
-  
-  //=============== NodeFilter Implementation ===============
-
-  /**
-   *  Test whether a specified node is visible in the logical view of a
-   * TreeWalker or NodeIterator. This function will be called by the
-   * implementation of TreeWalker and NodeIterator; it is not intended to
-   * be called directly from user code.
-   * @param n  The node to check to see if it passes the filter or not.
-   * @return  a constant to determine whether the node is accepted,
-   *   rejected, or skipped, as defined  above .
-   */
-  public short acceptNode(int n)
-  {
-
-    XPathContext xctxt = m_lpi.getXPathContext();
-
-    try
-    {
-      xctxt.pushCurrentNode(n);
-
-      XObject score = execute(xctxt, n);
-
-      // System.out.println("\n::acceptNode - score: "+score.num()+"::");
-      if (score != NodeTest.SCORE_NONE)
-      {
-        if (getPredicateCount() > 0)
-        {
-          countProximityPosition(0);
-
-          if (!executePredicates(n, xctxt))
-            return DTMIterator.FILTER_SKIP;
-        }
-
-        return DTMIterator.FILTER_ACCEPT;
-      }
-    }
-    catch (javax.xml.transform.TransformerException se)
-    {
-
-      // TODO: Fix this.
-      throw new RuntimeException(se.getMessage());
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-    }
-
-    return DTMIterator.FILTER_SKIP;
-  }
-
-  
-  /**
-   * Get the owning location path iterator.
-   *
-   * @return the owning location path iterator, which should not be null.
-   */
-  public LocPathIterator getLocPathIterator()
-  {
-    return m_lpi;
-  }
-
-  /**
-   * Set the location path iterator owner for this walker.  Besides 
-   * initialization, this function is called during cloning operations.
-   *
-   * @param li non-null reference to the owning location path iterator.
-   */
-  public void setLocPathIterator(LocPathIterator li)
-  {
-    m_lpi = li;
-  }
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-    int n = getPredicateCount();
-    for (int i = 0; i < n; i++) 
-    {
-      if(getPredicate(i).canTraverseOutsideSubtree())
-        return true;
-    }
-    return false;
-   }
-   
-  /** This is true if nextNode returns null. */
-  transient protected boolean m_foundLast = false;
-    
-  /** The owning location path iterator.
-   *  @serial */
-  protected LocPathIterator m_lpi;
-  
-  /**
-   * Which predicate we are executing.
-   */
-  transient int m_predicateIndex = -1;
-  
-  /** The list of predicate expressions. Is static and does not need 
-   *  to be deep cloned.
-   *  @serial 
-   */
-  private Expression[] m_predicates;
-
-  /**
-   * An array of counts that correspond to the number
-   * of predicates the step contains.
-   */
-  transient protected int[] m_proximityPositions;
-
-  /** If true, diagnostic messages about predicate execution will be posted.  */
-  static final boolean DEBUG_PREDICATECOUNTING = false;
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/axes/ReverseAxesWalker.java b/src/org/apache/xpath/axes/ReverseAxesWalker.java
deleted file mode 100644
index ffe6885..0000000
--- a/src/org/apache/xpath/axes/ReverseAxesWalker.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import java.util.Vector;
-
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.objects.XObject;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMAxisIterator;
-import org.apache.xml.dtm.Axis;
-
-/**
- * Walker for a reverse axes.
- * @see <a href="http://www.w3.org/TR/xpath#predicates">XPath 2.4 Predicates</a>
- */
-public class ReverseAxesWalker extends AxesWalker
-{
-
-  /**
-   * Construct an AxesWalker using a LocPathIterator.
-   *
-   * @param locPathIterator The location path iterator that 'owns' this walker.
-   */
-  ReverseAxesWalker(LocPathIterator locPathIterator, int axis)
-  {
-    super(locPathIterator, axis);
-  }
-  
-  /**
-   * Set the root node of the TreeWalker.
-   * (Not part of the DOM2 TreeWalker interface).
-   *
-   * @param root The context node of this step.
-   */
-  public void setRoot(int root)
-  {
-    super.setRoot(root);
-    m_iterator = getDTM(root).getAxisIterator(m_axis);
-    m_iterator.setStartNode(root);
-  }
-  
-  /**
-   * Get the next node in document order on the axes.
-   *
-   * @return the next node in document order on the axes, or null.
-   */
-  protected int getNextNode()
-  {
-    if (m_foundLast)
-      return DTM.NULL;
-
-    int next = m_iterator.next();
-    
-    if (m_isFresh)
-      m_isFresh = false;
-
-    if (DTM.NULL == next)
-      this.m_foundLast = true;
-
-    return next;
-  }
-
-
-  /**
-   * Tells if this is a reverse axes.  Overrides AxesWalker#isReverseAxes.
-   *
-   * @return true for this class.
-   */
-  public boolean isReverseAxes()
-  {
-    return true;
-  }
-
-//  /**
-//   *  Set the root node of the TreeWalker.
-//   *
-//   * @param root The context node of this step.
-//   */
-//  public void setRoot(int root)
-//  {
-//    super.setRoot(root);
-//  }
-
-  /**
-   * Get the current sub-context position.  In order to do the
-   * reverse axes count, for the moment this re-searches the axes
-   * up to the predicate.  An optimization on this is to cache
-   * the nodes searched, but, for the moment, this case is probably
-   * rare enough that the added complexity isn't worth it.
-   *
-   * @param predicateIndex The predicate index of the proximity position.
-   *
-   * @return The pridicate index, or -1.
-   */
-  protected int getProximityPosition(int predicateIndex)
-  {
-    // A negative predicate index seems to occur with
-    // (preceding-sibling::*|following-sibling::*)/ancestor::*[position()]/*[position()]
-    // -sb
-    if(predicateIndex < 0)
-      return -1;
-      
-    if (m_proximityPositions[predicateIndex] <= 0)
-    {
-      AxesWalker savedWalker = wi().getLastUsedWalker();
-
-      try
-      {
-        ReverseAxesWalker clone = (ReverseAxesWalker) this.clone();
-
-        clone.setRoot(this.getRoot());
-
-        clone.setPredicateCount(predicateIndex);
-
-        clone.setPrevWalker(null);
-        clone.setNextWalker(null);
-        wi().setLastUsedWalker(clone);
-
-        // Count 'em all
-        int count = 1;
-        int next;
-
-        while (DTM.NULL != (next = clone.nextNode()))
-        {
-          count++;
-        }
-
-        m_proximityPositions[predicateIndex] += count;
-      }
-      catch (CloneNotSupportedException cnse)
-      {
-
-        // can't happen
-      }
-      finally
-      {
-        wi().setLastUsedWalker(savedWalker);
-      }
-    }
-
-    return m_proximityPositions[predicateIndex];
-  }
-
-  /**
-   * Count backwards one proximity position.
-   *
-   * @param i The predicate index.
-   */
-  protected void countProximityPosition(int i)
-  {
-    if (i < m_proximityPositions.length)
-      m_proximityPositions[i]--;
-  }
-
-  /**
-   * Get the number of nodes in this node list.  The function is probably ill
-   * named?
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return the number of nodes in this node list.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-
-    int count = 0;
-    AxesWalker savedWalker = wi().getLastUsedWalker();
-
-    try
-    {
-      ReverseAxesWalker clone = (ReverseAxesWalker) this.clone();
-
-      clone.setRoot(this.getRoot());
-
-      clone.setPredicateCount(this.getPredicateCount() - 1);
-
-      clone.setPrevWalker(null);
-      clone.setNextWalker(null);
-      wi().setLastUsedWalker(clone);
-
-      // Count 'em all
-      // count = 1;
-      int next;
-
-      while (DTM.NULL != (next = clone.nextNode()))
-      {
-        count++;
-      }
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-
-      // can't happen
-    }
-    finally
-    {
-      wi().setLastUsedWalker(savedWalker);
-    }
-
-    return count;
-  }
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * Warning: This can only be called after setRoot has been called!
-   * 
-   * @return false.
-   */
-  public boolean isDocOrdered()
-  {
-    return false;  // I think.
-  }
-  
-  /** The DTM inner traversal class, that corresponds to the super axis. */
-  protected DTMAxisIterator m_iterator;
-}
diff --git a/src/org/apache/xpath/axes/SelfIteratorNoPredicate.java b/src/org/apache/xpath/axes/SelfIteratorNoPredicate.java
deleted file mode 100644
index 475cf31..0000000
--- a/src/org/apache/xpath/axes/SelfIteratorNoPredicate.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.apache.xpath.axes;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolver;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.DOMException;
-import org.apache.xml.dtm.DTM;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class implements an optimized iterator for
- * "." patterns, that is, the self axes without any predicates.  
- * @see org.apache.xpath.axes.WalkerFactory#newLocPathIterator
- */
-public class SelfIteratorNoPredicate extends LocPathIterator
-{
-
-  /**
-   * Create a SelfIteratorNoPredicate object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   * @param analysis Analysis bits.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  SelfIteratorNoPredicate(Compiler compiler, int opPos, int analysis)
-          throws javax.xml.transform.TransformerException
-  {
-    super(compiler, opPos, analysis, false);
-  }
-  
-  /**
-   * Create a SelfIteratorNoPredicate object.
-   *
-   * @param compiler A reference to the Compiler that contains the op map.
-   * @param opPos The position within the op map, which contains the
-   * location path expression for this itterator.
-   * @param analysis Analysis bits.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public SelfIteratorNoPredicate()
-          throws javax.xml.transform.TransformerException
-  {
-    super(null);
-  }
-
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   *
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))
-    {
-      int next = m_cachedNodes.elementAt(m_next);
-    
-      incrementNextPosition();
-      m_currentContextNode = next;
-
-      return next;
-    }
-
-    if (m_foundLast)
-    {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-    }
-
-    int next;
-    DTM dtm = m_cdtm;
-
-    m_lastFetched = next = (DTM.NULL == m_lastFetched)
-                           ? m_context
-                           : DTM.NULL;
-
-    // m_lastFetched = next;
-    if (DTM.NULL != next)
-    {
-      if (null != m_cachedNodes)
-        m_cachedNodes.addElement(m_lastFetched);
-
-      m_next++;
-
-      return next;
-    }
-    else
-    {
-      m_foundLast = true;
-
-      return DTM.NULL;
-    }
-  }
-  
-  /**
-   * Return the first node out of the nodeset, if this expression is 
-   * a nodeset expression.  This is the default implementation for 
-   * nodesets.  Derived classes should try and override this and return a 
-   * value without having to do a clone operation.
-   * @param xctxt The XPath runtime context.
-   * @return the first node out of the nodeset, or DTM.NULL.
-   */
-  public int asNode(XPathContext xctxt)
-    throws javax.xml.transform.TransformerException
-  {
-    return xctxt.getCurrentNode();
-  }
-  
-  /**
-   * Get the index of the last node that can be itterated to.
-   * This probably will need to be overridded by derived classes.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the index of the last node that can be itterated to.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-    return 1;
-  }
-
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/axes/SubContextList.java b/src/org/apache/xpath/axes/SubContextList.java
deleted file mode 100644
index 959bf3a..0000000
--- a/src/org/apache/xpath/axes/SubContextList.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import org.apache.xpath.XPathContext;
-
-//import org.w3c.dom.Node;
- 
-/**
- * <meta name="usage" content="advanced"/>
- * A class that implements this interface is a sub context node list, meaning it
- * is a node list for a location path step for a predicate.
- */
-public interface SubContextList
-{
-
-  /**
-   * Get the number of nodes in the node list, which, in the XSLT 1 based 
-   * counting system, is the last index position.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return the number of nodes in the node list.
-   */
-  public int getLastPos(XPathContext xctxt);
-
-  /**
-   * Get the current sub-context position.
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return The position of the current node in the list.
-   */
-  public int getProximityPosition(XPathContext xctxt);
-}
diff --git a/src/org/apache/xpath/axes/UnionPathIterator.java b/src/org/apache/xpath/axes/UnionPathIterator.java
deleted file mode 100644
index 5770e1c..0000000
--- a/src/org/apache/xpath/axes/UnionPathIterator.java
+++ /dev/null
@@ -1,1024 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import org.apache.xpath.compiler.OpCodes;
-
-// DOM Imports
-//import org.w3c.dom.traversal.NodeIterator;
-//import org.w3c.dom.Node;
-//import org.w3c.dom.DOMException;
-//import org.w3c.dom.traversal.NodeFilter;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMManager;
-import org.apache.xml.dtm.DTMIterator;
-
-// Xalan Imports
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xml.utils.ObjectPool;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class extends NodeSetDTM, which implements DTMIterator,
- * and fetches nodes one at a time in document order based on a XPath
- * <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- * As each node is iterated via nextNode(), the node is also stored
- * in the NodeVector, so that previousNode() can easily be done.
- */
-public class UnionPathIterator extends Expression
-        implements Cloneable, DTMIterator, java.io.Serializable
-{
-
-  /**
-   * Constructor to create an instance which you can add location paths to.
-   */
-  public UnionPathIterator()
-  {
-
-    super();
-
-    // m_mutable = false;
-    // m_cacheNodes = false;
-    m_iterators = null;
-  }
-
-  /**
-   * Initialize the context values for this expression 
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this 
-   * transformation.
-   */
-  public void setRoot(int context, Object environment)
-  {
-    this.m_execContext = (XPathContext)environment;
-    this.m_currentContextNode = context;
-    this.m_context = context;
-    m_lastFetched = DTM.NULL;
-    m_next = 0;
-    m_last = 0;
-    m_foundLast = false;
-
-    try
-    {
-      if (null != m_iterators)
-      {
-        int n = m_iterators.length;
-  
-        for (int i = 0; i < n; i++)
-        {
-          m_iterators[i] = ((LocPathIterator)m_iterators[i]).asIterator(m_execContext, context);
-          m_iterators[i].setRoot(context, environment);
-          m_iterators[i].nextNode();
-        }
-      }
-    }
-    catch(Exception e)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(e);
-    }
-  }
-  
-  /** Control over whether it is OK for detach to reset the iterator. */
-  private boolean m_allowDetach = true;
-  
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   * 
-   * @param allowRelease true if it is OK for detach to release this iterator 
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease)
-  {
-    m_allowDetach = allowRelease;
-  }
-
-  /**
-   *  Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   */
-  public void detach()
-  {
-
-    if(m_allowDetach)
-    {
-      m_cachedNodes = null;
-      m_execContext = null;
-      // m_prefixResolver = null;
-      // m_cdtm = null;
-      
-      if (null != m_iterators)
-      {
-        int n = m_iterators.length;
-  
-        for (int i = 0; i < n; i++)
-        {
-          m_iterators[i].detach();
-        }
-      }
-
-  
-  //    int n = m_iterators.length;
-  //
-  //    for (int i = 0; i < n; i++)
-  //    {
-  //      m_iterators[i].detach();
-  //    }
-  
-      m_clones.freeInstance(this);
-    }
-  }
-
-  /** Pool of UnionPathIterators.  (The need for this has to be re-evaluated.  -sb) */
-  transient protected IteratorPool m_clones = new IteratorPool(this);
-
-  /**
-   * Execute this iterator, meaning create a clone that can  
-   * store state, and initialize it for fast execution from 
-   * the current runtime state.  When this is called, no actual 
-   * query from the current context node is performed.
-   *
-   * @param xctxt The XPath execution context.
-   *
-   * @return An XNodeSet reference that holds this iterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    UnionPathIterator clone =
-      (UnionPathIterator) m_clones.getInstance();
-
-    int current = xctxt.getCurrentNode();
-    clone.setRoot(current, xctxt);
-
-    return new XNodeSet(clone);
-  }
-
-  /** If this iterator needs to cache nodes that are fetched, they
-   * are stored here.   */
-  transient NodeSetDTM m_cachedNodes = null;
-
-  /** The index of the next node to be fetched.  Useful if this 
-   * is a cached iterator, and is being used as random access 
-   * NodeList.   */
-  transient protected int m_next = 0;
-
-  /**
-   * If setShouldCacheNodes(true) is called, then nodes will
-   * be cached.  They are not cached by default.
-   *
-   * @param b True if this iterator should cache nodes.
-   */
-  public void setShouldCacheNodes(boolean b)
-  {
-
-    if (b)
-      m_cachedNodes = new NodeSetDTM(getDTMManager());
-    else
-      m_cachedNodes = null;
-  }
-  
-  /**
-   * Tells if this iterator can have nodes added to it or set via 
-   * the <code>setItem(int node, int index)</code> method.
-   * 
-   * @return True if the nodelist can be mutated.
-   */
-  public boolean isMutable()
-  {
-    return (m_cachedNodes != null);
-  }
-
-  /**
-   * Set the current position in the node set.
-   * @param i Must be a valid index.
-   */
-  public void setCurrentPos(int i)
-  {
-
-    if (null == m_cachedNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not do indexing or counting functions!");
-
-    m_next = i;
-
-    m_cachedNodes.setCurrentPos(i);
-  }
-
-  /**
-   * Get the length of the list.
-   *
-   * @return The length of this list, or zero is this is not a cached list.
-   */
-  public int size()
-  {
-
-    if (null == m_cachedNodes)
-      return 0;
-
-    return m_cachedNodes.size();
-  }
-
-  /**
-   * Tells if this NodeSetDTM is "fresh", in other words, if
-   * the first nextNode() that is called will return the
-   * first node in the set.
-   *
-   * @return True if the iteration has not yet begun.
-   */
-  public boolean isFresh()
-  {
-    return (m_next == 0);
-  }
-
-  /**
-   *  Returns the previous node in the set and moves the position of the
-   * iterator backwards in the set.
-   * @return  The previous <code>Node</code> in the set being iterated over,
-   *   or<code>null</code> if there are no more members in that set.
-   */
-  public int previousNode()
-  {
-
-    if (null == m_cachedNodes)
-      throw new RuntimeException(
-        "This NodeSetDTM can not iterate to a previous node!");
-
-    return m_cachedNodes.previousNode();
-  }
-
-  /**
-   *  This attribute determines which node types are presented via the
-   * iterator. The available set of constants is defined in the
-   * <code>DTMFilter</code> interface.
-   *
-   * @return A bit set that tells what node types to show (DTMFilter.SHOW_ALL at 
-   * the iterator level).
-   */
-  public int getWhatToShow()
-  {
-
-    // TODO: ??
-    return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
-  }
-
-  /**
-   *  The filter used to screen nodes.
-   *
-   * @return null.
-   */
-  public DTMFilter getFilter()
-  {
-    return null;
-  }
-
-  /**
-   *  The root node of the Iterator, as specified when it was created.
-   *
-   * @return The context node of this iterator.
-   */
-  public int getRoot()
-  {
-    return m_context;
-  }
-
-  /**
-   *  The value of this flag determines whether the children of entity
-   * reference nodes are visible to the iterator. If false, they will be
-   * skipped over.
-   * <br> To produce a view of the document that has entity references
-   * expanded and does not expose the entity reference node itself, use the
-   * whatToShow flags to hide the entity reference node and set
-   * expandEntityReferences to true when creating the iterator. To produce
-   * a view of the document that has entity reference nodes but no entity
-   * expansion, use the whatToShow flags to show the entity reference node
-   * and set expandEntityReferences to false.
-   *
-   * @return true.
-   */
-  public boolean getExpandEntityReferences()
-  {
-    return true;
-  }
-
-  /**
-   * Add an iterator to the union list.
-   *
-   * @param iter non-null reference to a location path iterator.
-   */
-  public void addIterator(LocPathIterator iter)
-  {
-
-    // Increase array size by only 1 at a time.  Fix this
-    // if it looks to be a problem.
-    if (null == m_iterators)
-    {
-      m_iterators = new LocPathIterator[1];
-      m_iterators[0] = iter;
-    }
-    else
-    {
-      DTMIterator[] iters = m_iterators;
-      int len = m_iterators.length;
-
-      m_iterators = new LocPathIterator[len + 1];
-
-      System.arraycopy(iters, 0, m_iterators, 0, len);
-
-      m_iterators[len] = iter;
-    }
-  }
-
-  /**
-   * Create a UnionPathIterator object, including creation 
-   * of location path iterators from the opcode list, and call back 
-   * into the Compiler to create predicate expressions.
-   *
-   * @param compiler The Compiler which is creating 
-   * this expression.
-   * @param opPos The position of this iterator in the 
-   * opcode list from the compiler.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public UnionPathIterator(Compiler compiler, int opPos)
-          throws javax.xml.transform.TransformerException
-  {
-
-    super();
-
-    opPos = compiler.getFirstChildPos(opPos);
-
-    loadLocationPaths(compiler, opPos, 0);
-  }
-  
-  /**
-   * Read the object from a serialization stream.
-   *
-   * @param stream Input stream to read from
-   *
-   * @throws java.io.IOException
-   * @throws javax.xml.transform.TransformerException
-   */
-  private void readObject(java.io.ObjectInputStream stream)
-          throws java.io.IOException, javax.xml.transform.TransformerException
-  {
-    try
-    {
-      stream.defaultReadObject();
-      m_clones =  new IteratorPool(this);
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new javax.xml.transform.TransformerException(cnfe);
-    }
-  }
-
-  /**
-   * Get a cloned Iterator that is reset to the beginning 
-   * of the query.
-   *
-   * @return A cloned DTMIterator set of the start of the query.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public DTMIterator cloneWithReset() throws CloneNotSupportedException
-  {
-
-    UnionPathIterator clone = (UnionPathIterator) clone();
-    
-    clone.reset();
-
-    return clone;
-  }
-
-  /**
-   * Get a cloned LocPathIterator that holds the same 
-   * position as this iterator.
-   *
-   * @return A clone of this iterator that holds the same node position.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    UnionPathIterator clone = (UnionPathIterator) super.clone();
-    int n = m_iterators.length;
-
-    clone.m_iterators = new LocPathIterator[n];
-
-    for (int i = 0; i < n; i++)
-    {
-      clone.m_iterators[i] = (LocPathIterator)m_iterators[i].clone();
-    }
-
-    return clone;
-  }
-  
-  /**
-   * <meta name="usage" content="experimental"/>
-   * Given an select expression and a context, evaluate the XPath
-   * and return the resulting iterator.
-   * 
-   * @param xctxt The execution context.
-   * @param contextNode The node that "." expresses.
-   * @param namespaceContext The context in which namespaces in the
-   * XPath are supposed to be expanded.
-   * 
-   * @throws TransformerException thrown if the active ProblemListener decides
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public DTMIterator asIterator(
-          XPathContext xctxt, int contextNode)
-            throws javax.xml.transform.TransformerException
-  {
-    UnionPathIterator clone = (UnionPathIterator)m_clones.getInstance();
-    
-    clone.setRoot(contextNode, xctxt);
-    
-    return clone;
-  }
-
-  /**
-   * Reset the iterator.
-   */
-  public void reset()
-  {
-
-    // super.reset();
-    m_foundLast = false;
-    m_next = 0;
-    m_last = 0;
-    m_lastFetched = DTM.NULL;
-
-    int n = m_iterators.length;
-
-    for (int i = 0; i < n; i++)
-    {
-      m_iterators[i].reset();
-      m_iterators[i].nextNode();
-    }
-  }
-
-  /**
-   * Initialize the location path iterators.  Recursive.
-   *
-   * @param compiler The Compiler which is creating 
-   * this expression.
-   * @param opPos The position of this iterator in the 
-   * opcode list from the compiler.
-   * @param count The insert position of the iterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void loadLocationPaths(Compiler compiler, int opPos, int count)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // TODO: Handle unwrapped FilterExpr
-    int steptype = compiler.getOpMap()[opPos];
-
-    if (steptype == OpCodes.OP_LOCATIONPATH)
-    {
-      loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
-
-      m_iterators[count] = createDTMIterator(compiler, opPos);
-    }
-    else
-    {
-
-      // Have to check for unwrapped functions, which the LocPathIterator
-      // doesn't handle. 
-      switch (steptype)
-      {
-      case OpCodes.OP_VARIABLE :
-      case OpCodes.OP_EXTFUNCTION :
-      case OpCodes.OP_FUNCTION :
-      case OpCodes.OP_GROUP :
-        loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
-
-        WalkingIterator iter =
-          new WalkingIterator(compiler.getNamespaceContext());
-          
-        if(compiler.getLocationPathDepth() <= 0)
-          iter.setIsTopLevel(true);
-
-        iter.m_firstWalker = new org.apache.xpath.axes.FilterExprWalker(iter);
-
-        iter.m_firstWalker.init(compiler, opPos, steptype);
-
-        m_iterators[count] = iter;
-        break;
-      default :
-        m_iterators = new LocPathIterator[count];
-      }
-    }
-  }
-
-  /**
-   * Create a new location path iterator.
-   *
-   * @param compiler The Compiler which is creating 
-   * this expression.
-   * @param opPos The position of this iterator in the 
-   *
-   * @return New location path iterator.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected DTMIterator createDTMIterator(
-          Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
-  {
-    DTMIterator lpi = WalkerFactory.newDTMIterator(compiler, opPos, 
-                                      (compiler.getLocationPathDepth() <= 0));
-    return lpi;
-  }
-
-  /** The last node that was fetched, usually by nextNode. */
-  transient int m_lastFetched = DTM.NULL;
-
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a DTMIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-//    // If the cache is on, and the node has already been found, then 
-//    // just return from the list.
-//    if ((null != m_cachedNodes)
-//            && (m_cachedNodes.getCurrentPos() < m_cachedNodes.size()))
-//    {
-//      return m_cachedNodes.nextNode();
-//    }
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if ((null != m_cachedNodes)
-            && (m_next < m_cachedNodes.size()))
-    {
-      int next = m_cachedNodes.elementAt(m_next);
-    
-      m_next++;
-      m_currentContextNode = next;
-
-      return next;
-    }
-
-    if (m_foundLast)
-    {
-      m_lastFetched = DTM.NULL;
-      return DTM.NULL;
-    }
-
-    // Loop through the iterators getting the current fetched 
-    // node, and get the earliest occuring in document order
-    int earliestNode = DTM.NULL;
-
-    if (null != m_iterators)
-    {
-      int n = m_iterators.length;
-      int iteratorUsed = -1;
-
-      for (int i = 0; i < n; i++)
-      {
-        int node = m_iterators[i].getCurrentNode();
-
-        if (DTM.NULL == node)
-          continue;
-        else if (DTM.NULL == earliestNode)
-        {
-          iteratorUsed = i;
-          earliestNode = node;
-        }
-        else
-        {
-          if (node == earliestNode)
-          {
-
-            // Found a duplicate, so skip past it.
-            m_iterators[i].nextNode();
-          }
-          else
-          {
-            DTM dtm = getDTM(node);
-
-            if (dtm.isNodeAfter(node, earliestNode))
-            {
-              iteratorUsed = i;
-              earliestNode = node;
-            }
-          }
-        }
-      }
-
-      if (DTM.NULL != earliestNode)
-      {
-        m_iterators[iteratorUsed].nextNode();
-
-        if (null != m_cachedNodes)
-          m_cachedNodes.addElement(earliestNode);
-
-        m_next++;
-      }
-      else
-        m_foundLast = true;
-    }
-
-    m_lastFetched = earliestNode;
-
-    return earliestNode;
-  }
-
-  /**
-   * If an index is requested, NodeSetDTM will call this method
-   * to run the iterator to the index.  By default this sets
-   * m_next to the index.  If the index argument is -1, this
-   * signals that the iterator should be run to the end.
-   *
-   * @param index The index to run to, or -1 if the iterator 
-   * should run to the end.
-   */
-  public void runTo(int index)
-  {
-
-    if (m_foundLast || ((index >= 0) && (index <= getCurrentPos())))
-      return;
-
-    int n;
-
-    if (-1 == index)
-    {
-      while (DTM.NULL != (n = nextNode()));
-    }
-    else
-    {
-      while (DTM.NULL != (n = nextNode()))
-      {
-        if (getCurrentPos() >= index)
-          break;
-      }
-    }
-  }
-
-  /**
-   * Get the current position, which is one less than
-   * the next nextNode() call will retrieve.  i.e. if
-   * you call getCurrentPos() and the return is 0, the next
-   * fetch will take place at index 1.
-   *
-   * @return A value greater than or equal to zero that indicates the next 
-   * node position to fetch.
-   */
-  public int getCurrentPos()
-  {
-    return m_next;
-  }
-  
-  /**
-   *  The number of nodes in the list. The range of valid child node indices
-   * is 0 to <code>length-1</code> inclusive.
-   *
-   * @return The number of nodes in the list, always greater or equal to zero.
-   */
-  public int getLength()
-  {
-
-    // resetToCachedList();
-    if(m_last > 0)
-      return m_last;
-    else if(null == m_cachedNodes || !m_foundLast)
-    {
-      m_last = getLastPos(m_execContext);
-    }
-    else
-    {
-      m_last = m_cachedNodes.getLength();
-    }
-    return m_last;
-  }
-  
-  /**
-   * Get the index of the last node that can be itterated to.
-   * This probably will need to be overridded by derived classes.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the index of the last node that can be itterated to.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-    int pos = m_next;
-    UnionPathIterator clone;
-
-    int savedPos;
-    if(null != m_cachedNodes)
-      savedPos = m_cachedNodes.getCurrentPos();
-    else 
-      savedPos = -1;
-
-    try
-    {
-      // %REVIEW% %OPT%
-      if(0 == pos && m_currentContextNode != DTM.NULL)
-        clone = (UnionPathIterator) cloneWithReset();
-      else
-        clone = (UnionPathIterator) clone();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      return -1;
-    }
-
-    int next;
-    pos = clone.getCurrentPos();
-
-    while (DTM.NULL != (next = clone.nextNode()))
-    {
-      pos++;
-    }
-    
-    if(-1 != savedPos)
-      m_cachedNodes.setCurrentPos(savedPos);
-    
-    return pos;
-  }
-
-  /**
-   *  Returns the <code>index</code> th item in the collection. If
-   * <code>index</code> is greater than or equal to the number of nodes in
-   * the list, this returns <code>null</code> .
-   * @param index  Index into the collection.
-   * @return  The node at the <code>index</code> th position in the
-   *   <code>NodeList</code> , or <code>null</code> if that is not a valid
-   *   index.
-   */
-  public int item(int index)
-  {
-    // resetToCachedList(); %TBD% ??
-
-    return m_cachedNodes.item(index);
-  }
-  
-  /**
-   * Sets the node at the specified index of this vector to be the
-   * specified node. The previous component at that position is discarded.
-   *
-   * <p>The index must be a value greater than or equal to 0 and less
-   * than the current size of the vector.  
-   * The iterator must be in cached mode.</p>
-   * 
-   * <p>Meant to be used for sorted iterators.</p>
-   *
-   * @param node Node to set
-   * @param index Index of where to set the node
-   */
-  public void setItem(int node, int index)
-  {
-    m_cachedNodes.setElementAt(node, index);
-  }
-  
-  /**
-   * Set the current context node for this iterator.
-   *
-   * @param n Must be a non-null reference to the node context.
-   */
-  public final void setRoot(int n)
-  {
-    m_context = n;
-  }
-  
-  /**
-   * Set the environment in which this iterator operates, which should provide:
-   * a node (the context node... same value as "root" defined below) 
-   * a pair of non-zero positive integers (the context position and the context size) 
-   * a set of variable bindings 
-   * a function library 
-   * the set of namespace declarations in scope for the expression.
-   * 
-   * <p>At this time the exact implementation of this environment is application 
-   * dependent.  Probably a proper interface will be created fairly soon.</p>
-   * 
-   * @param environment The environment object.
-   */
-  public void setEnvironment(Object environment)
-  {
-    // no-op for now.
-  }
-  
-  /**
-   * Get an instance of the DTMManager.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTMManager using just the iterator.
-   *
-   * @return a non-null DTMManager reference.
-   */
-  public DTMManager getDTMManager()
-  {
-    return m_execContext.getDTMManager();
-  }
-  
-  /**
-   * Return the last fetched node.
-   *
-   * @return The last fetched node, or null if the last fetch was null.
-   */
-  public int getCurrentNode()
-  {
-    return m_lastFetched;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    for (int i = 0; i < m_iterators.length; i++) 
-    {
-      DTMIterator iter = m_iterators[i];
-      if(iter instanceof Expression)
-      {
-        ((Expression)iter).fixupVariables(vars, globalsSize);
-      }
-    }
-    
-  }
-
-  /**
-   * Tells if we've found the last node yet.
-   */
-  transient protected boolean m_foundLast = false;
-
-  /**
-   * The execution context for the expression.
-   */
-  transient protected XPathContext m_execContext;
-
-  /**
-   * The node context for the expression.
-   */
-  transient protected int m_context = DTM.NULL;
-
-  /**
-   * The node context from where the Location Path is being
-   * executed from (i.e. for current() support).
-   */
-  transient protected int m_currentContextNode = DTM.NULL;
-  
-  /**
-   * Get an instance of a DTM that "owns" a node handle.  Since a node 
-   * iterator may be passed without a DTMManager, this allows the 
-   * caller to easily get the DTM using just the iterator.
-   *
-   * @param nodeHandle the nodeHandle.
-   *
-   * @return a non-null DTM reference.
-   */
-  public DTM getDTM(int nodeHandle)
-  {
-    return m_execContext.getDTM(nodeHandle);
-  }
-  
-  /**
-   * The node context from where the expression is being
-   * executed from (i.e. for current() support).
-   *
-   * @return The top-level node context of the entire expression.
-   */
-  public int getCurrentContextNode()
-  {
-    return m_currentContextNode;
-  }
-
-  /**
-   * The location path iterators, one for each
-   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location
-   * path</a> contained in the union expression.
-   * @serial
-   */
-  protected DTMIterator[] m_iterators;
-  
-  /**
-   * The last index in the list.
-   */
-  transient private int m_last = 0;
-  
-  /**
-   * Get the index of the last node in the itteration.
-   */
-  public int getLast()
-  {
-    return m_last;
-  }
-  
-  /**
-   * Set the index of the last node in the itteration.
-   */
-  public void setLast(int last)
-  {
-    m_last = last;
-  }
-  
-  /**
-   * Returns true if all the nodes in the iteration well be returned in document 
-   * order.
-   * 
-   * @return true as a default.
-   */
-  public boolean isDocOrdered()
-  {
-    return true;
-  }
-  
-  /**
-   * Returns the axis being iterated, if it is known.
-   * 
-   * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple 
-   * types.
-   */
-  public int getAxis()
-  {
-    // Could be smarter.
-    return -1;
-  }
-
-}
diff --git a/src/org/apache/xpath/axes/WalkerFactory.java b/src/org/apache/xpath/axes/WalkerFactory.java
deleted file mode 100644
index 62f97c2..0000000
--- a/src/org/apache/xpath/axes/WalkerFactory.java
+++ /dev/null
@@ -1,1787 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.FunctionTable;
-import org.apache.xpath.patterns.NodeTest;
-import org.apache.xpath.patterns.StepPattern;
-import org.apache.xpath.patterns.ContextMatchStepPattern;
-import org.apache.xpath.patterns.FunctionPattern;
-import org.apache.xpath.Expression;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.Axis;
-
-/**
- * This class is both a factory for XPath location path expressions,
- * which are built from the opcode map output, and an analysis engine
- * for the location path expressions in order to provide optimization hints.
- */
-public class WalkerFactory
-{
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * This method is for building an array of possible levels
-   * where the target element(s) could be found for a match.
-   * @param xpath The xpath that is executing.
-   * @param context The current source tree context node.
-   *
-   * @param lpi The owning location path iterator.
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param stepOpCodePos The opcode position for the step.
-   *
-   * @return non-null AxesWalker derivative.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  static AxesWalker loadOneWalker(
-          WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
-            throws javax.xml.transform.TransformerException
-  {
-
-    AxesWalker firstWalker = null;
-    int stepType = compiler.getOpMap()[stepOpCodePos];
-
-    if (stepType != OpCodes.ENDOP)
-    {
-
-      // m_axesWalkers = new AxesWalker[1];
-      // As we unwind from the recursion, create the iterators.
-      firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);
-
-      firstWalker.init(compiler, stepOpCodePos, stepType);
-    }
-
-    return firstWalker;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * This method is for building an array of possible levels
-   * where the target element(s) could be found for a match.
-   * @param xpath The xpath that is executing.
-   * @param context The current source tree context node.
-   *
-   * @param lpi The owning location path iterator object.
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param stepOpCodePos The opcode position for the step.
-   * @param stepIndex The top-level step index withing the iterator.
-   *
-   * @return non-null AxesWalker derivative.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  static AxesWalker loadWalkers(
-          WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex)
-            throws javax.xml.transform.TransformerException
-  {
-
-    int stepType;
-    AxesWalker firstWalker = null;
-    AxesWalker walker, prevWalker = null;
-    int ops[] = compiler.getOpMap();
-    int analysis = analyze(compiler, stepOpCodePos, stepIndex);
-
-    while (OpCodes.ENDOP != (stepType = ops[stepOpCodePos]))
-    {
-      walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis);
-
-      walker.init(compiler, stepOpCodePos, stepType);
-
-      // walker.setAnalysis(analysis);
-      if (null == firstWalker)
-      {
-        firstWalker = walker;
-      }
-      else
-      {
-        prevWalker.setNextWalker(walker);
-        walker.setPrevWalker(prevWalker);
-      }
-
-      prevWalker = walker;
-      stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
-      if (stepOpCodePos < 0)
-        break;
-    }
-
-    return firstWalker;
-  }
-  
-  public static boolean isSet(int analysis, int bits)
-  {
-    return (0 != (analysis & bits));
-  }
-  
-  public static void diagnoseIterator(String name, int analysis, Compiler compiler)
-  {
-    System.out.println(compiler.toString()+", "+name+", "
-                             + Integer.toBinaryString(analysis) + ", "
-                             + getAnalysisString(analysis));
-  }
-
-  /**
-   * Create a new LocPathIterator iterator.  The exact type of iterator
-   * returned is based on an analysis of the XPath operations.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param opPos The position of the operation code for this itterator.
-   *
-   * @return non-null reference to a LocPathIterator or derivative.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public static DTMIterator newDTMIterator(
-          Compiler compiler, int opPos,
-          boolean isTopLevel)
-            throws javax.xml.transform.TransformerException
-  {
-
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-    int analysis = analyze(compiler, firstStepPos, 0);
-    boolean isOneStep = isOneStep(analysis);
-    DTMIterator iter;
-
-    // Is the iteration a one-step attribute pattern (i.e. select="@foo")?
-    if (isOneStep && walksSelfOnly(analysis) && 
-        isWild(analysis) && !hasPredicate(analysis))
-    {
-      if (DEBUG_ITERATOR_CREATION)
-        diagnoseIterator("SelfIteratorNoPredicate", analysis, compiler);
-
-      // Then use a simple iteration of the attributes, with node test 
-      // and predicate testing.
-      iter = new SelfIteratorNoPredicate(compiler, opPos, analysis);
-    }
-    // Is the iteration exactly one child step?
-    else if (walksChildrenOnly(analysis) && isOneStep)
-    {
-
-      // Does the pattern specify *any* child with no predicate? (i.e. select="child::node()".
-      if (isWild(analysis) && !hasPredicate(analysis))
-      {
-        if (DEBUG_ITERATOR_CREATION)
-          diagnoseIterator("ChildIterator", analysis, compiler);
-
-        // Use simple child iteration without any test.
-        iter = new ChildIterator(compiler, opPos, analysis);
-      }
-      else
-      {
-        if (DEBUG_ITERATOR_CREATION)
-          diagnoseIterator("ChildTestIterator", analysis, compiler);
-
-        // Else use simple node test iteration with predicate test.
-        iter = new ChildTestIterator(compiler, opPos, analysis);
-      }
-    }
-    // Is the iteration a one-step attribute pattern (i.e. select="@foo")?
-    else if (isOneStep && walksAttributes(analysis))
-    {
-      if (DEBUG_ITERATOR_CREATION)
-        diagnoseIterator("AttributeIterator", analysis, compiler);
-
-      // Then use a simple iteration of the attributes, with node test 
-      // and predicate testing.
-      iter = new AttributeIterator(compiler, opPos, analysis);
-    }
-    else if(isOneStep && !walksFilteredList(analysis))
-    {
-      if( !walksNamespaces(analysis) 
-      && (walksInDocOrder(analysis) || isSet(analysis, BIT_PARENT)))
-      {
-        if (false || DEBUG_ITERATOR_CREATION)
-          diagnoseIterator("OneStepIteratorForward", analysis, compiler);
-  
-        // Then use a simple iteration of the attributes, with node test 
-        // and predicate testing.
-        iter = new OneStepIteratorForward(compiler, opPos, analysis);
-      }
-      else
-      {
-        if (false || DEBUG_ITERATOR_CREATION)
-          diagnoseIterator("OneStepIterator", analysis, compiler);
-  
-        // Then use a simple iteration of the attributes, with node test 
-        // and predicate testing.
-        iter = new OneStepIterator(compiler, opPos, analysis);
-      }
-    }
-
-    // Analysis of "//center":
-    // bits: 1001000000001010000000000000011
-    // count: 3
-    // root
-    // child:node()
-    // BIT_DESCENDANT_OR_SELF
-    // It's highly possible that we should have a seperate bit set for 
-    // "//foo" patterns.
-    // For at least the time being, we can't optimize patterns like 
-    // "//table[3]", because this has to be analyzed as 
-    // "/descendant-or-self::node()/table[3]" in order for the indexes 
-    // to work right.
-    else if (isOptimizableForDescendantIterator(compiler, firstStepPos, 0)
-              // && getStepCount(analysis) <= 3 
-              // && walksDescendants(analysis) 
-              // && walksSubtreeOnlyFromRootOrContext(analysis)
-             )
-    {
-      if (DEBUG_ITERATOR_CREATION)
-        diagnoseIterator("DescendantIterator", analysis, compiler);
-
-      iter = new DescendantIterator(compiler, opPos, analysis);
-    }
-    else
-    { 
-      if(isNaturalDocOrder(compiler, firstStepPos, 0, analysis))
-      {
-        if (false || DEBUG_ITERATOR_CREATION)
-        {
-          diagnoseIterator("WalkingIterator", analysis, compiler);
-        }
-  
-        iter = new WalkingIterator(compiler, opPos, analysis, true);
-      }
-      else
-      {
-//        if (DEBUG_ITERATOR_CREATION)
-//          diagnoseIterator("MatchPatternIterator", analysis, compiler);
-//
-//        return new MatchPatternIterator(compiler, opPos, analysis);
-        if (DEBUG_ITERATOR_CREATION)
-          diagnoseIterator("WalkingIteratorSorted", analysis, compiler);
-
-        iter = new WalkingIteratorSorted(compiler, opPos, analysis, true);
-      }
-    }
-    if(iter instanceof LocPathIterator)
-      ((LocPathIterator)iter).setIsTopLevel(isTopLevel);
-      
-    return iter;
-  }
-  
-  /**
-   * Special purpose function to see if we can optimize the pattern for 
-   * a DescendantIterator.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param stepOpCodePos The opcode position for the step.
-   * @param stepIndex The top-level step index withing the iterator.
-   *
-   * @return 32 bits as an integer that give information about the location
-   * path as a whole.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public static int getAxisFromStep(
-          Compiler compiler, int stepOpCodePos)
-            throws javax.xml.transform.TransformerException
-  {
-
-    int ops[] = compiler.getOpMap();
-    int stepType = ops[stepOpCodePos];
-
-    switch (stepType)
-    {
-    case OpCodes.FROM_FOLLOWING :
-      return Axis.FOLLOWING;
-    case OpCodes.FROM_FOLLOWING_SIBLINGS :
-      return Axis.FOLLOWINGSIBLING;
-    case OpCodes.FROM_PRECEDING :
-      return Axis.PRECEDING;
-    case OpCodes.FROM_PRECEDING_SIBLINGS :
-      return Axis.PRECEDINGSIBLING;
-    case OpCodes.FROM_PARENT :
-      return Axis.PARENT;
-    case OpCodes.FROM_NAMESPACE :
-      return Axis.NAMESPACE;
-    case OpCodes.FROM_ANCESTORS :
-      return Axis.ANCESTOR;
-    case OpCodes.FROM_ANCESTORS_OR_SELF :
-      return Axis.ANCESTORORSELF;
-    case OpCodes.FROM_ATTRIBUTES :
-      return Axis.ATTRIBUTE;
-    case OpCodes.FROM_ROOT :
-      return Axis.ROOT;
-    case OpCodes.FROM_CHILDREN :
-      return Axis.CHILD;
-    case OpCodes.FROM_DESCENDANTS_OR_SELF :
-      return Axis.DESCENDANTORSELF;
-    case OpCodes.FROM_DESCENDANTS :
-      return Axis.DESCENDANT;
-    case OpCodes.FROM_SELF :
-      return Axis.SELF;
-    case OpCodes.OP_EXTFUNCTION :
-    case OpCodes.OP_FUNCTION :
-    case OpCodes.OP_GROUP :
-    case OpCodes.OP_VARIABLE :
-      return Axis.FILTEREDLIST;
-    }
-
-    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
-                               //+ stepType);
-  }
-  
-  static boolean functionProximateOrContainsProximate(Compiler compiler, 
-                                                      int opPos)
-  {
-    int endFunc = opPos + compiler.getOp(opPos + 1) - 1;
-    opPos = compiler.getFirstChildPos(opPos);
-    int funcID = compiler.getOp(opPos);
-    //  System.out.println("funcID: "+funcID);
-    //  System.out.println("opPos: "+opPos);
-    //  System.out.println("endFunc: "+endFunc);
-    switch(funcID)
-    {
-      case FunctionTable.FUNC_LAST:
-      case FunctionTable.FUNC_POSITION:
-        return true;
-      default:
-        opPos++;
-        int i = 0;
-        for (int p = opPos; p < endFunc; p = compiler.getNextOpPos(p), i++)
-        {
-          int innerExprOpPos = p+2;
-          int argOp = compiler.getOp(innerExprOpPos);
-          boolean prox = isProximateInnerExpr(compiler, innerExprOpPos);
-          if(prox)
-            return true;
-        }
-
-    }
-    return false;
-  }
-  
-  static boolean isProximateInnerExpr(Compiler compiler, int opPos)
-  {
-    int op = compiler.getOp(opPos);
-    int innerExprOpPos = opPos+2;
-    switch(op)
-    {
-      case OpCodes.OP_ARGUMENT:
-        if(isProximateInnerExpr(compiler, innerExprOpPos))
-          return true;
-        break;
-      case OpCodes.OP_VARIABLE:
-      case OpCodes.OP_NUMBERLIT:
-      case OpCodes.OP_LITERAL:
-      case OpCodes.OP_LOCATIONPATH:
-        break; // OK
-      case OpCodes.OP_FUNCTION:
-        boolean isProx = functionProximateOrContainsProximate(compiler, opPos);
-        if(isProx)
-          return true;
-        break;
-      case OpCodes.OP_GT:
-      case OpCodes.OP_GTE:
-      case OpCodes.OP_LT:
-      case OpCodes.OP_LTE:
-      case OpCodes.OP_EQUALS:
-        int leftPos = compiler.getFirstChildPos(op);
-        int rightPos = compiler.getNextOpPos(leftPos);
-        isProx = isProximateInnerExpr(compiler, leftPos);
-        if(isProx)
-          return true;
-        isProx = isProximateInnerExpr(compiler, rightPos);
-        if(isProx)
-          return true;
-        break;
-      default:
-        return true; // be conservative...
-    }
-    return false;
-  }
-    
-  /**
-   * Tell if the predicates need to have proximity knowledge.
-   */
-  public static boolean mightBeProximate(Compiler compiler, int opPos, int stepType)
-          throws javax.xml.transform.TransformerException
-  {
-
-    boolean mightBeProximate = false;
-    int argLen;
-
-    switch (stepType)
-    {
-    case OpCodes.OP_VARIABLE :
-    case OpCodes.OP_EXTFUNCTION :
-    case OpCodes.OP_FUNCTION :
-    case OpCodes.OP_GROUP :
-      argLen = compiler.getArgLength(opPos);
-      break;
-    default :
-      argLen = compiler.getArgLengthOfStep(opPos);
-    }
-
-    int predPos = compiler.getFirstPredicateOpPos(opPos);
-    int count = 0;
-
-    while (OpCodes.OP_PREDICATE == compiler.getOp(predPos))
-    {
-      count++;
-      
-      int innerExprOpPos = predPos+2;
-      int predOp = compiler.getOp(innerExprOpPos);
-
-      switch(predOp)
-      {
-        case OpCodes.OP_VARIABLE:
-        case OpCodes.OP_LOCATIONPATH:
-          // OK.
-          break;
-        case OpCodes.OP_NUMBER:
-        case OpCodes.OP_NUMBERLIT:
-          return true; // that's all she wrote!
-        case OpCodes.OP_FUNCTION:
-          boolean isProx 
-            = functionProximateOrContainsProximate(compiler, innerExprOpPos);
-          if(isProx)
-            return true;
-          break;
-        case OpCodes.OP_GT:
-        case OpCodes.OP_GTE:
-        case OpCodes.OP_LT:
-        case OpCodes.OP_LTE:
-        case OpCodes.OP_EQUALS:
-          int leftPos = compiler.getFirstChildPos(innerExprOpPos);
-          int rightPos = compiler.getNextOpPos(leftPos);
-          isProx = isProximateInnerExpr(compiler, leftPos);
-          if(isProx)
-            return true;
-          isProx = isProximateInnerExpr(compiler, rightPos);
-          if(isProx)
-            return true;
-          break;
-        default:
-          return true; // be conservative...
-      }
-
-      predPos = compiler.getNextOpPos(predPos);
-    }
-
-    return mightBeProximate;
-  }
-  
-  /**
-   * Special purpose function to see if we can optimize the pattern for 
-   * a DescendantIterator.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param stepOpCodePos The opcode position for the step.
-   * @param stepIndex The top-level step index withing the iterator.
-   *
-   * @return 32 bits as an integer that give information about the location
-   * path as a whole.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private static boolean isOptimizableForDescendantIterator(
-          Compiler compiler, int stepOpCodePos, int stepIndex)
-            throws javax.xml.transform.TransformerException
-  {
-
-    int stepType;
-    int ops[] = compiler.getOpMap();
-    int stepCount = 0;
-    boolean foundDorDS = false;
-    boolean foundSelf = false;
-    boolean foundDS = false;
-    
-    int nodeTestType = OpCodes.NODETYPE_NODE;
-    
-    while (OpCodes.ENDOP != (stepType = ops[stepOpCodePos]))
-    {
-      // The DescendantIterator can only do one node test.  If there's more 
-      // than one, use another iterator.
-      if(nodeTestType != OpCodes.NODETYPE_NODE && nodeTestType != OpCodes.NODETYPE_ROOT)
-        return false;
-        
-      stepCount++;
-      if(stepCount > 3)
-        return false;
-        
-      boolean mightBeProximate = mightBeProximate(compiler, stepOpCodePos, stepType);
-      if(mightBeProximate)
-        return false;
-
-      switch (stepType)
-      {
-      case OpCodes.FROM_FOLLOWING :
-      case OpCodes.FROM_FOLLOWING_SIBLINGS :
-      case OpCodes.FROM_PRECEDING :
-      case OpCodes.FROM_PRECEDING_SIBLINGS :
-      case OpCodes.FROM_PARENT :
-      case OpCodes.OP_VARIABLE :
-      case OpCodes.OP_EXTFUNCTION :
-      case OpCodes.OP_FUNCTION :
-      case OpCodes.OP_GROUP :
-      case OpCodes.FROM_NAMESPACE :
-      case OpCodes.FROM_ANCESTORS :
-      case OpCodes.FROM_ANCESTORS_OR_SELF :
-      case OpCodes.FROM_ATTRIBUTES :
-      case OpCodes.MATCH_ATTRIBUTE :
-      case OpCodes.MATCH_ANY_ANCESTOR :
-      case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
-        return false;
-      case OpCodes.FROM_ROOT :
-        if(1 != stepCount)
-          return false;
-        break;
-      case OpCodes.FROM_CHILDREN :
-        if(!foundDS && !(foundDorDS && foundSelf))
-          return false;
-        break;
-      case OpCodes.FROM_DESCENDANTS_OR_SELF :
-        foundDS = true;
-      case OpCodes.FROM_DESCENDANTS :
-        if(3 == stepCount)
-          return false;
-        foundDorDS = true;
-        break;
-      case OpCodes.FROM_SELF :
-        if(1 != stepCount)
-          return false;
-        foundSelf = true;
-        break;
-      default :
-        throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
-                                  // + stepType);
-      }
-      
-      nodeTestType = compiler.getStepTestType(stepOpCodePos);
-
-      int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
-      if (nextStepOpCodePos < 0)
-        break;
-        
-      if(OpCodes.ENDOP != ops[nextStepOpCodePos])
-      {
-        if(compiler.countPredicates(stepOpCodePos) > 0)
-        {
-          return false;
-        }
-      }
-      
-      stepOpCodePos = nextStepOpCodePos;
-    }
-
-    return true;
-  }
-
-  /**
-   * Analyze the location path and return 32 bits that give information about
-   * the location path as a whole.  See the BIT_XXX constants for meaning about
-   * each of the bits.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param stepOpCodePos The opcode position for the step.
-   * @param stepIndex The top-level step index withing the iterator.
-   *
-   * @return 32 bits as an integer that give information about the location
-   * path as a whole.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private static int analyze(
-          Compiler compiler, int stepOpCodePos, int stepIndex)
-            throws javax.xml.transform.TransformerException
-  {
-
-    int stepType;
-    int ops[] = compiler.getOpMap();
-    int stepCount = 0;
-    int analysisResult = 0x00000000;  // 32 bits of analysis
-
-    while (OpCodes.ENDOP != (stepType = ops[stepOpCodePos]))
-    {
-      stepCount++;
-
-      // String namespace = compiler.getStepNS(stepOpCodePos);
-      // boolean isNSWild = (null != namespace) 
-      //                   ? namespace.equals(NodeTest.WILD) : false;
-      // String localname = compiler.getStepLocalName(stepOpCodePos);
-      // boolean isWild = (null != localname) ? localname.equals(NodeTest.WILD) : false;
-      boolean predAnalysis = analyzePredicate(compiler, stepOpCodePos,
-                                              stepType);
-
-      if (predAnalysis)
-        analysisResult |= BIT_PREDICATE;
-
-      switch (stepType)
-      {
-      case OpCodes.OP_VARIABLE :
-      case OpCodes.OP_EXTFUNCTION :
-      case OpCodes.OP_FUNCTION :
-      case OpCodes.OP_GROUP :
-        analysisResult |= BIT_FILTER;
-        break;
-      case OpCodes.FROM_ROOT :
-        analysisResult |= BIT_ROOT;
-        break;
-      case OpCodes.FROM_ANCESTORS :
-        analysisResult |= BIT_ANCESTOR;
-        break;
-      case OpCodes.FROM_ANCESTORS_OR_SELF :
-        analysisResult |= BIT_ANCESTOR_OR_SELF;
-        break;
-      case OpCodes.FROM_ATTRIBUTES :
-        analysisResult |= BIT_ATTRIBUTE;
-        break;
-      case OpCodes.FROM_NAMESPACE :
-        analysisResult |= BIT_NAMESPACE;
-        break;
-      case OpCodes.FROM_CHILDREN :
-        analysisResult |= BIT_CHILD;
-        break;
-      case OpCodes.FROM_DESCENDANTS :
-        analysisResult |= BIT_DESCENDANT;
-        break;
-      case OpCodes.FROM_DESCENDANTS_OR_SELF :
-
-        // Use a special bit to to make sure we get the right analysis of "//foo".
-        if (2 == stepCount && BIT_ROOT == analysisResult)
-        {
-          analysisResult |= BIT_ANY_DESCENDANT_FROM_ROOT;
-        }
-
-        analysisResult |= BIT_DESCENDANT_OR_SELF;
-        break;
-      case OpCodes.FROM_FOLLOWING :
-        analysisResult |= BIT_FOLLOWING;
-        break;
-      case OpCodes.FROM_FOLLOWING_SIBLINGS :
-        analysisResult |= BIT_FOLLOWING_SIBLING;
-        break;
-      case OpCodes.FROM_PRECEDING :
-        analysisResult |= BIT_PRECEDING;
-        break;
-      case OpCodes.FROM_PRECEDING_SIBLINGS :
-        analysisResult |= BIT_PRECEDING_SIBLING;
-        break;
-      case OpCodes.FROM_PARENT :
-        analysisResult |= BIT_PARENT;
-        break;
-      case OpCodes.FROM_SELF :
-        analysisResult |= BIT_SELF;
-        break;
-      case OpCodes.MATCH_ATTRIBUTE :
-        analysisResult |= (BIT_MATCH_PATTERN | BIT_ATTRIBUTE);
-        break;
-      case OpCodes.MATCH_ANY_ANCESTOR :
-        analysisResult |= (BIT_MATCH_PATTERN | BIT_ANCESTOR);
-        break;
-      case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
-        analysisResult |= (BIT_MATCH_PATTERN | BIT_PARENT);
-        break;
-      default :
-        throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
-                                   //+ stepType);
-      }
-
-      if (OpCodes.NODETYPE_NODE == ops[stepOpCodePos + 3])  // child::node()
-      {
-        analysisResult |= BIT_NODETEST_ANY;
-      }
-
-      stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
-      if (stepOpCodePos < 0)
-        break;
-    }
-
-    analysisResult |= (stepCount & BITS_COUNT);
-
-    return analysisResult;
-  }
-  
-  /**
-   * Tell if the given axis goes downword.  Bogus name, if you can think of 
-   * a better one, please do tell.  This really has to do with inverting 
-   * attribute axis.
-   * @param axis One of Axis.XXX.
-   * @return true if the axis is not a child axis and does not go up from 
-   * the axis root.
-   */
-  public static boolean isDownwardAxisOfMany(int axis)
-  {
-    return ((Axis.DESCENDANTORSELF == axis) ||
-          (Axis.DESCENDANT == axis) 
-          || (Axis.FOLLOWING == axis) 
-//          || (Axis.FOLLOWINGSIBLING == axis) 
-          || (Axis.PRECEDING == axis) 
-//          || (Axis.PRECEDINGSIBLING == axis)
-          );
-  }
-
-  /**
-   * Read a <a href="http://www.w3.org/TR/xpath#location-paths">LocationPath</a>
-   * as a generalized match pattern.  What this means is that the LocationPath
-   * is read backwards, as a test on a given node, to see if it matches the
-   * criteria of the selection, and ends up at the context node.  Essentially,
-   * this is a backwards query from a given node, to find the context node.
-   * <p>So, the selection "foo/daz[2]" is, in non-abreviated expanded syntax,
-   * "self::node()/following-sibling::foo/child::daz[position()=2]".
-   * Taking this as a match pattern for a probable node, it works out to
-   * "self::daz/parent::foo[child::daz[position()=2 and isPrevStepNode()]
-   * precedingSibling::node()[isContextNodeOfLocationPath()]", adding magic
-   * isPrevStepNode and isContextNodeOfLocationPath operations.  Predicates in
-   * the location path have to be executed by the following step,
-   * because they have to know the context of their execution.
-   *
-   * @param mpi The MatchPatternIterator to which the steps will be attached.
-   * @param compiler The compiler that holds the syntax tree/op map to
-   * construct from.
-   * @param stepOpCodePos The current op code position within the opmap.
-   * @param stepIndex The top-level step index withing the iterator.
-   *
-   * @return A StepPattern object, which may contain relative StepPatterns.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  static StepPattern loadSteps(
-          MatchPatternIterator mpi, Compiler compiler, int stepOpCodePos, 
-                                                       int stepIndex)
-            throws javax.xml.transform.TransformerException
-  {
-    if (DEBUG_PATTERN_CREATION)
-    {
-      System.out.println("================");
-      System.out.println("loadSteps for: "+compiler.getPatternString());
-    }
-    int stepType;
-    StepPattern step = null;
-    StepPattern firstStep = null, prevStep = null;
-    int ops[] = compiler.getOpMap();
-    int analysis = analyze(compiler, stepOpCodePos, stepIndex);
-
-    while (OpCodes.ENDOP != (stepType = ops[stepOpCodePos]))
-    {
-      step = createDefaultStepPattern(compiler, stepOpCodePos, mpi, analysis,
-                                      firstStep, prevStep);
-
-      if (null == firstStep)
-      {
-        firstStep = step;
-      }
-      else
-      {
-
-        //prevStep.setNextWalker(step);
-        step.setRelativePathPattern(prevStep);
-      }
-
-      prevStep = step;
-      stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
-      if (stepOpCodePos < 0)
-        break;
-    }
-    
-    int axis = Axis.SELF;
-    int paxis = Axis.SELF;
-    StepPattern tail = step;
-    for (StepPattern pat = step; null != pat; 
-         pat = pat.getRelativePathPattern()) 
-    {
-      int nextAxis = pat.getAxis();
-      //int nextPaxis = pat.getPredicateAxis();
-      pat.setAxis(axis);
-      
-      // The predicate axis can't be moved!!!  Test Axes103
-      // pat.setPredicateAxis(paxis);
-      
-      // If we have an attribute or namespace axis that went up, then 
-      // it won't find the attribute in the inverse, since the select-to-match
-      // axes are not invertable (an element is a parent of an attribute, but 
-      // and attribute is not a child of an element).
-      // If we don't do the magic below, then "@*/ancestor-or-self::*" gets
-      // inverted for match to "self::*/descendant-or-self::@*/parent::node()",
-      // which obviously won't work.
-      // So we will rewrite this as:
-      // "self::*/descendant-or-self::*/attribute::*/parent::node()"
-      // Child has to be rewritten a little differently:
-      // select: "@*/parent::*"
-      // inverted match: "self::*/child::@*/parent::node()"
-      // rewrite: "self::*/attribute::*/parent::node()"
-      // Axes that go down in the select, do not have to have special treatment 
-      // in the rewrite. The following inverted match will still not select 
-      // anything.
-      // select: "@*/child::*"
-      // inverted match: "self::*/parent::@*/parent::node()"
-      // Lovely business, this.
-      // -sb
-      int whatToShow = pat.getWhatToShow();
-      if(whatToShow == DTMFilter.SHOW_ATTRIBUTE || 
-         whatToShow == DTMFilter.SHOW_NAMESPACE)
-      {
-        int newAxis = (whatToShow == DTMFilter.SHOW_ATTRIBUTE) ? 
-                       Axis.ATTRIBUTE : Axis.NAMESPACE;
-        if(isDownwardAxisOfMany(axis))
-        {
-          StepPattern attrPat = new StepPattern(whatToShow, 
-                                    pat.getNamespace(),
-                                    pat.getLocalName(),
-                                //newAxis, pat.getPredicateAxis);
-                                                newAxis, 0); // don't care about the predicate axis
-          XNumber score = pat.getStaticScore();
-          pat.setNamespace(null);
-          pat.setLocalName(NodeTest.WILD);
-          attrPat.setPredicates(pat.getPredicates());
-          pat.setPredicates(null);
-          pat.setWhatToShow(DTMFilter.SHOW_ELEMENT);
-          StepPattern rel = pat.getRelativePathPattern();
-          pat.setRelativePathPattern(attrPat);
-          attrPat.setRelativePathPattern(rel);
-          attrPat.setStaticScore(score);
-          
-          // This is needed to inverse a following pattern, because of the 
-          // wacky Xalan rules for following from an attribute.  See axes108.
-          // By these rules, following from an attribute is not strictly 
-          // inverseable.
-          if(Axis.PRECEDING == pat.getAxis())
-            pat.setAxis(Axis.PRECEDINGANDANCESTOR);
-            
-          else if(Axis.DESCENDANT == pat.getAxis())
-            pat.setAxis(Axis.DESCENDANTORSELF);
-          
-          pat = attrPat;
-        }
-        else if(Axis.CHILD == pat.getAxis())
-        {
-          // In this case just change the axis.
-          // pat.setWhatToShow(whatToShow);
-          pat.setAxis(Axis.ATTRIBUTE);
-        }
-      }
-      axis = nextAxis;
-      //paxis = nextPaxis;
-      tail = pat;
-    }
-    
-    if(axis < Axis.ALL)
-    {
-      StepPattern selfPattern = new ContextMatchStepPattern(axis, paxis);
-      // We need to keep the new nodetest from affecting the score...
-      XNumber score = tail.getStaticScore();
-      tail.setRelativePathPattern(selfPattern);
-      tail.setStaticScore(score);
-      selfPattern.setStaticScore(score);
-    }        
-
-    if (DEBUG_PATTERN_CREATION)
-    {
-      System.out.println("Done loading steps: "+step.toString());
-            
-      System.out.println("");
-    }
-    return step;  // start from last pattern?? //firstStep;
-  }
-
-  /**
-   * Create a StepPattern that is contained within a LocationPath.
-   *
-   *
-   * @param compiler The compiler that holds the syntax tree/op map to
-   * construct from.
-   * @param stepOpCodePos The current op code position within the opmap.
-   * @param mpi The MatchPatternIterator to which the steps will be attached.
-   * @param analysis 32 bits of analysis, from which the type of AxesWalker
-   *                 may be influenced.
-   * @param tail The step that is the first step analyzed, but the last 
-   *                  step in the relative match linked list, i.e. the tail.
-   *                  May be null.
-   * @param head The step that is the current head of the relative 
-   *                 match step linked list.
-   *                 May be null.
-   *
-   * @return the head of the list.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private static StepPattern createDefaultStepPattern(
-          Compiler compiler, int opPos, MatchPatternIterator mpi, 
-          int analysis, StepPattern tail, StepPattern head)
-            throws javax.xml.transform.TransformerException
-  {
-
-    int stepType = compiler.getOp(opPos);
-    boolean simpleInit = false;
-    int totalNumberWalkers = (analysis & BITS_COUNT);
-    boolean prevIsOneStepDown = true;
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-    
-    int whatToShow = compiler.getWhatToShow(opPos);
-    StepPattern ai = null;
-    int axis, predicateAxis;
-    
-    switch (stepType)
-    {
-    case OpCodes.OP_VARIABLE :
-    case OpCodes.OP_EXTFUNCTION :
-    case OpCodes.OP_FUNCTION :
-    case OpCodes.OP_GROUP :
-      prevIsOneStepDown = false;
-
-      Expression expr;
-
-      switch (stepType)
-      {
-      case OpCodes.OP_VARIABLE :
-      case OpCodes.OP_EXTFUNCTION :
-      case OpCodes.OP_FUNCTION :
-      case OpCodes.OP_GROUP :
-        expr = compiler.compile(opPos);
-        break;
-      default :
-        expr = compiler.compile(opPos + 2);
-      }
-
-      axis = Axis.FILTEREDLIST;
-      predicateAxis = Axis.FILTEREDLIST;
-      ai = new FunctionPattern(expr, axis, predicateAxis);
-      simpleInit = true;
-      break;
-    case OpCodes.FROM_ROOT :
-      whatToShow = DTMFilter.SHOW_DOCUMENT
-                   | DTMFilter.SHOW_DOCUMENT_FRAGMENT;
-
-      axis = Axis.ROOT;
-      predicateAxis = Axis.ROOT;
-      ai = new StepPattern(DTMFilter.SHOW_DOCUMENT | 
-                                DTMFilter.SHOW_DOCUMENT_FRAGMENT,
-                                axis, predicateAxis);
-      break;
-    case OpCodes.FROM_ATTRIBUTES :
-      whatToShow = DTMFilter.SHOW_ATTRIBUTE;
-      axis = Axis.PARENT;
-      predicateAxis = Axis.ATTRIBUTE;
-      // ai = new StepPattern(whatToShow, Axis.SELF, Axis.SELF);
-      break;
-    case OpCodes.FROM_NAMESPACE :
-      whatToShow = DTMFilter.SHOW_NAMESPACE;
-      axis = Axis.PARENT;
-      predicateAxis = Axis.NAMESPACE;
-      // ai = new StepPattern(whatToShow, axis, predicateAxis);
-      break;
-    case OpCodes.FROM_ANCESTORS :
-      axis = Axis.DESCENDANT;
-      predicateAxis = Axis.ANCESTOR;
-      break;
-    case OpCodes.FROM_CHILDREN :
-      axis = Axis.PARENT;
-      predicateAxis = Axis.CHILD;
-      break;
-    case OpCodes.FROM_ANCESTORS_OR_SELF :
-      axis = Axis.DESCENDANTORSELF;
-      predicateAxis = Axis.ANCESTORORSELF;
-      break;
-    case OpCodes.FROM_SELF :
-      axis = Axis.SELF;
-      predicateAxis = Axis.SELF;
-      break;
-    case OpCodes.FROM_PARENT :
-      axis = Axis.CHILD;
-      predicateAxis = Axis.PARENT;
-      break;
-    case OpCodes.FROM_PRECEDING_SIBLINGS :
-      axis = Axis.FOLLOWINGSIBLING;
-      predicateAxis = Axis.PRECEDINGSIBLING;
-      break;
-    case OpCodes.FROM_PRECEDING :
-      axis = Axis.FOLLOWING;
-      predicateAxis = Axis.PRECEDING;
-      break;
-    case OpCodes.FROM_FOLLOWING_SIBLINGS :
-      axis = Axis.PRECEDINGSIBLING;
-      predicateAxis = Axis.FOLLOWINGSIBLING;
-      break;
-    case OpCodes.FROM_FOLLOWING :
-      axis = Axis.PRECEDING;
-      predicateAxis = Axis.FOLLOWING;
-      break;
-    case OpCodes.FROM_DESCENDANTS_OR_SELF :
-      axis = Axis.ANCESTORORSELF;
-      predicateAxis = Axis.DESCENDANTORSELF;
-      break;
-    case OpCodes.FROM_DESCENDANTS :
-      axis = Axis.ANCESTOR;
-      predicateAxis = Axis.DESCENDANT;
-      break;
-    default :
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
-                                 //+ stepType);
-    }
-    if(null == ai)
-    {
-      whatToShow = compiler.getWhatToShow(opPos); // %REVIEW%
-      ai = new StepPattern(whatToShow, compiler.getStepNS(opPos),
-                                compiler.getStepLocalName(opPos),
-                                axis, predicateAxis);
-    }
-   
-    if (false || DEBUG_PATTERN_CREATION)
-    {
-      System.out.print("new step: "+ ai);
-      System.out.print(", axis: " + Axis.names[ai.getAxis()]);
-      System.out.print(", predAxis: " + Axis.names[ai.getAxis()]);
-      System.out.print(", what: ");
-      System.out.print("    ");
-      ai.debugWhatToShow(ai.getWhatToShow());
-    }
-
-    int argLen = compiler.getFirstPredicateOpPos(opPos);
-
-    ai.setPredicates(compiler.getCompiledPredicates(argLen));
-
-    return ai;
-  }
-
-  /**
-   * Analyze a step and give information about it's predicates.  Right now this
-   * just returns true or false if the step has a predicate.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param opPos The opcode position for the step.
-   * @param stepType The type of step, one of OP_GROUP, etc.
-   *
-   * @return true if step has a predicate.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
-          throws javax.xml.transform.TransformerException
-  {
-
-    int argLen;
-
-    switch (stepType)
-    {
-    case OpCodes.OP_VARIABLE :
-    case OpCodes.OP_EXTFUNCTION :
-    case OpCodes.OP_FUNCTION :
-    case OpCodes.OP_GROUP :
-      argLen = compiler.getArgLength(opPos);
-      break;
-    default :
-      argLen = compiler.getArgLengthOfStep(opPos);
-    }
-
-    int pos = compiler.getFirstPredicateOpPos(opPos);
-    int nPredicates = compiler.countPredicates(pos);
-
-    return (nPredicates > 0) ? true : false;
-  }
-
-  /**
-   * Create the proper Walker from the axes type.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param opPos The opcode position for the step.
-   * @param lpi The owning location path iterator.
-   * @param analysis 32 bits of analysis, from which the type of AxesWalker
-   *                 may be influenced.
-   *
-   * @return non-null reference to AxesWalker derivative.
-   * @throws RuntimeException if the input is bad.
-   */
-  private static AxesWalker createDefaultWalker(Compiler compiler, int opPos,
-          WalkingIterator lpi, int analysis)
-  {
-
-    AxesWalker ai = null;
-    int stepType = compiler.getOp(opPos);
-
-    /*
-    System.out.println("0: "+compiler.getOp(opPos));
-    System.out.println("1: "+compiler.getOp(opPos+1));
-    System.out.println("2: "+compiler.getOp(opPos+2));
-    System.out.println("3: "+compiler.getOp(opPos+3));
-    System.out.println("4: "+compiler.getOp(opPos+4));
-    System.out.println("5: "+compiler.getOp(opPos+5));
-    */
-    boolean simpleInit = false;
-    int totalNumberWalkers = (analysis & BITS_COUNT);
-    boolean prevIsOneStepDown = true;
-
-    switch (stepType)
-    {
-    case OpCodes.OP_VARIABLE :
-    case OpCodes.OP_EXTFUNCTION :
-    case OpCodes.OP_FUNCTION :
-    case OpCodes.OP_GROUP :
-      prevIsOneStepDown = false;
-
-      if (DEBUG_WALKER_CREATION)
-        System.out.println("new walker:  FilterExprWalker: " + analysis
-                           + ", " + compiler.toString());
-
-      ai = new FilterExprWalker(lpi);
-      simpleInit = true;
-      break;
-    case OpCodes.FROM_ROOT :
-      ai = new AxesWalker(lpi, Axis.ROOT);
-      break;
-    case OpCodes.FROM_ANCESTORS :
-      prevIsOneStepDown = false;
-      ai = new ReverseAxesWalker(lpi, Axis.ANCESTOR);
-      break;
-    case OpCodes.FROM_ANCESTORS_OR_SELF :
-      prevIsOneStepDown = false;
-      ai = new ReverseAxesWalker(lpi, Axis.ANCESTORORSELF);
-      break;
-    case OpCodes.FROM_ATTRIBUTES :
-      ai = new AxesWalker(lpi, Axis.ATTRIBUTE);
-      break;
-    case OpCodes.FROM_NAMESPACE :
-      ai = new AxesWalker(lpi, Axis.NAMESPACE);
-      break;
-    case OpCodes.FROM_CHILDREN :
-      ai = new AxesWalker(lpi, Axis.CHILD);
-      break;
-    case OpCodes.FROM_DESCENDANTS :
-      prevIsOneStepDown = false;
-      ai = new AxesWalker(lpi, Axis.DESCENDANT);
-      break;
-    case OpCodes.FROM_DESCENDANTS_OR_SELF :
-      prevIsOneStepDown = false;
-      ai = new AxesWalker(lpi, Axis.DESCENDANTORSELF);
-      break;
-    case OpCodes.FROM_FOLLOWING :
-      prevIsOneStepDown = false;
-      ai = new AxesWalker(lpi, Axis.FOLLOWING);
-      break;
-    case OpCodes.FROM_FOLLOWING_SIBLINGS :
-      prevIsOneStepDown = false;
-      ai = new AxesWalker(lpi, Axis.FOLLOWINGSIBLING);
-      break;
-    case OpCodes.FROM_PRECEDING :
-      prevIsOneStepDown = false;
-      ai = new ReverseAxesWalker(lpi, Axis.PRECEDING);
-      break;
-    case OpCodes.FROM_PRECEDING_SIBLINGS :
-      prevIsOneStepDown = false;
-      ai = new ReverseAxesWalker(lpi, Axis.PRECEDINGSIBLING);
-      break;
-    case OpCodes.FROM_PARENT :
-      prevIsOneStepDown = false;
-      ai = new ReverseAxesWalker(lpi, Axis.PARENT);
-      break;
-    case OpCodes.FROM_SELF :
-      ai = new AxesWalker(lpi, Axis.SELF);
-      break;
-    default :
-      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
-                                 //+ stepType);
-    }
-
-    if (simpleInit)
-    {
-      ai.initNodeTest(DTMFilter.SHOW_ALL);
-    }
-    else
-    {
-      int whatToShow = compiler.getWhatToShow(opPos);
-
-      /*
-      System.out.print("construct: ");
-      NodeTest.debugWhatToShow(whatToShow);
-      System.out.println("or stuff: "+(whatToShow & (DTMFilter.SHOW_ATTRIBUTE
-                             | DTMFilter.SHOW_ELEMENT
-                             | DTMFilter.SHOW_PROCESSING_INSTRUCTION)));
-      */
-      if ((0 == (whatToShow
-                 & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_NAMESPACE | DTMFilter.SHOW_ELEMENT
-                    | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) || (whatToShow == DTMFilter.SHOW_ALL))
-        ai.initNodeTest(whatToShow);
-      else
-      {
-        ai.initNodeTest(whatToShow, compiler.getStepNS(opPos),
-                        compiler.getStepLocalName(opPos));
-      }
-    }
-
-    return ai;
-  }
-  
-  public static String getAnalysisString(int analysis)
-  {
-    StringBuffer buf = new StringBuffer();
-    buf.append("count: "+getStepCount(analysis)+" ");
-    if((analysis & BIT_NODETEST_ANY) != 0)
-    {
-      buf.append("NTANY|");
-    }
-    if((analysis & BIT_PREDICATE) != 0)
-    {
-      buf.append("PRED|");
-    }
-    if((analysis & BIT_ANCESTOR) != 0)
-    {
-      buf.append("ANC|");
-    }
-    if((analysis & BIT_ANCESTOR_OR_SELF) != 0)
-    {
-      buf.append("ANCOS|");
-    }
-    if((analysis & BIT_ATTRIBUTE) != 0)
-    {
-      buf.append("ATTR|");
-    }
-    if((analysis & BIT_CHILD) != 0)
-    {
-      buf.append("CH|");
-    }
-    if((analysis & BIT_DESCENDANT) != 0)
-    {
-      buf.append("DESC|");
-    }
-    if((analysis & BIT_DESCENDANT_OR_SELF) != 0)
-    {
-      buf.append("DESCOS|");
-    }
-    if((analysis & BIT_FOLLOWING) != 0)
-    {
-      buf.append("FOL|");
-    }
-    if((analysis & BIT_FOLLOWING_SIBLING) != 0)
-    {
-      buf.append("FOLS|");
-    }
-    if((analysis & BIT_NAMESPACE) != 0)
-    {
-      buf.append("NS|");
-    }
-    if((analysis & BIT_PARENT) != 0)
-    {
-      buf.append("P|");
-    }
-    if((analysis & BIT_PRECEDING) != 0)
-    {
-      buf.append("PREC|");
-    }
-    if((analysis & BIT_PRECEDING_SIBLING) != 0)
-    {
-      buf.append("PRECS|");
-    }
-    if((analysis & BIT_SELF) != 0)
-    {
-      buf.append(".|");
-    }
-    if((analysis & BIT_FILTER) != 0)
-    {
-      buf.append("FLT|");
-    }
-    if((analysis & BIT_ROOT) != 0)
-    {
-      buf.append("R|");
-    }
-    return buf.toString();
-  }
-
-  /** Set to true for diagnostics about walker creation */
-  static final boolean DEBUG_PATTERN_CREATION = false;
-
-  /** Set to true for diagnostics about walker creation */
-  static final boolean DEBUG_WALKER_CREATION = false;
-
-  /** Set to true for diagnostics about iterator creation */
-  static final boolean DEBUG_ITERATOR_CREATION = false;
-  
-  public static boolean hasPredicate(int analysis)
-  {
-    return (0 != (analysis & BIT_PREDICATE));
-  }
-
-  public static boolean isWild(int analysis)
-  {
-    return (0 != (analysis & BIT_NODETEST_ANY));
-  }
-
-  public static boolean walksAncestors(int analysis)
-  {
-    return isSet(analysis, BIT_ANCESTOR | BIT_ANCESTOR_OR_SELF);
-  }
-  
-  public static boolean walksAttributes(int analysis)
-  {
-    return (0 != (analysis & BIT_ATTRIBUTE));
-  }
-
-  public static boolean walksNamespaces(int analysis)
-  {
-    return (0 != (analysis & BIT_NAMESPACE));
-  }  
-
-  public static boolean walksChildren(int analysis)
-  {
-    return (0 != (analysis & BIT_CHILD));
-  }
-
-  public static boolean walksDescendants(int analysis)
-  {
-    return isSet(analysis, BIT_DESCENDANT | BIT_DESCENDANT_OR_SELF);
-  }
-
-  public static boolean walksSubtree(int analysis)
-  {
-    return isSet(analysis, BIT_DESCENDANT | BIT_DESCENDANT_OR_SELF | BIT_CHILD);
-  }
-  
-  public static boolean walksSubtreeOnly(int analysis)
-  {
-    return walksSubtree(analysis)
-           && !walksExtraNodes(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-
-  public static boolean walksFilteredList(int analysis)
-  {
-    return isSet(analysis, BIT_FILTER);
-  }
-  
-  public static boolean walksSubtreeOnlyFromRootOrContext(int analysis)
-  {
-    return walksSubtree(analysis)
-           && !walksExtraNodes(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isSet(analysis, BIT_FILTER) 
-           ;
-  }
-
-  public static boolean walksInDocOrder(int analysis)
-  {
-    return (walksSubtree(analysis)
-           || walksExtraNodes(analysis)
-           || isSet(analysis, BIT_SELF | BIT_FOLLOWING_SIBLING | BIT_FOLLOWING)) 
-           && !walksUp(analysis) 
-           && !isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING) 
-           && !isSet(analysis, BIT_FILTER) 
-           ;
-  }
-  
-  public static boolean walksUp(int analysis)
-  {
-    return isSet(analysis, BIT_PARENT | BIT_ANCESTOR | BIT_ANCESTOR_OR_SELF);
-  }
-  
-  public static boolean walksSideways(int analysis)
-  {
-    return isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING | 
-                           BIT_PRECEDING | BIT_PRECEDING_SIBLING);
-  }
-  
-  public static boolean walksExtraNodes(int analysis)
-  {
-    return isSet(analysis, BIT_NAMESPACE | BIT_ATTRIBUTE);
-  }
-
-  public static boolean walksExtraNodesOnly(int analysis)
-  {
-    return walksExtraNodes(analysis)
-           && !isSet(analysis, BIT_SELF) 
-           && !walksSubtree(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-
-  public static boolean isAbsolute(int analysis)
-  {
-    return isSet(analysis, BIT_ROOT | BIT_FILTER);
-  }
-  
-  public static boolean walksChildrenOnly(int analysis)
-  {
-    return walksChildren(analysis)
-           && !isSet(analysis, BIT_SELF)
-           && !walksExtraNodes(analysis)
-           && !walksDescendants(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-  
-  public static boolean walksChildrenAndExtraAndSelfOnly(int analysis)
-  {
-    return walksChildren(analysis)
-           && !walksDescendants(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-  
-  public static boolean walksDescendantsAndExtraAndSelfOnly(int analysis)
-  {
-    return !walksChildren(analysis)
-           && walksDescendants(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-  
-  public static boolean walksSelfOnly(int analysis)
-  {
-    return isSet(analysis, BIT_SELF) 
-           && !walksSubtree(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-
-  
-  public static boolean walksUpOnly(int analysis)
-  {
-    return !walksSubtree(analysis) 
-           && walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-  
-  public static boolean walksDownOnly(int analysis)
-  {
-    return walksSubtree(analysis) 
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-
-  public static boolean walksDownExtraOnly(int analysis)
-  {
-    return walksSubtree(analysis) &&  walksExtraNodes(analysis)
-           && !walksUp(analysis) 
-           && !walksSideways(analysis) 
-           && !isAbsolute(analysis) 
-           ;
-  }
-  
-  public static boolean canSkipSubtrees(int analysis)
-  {
-    return isSet(analysis, BIT_CHILD) | walksSideways(analysis);
-  }
-  
-  public static boolean canCrissCross(int analysis)
-  {
-    // This could be done faster.  Coded for clarity.
-    if(walksSelfOnly(analysis))
-      return false;
-    else if(walksDownOnly(analysis) && !canSkipSubtrees(analysis))
-      return false;
-    else if(walksChildrenAndExtraAndSelfOnly(analysis))
-      return false;
-    else if(walksDescendantsAndExtraAndSelfOnly(analysis))
-      return false;
-    else if(walksUpOnly(analysis))
-      return false;
-    else if(walksExtraNodesOnly(analysis))
-      return false;
-    else if(walksSubtree(analysis) 
-           && (walksSideways(analysis) 
-            || walksUp(analysis) 
-            || canSkipSubtrees(analysis)))
-      return true;
-    else
-      return false;
-  }
-  
-  /**
-   * Tell if the pattern can be 'walked' with the iteration steps in natural 
-   * document order, without duplicates.
-   *
-   * @param compiler non-null reference to compiler object that has processed
-   *                 the XPath operations into an opcode map.
-   * @param stepOpCodePos The opcode position for the step.
-   * @param stepIndex The top-level step index withing the iterator.
-   * @param analysis The general analysis of the pattern.
-   *
-   * @return 32 bits as an integer that give information about the location
-   * path as a whole.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private static boolean isNaturalDocOrder(
-          Compiler compiler, int stepOpCodePos, int stepIndex, int analysis)
-            throws javax.xml.transform.TransformerException
-  {
-    if(canCrissCross(analysis))
-      return false;
-      
-    // Namespaces can present some problems, so just punt if we're looking for 
-    // these.
-    if(isSet(analysis, BIT_NAMESPACE))
-      return false;
-      
-    // The following, preceding, following-sibling, and preceding sibling can 
-    // be found in doc order if we get to this point, but if they occur 
-    // together, they produce 
-    // duplicates, so it's better for us to eliminate this case so we don't 
-    // have to check for duplicates during runtime if we're using a 
-    // WalkingIterator.
-    if(isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING) && 
-       isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING))
-      return  false;
-      
-    // OK, now we have to check for select="@*/axis::*" patterns, which 
-    // can also cause duplicates to happen.  But select="axis*/@::*" patterns 
-    // are OK, as are select="@foo/axis::*" patterns.
-    // Unfortunately, we can't do this just via the analysis bits.
-    
-    int stepType;
-    int ops[] = compiler.getOpMap();
-    int stepCount = 0;
-    boolean foundWildAttribute = false;
-    
-    // Steps that can traverse anything other than down a 
-    // subtree or that can produce duplicates when used in 
-    // combonation are counted with this variable.
-    int potentialDuplicateMakingStepCount = 0;
-    
-    while (OpCodes.ENDOP != (stepType = ops[stepOpCodePos]))
-    {        
-      stepCount++;
-        
-      switch (stepType)
-      {
-      case OpCodes.FROM_ATTRIBUTES :
-      case OpCodes.MATCH_ATTRIBUTE :
-        if(foundWildAttribute) // Maybe not needed, but be safe.
-          return false;
-        
-        // This doesn't seem to work as a test for wild card.  Hmph.
-        // int nodeTestType = compiler.getStepTestType(stepOpCodePos);  
-        
-        String localName = compiler.getStepLocalName(stepOpCodePos);
-        // System.err.println("localName: "+localName);
-        if(localName.equals("*"))
-        {
-          foundWildAttribute = true;
-        }
-        break;
-      case OpCodes.FROM_FOLLOWING :
-      case OpCodes.FROM_FOLLOWING_SIBLINGS :
-      case OpCodes.FROM_PRECEDING :
-      case OpCodes.FROM_PRECEDING_SIBLINGS :
-      case OpCodes.FROM_PARENT :
-      case OpCodes.OP_VARIABLE :
-      case OpCodes.OP_EXTFUNCTION :
-      case OpCodes.OP_FUNCTION :
-      case OpCodes.OP_GROUP :
-      case OpCodes.FROM_NAMESPACE :
-      case OpCodes.FROM_ANCESTORS :
-      case OpCodes.FROM_ANCESTORS_OR_SELF :      
-      case OpCodes.MATCH_ANY_ANCESTOR :
-      case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
-      case OpCodes.FROM_DESCENDANTS_OR_SELF :
-      case OpCodes.FROM_DESCENDANTS :
-        if(potentialDuplicateMakingStepCount > 0)
-            return false;
-        potentialDuplicateMakingStepCount++;
-      case OpCodes.FROM_ROOT :
-      case OpCodes.FROM_CHILDREN :
-      case OpCodes.FROM_SELF :
-        if(foundWildAttribute)
-          return false;
-        break;
-      default :
-        throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
-                                  // + stepType);
-      }
-
-      int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
-      if (nextStepOpCodePos < 0)
-        break;
-              
-      stepOpCodePos = nextStepOpCodePos;
-    }
-
-    return true;
-  }
-  
-  public static boolean isOneStep(int analysis)
-  {
-    return (analysis & BITS_COUNT) == 0x00000001;
-  }
-
-  public static int getStepCount(int analysis)
-  {
-    return (analysis & BITS_COUNT);
-  }
-
-  /**
-   * First 8 bits are the number of top-level location steps.  Hopefully
-   *  there will never be more that 255 location steps!!!
-   */
-  public static final int BITS_COUNT = 0x000000FF;
-
-  /** 4 bits are reserved for future use. */
-  public static final int BITS_RESERVED = 0x00000F00;
-
-  /** Bit is on if the expression contains a top-level predicate. */
-  public static final int BIT_PREDICATE = (0x00001000);
-
-  /** Bit is on if any of the walkers contain an ancestor step. */
-  public static final int BIT_ANCESTOR = (0x00001000 << 1);
-
-  /** Bit is on if any of the walkers contain an ancestor-or-self step. */
-  public static final int BIT_ANCESTOR_OR_SELF = (0x00001000 << 2);
-
-  /** Bit is on if any of the walkers contain an attribute step. */
-  public static final int BIT_ATTRIBUTE = (0x00001000 << 3);
-
-  /** Bit is on if any of the walkers contain a child step. */
-  public static final int BIT_CHILD = (0x00001000 << 4);
-
-  /** Bit is on if any of the walkers contain a descendant step. */
-  public static final int BIT_DESCENDANT = (0x00001000 << 5);
-
-  /** Bit is on if any of the walkers contain a descendant-or-self step. */
-  public static final int BIT_DESCENDANT_OR_SELF = (0x00001000 << 6);
-
-  /** Bit is on if any of the walkers contain a following step. */
-  public static final int BIT_FOLLOWING = (0x00001000 << 7);
-
-  /** Bit is on if any of the walkers contain a following-sibiling step. */
-  public static final int BIT_FOLLOWING_SIBLING = (0x00001000 << 8);
-
-  /** Bit is on if any of the walkers contain a namespace step. */
-  public static final int BIT_NAMESPACE = (0x00001000 << 9);
-
-  /** Bit is on if any of the walkers contain a parent step. */
-  public static final int BIT_PARENT = (0x00001000 << 10);
-
-  /** Bit is on if any of the walkers contain a preceding step. */
-  public static final int BIT_PRECEDING = (0x00001000 << 11);
-
-  /** Bit is on if any of the walkers contain a preceding-sibling step. */
-  public static final int BIT_PRECEDING_SIBLING = (0x00001000 << 12);
-
-  /** Bit is on if any of the walkers contain a self step. */
-  public static final int BIT_SELF = (0x00001000 << 13);
-
-  /**
-   * Bit is on if any of the walkers contain a filter (i.e. id(), extension
-   *  function, etc.) step.
-   */
-  public static final int BIT_FILTER = (0x00001000 << 14);
-
-  /** Bit is on if any of the walkers contain a root step. */
-  public static final int BIT_ROOT = (0x00001000 << 15);
-
-  /**
-   * If any of these bits are on, the expression may likely traverse outside
-   *  the given subtree.
-   */
-  public static final int BITMASK_TRAVERSES_OUTSIDE_SUBTREE = (BIT_NAMESPACE  // ??
-                                                                | BIT_PRECEDING_SIBLING
-                                                                | BIT_PRECEDING
-                                                                | BIT_FOLLOWING_SIBLING
-                                                                | BIT_FOLLOWING
-                                                                | BIT_PARENT  // except parent of attrs.
-                                                                | BIT_ANCESTOR_OR_SELF
-                                                                | BIT_ANCESTOR
-                                                                | BIT_FILTER
-                                                                | BIT_ROOT);
-
-  /**
-   * Bit is on if any of the walkers can go backwards in document
-   *  order from the context node.
-   */
-  public static final int BIT_BACKWARDS_SELF = (0x00001000 << 16);
-
-  /** Found "//foo" pattern */
-  public static final int BIT_ANY_DESCENDANT_FROM_ROOT = (0x00001000 << 17);
-
-  /**
-   * Bit is on if any of the walkers contain an node() test.  This is
-   *  really only useful if the count is 1.
-   */
-  public static final int BIT_NODETEST_ANY = (0x00001000 << 18);
-
-  // can't go higher than 18!
-
-  /** Bit is on if the expression is a match pattern. */
-  public static final int BIT_MATCH_PATTERN = (0x00001000 << 19);
-}
diff --git a/src/org/apache/xpath/axes/WalkingIterator.java b/src/org/apache/xpath/axes/WalkingIterator.java
deleted file mode 100644
index 056189d..0000000
--- a/src/org/apache/xpath/axes/WalkingIterator.java
+++ /dev/null
@@ -1,272 +0,0 @@
-package org.apache.xpath.axes;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMManager;
-
-// Xalan imports
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.OpMap;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.compiler.PsuedoNames;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xml.utils.IntStack;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.ObjectPool;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.axes.AxesWalker;
-import org.apache.xpath.VariableStack;
-
-/**
- * Location path iterator that uses Walkers.
- */
-
-public class WalkingIterator extends LocPathIterator
-{
-  /**
-   * Create a WalkingIterator iterator, including creation
-   * of step walkers from the opcode list, and call back
-   * into the Compiler to create predicate expressions.
-   *
-   * @param compiler The Compiler which is creating
-   * this expression.
-   * @param opPos The position of this iterator in the
-   * opcode list from the compiler.
-   * @param shouldLoadWalkers True if walkers should be
-   * loaded, or false if this is a derived iterator and
-   * it doesn't wish to load child walkers.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  WalkingIterator(
-          Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
-            throws javax.xml.transform.TransformerException
-  {
-    super(compiler, opPos, analysis, shouldLoadWalkers);
-    
-    int firstStepPos = compiler.getFirstChildPos(opPos);
-
-    if (shouldLoadWalkers)
-    {
-      m_firstWalker = WalkerFactory.loadWalkers(this, compiler, firstStepPos, 0);
-      m_lastUsedWalker = m_firstWalker;
-    }
-  }
-  
-  /**
-   * Create a WalkingIterator object.
-   *
-   * @param nscontext The namespace context for this iterator,
-   * should be OK if null.
-   */
-  protected WalkingIterator(PrefixResolver nscontext)
-  {
-
-    super(nscontext);
-  }
-
-  
-  /**
-   * Get a cloned WalkingIterator that holds the same
-   * position as this iterator.
-   *
-   * @return A clone of this iterator that holds the same node position.
-   *
-   * @throws CloneNotSupportedException
-   */
-  public Object clone() throws CloneNotSupportedException
-  {
-
-    WalkingIterator clone = (WalkingIterator) super.clone();
-
-    //    clone.m_varStackPos = this.m_varStackPos;
-    //    clone.m_varStackContext = this.m_varStackContext;
-    if (null != m_firstWalker)
-    {
-      clone.m_firstWalker = m_firstWalker.cloneDeep(clone, null);
-    }
-
-    return clone;
-  }
-  
-  /**
-   * Reset the iterator.
-   */
-  public void reset()
-  {
-
-    super.reset();
-
-    if (null != m_firstWalker)
-    {
-      m_lastUsedWalker = m_firstWalker;
-
-      m_firstWalker.setRoot(m_context);
-    }
-
-  }
-  
-  /**
-   *  Returns the next node in the set and advances the position of the
-   * iterator in the set. After a NodeIterator is created, the first call
-   * to nextNode() returns the first node in the set.
-   * @return  The next <code>Node</code> in the set being iterated over, or
-   *   <code>null</code> if there are no more members in that set.
-   */
-  public int nextNode()
-  {
-
-    // If the cache is on, and the node has already been found, then 
-    // just return from the list.
-    if (null != m_cachedNodes)
-    {
-      if(m_next < m_cachedNodes.size())
-      {
-        int next = m_lastFetched = m_currentContextNode 
-                                       = m_cachedNodes.elementAt(m_next);
-      
-        incrementNextPosition();
-  
-        return next;
-      }
-      else if(m_foundLast)
-      {
-        m_lastFetched = DTM.NULL;
-        return DTM.NULL;
-      }
-    }
-
-    // If the variable stack position is not -1, we'll have to 
-    // set our position in the variable stack, so our variable access 
-    // will be correct.  Iterators that are at the top level of the 
-    // expression need to reset the variable stack, while iterators 
-    // in predicates do not need to, and should not, since their execution
-    // may be much later than top-level iterators.  
-    // m_varStackPos is set in setRoot, which is called 
-    // from the execute method.
-    if (-1 == m_stackFrame)
-    {
-      if (DTM.NULL == m_firstWalker.getRoot())
-      {
-        this.setNextPosition(0);
-        m_firstWalker.setRoot(m_context);
-
-        m_lastUsedWalker = m_firstWalker;
-      }
-
-      return returnNextNode(m_firstWalker.nextNode());
-    }
-    else
-    {
-      VariableStack vars = m_execContext.getVarStack();
-
-      // These three statements need to be combined into one operation.
-      int savedStart = vars.getStackFrame();
-
-      vars.setStackFrame(m_stackFrame);
-
-      if (DTM.NULL == m_firstWalker.getRoot())
-      {
-        this.setNextPosition(0);
-        m_firstWalker.setRoot(m_context);
-
-        m_lastUsedWalker = m_firstWalker;
-      }
-
-      int n = returnNextNode(m_firstWalker.nextNode());
-
-      // These two statements need to be combined into one operation.
-      vars.setStackFrame(savedStart);
-
-      return n;
-    }
-  }
-  
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the head of the walker list.
-   *
-   * @return The head of the walker list, or null
-   * if this iterator does not implement walkers.
-   */
-  public final AxesWalker getFirstWalker()
-  {
-    return m_firstWalker;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Set the last used walker.
-   *
-   * @param walker The last used walker, or null.
-   */
-  public final void setLastUsedWalker(AxesWalker walker)
-  {
-    m_lastUsedWalker = walker;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Get the last used walker.
-   *
-   * @return The last used walker, or null.
-   */
-  public final AxesWalker getLastUsedWalker()
-  {
-    return m_lastUsedWalker;
-  }
-  
-  /**
-   *  Detaches the iterator from the set which it iterated over, releasing
-   * any computational resources and placing the iterator in the INVALID
-   * state. After<code>detach</code> has been invoked, calls to
-   * <code>nextNode</code> or<code>previousNode</code> will raise the
-   * exception INVALID_STATE_ERR.
-   */
-  public void detach()
-  {    
-    m_lastUsedWalker = null;
-    
-    // Always call the superclass detach last!
-    super.detach();
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    m_predicateIndex = -1;
-
-    AxesWalker walker = m_firstWalker;
-
-    while (null != walker)
-    {
-      walker.fixupVariables(vars, globalsSize);
-      walker = walker.getNextWalker();
-    }
-  }
-
-  
-  /** The last used step walker in the walker list.
-   *  @serial */
-  protected AxesWalker m_lastUsedWalker;
-
-  /** The head of the step walker list.
-   *  @serial */
-  protected AxesWalker m_firstWalker;
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/axes/WalkingIteratorSorted.java b/src/org/apache/xpath/axes/WalkingIteratorSorted.java
deleted file mode 100644
index 0282ae7..0000000
--- a/src/org/apache/xpath/axes/WalkingIteratorSorted.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.axes;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.Axis;
-
-/**
- * <meta name="usage" content="internal"/>
- * NEEDSDOC Class WalkingIteratorSorted <needs-comment/>
- */
-public class WalkingIteratorSorted extends WalkingIterator
-{
-
-  /** NEEDSDOC Field m_inNaturalOrder          */
-  protected boolean m_inNaturalOrder = false;
-
-  /**
-   * Create a WalkingIteratorSorted object.
-   *
-   * @param nscontext The namespace context for this iterator,
-   * should be OK if null.
-   */
-  public WalkingIteratorSorted(PrefixResolver nscontext)
-  {
-    super(nscontext);
-  }
-
-  /**
-   * Create a WalkingIteratorSorted iteratorWalkingIteratorSortedWalkingIteratorSorted.
-   *
-   * @param compiler The Compiler which is creating
-   * this expression.
-   * @param opPos The position of this iterator in the
-   * opcode list from the compiler.
-   * NEEDSDOC @param analysis
-   * @param shouldLoadWalkers True if walkers should be
-   * loaded, or false if this is a derived iterator and
-   * it doesn't wish to load child walkers.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public WalkingIteratorSorted(
-          Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
-            throws javax.xml.transform.TransformerException
-  {
-
-    super(compiler, opPos, analysis, shouldLoadWalkers);
-
-    //this.setShouldCacheNodes(true);
-  }
-
-  /**
-   * NEEDSDOC Method canBeWalkedInNaturalDocOrder 
-   *
-   *
-   * NEEDSDOC (canBeWalkedInNaturalDocOrder) @return
-   */
-  boolean canBeWalkedInNaturalDocOrder()
-  {
-
-    if (null != m_firstWalker)
-    {
-      AxesWalker walker = m_firstWalker;
-      int prevAxis = -1;
-      boolean prevIsSimpleDownAxis = true;
-
-      for(int i = 0; null != walker; i++)
-      {
-        int axis = walker.getAxis();
-        boolean isSimpleDownAxis = ((axis == Axis.CHILD)
-           || (axis == Axis.SELF)
-           || (axis == Axis.ROOT));
-        if(walker.isDocOrdered())
-        {
-          if(isSimpleDownAxis)
-            walker = walker.getNextWalker();
-          else
-          {
-            boolean isLastWalker = (null == walker.getNextWalker());
-            if(isLastWalker)
-            {
-              if(walker.isDocOrdered() && (axis == Axis.DESCENDANT || 
-                 axis == Axis.DESCENDANTORSELF || axis == Axis.DESCENDANTSFROMROOT
-                 || axis == Axis.DESCENDANTSORSELFFROMROOT) || (axis == Axis.ATTRIBUTE))
-                return true;
-            }
-            return false;
-          }
-        }
-        else
-          return false;
-      }
-      return true;
-    }
-    return false;
-  }
-
-  /**
-   * Initialize the context values for this expression
-   * after it is cloned.
-   *
-   * @param execContext The XPath runtime context for this
-   * transformation.
-   *
-   * NEEDSDOC @param context
-   * NEEDSDOC @param environment
-   */
-  public void setRoot(int context, Object environment)
-  {
-
-    super.setRoot(context, environment);
-
-    m_inNaturalOrder = canBeWalkedInNaturalDocOrder();
-
-    if (!m_inNaturalOrder)
-    {
-      this.setShouldCacheNodes(true);
-
-      // This should really be done in the super's setRoot, but if I do that 
-      // it becomes unhappy in the minitest... possibly something to do with 
-      // the keyref iterator.  -sb
-      m_cachedNodes.setLast(0);
-      m_cachedNodes.reset();
-      m_cachedNodes.RemoveAllNoClear();
-      setNextPosition(0);
-      m_firstWalker.setRoot(context);
-
-      m_lastUsedWalker = m_firstWalker;
-
-      int nextNode = DTM.NULL;
-      AxesWalker walker = getLastUsedWalker();
-      XPathContext execContext = (XPathContext) environment;
-
-      execContext.pushCurrentNodeAndExpression(context, context);
-
-      try
-      {
-        do
-        {
-          while (true)
-          {
-            if (null == walker)
-              break;
-
-            nextNode = walker.getNextNode();
-
-            if (DTM.NULL == nextNode)
-            {
-              walker = walker.m_prevWalker;
-            }
-            else
-            {
-              if (walker.acceptNode(nextNode) != DTMIterator.FILTER_ACCEPT)
-              {
-                continue;
-              }
-
-              if (null == walker.m_nextWalker)
-              {
-                setLastUsedWalker(walker);
-
-                // return walker.returnNextNode(nextNode);
-                break;
-              }
-              else
-              {
-                AxesWalker prev = walker;
-
-                walker = walker.m_nextWalker;
-
-                walker.setRoot(nextNode);
-
-                walker.m_prevWalker = prev;
-
-                continue;
-              }
-            }  // if(null != nextNode)
-          }  // while(null != walker)
-
-          if (DTM.NULL != nextNode)
-          {
-            incrementNextPosition();
-
-            // m_currentContextNode = nextNode;
-            m_cachedNodes.addNodeInDocOrder(nextNode, execContext);
-
-            walker = getLastUsedWalker();
-          }
-        }
-        while (DTM.NULL != nextNode);
-      }
-      finally
-      {
-        execContext.popCurrentNodeAndExpression();
-      }
-
-      // m_prevReturned = nextNode;
-      setNextPosition(0);
-
-      m_last = m_cachedNodes.size();
-      m_lastFetched = DTM.NULL;
-      m_currentContextNode = DTM.NULL;
-      m_foundLast = true;
-    }
-  }
-
-  //  public int nextNode()
-  //  {
-  //    return super.nextNode();
-  //  }
-
-  /**
-   * Reset the iterator.
-   */
-  public void reset()
-  {
-
-    if (m_inNaturalOrder)
-      super.reset();
-    else
-    {
-
-      // super.reset();
-      // m_foundLast = false;
-      m_lastFetched = DTM.NULL;
-      m_next = 0;
-
-      // m_last = 0;
-      if (null != m_firstWalker)
-      {
-        m_lastUsedWalker = m_firstWalker;
-
-        m_firstWalker.setRoot(m_context);
-      }
-    }
-  }
-}
diff --git a/src/org/apache/xpath/axes/package.html b/src/org/apache/xpath/axes/package.html
deleted file mode 100644
index 374be1d..0000000
--- a/src/org/apache/xpath/axes/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <title>XPath LocationPath support.</title>
-  <body>
-    <p>Implementation of XPath LocationPath support -- primary classes are 
-    LocPathIterator and UnionPathIterator.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/compiler/Compiler.java b/src/org/apache/xpath/compiler/Compiler.java
deleted file mode 100644
index 99def8a..0000000
--- a/src/org/apache/xpath/compiler/Compiler.java
+++ /dev/null
@@ -1,1264 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import org.apache.xpath.operations.And;
-import org.apache.xpath.operations.Bool;
-import org.apache.xpath.operations.Div;
-import org.apache.xpath.operations.Equals;
-import org.apache.xpath.operations.Gt;
-import org.apache.xpath.operations.Gte;
-import org.apache.xpath.operations.Lt;
-import org.apache.xpath.operations.Lte;
-import org.apache.xpath.operations.Minus;
-import org.apache.xpath.operations.Mod;
-import org.apache.xpath.operations.Mult;
-import org.apache.xpath.operations.Neg;
-import org.apache.xpath.operations.NotEquals;
-import org.apache.xpath.operations.Operation;
-import org.apache.xpath.operations.Or;
-import org.apache.xpath.operations.Plus;
-import org.apache.xpath.operations.UnaryOperation;
-import org.apache.xpath.operations.Variable;
-import org.apache.xpath.objects.*;
-import org.apache.xpath.axes.*;
-import org.apache.xpath.patterns.*;
-import org.apache.xpath.functions.Function;
-import org.apache.xpath.functions.FuncExtFunction;
-import org.apache.xpath.functions.WrongNumberArgsException;
-import org.apache.xpath.*;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xml.utils.QName;
-import org.apache.xml.utils.PrefixResolver;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.SourceLocator;
-import org.apache.xml.utils.SAXSourceLocator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.Axis;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-
-/**
- * <meta name="usage" content="advanced"/>
- * An instance of this class compiles an XPath string expression into 
- * a Expression object.  This class compiles the string into a sequence 
- * of operation codes (op map) and then builds from that into an Expression 
- * tree.
- */
-public class Compiler extends OpMap
-{
-
-  /**
-   * Construct a Compiler object with a specific ErrorListener and 
-   * SourceLocator where the expression is located.
-   *
-   * @param errorHandler Error listener where messages will be sent, or null 
-   *                     if messages should be sent to System err.
-   * @param locator The location object where the expression lives, which 
-   *                may be null.
-   */
-  public Compiler(ErrorListener errorHandler, SourceLocator locator)
-  {
-    m_errorHandler = errorHandler;
-    if(null != locator)
-    {
-      SAXSourceLocator ssl = new SAXSourceLocator();
-      ssl.setColumnNumber(locator.getColumnNumber());
-      ssl.setLineNumber(locator.getLineNumber());
-      ssl.setPublicId(locator.getPublicId());
-      ssl.setSystemId(locator.getSystemId());
-      m_locator = ssl;
-    }
-  }
-
-  /**
-   * Construct a Compiler instance that has a null error listener and a 
-   * null source locator.
-   */
-  public Compiler()
-  {
-    m_errorHandler = null;
-    m_locator = null;
-  }
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * Execute the XPath object from a given opcode position.
-   * @param xctxt The execution context.
-   * @param context The current source tree context node.
-   * @param opPos The current position in the xpath.m_opMap array.
-   * @param callback Interface that implements the processLocatedNode method.
-   * @param callbackInfo Object that will be passed to the processLocatedNode method.
-   * @return The result of the XPath.
-   *
-   * @throws TransformerException if there is a syntax or other error.
-   */
-  public Expression compile(int opPos) throws TransformerException
-  {
-
-    int op = m_opMap[opPos];
-
-    Expression expr = null;
-    // System.out.println(getPatternString()+"op: "+op);
-    switch (op)
-    {
-    case OpCodes.OP_XPATH :
-      expr = compile(opPos + 2); break;
-    case OpCodes.OP_OR :
-      expr = or(opPos); break;
-    case OpCodes.OP_AND :
-      expr = and(opPos); break;
-    case OpCodes.OP_NOTEQUALS :
-      expr = notequals(opPos); break;
-    case OpCodes.OP_EQUALS :
-      expr = equals(opPos); break;
-    case OpCodes.OP_LTE :
-      expr = lte(opPos); break;
-    case OpCodes.OP_LT :
-      expr = lt(opPos); break;
-    case OpCodes.OP_GTE :
-      expr = gte(opPos); break;
-    case OpCodes.OP_GT :
-      expr = gt(opPos); break;
-    case OpCodes.OP_PLUS :
-      expr = plus(opPos); break;
-    case OpCodes.OP_MINUS :
-      expr = minus(opPos); break;
-    case OpCodes.OP_MULT :
-      expr = mult(opPos); break;
-    case OpCodes.OP_DIV :
-      expr = div(opPos); break;
-    case OpCodes.OP_MOD :
-      expr = mod(opPos); break;
-//    case OpCodes.OP_QUO :
-//      expr = quo(opPos); break;
-    case OpCodes.OP_NEG :
-      expr = neg(opPos); break;
-    case OpCodes.OP_STRING :
-      expr = string(opPos); break;
-    case OpCodes.OP_BOOL :
-      expr = bool(opPos); break;
-    case OpCodes.OP_NUMBER :
-      expr = number(opPos); break;
-    case OpCodes.OP_UNION :
-      expr = union(opPos); break;
-    case OpCodes.OP_LITERAL :
-      expr = literal(opPos); break;
-    case OpCodes.OP_VARIABLE :
-      expr = variable(opPos); break;
-    case OpCodes.OP_GROUP :
-      expr = group(opPos); break;
-    case OpCodes.OP_NUMBERLIT :
-      expr = numberlit(opPos); break;
-    case OpCodes.OP_ARGUMENT :
-      expr = arg(opPos); break;
-    case OpCodes.OP_EXTFUNCTION :
-      expr = compileExtension(opPos); break;
-    case OpCodes.OP_FUNCTION :
-      expr = compileFunction(opPos); break;
-    case OpCodes.OP_LOCATIONPATH :
-      expr = locationPath(opPos); break;
-    case OpCodes.OP_PREDICATE :
-      expr = null; break;  // should never hit this here.
-    case OpCodes.OP_MATCHPATTERN :
-      expr = matchPattern(opPos + 2); break;
-    case OpCodes.OP_LOCATIONPATHPATTERN :
-      expr = locationPathPattern(opPos); break;
-    case OpCodes.OP_QUO:
-      error(XPATHErrorResources.ER_UNKNOWN_OPCODE,
-            new Object[]{ "quo" });  //"ERROR! Unknown op code: "+m_opMap[opPos]);
-      break;
-    default :
-      error(XPATHErrorResources.ER_UNKNOWN_OPCODE,
-            new Object[]{ Integer.toString(m_opMap[opPos]) });  //"ERROR! Unknown op code: "+m_opMap[opPos]);
-    }
-    if(null != expr)
-      expr.setSourceLocator(m_locator);
-
-    return expr;
-  }
-
-  /**
-   * Bottle-neck compilation of an operation with left and right operands.
-   *
-   * @param operation non-null reference to parent operation.
-   * @param opPos The op map position of the parent operation.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Operation} instance.
-   *
-   * @throws TransformerException if there is a syntax or other error.
-   */
-  private Expression compileOperation(Operation operation, int opPos)
-          throws TransformerException
-  {
-
-    int leftPos = getFirstChildPos(opPos);
-    int rightPos = getNextOpPos(leftPos);
-
-    operation.setLeftRight(compile(leftPos), compile(rightPos));
-
-    return operation;
-  }
-
-  /**
-   * Bottle-neck compilation of a unary operation.
-   *
-   * @param unary The parent unary operation.
-   * @param opPos The position in the op map of the parent operation.
-   *
-   * @return The unary argument.
-   *
-   * @throws TransformerException if syntax or other error occurs.
-   */
-  private Expression compileUnary(UnaryOperation unary, int opPos)
-          throws TransformerException
-  {
-
-    int rightPos = getFirstChildPos(opPos);
-
-    unary.setRight(compile(rightPos));
-
-    return unary;
-  }
-
-  /**
-   * Compile an 'or' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Or} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression or(int opPos) throws TransformerException
-  {
-    return compileOperation(new Or(), opPos);
-  }
-
-  /**
-   * Compile an 'and' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.And} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression and(int opPos) throws TransformerException
-  {
-    return compileOperation(new And(), opPos);
-  }
-
-  /**
-   * Compile a '!=' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.NotEquals} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression notequals(int opPos) throws TransformerException
-  {
-    return compileOperation(new NotEquals(), opPos);
-  }
-
-  /**
-   * Compile a '=' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Equals} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression equals(int opPos) throws TransformerException
-  {
-    return compileOperation(new Equals(), opPos);
-  }
-
-  /**
-   * Compile a '<=' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Lte} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression lte(int opPos) throws TransformerException
-  {
-    return compileOperation(new Lte(), opPos);
-  }
-
-  /**
-   * Compile a '<' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Lt} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression lt(int opPos) throws TransformerException
-  {
-    return compileOperation(new Lt(), opPos);
-  }
-
-  /**
-   * Compile a '>=' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Gte} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression gte(int opPos) throws TransformerException
-  {
-    return compileOperation(new Gte(), opPos);
-  }
-
-  /**
-   * Compile a '>' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Gt} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression gt(int opPos) throws TransformerException
-  {
-    return compileOperation(new Gt(), opPos);
-  }
-
-  /**
-   * Compile a '+' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Plus} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression plus(int opPos) throws TransformerException
-  {
-    return compileOperation(new Plus(), opPos);
-  }
-
-  /**
-   * Compile a '-' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Minus} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression minus(int opPos) throws TransformerException
-  {
-    return compileOperation(new Minus(), opPos);
-  }
-
-  /**
-   * Compile a '*' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Mult} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression mult(int opPos) throws TransformerException
-  {
-    return compileOperation(new Mult(), opPos);
-  }
-
-  /**
-   * Compile a 'div' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Div} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression div(int opPos) throws TransformerException
-  {
-    return compileOperation(new Div(), opPos);
-  }
-
-  /**
-   * Compile a 'mod' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Mod} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression mod(int opPos) throws TransformerException
-  {
-    return compileOperation(new Mod(), opPos);
-  }
-
-  /*
-   * Compile a 'quo' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Quo} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-//  protected Expression quo(int opPos) throws TransformerException
-//  {
-//    return compileOperation(new Quo(), opPos);
-//  }
-
-  /**
-   * Compile a unary '-' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Neg} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression neg(int opPos) throws TransformerException
-  {
-    return compileUnary(new Neg(), opPos);
-  }
-
-  /**
-   * Compile a 'string(...)' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.String} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression string(int opPos) throws TransformerException
-  {
-    return compileUnary(new org.apache.xpath.operations.String(), opPos);
-  }
-
-  /**
-   * Compile a 'boolean(...)' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Bool} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression bool(int opPos) throws TransformerException
-  {
-    return compileUnary(new org.apache.xpath.operations.Bool(), opPos);
-  }
-
-  /**
-   * Compile a 'number(...)' operation.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Number} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression number(int opPos) throws TransformerException
-  {
-    return compileUnary(new org.apache.xpath.operations.Number(), opPos);
-  }
-
-  /**
-   * Compile a literal string value.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.objects.XString} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression literal(int opPos)
-  {
-
-    opPos = getFirstChildPos(opPos);
-
-    return (XString) m_tokenQueue[m_opMap[opPos]];
-  }
-
-  /**
-   * Compile a literal number value.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.objects.XNumber} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression numberlit(int opPos)
-  {
-
-    opPos = getFirstChildPos(opPos);
-
-    return (XNumber) m_tokenQueue[m_opMap[opPos]];
-  }
-
-  /**
-   * Compile a variable reference.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.operations.Variable} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression variable(int opPos) throws TransformerException
-  {
-
-    Variable var = new Variable();
-
-    opPos = getFirstChildPos(opPos);
-
-    int nsPos = m_opMap[opPos];
-    java.lang.String namespace 
-      = (OpCodes.EMPTY == nsPos) ? null 
-                                   : (java.lang.String) m_tokenQueue[nsPos];
-    java.lang.String localname 
-      = (java.lang.String) m_tokenQueue[m_opMap[opPos+1]];
-    QName qname = new QName(namespace, localname);
-
-    var.setQName(qname);
-
-    return var;
-  }
-
-  /**
-   * Compile an expression group.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to the contained expression.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression group(int opPos) throws TransformerException
-  {
-
-    // no-op
-    return compile(opPos + 2);
-  }
-
-  /**
-   * Compile a function argument.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to the argument expression.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression arg(int opPos) throws TransformerException
-  {
-
-    // no-op
-    return compile(opPos + 2);
-  }
-
-  /**
-   * Compile a location path union. The UnionPathIterator itself may create
-   * {@link org.apache.xpath.axes.LocPathIterator} children.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.axes.UnionPathIterator} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression union(int opPos) throws TransformerException
-  {
-    locPathDepth++;
-    try
-    {
-      return new UnionPathIterator(this, opPos);
-    }
-    finally
-    {
-      locPathDepth--;
-    }
-  }
-  
-  private int locPathDepth = -1;
-  
-  /**
-   * Get the level of the location path or union being constructed.  
-   * @return 0 if it is a top-level path.
-   */
-  public int getLocationPathDepth()
-  {
-    return locPathDepth;
-  }
-
-  /**
-   * Compile a location path.  The LocPathIterator itself may create
-   * {@link org.apache.xpath.axes.AxesWalker} children.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.axes.LocPathIterator} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  public Expression locationPath(int opPos) throws TransformerException
-  {
-    locPathDepth++;
-    try
-    {
-      DTMIterator iter = WalkerFactory.newDTMIterator(this, opPos, (locPathDepth == 0));
-      return (Expression)iter; // cast OK, I guess.
-    }
-    finally
-    {
-      locPathDepth--;
-    }
-  }
-
-  /**
-   * Compile a location step predicate expression.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return the contained predicate expression.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  public Expression predicate(int opPos) throws TransformerException
-  {
-    return compile(opPos + 2);
-  }
-
-  /**
-   * Compile an entire match pattern expression.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.patterns.UnionPattern} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected Expression matchPattern(int opPos) throws TransformerException
-  {
-
-    // First, count...
-    int nextOpPos = opPos;
-    int i;
-
-    for (i = 0; m_opMap[nextOpPos] == OpCodes.OP_LOCATIONPATHPATTERN; i++)
-    {
-      nextOpPos = getNextOpPos(nextOpPos);
-    }
-
-    if (i == 1)
-      return compile(opPos);
-
-    UnionPattern up = new UnionPattern();
-    StepPattern[] patterns = new StepPattern[i];
-
-    for (i = 0; m_opMap[opPos] == OpCodes.OP_LOCATIONPATHPATTERN; i++)
-    {
-      nextOpPos = getNextOpPos(opPos);
-      patterns[i] = (StepPattern) compile(opPos);
-      opPos = nextOpPos;
-    }
-
-    up.setPatterns(patterns);
-
-    return up;
-  }
-
-  /**
-   * Compile a location match pattern unit expression.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.patterns.StepPattern} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  public Expression locationPathPattern(int opPos)
-          throws TransformerException
-  {
-
-    opPos = getFirstChildPos(opPos);
-
-    return stepPattern(opPos, 0, null);
-  }
-
-  /**
-   * Get a {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what 
-   * to show for a given node test.
-   *
-   * @param opPos the op map position for the location step.
-   *
-   * @return {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what 
-   *         to show for a given node test.
-   */
-  public int getWhatToShow(int opPos)
-  {
-
-    int axesType = getOp(opPos);
-    int testType = getOp(opPos + 3);
-
-    // System.out.println("testType: "+testType);
-    switch (testType)
-    {
-    case OpCodes.NODETYPE_COMMENT :
-      return DTMFilter.SHOW_COMMENT;
-    case OpCodes.NODETYPE_TEXT :
-//      return DTMFilter.SHOW_TEXT | DTMFilter.SHOW_COMMENT;
-      return DTMFilter.SHOW_TEXT | DTMFilter.SHOW_CDATA_SECTION ;
-    case OpCodes.NODETYPE_PI :
-      return DTMFilter.SHOW_PROCESSING_INSTRUCTION;
-    case OpCodes.NODETYPE_NODE :
-//      return DTMFilter.SHOW_ALL;
-      switch (axesType)
-      {
-      case OpCodes.FROM_NAMESPACE:
-        return DTMFilter.SHOW_NAMESPACE;
-      case OpCodes.FROM_ATTRIBUTES :
-      case OpCodes.MATCH_ATTRIBUTE :
-        return DTMFilter.SHOW_ATTRIBUTE;
-      case OpCodes.FROM_SELF:
-      case OpCodes.FROM_ANCESTORS_OR_SELF:
-      case OpCodes.FROM_DESCENDANTS_OR_SELF:
-        return DTMFilter.SHOW_ALL;
-      default:
-        if (getOp(0) == OpCodes.OP_MATCHPATTERN)
-          return ~DTMFilter.SHOW_ATTRIBUTE
-                  & ~DTMFilter.SHOW_DOCUMENT
-                  & ~DTMFilter.SHOW_DOCUMENT_FRAGMENT;
-        else
-          return ~DTMFilter.SHOW_ATTRIBUTE;
-      }
-    case OpCodes.NODETYPE_ROOT :
-      return DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT;
-    case OpCodes.NODETYPE_FUNCTEST :
-      return NodeTest.SHOW_BYFUNCTION;
-    case OpCodes.NODENAME :
-      switch (axesType)
-      {
-      case OpCodes.FROM_NAMESPACE :
-        return DTMFilter.SHOW_NAMESPACE;
-      case OpCodes.FROM_ATTRIBUTES :
-      case OpCodes.MATCH_ATTRIBUTE :
-        return DTMFilter.SHOW_ATTRIBUTE;
-
-      // break;
-      case OpCodes.MATCH_ANY_ANCESTOR :
-      case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
-        return DTMFilter.SHOW_ELEMENT;
-
-      // break;
-      default :
-        return DTMFilter.SHOW_ELEMENT;
-      }
-    default :
-      // System.err.println("We should never reach here.");
-      return DTMFilter.SHOW_ALL;
-    }
-  }
-  
-private static final boolean DEBUG = false;
-
-  /**
-   * Compile a step pattern unit expression, used for both location paths 
-   * and match patterns.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   * @param stepCount The number of steps to expect.
-   * @param ancestorPattern The owning StepPattern, which may be null.
-   *
-   * @return reference to {@link org.apache.xpath.patterns.StepPattern} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  protected StepPattern stepPattern(
-          int opPos, int stepCount, StepPattern ancestorPattern)
-            throws TransformerException
-  {
-
-    int startOpPos = opPos;
-    int stepType = getOpMap()[opPos];
-
-    if (OpCodes.ENDOP == stepType)
-    {
-      return null;
-    }
-    
-    boolean addMagicSelf = true;
-
-    int endStep = getNextOpPos(opPos);
-
-    // int nextStepType = getOpMap()[endStep];
-    StepPattern pattern;
-    
-    // boolean isSimple = ((OpCodes.ENDOP == nextStepType) && (stepCount == 0));
-    int argLen;
-
-    switch (stepType)
-    {
-    case OpCodes.OP_FUNCTION :
-      if(DEBUG)
-        System.out.println("MATCH_FUNCTION: "+m_currentPattern); 
-      addMagicSelf = false;
-      argLen = m_opMap[opPos + OpMap.MAPINDEX_LENGTH];
-      pattern = new FunctionPattern(compileFunction(opPos), Axis.PARENT, Axis.CHILD);
-      break;
-    case OpCodes.FROM_ROOT :
-      if(DEBUG)
-        System.out.println("FROM_ROOT, "+m_currentPattern);
-      addMagicSelf = false;
-      argLen = getArgLengthOfStep(opPos);
-      opPos = getFirstChildPosOfStep(opPos);
-      pattern = new StepPattern(DTMFilter.SHOW_DOCUMENT | 
-                                DTMFilter.SHOW_DOCUMENT_FRAGMENT,
-                                Axis.PARENT, Axis.CHILD);
-      break;
-    case OpCodes.MATCH_ATTRIBUTE :
-     if(DEBUG)
-        System.out.println("MATCH_ATTRIBUTE: "+getStepLocalName(startOpPos)+", "+m_currentPattern);
-      argLen = getArgLengthOfStep(opPos);
-      opPos = getFirstChildPosOfStep(opPos);
-      pattern = new StepPattern(DTMFilter.SHOW_ATTRIBUTE,
-                                getStepNS(startOpPos),
-                                getStepLocalName(startOpPos),
-                                Axis.PARENT, Axis.ATTRIBUTE);
-      break;
-    case OpCodes.MATCH_ANY_ANCESTOR :
-      if(DEBUG)
-        System.out.println("MATCH_ANY_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern);
-      argLen = getArgLengthOfStep(opPos);
-      opPos = getFirstChildPosOfStep(opPos);
-      int what = getWhatToShow(startOpPos);
-      // bit-o-hackery, but this code is due for the morgue anyway...
-      if(0x00000500 == what)
-        addMagicSelf = false;
-      pattern = new StepPattern(getWhatToShow(startOpPos),
-                                        getStepNS(startOpPos),
-                                        getStepLocalName(startOpPos),
-                                        Axis.ANCESTOR, Axis.CHILD);
-      break;
-    case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
-      if(DEBUG)
-        System.out.println("MATCH_IMMEDIATE_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern);
-      argLen = getArgLengthOfStep(opPos);
-      opPos = getFirstChildPosOfStep(opPos);
-      pattern = new StepPattern(getWhatToShow(startOpPos),
-                                getStepNS(startOpPos),
-                                getStepLocalName(startOpPos),
-                                Axis.PARENT, Axis.CHILD);
-      break;
-    default :
-      error(XPATHErrorResources.ER_UNKNOWN_MATCH_OPERATION, null);  //"unknown match operation!");
-
-      return null;
-    }
-
-    pattern.setPredicates(getCompiledPredicates(opPos + argLen));
-    if(null == ancestorPattern)
-    {
-      // This is the magic and invisible "." at the head of every 
-      // match pattern, and corresponds to the current node in the context 
-      // list, from where predicates are counted.
-      // So, in order to calculate "foo[3]", it has to count from the 
-      // current node in the context list, so, from that current node, 
-      // the full pattern is really "self::node()/child::foo[3]".  If you 
-      // translate this to a select pattern from the node being tested, 
-      // which is really how we're treating match patterns, it works out to 
-      // self::foo/parent::node[child::foo[3]]", or close enough.
-	/*      if(addMagicSelf && pattern.getPredicateCount() > 0)
-      {
-        StepPattern selfPattern = new StepPattern(DTMFilter.SHOW_ALL, 
-                                                  Axis.PARENT, Axis.CHILD);
-        // We need to keep the new nodetest from affecting the score...
-        XNumber score = pattern.getStaticScore();
-        pattern.setRelativePathPattern(selfPattern);
-        pattern.setStaticScore(score);
-        selfPattern.setStaticScore(score);
-	}*/
-    }
-    else
-    {
-      // System.out.println("Setting "+ancestorPattern+" as relative to "+pattern);
-      pattern.setRelativePathPattern(ancestorPattern);
-    }
-
-    StepPattern relativePathPattern = stepPattern(endStep, stepCount + 1,
-                                        pattern);
-
-    return (null != relativePathPattern) ? relativePathPattern : pattern;
-  }
-
-  /**
-   * Compile a zero or more predicates for a given match pattern.
-   * 
-   * @param opPos The position of the first predicate the m_opMap array.
-   *
-   * @return reference to array of {@link org.apache.xpath.Expression} instances.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  public Expression[] getCompiledPredicates(int opPos)
-          throws TransformerException
-  {
-
-    int count = countPredicates(opPos);
-
-    if (count > 0)
-    {
-      Expression[] predicates = new Expression[count];
-
-      compilePredicates(opPos, predicates);
-
-      return predicates;
-    }
-
-    return null;
-  }
-
-  /**
-   * Count the number of predicates in the step.
-   *
-   * @param opPos The position of the first predicate the m_opMap array.
-   *
-   * @return The number of predicates for this step.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  public int countPredicates(int opPos) throws TransformerException
-  {
-
-    int count = 0;
-
-    while (OpCodes.OP_PREDICATE == getOp(opPos))
-    {
-      count++;
-
-      opPos = getNextOpPos(opPos);
-    }
-
-    return count;
-  }
-
-  /**
-   * Compiles predicates in the step.
-   *
-   * @param opPos The position of the first predicate the m_opMap array.
-   * @param predicates An empty pre-determined array of 
-   *            {@link org.apache.xpath.Expression}s, that will be filled in.
-   *
-   * @throws TransformerException
-   */
-  private void compilePredicates(int opPos, Expression[] predicates)
-          throws TransformerException
-  {
-
-    for (int i = 0; OpCodes.OP_PREDICATE == getOp(opPos); i++)
-    {
-      predicates[i] = predicate(opPos);
-      opPos = getNextOpPos(opPos);
-    }
-  }
-
-  /**
-   * Compile a built-in XPath function.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.functions.Function} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  Expression compileFunction(int opPos) throws TransformerException
-  {
-
-    int endFunc = opPos + m_opMap[opPos + 1] - 1;
-
-    opPos = getFirstChildPos(opPos);
-
-    int funcID = m_opMap[opPos];
-
-    opPos++;
-
-    if (-1 != funcID)
-    {
-      Function func = FunctionTable.getFunction(funcID);
-
-      try
-      {
-        int i = 0;
-
-        for (int p = opPos; p < endFunc; p = getNextOpPos(p), i++)
-        {
-
-          // System.out.println("argPos: "+ p);
-          // System.out.println("argCode: "+ m_opMap[p]);
-          func.setArg(compile(p), i);
-        }
-
-        func.checkNumberArgs(i);
-      }
-      catch (WrongNumberArgsException wnae)
-      {
-        java.lang.String name = FunctionTable.m_functions[funcID].getName();
-
-        m_errorHandler.fatalError( new TransformerException(name + " only allows " + wnae.getMessage()
-                               + " arguments", m_locator));
-      }
-
-      return func;
-    }
-    else
-    {
-      error(XPATHErrorResources.ER_FUNCTION_TOKEN_NOT_FOUND, null);  //"function token not found.");
-
-      return null;
-    }
-  }
-
-  /**
-   * Compile an extension function.
-   * 
-   * @param opPos The current position in the m_opMap array.
-   *
-   * @return reference to {@link org.apache.xpath.functions.FuncExtFunction} instance.
-   *
-   * @throws TransformerException if a error occurs creating the Expression.
-   */
-  private Expression compileExtension(int opPos)
-          throws TransformerException
-  {
-
-    int endExtFunc = opPos + m_opMap[opPos + 1] - 1;
-
-    opPos = getFirstChildPos(opPos);
-
-    java.lang.String ns = (java.lang.String) m_tokenQueue[m_opMap[opPos]];
-
-    opPos++;
-
-    java.lang.String funcName =
-      (java.lang.String) m_tokenQueue[m_opMap[opPos]];
-
-    opPos++;
-
-    // We create a method key to uniquely identify this function so that we
-    // can cache the object needed to invoke it.  This way, we only pay the
-    // reflection overhead on the first call.
-
-    Function extension = new FuncExtFunction(ns, funcName, 
-         String.valueOf(opPos)
-       + String.valueOf(hashCode())
-       + String.valueOf(System.currentTimeMillis()));
-
-    try
-    {
-      int i = 0;
-
-      while (opPos < endExtFunc)
-      {
-        int nextOpPos = getNextOpPos(opPos);
-
-        extension.setArg(this.compile(opPos), i);
-
-        opPos = nextOpPos;
-
-        i++;
-      }
-    }
-    catch (WrongNumberArgsException wnae)
-    {
-      ;  // should never happen
-    }
-
-    return extension;
-  }
-
-  /**
-   * Warn the user of an problem.
-   *
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  public void warn(int msg, Object[] args) throws TransformerException
-  {
-
-    java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args);
-
-    if (null != m_errorHandler)
-    {
-      m_errorHandler.warning(new TransformerException(fmsg, m_locator));
-    }
-    else
-    {
-      System.out.println(fmsg
-                          +"; file "+m_locator.getSystemId()
-                          +"; line "+m_locator.getLineNumber()
-                          +"; column "+m_locator.getColumnNumber());
-    }
-  }
-
-  /**
-   * Tell the user of an assertion error, and probably throw an
-   * exception.
-   *
-   * @param b  If false, a runtime exception will be thrown.
-   * @param msg The assertion message, which should be informative.
-   * 
-   * @throws RuntimeException if the b argument is false.
-   */
-  public void assertion(boolean b, java.lang.String msg)
-  {
-
-    if (!b)
-    {
-      java.lang.String fMsg = XSLMessages.createXPATHMessage(
-        XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
-        new Object[]{ msg });
-
-      throw new RuntimeException(fMsg);
-    }
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  public void error(int msg, Object[] args) throws TransformerException
-  {
-
-    java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args);
-    
-
-    if (null != m_errorHandler)
-    {
-      m_errorHandler.fatalError(new TransformerException(fmsg, m_locator));
-    }
-    else
-    {
-
-      // System.out.println(te.getMessage()
-      //                    +"; file "+te.getSystemId()
-      //                    +"; line "+te.getLineNumber()
-      //                    +"; column "+te.getColumnNumber());
-      throw new TransformerException(fmsg, (SAXSourceLocator)m_locator);
-    }
-  }
-
-  /**
-   * The current prefixResolver for the execution context.
-   */
-  private PrefixResolver m_currentPrefixResolver = null;
-
-  /**
-   * Get the current namespace context for the xpath.
-   *
-   * @return The current prefix resolver, *may* be null, though hopefully not.
-   */
-  public PrefixResolver getNamespaceContext()
-  {
-    return m_currentPrefixResolver;
-  }
-
-  /**
-   * Set the current namespace context for the xpath.
-   *
-   * @param pr The resolver for prefixes in the XPath expression.
-   */
-  public void setNamespaceContext(PrefixResolver pr)
-  {
-    m_currentPrefixResolver = pr;
-  }
-
-  /** The error listener where errors will be sent.  If this is null, errors 
-   *  and warnings will be sent to System.err.  May be null.    */
-  ErrorListener m_errorHandler;
-
-  /** The source locator for the expression being compiled.  May be null. */
-  SourceLocator m_locator;
-}
diff --git a/src/org/apache/xpath/compiler/FuncLoader.java b/src/org/apache/xpath/compiler/FuncLoader.java
deleted file mode 100644
index 0f63989..0000000
--- a/src/org/apache/xpath/compiler/FuncLoader.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import java.lang.Class;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.functions.Function;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Lazy load of functions into the function table as needed, so we don't 
- * have to load all the functions allowed in XPath and XSLT on startup.
- */
-public class FuncLoader
-{
-
-  /** The function ID, which may correspond to one of the FUNC_XXX values 
-   *  found in {@link org.apache.xpath.compiler.FunctionTable}, but may 
-   *  be a value installed by an external module.  */
-  private int m_funcID;
-
-  /** The class name of the function.  Must not be null.   */
-  private String m_funcName;
-
-  /**
-   * Get the local class name of the function class.  If function name does 
-   * not have a '.' in it, it is assumed to be relative to 
-   * 'org.apache.xpath.functions'.
-   *
-   * @return The class name of the {org.apache.xpath.functions.Function} class.
-   */
-  public String getName()
-  {
-    return m_funcName;
-  }
-
-  /**
-   * Construct a function loader
-   *
-   * @param funcName The class name of the {org.apache.xpath.functions.Function} 
-   *             class, which, if it does not have a '.' in it, is assumed to 
-   *             be relative to 'org.apache.xpath.functions'. 
-   * @param funcID  The function ID, which may correspond to one of the FUNC_XXX 
-   *    values found in {@link org.apache.xpath.compiler.FunctionTable}, but may 
-   *    be a value installed by an external module. 
-   */
-  public FuncLoader(String funcName, int funcID)
-  {
-
-    super();
-
-    m_funcID = funcID;
-    m_funcName = funcName;
-  }
-
-  /**
-   * Get a Function instance that this instance is liaisoning for.
-   *
-   * @return non-null reference to Function derivative.
-   *
-   * @throws javax.xml.transform.TransformerException if ClassNotFoundException, 
-   *    IllegalAccessException, or InstantiationException is thrown.
-   */
-  public Function getFunction() throws javax.xml.transform.TransformerException
-  {
-
-    try
-    {
-      Class function;
-
-      // first get package name if necessary
-      if (m_funcName.indexOf(".") < 0)
-      {
-
-        // String thisName = this.getClass().getName();
-        // int lastdot = thisName.lastIndexOf(".");
-        // String classname = thisName.substring(0,lastdot+1) + m_funcName; 
-        String classname = "org.apache.xpath.functions." + m_funcName;
-
-        function = Class.forName(classname);
-      }
-      else
-        function = Class.forName(m_funcName);
-
-      Function func = (Function) function.newInstance();
-
-      return func;
-    }
-    catch (ClassNotFoundException e)
-    {
-      throw new javax.xml.transform.TransformerException(e);
-    }
-    catch (IllegalAccessException e)
-    {
-      throw new javax.xml.transform.TransformerException(e);
-    }
-    catch (InstantiationException e)
-    {
-      throw new javax.xml.transform.TransformerException(e);
-    }
-  }
-}
diff --git a/src/org/apache/xpath/compiler/FunctionTable.java b/src/org/apache/xpath/compiler/FunctionTable.java
deleted file mode 100644
index 40f4878..0000000
--- a/src/org/apache/xpath/compiler/FunctionTable.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.functions.Function;
-
-/**
- * The function table for XPath.
- */
-public class FunctionTable
-{
-
-  /** The 'current()' id. */
-  public static final int FUNC_CURRENT = 0;
-
-  /** The 'last()' id. */
-  public static final int FUNC_LAST = 1;
-
-  /** The 'position()' id. */
-  public static final int FUNC_POSITION = 2;
-
-  /** The 'count()' id. */
-  public static final int FUNC_COUNT = 3;
-
-  /** The 'id()' id. */
-  public static final int FUNC_ID = 4;
-
-  /** The 'key()' id (XSLT). */
-  public static final int FUNC_KEY = 5;
-
-  /** The 'local-name()' id. */
-  public static final int FUNC_LOCAL_PART = 7;
-
-  /** The 'namespace-uri()' id. */
-  public static final int FUNC_NAMESPACE = 8;
-
-  /** The 'name()' id. */
-  public static final int FUNC_QNAME = 9;
-
-  /** The 'generate-id()' id. */
-  public static final int FUNC_GENERATE_ID = 10;
-
-  /** The 'not()' id. */
-  public static final int FUNC_NOT = 11;
-
-  /** The 'true()' id. */
-  public static final int FUNC_TRUE = 12;
-
-  /** The 'false()' id. */
-  public static final int FUNC_FALSE = 13;
-
-  /** The 'boolean()' id. */
-  public static final int FUNC_BOOLEAN = 14;
-
-  /** The 'number()' id. */
-  public static final int FUNC_NUMBER = 15;
-
-  /** The 'floor()' id. */
-  public static final int FUNC_FLOOR = 16;
-
-  /** The 'ceiling()' id. */
-  public static final int FUNC_CEILING = 17;
-
-  /** The 'round()' id. */
-  public static final int FUNC_ROUND = 18;
-
-  /** The 'sum()' id. */
-  public static final int FUNC_SUM = 19;
-
-  /** The 'string()' id. */
-  public static final int FUNC_STRING = 20;
-
-  /** The 'starts-with()' id. */
-  public static final int FUNC_STARTS_WITH = 21;
-
-  /** The 'contains()' id. */
-  public static final int FUNC_CONTAINS = 22;
-
-  /** The 'substring-before()' id. */
-  public static final int FUNC_SUBSTRING_BEFORE = 23;
-
-  /** The 'substring-after()' id. */
-  public static final int FUNC_SUBSTRING_AFTER = 24;
-
-  /** The 'normalize-space()' id. */
-  public static final int FUNC_NORMALIZE_SPACE = 25;
-
-  /** The 'translate()' id. */
-  public static final int FUNC_TRANSLATE = 26;
-
-  /** The 'concat()' id. */
-  public static final int FUNC_CONCAT = 27;
-
-  /** The 'substring()' id. */
-  public static final int FUNC_SUBSTRING = 29;
-
-  /** The 'string-length()' id. */
-  public static final int FUNC_STRING_LENGTH = 30;
-
-  /** The 'system-property()' id. */
-  public static final int FUNC_SYSTEM_PROPERTY = 31;
-
-  /** The 'lang()' id. */
-  public static final int FUNC_LANG = 32;
-
-  /** The 'function-available()' id (XSLT). */
-  public static final int FUNC_EXT_FUNCTION_AVAILABLE = 33;
-
-  /** The 'element-available()' id (XSLT). */
-  public static final int FUNC_EXT_ELEM_AVAILABLE = 34;
-
-  /** The 'unparsed-entity-uri()' id (XSLT). */
-  public static final int FUNC_UNPARSED_ENTITY_URI = 36;
-
-  // Proprietary
-
-  /** The 'document-location()' id (Proprietary). */
-  public static final int FUNC_DOCLOCATION = 35;
-
-  /**
-   * The function table.
-   */
-  public static FuncLoader m_functions[];
-
-  /**
-   * Number of built in functions.  Be sure to update this as
-   * built-in functions are added.
-   */
-  private static final int NUM_BUILT_IN_FUNCS = 37;
-
-  /**
-   * Number of built-in functions that may be added.
-   */
-  private static final int NUM_ALLOWABLE_ADDINS = 30;
-
-  /**
-   * The index to the next free function index.
-   */
-  static int m_funcNextFreeIndex = NUM_BUILT_IN_FUNCS;
-
-  static
-  {
-    m_functions = new FuncLoader[NUM_BUILT_IN_FUNCS + NUM_ALLOWABLE_ADDINS];
-    m_functions[FUNC_CURRENT] = new FuncLoader("FuncCurrent", FUNC_CURRENT);
-    m_functions[FUNC_LAST] = new FuncLoader("FuncLast", FUNC_LAST);
-    m_functions[FUNC_POSITION] = new FuncLoader("FuncPosition",
-                                                FUNC_POSITION);
-    m_functions[FUNC_COUNT] = new FuncLoader("FuncCount", FUNC_COUNT);
-    m_functions[FUNC_ID] = new FuncLoader("FuncId", FUNC_ID);
-    m_functions[FUNC_KEY] =
-      new FuncLoader("org.apache.xalan.templates.FuncKey", FUNC_KEY);
-
-    // m_functions[FUNC_DOC] = new FuncDoc();
-    m_functions[FUNC_LOCAL_PART] = new FuncLoader("FuncLocalPart",
-            FUNC_LOCAL_PART);
-    m_functions[FUNC_NAMESPACE] = new FuncLoader("FuncNamespace",
-            FUNC_NAMESPACE);
-    m_functions[FUNC_QNAME] = new FuncLoader("FuncQname", FUNC_QNAME);
-    m_functions[FUNC_GENERATE_ID] = new FuncLoader("FuncGenerateId",
-            FUNC_GENERATE_ID);
-    m_functions[FUNC_NOT] = new FuncLoader("FuncNot", FUNC_NOT);
-    m_functions[FUNC_TRUE] = new FuncLoader("FuncTrue", FUNC_TRUE);
-    m_functions[FUNC_FALSE] = new FuncLoader("FuncFalse", FUNC_FALSE);
-    m_functions[FUNC_BOOLEAN] = new FuncLoader("FuncBoolean", FUNC_BOOLEAN);
-    m_functions[FUNC_LANG] = new FuncLoader("FuncLang", FUNC_LANG);
-    m_functions[FUNC_NUMBER] = new FuncLoader("FuncNumber", FUNC_NUMBER);
-    m_functions[FUNC_FLOOR] = new FuncLoader("FuncFloor", FUNC_FLOOR);
-    m_functions[FUNC_CEILING] = new FuncLoader("FuncCeiling", FUNC_CEILING);
-    m_functions[FUNC_ROUND] = new FuncLoader("FuncRound", FUNC_ROUND);
-    m_functions[FUNC_SUM] = new FuncLoader("FuncSum", FUNC_SUM);
-    m_functions[FUNC_STRING] = new FuncLoader("FuncString", FUNC_STRING);
-    m_functions[FUNC_STARTS_WITH] = new FuncLoader("FuncStartsWith",
-            FUNC_STARTS_WITH);
-    m_functions[FUNC_CONTAINS] = new FuncLoader("FuncContains",
-                                                FUNC_CONTAINS);
-    m_functions[FUNC_SUBSTRING_BEFORE] = new FuncLoader("FuncSubstringBefore",
-            FUNC_SUBSTRING_BEFORE);
-    m_functions[FUNC_SUBSTRING_AFTER] = new FuncLoader("FuncSubstringAfter",
-            FUNC_SUBSTRING_AFTER);
-    m_functions[FUNC_NORMALIZE_SPACE] = new FuncLoader("FuncNormalizeSpace",
-            FUNC_NORMALIZE_SPACE);
-    m_functions[FUNC_TRANSLATE] = new FuncLoader("FuncTranslate",
-            FUNC_TRANSLATE);
-    m_functions[FUNC_CONCAT] = new FuncLoader("FuncConcat", FUNC_CONCAT);
-
-    //m_functions[FUNC_FORMAT_NUMBER] = new FuncFormatNumber();
-    m_functions[FUNC_SYSTEM_PROPERTY] = new FuncLoader("FuncSystemProperty",
-            FUNC_SYSTEM_PROPERTY);
-    m_functions[FUNC_EXT_FUNCTION_AVAILABLE] =
-      new FuncLoader("FuncExtFunctionAvailable", FUNC_EXT_FUNCTION_AVAILABLE);
-    m_functions[FUNC_EXT_ELEM_AVAILABLE] =
-      new FuncLoader("FuncExtElementAvailable", FUNC_EXT_ELEM_AVAILABLE);
-    m_functions[FUNC_SUBSTRING] = new FuncLoader("FuncSubstring",
-            FUNC_SUBSTRING);
-    m_functions[FUNC_STRING_LENGTH] = new FuncLoader("FuncStringLength",
-            FUNC_STRING_LENGTH);
-    m_functions[FUNC_DOCLOCATION] = new FuncLoader("FuncDoclocation",
-            FUNC_DOCLOCATION);
-    m_functions[FUNC_UNPARSED_ENTITY_URI] =
-      new FuncLoader("FuncUnparsedEntityURI", FUNC_UNPARSED_ENTITY_URI);
-  }
-
-  /**
-   * Obtain a new Function object from a function ID.
-   *
-   * @param which  The function ID, which may correspond to one of the FUNC_XXX 
-   *    values found in {@link org.apache.xpath.compiler.FunctionTable}, but may 
-   *    be a value installed by an external module. 
-   *
-   * @return a a new Function instance.
-   *
-   * @throws javax.xml.transform.TransformerException if ClassNotFoundException, 
-   *    IllegalAccessException, or InstantiationException is thrown.
-   */
-  public static Function getFunction(int which)
-          throws javax.xml.transform.TransformerException
-  {
-    return m_functions[which].getFunction();
-  }
-
-  /**
-   * Install a built-in function.
-   * @param name The unqualified name of the function.
-   * @param func A Implementation of an XPath Function object.
-   * @return the position of the function in the internal index.
-   */
-  public static int installFunction(String name, Expression func)
-  {
-
-    int funcIndex;
-    Object funcIndexObj = Keywords.m_functions.get(name);
-
-    if (null != funcIndexObj)
-    {
-      funcIndex = ((Integer) funcIndexObj).intValue();
-    }
-    else
-    {
-      funcIndex = m_funcNextFreeIndex;
-
-      m_funcNextFreeIndex++;
-
-      Keywords.m_functions.put(name, new Integer(funcIndex));
-    }
-
-    FuncLoader loader = new FuncLoader(func.getClass().getName(), funcIndex);
-
-    m_functions[funcIndex] = loader;
-
-    return funcIndex;
-  }
-
-  /**
-   * Install a function loader at a specific index.
-   * @param func A Implementation of an XPath Function object.
-   * @param which  The function ID, which may correspond to one of the FUNC_XXX 
-   *    values found in {@link org.apache.xpath.compiler.FunctionTable}, but may 
-   *    be a value installed by an external module. 
-   * @return the position of the function in the internal index.
-   */
-  public static void installFunction(Expression func, int funcIndex)
-  {
-
-    FuncLoader loader = new FuncLoader(func.getClass().getName(), funcIndex);
-
-    m_functions[funcIndex] = loader;
-  }
-}
diff --git a/src/org/apache/xpath/compiler/Keywords.java b/src/org/apache/xpath/compiler/Keywords.java
deleted file mode 100644
index 14e1a44..0000000
--- a/src/org/apache/xpath/compiler/Keywords.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import java.util.Hashtable;
-
-/**
- * <meta name="usage" content="internal"/>
- * Table of strings to operation code lookups.
- */
-public class Keywords
-{
-
-  /** Table of keywords to opcode associations. */
-  static Hashtable m_keywords = new Hashtable();
-
-  /** Table of axes names to opcode associations. */
-  static Hashtable m_axisnames = new Hashtable();
-
-  /** Table of function name to function ID associations. */
-  static Hashtable m_functions = new Hashtable();
-
-  /** Table of node type strings to opcode associations. */
-  static Hashtable m_nodetypes = new Hashtable();
-
-  /** ancestor axes string. */
-  private static final String FROM_ANCESTORS_STRING = "ancestor";
-
-  /** ancestor-or-self axes string. */
-  private static final String FROM_ANCESTORS_OR_SELF_STRING =
-    "ancestor-or-self";
-
-  /** attribute axes string. */
-  private static final String FROM_ATTRIBUTES_STRING = "attribute";
-
-  /** child axes string. */
-  private static final String FROM_CHILDREN_STRING = "child";
-
-  /** descendant-or-self axes string. */
-  private static final String FROM_DESCENDANTS_STRING = "descendant";
-
-  /** ancestor axes string. */
-  private static final String FROM_DESCENDANTS_OR_SELF_STRING =
-    "descendant-or-self";
-
-  /** following axes string. */
-  private static final String FROM_FOLLOWING_STRING = "following";
-
-  /** following-sibling axes string. */
-  private static final String FROM_FOLLOWING_SIBLINGS_STRING =
-    "following-sibling";
-
-  /** parent axes string. */
-  private static final String FROM_PARENT_STRING = "parent";
-
-  /** preceding axes string. */
-  private static final String FROM_PRECEDING_STRING = "preceding";
-
-  /** preceding-sibling axes string. */
-  private static final String FROM_PRECEDING_SIBLINGS_STRING =
-    "preceding-sibling";
-
-  /** self axes string. */
-  private static final String FROM_SELF_STRING = "self";
-
-  /** namespace axes string. */
-  private static final String FROM_NAMESPACE_STRING = "namespace";
-
-  /** self axes abreviated string. */
-  private static final String FROM_SELF_ABBREVIATED_STRING = ".";
-
-  /** comment node test string. */
-  private static final String NODETYPE_COMMENT_STRING = "comment";
-
-  /** text node test string. */
-  private static final String NODETYPE_TEXT_STRING = "text";
-
-  /** processing-instruction node test string. */
-  private static final String NODETYPE_PI_STRING = "processing-instruction";
-
-  /** Any node test string. */
-  private static final String NODETYPE_NODE_STRING = "node";
-
-  /** Wildcard element string. */
-  private static final String NODETYPE_ANYELEMENT_STRING = "*";
-
-  /** current function string. */
-  private static final String FUNC_CURRENT_STRING = "current";
-
-  /** last function string. */
-  private static final String FUNC_LAST_STRING = "last";
-
-  /** position function string. */
-  private static final String FUNC_POSITION_STRING = "position";
-
-  /** count function string. */
-  private static final String FUNC_COUNT_STRING = "count";
-
-  /** id function string. */
-  static final String FUNC_ID_STRING = "id";
-
-  /** key function string (XSLT). */
-  public static final String FUNC_KEY_STRING = "key";
-
-  /** local-name function string. */
-  private static final String FUNC_LOCAL_PART_STRING = "local-name";
-
-  /** namespace-uri function string. */
-  private static final String FUNC_NAMESPACE_STRING = "namespace-uri";
-
-  /** name function string. */
-  private static final String FUNC_NAME_STRING = "name";
-
-  /** generate-id function string (XSLT). */
-  private static final String FUNC_GENERATE_ID_STRING = "generate-id";
-
-  /** not function string. */
-  private static final String FUNC_NOT_STRING = "not";
-
-  /** true function string. */
-  private static final String FUNC_TRUE_STRING = "true";
-
-  /** false function string. */
-  private static final String FUNC_FALSE_STRING = "false";
-
-  /** boolean function string. */
-  private static final String FUNC_BOOLEAN_STRING = "boolean";
-
-  /** lang function string. */
-  private static final String FUNC_LANG_STRING = "lang";
-
-  /** number function string. */
-  private static final String FUNC_NUMBER_STRING = "number";
-
-  /** floor function string. */
-  private static final String FUNC_FLOOR_STRING = "floor";
-
-  /** ceiling function string. */
-  private static final String FUNC_CEILING_STRING = "ceiling";
-
-  /** round function string. */
-  private static final String FUNC_ROUND_STRING = "round";
-
-  /** sum function string. */
-  private static final String FUNC_SUM_STRING = "sum";
-
-  /** string function string. */
-  private static final String FUNC_STRING_STRING = "string";
-
-  /** starts-with function string. */
-  private static final String FUNC_STARTS_WITH_STRING = "starts-with";
-
-  /** contains function string. */
-  private static final String FUNC_CONTAINS_STRING = "contains";
-
-  /** substring-before function string. */
-  private static final String FUNC_SUBSTRING_BEFORE_STRING =
-    "substring-before";
-
-  /** substring-after function string. */
-  private static final String FUNC_SUBSTRING_AFTER_STRING = "substring-after";
-
-  /** normalize-space function string. */
-  private static final String FUNC_NORMALIZE_SPACE_STRING = "normalize-space";
-
-  /** translate function string. */
-  private static final String FUNC_TRANSLATE_STRING = "translate";
-
-  /** concat function string. */
-  private static final String FUNC_CONCAT_STRING = "concat";
-
-  /** system-property function string. */
-  private static final String FUNC_SYSTEM_PROPERTY_STRING = "system-property";
-
-  /** function-available function string (XSLT). */
-  private static final String FUNC_EXT_FUNCTION_AVAILABLE_STRING =
-    "function-available";
-
-  /** element-available function string (XSLT). */
-  private static final String FUNC_EXT_ELEM_AVAILABLE_STRING =
-    "element-available";
-
-  /** substring function string. */
-  private static final String FUNC_SUBSTRING_STRING = "substring";
-
-  /** string-length function string. */
-  private static final String FUNC_STRING_LENGTH_STRING = "string-length";
-
-  /** unparsed-entity-uri function string (XSLT). */
-  private static final String FUNC_UNPARSED_ENTITY_URI_STRING =
-    "unparsed-entity-uri";
-
-  // Proprietary, built in functions
-
-  /** current function string (Proprietary). */
-  private static final String FUNC_DOCLOCATION_STRING = "document-location";
-
-  static
-  {
-    m_axisnames.put(FROM_ANCESTORS_STRING,
-                    new Integer(OpCodes.FROM_ANCESTORS));
-    m_axisnames.put(FROM_ANCESTORS_OR_SELF_STRING,
-                    new Integer(OpCodes.FROM_ANCESTORS_OR_SELF));
-    m_axisnames.put(FROM_ATTRIBUTES_STRING,
-                    new Integer(OpCodes.FROM_ATTRIBUTES));
-    m_axisnames.put(FROM_CHILDREN_STRING,
-                    new Integer(OpCodes.FROM_CHILDREN));
-    m_axisnames.put(FROM_DESCENDANTS_STRING,
-                    new Integer(OpCodes.FROM_DESCENDANTS));
-    m_axisnames.put(FROM_DESCENDANTS_OR_SELF_STRING,
-                    new Integer(OpCodes.FROM_DESCENDANTS_OR_SELF));
-    m_axisnames.put(FROM_FOLLOWING_STRING,
-                    new Integer(OpCodes.FROM_FOLLOWING));
-    m_axisnames.put(FROM_FOLLOWING_SIBLINGS_STRING,
-                    new Integer(OpCodes.FROM_FOLLOWING_SIBLINGS));
-    m_axisnames.put(FROM_PARENT_STRING,
-                    new Integer(OpCodes.FROM_PARENT));
-    m_axisnames.put(FROM_PRECEDING_STRING,
-                    new Integer(OpCodes.FROM_PRECEDING));
-    m_axisnames.put(FROM_PRECEDING_SIBLINGS_STRING,
-                    new Integer(OpCodes.FROM_PRECEDING_SIBLINGS));
-    m_axisnames.put(FROM_SELF_STRING,
-                    new Integer(OpCodes.FROM_SELF));
-    m_axisnames.put(FROM_NAMESPACE_STRING,
-                    new Integer(OpCodes.FROM_NAMESPACE));
-    m_nodetypes.put(NODETYPE_COMMENT_STRING,
-                    new Integer(OpCodes.NODETYPE_COMMENT));
-    m_nodetypes.put(NODETYPE_TEXT_STRING,
-                    new Integer(OpCodes.NODETYPE_TEXT));
-    m_nodetypes.put(NODETYPE_PI_STRING,
-                    new Integer(OpCodes.NODETYPE_PI));
-    m_nodetypes.put(NODETYPE_NODE_STRING,
-                    new Integer(OpCodes.NODETYPE_NODE));
-    m_nodetypes.put(NODETYPE_ANYELEMENT_STRING,
-                    new Integer(OpCodes.NODETYPE_ANYELEMENT));
-    m_keywords.put(FROM_SELF_ABBREVIATED_STRING,
-                   new Integer(OpCodes.FROM_SELF));
-    m_keywords.put(FUNC_ID_STRING,
-                   new Integer(FunctionTable.FUNC_ID));
-    m_keywords.put(FUNC_KEY_STRING,
-                   new Integer(FunctionTable.FUNC_KEY));
-    m_functions.put(FUNC_CURRENT_STRING,
-                    new Integer(FunctionTable.FUNC_CURRENT));
-    m_functions.put(FUNC_LAST_STRING,
-                    new Integer(FunctionTable.FUNC_LAST));
-    m_functions.put(FUNC_POSITION_STRING,
-                    new Integer(FunctionTable.FUNC_POSITION));
-    m_functions.put(FUNC_COUNT_STRING,
-                    new Integer(FunctionTable.FUNC_COUNT));
-    m_functions.put(FUNC_ID_STRING,
-                    new Integer(FunctionTable.FUNC_ID));
-    m_functions.put(FUNC_KEY_STRING,
-                    new Integer(FunctionTable.FUNC_KEY));
-    m_functions.put(FUNC_LOCAL_PART_STRING,
-                    new Integer(FunctionTable.FUNC_LOCAL_PART));
-    m_functions.put(FUNC_NAMESPACE_STRING,
-                    new Integer(FunctionTable.FUNC_NAMESPACE));
-    m_functions.put(FUNC_NAME_STRING,
-                    new Integer(FunctionTable.FUNC_QNAME));
-    m_functions.put(FUNC_GENERATE_ID_STRING,
-                    new Integer(FunctionTable.FUNC_GENERATE_ID));
-    m_functions.put(FUNC_NOT_STRING,
-                    new Integer(FunctionTable.FUNC_NOT));
-    m_functions.put(FUNC_TRUE_STRING,
-                    new Integer(FunctionTable.FUNC_TRUE));
-    m_functions.put(FUNC_FALSE_STRING,
-                    new Integer(FunctionTable.FUNC_FALSE));
-    m_functions.put(FUNC_BOOLEAN_STRING,
-                    new Integer(FunctionTable.FUNC_BOOLEAN));
-    m_functions.put(FUNC_LANG_STRING,
-                    new Integer(FunctionTable.FUNC_LANG));
-    m_functions.put(FUNC_NUMBER_STRING,
-                    new Integer(FunctionTable.FUNC_NUMBER));
-    m_functions.put(FUNC_FLOOR_STRING,
-                    new Integer(FunctionTable.FUNC_FLOOR));
-    m_functions.put(FUNC_CEILING_STRING,
-                    new Integer(FunctionTable.FUNC_CEILING));
-    m_functions.put(FUNC_ROUND_STRING,
-                    new Integer(FunctionTable.FUNC_ROUND));
-    m_functions.put(FUNC_SUM_STRING,
-                    new Integer(FunctionTable.FUNC_SUM));
-    m_functions.put(FUNC_STRING_STRING,
-                    new Integer(FunctionTable.FUNC_STRING));
-    m_functions.put(FUNC_STARTS_WITH_STRING,
-                    new Integer(FunctionTable.FUNC_STARTS_WITH));
-    m_functions.put(FUNC_CONTAINS_STRING,
-                    new Integer(FunctionTable.FUNC_CONTAINS));
-    m_functions.put(FUNC_SUBSTRING_BEFORE_STRING,
-                    new Integer(FunctionTable.FUNC_SUBSTRING_BEFORE));
-    m_functions.put(FUNC_SUBSTRING_AFTER_STRING,
-                    new Integer(FunctionTable.FUNC_SUBSTRING_AFTER));
-    m_functions.put(FUNC_NORMALIZE_SPACE_STRING,
-                    new Integer(FunctionTable.FUNC_NORMALIZE_SPACE));
-    m_functions.put(FUNC_TRANSLATE_STRING,
-                    new Integer(FunctionTable.FUNC_TRANSLATE));
-    m_functions.put(FUNC_CONCAT_STRING,
-                    new Integer(FunctionTable.FUNC_CONCAT));
-
-    //m_functions.put(FUNC_FORMAT_NUMBER_STRING, new Integer(FunctionTable.FUNC_FORMAT_NUMBER));
-    m_functions.put(FUNC_SYSTEM_PROPERTY_STRING,
-                    new Integer(FunctionTable.FUNC_SYSTEM_PROPERTY));
-    m_functions.put(FUNC_EXT_FUNCTION_AVAILABLE_STRING,
-                    new Integer(FunctionTable.FUNC_EXT_FUNCTION_AVAILABLE));
-    m_functions.put(FUNC_EXT_ELEM_AVAILABLE_STRING,
-                    new Integer(FunctionTable.FUNC_EXT_ELEM_AVAILABLE));
-    m_functions.put(FUNC_SUBSTRING_STRING,
-                    new Integer(FunctionTable.FUNC_SUBSTRING));
-    m_functions.put(FUNC_STRING_LENGTH_STRING,
-                    new Integer(FunctionTable.FUNC_STRING_LENGTH));
-    m_functions.put(FUNC_UNPARSED_ENTITY_URI_STRING,
-                    new Integer(FunctionTable.FUNC_UNPARSED_ENTITY_URI));
-
-    // These aren't really functions.
-    m_functions.put(NODETYPE_COMMENT_STRING,
-                    new Integer(OpCodes.NODETYPE_COMMENT));
-    m_functions.put(NODETYPE_TEXT_STRING,
-                    new Integer(OpCodes.NODETYPE_TEXT));
-    m_functions.put(NODETYPE_PI_STRING,
-                    new Integer(OpCodes.NODETYPE_PI));
-    m_functions.put(NODETYPE_NODE_STRING,
-                    new Integer(OpCodes.NODETYPE_NODE));
-    m_functions.put(FUNC_DOCLOCATION_STRING,
-                    new Integer(FunctionTable.FUNC_DOCLOCATION));
-  }
-
-  /**
-   * Tell if a built-in, non-namespaced function is available.
-   *
-   * @param methName The local name of the function.
-   *
-   * @return True if the function can be executed.
-   */
-  public static boolean functionAvailable(String methName)
-  {
-
-    try
-    {
-      Object tblEntry = m_functions.get(methName);
-
-      if (null == tblEntry)
-        return false;
-
-      int funcType = ((Integer) tblEntry).intValue();
-
-      switch (funcType)
-      {
-      case OpCodes.NODETYPE_COMMENT :
-      case OpCodes.NODETYPE_TEXT :
-      case OpCodes.NODETYPE_PI :
-      case OpCodes.NODETYPE_NODE :
-        return false;  // These look like functions but they're NodeTests.
-      default :
-        return true;
-      }
-    }
-    catch (Exception e)
-    {
-      return false;
-    }
-  }
-}
diff --git a/src/org/apache/xpath/compiler/Lexer.java b/src/org/apache/xpath/compiler/Lexer.java
deleted file mode 100644
index 0200ddd..0000000
--- a/src/org/apache/xpath/compiler/Lexer.java
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import org.apache.xml.utils.PrefixResolver;
-
-import java.util.Vector;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.compiler.XPathParser;
-
-/**
- * This class is in charge of lexical processing of the XPath
- * expression into tokens.
- */
-class Lexer
-{
-
-  /**
-   * The target XPath.
-   */
-  private Compiler m_compiler;
-
-  /**
-   * The prefix resolver to map prefixes to namespaces in the XPath.
-   */
-  PrefixResolver m_namespaceContext;
-
-  /**
-   * The XPath processor object.
-   */
-  XPathParser m_processor;
-
-  /**
-   * This value is added to each element name in the TARGETEXTRA
-   * that is a 'target' (right-most top-level element name).
-   */
-  static final int TARGETEXTRA = 10000;
-
-  /**
-   * Ignore this, it is going away.
-   * This holds a map to the m_tokenQueue that tells where the top-level elements are.
-   * It is used for pattern matching so the m_tokenQueue can be walked backwards.
-   * Each element that is a 'target', (right-most top level element name) has
-   * TARGETEXTRA added to it.
-   *
-   */
-  private int m_patternMap[] = new int[100];
-
-  /**
-   * Ignore this, it is going away.
-   * The number of elements that m_patternMap maps;
-   */
-  private int m_patternMapSize;
-
-  /**
-   * Create a Lexer object.
-   *
-   * @param compiler The owning compiler for this lexer.
-   * @param resolver The prefix resolver for mapping qualified name prefixes 
-   *                 to namespace URIs.
-   * @param xpathProcessor The parser that is processing strings to opcodes.
-   */
-  Lexer(Compiler compiler, PrefixResolver resolver,
-        XPathParser xpathProcessor)
-  {
-
-    m_compiler = compiler;
-    m_namespaceContext = resolver;
-    m_processor = xpathProcessor;
-  }
-
-  /**
-   * Walk through the expression and build a token queue, and a map of the top-level
-   * elements.
-   * @param pat XSLT Expression.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  void tokenize(String pat) throws javax.xml.transform.TransformerException
-  {
-    tokenize(pat, null);
-  }
-
-  /**
-   * Walk through the expression and build a token queue, and a map of the top-level
-   * elements.
-   * @param pat XSLT Expression.
-   * @param targetStrings Vector to hold Strings, may be null.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  void tokenize(String pat, Vector targetStrings)
-          throws javax.xml.transform.TransformerException
-  {
-
-    m_compiler.m_tokenQueueSize = 0;
-    m_compiler.m_currentPattern = pat;
-    m_patternMapSize = 0;
-    m_compiler.m_opMap = new int[OpMap.MAXTOKENQUEUESIZE * 5];
-
-    int nChars = pat.length();
-    int startSubstring = -1;
-    int posOfNSSep = -1;
-    boolean isStartOfPat = true;
-    boolean isAttrName = false;
-    boolean isNum = false;
-
-    // Nesting of '[' so we can know if the given element should be
-    // counted inside the m_patternMap.
-    int nesting = 0;
-
-    // char[] chars = pat.toCharArray();
-    for (int i = 0; i < nChars; i++)
-    {
-      char c = pat.charAt(i);
-
-      switch (c)
-      {
-      case '\"' :
-      {
-        if (startSubstring != -1)
-        {
-          isNum = false;
-          isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-          isAttrName = false;
-
-          if (-1 != posOfNSSep)
-          {
-            posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
-          }
-          else
-          {
-            addToTokenQueue(pat.substring(startSubstring, i));
-          }
-        }
-
-        startSubstring = i;
-
-        for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\"'); i++);
-
-        if (c == '\"' && i < nChars)
-        {
-          addToTokenQueue(pat.substring(startSubstring, i + 1));
-
-          startSubstring = -1;
-        }
-        else
-        {
-          m_processor.error(XPATHErrorResources.ER_EXPECTED_DOUBLE_QUOTE,
-                            null);  //"misquoted literal... expected double quote!");
-        }
-      }
-      break;
-      case '\'' :
-        if (startSubstring != -1)
-        {
-          isNum = false;
-          isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-          isAttrName = false;
-
-          if (-1 != posOfNSSep)
-          {
-            posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
-          }
-          else
-          {
-            addToTokenQueue(pat.substring(startSubstring, i));
-          }
-        }
-
-        startSubstring = i;
-
-        for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\''); i++);
-
-        if (c == '\'' && i < nChars)
-        {
-          addToTokenQueue(pat.substring(startSubstring, i + 1));
-
-          startSubstring = -1;
-        }
-        else
-        {
-          m_processor.error(XPATHErrorResources.ER_EXPECTED_SINGLE_QUOTE,
-                            null);  //"misquoted literal... expected single quote!");
-        }
-        break;
-      case 0x0A :
-      case 0x0D :
-      case ' ' :
-      case '\t' :
-        if (startSubstring != -1)
-        {
-          isNum = false;
-          isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-          isAttrName = false;
-
-          if (-1 != posOfNSSep)
-          {
-            posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
-          }
-          else
-          {
-            addToTokenQueue(pat.substring(startSubstring, i));
-          }
-
-          startSubstring = -1;
-        }
-        break;
-      case '@' :
-        isAttrName = true;
-
-      // fall-through on purpose
-      case '-' :
-        if ('-' == c)
-        {
-          if (!(isNum || (startSubstring == -1)))
-          {
-            break;
-          }
-
-          isNum = false;
-        }
-
-      // fall-through on purpose
-      case '(' :
-      case '[' :
-      case ')' :
-      case ']' :
-      case '|' :
-      case '/' :
-      case '*' :
-      case '+' :
-      case '=' :
-      case ',' :
-      case '\\' :  // Unused at the moment
-      case '^' :  // Unused at the moment
-      case '!' :  // Unused at the moment
-      case '$' :
-      case '<' :
-      case '>' :
-        if (startSubstring != -1)
-        {
-          isNum = false;
-          isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-          isAttrName = false;
-
-          if (-1 != posOfNSSep)
-          {
-            posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
-          }
-          else
-          {
-            addToTokenQueue(pat.substring(startSubstring, i));
-          }
-
-          startSubstring = -1;
-        }
-        else if (('/' == c) && isStartOfPat)
-        {
-          isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-        }
-        else if ('*' == c)
-        {
-          isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-          isAttrName = false;
-        }
-
-        if (0 == nesting)
-        {
-          if ('|' == c)
-          {
-            if (null != targetStrings)
-            {
-              recordTokenString(targetStrings);
-            }
-
-            isStartOfPat = true;
-          }
-        }
-
-        if ((')' == c) || (']' == c))
-        {
-          nesting--;
-        }
-        else if (('(' == c) || ('[' == c))
-        {
-          nesting++;
-        }
-
-        addToTokenQueue(pat.substring(i, i + 1));
-        break;
-      case ':' :
-        if (i>0)
-        {
-          if (posOfNSSep == (i - 1))
-          {
-            if (startSubstring != -1)
-            {
-              if (startSubstring < (i - 1))
-                addToTokenQueue(pat.substring(startSubstring, i - 1));
-            }
-
-            isNum = false;
-            isAttrName = false;
-            startSubstring = -1;
-            posOfNSSep = -1;
-
-            addToTokenQueue(pat.substring(i - 1, i + 1));
-
-            break;
-          }
-          else
-          {
-            posOfNSSep = i;
-          }
-        }
-
-      // fall through on purpose
-      default :
-        if (-1 == startSubstring)
-        {
-          startSubstring = i;
-          isNum = Character.isDigit(c);
-        }
-        else if (isNum)
-        {
-          isNum = Character.isDigit(c);
-        }
-      }
-    }
-
-    if (startSubstring != -1)
-    {
-      isNum = false;
-      isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-
-      if (-1 != posOfNSSep)
-      {
-        posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, nChars);
-      }
-      else
-      {
-        addToTokenQueue(pat.substring(startSubstring, nChars));
-      }
-    }
-
-    if (0 == m_compiler.m_tokenQueueSize)
-    {
-      m_processor.error(XPATHErrorResources.ER_EMPTY_EXPRESSION, null);  //"Empty expression!");
-    }
-    else if (null != targetStrings)
-    {
-      recordTokenString(targetStrings);
-    }
-
-    m_processor.m_queueMark = 0;
-  }
-
-  /**
-   * Record the current position on the token queue as long as
-   * this is a top-level element.  Must be called before the
-   * next token is added to the m_tokenQueue.
-   *
-   * @param nesting The nesting count for the pattern element.
-   * @param isStart true if this is the start of a pattern.
-   * @param isAttrName true if we have determined that this is an attribute name.
-   *
-   * @return true if this is the start of a pattern.
-   */
-  private boolean mapPatternElemPos(int nesting, boolean isStart,
-                                    boolean isAttrName)
-  {
-
-    if (0 == nesting)
-    {
-      if(m_patternMapSize >= m_patternMap.length)
-      {
-        int patternMap[] = m_patternMap;
-        int len = m_patternMap.length;
-        m_patternMap = new int[m_patternMapSize + 100];
-        System.arraycopy(patternMap, 0, m_patternMap, 0, len);
-      } 
-      if (!isStart)
-      {
-        m_patternMap[m_patternMapSize - 1] -= TARGETEXTRA;
-      }
-      m_patternMap[m_patternMapSize] =
-        (m_compiler.m_tokenQueueSize - (isAttrName ? 1 : 0)) + TARGETEXTRA;
-
-      m_patternMapSize++;
-
-      isStart = false;
-    }
-
-    return isStart;
-  }
-
-  /**
-   * Given a map pos, return the corresponding token queue pos.
-   *
-   * @param i The index in the m_patternMap.
-   *
-   * @return the token queue position.
-   */
-  private int getTokenQueuePosFromMap(int i)
-  {
-
-    int pos = m_patternMap[i];
-
-    return (pos >= TARGETEXTRA) ? (pos - TARGETEXTRA) : pos;
-  }
-
-  /**
-   * Reset token queue mark and m_token to a
-   * given position.
-   * @param mark The new position.
-   */
-  private final void resetTokenMark(int mark)
-  {
-
-    int qsz = m_compiler.m_tokenQueueSize;
-
-    m_processor.m_queueMark = (mark > 0)
-                              ? ((mark <= qsz) ? mark - 1 : mark) : 0;
-
-    if (m_processor.m_queueMark < qsz)
-    {
-      m_processor.m_token =
-        (String) m_compiler.m_tokenQueue[m_processor.m_queueMark++];
-      m_processor.m_tokenChar = m_processor.m_token.charAt(0);
-    }
-    else
-    {
-      m_processor.m_token = null;
-      m_processor.m_tokenChar = 0;
-    }
-  }
-
-  /**
-   * Given a string, return the corresponding keyword token.
-   *
-   * @param key The keyword.
-   *
-   * @return An opcode value.
-   */
-  final int getKeywordToken(String key)
-  {
-
-    int tok;
-
-    try
-    {
-      Integer itok = (Integer) Keywords.m_keywords.get(key);
-
-      tok = (null != itok) ? itok.intValue() : 0;
-    }
-    catch (NullPointerException npe)
-    {
-      tok = 0;
-    }
-    catch (ClassCastException cce)
-    {
-      tok = 0;
-    }
-
-    return tok;
-  }
-
-  /**
-   * Record the current token in the passed vector.
-   *
-   * @param targetStrings Vector of string.
-   */
-  private void recordTokenString(Vector targetStrings)
-  {
-
-    int tokPos = getTokenQueuePosFromMap(m_patternMapSize - 1);
-
-    resetTokenMark(tokPos + 1);
-
-    if (m_processor.lookahead('(', 1))
-    {
-      int tok = getKeywordToken(m_processor.m_token);
-
-      switch (tok)
-      {
-      case OpCodes.NODETYPE_COMMENT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_COMMENT);
-        break;
-      case OpCodes.NODETYPE_TEXT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_TEXT);
-        break;
-      case OpCodes.NODETYPE_NODE :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
-        break;
-      case OpCodes.NODETYPE_ROOT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ROOT);
-        break;
-      case OpCodes.NODETYPE_ANYELEMENT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
-        break;
-      case OpCodes.NODETYPE_PI :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
-        break;
-      default :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
-      }
-    }
-    else
-    {
-      if (m_processor.tokenIs('@'))
-      {
-        tokPos++;
-
-        resetTokenMark(tokPos + 1);
-      }
-
-      if (m_processor.lookahead(':', 1))
-      {
-        tokPos += 2;
-      }
-
-      targetStrings.addElement(m_compiler.m_tokenQueue[tokPos]);
-    }
-  }
-
-  /**
-   * Add a token to the token queue.
-   *
-   *
-   * @param s The token.
-   */
-  private final void addToTokenQueue(String s)
-  {
-    m_compiler.m_tokenQueue[m_compiler.m_tokenQueueSize++] = s;
-  }
-
-  /**
-   * When a seperator token is found, see if there's a element name or
-   * the like to map.
-   *
-   * @param pat The XPath name string.
-   * @param startSubstring The start of the name string.
-   * @param posOfNSSep The position of the namespace seperator (':').
-   * @param posOfScan The end of the name index.
-   *
-   * @throws javax.xml.transform.TransformerException
-   *
-   * @return -1 always.
-   */
-  private int mapNSTokens(String pat, int startSubstring, int posOfNSSep,
-                          int posOfScan)
-           throws javax.xml.transform.TransformerException
- {
-
-    String prefix = pat.substring(startSubstring, posOfNSSep);
-    String uName;
-
-    if ((null != m_namespaceContext) &&!prefix.equals("*")
-            &&!prefix.equals("xmlns"))
-    {
-      try
-      {
-        if (prefix.length() > 0)
-          uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-            prefix);
-        else
-        {
-
-          // Assume last was wildcard. This is not legal according
-          // to the draft. Set the below to true to make namespace
-          // wildcards work.
-          if (false)
-          {
-            addToTokenQueue(":");
-
-            String s = pat.substring(posOfNSSep + 1, posOfScan);
-
-            if (s.length() > 0)
-              addToTokenQueue(s);
-
-            return -1;
-          }
-          else
-          {
-            uName =
-              ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-                prefix);
-          }
-        }
-      }
-      catch (ClassCastException cce)
-      {
-        uName = m_namespaceContext.getNamespaceForPrefix(prefix);
-      }
-    }
-    else
-    {
-      uName = prefix;
-    }
-
-    if ((null != uName) && (uName.length() > 0))
-    {
-      addToTokenQueue(uName);
-      addToTokenQueue(":");
-
-      String s = pat.substring(posOfNSSep + 1, posOfScan);
-
-      if (s.length() > 0)
-        addToTokenQueue(s);
-    }
-    else
-    {
-
-      // error("Could not locate namespace for prefix: "+prefix);
-      m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
-                 new String[] {prefix});  //"Prefix must resolve to a namespace: {0}";
-
-
-      /***  Old code commented out 10-Jan-2001
-      addToTokenQueue(prefix);
-      addToTokenQueue(":");
-
-      String s = pat.substring(posOfNSSep + 1, posOfScan);
-
-      if (s.length() > 0)
-        addToTokenQueue(s);
-      ***/
-    }
-
-    return -1;
-  }
-}
diff --git a/src/org/apache/xpath/compiler/OpCodes.java b/src/org/apache/xpath/compiler/OpCodes.java
deleted file mode 100644
index bac0a68..0000000
--- a/src/org/apache/xpath/compiler/OpCodes.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-/**
- * Operations codes for XPath.
- *
- * Code for the descriptions of the operations codes:
- * [UPPER CASE] indicates a literal value,
- * [lower case] is a description of a value,
- *      ([length] always indicates the length of the operation,
- *       including the operations code and the length integer.)
- * {UPPER CASE} indicates the given production,
- * {description} is the description of a new production,
- *      (For instance, {boolean expression} means some expression
- *       that should be resolved to a boolean.)
- *  * means that it occurs zero or more times,
- *  + means that it occurs one or more times,
- *  ? means that it is optional.
- *
- * returns: indicates what the production should return.
- */
-public class OpCodes
-{
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [ENDOP]
-   * Some operators may like to have a terminator.
-   */
-  public static final int ENDOP = -1;
-
-  /**
-   * [EMPTY]
-   * Empty slot to indicate NULL.
-   */
-  public static final int EMPTY = -2;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [ELEMWILDCARD]
-   * Means ELEMWILDCARD ("*"), used instead
-   * of string index in some places.
-   */
-  public static final int ELEMWILDCARD = -3;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_XPATH]
-   * [length]
-   *  {expression}
-   *
-   * returns:
-   *  XNodeSet
-   *  XNumber
-   *  XString
-   *  XBoolean
-   *  XRTree
-   *  XObject
-   */
-  public static final int OP_XPATH = 1;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_OR]
-   * [length]
-   *  {boolean expression}
-   *  {boolean expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_OR = 2;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_AND]
-   * [length]
-   *  {boolean expression}
-   *  {boolean expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_AND = 3;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_NOTEQUALS]
-   * [length]
-   *  {expression}
-   *  {expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_NOTEQUALS = 4;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_EQUALS]
-   * [length]
-   *  {expression}
-   *  {expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_EQUALS = 5;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_LTE] (less-than-or-equals)
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_LTE = 6;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_LT] (less-than)
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_LT = 7;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_GTE] (greater-than-or-equals)
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_GTE = 8;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_GT] (greater-than)
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_GT = 9;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_PLUS]
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_PLUS = 10;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_MINUS]
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_MINUS = 11;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_MULT]
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_MULT = 12;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_DIV]
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_DIV = 13;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_MOD]
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_MOD = 14;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_QUO]
-   * [length]
-   *  {number expression}
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_QUO = 15;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_NEG]
-   * [length]
-   *  {number expression}
-   *
-   * returns:
-   *  XNumber
-   */
-  public static final int OP_NEG = 16;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_STRING] (cast operation)
-   * [length]
-   *  {expression}
-   *
-   * returns:
-   *  XString
-   */
-  public static final int OP_STRING = 17;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_BOOL] (cast operation)
-   * [length]
-   *  {expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_BOOL = 18;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_NUMBER] (cast operation)
-   * [length]
-   *  {expression}
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int OP_NUMBER = 19;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_UNION]
-   * [length]
-   *  {PathExpr}+
-   *
-   * returns:
-   *  XNodeSet
-   */
-  public static final int OP_UNION = 20;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_LITERAL]
-   * [3]
-   * [index to token]
-   *
-   * returns:
-   *  XString
-   */
-  public static final int OP_LITERAL = 21;
-
-  /** The low opcode for nodesets, needed by getFirstPredicateOpPos and 
-   *  getNextStepPos.          */
-  static final int FIRST_NODESET_OP = 22;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_VARIABLE]
-   * [4]
-   * [index to namespace token, or EMPTY]
-   * [index to function name token]
-   *
-   * returns:
-   *  XString
-   */
-  public static final int OP_VARIABLE = 22;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_GROUP]
-   * [length]
-   *  {expression}
-   *
-   * returns:
-   *  XNodeSet
-   *  XNumber
-   *  XString
-   *  XBoolean
-   *  XRTree
-   *  XObject
-   */
-  public static final int OP_GROUP = 23;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_EXTFUNCTION] (Extension function.)
-   * [length]
-   * [index to namespace token]
-   * [index to function name token]
-   *  {OP_ARGUMENT}
-   *
-   * returns:
-   *  XNodeSet
-   *  XNumber
-   *  XString
-   *  XBoolean
-   *  XRTree
-   *  XObject
-   */
-  public static final int OP_EXTFUNCTION = 24;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_FUNCTION]
-   * [length]
-   * [FUNC_name]
-   *  {OP_ARGUMENT}
-   * [ENDOP]
-   *
-   * returns:
-   *  XNodeSet
-   *  XNumber
-   *  XString
-   *  XBoolean
-   *  XRTree
-   *  XObject
-   */
-  public static final int OP_FUNCTION = 25;
-
-  /** The last opcode for stuff that can be a nodeset.         */
-  static final int LAST_NODESET_OP = 25;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_ARGUMENT] (Function argument.)
-   * [length]
-   *  {expression}
-   *
-   * returns:
-   *  XNodeSet
-   *  XNumber
-   *  XString
-   *  XBoolean
-   *  XRTree
-   *  XObject
-   */
-  public static final int OP_ARGUMENT = 26;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_NUMBERLIT] (Number literal.)
-   * [3]
-   * [index to token]
-   *
-   * returns:
-   *  XString
-   */
-  public static final int OP_NUMBERLIT = 27;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_LOCATIONPATH]
-   * [length]
-   *   {FROM_stepType}
-   * | {function}
-   * {predicate}
-   * [ENDOP]
-   *
-   * (Note that element and attribute namespaces and
-   * names can be wildcarded '*'.)
-   *
-   * returns:
-   *  XNodeSet
-   */
-  public static final int OP_LOCATIONPATH = 28;
-
-  // public static final int LOCATIONPATHEX_MASK = 0x0000FFFF;
-  // public static final int LOCATIONPATHEX_ISSIMPLE = 0x00010000;
-  // public static final int OP_LOCATIONPATH_EX = (28 | 0x00010000);
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_PREDICATE]
-   * [length]
-   *  {expression}
-   * [ENDOP] (For safety)
-   *
-   * returns:
-   *  XBoolean or XNumber
-   */
-  public static final int OP_PREDICATE = 29;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_MATCHPATTERN]
-   * [length]
-   *  {PathExpr}+
-   *
-   * returns:
-   *  XNodeSet
-   */
-  public static final int OP_MATCHPATTERN = 30;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [OP_LOCATIONPATHPATTERN]
-   * [length]
-   *   {FROM_stepType}
-   * | {function}{predicate}
-   * [ENDOP]
-   * returns:
-   *  XNodeSet
-   */
-  public static final int OP_LOCATIONPATHPATTERN = 31;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_COMMENT]
-   * No size or arguments.
-   * Note: must not overlap function OP number!
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_COMMENT = 1030;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_TEXT]
-   * No size or arguments.
-   * Note: must not overlap function OP number!
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_TEXT = 1031;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_PI]
-   * [index to token]
-   * Note: must not overlap function OP number!
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_PI = 1032;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_NODE]
-   * No size or arguments.
-   * Note: must not overlap function OP number!
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_NODE = 1033;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODENAME]
-   * [index to ns token or EMPTY]
-   * [index to name token]
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODENAME = 34;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_ROOT]
-   * No size or arguments.
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_ROOT = 35;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_ANY]
-   * No size or arguments.
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_ANYELEMENT = 36;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [NODETYPE_ANY]
-   * No size or arguments.
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int NODETYPE_FUNCTEST = 1034;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * [FROM_stepType]
-   * [length, including predicates]
-   * [length of just the step, without the predicates]
-   * {node test}
-   * {predicates}?
-   *
-   * returns:
-   *  XBoolean
-   */
-  public static final int AXES_START_TYPES = 37;
-
-  /** ancestor axes opcode.         */
-  public static final int FROM_ANCESTORS = 37;
-
-  /** ancestor-or-self axes opcode.         */
-  public static final int FROM_ANCESTORS_OR_SELF = 38;
-
-  /** attribute axes opcode.         */
-  public static final int FROM_ATTRIBUTES = 39;
-
-  /** children axes opcode.         */
-  public static final int FROM_CHILDREN = 40;
-
-  /** descendants axes opcode.         */
-  public static final int FROM_DESCENDANTS = 41;
-
-  /** descendants-of-self axes opcode.         */
-  public static final int FROM_DESCENDANTS_OR_SELF = 42;
-
-  /** following axes opcode.         */
-  public static final int FROM_FOLLOWING = 43;
-
-  /** following-siblings axes opcode.         */
-  public static final int FROM_FOLLOWING_SIBLINGS = 44;
-
-  /** parent axes opcode.         */
-  public static final int FROM_PARENT = 45;
-
-  /** preceding axes opcode.         */
-  public static final int FROM_PRECEDING = 46;
-
-  /** preceding-sibling axes opcode.         */
-  public static final int FROM_PRECEDING_SIBLINGS = 47;
-
-  /** self axes opcode.         */
-  public static final int FROM_SELF = 48;
-
-  /** namespace axes opcode.         */
-  public static final int FROM_NAMESPACE = 49;
-
-  /** '/' axes opcode.         */
-  public static final int FROM_ROOT = 50;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * For match patterns.
-   */
-  public static final int MATCH_ATTRIBUTE = 51;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * For match patterns.
-   */
-  public static final int MATCH_ANY_ANCESTOR = 52;
-
-  /**
-   * <meta name="usage" content="advanced"/>
-   * For match patterns.
-   */
-  public static final int MATCH_IMMEDIATE_ANCESTOR = 53;
-
-  /** The end of the axes types.    */
-  public static final int AXES_END_TYPES = 53;
-
-  /** The next free ID.  Please keep this up to date.  */
-  private static final int NEXT_FREE_ID = 99;
-}
diff --git a/src/org/apache/xpath/compiler/OpMap.java b/src/org/apache/xpath/compiler/OpMap.java
deleted file mode 100644
index 90d0b43..0000000
--- a/src/org/apache/xpath/compiler/OpMap.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import java.util.Vector;
-
-import org.apache.xml.utils.QName;
-import org.apache.xpath.patterns.NodeTest;
-
-/**
- * This class represents the data structure basics of the XPath
- * object.
- */
-public class OpMap
-{
-
-  /**
-   * The current pattern string, for diagnostics purposes
-   */
-  protected String m_currentPattern;
-
-  /**
-   * Return the expression as a string for diagnostics.
-   *
-   * @return The expression string.
-   */
-  public String toString()
-  {
-    return m_currentPattern;
-  }
-
-  /**
-   * Return the expression as a string for diagnostics.
-   *
-   * @return The expression string.
-   */
-  public String getPatternString()
-  {
-    return m_currentPattern;
-  }
-
-  /**
-   * The max size that the token queue can grow to.
-   */
-  static final int MAXTOKENQUEUESIZE = 500;
-
-  /**
-   *  TokenStack is the queue of used tokens. The current token is the token at the
-   * end of the m_tokenQueue. The idea is that the queue can be marked and a sequence
-   * of tokens can be reused.
-   */
-  public Object[] m_tokenQueue = new Object[MAXTOKENQUEUESIZE];
-
-  /**
-   * Get the XPath as a list of tokens.
-   *
-   * @return an array of string tokens.
-   */
-  public Object[] getTokenQueue()
-  {
-    return m_tokenQueue;
-  }
-
-  /**
-   * Get the XPath as a list of tokens.
-   *
-   * @param pos index into token queue.
-   *
-   * @return The token, normally a string.
-   */
-  public Object getToken(int pos)
-  {
-    return m_tokenQueue[pos];
-  }
-
-  /**
-   * The current size of the token queue.
-   */
-  public int m_tokenQueueSize = 0;
-
-  /**
-    * Get size of the token queue.
-   *
-   * @return The size of the token queue.
-   */
-  public int getTokenQueueSize()
-  {
-    return m_tokenQueueSize;
-  }
-
-  /**
-   * An operations map is used instead of a proper parse tree.  It contains
-   * operations codes and indexes into the m_tokenQueue.
-   * I use an array instead of a full parse tree in order to cut down
-   * on the number of objects created.
-   */
-  public int m_opMap[] = null;
-
-  /**
-    * Get the opcode list that describes the XPath operations.  It contains
-   * operations codes and indexes into the m_tokenQueue.
-   * I use an array instead of a full parse tree in order to cut down
-   * on the number of objects created.
-   *
-   * @return An array of integers that is the opcode list that describes the XPath operations.
-   */
-  public int[] getOpMap()
-  {
-    return m_opMap;
-  }
-
-  // Position indexes
-
-  /**
-   * The length is always the opcode position + 1.
-   * Length is always expressed as the opcode+length bytes,
-   * so it is always 2 or greater.
-   */
-  public static final int MAPINDEX_LENGTH = 1;
-
-  /**
-   * Replace the large arrays
-   * with a small array.
-   */
-  void shrink()
-  {
-
-    int map[] = m_opMap;
-    int n = m_opMap[MAPINDEX_LENGTH];
-    ;
-
-    m_opMap = new int[n + 4];
-
-    int i;
-
-    for (i = 0; i < n; i++)
-    {
-      m_opMap[i] = map[i];
-    }
-
-    m_opMap[i] = 0;
-    m_opMap[i + 1] = 0;
-    m_opMap[i + 2] = 0;
-
-    Object[] tokens = m_tokenQueue;
-
-    n = m_tokenQueueSize;
-    m_tokenQueue = new Object[n + 4];
-
-    for (i = 0; i < n; i++)
-    {
-      m_tokenQueue[i] = tokens[i];
-    }
-
-    m_tokenQueue[i] = null;
-    m_tokenQueue[i + 1] = null;
-    m_tokenQueue[i + 2] = null;
-  }
-
-  /**
-  * Given an operation position, return the current op.
-   *
-   * @param opPos index into op map.
-   * @return the op that corresponds to the opPos argument.
-   */
-  public int getOp(int opPos)
-  {
-    return m_opMap[opPos];
-  }
-
-  /**
-   * Given an operation position, return the end position, i.e. the
-   * beginning of the next operation.
-   *
-   * @param opPos An op position of an operation for which there is a size 
-   *              entry following.
-   * @return position of next operation in m_opMap.
-   */
-  public int getNextOpPos(int opPos)
-  {
-    return opPos + m_opMap[opPos + 1];
-  }
-
-  /**
-   * Given a location step position, return the end position, i.e. the
-   * beginning of the next step.
-   *
-   * @param opPos the position of a location step.
-   * @return the position of the next location step.
-   */
-  public int getNextStepPos(int opPos)
-  {
-
-    int stepType = getOp(opPos);
-
-    if ((stepType >= OpCodes.AXES_START_TYPES)
-            && (stepType <= OpCodes.AXES_END_TYPES))
-    {
-      return getNextOpPos(opPos);
-    }
-    else if ((stepType >= OpCodes.FIRST_NODESET_OP)
-             && (stepType <= OpCodes.LAST_NODESET_OP))
-    {
-      int newOpPos = getNextOpPos(opPos);
-
-      while (OpCodes.OP_PREDICATE == getOp(newOpPos))
-      {
-        newOpPos = getNextOpPos(newOpPos);
-      }
-
-      stepType = getOp(newOpPos);
-
-      if (!((stepType >= OpCodes.AXES_START_TYPES)
-            && (stepType <= OpCodes.AXES_END_TYPES)))
-      {
-        return OpCodes.ENDOP;
-      }
-
-      return newOpPos;
-    }
-    else
-    {
-      throw new RuntimeException(
-        "Programmer's assertion in getNextStepPos: unknown stepType: "
-        + stepType);
-    }
-  }
-
-  /**
-   * Given an operation position, return the end position, i.e. the
-   * beginning of the next operation.
-   *
-   * @param opMap The operations map.
-   * @param opPos index to operation, for which there is a size entry following.
-   * @return position of next operation in m_opMap.
-   */
-  public static int getNextOpPos(int[] opMap, int opPos)
-  {
-    return opPos + opMap[opPos + 1];
-  }
-
-  /**
-   * Given an FROM_stepType position, return the position of the
-   * first predicate, if there is one, or else this will point
-   * to the end of the FROM_stepType.
-   * Example:
-   *  int posOfPredicate = xpath.getNextOpPos(stepPos);
-   *  boolean hasPredicates =
-   *            OpCodes.OP_PREDICATE == xpath.getOp(posOfPredicate);
-   *
-   * @param opPos position of FROM_stepType op. 
-   * @return position of predicate in FROM_stepType structure.
-   */
-  public int getFirstPredicateOpPos(int opPos)
-     throws javax.xml.transform.TransformerException
-  {
-
-    int stepType = m_opMap[opPos];
-
-    if ((stepType >= OpCodes.AXES_START_TYPES)
-            && (stepType <= OpCodes.AXES_END_TYPES))
-    {
-      return opPos + m_opMap[opPos + 2];
-    }
-    else if ((stepType >= OpCodes.FIRST_NODESET_OP)
-             && (stepType <= OpCodes.LAST_NODESET_OP))
-    {
-      return opPos + m_opMap[opPos + 1];
-    }
-    else if(-2 == stepType)
-    {
-      return -2;
-    }
-    else
-    {
-      error(org.apache.xpath.res.XPATHErrorResources.ER_UNKNOWN_OPCODE,
-            new Object[]{ String.valueOf(stepType) });  //"ERROR! Unknown op code: "+m_opMap[opPos]);
-      return -1;
-    }
-  }
-  
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  public void error(int msg, Object[] args) throws javax.xml.transform.TransformerException
-  {
-
-    java.lang.String fmsg = org.apache.xalan.res.XSLMessages.createXPATHMessage(msg, args);
-    
-
-    throw new javax.xml.transform.TransformerException(fmsg);
-  }
-
-
-  /**
-   * Go to the first child of a given operation.
-   *
-   * @param opPos position of operation.
-   *
-   * @return The position of the first child of the operation.
-   */
-  public static int getFirstChildPos(int opPos)
-  {
-    return opPos + 2;
-  }
-
-  /**
-   * Get the length of an operation.
-   *
-   * @param opPos The position of the operation in the op map.
-   *
-   * @return The size of the operation.
-   */
-  public int getArgLength(int opPos)
-  {
-    return m_opMap[opPos + MAPINDEX_LENGTH];
-  }
-
-  /**
-   * Given a location step, get the length of that step.
-   *
-   * @param opPos Position of location step in op map.
-   *
-   * @return The length of the step.
-   */
-  public int getArgLengthOfStep(int opPos)
-  {
-    return m_opMap[opPos + MAPINDEX_LENGTH + 1] - 3;
-  }
-
-  /**
-   * Get the first child position of a given location step.
-   *
-   * @param opPos Position of location step in the location map.
-   *
-   * @return The first child position of the step.
-   */
-  public static int getFirstChildPosOfStep(int opPos)
-  {
-    return opPos + 3;
-  }
-
-  /**
-   * Get the test type of the step, i.e. NODETYPE_XXX value.
-   * 
-   * @param opPosOfStep The position of the FROM_XXX step.
-   *
-   * @return NODETYPE_XXX value.
-   */
-  public int getStepTestType(int opPosOfStep)
-  {
-    return m_opMap[opPosOfStep + 3];  // skip past op, len, len without predicates
-  }
-
-  /**
-   * Get the namespace of the step.
-   * 
-   * @param opPosOfStep The position of the FROM_XXX step.
-   *
-   * @return The step's namespace, NodeTest.WILD, or null for null namespace.
-   */
-  public String getStepNS(int opPosOfStep)
-  {
-
-    int argLenOfStep = getArgLengthOfStep(opPosOfStep);
-
-    // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
-    if (argLenOfStep == 3)
-    {
-      int index = m_opMap[opPosOfStep + 4];
-
-      if (index >= 0)
-        return (String) m_tokenQueue[index];
-      else if (OpCodes.ELEMWILDCARD == index)
-        return NodeTest.WILD;
-      else
-        return null;
-    }
-    else
-      return null;
-  }
-
-  /**
-   * Get the local name of the step.
-   * @param opPosOfStep The position of the FROM_XXX step.
-   *
-   * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
-   */
-  public String getStepLocalName(int opPosOfStep)
-  {
-
-    int argLenOfStep = getArgLengthOfStep(opPosOfStep);
-
-    // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
-    int index;
-
-    switch (argLenOfStep)
-    {
-    case 0 :
-      index = OpCodes.EMPTY;
-      break;
-    case 1 :
-      index = OpCodes.ELEMWILDCARD;
-      break;
-    case 2 :
-      index = m_opMap[opPosOfStep + 4];
-      break;
-    case 3 :
-      index = m_opMap[opPosOfStep + 5];
-      break;
-    default :
-      index = OpCodes.EMPTY;
-      break;  // Should assert error
-    }
-
-    // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5] 
-    //                                  : ((argLenOfStep == 1) ? -3 : -2);
-    if (index >= 0)
-      return (String) m_tokenQueue[index].toString();
-    else if (OpCodes.ELEMWILDCARD == index)
-      return NodeTest.WILD;
-    else
-      return null;
-  }
-
-}
diff --git a/src/org/apache/xpath/compiler/PsuedoNames.java b/src/org/apache/xpath/compiler/PsuedoNames.java
deleted file mode 100644
index f80d1d9..0000000
--- a/src/org/apache/xpath/compiler/PsuedoNames.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-/**
- * This is used to represent names of nodes that may not be named, like a 
- * comment node.
- */
-public class PsuedoNames
-{
-
-  /**
-   * Psuedo name for a wild card pattern ('*').
-   */
-  public static final String PSEUDONAME_ANY = "*";
-
-  /**
-   * Psuedo name for the root node.
-   */
-  public static final String PSEUDONAME_ROOT = "/";
-
-  /**
-   * Psuedo name for a text node.
-   */
-  public static final String PSEUDONAME_TEXT = "#text";
-
-  /**
-   * Psuedo name for a comment node.
-   */
-  public static final String PSEUDONAME_COMMENT = "#comment";
-
-  /**
-   * Psuedo name for a processing instruction node.
-   */
-  public static final String PSEUDONAME_PI = "#pi";
-
-  /**
-   * Psuedo name for an unknown type value.
-   */
-  public static final String PSEUDONAME_OTHER = "*";
-}
diff --git a/src/org/apache/xpath/compiler/XPathDumper.java b/src/org/apache/xpath/compiler/XPathDumper.java
deleted file mode 100644
index d660a75..0000000
--- a/src/org/apache/xpath/compiler/XPathDumper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.XPathParser;
-
-/**
- * Class for XPath diagnostic functions.
- */
-public class XPathDumper
-{
-
-  // deleted for the time being.
-}
diff --git a/src/org/apache/xpath/compiler/XPathParser.java b/src/org/apache/xpath/compiler/XPathParser.java
deleted file mode 100644
index 84dd5d5..0000000
--- a/src/org/apache/xpath/compiler/XPathParser.java
+++ /dev/null
@@ -1,2180 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.compiler;
-
-import java.util.Vector;
-import java.util.Hashtable;
-
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.compiler.Compiler;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xalan.res.XSLMessages;
-
-import javax.xml.transform.TransformerException;
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.LocatorImpl;
-
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.ErrorListener;
-
-/**
- * <meta name="usage" content="general"/>
- * Tokenizes and parses XPath expressions. This should really be named
- * XPathParserImpl, and may be renamed in the future.
- */
-public class XPathParser
-{
-
-  /**
-   * The XPath to be processed.
-   */
-  private OpMap m_ops;
-
-  /**
-   * The next token in the pattern.
-   */
-  transient String m_token;
-
-  /**
-   * The first char in m_token, the theory being that this
-   * is an optimization because we won't have to do charAt(0) as
-   * often.
-   */
-  transient char m_tokenChar = 0;
-
-  /**
-   * The position in the token queue is tracked by m_queueMark.
-   */
-  int m_queueMark = 0;
-
-  /**
-   * The parser constructor.
-   */
-  public XPathParser(ErrorListener errorListener, javax.xml.transform.SourceLocator sourceLocator)
-  {
-    m_errorListener = errorListener;
-    m_sourceLocator = sourceLocator;
-  }
-
-  /**
-   * The prefix resolver to map prefixes to namespaces in the OpMap.
-   */
-  PrefixResolver m_namespaceContext;
-
-  /**
-   * Given an string, init an XPath object for selections,
-   * in order that a parse doesn't
-   * have to be done each time the expression is evaluated.
-   * 
-   * @param compiler The compiler object.
-   * @param expression A string conforming to the XPath grammar.
-   * @param namespaceContext An object that is able to resolve prefixes in
-   * the XPath to namespaces.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void initXPath(
-          Compiler compiler, String expression, PrefixResolver namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    m_ops = compiler;
-    m_namespaceContext = namespaceContext;
-
-    Lexer lexer = new Lexer(compiler, namespaceContext, this);
-
-    lexer.tokenize(expression);
-
-    m_ops.m_opMap[0] = OpCodes.OP_XPATH;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] = 2;
-
-    nextToken();
-    Expr();
-
-    if (null != m_token)
-    {
-      String extraTokens = "";
-
-      while (null != m_token)
-      {
-        extraTokens += "'" + m_token + "'";
-
-        nextToken();
-
-        if (null != m_token)
-          extraTokens += ", ";
-      }
-
-      error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS,
-            new Object[]{ extraTokens });  //"Extra illegal tokens: "+extraTokens);
-    }
-
-    compiler.shrink();
-  }
-
-  /**
-   * Given an string, init an XPath object for pattern matches,
-   * in order that a parse doesn't
-   * have to be done each time the expression is evaluated.
-   * @param compiler The XPath object to be initialized.
-   * @param expression A String representing the XPath.
-   * @param namespaceContext An object that is able to resolve prefixes in
-   * the XPath to namespaces.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public void initMatchPattern(
-          Compiler compiler, String expression, PrefixResolver namespaceContext)
-            throws javax.xml.transform.TransformerException
-  {
-
-    m_ops = compiler;
-    m_namespaceContext = namespaceContext;
-
-    Lexer lexer = new Lexer(compiler, namespaceContext, this);
-
-    lexer.tokenize(expression);
-
-    m_ops.m_opMap[0] = OpCodes.OP_MATCHPATTERN;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] = 2;
-
-    nextToken();
-    Pattern();
-
-    if (null != m_token)
-    {
-      String extraTokens = "";
-
-      while (null != m_token)
-      {
-        extraTokens += "'" + m_token + "'";
-
-        nextToken();
-
-        if (null != m_token)
-          extraTokens += ", ";
-      }
-
-      error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS,
-            new Object[]{ extraTokens });  //"Extra illegal tokens: "+extraTokens);
-    }
-
-    // Terminate for safety.
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-    m_ops.shrink();
-  }
-
-  /** The error listener where syntax errors are to be sent.
-   */
-  private ErrorListener m_errorListener;
-  
-  /** The source location of the XPath. */
-  javax.xml.transform.SourceLocator m_sourceLocator;
-
-  /**
-   * Allow an application to register an error event handler, where syntax 
-   * errors will be sent.  If the error listener is not set, syntax errors 
-   * will be sent to System.err.
-   * 
-   * @param handler Reference to error listener where syntax errors will be 
-   *                sent.
-   */
-  public void setErrorHandler(ErrorListener handler)
-  {
-    m_errorListener = handler;
-  }
-
-  /**
-   * Return the current error listener.
-   *
-   * @return The error listener, which should not normally be null, but may be.
-   */
-  public ErrorListener getErrorListener()
-  {
-    return m_errorListener;
-  }
-
-  /**
-   * Check whether m_token matches the target string. 
-   *
-   * @param s A string reference or null.
-   *
-   * @return If m_token is null, returns false (or true if s is also null), or 
-   * return true if the current token matches the string, else false.
-   */
-  final boolean tokenIs(String s)
-  {
-    return (m_token != null) ? (m_token.equals(s)) : (s == null);
-  }
-
-  /**
-   * Check whether m_tokenChar==c. 
-   *
-   * @param c A character to be tested.
-   *
-   * @return If m_token is null, returns false, or return true if c matches 
-   *         the current token.
-   */
-  final boolean tokenIs(char c)
-  {
-    return (m_token != null) ? (m_tokenChar == c) : false;
-  }
-
-  /**
-   * Look ahead of the current token in order to
-   * make a branching decision.
-   *
-   * @param c the character to be tested for.
-   * @param n number of tokens to look ahead.  Must be
-   * greater than 1.
-   *
-   * @return true if the next token matches the character argument.
-   */
-  final boolean lookahead(char c, int n)
-  {
-
-    int pos = (m_queueMark + n);
-    boolean b;
-
-    if ((pos <= m_ops.m_tokenQueueSize) && (pos > 0)
-            && (m_ops.m_tokenQueueSize != 0))
-    {
-      String tok = ((String) m_ops.m_tokenQueue[pos - 1]);
-
-      b = (tok.length() == 1) ? (tok.charAt(0) == c) : false;
-    }
-    else
-    {
-      b = false;
-    }
-
-    return b;
-  }
-
-  /**
-   * Look behind the first character of the current token in order to
-   * make a branching decision.
-   * 
-   * @param c the character to compare it to.
-   * @param n number of tokens to look behind.  Must be
-   * greater than 1.  Note that the look behind terminates
-   * at either the beginning of the string or on a '|'
-   * character.  Because of this, this method should only
-   * be used for pattern matching.
-   *
-   * @return true if the token behind the current token matches the character 
-   *         argument.
-   */
-  private final boolean lookbehind(char c, int n)
-  {
-
-    boolean isToken;
-    int lookBehindPos = m_queueMark - (n + 1);
-
-    if (lookBehindPos >= 0)
-    {
-      String lookbehind = (String) m_ops.m_tokenQueue[lookBehindPos];
-
-      if (lookbehind.length() == 1)
-      {
-        char c0 = (lookbehind == null) ? '|' : lookbehind.charAt(0);
-
-        isToken = (c0 == '|') ? false : (c0 == c);
-      }
-      else
-      {
-        isToken = false;
-      }
-    }
-    else
-    {
-      isToken = false;
-    }
-
-    return isToken;
-  }
-
-  /**
-   * look behind the current token in order to
-   * see if there is a useable token.
-   * 
-   * @param n number of tokens to look behind.  Must be
-   * greater than 1.  Note that the look behind terminates
-   * at either the beginning of the string or on a '|'
-   * character.  Because of this, this method should only
-   * be used for pattern matching.
-   * 
-   * @return true if look behind has a token, false otherwise.
-   */
-  private final boolean lookbehindHasToken(int n)
-  {
-
-    boolean hasToken;
-
-    if ((m_queueMark - n) > 0)
-    {
-      String lookbehind = (String) m_ops.m_tokenQueue[m_queueMark - (n - 1)];
-      char c0 = (lookbehind == null) ? '|' : lookbehind.charAt(0);
-
-      hasToken = (c0 == '|') ? false : true;
-    }
-    else
-    {
-      hasToken = false;
-    }
-
-    return hasToken;
-  }
-
-  /**
-   * Look ahead of the current token in order to
-   * make a branching decision.
-   * 
-   * @param s the string to compare it to.
-   * @param n number of tokens to lookahead.  Must be
-   * greater than 1.
-   *
-   * @return true if the token behind the current token matches the string 
-   *         argument.
-   */
-  private final boolean lookahead(String s, int n)
-  {
-
-    boolean isToken;
-
-    if ((m_queueMark + n) <= m_ops.m_tokenQueueSize)
-    {
-      String lookahead = (String) m_ops.m_tokenQueue[m_queueMark + (n - 1)];
-
-      isToken = (lookahead != null) ? lookahead.equals(s) : (s == null);
-    }
-    else
-    {
-      isToken = (null == s);
-    }
-
-    return isToken;
-  }
-
-  /**
-   * Retrieve the next token from the command and
-   * store it in m_token string.
-   */
-  private final void nextToken()
-  {
-
-    if (m_queueMark < m_ops.m_tokenQueueSize)
-    {
-      m_token = (String) m_ops.m_tokenQueue[m_queueMark++];
-      m_tokenChar = m_token.charAt(0);
-    }
-    else
-    {
-      m_token = null;
-      m_tokenChar = 0;
-    }
-  }
-
-  /**
-   * Retrieve a token relative to the current token.
-   * 
-   * @param i Position relative to current token.
-   *
-   * @return The string at the given index, or null if the index is out 
-   *         of range.
-   */
-  private final String getTokenRelative(int i)
-  {
-
-    String tok;
-    int relative = m_queueMark + i;
-
-    if ((relative > 0) && (relative < m_ops.m_tokenQueueSize))
-    {
-      tok = (String) m_ops.m_tokenQueue[relative];
-    }
-    else
-    {
-      tok = null;
-    }
-
-    return tok;
-  }
-
-  /**
-   * Retrieve the previous token from the command and
-   * store it in m_token string.
-   */
-  private final void prevToken()
-  {
-
-    if (m_queueMark > 0)
-    {
-      m_queueMark--;
-
-      m_token = (String) m_ops.m_tokenQueue[m_queueMark];
-      m_tokenChar = m_token.charAt(0);
-    }
-    else
-    {
-      m_token = null;
-      m_tokenChar = 0;
-    }
-  }
-
-  /**
-   * Consume an expected token, throwing an exception if it
-   * isn't there.
-   *
-   * @param expected The string to be expected.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private final void consumeExpected(String expected)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (tokenIs(expected))
-    {
-      nextToken();
-    }
-    else
-    {
-      error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected,
-                                                                     m_token });  //"Expected "+expected+", but found: "+m_token);
-    }
-  }
-
-  /**
-   * Consume an expected token, throwing an exception if it
-   * isn't there.
-   *
-   * @param expected the character to be expected.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  private final void consumeExpected(char expected)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (tokenIs(expected))
-    {
-      nextToken();
-    }
-    else
-    {
-      error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND,
-            new Object[]{ String.valueOf(expected),
-                          m_token });  //"Expected "+expected+", but found: "+m_token);
-    }
-  }
-
-  /**
-   * Warn the user of a problem.
-   *
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  void warn(int msg, Object[] args) throws TransformerException
-  {
-
-    String fmsg = XSLMessages.createXPATHWarning(msg, args);
-    ErrorListener ehandler = this.getErrorListener();
-
-    if (null != ehandler)
-    {
-      // TO DO: Need to get stylesheet Locator from here.
-      ehandler.warning(new TransformerException(fmsg, m_sourceLocator));
-    }
-    else
-    {
-      // Should never happen.
-      System.err.println(fmsg);
-    }
-  }
-
-  /**
-   * Notify the user of an assertion error, and probably throw an
-   * exception.
-   *
-   * @param b  If false, a runtime exception will be thrown.
-   * @param msg The assertion message, which should be informative.
-   * 
-   * @throws RuntimeException if the b argument is false.
-   */
-  private void assertion(boolean b, String msg)
-  {
-
-    if (!b)
-    {
-      String fMsg = XSLMessages.createXPATHMessage(
-        XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
-        new Object[]{ msg });
-
-      throw new RuntimeException(fMsg);
-    }
-  }
-
-  /**
-   * Notify the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg An error number that corresponds to one of the numbers found 
-   *            in {@link org.apache.xpath.res.XPATHErrorResources}, which is 
-   *            a key for a format string.
-   * @param args An array of arguments represented in the format string, which 
-   *             may be null.
-   *
-   * @throws TransformerException if the current ErrorListoner determines to 
-   *                              throw an exception.
-   */
-  void error(int msg, Object[] args) throws TransformerException
-  {
-
-    String fmsg = XSLMessages.createXPATHMessage(msg, args);
-    ErrorListener ehandler = this.getErrorListener();
-
-    TransformerException te = new TransformerException(fmsg, m_sourceLocator);
-    if (null != ehandler)
-    {
-      // TO DO: Need to get stylesheet Locator from here.
-      ehandler.fatalError(te);
-    }
-    else
-    {
-      // System.err.println(fmsg);
-      throw te;
-    }
-  }
-
-  /**
-   * Dump the remaining token queue.
-   * Thanks to Craig for this.
-   *
-   * @return A dump of the remaining token queue, which may be appended to 
-   *         an error message.
-   */
-  protected String dumpRemainingTokenQueue()
-  {
-
-    int q = m_queueMark;
-    String returnMsg;
-
-    if (q < m_ops.m_tokenQueueSize)
-    {
-      String msg = "\n Remaining tokens: (";
-
-      while (q < m_ops.m_tokenQueueSize)
-      {
-        String t = (String) m_ops.m_tokenQueue[q++];
-
-        msg += (" '" + t + "'");
-      }
-
-      returnMsg = msg + ")";
-    }
-    else
-    {
-      returnMsg = "";
-    }
-
-    return returnMsg;
-  }
-
-  /**
-   * Given a string, return the corresponding function token.
-   *
-   * @param key A local name of a function.
-   *
-   * @return   The function ID, which may correspond to one of the FUNC_XXX 
-   *    values found in {@link org.apache.xpath.compiler.FunctionTable}, but may 
-   *    be a value installed by an external module.
-   */
-  final int getFunctionToken(String key)
-  {
-
-    int tok;
-
-    try
-    {
-      tok = ((Integer) (Keywords.m_functions.get(key))).intValue();
-    }
-    catch (NullPointerException npe)
-    {
-      tok = -1;
-    }
-    catch (ClassCastException cce)
-    {
-      tok = -1;
-    }
-
-    return tok;
-  }
-
-  /**
-   * Insert room for operation.  This will NOT set
-   * the length value of the operation, but will update
-   * the length value for the total expression.
-   *
-   * @param pos The position where the op is to be inserted.
-   * @param length The length of the operation space in the op map.
-   * @param op The op code to the inserted.
-   */
-  void insertOp(int pos, int length, int op)
-  {
-
-    int totalLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    for (int i = totalLen - 1; i >= pos; i--)
-    {
-      m_ops.m_opMap[i + length] = m_ops.m_opMap[i];
-    }
-
-    m_ops.m_opMap[pos] = op;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] = totalLen + length;
-  }
-
-  /**
-   * Insert room for operation.  This WILL set
-   * the length value of the operation, and will update
-   * the length value for the total expression.
-   *
-   * @param length The length of the operation.
-   * @param op The op code to the inserted.
-   */
-  void appendOp(int length, int op)
-  {
-
-    int totalLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    m_ops.m_opMap[totalLen] = op;
-    m_ops.m_opMap[totalLen + OpMap.MAPINDEX_LENGTH] = length;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] = totalLen + length;
-  }
-
-  // ============= EXPRESSIONS FUNCTIONS =================
-
-  /**
-   *
-   *
-   * Expr  ::=  OrExpr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Expr() throws javax.xml.transform.TransformerException
-  {
-    OrExpr();
-  }
-
-  /**
-   *
-   *
-   * OrExpr  ::=  AndExpr
-   * | OrExpr 'or' AndExpr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void OrExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    AndExpr();
-
-    if ((null != m_token) && tokenIs("or"))
-    {
-      nextToken();
-      insertOp(opPos, 2, OpCodes.OP_OR);
-      OrExpr();
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-  }
-
-  /**
-   *
-   *
-   * AndExpr  ::=  EqualityExpr
-   * | AndExpr 'and' EqualityExpr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void AndExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    EqualityExpr(-1);
-
-    if ((null != m_token) && tokenIs("and"))
-    {
-      nextToken();
-      insertOp(opPos, 2, OpCodes.OP_AND);
-      AndExpr();
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-  }
-
-  /**
-   *
-   * @returns an Object which is either a String, a Number, a Boolean, or a vector
-   * of nodes.
-   *
-   * EqualityExpr  ::=  RelationalExpr
-   * | EqualityExpr '=' RelationalExpr
-   *
-   *
-   * @param addPos Position where expression is to be added, or -1 for append.
-   *
-   * @return the position at the end of the equality expression.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected int EqualityExpr(int addPos) throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if (-1 == addPos)
-      addPos = opPos;
-
-    RelationalExpr(-1);
-
-    if (null != m_token)
-    {
-      if (tokenIs('!') && lookahead('=', 1))
-      {
-        nextToken();
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_NOTEQUALS);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = EqualityExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-      else if (tokenIs('='))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_EQUALS);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = EqualityExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-    }
-
-    return addPos;
-  }
-
-  /**
-   * .
-   * @returns an Object which is either a String, a Number, a Boolean, or a vector
-   * of nodes.
-   *
-   * RelationalExpr  ::=  AdditiveExpr
-   * | RelationalExpr '<' AdditiveExpr
-   * | RelationalExpr '>' AdditiveExpr
-   * | RelationalExpr '<=' AdditiveExpr
-   * | RelationalExpr '>=' AdditiveExpr
-   *
-   *
-   * @param addPos Position where expression is to be added, or -1 for append.
-   *
-   * @return the position at the end of the relational expression.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected int RelationalExpr(int addPos) throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if (-1 == addPos)
-      addPos = opPos;
-
-    AdditiveExpr(-1);
-
-    if (null != m_token)
-    {
-      if (tokenIs('<'))
-      {
-        nextToken();
-
-        if (tokenIs('='))
-        {
-          nextToken();
-          insertOp(addPos, 2, OpCodes.OP_LTE);
-        }
-        else
-        {
-          insertOp(addPos, 2, OpCodes.OP_LT);
-        }
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = RelationalExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-      else if (tokenIs('>'))
-      {
-        nextToken();
-
-        if (tokenIs('='))
-        {
-          nextToken();
-          insertOp(addPos, 2, OpCodes.OP_GTE);
-        }
-        else
-        {
-          insertOp(addPos, 2, OpCodes.OP_GT);
-        }
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = RelationalExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-    }
-
-    return addPos;
-  }
-
-  /**
-   * This has to handle construction of the operations so that they are evaluated
-   * in pre-fix order.  So, for 9+7-6, instead of |+|9|-|7|6|, this needs to be
-   * evaluated as |-|+|9|7|6|.
-   *
-   * AdditiveExpr  ::=  MultiplicativeExpr
-   * | AdditiveExpr '+' MultiplicativeExpr
-   * | AdditiveExpr '-' MultiplicativeExpr
-   *
-   *
-   * @param addPos Position where expression is to be added, or -1 for append.
-   *
-   * @return the position at the end of the equality expression.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected int AdditiveExpr(int addPos) throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if (-1 == addPos)
-      addPos = opPos;
-
-    MultiplicativeExpr(-1);
-
-    if (null != m_token)
-    {
-      if (tokenIs('+'))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_PLUS);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = AdditiveExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-      else if (tokenIs('-'))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_MINUS);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = AdditiveExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-    }
-
-    return addPos;
-  }
-
-  /**
-   * This has to handle construction of the operations so that they are evaluated
-   * in pre-fix order.  So, for 9+7-6, instead of |+|9|-|7|6|, this needs to be
-   * evaluated as |-|+|9|7|6|.
-   *
-   * MultiplicativeExpr  ::=  UnaryExpr
-   * | MultiplicativeExpr MultiplyOperator UnaryExpr
-   * | MultiplicativeExpr 'div' UnaryExpr
-   * | MultiplicativeExpr 'mod' UnaryExpr
-   * | MultiplicativeExpr 'quo' UnaryExpr
-   *
-   * @param addPos Position where expression is to be added, or -1 for append.
-   *
-   * @return the position at the end of the equality expression.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected int MultiplicativeExpr(int addPos) throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if (-1 == addPos)
-      addPos = opPos;
-
-    UnaryExpr();
-
-    if (null != m_token)
-    {
-      if (tokenIs('*'))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_MULT);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = MultiplicativeExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-      else if (tokenIs("div"))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_DIV);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = MultiplicativeExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-      else if (tokenIs("mod"))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_MOD);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = MultiplicativeExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-      else if (tokenIs("quo"))
-      {
-        nextToken();
-        insertOp(addPos, 2, OpCodes.OP_QUO);
-
-        int opPlusLeftHandLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - addPos;
-
-        addPos = MultiplicativeExpr(addPos);
-        m_ops.m_opMap[addPos + OpMap.MAPINDEX_LENGTH] =
-          m_ops.m_opMap[addPos + opPlusLeftHandLen + 1] + opPlusLeftHandLen;
-        addPos += 2;
-      }
-    }
-
-    return addPos;
-  }
-
-  /**
-   *
-   * UnaryExpr  ::=  UnionExpr
-   * | '-' UnaryExpr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void UnaryExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-    boolean isNeg = false;
-
-    if (m_tokenChar == '-')
-    {
-      nextToken();
-      appendOp(2, OpCodes.OP_NEG);
-
-      isNeg = true;
-    }
-
-    UnionExpr();
-
-    if (isNeg)
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   *
-   * StringExpr  ::=  Expr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void StringExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    appendOp(2, OpCodes.OP_STRING);
-    Expr();
-
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   *
-   *
-   * StringExpr  ::=  Expr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void BooleanExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    appendOp(2, OpCodes.OP_BOOL);
-    Expr();
-
-    int opLen = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-
-    if (opLen == 2)
-    {
-      error(XPATHErrorResources.ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL, null);  //"boolean(...) argument is no longer optional with 19990709 XPath draft.");
-    }
-
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] = opLen;
-  }
-
-  /**
-   *
-   *
-   * NumberExpr  ::=  Expr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void NumberExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    appendOp(2, OpCodes.OP_NUMBER);
-    Expr();
-
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   * The context of the right hand side expressions is the context of the
-   * left hand side expression. The results of the right hand side expressions
-   * are node sets. The result of the left hand side UnionExpr is the union
-   * of the results of the right hand side expressions.
-   *
-   *
-   * UnionExpr    ::=    PathExpr
-   * | UnionExpr '|' PathExpr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void UnionExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-    boolean continueOrLoop = true;
-    boolean foundUnion = false;
-
-    do
-    {
-      PathExpr();
-
-      if (tokenIs('|'))
-      {
-        if (false == foundUnion)
-        {
-          foundUnion = true;
-
-          insertOp(opPos, 2, OpCodes.OP_UNION);
-        }
-
-        nextToken();
-      }
-      else
-      {
-        break;
-      }
-
-      // this.m_testForDocOrder = true;
-    }
-    while (continueOrLoop);
-
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   * PathExpr  ::=  LocationPath
-   * | FilterExpr
-   * | FilterExpr '/' RelativeLocationPath
-   * | FilterExpr '//' RelativeLocationPath
-   *
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void PathExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-    boolean foundLocationPath;
-
-    FilterExpr();
-
-    if (tokenIs('/'))
-    {
-      nextToken();
-
-      // int locationPathOpPos = opPos;
-      insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH);
-      RelativeLocationPath();
-
-      // Terminate for safety.
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-  }
-
-  /**
-   *
-   *
-   * FilterExpr  ::=  PrimaryExpr
-   * | FilterExpr Predicate
-   *
-   * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
-   * the error condition is severe enough to halt processing.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void FilterExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    // boolean isFunc = lookahead('(', 1);
-    PrimaryExpr();
-
-    if (tokenIs('['))
-    {
-
-      // int locationPathOpPos = opPos;
-      insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH);
-
-      while (tokenIs('['))
-      {
-        Predicate();
-      }
-
-      if (tokenIs('/'))
-      {
-        nextToken();
-        RelativeLocationPath();
-      }
-
-      // Terminate for safety.
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-
-    /*
-     * if(tokenIs('['))
-     * {
-     *   Predicate();
-     *   m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-     * }
-     */
-  }
-
-  /**
-   *
-   * PrimaryExpr  ::=  VariableReference
-   * | '(' Expr ')'
-   * | Literal
-   * | Number
-   * | FunctionCall
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void PrimaryExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if ((m_tokenChar == '\'') || (m_tokenChar == '"'))
-    {
-      appendOp(2, OpCodes.OP_LITERAL);
-      Literal();
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-    else if (m_tokenChar == '$')
-    {
-      nextToken();  // consume '$'
-      appendOp(2, OpCodes.OP_VARIABLE);
-      QName();
-      
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-    else if (m_tokenChar == '(')
-    {
-      nextToken();
-      appendOp(2, OpCodes.OP_GROUP);
-      Expr();
-      consumeExpected(')');
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-    else if ((null != m_token) && ((('.' == m_tokenChar) && (m_token.length() > 1) && Character.isDigit(
-            m_token.charAt(1))) || Character.isDigit(m_tokenChar)))
-    {
-      appendOp(2, OpCodes.OP_NUMBERLIT);
-      Number();
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-    else if (lookahead('(', 1) || (lookahead(':', 1) && lookahead('(', 3)))
-    {
-      FunctionCall();
-    }
-    else
-    {
-      LocationPath();
-    }
-  }
-
-  /**
-   *
-   * Argument    ::=    Expr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Argument() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    appendOp(2, OpCodes.OP_ARGUMENT);
-    Expr();
-
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   *
-   * FunctionCall    ::=    FunctionName '(' ( Argument ( ',' Argument)*)? ')'
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void FunctionCall() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if (lookahead(':', 1))
-    {
-      appendOp(4, OpCodes.OP_EXTFUNCTION);
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 1] = m_queueMark - 1;
-
-      nextToken();
-      consumeExpected(':');
-
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 2] = m_queueMark - 1;
-
-      nextToken();
-    }
-    else
-    {
-      int funcTok = getFunctionToken(m_token);
-
-      if (-1 == funcTok)
-      {
-        error(XPATHErrorResources.ER_COULDNOT_FIND_FUNCTION,
-              new Object[]{ m_token });  //"Could not find function: "+m_token+"()");
-      }
-
-      switch (funcTok)
-      {
-      case OpCodes.NODETYPE_PI :
-      case OpCodes.NODETYPE_COMMENT :
-      case OpCodes.NODETYPE_TEXT :
-      case OpCodes.NODETYPE_NODE :
-        LocationPath();
-
-        return;
-      default :
-        appendOp(3, OpCodes.OP_FUNCTION);
-
-        m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 1] = funcTok;
-      }
-
-      nextToken();
-    }
-
-    consumeExpected('(');
-
-    while (!tokenIs(')') && m_token != null)
-    {
-      if (tokenIs(','))
-      {
-        error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG, null);  //"Found ',' but no preceding argument!");
-      }
-
-      Argument();
-
-      if (!tokenIs(')'))
-      {
-        consumeExpected(',');
-
-        if (tokenIs(')'))
-        {
-          error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
-                null);  //"Found ',' but no following argument!");
-        }
-      }
-    }
-
-    consumeExpected(')');
-
-    // Terminate for safety.
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  // ============= GRAMMAR FUNCTIONS =================
-
-  /**
-   *
-   * LocationPath ::= RelativeLocationPath
-   * | AbsoluteLocationPath
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void LocationPath() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    // int locationPathOpPos = opPos;
-    appendOp(2, OpCodes.OP_LOCATIONPATH);
-
-    if (tokenIs('/'))
-    {
-      appendOp(4, OpCodes.FROM_ROOT);
-
-      // Tell how long the step is without the predicate
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 2] = 4;
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 1] =
-        OpCodes.NODETYPE_ROOT;
-
-      nextToken();
-    }
-
-    if (m_token != null)
-    {
-      RelativeLocationPath();
-    }
-
-    // Terminate for safety.
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   *
-   * RelativeLocationPath ::= Step
-   * | RelativeLocationPath '/' Step
-   * | AbbreviatedRelativeLocationPath
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void RelativeLocationPath() throws javax.xml.transform.TransformerException
-  {
-
-    Step();
-
-    while (tokenIs('/'))
-    {
-      nextToken();
-      Step();
-    }
-  }
-
-  /**
-   *
-   * Step    ::=    Basis Predicate
-   * | AbbreviatedStep
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Step() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    if (tokenIs("."))
-    {
-      nextToken();
-
-      if (tokenIs('['))
-      {
-        error(XPATHErrorResources.ER_PREDICATE_ILLEGAL_SYNTAX, null);  //"'..[predicate]' or '.[predicate]' is illegal syntax.  Use 'self::node()[predicate]' instead.");
-      }
-
-      appendOp(4, OpCodes.FROM_SELF);
-
-      // Tell how long the step is without the predicate
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 2] = 4;
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 1] =
-        OpCodes.NODETYPE_NODE;
-    }
-    else if (tokenIs(".."))
-    {
-      nextToken();
-      appendOp(4, OpCodes.FROM_PARENT);
-
-      // Tell how long the step is without the predicate
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 2] = 4;
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 1] =
-        OpCodes.NODETYPE_NODE;
-    }
-
-    // There is probably a better way to test for this 
-    // transition... but it gets real hairy if you try 
-    // to do it in basis().
-    else if (tokenIs('*') || tokenIs('@') || tokenIs('/')
-             || tokenIs('_') || (m_token!= null && Character.isLetter(m_token.charAt(0))))
-    {
-      Basis();
-
-      while (tokenIs('['))
-      {
-        Predicate();
-      }
-
-      // Tell how long the entire step is.
-      m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-    }
-  }
-
-  /**
-   *
-   * Basis    ::=    AxisName '::' NodeTest
-   * | AbbreviatedBasis
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Basis() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-    int axesType;
-
-    // The next blocks guarantee that a FROM_XXX will be added.
-    if (lookahead("::", 1))
-    {
-      axesType = AxisName();
-
-      nextToken();
-      nextToken();
-    }
-    else if (tokenIs('@'))
-    {
-      axesType = OpCodes.FROM_ATTRIBUTES;
-
-      appendOp(2, axesType);
-      nextToken();
-    }
-    else if (tokenIs('/'))
-    {
-      axesType = OpCodes.FROM_DESCENDANTS_OR_SELF;
-
-      appendOp(2, axesType);
-
-      // Have to fix up for patterns such as '//@foo' or '//attribute::foo',
-      // which translate to 'descendant-or-self::node()/attribute::foo'.
-      // notice I leave the '/' on the queue, so the next will be processed
-      // by a regular step pattern.
-      // if(lookahead('@', 1) || lookahead("::", 2))
-      {
-
-        // Make room for telling how long the step is without the predicate
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] =
-          OpCodes.NODETYPE_NODE;
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-        // Tell how long the step is without the predicate
-        m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 1] =
-          m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-
-        return;  // make a quick exit...
-      }
-
-      // else
-      // {
-      //  nextToken();
-      // }
-    }
-    else
-    {
-      axesType = OpCodes.FROM_CHILDREN;
-
-      appendOp(2, axesType);
-    }
-
-    // Make room for telling how long the step is without the predicate
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-    NodeTest(axesType);
-
-    // Tell how long the step is without the predicate
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 1] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   *
-   * Basis    ::=    AxisName '::' NodeTest
-   * | AbbreviatedBasis
-   *
-   * @return FROM_XXX axes type, found in {@link org.apache.xpath.compiler.Keywords}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected int AxisName() throws javax.xml.transform.TransformerException
-  {
-
-    Object val = Keywords.m_axisnames.get(m_token);
-
-    if (null == val)
-    {
-      error(XPATHErrorResources.ER_ILLEGAL_AXIS_NAME,
-            new Object[]{ m_token });  //"illegal axis name: "+m_token);
-    }
-
-    int axesType = ((Integer) val).intValue();
-
-    appendOp(2, axesType);
-
-    return axesType;
-  }
-
-  /**
-   *
-   * NodeTest    ::=    WildcardName
-   * | NodeType '(' ')'
-   * | 'processing-instruction' '(' Literal ')'
-   *
-   * @param axesType FROM_XXX axes type, found in {@link org.apache.xpath.compiler.Keywords}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void NodeTest(int axesType) throws javax.xml.transform.TransformerException
-  {
-
-    if (lookahead('(', 1))
-    {
-      Object nodeTestOp = Keywords.m_nodetypes.get(m_token);
-
-      if (null == nodeTestOp)
-      {
-        error(XPATHErrorResources.ER_UNKNOWN_NODETYPE,
-              new Object[]{ m_token });  //"Unknown nodetype: "+m_token);
-      }
-      else
-      {
-        nextToken();
-
-        int nt = ((Integer) nodeTestOp).intValue();
-
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = nt;
-        m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-        consumeExpected('(');
-
-        if (OpCodes.NODETYPE_PI == nt)
-        {
-          if (!tokenIs(')'))
-          {
-            Literal();
-          }
-        }
-
-        consumeExpected(')');
-      }
-    }
-    else
-    {
-
-      // Assume name of attribute or element.
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.NODENAME;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-      if (lookahead(':', 1))
-      {
-        if (tokenIs('*'))
-        {
-          m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] =
-            OpCodes.ELEMWILDCARD;
-        }
-        else
-        {
-          m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = m_queueMark
-                  - 1;
-        }
-
-        nextToken();
-        consumeExpected(':');
-      }
-      else
-      {
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.EMPTY;
-      }
-
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-      if (tokenIs('*'))
-      {
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] =
-          OpCodes.ELEMWILDCARD;
-      }
-      else
-      {
-        if (OpCodes.FROM_NAMESPACE == axesType)
-        {
-          String prefix = (String) this.m_ops.m_tokenQueue[m_queueMark - 1];
-          String namespace =
-            ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-              prefix);
-
-          this.m_ops.m_tokenQueue[m_queueMark - 1] = namespace;
-        }
-
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = m_queueMark - 1;
-      }
-
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-      nextToken();
-    }
-  }
-
-  /**
-   *
-   * Predicate ::= '[' PredicateExpr ']'
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Predicate() throws javax.xml.transform.TransformerException
-  {
-
-    if (tokenIs('['))
-    {
-      nextToken();
-      PredicateExpr();
-      consumeExpected(']');
-    }
-  }
-
-  /**
-   *
-   * PredicateExpr ::= Expr
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void PredicateExpr() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    appendOp(2, OpCodes.OP_PREDICATE);
-    Expr();
-
-    // Terminate for safety.
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   * QName ::=  (Prefix ':')? LocalPart
-   * Prefix ::=  NCName
-   * LocalPart ::=  NCName
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void QName() throws javax.xml.transform.TransformerException
-  {
-    // Namespace
-    if(lookahead(':', 1))
-    {
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = m_queueMark - 1;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-      nextToken();
-      consumeExpected(':');
-    }
-    else
-    {
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.EMPTY;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-    }
-    
-    // Local name
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = m_queueMark - 1;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-    nextToken();
-  }
-
-  /**
-   * NCName ::=  (Letter | '_') (NCNameChar)
-   * NCNameChar ::=  Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
-   */
-  protected void NCName()
-  {
-
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = m_queueMark - 1;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-    nextToken();
-  }
-
-  /**
-   * The value of the Literal is the sequence of characters inside
-   * the " or ' characters>.
-   *
-   * Literal  ::=  '"' [^"]* '"'
-   * | "'" [^']* "'"
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Literal() throws javax.xml.transform.TransformerException
-  {
-
-    int last = m_token.length() - 1;
-    char c0 = m_tokenChar;
-    char cX = m_token.charAt(last);
-
-    if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\'')))
-    {
-
-      // Mutate the token to remove the quotes and have the XString object
-      // already made.
-      int tokenQueuePos = m_queueMark - 1;
-
-      m_ops.m_tokenQueue[tokenQueuePos] = null;
-
-      Object obj = new XString(m_token.substring(1, last));
-
-      m_ops.m_tokenQueue[tokenQueuePos] = obj;
-
-      // lit = m_token.substring(1, last);
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = tokenQueuePos;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-      nextToken();
-    }
-    else
-    {
-      error(XPATHErrorResources.ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
-            new Object[]{ m_token });  //"Pattern literal ("+m_token+") needs to be quoted!");
-    }
-  }
-
-  /**
-   *
-   * Number ::= [0-9]+('.'[0-9]+)? | '.'[0-9]+
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Number() throws javax.xml.transform.TransformerException
-  {
-
-    if (null != m_token)
-    {
-
-      // Mutate the token to remove the quotes and have the XNumber object
-      // already made.
-      double num;
-
-      try
-      {
-        num = Double.valueOf(m_token).doubleValue();
-      }
-      catch (NumberFormatException nfe)
-      {
-        num = 0.0;  // to shut up compiler.
-
-        error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
-              new Object[]{ m_token });  //m_token+" could not be formatted to a number!");
-      }
-
-      m_ops.m_tokenQueue[m_queueMark - 1] = new XNumber(num);
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = m_queueMark - 1;
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-      nextToken();
-    }
-  }
-
-  // ============= PATTERN FUNCTIONS =================
-
-  /**
-   *
-   * Pattern  ::=  LocationPathPattern
-   * | Pattern '|' LocationPathPattern
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void Pattern() throws javax.xml.transform.TransformerException
-  {
-
-    while (true)
-    {
-      LocationPathPattern();
-
-      if (tokenIs('|'))
-      {
-        nextToken();
-      }
-      else
-      {
-        break;
-      }
-    }
-  }
-
-  /**
-   *
-   *
-   * LocationPathPattern  ::=  '/' RelativePathPattern?
-   * | IdKeyPattern (('/' | '//') RelativePathPattern)?
-   * | '//'? RelativePathPattern
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void LocationPathPattern() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-
-    appendOp(2, OpCodes.OP_LOCATIONPATHPATTERN);
-
-    if (lookahead('(', 1)
-            && (tokenIs(Keywords.FUNC_ID_STRING)
-                || tokenIs(Keywords.FUNC_KEY_STRING)))
-    {
-      IdKeyPattern();
-
-      if (tokenIs('/') && lookahead('/', 1))
-      {
-        appendOp(4, OpCodes.MATCH_ANY_ANCESTOR);
-
-        // Tell how long the step is without the predicate
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 2] = 4;
-        m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 1] =
-          OpCodes.NODETYPE_FUNCTEST;
-
-        nextToken();
-        nextToken();
-      }
-    }
-    else if (tokenIs('/'))
-    {
-      if (lookahead('/', 1))
-      {
-        appendOp(4, OpCodes.MATCH_ANY_ANCESTOR);
-      }
-      else
-      {
-        appendOp(4, OpCodes.FROM_ROOT);
-      }
-
-      // Tell how long the step is without the predicate
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 2] = 4;
-      m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - 1] =
-        OpCodes.NODETYPE_ROOT;
-
-      nextToken();
-    }
-
-    if (!tokenIs('|') && (null != m_token))
-    {
-      RelativePathPattern();
-    }
-
-    // Terminate for safety.
-    m_ops.m_opMap[m_ops.m_opMap[OpMap.MAPINDEX_LENGTH]] = OpCodes.ENDOP;
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-
-  /**
-   *
-   * IdKeyPattern  ::=  'id' '(' Literal ')'
-   * | 'key' '(' Literal ',' Literal ')'
-   * (Also handle doc())
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void IdKeyPattern() throws javax.xml.transform.TransformerException
-  {
-    FunctionCall();
-  }
-
-  /**
-   *
-   * RelativePathPattern  ::=  StepPattern
-   * | RelativePathPattern '/' StepPattern
-   * | RelativePathPattern '//' StepPattern
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void RelativePathPattern() throws javax.xml.transform.TransformerException
-  {
-
-    StepPattern();
-
-    while (tokenIs('/'))
-    {
-      nextToken();
-      StepPattern();
-    }
-  }
-
-  /**
-   *
-   * StepPattern  ::=  AbbreviatedNodeTestStep
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void StepPattern() throws javax.xml.transform.TransformerException
-  {
-    AbbreviatedNodeTestStep();
-  }
-
-  /**
-   *
-   * AbbreviatedNodeTestStep    ::=    '@'? NodeTest Predicate
-   *
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void AbbreviatedNodeTestStep() throws javax.xml.transform.TransformerException
-  {
-
-    int opPos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-    int axesType;
-
-    // The next blocks guarantee that a MATCH_XXX will be added.
-    int matchTypePos = -1;
-
-    if (tokenIs('@'))
-    {
-      axesType = OpCodes.MATCH_ATTRIBUTE;
-
-      appendOp(2, axesType);
-      nextToken();
-    }
-    else if (this.lookahead("::", 1))
-    {
-      if (tokenIs("attribute"))
-      {
-        axesType = OpCodes.MATCH_ATTRIBUTE;
-
-        appendOp(2, axesType);
-      }
-      else if (tokenIs("child"))
-      {
-        axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR;
-
-        appendOp(2, axesType);
-      }
-      else
-      {
-        axesType = -1;
-
-        this.error(XPATHErrorResources.ER_AXES_NOT_ALLOWED,
-                   new Object[]{ this.m_token });
-      }
-
-      nextToken();
-      nextToken();
-    }
-    else if (tokenIs('/'))
-    {
-      axesType = OpCodes.MATCH_ANY_ANCESTOR;
-
-      appendOp(2, axesType);
-      nextToken();
-    }
-    else
-    {
-      if (tokenIs('/'))
-      {
-        nextToken();
-      }
-
-      matchTypePos = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH];
-      axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR;
-
-      appendOp(2, axesType);
-    }
-
-    // Make room for telling how long the step is without the predicate
-    m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] += 1;
-
-    NodeTest(axesType);
-
-    // Tell how long the step is without the predicate
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH + 1] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-
-    while (tokenIs('['))
-    {
-      Predicate();
-    }
-
-    if ((matchTypePos > -1) && tokenIs('/') && lookahead('/', 1))
-    {
-      m_ops.m_opMap[matchTypePos] = OpCodes.MATCH_ANY_ANCESTOR;
-
-      nextToken();
-    }
-
-    // Tell how long the entire step is.
-    m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] =
-      m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
-  }
-}
diff --git a/src/org/apache/xpath/compiler/package.html b/src/org/apache/xpath/compiler/package.html
deleted file mode 100644
index 43dd328..0000000
--- a/src/org/apache/xpath/compiler/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <title>XPath parsing and compilation support Package.</title>
-  <body>
-    <p>Implements an XPath parser which produces an OpMap, and a so-called Compiler
-    which produces an expression tree for fast evaluation.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/functions/FuncBoolean.java b/src/org/apache/xpath/functions/FuncBoolean.java
deleted file mode 100644
index f2b9c5e..0000000
--- a/src/org/apache/xpath/functions/FuncBoolean.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Boolean() function.
- */
-public class FuncBoolean extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return m_arg0.execute(xctxt).bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncCeiling.java b/src/org/apache/xpath/functions/FuncCeiling.java
deleted file mode 100644
index 19b2c0d..0000000
--- a/src/org/apache/xpath/functions/FuncCeiling.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import java.lang.Math;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Ceiling() function.
- */
-public class FuncCeiling extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(Math.ceil(m_arg0.execute(xctxt).num()));
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncConcat.java b/src/org/apache/xpath/functions/FuncConcat.java
deleted file mode 100644
index c28e561..0000000
--- a/src/org/apache/xpath/functions/FuncConcat.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Concat() function.
- */
-public class FuncConcat extends FunctionMultiArgs
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    StringBuffer sb = new StringBuffer();
-
-    // Compiler says we must have at least two arguments.
-    sb.append(m_arg0.execute(xctxt).str());
-    sb.append(m_arg1.execute(xctxt).str());
-
-    if (null != m_arg2)
-      sb.append(m_arg2.execute(xctxt).str());
-
-    if (null != m_args)
-    {
-      for (int i = 0; i < m_args.length; i++)
-      {
-        sb.append(m_args[i].execute(xctxt).str());
-      }
-    }
-
-    return new XString(sb.toString());
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct.
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum < 2)
-      throw new WrongNumberArgsException(">1");
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncContains.java b/src/org/apache/xpath/functions/FuncContains.java
deleted file mode 100644
index 7043f7f..0000000
--- a/src/org/apache/xpath/functions/FuncContains.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Contains() function.
- */
-public class FuncContains extends Function2Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String s1 = m_arg0.execute(xctxt).str();
-    String s2 = m_arg1.execute(xctxt).str();
-
-    // Add this check for JDK consistency for empty strings.
-    if (s1.length() == 0 && s2.length() == 0)
-      return XBoolean.S_TRUE;
-
-    int index = s1.indexOf(s2);
-
-    return (index > -1) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncCount.java b/src/org/apache/xpath/functions/FuncCount.java
deleted file mode 100644
index 9f9bffd..0000000
--- a/src/org/apache/xpath/functions/FuncCount.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Count() function.
- */
-public class FuncCount extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
-
-    // We should probably make a function on the iterator for this, 
-    // as a given implementation could optimize.
-    int i = 0;
-
-    while (DTM.NULL != nl.nextNode())
-    {
-      i++;
-    }
-    nl.detach();
-
-    return new XNumber((double) i);
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncCurrent.java b/src/org/apache/xpath/functions/FuncCurrent.java
deleted file mode 100644
index ea7e2e4..0000000
--- a/src/org/apache/xpath/functions/FuncCurrent.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.axes.PredicatedNodeTest;
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.axes.SubContextList;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the current() function.
- */
-public class FuncCurrent extends Function
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    // If we're in a predicate, then this will return non-null.
-    Object subContextList = xctxt.getSubContextList();
-    int currentNode;
-
-    // %TBD% Hack city...
-    if (null != subContextList && subContextList instanceof PredicatedNodeTest)
-    {
-      // PredicatedNodeTest iter = (PredicatedNodeTest) xctxt.getSubContextList();
-      // LocPathIterator lpi = iter.getLocPathIterator();
-      LocPathIterator lpi = xctxt.getCurrentNodeList();
-
-      currentNode = lpi.getCurrentContextNode();  
-        
-    }
-    else if(xctxt.getIteratorRoot() != DTM.NULL)
-    {
-      currentNode = xctxt.getIteratorRoot();
-    }
-    else
-    {
-      DTMIterator cnl = xctxt.getContextNodeList();
-
-      if (null != cnl)
-      {
-        // %REVIEW% Not so certain that this is doing the right thing?
-        currentNode = cnl.getCurrentNode();
-      }
-      else
-        currentNode = DTM.NULL;
-    }
-    //  if(DTM.NULL != currentNode)
-    //  {
-    //    DTM dtm = xctxt.getDTM(currentNode);
-    //    System.err.println("current node: "+dtm.getNodeName(currentNode)+"["+Integer.toHexString(currentNode)+"]");
-    //  }
-    //  else
-    //  {
-    //     System.err.println("current node: DTM.NULL");
-    //  }
-
-    return new XNodeSet(currentNode, xctxt.getDTMManager());
-  }
-  
-  /**
-   * No arguments to process, so this does nothing.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-}
diff --git a/src/org/apache/xpath/functions/FuncDoclocation.java b/src/org/apache/xpath/functions/FuncDoclocation.java
deleted file mode 100644
index 2abf007..0000000
--- a/src/org/apache/xpath/functions/FuncDoclocation.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the proprietary document-location() function, which returns
- * a node set of documents.
- */
-public class FuncDoclocation extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    int whereNode = getArg0AsNode(xctxt);
-    String fileLocation = null;
-
-    if (DTM.NULL != whereNode)
-    {
-      DTM dtm = xctxt.getDTM(whereNode);
-      
-      // %REVIEW%
-      if (DTM.DOCUMENT_FRAGMENT_NODE ==  dtm.getNodeType(whereNode))
-      {
-        whereNode = dtm.getFirstChild(whereNode);
-      }
-
-      if (DTM.NULL != whereNode)
-      {        
-        fileLocation = dtm.getDocumentBaseURI();
-//        int owner = dtm.getDocument();
-//        fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
-      }
-    }
-
-    return new XString((null != fileLocation) ? fileLocation : "");
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncExtElementAvailable.java b/src/org/apache/xpath/functions/FuncExtElementAvailable.java
deleted file mode 100644
index a46dd63..0000000
--- a/src/org/apache/xpath/functions/FuncExtElementAvailable.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.utils.QName;
-import org.apache.xalan.extensions.ExtensionsTable;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.transformer.TransformerImpl;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the ExtElementAvailable() function.
- */
-public class FuncExtElementAvailable extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String prefix;
-    String namespace;
-    String methName;
-
-    String fullName = m_arg0.execute(xctxt).str();
-    int indexOfNSSep = fullName.indexOf(':');
-
-    if (indexOfNSSep < 0)
-    {
-      prefix = "";
-      namespace = Constants.S_XSLNAMESPACEURL;
-      methName = fullName;
-    }
-    else
-    {
-      prefix = fullName.substring(0, indexOfNSSep);
-      namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
-      if (null == namespace)
-        return XBoolean.S_FALSE;
-      methName= fullName.substring(indexOfNSSep + 1);
-    }
-
-    if (namespace.equals(Constants.S_XSLNAMESPACEURL)
-    ||  namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL))
-    {
-      try
-      {
-        TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject();
-        return transformer.getStylesheet().getAvailableElements().containsKey(
-                                                            new QName(namespace, methName))
-               ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-      }
-      catch (Exception e)
-      {
-        return XBoolean.S_FALSE;
-      }
-    }
-    else
-    {
-      ExtensionsTable etable = xctxt.getExtensionsTable();
-
-      return etable.elementAvailable(namespace, methName)
-             ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-    }
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncExtFunction.java b/src/org/apache/xpath/functions/FuncExtFunction.java
deleted file mode 100644
index 339ae40..0000000
--- a/src/org/apache/xpath/functions/FuncExtFunction.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import java.util.Vector;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.*;
-import org.apache.xalan.extensions.ExtensionsTable;
-import org.apache.xml.dtm.DTMIterator;
-
-//import org.w3c.dom.Node;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.apache.xml.dtm.*;
-import org.apache.xpath.axes.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * An object of this class represents an extension call expression.  When
- * the expression executes, it calls ExtensionsTable#extFunction, and then
- * converts the result to the appropriate XObject.
- */
-public class FuncExtFunction extends Function
-{
-
-  /**
-   * The namespace for the extension function, which should not normally
-   *  be null or empty.
-   *  @serial    
-   */
-  String m_namespace;
-
-  /**
-   * The local name of the extension.
-   *  @serial   
-   */
-  String m_extensionName;
-
-  /**
-   * Unique method key, which is passed to ExtensionsTable#extFunction in
-   *  order to allow caching of the method.
-   *  @serial 
-   */
-  Object m_methodKey;
-
-  /**
-   * Array of static expressions which represent the parameters to the
-   *  function.
-   *  @serial   
-   */
-  Vector m_argVec = new Vector();
-
-  /**
-   * This function is used to fixup variables from QNames to stack frame
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list
-   * should be searched backwards for the first qualified name that
-   * corresponds to the variable reference qname.  The position of the
-   * QName in the vector from the start of the vector will be its position
-   * in the stack frame (but variables above the globalsTop value will need
-   * to be offset to the current stack frame).
-   * NEEDSDOC @param globalsSize
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-
-    if (null != m_argVec)
-    {
-      int nArgs = m_argVec.size();
-
-      for (int i = 0; i < nArgs; i++)
-      {
-        Expression arg = (Expression) m_argVec.elementAt(i);
-
-        arg.fixupVariables(vars, globalsSize);
-      }
-    }
-  }
-
-  /**
-   * Create a new FuncExtFunction based on the qualified name of the extension,
-   * and a unique method key.
-   *
-   * @param namespace The namespace for the extension function, which should
-   *                  not normally be null or empty.
-   * @param extensionName The local name of the extension.
-   * @param methodKey Unique method key, which is passed to
-   *                  ExtensionsTable#extFunction in order to allow caching
-   *                  of the method.
-   */
-  public FuncExtFunction(java.lang.String namespace,
-                         java.lang.String extensionName, Object methodKey)
-  {
-
-    m_namespace = namespace;
-    m_extensionName = extensionName;
-    m_methodKey = methodKey;
-  }
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    XObject result;
-    Vector argVec = new Vector();
-    int nArgs = m_argVec.size();
-
-    for (int i = 0; i < nArgs; i++)
-    {
-      Expression arg = (Expression) m_argVec.elementAt(i);
-
-      argVec.addElement(arg.execute(xctxt));
-    }
-
-    ExtensionsTable etable = xctxt.getExtensionsTable();
-    Object val = etable.extFunction(m_namespace, m_extensionName, argVec,
-                                    m_methodKey,
-                                    xctxt.getExpressionContext());
-
-    if (null != val)
-    {
-      result = XObject.create(val, xctxt);
-    }
-    else
-    {
-      result = new XNull();
-    }
-
-    return result;
-  }
-
-  /**
-   * Set an argument expression for a function.  This method is called by the
-   * XPath compiler.
-   *
-   * @param arg non-null expression that represents the argument.
-   * @param argNum The argument number index.
-   *
-   * @throws WrongNumberArgsException If the argNum parameter is beyond what
-   * is specified for this function.
-   */
-  public void setArg(Expression arg, int argNum)
-          throws WrongNumberArgsException
-  {
-    m_argVec.addElement(arg);
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct.
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
-}
diff --git a/src/org/apache/xpath/functions/FuncExtFunctionAvailable.java b/src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
deleted file mode 100644
index f819961..0000000
--- a/src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.extensions.ExtensionsTable;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.compiler.Keywords;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the ExtFunctionAvailable() function.
- */
-public class FuncExtFunctionAvailable extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String prefix;
-    String namespace;
-    String methName;
-
-    String fullName = m_arg0.execute(xctxt).str();
-    int indexOfNSSep = fullName.indexOf(':');
-
-    if (indexOfNSSep < 0)
-    {
-      prefix = "";
-      namespace = Constants.S_XSLNAMESPACEURL;
-      methName = fullName;
-    }
-    else
-    {
-      prefix = fullName.substring(0, indexOfNSSep);
-      namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
-      if (null == namespace)
-        return XBoolean.S_FALSE;
-        methName = fullName.substring(indexOfNSSep + 1);
-    }
-
-    if (namespace.equals(Constants.S_XSLNAMESPACEURL))
-    {
-      try
-      {
-        return Keywords.functionAvailable(methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-      }
-      catch (Exception e)
-      {
-        return XBoolean.S_FALSE;
-      }
-    }
-    else
-    {
-      ExtensionsTable etable = xctxt.getExtensionsTable();
-
-      return etable.functionAvailable(namespace, methName)
-             ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-    }
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncFalse.java b/src/org/apache/xpath/functions/FuncFalse.java
deleted file mode 100644
index 99f0491..0000000
--- a/src/org/apache/xpath/functions/FuncFalse.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the False() function.
- */
-public class FuncFalse extends Function
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return XBoolean.S_FALSE;
-  }
-  
-  /**
-   * No arguments to process, so this does nothing.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-}
diff --git a/src/org/apache/xpath/functions/FuncFloor.java b/src/org/apache/xpath/functions/FuncFloor.java
deleted file mode 100644
index d7dc0e1..0000000
--- a/src/org/apache/xpath/functions/FuncFloor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Floor() function.
- */
-public class FuncFloor extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num()));
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncGenerateId.java b/src/org/apache/xpath/functions/FuncGenerateId.java
deleted file mode 100644
index 720183b..0000000
--- a/src/org/apache/xpath/functions/FuncGenerateId.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the GenerateId() function.
- */
-public class FuncGenerateId extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    int which = getArg0AsNode(xctxt);
-
-    if (DTM.NULL != which)
-    {
-      // Note that this is a different value than in previous releases
-      // of Xalan. It's sensitive to the exact encoding of the node
-      // handle anyway, so fighting to maintain backward compatability
-      // really didn't make sense; it may change again as we continue
-      // to experiment with balancing document and node numbers within
-      // that value.
-      return new XString("N" + Integer.toHexString(which).toUpperCase());
-    }
-    else
-      return XString.EMPTYSTRING;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncId.java b/src/org/apache/xpath/functions/FuncId.java
deleted file mode 100644
index 1bfa3d1..0000000
--- a/src/org/apache/xpath/functions/FuncId.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.XPath;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xml.utils.StringVector;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Id() function.
- */
-public class FuncId extends FunctionOneArg
-{
-
-  /**
-   * Fill in a list with nodes that match a space delimited list if ID 
-   * ID references.
-   *
-   * @param xctxt The runtime XPath context.
-   * @param docContext The document where the nodes are being looked for.
-   * @param refval A space delimited list of ID references.
-   * @param usedrefs List of references for which nodes were found.
-   * @param nodeSet Node set where the nodes will be added to.
-   * @param mayBeMore true if there is another set of nodes to be looked for.
-   *
-   * @return The usedrefs value.
-   */
-  private StringVector getNodesByID(XPathContext xctxt, int docContext,
-                                    String refval, StringVector usedrefs,
-                                    NodeSetDTM nodeSet, boolean mayBeMore)
-  {
-
-    if (null != refval)
-    {
-      String ref = null;
-//      DOMHelper dh = xctxt.getDOMHelper();
-      StringTokenizer tokenizer = new StringTokenizer(refval);
-      boolean hasMore = tokenizer.hasMoreTokens();
-      DTM dtm = xctxt.getDTM(docContext);
-
-      while (hasMore)
-      {
-        ref = tokenizer.nextToken();
-        hasMore = tokenizer.hasMoreTokens();
-
-        if ((null != usedrefs) && usedrefs.contains(ref))
-        {
-          ref = null;
-
-          continue;
-        }
-
-        int node = dtm.getElementById(ref);
-
-        if (DTM.NULL != node)
-          nodeSet.addNodeInDocOrder(node, xctxt);
-
-        if ((null != ref) && (hasMore || mayBeMore))
-        {
-          if (null == usedrefs)
-            usedrefs = new StringVector();
-
-          usedrefs.addElement(ref);
-        }
-      }
-    }
-
-    return usedrefs;
-  }
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    int context = xctxt.getCurrentNode();
-    DTM dtm = xctxt.getDTM(context);
-    int docContext = dtm.getDocument();
-
-    if (DTM.NULL == docContext)
-      error(xctxt, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC, null);
-
-    XObject arg = m_arg0.execute(xctxt);
-    int argType = arg.getType();
-    XNodeSet nodes = new XNodeSet(xctxt.getDTMManager());
-    NodeSetDTM nodeSet = nodes.mutableNodeset();
-
-    if (XObject.CLASS_NODESET == argType)
-    {
-      DTMIterator ni = arg.iter();
-      StringVector usedrefs = null;
-      int pos = ni.nextNode();
-
-      while (DTM.NULL != pos)
-      {
-        DTM ndtm = ni.getDTM(pos);
-        String refval = ndtm.getStringValue(pos).toString();
-
-        pos = ni.nextNode();
-        usedrefs = getNodesByID(xctxt, docContext, refval, usedrefs, nodeSet,
-                                DTM.NULL != pos);
-      }
-      // ni.detach();
-    }
-    else if (XObject.CLASS_NULL == argType)
-    {
-      return nodes;
-    }
-    else
-    {
-      String refval = arg.str();
-
-      getNodesByID(xctxt, docContext, refval, null, nodeSet, false);
-    }
-
-    return nodes;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncLang.java b/src/org/apache/xpath/functions/FuncLang.java
deleted file mode 100644
index 5e33559..0000000
--- a/src/org/apache/xpath/functions/FuncLang.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Element;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Lang() function.
- */
-public class FuncLang extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String lang = m_arg0.execute(xctxt).str();
-    int parent = xctxt.getCurrentNode();
-    boolean isLang = false;
-    DTM dtm = xctxt.getDTM(parent);
-
-    while (DTM.NULL != parent)
-    {
-      if (DTM.ELEMENT_NODE == dtm.getNodeType(parent))
-      {
-        int langAttr = dtm.getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang");
-
-        if (DTM.NULL != langAttr)
-        {
-          String langVal = dtm.getNodeValue(langAttr);
-          // %OPT%
-          if (langVal.toLowerCase().startsWith(lang.toLowerCase()))
-          {
-            int valLen = lang.length();
-
-            if ((langVal.length() == valLen)
-                    || (langVal.charAt(valLen) == '-'))
-            {
-              isLang = true;
-            }
-          }
-
-          break;
-        }
-      }
-
-      parent = dtm.getParent(parent);
-    }
-
-    return isLang ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncLast.java b/src/org/apache/xpath/functions/FuncLast.java
deleted file mode 100644
index 277d40e..0000000
--- a/src/org/apache/xpath/functions/FuncLast.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Element;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.axes.SubContextList;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Last() function.
- */
-public class FuncLast extends Function
-{
-
-  /**
-   * Get the position in the current context node list.
-   *
-   * @param xctxt non-null reference to XPath runtime context.
-   *
-   * @return The number of nodes in the list.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public int getCountOfContextNodeList(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // assert(null != m_contextNodeList, "m_contextNodeList must be non-null");
-    // If we're in a predicate, then this will return non-null.
-    SubContextList iter = xctxt.getSubContextList();
-    // System.out.println("iter: "+iter);
-    if (null != iter)
-      return iter.getLastPos(xctxt);
-
-    DTMIterator cnl = xctxt.getContextNodeList();
-    int count;
-    if(null != cnl)
-    {
-      count = cnl.getLength();
-      // System.out.println("count: "+count); 
-    }
-    else
-      count = 0;   
-    return count;
-  }
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt));
-    // System.out.println("last: "+xnum.num());
-    return xnum;
-  }
-  
-  /**
-   * No arguments to process, so this does nothing.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-}
diff --git a/src/org/apache/xpath/functions/FuncLocalPart.java b/src/org/apache/xpath/functions/FuncLocalPart.java
deleted file mode 100644
index 107269a..0000000
--- a/src/org/apache/xpath/functions/FuncLocalPart.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * Execute the LocalPart() function.
- * <meta name="usage" content="advanced"/>
- */
-public class FuncLocalPart extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    int context = getArg0AsNode(xctxt);
-    if(DTM.NULL == context)
-      return XString.EMPTYSTRING;
-    DTM dtm = xctxt.getDTM(context);
-    String s = (context != DTM.NULL) ? dtm.getLocalName(context) : "";
-    if(s.startsWith("#") || s.equals("xmlns"))
-      return XString.EMPTYSTRING;
-
-    return new XString(s);
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncNamespace.java b/src/org/apache/xpath/functions/FuncNamespace.java
deleted file mode 100644
index 6a3925f..0000000
--- a/src/org/apache/xpath/functions/FuncNamespace.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Namespace() function.
- */
-public class FuncNamespace extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    int context = getArg0AsNode(xctxt);
-    
-    String s;
-    if(context != DTM.NULL)
-    {
-      DTM dtm = xctxt.getDTM(context);
-      int t = dtm.getNodeType(context);
-      if(t == DTM.ELEMENT_NODE)
-      {
-        s = dtm.getNamespaceURI(context);
-      }
-      else if(t == DTM.ATTRIBUTE_NODE)
-      {
-
-        // This function always returns an empty string for namespace nodes.
-        // We check for those here.  Fix inspired by Davanum Srinivas.
-
-        s = dtm.getNodeName(context);
-        if(s.startsWith("xmlns:") || s.equals("xmlns"))
-          return XString.EMPTYSTRING;
-
-        s = dtm.getNamespaceURI(context);
-      }
-      else
-        return XString.EMPTYSTRING;
-    }
-    else 
-      return XString.EMPTYSTRING;
-    
-    return ((null == s) ? XString.EMPTYSTRING : new XString(s));
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncNormalizeSpace.java b/src/org/apache/xpath/functions/FuncNormalizeSpace.java
deleted file mode 100644
index ab440f3..0000000
--- a/src/org/apache/xpath/functions/FuncNormalizeSpace.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.objects.XMLStringFactoryImpl;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.apache.xml.utils.FastStringBuffer;
-
-import org.apache.xml.dtm.DTM;
-import org.xml.sax.ContentHandler;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the normalize-space() function.
- */
-public class FuncNormalizeSpace extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    XMLString s1 = getArg0AsString(xctxt);
-
-    return (XString)s1.fixWhiteSpace(true, true, false);
-  }
-  
-  /**
-   * Execute an expression in the XPath runtime context, and return the 
-   * result of the expression.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   *
-   * @return The result of the expression in the form of a <code>XObject</code>.
-   *
-   * @throws javax.xml.transform.TransformerException if a runtime exception 
-   *         occurs.
-   */
-  public void executeCharsToContentHandler(XPathContext xctxt, 
-                                              ContentHandler handler)
-    throws javax.xml.transform.TransformerException,
-           org.xml.sax.SAXException
-  {
-    if(Arg0IsNodesetExpr())
-    {
-      int node = getArg0AsNode(xctxt);
-      if(DTM.NULL != node)
-      {
-        DTM dtm = xctxt.getDTM(node);
-        dtm.dispatchCharactersEvents(node, handler, true);
-      }
-    }
-    else
-    {
-      XObject obj = execute(xctxt);
-      obj.dispatchCharactersEvents(handler);
-    }
-  }
-
-}
diff --git a/src/org/apache/xpath/functions/FuncNot.java b/src/org/apache/xpath/functions/FuncNot.java
deleted file mode 100644
index 9d59600..0000000
--- a/src/org/apache/xpath/functions/FuncNot.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Not() function.
- */
-public class FuncNot extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncNumber.java b/src/org/apache/xpath/functions/FuncNumber.java
deleted file mode 100644
index dbe9257..0000000
--- a/src/org/apache/xpath/functions/FuncNumber.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XNodeSet;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Number() function.
- */
-public class FuncNumber extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(getArg0AsNumber(xctxt));
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncPosition.java b/src/org/apache/xpath/functions/FuncPosition.java
deleted file mode 100644
index 588fbbd..0000000
--- a/src/org/apache/xpath/functions/FuncPosition.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.axes.SubContextList;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xpath.NodeSetDTM;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Position() function.
- */
-public class FuncPosition extends Function
-{
-
-  /**
-   * Get the position in the current context node list.
-   *
-   * @param xctxt Runtime XPath context.
-   *
-   * @return The current position of the itteration in the context node list, 
-   *         or -1 if there is no active context node list.
-   */
-  public int getPositionInContextNodeList(XPathContext xctxt)
-  {
-
-    // System.out.println("FuncPosition- entry");
-    // If we're in a predicate, then this will return non-null.
-    SubContextList iter = xctxt.getSubContextList();
-
-    if (null != iter)
-    {
-      int prox = iter.getProximityPosition(xctxt);
-
-      // System.out.println("FuncPosition- prox: "+prox);
-      return prox;
-    }
-
-    DTMIterator cnl = xctxt.getContextNodeList();
-
-    if (null != cnl)
-    {
-      int n = cnl.getCurrentNode();
-      if(n == DTM.NULL)
-      {
-        if(cnl.getCurrentPos() == 0)
-          return 0;
-          
-        // Then I think we're in a sort.  See sort21.xsl. So the iterator has 
-        // already been spent, and is not on the node we're processing. 
-        // It's highly possible that this is an issue for other context-list 
-        // functions.  Shouldn't be a problem for last(), and it shouldn't be 
-        // a problem for current().
-        try 
-        { 
-          cnl = cnl.cloneWithReset(); 
-        }
-        catch(CloneNotSupportedException cnse)
-        {
-          throw new org.apache.xml.utils.WrappedRuntimeException(cnse);
-        }
-        int currentNode = xctxt.getContextNode();
-        // System.out.println("currentNode: "+currentNode);
-        while(DTM.NULL != (n = cnl.nextNode()))
-        {
-          if(n == currentNode)
-            break;
-        }
-      }
-      // System.out.println("n: "+n);
-      // System.out.println("FuncPosition- cnl.getCurrentPos(): "+cnl.getCurrentPos());
-      return cnl.getCurrentPos();
-    }
-
-    // System.out.println("FuncPosition - out of guesses: -1");
-    return -1;
-  }
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    double pos = (double) getPositionInContextNodeList(xctxt);
-    
-    return new XNumber(pos);
-  }
-  
-  /**
-   * No arguments to process, so this does nothing.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncQname.java b/src/org/apache/xpath/functions/FuncQname.java
deleted file mode 100644
index 24edd9c..0000000
--- a/src/org/apache/xpath/functions/FuncQname.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.traversal.NodeIterator;
-//import org.w3c.dom.Attr;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xml.utils.QName;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Qname() function.
- */
-public class FuncQname extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    int context = getArg0AsNode(xctxt);
-    XObject val;
-
-    if (DTM.NULL != context)
-    {
-      DTM dtm = xctxt.getDTM(context);
-      String qname = dtm.getNodeNameX(context);
-      val = (null == qname) ? XString.EMPTYSTRING : new XString(qname);
-    }
-    else
-    {
-      val = XString.EMPTYSTRING;
-    }
-
-    return val;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncRound.java b/src/org/apache/xpath/functions/FuncRound.java
deleted file mode 100644
index d1bb54d..0000000
--- a/src/org/apache/xpath/functions/FuncRound.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the round() function.
- */
-public class FuncRound extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num()
-                                            + 0.5));
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncStartsWith.java b/src/org/apache/xpath/functions/FuncStartsWith.java
deleted file mode 100644
index 313b1d2..0000000
--- a/src/org/apache/xpath/functions/FuncStartsWith.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the StartsWith() function.
- */
-public class FuncStartsWith extends Function2Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr())
-           ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncString.java b/src/org/apache/xpath/functions/FuncString.java
deleted file mode 100644
index 3fc8525..0000000
--- a/src/org/apache/xpath/functions/FuncString.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xpath.objects.XNodeSet;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the String() function.
- */
-public class FuncString extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return (XString)getArg0AsString(xctxt);
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncStringLength.java b/src/org/apache/xpath/functions/FuncStringLength.java
deleted file mode 100644
index 057c1f2..0000000
--- a/src/org/apache/xpath/functions/FuncStringLength.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XNodeSet;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the StringLength() function.
- */
-public class FuncStringLength extends FunctionDef1Arg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(getArg0AsString(xctxt).length());
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncSubstring.java b/src/org/apache/xpath/functions/FuncSubstring.java
deleted file mode 100644
index fc632fe..0000000
--- a/src/org/apache/xpath/functions/FuncSubstring.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Substring() function.
- */
-public class FuncSubstring extends Function3Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    XMLString s1 = m_arg0.execute(xctxt).xstr();
-    double start = m_arg1.execute(xctxt).num();
-    int lenOfS1 = s1.length();
-    XMLString substr;
-
-    if (lenOfS1 <= 0)
-      return XString.EMPTYSTRING;
-    else
-    {
-      int startIndex;
-
-      if (Double.isNaN(start))
-      {
-
-        // Double.MIN_VALUE doesn't work with math below 
-        // so just use a big number and hope I never get caught.
-        start = -1000000;
-        startIndex = 0;
-      }
-      else
-      {
-        start = Math.round(start);
-        startIndex = (start > 0) ? (int) start - 1 : 0;
-      }
-
-      if (null != m_arg2)
-      {
-        double len = m_arg2.num(xctxt);
-        int end = (int) (Math.round(len) + start) - 1;
-
-        // Normalize end index.
-        if (end < 0)
-          end = 0;
-        else if (end > lenOfS1)
-          end = lenOfS1;
-
-        if (startIndex > lenOfS1)
-          startIndex = lenOfS1;
-
-        substr = s1.substring(startIndex, end);
-      }
-      else
-      {
-        if (startIndex > lenOfS1)
-          startIndex = lenOfS1;
-        substr = s1.substring(startIndex);
-      }
-    }
-
-    return (XString)substr; // cast semi-safe
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct. 
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum < 2)
-      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3");
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncSubstringAfter.java b/src/org/apache/xpath/functions/FuncSubstringAfter.java
deleted file mode 100644
index cf45316..0000000
--- a/src/org/apache/xpath/functions/FuncSubstringAfter.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the SubstringAfter() function.
- */
-public class FuncSubstringAfter extends Function2Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    XMLString s1 = m_arg0.execute(xctxt).xstr();
-    XMLString s2 = m_arg1.execute(xctxt).xstr();
-    int index = s1.indexOf(s2);
-
-    return (-1 == index)
-           ? XString.EMPTYSTRING
-           : (XString)s1.substring(index + s2.length());
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncSubstringBefore.java b/src/org/apache/xpath/functions/FuncSubstringBefore.java
deleted file mode 100644
index 94402cb..0000000
--- a/src/org/apache/xpath/functions/FuncSubstringBefore.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the SubstringBefore() function.
- */
-public class FuncSubstringBefore extends Function2Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String s1 = m_arg0.execute(xctxt).str();
-    String s2 = m_arg1.execute(xctxt).str();
-    int index = s1.indexOf(s2);
-
-    return (-1 == index)
-           ? XString.EMPTYSTRING : new XString(s1.substring(0, index));
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncSum.java b/src/org/apache/xpath/functions/FuncSum.java
deleted file mode 100644
index 6ee8615..0000000
--- a/src/org/apache/xpath/functions/FuncSum.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XString;
-
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Sum() function.
- */
-public class FuncSum extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    DTMIterator nodes = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
-    double sum = 0.0;
-    int pos;
-
-    while (DTM.NULL != (pos = nodes.nextNode()))
-    {
-      DTM dtm = nodes.getDTM(pos);
-      XMLString s = dtm.getStringValue(pos);
-
-      if (null != s)
-        sum += s.toDouble();
-    }
-    nodes.detach();
-
-    return new XNumber(sum);
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncSystemProperty.java b/src/org/apache/xpath/functions/FuncSystemProperty.java
deleted file mode 100644
index 05e67cb..0000000
--- a/src/org/apache/xpath/functions/FuncSystemProperty.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import java.util.Properties;
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-
-import java.lang.ClassLoader;
-
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the SystemProperty() function.
- */
-public class FuncSystemProperty extends FunctionOneArg
-{
-
-  /** 
-   * The path/filename of the property file: XSLTInfo.properties  
-   * Maintenance note: see also org.apache.xalan.processor.TransformerFactoryImpl.XSLT_PROPERTIES
-   */
-  static String XSLT_PROPERTIES = "org/apache/xalan/res/XSLTInfo.properties";
-	
-	/** a zero length Class array used in loadPropertyFile() */
-  private static final Class[] NO_CLASSES = new Class[0];
-
-  /** a zero length Object array used in loadPropertyFile() */
-  private static final Object[] NO_OBJS = new Object[0];
-
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String fullName = m_arg0.execute(xctxt).str();
-    int indexOfNSSep = fullName.indexOf(':');
-    String result;
-    String propName = "";
-    
-    /* List of properties where the name of the property argument is 
-     *  to be looked for. */
-    Properties xsltInfo = new Properties();
-
-    loadPropertyFile(XSLT_PROPERTIES, xsltInfo);
-
-    if (indexOfNSSep > 0)
-    {
-      String prefix = (indexOfNSSep >= 0)
-                      ? fullName.substring(0, indexOfNSSep) : "";
-      String namespace;
-
-      namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
-      propName = (indexOfNSSep < 0)
-                 ? fullName : fullName.substring(indexOfNSSep + 1);
-
-      if (namespace.startsWith("http://www.w3.org/XSL/Transform")
-              || namespace.equals("http://www.w3.org/1999/XSL/Transform"))
-      {
-        result = xsltInfo.getProperty(propName);
-
-        if (null == result)
-        {
-          warn(xctxt, XPATHErrorResources.WG_PROPERTY_NOT_SUPPORTED,
-               new Object[]{ fullName });  //"XSL Property not supported: "+fullName);
-
-          return XString.EMPTYSTRING;
-        }
-      }
-      else
-      {
-        warn(xctxt, XPATHErrorResources.WG_DONT_DO_ANYTHING_WITH_NS,
-             new Object[]{ namespace,
-                           fullName });  //"Don't currently do anything with namespace "+namespace+" in property: "+fullName);
-
-        try
-        {
-          result = System.getProperty(propName);
-
-          if (null == result)
-          {
-
-            // result = System.getenv(propName);
-            return XString.EMPTYSTRING;
-          }
-        }
-        catch (SecurityException se)
-        {
-          warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION,
-               new Object[]{ fullName });  //"SecurityException when trying to access XSL system property: "+fullName);
-
-          return XString.EMPTYSTRING;
-        }
-      }
-    }
-    else
-    {
-      try
-      {
-        result = System.getProperty(fullName);
-
-        if (null == result)
-        {
-
-          // result = System.getenv(fullName);
-          return XString.EMPTYSTRING;
-        }
-      }
-      catch (SecurityException se)
-      {
-        warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION,
-             new Object[]{ fullName });  //"SecurityException when trying to access XSL system property: "+fullName);
-
-        return XString.EMPTYSTRING;
-      }
-    }
-
-    if (propName.equals("version") && result.length() > 0)
-    {
-      try
-      {
-        // Needs to return the version number of the spec we conform to.
-        return new XNumber(1.0);
-      }
-      catch (Exception ex)
-      {
-        return new XString(result);
-      }
-    }
-    else
-      return new XString(result);
-  }
-
-  /**
-   * Retrieve a propery bundle from a specified file
-   * 
-   * @param file The string name of the property file.  The name 
-   * should already be fully qualified as path/filename
-   * @param target The target property bag the file will be placed into.
-   */
-  public void loadPropertyFile(String file, Properties target)
-  {
-
-    InputStream is = null;
-
-    try
-    {
-      try {
-        java.lang.reflect.Method getCCL = Thread.class.getMethod("getContextClassLoader", NO_CLASSES);
-        if (getCCL != null) {
-          ClassLoader contextClassLoader = (ClassLoader) getCCL.invoke(Thread.currentThread(), NO_OBJS);
-          is = contextClassLoader.getResourceAsStream(file); // file should be already fully specified
-        }
-      }
-      catch (Exception e) {}
-
-      if (is == null) {
-        // NOTE! For the below getResourceAsStream in Sun JDK 1.1.8M
-        //  we apparently must add the leading slash character - I 
-        //  don't know why, but if it's not there, we throw an NPE from the below loading
-        is = FuncSystemProperty.class.getResourceAsStream("/" + file); // file should be already fully specified
-      }
-
-      // get a buffered version
-      BufferedInputStream bis = new BufferedInputStream(is);
-
-      target.load(bis);  // and load up the property bag from this
-      bis.close();  // close out after reading
-    }
-    catch (Exception ex)
-    {
-      // ex.printStackTrace();
-      throw new org.apache.xml.utils.WrappedRuntimeException(ex);
-    }
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncTranslate.java b/src/org/apache/xpath/functions/FuncTranslate.java
deleted file mode 100644
index 5e8f263..0000000
--- a/src/org/apache/xpath/functions/FuncTranslate.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the Translate() function.
- */
-public class FuncTranslate extends Function3Args
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String theFirstString = m_arg0.execute(xctxt).str();
-    String theSecondString = m_arg1.execute(xctxt).str();
-    String theThirdString = m_arg2.execute(xctxt).str();
-    int theFirstStringLength = theFirstString.length();
-    int theThirdStringLength = theThirdString.length();
-
-    // A vector to contain the new characters.  We'll use it to construct
-    // the result string.
-    StringBuffer sbuffer = new StringBuffer();
-
-    for (int i = 0; i < theFirstStringLength; i++)
-    {
-      char theCurrentChar = theFirstString.charAt(i);
-      int theIndex = theSecondString.indexOf(theCurrentChar);
-
-      if (theIndex < 0)
-      {
-
-        // Didn't find the character in the second string, so it
-        // is not translated.
-        sbuffer.append(theCurrentChar);
-      }
-      else if (theIndex < theThirdStringLength)
-      {
-
-        // OK, there's a corresponding character in the
-        // third string, so do the translation...
-        sbuffer.append(theThirdString.charAt(theIndex));
-      }
-      else
-      {
-
-        // There's no corresponding character in the
-        // third string, since it's shorter than the
-        // second string.  In this case, the character
-        // is removed from the output string, so don't
-        // do anything.
-      }
-    }
-
-    return new XString(sbuffer.toString());
-  }
-}
diff --git a/src/org/apache/xpath/functions/FuncTrue.java b/src/org/apache/xpath/functions/FuncTrue.java
deleted file mode 100644
index 2b13449..0000000
--- a/src/org/apache/xpath/functions/FuncTrue.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Execute the True() function.
- */
-public class FuncTrue extends Function
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-    return XBoolean.S_TRUE;
-  }
-  
-  /**
-   * No arguments to process, so this does nothing.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-}
diff --git a/src/org/apache/xpath/functions/FuncUnparsedEntityURI.java b/src/org/apache/xpath/functions/FuncUnparsedEntityURI.java
deleted file mode 100644
index ff7289e..0000000
--- a/src/org/apache/xpath/functions/FuncUnparsedEntityURI.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.res.XPATHErrorResources;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Element;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * <meta name="usage" content="advanced"/>
- */
-public class FuncUnparsedEntityURI extends FunctionOneArg
-{
-
-  /**
-   * Execute the function.  The function must return
-   * a valid object.
-   * @param xctxt The current execution context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    String name = m_arg0.execute(xctxt).str();
-    int context = xctxt.getCurrentNode();
-    DTM dtm = xctxt.getDTM(context);
-    int doc = dtm.getDocument();
-    
-    String uri = dtm.getUnparsedEntityURI(name);
-
-    return new XString(uri);
-  }
-}
diff --git a/src/org/apache/xpath/functions/Function.java b/src/org/apache/xpath/functions/Function.java
deleted file mode 100644
index 1af83dd..0000000
--- a/src/org/apache/xpath/functions/Function.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import java.util.Vector;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.XPath;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.Expression;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This is a superclass of all XPath functions.  This allows two
- * ways for the class to be called. One method is that the
- * super class processes the arguments and hands the results to
- * the derived class, the other method is that the derived
- * class may process it's own arguments, which is faster since
- * the arguments don't have to be added to an array, but causes
- * a larger code footprint.
- */
-public abstract class Function extends Expression
-{
-
-  /**
-   * Set an argument expression for a function.  This method is called by the 
-   * XPath compiler.
-   *
-   * @param arg non-null expression that represents the argument.
-   * @param argNum The argument number index.
-   *
-   * @throws WrongNumberArgsException If the argNum parameter is beyond what 
-   * is specified for this function.
-   */
-  public void setArg(Expression arg, int argNum)
-          throws WrongNumberArgsException
-  {
-    throw new WrongNumberArgsException("0");
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct.
-   * This method is meant to be overloaded by derived classes, to check for 
-   * the number of arguments for a specific function type.  This method is 
-   * called by the compiler for static number of arguments checking.
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum != 0)
-      throw new WrongNumberArgsException("0");
-  }
-
-  /**
-   * Execute an XPath function object.  The function must return
-   * a valid object.
-   * @param xctxt The execution current context.
-   * @return A valid XObject.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    // Programmer's assert.  (And, no, I don't want the method to be abstract).
-    System.out.println("Error! Function.execute should not be called!");
-
-    return null;
-  }
-  
-
-}
diff --git a/src/org/apache/xpath/functions/Function2Args.java b/src/org/apache/xpath/functions/Function2Args.java
deleted file mode 100644
index 4fab1e0..0000000
--- a/src/org/apache/xpath/functions/Function2Args.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.Expression;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Base class for functions that accept two arguments.
- */
-public class Function2Args extends FunctionOneArg
-{
-
-  /** The second argument passed to the function (at index 1).
-   *  @serial  */
-  Expression m_arg1;
-
-  /**
-   * Return the second argument passed to the function (at index 1).
-   *
-   * @return An expression that represents the second argument passed to the 
-   *         function.
-   */
-  public Expression getArg1()
-  {
-    return m_arg1;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    super.fixupVariables(vars, globalsSize);
-    if(null != m_arg1)
-      m_arg1.fixupVariables(vars, globalsSize);
-  }
-
-
-  /**
-   * Set an argument expression for a function.  This method is called by the 
-   * XPath compiler.
-   *
-   * @param arg non-null expression that represents the argument.
-   * @param argNum The argument number index.
-   *
-   * @throws WrongNumberArgsException If the argNum parameter is greater than 1.
-   */
-  public void setArg(Expression arg, int argNum)
-          throws WrongNumberArgsException
-  {
-
-    // System.out.println("argNum: "+argNum);
-    if (argNum == 0)
-      super.setArg(arg, argNum);
-    else if (1 == argNum)
-      m_arg1 = arg;
-    else
-      throw new WrongNumberArgsException("2");
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct. 
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum != 2)
-      throw new WrongNumberArgsException("2");
-  }
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-    return super.canTraverseOutsideSubtree() 
-    ? true : m_arg1.canTraverseOutsideSubtree();
-   }
-
-}
diff --git a/src/org/apache/xpath/functions/Function3Args.java b/src/org/apache/xpath/functions/Function3Args.java
deleted file mode 100644
index 48f67a0..0000000
--- a/src/org/apache/xpath/functions/Function3Args.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.Expression;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Base class for functions that accept three arguments.
- */
-public class Function3Args extends Function2Args
-{
-
-  /** The third argument passed to the function (at index 2).
-   *  @serial  */
-  Expression m_arg2;
-
-  /**
-   * Return the third argument passed to the function (at index 2).
-   *
-   * @return An expression that represents the third argument passed to the 
-   *         function.
-   */
-  public Expression getArg2()
-  {
-    return m_arg2;
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    super.fixupVariables(vars, globalsSize);
-    if(null != m_arg2)
-      m_arg2.fixupVariables(vars, globalsSize);
-  }
-
-  /**
-   * Set an argument expression for a function.  This method is called by the 
-   * XPath compiler.
-   *
-   * @param arg non-null expression that represents the argument.
-   * @param argNum The argument number index.
-   *
-   * @throws WrongNumberArgsException If the argNum parameter is greater than 2.
-   */
-  public void setArg(Expression arg, int argNum)
-          throws WrongNumberArgsException
-  {
-
-    if (argNum < 2)
-      super.setArg(arg, argNum);
-    else if (2 == argNum)
-      m_arg2 = arg;
-    else
-      throw new WrongNumberArgsException("3");
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct. 
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum != 3)
-      throw new WrongNumberArgsException("3");
-  }
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-    return super.canTraverseOutsideSubtree() 
-    ? true : m_arg2.canTraverseOutsideSubtree();
-   }
-
-}
diff --git a/src/org/apache/xpath/functions/FunctionDef1Arg.java b/src/org/apache/xpath/functions/FunctionDef1Arg.java
deleted file mode 100644
index 7c3e255..0000000
--- a/src/org/apache/xpath/functions/FunctionDef1Arg.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-//import org.w3c.dom.Node;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XString;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-
-import org.apache.xml.utils.XMLString;
-
-import org.apache.xml.dtm.DTM;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Base class for functions that accept one argument that can be defaulted if
- * not specified.
- */
-public class FunctionDef1Arg extends FunctionOneArg
-{
-
-  /**
-   * Execute the first argument expression that is expected to return a
-   * nodeset.  If the argument is null, then return the current context node.
-   *
-   * @param xctxt Runtime XPath context.
-   *
-   * @return The first node of the executed nodeset, or the current context
-   *         node if the first argument is null.
-   *
-   * @throws javax.xml.transform.TransformerException if an error occurs while
-   *                                   executing the argument expression.
-   */
-  protected int getArg0AsNode(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return (null == m_arg0)
-           ? xctxt.getCurrentNode() : m_arg0.asNode(xctxt);
-  }
-  
-  /**
-   * Tell if the expression is a nodeset expression.
-   * @return true if the expression can be represented as a nodeset.
-   */
-  public boolean Arg0IsNodesetExpr()
-  {
-    return (null == m_arg0) ? true : m_arg0.isNodesetExpr();
-  }
-
-  /**
-   * Execute the first argument expression that is expected to return a
-   * string.  If the argument is null, then get the string value from the
-   * current context node.
-   *
-   * @param xctxt Runtime XPath context.
-   *
-   * @return The string value of the first argument, or the string value of the
-   *         current context node if the first argument is null.
-   *
-   * @throws javax.xml.transform.TransformerException if an error occurs while
-   *                                   executing the argument expression.
-   */
-  protected XMLString getArg0AsString(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    if(null == m_arg0)
-    {
-      int currentNode = xctxt.getCurrentNode();
-      if(DTM.NULL == currentNode)
-        return XString.EMPTYSTRING;
-      else
-      {
-        DTM dtm = xctxt.getDTM(currentNode);
-        return dtm.getStringValue(currentNode);
-      }
-      
-    }
-    else
-      return m_arg0.execute(xctxt).xstr();   
-  }
-
-  /**
-   * Execute the first argument expression that is expected to return a
-   * number.  If the argument is null, then get the number value from the
-   * current context node.
-   *
-   * @param xctxt Runtime XPath context.
-   *
-   * @return The number value of the first argument, or the number value of the
-   *         current context node if the first argument is null.
-   *
-   * @throws javax.xml.transform.TransformerException if an error occurs while
-   *                                   executing the argument expression.
-   */
-  protected double getArg0AsNumber(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if(null == m_arg0)
-    {
-      int currentNode = xctxt.getCurrentNode();
-      if(DTM.NULL == currentNode)
-        return 0;
-      else
-      {
-        DTM dtm = xctxt.getDTM(currentNode);
-        XMLString str = dtm.getStringValue(currentNode);
-        return str.toDouble();
-      }
-      
-    }
-    else
-      return m_arg0.execute(xctxt).num();
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct.
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException if the number of arguments is not 0 or 1.
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum > 1)
-      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ZERO_OR_ONE, null)); //"0 or 1");
-  }
-
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-    return (null == m_arg0) ? false : super.canTraverseOutsideSubtree();
-  }
-}
diff --git a/src/org/apache/xpath/functions/FunctionMultiArgs.java b/src/org/apache/xpath/functions/FunctionMultiArgs.java
deleted file mode 100644
index 025884a..0000000
--- a/src/org/apache/xpath/functions/FunctionMultiArgs.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.Expression;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Base class for functions that accept an undetermined number of multiple
- * arguments.
- */
-public class FunctionMultiArgs extends Function3Args
-{
-
-  /** Argument expressions that are at index 3 or greater.
-   *  @serial */
-  Expression[] m_args;
-
-  /**
-   * Set an argument expression for a function.  This method is called by the
-   * XPath compiler.
-   *
-   * @param arg non-null expression that represents the argument.
-   * @param argNum The argument number index.
-   *
-   * @throws WrongNumberArgsException If a derived class determines that the
-   * number of arguments is incorrect.
-   */
-  public void setArg(Expression arg, int argNum)
-          throws WrongNumberArgsException
-  {
-
-    if (argNum < 3)
-      super.setArg(arg, argNum);
-    else
-    {
-      if (null == m_args)
-      {
-        m_args = new Expression[1];
-        m_args[0] = arg;
-      }
-      else
-      {
-
-        // Slow but space conservative.
-        Expression[] args = new Expression[m_args.length + 1];
-
-        System.arraycopy(m_args, 0, args, 0, m_args.length);
-
-        args[m_args.length] = arg;
-        m_args = args;
-      }
-    }
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    super.fixupVariables(vars, globalsSize);
-    if(null != m_args)
-    {
-      for (int i = 0; i < m_args.length; i++) 
-      {
-        m_args[i].fixupVariables(vars, globalsSize);
-      }
-    }
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct.
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
-
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-
-    if (super.canTraverseOutsideSubtree())
-      return true;
-    else
-    {
-      int n = m_args.length;
-
-      for (int i = 0; i < n; i++)
-      {
-        if (m_args[i].canTraverseOutsideSubtree())
-          return true;
-      }
-
-      return false;
-    }
-  }
-}
diff --git a/src/org/apache/xpath/functions/FunctionOneArg.java b/src/org/apache/xpath/functions/FunctionOneArg.java
deleted file mode 100644
index 513a375..0000000
--- a/src/org/apache/xpath/functions/FunctionOneArg.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-import org.apache.xpath.Expression;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Base class for functions that accept one argument.
- */
-public class FunctionOneArg extends Function
-{
-
-  /** The first argument passed to the function (at index 0).
-   *  @serial  */
-  Expression m_arg0;
-
-  /**
-   * Return the first argument passed to the function (at index 0).
-   *
-   * @return An expression that represents the first argument passed to the 
-   *         function.
-   */
-  public Expression getArg0()
-  {
-    return m_arg0;
-  }
-  
-  /**
-   * Set an argument expression for a function.  This method is called by the 
-   * XPath compiler.
-   *
-   * @param arg non-null expression that represents the argument.
-   * @param argNum The argument number index.
-   *
-   * @throws WrongNumberArgsException If the argNum parameter is greater than 0.
-   */
-  public void setArg(Expression arg, int argNum)
-          throws WrongNumberArgsException
-  {
-
-    if (0 == argNum)
-      m_arg0 = arg;
-    else
-      throw new WrongNumberArgsException("1");
-  }
-
-  /**
-   * Check that the number of arguments passed to this function is correct. 
-   *
-   *
-   * @param argNum The number of arguments that is being passed to the function.
-   *
-   * @throws WrongNumberArgsException
-   */
-  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
-  {
-    if (argNum != 1)
-      throw new WrongNumberArgsException("1");
-  }
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-    return m_arg0.canTraverseOutsideSubtree();
-   }
-   
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    if(null != m_arg0)
-      m_arg0.fixupVariables(vars, globalsSize);
-  }
-
-}
diff --git a/src/org/apache/xpath/functions/WrongNumberArgsException.java b/src/org/apache/xpath/functions/WrongNumberArgsException.java
deleted file mode 100644
index e5ed626..0000000
--- a/src/org/apache/xpath/functions/WrongNumberArgsException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.functions;
-
-/**
- * <meta name="usage" content="advanced"/>
- * An exception that is thrown if the wrong number of arguments to an exception 
- * are specified by the stylesheet.
- */
-public class WrongNumberArgsException extends Exception
-{
-
-  /**
-   * Constructor WrongNumberArgsException
-   *
-   * @param argsExpected Error message that tells the number of arguments that 
-   * were expected.
-   */
-  public WrongNumberArgsException(String argsExpected)
-  {
-
-    super(argsExpected);
-  }
-}
diff --git a/src/org/apache/xpath/functions/package.html b/src/org/apache/xpath/functions/package.html
deleted file mode 100644
index 1e60c3f..0000000
--- a/src/org/apache/xpath/functions/package.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-  <title>XPath functions Package.</title>
-  <body>
-    <p>Implements XPath functions -- each function is derived from Function, 
-    FunctionOneArg, Function2Args, etc, with number-of-arguments checking being 
-    applied mainly at compile time -- this package only implements XPath functions, 
-    XSLT functions are found in the "templates" package.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/objects/XBoolean.java b/src/org/apache/xpath/objects/XBoolean.java
deleted file mode 100644
index 6d406ee..0000000
--- a/src/org/apache/xpath/objects/XBoolean.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.w3c.dom.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class represents an XPath boolean object, and is capable of
- * converting the boolean to other types, such as a string.
- */
-public class XBoolean extends XObject
-{
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * A true boolean object so we don't have to keep creating them.
-   */
-  public static XBoolean S_TRUE = new XBooleanStatic(true);
-
-  /**
-   * <meta name="usage" content="internal"/>
-   * A true boolean object so we don't have to keep creating them.
-   */
-  public static XBoolean S_FALSE = new XBooleanStatic(false);
-
-  /** Value of the object.
-   *  @serial         */
-  boolean m_val;
-
-  /**
-   * Construct a XBoolean object.
-   *
-   * @param b Value of the boolean object
-   */
-  public XBoolean(boolean b)
-  {
-
-    super();
-
-    m_val = b;
-  }
-  
-  /**
-   * Construct a XBoolean object.
-   *
-   * @param b Value of the boolean object
-   */
-  public XBoolean(Boolean b)
-  {
-
-    super();
-
-    m_val = b.booleanValue();
-    m_obj = b;
-  }
-
-
-  /**
-   * Tell that this is a CLASS_BOOLEAN.
-   *
-   * @return type of CLASS_BOOLEAN
-   */
-  public int getType()
-  {
-    return CLASS_BOOLEAN;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#BOOLEAN"
-   */
-  public String getTypeString()
-  {
-    return "#BOOLEAN";
-  }
-
-  /**
-   * Cast result object to a number.
-   *
-   * @return numeric value of the object value
-   */
-  public double num()
-  {
-    return m_val ? 1.0 : 0.0;
-  }
-
-  /**
-   * Cast result object to a boolean.
-   *
-   * @return The object value as a boolean
-   */
-  public boolean bool()
-  {
-    return m_val;
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The object's value as a string
-   */
-  public String str()
-  {
-    return m_val ? "true" : "false";
-  }
-
-  /**
-   * Return a java object that's closest to the representation
-   * that should be handed to an extension.
-   *
-   * @return The object's value as a java object
-   */
-  public Object object()
-  {
-    if(null == m_obj)
-      m_obj = m_val ? S_TRUE : S_FALSE;
-    return m_obj;
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare to this  
-   *
-   * @return True if the two objects are equal
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.equals(this);
-
-    try
-    {
-      return m_val == obj2.bool();
-    }
-    catch(javax.xml.transform.TransformerException te)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    }
-  }
-
-}
diff --git a/src/org/apache/xpath/objects/XBooleanStatic.java b/src/org/apache/xpath/objects/XBooleanStatic.java
deleted file mode 100644
index c56898a..0000000
--- a/src/org/apache/xpath/objects/XBooleanStatic.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.w3c.dom.*;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * <meta name="usage" content="internal"/>
- * This class doesn't have any XPathContext, so override
- * whatever to ensure it works OK.
- */
-public class XBooleanStatic extends XBoolean
-{
-
-  /** The value of the object.
-   *  @serial          */
-  boolean m_val;
-
-  /**
-   * Construct a XBooleanStatic object.
-   *
-   * @param b The value of the object
-   */
-  public XBooleanStatic(boolean b)
-  {
-
-    super(b);
-
-    m_val = b;
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare to this 
-   *
-   * @return True if the two objects are equal
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-    try
-    {
-      return m_val == obj2.bool();
-    }
-    catch(javax.xml.transform.TransformerException te)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    }
-  }
-}
diff --git a/src/org/apache/xpath/objects/XMLStringFactoryImpl.java b/src/org/apache/xpath/objects/XMLStringFactoryImpl.java
deleted file mode 100644
index bfcd520..0000000
--- a/src/org/apache/xpath/objects/XMLStringFactoryImpl.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.apache.xml.utils.FastStringBuffer;
-
-/**
- * <meta name="usage" content="internal"/>
- * Class XMLStringFactoryImpl creates XString versions of XMLStrings.
- */
-public class XMLStringFactoryImpl extends XMLStringFactory
-{
-  /** The XMLStringFactory to pass to DTM construction.   */
-  private static XMLStringFactory m_xstringfactory =
-    new XMLStringFactoryImpl();
-
-  /**
-   * Get the XMLStringFactory to pass to DTM construction.
-   *
-   *
-   * @return A never-null static reference to a String factory.
-   */
-  public static XMLStringFactory getFactory()
-  {
-    return m_xstringfactory;
-  }
-
-  /**
-   * Create a new XMLString from a Java string.
-   *
-   *
-   * @param string Java String reference, which must be non-null.
-   *
-   * @return An XMLString object that wraps the String reference.
-   */
-  public XMLString newstr(String string)
-  {
-    return new XString(string);
-  }
-
-  /**
-   * Create a XMLString from a FastStringBuffer.
-   *
-   *
-   * @param string FastStringBuffer reference, which must be non-null.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   *
-   * @return An XMLString object that wraps the FastStringBuffer reference.
-   */
-  public XMLString newstr(FastStringBuffer fsb, int start, int length)
-  {
-    return new XStringForFSB(fsb, start, length);
-  }
-  
-  /**
-   * Create a XMLString from a FastStringBuffer.
-   *
-   *
-   * @param string FastStringBuffer reference, which must be non-null.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   *
-   * @return An XMLString object that wraps the FastStringBuffer reference.
-   */
-  public XMLString newstr(char[] string, int start, int length)
-  {
-    return new XStringForChars(string, start, length);
-  }
-  
-  /**
-   * Get a cheap representation of an empty string.
-   * 
-   * @return An non-null reference to an XMLString that represents "".
-   */
-  public XMLString emptystr()
-  {
-    return XString.EMPTYSTRING;
-  }
-
-}
diff --git a/src/org/apache/xpath/objects/XNodeSet.java b/src/org/apache/xpath/objects/XNodeSet.java
deleted file mode 100644
index 051a4d8..0000000
--- a/src/org/apache/xpath/objects/XNodeSet.java
+++ /dev/null
@@ -1,970 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-//import org.w3c.dom.Node;
-//import org.w3c.dom.Text;
-//import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.NodeList;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMManager;
-
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xml.utils.StringVector;
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath nodeset object, and is capable of
- * converting the nodeset to other types, such as a string.
- */
-public class XNodeSet extends XObject
-{
-  protected DTMManager m_dtmMgr;
-  
-  public DTMManager getDTMMgr()
-  {
-    return m_dtmMgr;
-  }
-  
-  /**
-   * Default constructor for derived objects.
-   */
-  protected XNodeSet()
-  {
-  }
-
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param val Value of the XNodeSet object
-   */
-  public XNodeSet(DTMIterator val)
-  {
-    super(val);
-    m_dtmMgr = val.getDTMManager();
-  }
-
-  /**
-   * Construct an empty XNodeSet object.  This is used to create a mutable 
-   * nodeset to which random nodes may be added.
-   */
-  public XNodeSet(DTMManager dtmMgr)
-  {
-    super(new NodeSetDTM(dtmMgr));
-    m_dtmMgr = dtmMgr;
-  }
-
-  /**
-   * Construct a XNodeSet object for one node.
-   *
-   * @param n Node to add to the new XNodeSet object
-   */
-  public XNodeSet(int n, DTMManager dtmMgr)
-  {
-
-    super(new NodeSetDTM(dtmMgr));
-    m_dtmMgr = dtmMgr;
-
-    if (DTM.NULL != n)
-    {
-      ((NodeSetDTM) m_obj).addNode(n);
-    }
-  }
-
-  /**
-   * Tell that this is a CLASS_NODESET.
-   *
-   * @return type CLASS_NODESET
-   */
-  public int getType()
-  {
-    return CLASS_NODESET;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#NODESET"
-   */
-  public String getTypeString()
-  {
-    return "#NODESET";
-  }
-
-  /**
-   * Get numeric value of the string conversion from a single node.
-   *
-   * @param n Node to convert
-   *
-   * @return numeric value of the string conversion from a single node.
-   */
-  public double getNumberFromNode(int n)
-  {
-    XMLString xstr = m_dtmMgr.getDTM(n).getStringValue(n);
-    return xstr.toDouble();
-  }
-
-  /**
-   * Cast result object to a number.
-   *
-   * @return numeric value of the string conversion from the 
-   * next node in the NodeSetDTM, or NAN if no node was found
-   */
-  public double num()
-  {
-
-    DTMIterator nl = iter();
-    int node = nl.nextNode();
-
-    return (node != DTM.NULL) ? getNumberFromNode(node) : Double.NaN;
-  }
-  
-  /**
-   * Cast result object to a number, but allow side effects, such as the 
-   * incrementing of an iterator.
-   *
-   * @return numeric value of the string conversion from the 
-   * next node in the NodeSetDTM, or NAN if no node was found
-   */
-  public double numWithSideEffects()
-  {
-    DTMIterator nl = iterRaw();
-    int node = nl.nextNode();
-
-    return (node != DTM.NULL) ? getNumberFromNode(node) : Double.NaN;
-  }
-
-
-  /**
-   * Cast result object to a boolean.
-   *
-   * @return True if there is a next node in the nodeset
-   */
-  public boolean bool()
-  {
-    return (iter().nextNode() != DTM.NULL);
-  }
-  
-  /**
-   * Cast result object to a boolean, but allow side effects, such as the 
-   * incrementing of an iterator.
-   *
-   * @return True if there is a next node in the nodeset
-   */
-  public boolean boolWithSideEffects()
-  {
-    return (iterRaw().nextNode() != DTM.NULL);
-  }
-
-  
-  /**
-   * Get the string conversion from a single node.
-   *
-   * @param n Node to convert
-   *
-   * @return the string conversion from a single node.
-   */
-  public XMLString getStringFromNode(int n)
-  {
-    // %OPT%
-    // I guess we'll have to get a static instance of the DTM manager...
-    if(DTM.NULL != n)
-    {
-      return m_dtmMgr.getDTM(n).getStringValue(n);
-    }
-    else
-    {
-      return org.apache.xpath.objects.XString.EMPTYSTRING;
-    }
-  }
-  
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value. Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
-          throws org.xml.sax.SAXException
-  {
-    DTMIterator nl = iter();
-    int node = nl.nextNode();
-
-    if(node != DTM.NULL)
-    {
-      m_dtmMgr.getDTM(node).dispatchCharactersEvents(node, ch, false);
-    }
-  }
-  
-  /**
-   * Cast result object to an XMLString.
-   *
-   * @return The document fragment node data or the empty string. 
-   */
-  public XMLString xstr()
-  {
-    DTMIterator nl = iter();
-    int node = nl.nextNode();
-
-    return (node != DTM.NULL) ? getStringFromNode(node) : XString.EMPTYSTRING;
-  }
-  
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public void appendToFsb(org.apache.xml.utils.FastStringBuffer fsb)
-  {
-    XString xstring = (XString)xstr();
-    xstring.appendToFsb(fsb);
-  }
-  
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   * 
-   * @param allowRelease true if it is OK for detach to release this iterator 
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease)
-  {
-    if(null != m_obj)
-      ((DTMIterator) m_obj).allowDetachToRelease(allowRelease);
-  }
-
-  /**
-   * Detaches the <code>DTMIterator</code> from the set which it iterated
-   * over, releasing any computational resources and placing the iterator
-   * in the INVALID state. After <code>detach</code> has been invoked,
-   * calls to <code>nextNode</code> or <code>previousNode</code> will
-   * raise a runtime exception.
-   */
-  public void detach()
-  {
-    if(null != m_obj)
-    {
-      Object obj = m_obj;
-      m_obj = null;
-      ((DTMIterator) obj).detach();
-    }
-  }
-
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return the string conversion from the next node in the nodeset
-   * or "" if there is no next node
-   */
-  public String str()
-  {
-
-    DTMIterator nl = iter();
-    int node = nl.nextNode();
-
-    return (node != DTM.NULL) ? getStringFromNode(node).toString() : "";
-  }
-
-  // %REVIEW%
-  // hmmm...
-//  /**
-//   * Cast result object to a result tree fragment.
-//   *
-//   * @param support The XPath context to use for the conversion 
-//   *
-//   * @return the nodeset as a result tree fragment.
-//   */
-//  public DocumentFragment rtree(XPathContext support)
-//  {
-//    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-//    DocumentBuilder db = dbf.newDocumentBuilder();
-//    Document myDoc = db.newDocument();
-//    
-//    DocumentFragment docFrag = myDoc.createDocumentFragment();
-//
-//    DTMIterator nl = iter();
-//    int node;
-//
-//    while (DTM.NULL != (node = nl.nextNode()))
-//    {
-//      frag.appendChild(node, true, true);
-//    }
-//
-//    return frag.getDocument();
-//  }
-
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeIterator nodeset() throws javax.xml.transform.TransformerException
-  {
-    return new org.apache.xml.dtm.ref.DTMNodeIterator(iter());
-  }
-  
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeList nodelist() throws javax.xml.transform.TransformerException
-  {
-    return new org.apache.xml.dtm.ref.DTMNodeList(iter());
-  }
-
-  
-//  /**
-//   * Return a java object that's closest to the representation
-//   * that should be handed to an extension.
-//   *
-//   * @return The object that this class wraps
-//   */
-//  public Object object()
-//  {
-//    return new org.apache.xml.dtm.ref.DTMNodeList(iter());
-//  }
-
-  /**
-   * Return the iterator without cloning, etc.
-   */
-  public DTMIterator iterRaw()
-  {
-
-    // System.out.println("In XNodeSet.iter()");
-    return (DTMIterator) m_obj;
-  }
-  
-  /**
-   * Cast result object to a nodelist.
-   *
-   * @return The nodeset as a nodelist
-   */
-  public DTMIterator iter()
-  {
-    try
-    {
-      return ((DTMIterator) m_obj).cloneWithReset();
-    }
-    catch (CloneNotSupportedException cnse)
-    {
-      throw new RuntimeException(cnse.getMessage());
-    }
-  }
-
-  /**
-   * Cast result object to a mutableNodeset.
-   *
-   * @return The nodeset as a mutableNodeset
-   */
-  public NodeSetDTM mutableNodeset()
-  {
-
-    NodeSetDTM mnl;
-
-    if(m_obj instanceof NodeSetDTM)
-    {
-      mnl = (NodeSetDTM) m_obj;
-    }
-    else
-    {
-      mnl = new NodeSetDTM(iter());
-      m_obj = mnl;
-    }
-
-    return mnl;
-  }
-
-  /** Less than comparator         */
-  static LessThanComparator S_LT = new LessThanComparator();
-
-  /** Less than or equal comparator          */
-  static LessThanOrEqualComparator S_LTE = new LessThanOrEqualComparator();
-
-  /** Greater than comparator         */
-  static GreaterThanComparator S_GT = new GreaterThanComparator();
-
-  /** Greater than or equal comparator          */
-  static GreaterThanOrEqualComparator S_GTE =
-    new GreaterThanOrEqualComparator();
-
-  /** Equal comparator         */
-  static EqualComparator S_EQ = new EqualComparator();
-
-  /** Not equal comparator         */
-  static NotEqualComparator S_NEQ = new NotEqualComparator();
-
-  /**
-   * Tell if one object is less than the other.
-   *
-   * @param obj2 Object to compare this nodeset to
-   * @param comparator Comparator to use
-   *
-   * @return See the comments below for each object type comparison 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean compare(XObject obj2, Comparator comparator)
-          throws javax.xml.transform.TransformerException
-  {
-
-    boolean result = false;
-    int type = obj2.getType();
-
-    if (XObject.CLASS_NODESET == type)
-    {
-      // %OPT% This should be XMLString based instead of string based...
-
-      // From http://www.w3.org/TR/xpath: 
-      // If both objects to be compared are node-sets, then the comparison 
-      // will be true if and only if there is a node in the first node-set 
-      // and a node in the second node-set such that the result of performing 
-      // the comparison on the string-values of the two nodes is true.
-      // Note this little gem from the draft:
-      // NOTE: If $x is bound to a node-set, then $x="foo" 
-      // does not mean the same as not($x!="foo"): the former 
-      // is true if and only if some node in $x has the string-value 
-      // foo; the latter is true if and only if all nodes in $x have 
-      // the string-value foo.
-      DTMIterator list1 = iter();
-      DTMIterator list2 = ((XNodeSet) obj2).iter();
-      int node1;
-      java.util.Vector node2Strings = null;
-
-      while (DTM.NULL != (node1 = list1.nextNode()))
-      {
-        XMLString s1 = getStringFromNode(node1);
-
-        if (null == node2Strings)
-        {
-          int node2;
-
-          while (DTM.NULL != (node2 = list2.nextNode()))
-          {
-            XMLString s2 = getStringFromNode(node2);
-
-            if (comparator.compareStrings(s1, s2))
-            {
-              result = true;
-
-              break;
-            }
-
-            if (null == node2Strings)
-              node2Strings = new java.util.Vector();
-
-            node2Strings.addElement(s2);
-          }
-        }
-        else
-        {
-          int n = node2Strings.size();
-
-          for (int i = 0; i < n; i++)
-          {
-            if (comparator.compareStrings(s1, (XMLString)node2Strings.elementAt(i)))
-            {
-              result = true;
-
-              break;
-            }
-          }
-        }
-      }
-    }
-    else if (XObject.CLASS_BOOLEAN == type)
-    {
-
-      // From http://www.w3.org/TR/xpath: 
-      // If one object to be compared is a node-set and the other is a boolean, 
-      // then the comparison will be true if and only if the result of 
-      // performing the comparison on the boolean and on the result of 
-      // converting the node-set to a boolean using the boolean function 
-      // is true.
-      double num1 = bool() ? 1.0 : 0.0;
-      double num2 = obj2.num();
-
-      result = comparator.compareNumbers(num1, num2);
-    }
-    else if (XObject.CLASS_NUMBER == type)
-    {
-
-      // From http://www.w3.org/TR/xpath: 
-      // If one object to be compared is a node-set and the other is a number, 
-      // then the comparison will be true if and only if there is a 
-      // node in the node-set such that the result of performing the 
-      // comparison on the number to be compared and on the result of 
-      // converting the string-value of that node to a number using 
-      // the number function is true. 
-      DTMIterator list1 = iter();
-      double num2 = obj2.num();
-      int node;
-
-      while (DTM.NULL != (node = list1.nextNode()))
-      {
-        double num1 = getNumberFromNode(node);
-
-        if (comparator.compareNumbers(num1, num2))
-        {
-          result = true;
-
-          break;
-        }
-      }
-    }
-    else if (XObject.CLASS_RTREEFRAG == type)
-    {
-      XMLString s2 = obj2.xstr();
-      DTMIterator list1 = iter();
-      int node;
-
-      while (DTM.NULL != (node = list1.nextNode()))
-      {
-        XMLString s1 = getStringFromNode(node);
-
-        if (comparator.compareStrings(s1, s2))
-        {
-          result = true;
-
-          break;
-        }
-      }
-    }
-    else if (XObject.CLASS_STRING == type)
-    {
-
-      // From http://www.w3.org/TR/xpath: 
-      // If one object to be compared is a node-set and the other is a 
-      // string, then the comparison will be true if and only if there 
-      // is a node in the node-set such that the result of performing 
-      // the comparison on the string-value of the node and the other 
-      // string is true. 
-      XMLString s2 = obj2.xstr();
-      DTMIterator list1 = iter();
-      int node;
-
-      while (DTM.NULL != (node = list1.nextNode()))
-      {
-        XMLString s1 = getStringFromNode(node);
-        if (comparator.compareStrings(s1, s2))
-        {
-          result = true;
-
-          break;
-        }
-      }
-    }
-    else
-    {
-      result = comparator.compareNumbers(this.num(), obj2.num());
-    }
-
-    return result;
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   *
-   * @param obj2 object to compare this nodeset to
-   *
-   * @return see this.compare(...) 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean lessThan(XObject obj2) throws javax.xml.transform.TransformerException
-  {
-    return compare(obj2, S_LT);
-  }
-
-  /**
-   * Tell if one object is less than or equal to the other.
-   *
-   * @param obj2 object to compare this nodeset to
-   *
-   * @return see this.compare(...) 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException
-  {
-    return compare(obj2, S_LTE);
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   *
-   * @param obj2 object to compare this nodeset to
-   *
-   * @return see this.compare(...) 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean greaterThan(XObject obj2) throws javax.xml.transform.TransformerException
-  {
-    return compare(obj2, S_GT);
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   *
-   * @param obj2 object to compare this nodeset to
-   *
-   * @return see this.compare(...) 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean greaterThanOrEqual(XObject obj2)
-          throws javax.xml.transform.TransformerException
-  {
-    return compare(obj2, S_GTE);
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 object to compare this nodeset to
-   *
-   * @return see this.compare(...) 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-    try
-    {
-      return compare(obj2, S_EQ);
-    }
-    catch(javax.xml.transform.TransformerException te)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    }
-  }
-
-  /**
-   * Tell if two objects are functionally not equal.
-   *
-   * @param obj2 object to compare this nodeset to
-   *
-   * @return see this.compare(...) 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException
-  {
-    return compare(obj2, S_NEQ);
-  }
-}
-
-/**
- * compares nodes for various boolean operations.
- */
-abstract class Comparator
-{
-
-  /**
-   * Compare two strings
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare 
-   *
-   * @return Whether the strings are equal or not
-   */
-  abstract boolean compareStrings(XMLString s1, XMLString s2);
-
-  /**
-   * Compare two numbers
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return Whether the numbers are equal or not
-   */
-  abstract boolean compareNumbers(double n1, double n2);
-}
-
-/**
- * Compare strings or numbers for less than.
- */
-class LessThanComparator extends Comparator
-{
-
-  /**
-   * Compare two strings for less than.
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare 
-   *
-   * @return True if s1 is less than s2
-   */
-  boolean compareStrings(XMLString s1, XMLString s2)
-  {
-    return (s1.toDouble() < s2.toDouble());
-    // return s1.compareTo(s2) < 0;
-  }
-
-  /**
-   * Compare two numbers for less than.
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return true if n1 is less than n2
-   */
-  boolean compareNumbers(double n1, double n2)
-  {
-    return n1 < n2;
-  }
-}
-
-/**
- * Compare strings or numbers for less than or equal.
- */
-class LessThanOrEqualComparator extends Comparator
-{
-
-  /**
-   * Compare two strings for less than or equal.
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare
-   *
-   * @return true if s1 is less than or equal to s2
-   */
-  boolean compareStrings(XMLString s1, XMLString s2)
-  {
-    return (s1.toDouble() <= s2.toDouble());
-    // return s1.compareTo(s2) <= 0;
-  }
-
-  /**
-   * Compare two numbers for less than or equal.
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return true if n1 is less than or equal to n2
-   */
-  boolean compareNumbers(double n1, double n2)
-  {
-    return n1 <= n2;
-  }
-}
-
-/**
- * Compare strings or numbers for greater than.
- */
-class GreaterThanComparator extends Comparator
-{
-
-  /**
-   * Compare two strings for greater than.
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare
-   *
-   * @return true if s1 is greater than s2
-   */
-  boolean compareStrings(XMLString s1, XMLString s2)
-  {
-    return (s1.toDouble() > s2.toDouble());
-    // return s1.compareTo(s2) > 0;
-  }
-
-  /**
-   * Compare two numbers for greater than.
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return true if n1 is greater than n2
-   */
-  boolean compareNumbers(double n1, double n2)
-  {
-    return n1 > n2;
-  }
-}
-
-/**
- * Compare strings or numbers for greater than or equal.
- */
-class GreaterThanOrEqualComparator extends Comparator
-{
-
-  /**
-   * Compare two strings for greater than or equal.
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare
-   *
-   * @return true if s1 is greater than or equal to s2
-   */
-  boolean compareStrings(XMLString s1, XMLString s2)
-  {
-    return (s1.toDouble() >= s2.toDouble());
-    // return s1.compareTo(s2) >= 0;
-  }
-
-  /**
-   * Compare two numbers for greater than or equal.
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return true if n1 is greater than or equal to n2
-   */
-  boolean compareNumbers(double n1, double n2)
-  {
-    return n1 >= n2;
-  }
-}
-
-/**
- * Compare strings or numbers for equality.
- */
-class EqualComparator extends Comparator
-{
-
-  /**
-   * Compare two strings for equality.
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare
-   *
-   * @return true if s1 is equal to s2
-   */
-  boolean compareStrings(XMLString s1, XMLString s2)
-  {
-    return s1.equals(s2);
-  }
-
-  /**
-   * Compare two numbers for equality.
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return true if n1 is equal to n2
-   */
-  boolean compareNumbers(double n1, double n2)
-  {
-    return n1 == n2;
-  }
-}
-
-/**
- * Compare strings or numbers for non-equality.
- */
-class NotEqualComparator extends Comparator
-{
-
-  /**
-   * Compare two strings for non-equality.
-   *
-   *
-   * @param s1 First string to compare
-   * @param s2 Second String to compare
-   *
-   * @return true if s1 is not equal to s2
-   */
-  boolean compareStrings(XMLString s1, XMLString s2)
-  {
-    return !s1.equals(s2);
-  }
-
-  /**
-   * Compare two numbers for non-equality.
-   *
-   *
-   * @param n1 First number to compare
-   * @param n2 Second number to compare
-   *
-   * @return true if n1 is not equal to n2
-   */
-  boolean compareNumbers(double n1, double n2)
-  {
-    return n1 != n2;
-  }
-}
diff --git a/src/org/apache/xpath/objects/XNodeSetForDOM.java b/src/org/apache/xpath/objects/XNodeSetForDOM.java
deleted file mode 100644
index a1c236b..0000000
--- a/src/org/apache/xpath/objects/XNodeSetForDOM.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.apache.xpath.objects;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.apache.xml.dtm.*;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.XPathContext;
-
-/**
- * This class overrides the XNodeSet#object() method to provide the original 
- * Node object, NodeList object, or NodeIterator.
- */
-public class XNodeSetForDOM extends XNodeSet
-{
-  Object m_origObj;
-
-  public XNodeSetForDOM(Node node, DTMManager dtmMgr)
-  {
-    m_dtmMgr = dtmMgr;
-    m_origObj = node;
-    int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
-    m_obj = new NodeSetDTM(dtmMgr);
-    ((NodeSetDTM) m_obj).addNode(dtmHandle);
-  }
-  
-  public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
-  {
-    m_dtmMgr = xctxt.getDTMManager();
-    m_origObj = nodeList;
-    m_obj = new org.apache.xpath.NodeSetDTM(nodeList, xctxt);
-  }
-
-  public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)
-  {
-    m_dtmMgr = xctxt.getDTMManager();
-    m_origObj = nodeIter;
-    m_obj = new org.apache.xpath.NodeSetDTM(nodeIter, xctxt);
-  }
-  
-  /**
-   * Return the original DOM object that the user passed in.  For use primarily
-   * by the extension mechanism.
-   *
-   * @return The object that this class wraps
-   */
-  public Object object()
-  {
-    return m_origObj;
-  }
-  
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeIterator nodeset() throws javax.xml.transform.TransformerException
-  {
-    return (m_origObj instanceof NodeIterator) 
-                   ? (NodeIterator)m_origObj : super.nodeset();      
-  }
-  
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeList nodelist() throws javax.xml.transform.TransformerException
-  {
-    return (m_origObj instanceof NodeList) 
-                   ? (NodeList)m_origObj : super.nodelist();      
-  }
-
-
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/objects/XNull.java b/src/org/apache/xpath/objects/XNull.java
deleted file mode 100644
index 9c39ee7..0000000
--- a/src/org/apache/xpath/objects/XNull.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-//import org.w3c.dom.traversal.NodeIterator;
-//import org.w3c.dom.DocumentFragment;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSetDTM;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath null object, and is capable of
- * converting the null to other types, such as a string.
- */
-public class XNull extends XObject
-{
-
-  /**
-   * Create an XObject.
-   */
-  public XNull()
-  {
-    super();
-  }
-
-  /**
-   * Tell what kind of class this is.
-   *
-   * @return type CLASS_NULL
-   */
-  public int getType()
-  {
-    return CLASS_NULL;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#CLASS_NULL"
-   */
-  public String getTypeString()
-  {
-    return "#CLASS_NULL";
-  }
-
-  /**
-   * Cast result object to a number.
-   * 
-   * @return 0.0
-   */
-
-  public double num()
-  {
-    return 0.0;
-  }
-
-  /**
-   * Cast result object to a boolean.
-   *
-   * @return false
-   */
-  public boolean bool()
-  {
-    return false;
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return empty string ""
-   */
-  public String str()
-  {
-    return "";
-  }
-
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support XPath context to use for the conversion
-   *
-   * @return The object as a result tree fragment.
-   */
-  public int rtf(XPathContext support)
-  {
-    // DTM frag = support.createDocumentFragment();
-    // %REVIEW%
-    return DTM.NULL;
-  }
-
-  /**
-   * Cast result object to a nodelist.
-   *
-   * @return null
-   */
-  public DTMIterator iter()
-  {
-    return null;
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if the given object is of type CLASS_NULL
-   */
-  public boolean equals(XObject obj2)
-  {
-    return obj2.getType() == CLASS_NULL;
-  }
-}
diff --git a/src/org/apache/xpath/objects/XNumber.java b/src/org/apache/xpath/objects/XNumber.java
deleted file mode 100644
index 4df9eab..0000000
--- a/src/org/apache/xpath/objects/XNumber.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.w3c.dom.*;
-import java.math.BigDecimal;
-import org.apache.xpath.XPathContext;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath number, and is capable of
- * converting the number to other types, such as a string.
- */
-public class XNumber extends XObject
-{
-
-  /** Value of the XNumber object.
-   *  @serial         */
-  double m_val;
-
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param d Value of the object
-   */
-  public XNumber(double d)
-  {
-    super();
-
-    m_val = d;
-  }
-  
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param d Value of the object
-   */
-  public XNumber(Number num)
-  {
-
-    super();
-
-    m_val = num.doubleValue();
-    m_obj = num;
-  }
-
-  /**
-   * Tell that this is a CLASS_NUMBER.
-   *
-   * @return node type CLASS_NUMBER 
-   */
-  public int getType()
-  {
-    return CLASS_NUMBER;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#NUMBER" 
-   */
-  public String getTypeString()
-  {
-    return "#NUMBER";
-  }
-
-  /**
-   * Cast result object to a number.
-   *
-   * @return the value of the XNumber object
-   */
-  public double num()
-  {
-    return m_val;
-  }
-  
-  /**
-   * Evaluate expression to a number.
-   *
-   * @return 0.0
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt) 
-    throws javax.xml.transform.TransformerException
-  {
-
-    return m_val;
-  }
-
-  /**
-   * Cast result object to a boolean.
-   *
-   * @return false if the value is NaN or equal to 0.0
-   */
-  public boolean bool()
-  {
-    return (Double.isNaN(m_val) || (m_val == 0.0)) ? false : true;
-  }
-
-//  /**
-//   * Cast result object to a string.
-//   *
-//   * @return "NaN" if the number is NaN, Infinity or -Infinity if
-//   * the number is infinite or the string value of the number.
-//   */
-//  private static final int PRECISION = 16;
-//  public String str()
-//  {
-//
-//    if (Double.isNaN(m_val))
-//    {
-//      return "NaN";
-//    }
-//    else if (Double.isInfinite(m_val))
-//    {
-//      if (m_val > 0)
-//        return "Infinity";
-//      else
-//        return "-Infinity";
-//    }
-//
-//    long longVal = (long)m_val;
-//    if ((double)longVal == m_val)
-//      return Long.toString(longVal);
-//
-//
-//    String s = Double.toString(m_val);
-//    int len = s.length();
-//
-//    if (s.charAt(len - 2) == '.' && s.charAt(len - 1) == '0')
-//    {
-//      return s.substring(0, len - 2);
-//    }
-//
-//    int exp = 0;
-//    int e = s.indexOf('E');
-//    if (e != -1)
-//    {
-//      exp = Integer.parseInt(s.substring(e + 1));
-//      s = s.substring(0,e);
-//      len = e;
-//    }
-//
-//    // Calculate Significant Digits:
-//    // look from start of string for first digit
-//    // look from end for last digit
-//    // significant digits = end - start + (0 or 1 depending on decimal location)
-//
-//    int decimalPos = -1;
-//    int start = (s.charAt(0) == '-') ? 1 : 0;
-//    findStart: for( ; start < len; start++ )
-//    {
-//      switch (s.charAt(start))
-//      {
-//      case '0':
-//        break;
-//      case '.':
-//        decimalPos = start;
-//        break;
-//      default:
-//        break findStart;
-//      }
-//    }
-//    int end = s.length() - 1;
-//    findEnd: for( ; end > start; end-- )
-//    {
-//      switch (s.charAt(end))
-//      {
-//      case '0':
-//        break;
-//      case '.':
-//        decimalPos = end;
-//        break;
-//      default:
-//        break findEnd;
-//      }
-//    }
-//
-//    int sigDig = end - start;
-//
-//    // clarify decimal location if it has not yet been found
-//    if (decimalPos == -1)
-//      decimalPos = s.indexOf('.');
-//
-//    // if decimal is not between start and end, add one to sigDig
-//    if (decimalPos < start || decimalPos > end)
-//      ++sigDig;
-//
-//    // reduce significant digits to PRECISION if necessary
-//    if (sigDig > PRECISION)
-//    {
-//      // re-scale BigDecimal in order to get significant digits = PRECISION
-//      BigDecimal num = new BigDecimal(s);
-//      int newScale = num.scale() - (sigDig - PRECISION);
-//      if (newScale < 0)
-//        newScale = 0;
-//      s = num.setScale(newScale, BigDecimal.ROUND_HALF_UP).toString();
-//
-//      // remove trailing '0's; keep track of decimalPos
-//      int truncatePoint = s.length();
-//      while (s.charAt(--truncatePoint) == '0')
-//        ;
-//
-//      if (s.charAt(truncatePoint) == '.')
-//      {
-//        decimalPos = truncatePoint;
-//      }
-//      else
-//      {
-//        decimalPos = s.indexOf('.');
-//        truncatePoint += 1;
-//      }
-//
-//      s = s.substring(0, truncatePoint);
-//      len = s.length();
-//    }
-//
-//    // Account for exponent by adding zeros as needed 
-//    // and moving the decimal place
-//
-//    if (exp == 0)
-//       return s;
-//
-//    start = 0;
-//    String sign;
-//    if (s.charAt(0) == '-')
-//    {
-//      sign = "-";
-//      start++;
-//    }
-//    else
-//      sign = "";
-//
-//    String wholePart = s.substring(start, decimalPos);
-//    String decimalPart = s.substring(decimalPos + 1);
-//
-//    // get the number of digits right of the decimal
-//    int decimalLen = decimalPart.length();
-//
-//    if (exp >= decimalLen)
-//      return sign + wholePart + decimalPart + zeros(exp - decimalLen);
-//
-//    if (exp > 0)
-//      return sign + wholePart + decimalPart.substring(0, exp) + "."
-//             + decimalPart.substring(exp);
-//
-//    return sign + "0." + zeros(-1 - exp) + wholePart + decimalPart;
-//  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return "NaN" if the number is NaN, Infinity or -Infinity if
-   * the number is infinite or the string value of the number.
-   */
-  public String str()
-  {
-
-    if (Double.isNaN(m_val))
-    {
-      return "NaN";
-    }
-    else if (Double.isInfinite(m_val))
-    {
-      if (m_val > 0)
-        return "Infinity";
-      else
-        return "-Infinity";
-    }
-
-    double num = m_val;
-    String s = Double.toString(num);
-    int len = s.length();
-
-    if (s.charAt(len - 2) == '.' && s.charAt(len - 1) == '0')
-    {
-      s = s.substring(0, len - 2);
-
-      if (s.equals("-0"))
-        return "0";
-
-      return s;
-    }
-
-    int e = s.indexOf('E');
-
-    if (e < 0)
-      return s;
-
-    int exp = Integer.parseInt(s.substring(e + 1));
-    String sign;
-
-    if (s.charAt(0) == '-')
-    {
-      sign = "-";
-      s = s.substring(1);
-
-      --e;
-    }
-    else
-      sign = "";
-
-    int nDigits = e - 2;
-
-    if (exp >= nDigits)
-      return sign + s.substring(0, 1) + s.substring(2, e)
-             + zeros(exp - nDigits);
-
-    if (exp > 0)
-      return sign + s.substring(0, 1) + s.substring(2, 2 + exp) + "."
-             + s.substring(2 + exp, e);
-
-    return sign + "0." + zeros(-1 - exp) + s.substring(0, 1)
-           + s.substring(2, e);
-  }
-
-
-  /**
-   * Return a string of '0' of the given length
-   *
-   *
-   * @param n Length of the string to be returned
-   *
-   * @return a string of '0' with the given length
-   */
-  static private String zeros(int n)
-  {
-    if (n < 1)
-      return "";
-
-    char[] buf = new char[n];
-
-    for (int i = 0; i < n; i++)
-    {
-      buf[i] = '0';
-    }
-
-    return new String(buf);
-  }
-
-  /**
-   * Return a java object that's closest to the representation
-   * that should be handed to an extension.
-   *
-   * @return The value of this XNumber as a Double object
-   */
-  public Object object()
-  {
-    if(null == m_obj)
-      m_obj = new Double(m_val);
-    return m_obj;
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return true if the two objects are equal 
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.equals(this);
-
-    try
-    {
-      return m_val == obj2.num();
-    }
-    catch(javax.xml.transform.TransformerException te)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    }
-  }
-  
-  /**
-   * Tell if this expression returns a stable number that will not change during 
-   * iterations within the expression.  This is used to determine if a proximity 
-   * position predicate can indicate that no more searching has to occur.
-   * 
-   *
-   * @return true if the expression represents a stable number.
-   */
-  public boolean isStableNumber()
-  {
-    return true;
-  }
-
-}
diff --git a/src/org/apache/xpath/objects/XObject.java b/src/org/apache/xpath/objects/XObject.java
deleted file mode 100644
index 13a42b6..0000000
--- a/src/org/apache/xpath/objects/XObject.java
+++ /dev/null
@@ -1,742 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.w3c.dom.DocumentFragment;
-//import org.w3c.dom.Text;
-//import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-import org.apache.xml.dtm.*;
-
-import java.io.Serializable;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.XPathException;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.Expression;
-import org.apache.xml.utils.XMLString;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath object, and is capable of
- * converting the object to various types, such as a string.
- * This class acts as the base class to other XPath type objects,
- * such as XString, and provides polymorphic casting capabilities.
- */
-public class XObject extends Expression implements Serializable, Cloneable
-{
-
-  /**
-   * The java object which this object wraps.
-   *  @serial  
-   */
-  protected Object m_obj;  // This may be NULL!!!
-
-  /**
-   * Create an XObject.
-   */
-  public XObject(){}
-
-  /**
-   * Create an XObject.
-   *
-   * @param obj Can be any object, should be a specific type
-   * for derived classes, or null.
-   */
-  public XObject(Object obj)
-  {
-    m_obj = obj;
-  }
-
-  /**
-   * For support of literal objects in xpaths.
-   *
-   * @param xctxt The XPath execution context.
-   *
-   * @return This object.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return this;
-  }
-
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   *
-   * @param allowRelease true if it is OK for detach to release this iterator
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease){}
-
-  /**
-   * Detaches the <code>DTMIterator</code> from the set which it iterated
-   * over, releasing any computational resources and placing the iterator
-   * in the INVALID state. After <code>detach</code> has been invoked,
-   * calls to <code>nextNode</code> or <code>previousNode</code> will
-   * raise a runtime exception.
-   */
-  public void detach(){}
-
-  /**
-   * Forces the object to release it's resources.  This is more harsh than
-   * detach().
-   */
-  public void destruct()
-  {
-
-    if (null != m_obj)
-    {
-      allowDetachToRelease(true);
-      detach();
-
-      m_obj = null;
-    }
-  }
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value. Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
-          throws org.xml.sax.SAXException
-  {
-    xstr().dispatchCharactersEvents(ch);
-  }
-
-  /**
-   * Create the right XObject based on the type of the object passed.  This 
-   * function can not make an XObject that exposes DOM Nodes, NodeLists, and 
-   * NodeIterators to the XSLT stylesheet as node-sets.
-   *
-   * @param val The java object which this object will wrap.
-   *
-   * @return the right XObject based on the type of the object passed.
-   */
-  static public XObject create(Object val)
-  {
-    return XObjectFactory.create(val);
-  }
-  
-  /**
-   * Create the right XObject based on the type of the object passed.
-   * This function <emph>can</emph> make an XObject that exposes DOM Nodes, NodeLists, and 
-   * NodeIterators to the XSLT stylesheet as node-sets.
-   *
-   * @param val The java object which this object will wrap.
-   * @param xctxt The XPath context.
-   *
-   * @return the right XObject based on the type of the object passed.
-   */
-  static public XObject create(Object val, XPathContext xctxt)
-  {
-    return XObjectFactory.create(val, xctxt);
-  }
-
-  /** Constant for NULL object type */
-  public static final int CLASS_NULL = -1;
-
-  /** Constant for UNKNOWN object type */
-  public static final int CLASS_UNKNOWN = 0;
-
-  /** Constant for BOOLEAN  object type */
-  public static final int CLASS_BOOLEAN = 1;
-
-  /** Constant for NUMBER object type */
-  public static final int CLASS_NUMBER = 2;
-
-  /** Constant for STRING object type */
-  public static final int CLASS_STRING = 3;
-
-  /** Constant for NODESET object type */
-  public static final int CLASS_NODESET = 4;
-
-  /** Constant for RESULT TREE FRAGMENT object type */
-  public static final int CLASS_RTREEFRAG = 5;
-
-  /** Represents an unresolved variable type as an integer. */
-  public static final int CLASS_UNRESOLVEDVARIABLE = 600;
-
-  /**
-   * Tell what kind of class this is.
-   *
-   * @return CLASS_UNKNOWN
-   */
-  public int getType()
-  {
-    return CLASS_UNKNOWN;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#UNKNOWN" + object class name
-   */
-  public String getTypeString()
-  {
-    return "#UNKNOWN (" + object().getClass().getName() + ")";
-  }
-
-  /**
-   * Cast result object to a number. Always issues an error.
-   *
-   * @return 0.0
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num() throws javax.xml.transform.TransformerException
-  {
-
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER,
-          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a number");
-
-    return 0.0;
-  }
-  
-  /**
-   * Cast result object to a number, but allow side effects, such as the 
-   * incrementing of an iterator.
-   *
-   * @return numeric value of the string conversion from the 
-   * next node in the NodeSetDTM, or NAN if no node was found
-   */
-  public double numWithSideEffects()  throws javax.xml.transform.TransformerException
-  {
-    return num();
-  }
-
-  /**
-   * Cast result object to a boolean. Always issues an error.
-   *
-   * @return false
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool() throws javax.xml.transform.TransformerException
-  {
-
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER,
-          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a number");
-
-    return false;
-  }
-  
-  /**
-   * Cast result object to a boolean, but allow side effects, such as the 
-   * incrementing of an iterator.
-   *
-   * @return True if there is a next node in the nodeset
-   */
-  public boolean boolWithSideEffects() throws javax.xml.transform.TransformerException
-  {
-    return bool();
-  }
-
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public XMLString xstr()
-  {
-    return XMLStringFactoryImpl.getFactory().newstr(str());
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The object as a string
-   */
-  public String str()
-  {
-    return (m_obj != null) ? m_obj.toString() : "";
-  }
-
-  /**
-   * Return the string representation of the object
-   *
-   *
-   * @return the string representation of the object
-   */
-  public String toString()
-  {
-    return str();
-  }
-
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support XPath context to use for the conversion
-   *
-   * @return the objec as a result tree fragment.
-   */
-  public int rtf(XPathContext support)
-  {
-
-    int result = rtf();
-
-    if (DTM.NULL == result)
-    {
-      DTM frag = support.createDocumentFragment();
-
-      // %OPT%
-      frag.appendTextChild(str());
-
-      result = frag.getDocument();
-    }
-
-    return result;
-  }
-  
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support XPath context to use for the conversion
-   *
-   * @return the objec as a result tree fragment.
-   */
-  public DocumentFragment rtree(XPathContext support)
-  {
-    DocumentFragment docFrag = null;
-    int result = rtf();
-
-    if (DTM.NULL == result)
-    {
-      DTM frag = support.createDocumentFragment();
-
-      // %OPT%
-      frag.appendTextChild(str());
-
-      docFrag = (DocumentFragment)frag.getNode(frag.getDocument());
-    }
-    else
-    {
-      DTM frag = support.getDTM(result);
-      docFrag = (DocumentFragment)frag.getNode(frag.getDocument());
-    }
-
-    return docFrag;
-  }
-  
-  
-  
-  /**
-   * For functions to override.
-   *
-   * @return null
-   */
-  public DocumentFragment rtree()
-  {
-    return null;
-  }
-
-  /**
-   * For functions to override.
-   *
-   * @return null
-   */
-  public int rtf()
-  {
-    return DTM.NULL;
-  }
-
-  /**
-   * Return a java object that's closest to the representation
-   * that should be handed to an extension.
-   *
-   * @return The object that this class wraps
-   */
-  public Object object()
-  {
-    return m_obj;
-  }
-
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public DTMIterator iter() throws javax.xml.transform.TransformerException
-  {
-
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
-          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeList!");
-
-    return null;
-  }
-  
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeIterator nodeset() throws javax.xml.transform.TransformerException
-  {
-
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
-          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeList!");
-
-    return null;
-  }
-  
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return null
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeList nodelist() throws javax.xml.transform.TransformerException
-  {
-
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
-          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeList!");
-
-    return null;
-  }
-
-
-  /**
-   * Cast result object to a nodelist. Always issues an error.
-   *
-   * @return The object as a NodeSetDTM.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public NodeSetDTM mutableNodeset()
-          throws javax.xml.transform.TransformerException
-  {
-
-    error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
-          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");
-
-    return (NodeSetDTM) m_obj;
-  }
-
-  /**
-   * Cast object to type t.
-   *
-   * @param t Type of object to cast this to
-   * @param support XPath context to use for the conversion
-   *
-   * @return This object as the given type t
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public Object castToType(int t, XPathContext support)
-          throws javax.xml.transform.TransformerException
-  {
-
-    Object result;
-
-    switch (t)
-    {
-    case CLASS_STRING :
-      result = str();
-      break;
-    case CLASS_NUMBER :
-      result = new Double(num());
-      break;
-    case CLASS_NODESET :
-      result = iter();
-      break;
-    case CLASS_BOOLEAN :
-      result = new Boolean(bool());
-      break;
-    case CLASS_UNKNOWN :
-      result = m_obj;
-      break;
-
-    // %TBD%  What to do here?
-    //    case CLASS_RTREEFRAG :
-    //      result = rtree(support);
-    //      break;
-    default :
-      error(XPATHErrorResources.ER_CANT_CONVERT_TO_TYPE,
-            new Object[]{ getTypeString(),
-                          Integer.toString(t) });  //"Can not convert "+getTypeString()+" to a type#"+t);
-
-      result = null;
-    }
-
-    return result;
-  }
-
-  /**
-   * Tell if one object is less than the other.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if this object is less than the given object
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean lessThan(XObject obj2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.  Because the arguments 
-    // are backwards, we call the opposite comparison
-    // function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.greaterThan(this);
-
-    return this.num() < obj2.num();
-  }
-
-  /**
-   * Tell if one object is less than or equal to the other.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if this object is less than or equal to the given object
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean lessThanOrEqual(XObject obj2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.  Because the arguments 
-    // are backwards, we call the opposite comparison
-    // function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.greaterThanOrEqual(this);
-
-    return this.num() <= obj2.num();
-  }
-
-  /**
-   * Tell if one object is greater than the other.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if this object is greater than the given object
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean greaterThan(XObject obj2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.  Because the arguments 
-    // are backwards, we call the opposite comparison
-    // function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.lessThan(this);
-
-    return this.num() > obj2.num();
-  }
-
-  /**
-   * Tell if one object is greater than or equal to the other.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if this object is greater than or equal to the given object
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean greaterThanOrEqual(XObject obj2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.  Because the arguments 
-    // are backwards, we call the opposite comparison
-    // function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.lessThanOrEqual(this);
-
-    return this.num() >= obj2.num();
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if this object is equal to the given object
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.equals(this);
-
-    if (null != m_obj)
-    {
-      return m_obj.equals(obj2.m_obj);
-    }
-    else
-    {
-      return obj2.m_obj == null;
-    }
-  }
-
-  /**
-   * Tell if two objects are functionally not equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if this object is not equal to the given object
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean notEquals(XObject obj2)
-          throws javax.xml.transform.TransformerException
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.notEquals(this);
-
-    return !equals(obj2);
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Error message to issue
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void error(int msg)
-          throws javax.xml.transform.TransformerException
-  {
-    error(msg, null);
-  }
-
-  /**
-   * Tell the user of an error, and probably throw an
-   * exception.
-   *
-   * @param msg Error message to issue
-   * @param args Arguments to use in the message
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected void error(int msg, Object[] args)
-          throws javax.xml.transform.TransformerException
-  {
-
-    String fmsg = XSLMessages.createXPATHMessage(msg, args);
-
-    // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR, 
-    //                                      m_support.ERROR,
-    //                                      null, 
-    //                                      null, fmsg, 0, 0);
-    // if(shouldThrow)
-    {
-      throw new XPathException(fmsg);
-    }
-  }
-  
-  /**
-   * XObjects should not normally need to fix up variables.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-
-  /**
-   * Cast result object to a string.
-   *
-   *
-   * NEEDSDOC @param fsb
-   * @return The string this wraps or the empty string if null
-   */
-  public void appendToFsb(org.apache.xml.utils.FastStringBuffer fsb)
-  {
-    fsb.append(str());
-  }
-}
diff --git a/src/org/apache/xpath/objects/XObjectFactory.java b/src/org/apache/xpath/objects/XObjectFactory.java
deleted file mode 100644
index 6d873b6..0000000
--- a/src/org/apache/xpath/objects/XObjectFactory.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.apache.xpath.objects;
-
-import org.apache.xml.dtm.*;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.NodeSetDTM;
-import org.apache.xpath.axes.OneStepIterator;
-
-
-public class XObjectFactory
-{
-  
-  /**
-   * Create the right XObject based on the type of the object passed.  This 
-   * function can not make an XObject that exposes DOM Nodes, NodeLists, and 
-   * NodeIterators to the XSLT stylesheet as node-sets.
-   *
-   * @param val The java object which this object will wrap.
-   *
-   * @return the right XObject based on the type of the object passed.
-   */
-  static public XObject create(Object val)
-  {
-
-    XObject result;
-
-    if (val instanceof XObject)
-    {
-      result = (XObject) val;
-    }
-    else if (val instanceof String)
-    {
-      result = new XString((String) val);
-    }
-    else if (val instanceof Boolean)
-    {
-      result = new XBoolean((Boolean)val);
-    }
-    else if (val instanceof Double)
-    {
-      result = new XNumber(((Double) val));
-    }
-    else
-    {
-      result = new XObject(val);
-    }
-
-    return result;
-  }
-  
-  /**
-   * Create the right XObject based on the type of the object passed.
-   * This function <emph>can</emph> make an XObject that exposes DOM Nodes, NodeLists, and 
-   * NodeIterators to the XSLT stylesheet as node-sets.
-   *
-   * @param val The java object which this object will wrap.
-   * @param xctxt The XPath context.
-   *
-   * @return the right XObject based on the type of the object passed.
-   */
-  static public XObject create(Object val, XPathContext xctxt)
-  {
-
-    XObject result;
-
-    if (val instanceof XObject)
-    {
-      result = (XObject) val;
-    }
-    else if (val instanceof String)
-    {
-      result = new XString((String) val);
-    }
-    else if (val instanceof Boolean)
-    {
-      result = new XBoolean((Boolean)val);
-    }
-    else if (val instanceof Number)
-    {
-      result = new XNumber(((Number) val));
-    }
-    else if (val instanceof DTM)
-    {
-      DTM dtm = (DTM)val;
-      try
-      {
-        int dtmRoot = dtm.getDocument();
-        DTMAxisIterator iter = dtm.getAxisIterator(Axis.SELF);
-        iter.setStartNode(dtmRoot);
-        DTMIterator iterator = new OneStepIterator(iter, Axis.SELF);
-        iterator.setRoot(dtmRoot, xctxt);
-        result = new XNodeSet(iterator);
-      }
-      catch(Exception ex)
-      {
-        throw new org.apache.xml.utils.WrappedRuntimeException(ex);
-      }
-    }
-    else if (val instanceof DTMAxisIterator)
-    {
-      DTMAxisIterator iter = (DTMAxisIterator)val;
-      try
-      {
-        DTMIterator iterator = new OneStepIterator(iter, Axis.SELF);
-        iterator.setRoot(iter.getStartNode(), xctxt);
-        result = new XNodeSet(iterator);
-      }
-      catch(Exception ex)
-      {
-        throw new org.apache.xml.utils.WrappedRuntimeException(ex);
-      }
-    }
-    else if (val instanceof DTMIterator)
-    {
-      result = new XNodeSet((DTMIterator) val);
-    }
-    // This next three instanceofs are a little worrysome, since a NodeList 
-    // might also implement a Node!
-    else if (val instanceof org.w3c.dom.Node)
-    {
-      result = new XNodeSetForDOM((org.w3c.dom.Node)val, xctxt);
-    }
-    // This must come after org.w3c.dom.Node, since many Node implementations 
-    // also implement NodeList.
-    else if (val instanceof org.w3c.dom.NodeList)
-    {
-      result = new XNodeSetForDOM((org.w3c.dom.NodeList)val, xctxt);
-    }
-    else if (val instanceof org.w3c.dom.traversal.NodeIterator)
-    {
-      result = new XNodeSetForDOM((org.w3c.dom.traversal.NodeIterator)val, xctxt);
-    }
-    else
-    {
-      result = new XObject(val);
-    }
-
-    return result;
-  }
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/objects/XRTreeFrag.java b/src/org/apache/xpath/objects/XRTreeFrag.java
deleted file mode 100644
index 4d5fec9..0000000
--- a/src/org/apache/xpath/objects/XRTreeFrag.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.w3c.dom.NodeList;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-
-import org.apache.xml.utils.XMLString;
-
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.Expression;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath result tree fragment object, and is capable of
- * converting the RTF to other types, such as a string.
- */
-public class XRTreeFrag extends XObject implements Cloneable
-{
-  DTM m_dtm;
-  int m_dtmRoot;
-  XPathContext m_xctxt;
-  boolean m_allowRelease = true;
-
-//  /**
-//   * Create an XRTreeFrag Object.
-//   *
-//   * @param frag Document fragment this will wrap
-//   */
-//  public XRTreeFrag(DTMIterator frag)
-//  {
-//    super(frag);
-//    
-//    // Obviously, this constructor should be avoided when possible.
-//    m_dtmRoot = frag.cloneWithReset().nextNode();
-//  }
-  
-  /**
-   * Create an XRTreeFrag Object.
-   *
-   * @param frag Document fragment this will wrap
-   */
-  public XRTreeFrag(int root, XPathContext xctxt)
-  {
-    super(null);
-    
-    // Obviously, this constructor should be avoided when possible.
-    m_dtmRoot = root;
-    m_xctxt = xctxt;
-    m_dtm = xctxt.getDTM(root);
-  }
-  
-  /**
-   * Return a java object that's closest to the representation
-   * that should be handed to an extension.
-   *
-   * @return The object that this class wraps
-   */
-  public Object object()
-  {
-    return new org.apache.xml.dtm.ref.DTMNodeIterator((DTMIterator)(new org.apache.xpath.NodeSetDTM(m_dtmRoot, m_xctxt.getDTMManager())));
-  }
-  
-  /**
-   * Create an XRTreeFrag Object.
-   *
-   * @param frag Document fragment this will wrap
-   */
-  public XRTreeFrag(Expression expr)
-  {
-    super(expr);
-  }
-  
-  /**
-   * Release any resources this object may have by calling destruct().
-   *
-   * @throws Throwable
-   */
-  protected void finalize() throws Throwable
-  {
-
-    try
-    {
-      destruct();
-    }
-    finally
-    {
-      super.finalize();  // Always use this.
-    }
-  }
-  
-  /**
-   * Specify if it's OK for detach to release the iterator for reuse.
-   * 
-   * @param allowRelease true if it is OK for detach to release this iterator 
-   * for pooling.
-   */
-  public void allowDetachToRelease(boolean allowRelease)
-  {
-    m_allowRelease = allowRelease;
-  }
-
-  /**
-   * Detaches the <code>DTMIterator</code> from the set which it iterated
-   * over, releasing any computational resources and placing the iterator
-   * in the INVALID state. After <code>detach</code> has been invoked,
-   * calls to <code>nextNode</code> or <code>previousNode</code> will
-   * raise a runtime exception.
-   * 
-   * In general, detach should only be called once on the object.
-   */
-  public void detach()
-  {
-    if(m_allowRelease)
-    {
-      if(null != m_dtm)
-      {
-        m_xctxt.release(m_dtm, true);
-        m_dtm = null;
-        m_xctxt = null;
-      }
-      m_obj = null;
-    }
-  }
-  
-  /**
-   * Forces the object to release it's resources.  This is more harsh than 
-   * detach().  You can call destruct as many times as you want.
-   */
-  public void destruct()
-  {
-    if(null != m_dtm)
-    {
-      m_xctxt.release(m_dtm, true);
-      m_dtm = null;
-      m_xctxt = null;
-    }
-    m_obj = null;
- }
-
-  /**
-   * Tell what kind of class this is.
-   *
-   * @return type CLASS_RTREEFRAG 
-   */
-  public int getType()
-  {
-    return CLASS_RTREEFRAG;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#RTREEFRAG"
-   */
-  public String getTypeString()
-  {
-    return "#RTREEFRAG";
-  }
-
-  /**
-   * Cast result object to a number.
-   *
-   * @return The result tree fragment as a number or NaN
-   */
-  public double num()
-    throws javax.xml.transform.TransformerException
-  {
-
-    XMLString s = xstr();
-
-    return s.toDouble();
-  }
-
-  /**
-   * Cast result object to a boolean.  This always returns true for a RTreeFrag
-   * because it is treated like a node-set with a single root node.
-   *
-   * @return true
-   */
-  public boolean bool()
-  {
-    return true;
-  }
-  
-  private XMLString m_xmlStr = null;
-  
-  /**
-   * Cast result object to an XMLString.
-   *
-   * @return The document fragment node data or the empty string. 
-   */
-  public XMLString xstr()
-  {
-    if(null == m_xmlStr)
-      m_xmlStr = m_dtm.getStringValue(m_dtmRoot);
-    
-    return m_xmlStr;
-  }
-  
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public void appendToFsb(org.apache.xml.utils.FastStringBuffer fsb)
-  {
-    XString xstring = (XString)xstr();
-    xstring.appendToFsb(fsb);
-  }
-
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The document fragment node data or the empty string. 
-   */
-  public String str()
-  {
-    String str = m_dtm.getStringValue(m_dtmRoot).toString();
-
-    return (null == str) ? "" : str;
-  }
-
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @return The document fragment this wraps
-   */
-  public int rtf()
-  {
-    return m_dtmRoot;
-  }
-
-  /**
-   * Cast result object to a DTMIterator.
-   *
-   * @return The document fragment as a DTMIterator
-   */
-  public DTMIterator asNodeIterator()
-  {
-    return m_xctxt.createDTMIterator(m_dtmRoot);
-  }
-
-  /**
-   * Cast result object to a nodelist. (special function).
-   *
-   * @return The document fragment as a nodelist
-   */
-  public NodeList convertToNodeset()
-  {
-
-    if (m_obj instanceof NodeList)
-      return (NodeList) m_obj;
-    else
-      return new org.apache.xml.dtm.ref.DTMNodeList(asNodeIterator());
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return True if the two objects are equal
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-
-    try
-    {
-      if (XObject.CLASS_NODESET == obj2.getType())
-      {
-  
-        // In order to handle the 'all' semantics of 
-        // nodeset comparisons, we always call the 
-        // nodeset function.
-        return obj2.equals(this);
-      }
-      else if (XObject.CLASS_BOOLEAN == obj2.getType())
-      {
-        return bool() == obj2.bool();
-      }
-      else if (XObject.CLASS_NUMBER == obj2.getType())
-      {
-        return num() == obj2.num();
-      }
-      else if (XObject.CLASS_NODESET == obj2.getType())
-      {
-        return xstr().equals(obj2.xstr());
-      }
-      else if (XObject.CLASS_STRING == obj2.getType())
-      {
-        return xstr().equals(obj2.xstr());
-      }
-      else if (XObject.CLASS_RTREEFRAG == obj2.getType())
-      {
-  
-        // Probably not so good.  Think about this.
-        return xstr().equals(obj2.xstr());
-      }
-      else
-      {
-        return super.equals(obj2);
-      }
-    }
-    catch(javax.xml.transform.TransformerException te)
-    {
-      throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    }
-  }
-
-}
diff --git a/src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java b/src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
deleted file mode 100644
index 0c82d5b..0000000
--- a/src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.apache.xpath.objects;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-
-import org.apache.xml.utils.XMLString;
-
-import org.apache.xpath.DOMHelper;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.Expression;
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-
-/**
- * This class makes an select statement act like an result tree fragment.
- */
-public class XRTreeFragSelectWrapper extends XRTreeFrag implements Cloneable
-{
-  XObject m_selected;
-
-  public XRTreeFragSelectWrapper(Expression expr)
-  {
-    super(expr);
-  }
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    ((Expression)m_obj).fixupVariables(vars, globalsSize);
-  }
-  
-  /**
-   * For support of literal objects in xpaths.
-   *
-   * @param xctxt The XPath execution context.
-   *
-   * @return This object.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    try
-    {
-      XRTreeFragSelectWrapper xrtf = (XRTreeFragSelectWrapper)this.clone();
-      xrtf.m_selected = ((Expression)m_obj).execute(xctxt);
-      return xrtf;
-    }
-    catch(CloneNotSupportedException cnse)
-    {
-      throw new javax.xml.transform.TransformerException(cnse);
-    }
-    
-  }
-  
-  /**
-   * Cast result object to a number.
-   *
-   * @return The result tree fragment as a number or NaN
-   */
-  public double num()
-    throws javax.xml.transform.TransformerException
-  {
-
-    return m_selected.num();
-  }
-
-  
-  /**
-   * Cast result object to an XMLString.
-   *
-   * @return The document fragment node data or the empty string. 
-   */
-  public XMLString xstr()
-  {
-    return m_selected.xstr();
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The document fragment node data or the empty string. 
-   */
-  public String str()
-  {
-    return m_selected.str();
-  }
-  
-  /**
-   * Tell what kind of class this is.
-   *
-   * @return type CLASS_RTREEFRAG 
-   */
-  public int getType()
-  {
-    return CLASS_STRING; // hmm...
-  }
-
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @return The document fragment this wraps
-   */
-  public int rtf()
-  {
-    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"rtf() not supported by XRTreeFragSelectWrapper!");
-  }
-
-  /**
-   * Cast result object to a DTMIterator.
-   *
-   * @return The document fragment as a DTMIterator
-   */
-  public DTMIterator asNodeIterator()
-  {
-    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"asNodeIterator() not supported by XRTreeFragSelectWrapper!");
-  }
-
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/objects/XString.java b/src/org/apache/xpath/objects/XString.java
deleted file mode 100644
index 0a3618a..0000000
--- a/src/org/apache/xpath/objects/XString.java
+++ /dev/null
@@ -1,1181 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-//import org.w3c.dom.*;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-import org.apache.xml.utils.FastStringBuffer;
-
-import java.util.Locale;
-
-/**
- * <meta name="usage" content="general"/>
- * This class represents an XPath string object, and is capable of
- * converting the string to other types, such as a number.
- */
-public class XString extends XObject implements XMLString
-{
-
-  /** Empty string XString object */
-  public static XString EMPTYSTRING = new XString("");
-
-  /**
-   * Construct a XString object.  This constructor exists for derived classes.
-   *
-   * @param val String object this will wrap.
-   */
-  protected XString(Object val)
-  {
-    super(val);
-  }
-
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param val String object this will wrap.
-   */
-  public XString(String val)
-  {
-    super(val);
-  }
-
-  /**
-   * Tell that this is a CLASS_STRING.
-   *
-   * @return type CLASS_STRING
-   */
-  public int getType()
-  {
-    return CLASS_STRING;
-  }
-
-  /**
-   * Given a request type, return the equivalent string.
-   * For diagnostic purposes.
-   *
-   * @return type string "#STRING"
-   */
-  public String getTypeString()
-  {
-    return "#STRING";
-  }
-
-  /**
-   * Tell if this object contains a java String object.
-   *
-   * @return true if this XMLString can return a string without creating one.
-   */
-  public boolean hasString()
-  {
-    return true;
-  }
-
-  /**
-   * Cast result object to a number.
-   *
-   * @return 0.0 if this string is null, numeric value of this string
-   * or NaN
-   */
-  public double num()
-  {
-    return toDouble();
-  }
-
-  /**
-   * Convert a string to a double -- Allowed input is in fixed
-   * notation ddd.fff.
-   *
-   * @return A double value representation of the string, or return Double.NaN
-   * if the string can not be converted.
-   */
-  public double toDouble()
-  {
-    int end = length();
-    
-    if(0 == end)
-      return Double.NaN;
-
-    double result = 0.0;
-    int start = 0;
-    int punctPos = end-1;
-
-    // Scan to first whitespace character.
-    for (int i = start; i < end; i++)
-    {
-      char c = charAt(i);
-
-      if (!XMLCharacterRecognizer.isWhiteSpace(c))
-      {
-        break;
-      }
-      else
-        start++;
-    }
-
-    double sign = 1.0;
-
-    if (start < end && charAt(start) == '-')
-    {
-      sign = -1.0;
-
-      start++;
-    }
-
-    int digitsFound = 0;
-
-    for (int i = start; i < end; i++)  // parse the string from left to right converting the integer part
-    {
-      char c = charAt(i);
-
-      if (c != '.')
-      {
-        if (XMLCharacterRecognizer.isWhiteSpace(c))
-          break;
-        else if (Character.isDigit(c))
-        {
-          result = result * 10.0 + (c - 0x30);
-
-          digitsFound++;
-        }
-        else
-        {
-          return Double.NaN;
-        }
-      }
-      else
-      {
-        punctPos = i;
-
-        break;
-      }
-    }
-
-    if (charAt(punctPos) == '.')  // parse the string from the end to the '.' converting the fractional part
-    {
-      double fractPart = 0.0;
-
-      for (int i = end - 1; i > punctPos; i--)
-      {
-        char c = charAt(i);
-
-        if (XMLCharacterRecognizer.isWhiteSpace(c))
-          break;
-        else if (Character.isDigit(c))
-        {
-          fractPart = fractPart / 10.0 + (c - 0x30);
-
-          digitsFound++;
-        }
-        else
-        {
-          return Double.NaN;
-        }
-      }
-
-      result += fractPart / 10.0;
-    }
-
-    if (0 == digitsFound)
-      return Double.NaN;
-
-    return result * sign;
-  }
-
-  /**
-   * Cast result object to a boolean.
-   *
-   * @return True if the length of this string object is greater
-   * than 0.
-   */
-  public boolean bool()
-  {
-    return str().length() > 0;
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public XMLString xstr()
-  {
-    return this;
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public String str()
-  {
-    return (null != m_obj) ? ((String) m_obj) : "";
-  }
-
-  /**
-   * Cast result object to a result tree fragment.
-   *
-   * @param support Xpath context to use for the conversion
-   *
-   * @return A document fragment with this string as a child node
-   */
-  public int rtf(XPathContext support)
-  {
-
-    DTM frag = support.createDocumentFragment();
-
-    frag.appendTextChild(str());
-
-    return frag.getDocument();
-  }
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value. Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
-          throws org.xml.sax.SAXException
-  {
-
-    String str = str();
-
-    ch.characters(str.toCharArray(), 0, str.length());
-  }
-
-  /**
-   * Directly call the
-   * comment method on the passed LexicalHandler for the
-   * string-value.
-   *
-   * @param lh A non-null reference to a LexicalHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
-          throws org.xml.sax.SAXException
-  {
-
-    String str = str();
-
-    lh.comment(str.toCharArray(), 0, str.length());
-  }
-
-  /**
-   * Returns the length of this string.
-   *
-   * @return  the length of the sequence of characters represented by this
-   *          object.
-   */
-  public int length()
-  {
-    return str().length();
-  }
-
-  /**
-   * Returns the character at the specified index. An index ranges
-   * from <code>0</code> to <code>length() - 1</code>. The first character
-   * of the sequence is at index <code>0</code>, the next at index
-   * <code>1</code>, and so on, as for array indexing.
-   *
-   * @param      index   the index of the character.
-   * @return     the character at the specified index of this string.
-   *             The first character is at index <code>0</code>.
-   * @exception  IndexOutOfBoundsException  if the <code>index</code>
-   *             argument is negative or not less than the length of this
-   *             string.
-   */
-  public char charAt(int index)
-  {
-    return str().charAt(index);
-  }
-
-  /**
-   * Copies characters from this string into the destination character
-   * array.
-   *
-   * @param      srcBegin   index of the first character in the string
-   *                        to copy.
-   * @param      srcEnd     index after the last character in the string
-   *                        to copy.
-   * @param      dst        the destination array.
-   * @param      dstBegin   the start offset in the destination array.
-   * @exception IndexOutOfBoundsException If any of the following
-   *            is true:
-   *            <ul><li><code>srcBegin</code> is negative.
-   *            <li><code>srcBegin</code> is greater than <code>srcEnd</code>
-   *            <li><code>srcEnd</code> is greater than the length of this
-   *                string
-   *            <li><code>dstBegin</code> is negative
-   *            <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
-   *                <code>dst.length</code></ul>
-   * @exception NullPointerException if <code>dst</code> is <code>null</code>
-   */
-  public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
-  {
-    str().getChars(srcBegin, srcEnd, dst, dstBegin);
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return true if the two objects are equal
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-
-    // In order to handle the 'all' semantics of 
-    // nodeset comparisons, we always call the 
-    // nodeset function.
-    if (obj2.getType() == XObject.CLASS_NODESET)
-      return obj2.equals(this);
-
-    return str().equals(obj2.str());
-  }
-
-  /**
-   * Compares this string to the specified object.
-   * The result is <code>true</code> if and only if the argument is not
-   * <code>null</code> and is a <code>String</code> object that represents
-   * the same sequence of characters as this object.
-   *
-   * @param   anObject   the object to compare this <code>String</code>
-   *                     against.
-   *
-   * NEEDSDOC @param obj2
-   * @return  <code>true</code> if the <code>String </code>are equal;
-   *          <code>false</code> otherwise.
-   * @see     java.lang.String#compareTo(java.lang.String)
-   * @see     java.lang.String#equalsIgnoreCase(java.lang.String)
-   */
-  public boolean equals(XMLString obj2)
-  {
-
-    if (!obj2.hasString())
-      return obj2.equals(this);
-    else
-      return str().equals(obj2.toString());
-  }
-
-  /**
-   * Compares this string to the specified object.
-   * The result is <code>true</code> if and only if the argument is not
-   * <code>null</code> and is a <code>String</code> object that represents
-   * the same sequence of characters as this object.
-   *
-   * @param   anObject   the object to compare this <code>String</code>
-   *                     against.
-   *
-   * NEEDSDOC @param obj2
-   * @return  <code>true</code> if the <code>String </code>are equal;
-   *          <code>false</code> otherwise.
-   * @see     java.lang.String#compareTo(java.lang.String)
-   * @see     java.lang.String#equalsIgnoreCase(java.lang.String)
-   */
-  public boolean equals(Object obj2)
-  {
-
-    if (null == obj2)
-      return false;
-
-      // In order to handle the 'all' semantics of 
-      // nodeset comparisons, we always call the 
-      // nodeset function.
-    else if (obj2 instanceof XNodeSet)
-      return obj2.equals(this);
-    else
-      return str().equals(obj2.toString());
-  }
-
-  /**
-   * Compares this <code>String</code> to another <code>String</code>,
-   * ignoring case considerations.  Two strings are considered equal
-   * ignoring case if they are of the same length, and corresponding
-   * characters in the two strings are equal ignoring case.
-   *
-   * @param   anotherString   the <code>String</code> to compare this
-   *                          <code>String</code> against.
-   * @return  <code>true</code> if the argument is not <code>null</code>
-   *          and the <code>String</code>s are equal,
-   *          ignoring case; <code>false</code> otherwise.
-   * @see     #equals(Object)
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see java.lang.Character#toUpperCase(char)
-   */
-  public boolean equalsIgnoreCase(String anotherString)
-  {
-    return str().equalsIgnoreCase(anotherString);
-  }
-
-  /**
-   * Compares two strings lexicographically.
-   *
-   * @param   anotherString   the <code>String</code> to be compared.
-   *
-   * NEEDSDOC @param xstr
-   * @return  the value <code>0</code> if the argument string is equal to
-   *          this string; a value less than <code>0</code> if this string
-   *          is lexicographically less than the string argument; and a
-   *          value greater than <code>0</code> if this string is
-   *          lexicographically greater than the string argument.
-   * @exception java.lang.NullPointerException if <code>anotherString</code>
-   *          is <code>null</code>.
-   */
-  public int compareTo(XMLString xstr)
-  {
-
-    int len1 = this.length();
-    int len2 = xstr.length();
-    int n = Math.min(len1, len2);
-    int i = 0;
-    int j = 0;
-
-    while (n-- != 0)
-    {
-      char c1 = this.charAt(i);
-      char c2 = xstr.charAt(j);
-
-      if (c1 != c2)
-      {
-        return c1 - c2;
-      }
-
-      i++;
-      j++;
-    }
-
-    return len1 - len2;
-  }
-
-  /**
-   * Compares two strings lexicographically, ignoring case considerations.
-   * This method returns an integer whose sign is that of
-   * <code>this.toUpperCase().toLowerCase().compareTo(
-   * str.toUpperCase().toLowerCase())</code>.
-   * <p>
-   * Note that this method does <em>not</em> take locale into account,
-   * and will result in an unsatisfactory ordering for certain locales.
-   * The java.text package provides <em>collators</em> to allow
-   * locale-sensitive ordering.
-   *
-   * @param   str   the <code>String</code> to be compared.
-   * @return  a negative integer, zero, or a positive integer as the
-   *          the specified String is greater than, equal to, or less
-   *          than this String, ignoring case considerations.
-   * @see     java.text.Collator#compare(String, String)
-   * @since   1.2
-   */
-  public int compareToIgnoreCase(XMLString str)
-  {
-    // %REVIEW%  Like it says, @since 1.2. Doesn't exist in earlier
-    // versions of Java, hence we can't yet shell out to it. We can implement
-    // it as character-by-character compare, but doing so efficiently
-    // is likely to be (ahem) interesting.
-    //  
-    // However, since nobody is actually _using_ this method yet:
-    //    return str().compareToIgnoreCase(str.toString());
-    
-    throw new org.apache.xml.utils.WrappedRuntimeException(
-      new java.lang.NoSuchMethodException(
-        "Java 1.2 method, not yet implemented"));
-  }
-
-  /**
-   * Tests if this string starts with the specified prefix beginning
-   * a specified index.
-   *
-   * @param   prefix    the prefix.
-   * @param   toffset   where to begin looking in the string.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the substring of this object starting
-   *          at index <code>toffset</code>; <code>false</code> otherwise.
-   *          The result is <code>false</code> if <code>toffset</code> is
-   *          negative or greater than the length of this
-   *          <code>String</code> object; otherwise the result is the same
-   *          as the result of the expression
-   *          <pre>
-   *          this.subString(toffset).startsWith(prefix)
-   *          </pre>
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public boolean startsWith(String prefix, int toffset)
-  {
-    return str().startsWith(prefix, toffset);
-  }
-
-  /**
-   * Tests if this string starts with the specified prefix.
-   *
-   * @param   prefix   the prefix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the character sequence represented by
-   *          this string; <code>false</code> otherwise.
-   *          Note also that <code>true</code> will be returned if the
-   *          argument is an empty string or is equal to this
-   *          <code>String</code> object as determined by the
-   *          {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public boolean startsWith(String prefix)
-  {
-    return startsWith(prefix, 0);
-  }
-
-  /**
-   * Tests if this string starts with the specified prefix beginning
-   * a specified index.
-   *
-   * @param   prefix    the prefix.
-   * @param   toffset   where to begin looking in the string.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the substring of this object starting
-   *          at index <code>toffset</code>; <code>false</code> otherwise.
-   *          The result is <code>false</code> if <code>toffset</code> is
-   *          negative or greater than the length of this
-   *          <code>String</code> object; otherwise the result is the same
-   *          as the result of the expression
-   *          <pre>
-   *          this.subString(toffset).startsWith(prefix)
-   *          </pre>
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public boolean startsWith(XMLString prefix, int toffset)
-  {
-
-    int to = toffset;
-    int tlim = this.length();
-    int po = 0;
-    int pc = prefix.length();
-
-    // Note: toffset might be near -1>>>1.
-    if ((toffset < 0) || (toffset > tlim - pc))
-    {
-      return false;
-    }
-
-    while (--pc >= 0)
-    {
-      if (this.charAt(to) != prefix.charAt(po))
-      {
-        return false;
-      }
-
-      to++;
-      po++;
-    }
-
-    return true;
-  }
-
-  /**
-   * Tests if this string starts with the specified prefix.
-   *
-   * @param   prefix   the prefix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the character sequence represented by
-   *          this string; <code>false</code> otherwise.
-   *          Note also that <code>true</code> will be returned if the
-   *          argument is an empty string or is equal to this
-   *          <code>String</code> object as determined by the
-   *          {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public boolean startsWith(XMLString prefix)
-  {
-    return startsWith(prefix, 0);
-  }
-
-  /**
-   * Tests if this string ends with the specified suffix.
-   *
-   * @param   suffix   the suffix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a suffix of the character sequence represented by
-   *          this object; <code>false</code> otherwise. Note that the
-   *          result will be <code>true</code> if the argument is the
-   *          empty string or is equal to this <code>String</code> object
-   *          as determined by the {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>suffix</code> is
-   *          <code>null</code>.
-   */
-  public boolean endsWith(String suffix)
-  {
-    return str().endsWith(suffix);
-  }
-
-  /**
-   * Returns a hashcode for this string. The hashcode for a
-   * <code>String</code> object is computed as
-   * <blockquote><pre>
-   * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
-   * </pre></blockquote>
-   * using <code>int</code> arithmetic, where <code>s[i]</code> is the
-   * <i>i</i>th character of the string, <code>n</code> is the length of
-   * the string, and <code>^</code> indicates exponentiation.
-   * (The hash value of the empty string is zero.)
-   *
-   * @return  a hash code value for this object.
-   */
-  public int hashCode()
-  {
-    return str().hashCode();
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified character. If a character with value <code>ch</code> occurs
-   * in the character sequence represented by this <code>String</code>
-   * object, then the index of the first such occurrence is returned --
-   * that is, the smallest value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.charAt(<i>k</i>) == ch
-   * </pre></blockquote>
-   * is <code>true</code>. If no such character occurs in this string,
-   * then <code>-1</code> is returned.
-   *
-   * @param   ch   a character.
-   * @return  the index of the first occurrence of the character in the
-   *          character sequence represented by this object, or
-   *          <code>-1</code> if the character does not occur.
-   */
-  public int indexOf(int ch)
-  {
-    return str().indexOf(ch);
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified character, starting the search at the specified index.
-   * <p>
-   * If a character with value <code>ch</code> occurs in the character
-   * sequence represented by this <code>String</code> object at an index
-   * no smaller than <code>fromIndex</code>, then the index of the first
-   * such occurrence is returned--that is, the smallest value <i>k</i>
-   * such that:
-   * <blockquote><pre>
-   * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
-   * </pre></blockquote>
-   * is true. If no such character occurs in this string at or after
-   * position <code>fromIndex</code>, then <code>-1</code> is returned.
-   * <p>
-   * There is no restriction on the value of <code>fromIndex</code>. If it
-   * is negative, it has the same effect as if it were zero: this entire
-   * string may be searched. If it is greater than the length of this
-   * string, it has the same effect as if it were equal to the length of
-   * this string: <code>-1</code> is returned.
-   *
-   * @param   ch          a character.
-   * @param   fromIndex   the index to start the search from.
-   * @return  the index of the first occurrence of the character in the
-   *          character sequence represented by this object that is greater
-   *          than or equal to <code>fromIndex</code>, or <code>-1</code>
-   *          if the character does not occur.
-   */
-  public int indexOf(int ch, int fromIndex)
-  {
-    return str().indexOf(ch, fromIndex);
-  }
-
-  /**
-   * Returns the index within this string of the last occurrence of the
-   * specified character. That is, the index returned is the largest
-   * value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.charAt(<i>k</i>) == ch
-   * </pre></blockquote>
-   * is true.
-   * The String is searched backwards starting at the last character.
-   *
-   * @param   ch   a character.
-   * @return  the index of the last occurrence of the character in the
-   *          character sequence represented by this object, or
-   *          <code>-1</code> if the character does not occur.
-   */
-  public int lastIndexOf(int ch)
-  {
-    return str().lastIndexOf(ch);
-  }
-
-  /**
-   * Returns the index within this string of the last occurrence of the
-   * specified character, searching backward starting at the specified
-   * index. That is, the index returned is the largest value <i>k</i>
-   * such that:
-   * <blockquote><pre>
-   * this.charAt(k) == ch) && (k <= fromIndex)
-   * </pre></blockquote>
-   * is true.
-   *
-   * @param   ch          a character.
-   * @param   fromIndex   the index to start the search from. There is no
-   *          restriction on the value of <code>fromIndex</code>. If it is
-   *          greater than or equal to the length of this string, it has
-   *          the same effect as if it were equal to one less than the
-   *          length of this string: this entire string may be searched.
-   *          If it is negative, it has the same effect as if it were -1:
-   *          -1 is returned.
-   * @return  the index of the last occurrence of the character in the
-   *          character sequence represented by this object that is less
-   *          than or equal to <code>fromIndex</code>, or <code>-1</code>
-   *          if the character does not occur before that point.
-   */
-  public int lastIndexOf(int ch, int fromIndex)
-  {
-    return str().lastIndexOf(ch, fromIndex);
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified substring. The integer returned is the smallest value
-   * <i>k</i> such that:
-   * <blockquote><pre>
-   * this.startsWith(str, <i>k</i>)
-   * </pre></blockquote>
-   * is <code>true</code>.
-   *
-   * @param   str   any string.
-   * @return  if the string argument occurs as a substring within this
-   *          object, then the index of the first character of the first
-   *          such substring is returned; if it does not occur as a
-   *          substring, <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public int indexOf(String str)
-  {
-    return str().indexOf(str);
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified substring. The integer returned is the smallest value
-   * <i>k</i> such that:
-   * <blockquote><pre>
-   * this.startsWith(str, <i>k</i>)
-   * </pre></blockquote>
-   * is <code>true</code>.
-   *
-   * @param   str   any string.
-   * @return  if the string argument occurs as a substring within this
-   *          object, then the index of the first character of the first
-   *          such substring is returned; if it does not occur as a
-   *          substring, <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public int indexOf(XMLString str)
-  {
-    return str().indexOf(str.toString());
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified substring, starting at the specified index. The integer
-   * returned is the smallest value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.startsWith(str, <i>k</i>) && (<i>k</i> >= fromIndex)
-   * </pre></blockquote>
-   * is <code>true</code>.
-   * <p>
-   * There is no restriction on the value of <code>fromIndex</code>. If
-   * it is negative, it has the same effect as if it were zero: this entire
-   * string may be searched. If it is greater than the length of this
-   * string, it has the same effect as if it were equal to the length of
-   * this string: <code>-1</code> is returned.
-   *
-   * @param   str         the substring to search for.
-   * @param   fromIndex   the index to start the search from.
-   * @return  If the string argument occurs as a substring within this
-   *          object at a starting index no smaller than
-   *          <code>fromIndex</code>, then the index of the first character
-   *          of the first such substring is returned. If it does not occur
-   *          as a substring starting at <code>fromIndex</code> or beyond,
-   *          <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>
-   */
-  public int indexOf(String str, int fromIndex)
-  {
-    return str().indexOf(str, fromIndex);
-  }
-
-  /**
-   * Returns the index within this string of the rightmost occurrence
-   * of the specified substring.  The rightmost empty string "" is
-   * considered to occur at the index value <code>this.length()</code>.
-   * The returned index is the largest value <i>k</i> such that
-   * <blockquote><pre>
-   * this.startsWith(str, k)
-   * </pre></blockquote>
-   * is true.
-   *
-   * @param   str   the substring to search for.
-   * @return  if the string argument occurs one or more times as a substring
-   *          within this object, then the index of the first character of
-   *          the last such substring is returned. If it does not occur as
-   *          a substring, <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException  if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public int lastIndexOf(String str)
-  {
-    return str().lastIndexOf(str);
-  }
-
-  /**
-   * Returns the index within this string of the last occurrence of
-   * the specified substring.
-   *
-   * @param   str         the substring to search for.
-   * @param   fromIndex   the index to start the search from. There is no
-   *          restriction on the value of fromIndex. If it is greater than
-   *          the length of this string, it has the same effect as if it
-   *          were equal to the length of this string: this entire string
-   *          may be searched. If it is negative, it has the same effect
-   *          as if it were -1: -1 is returned.
-   * @return  If the string argument occurs one or more times as a substring
-   *          within this object at a starting index no greater than
-   *          <code>fromIndex</code>, then the index of the first character of
-   *          the last such substring is returned. If it does not occur as a
-   *          substring starting at <code>fromIndex</code> or earlier,
-   *          <code>-1</code> is returned.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public int lastIndexOf(String str, int fromIndex)
-  {
-    return str().lastIndexOf(str, fromIndex);
-  }
-
-  /**
-   * Returns a new string that is a substring of this string. The
-   * substring begins with the character at the specified index and
-   * extends to the end of this string. <p>
-   * Examples:
-   * <blockquote><pre>
-   * "unhappy".substring(2) returns "happy"
-   * "Harbison".substring(3) returns "bison"
-   * "emptiness".substring(9) returns "" (an empty string)
-   * </pre></blockquote>
-   *
-   * @param      beginIndex   the beginning index, inclusive.
-   * @return     the specified substring.
-   * @exception  IndexOutOfBoundsException  if
-   *             <code>beginIndex</code> is negative or larger than the
-   *             length of this <code>String</code> object.
-   */
-  public XMLString substring(int beginIndex)
-  {
-    return new XString(str().substring(beginIndex));
-  }
-
-  /**
-   * Returns a new string that is a substring of this string. The
-   * substring begins at the specified <code>beginIndex</code> and
-   * extends to the character at index <code>endIndex - 1</code>.
-   * Thus the length of the substring is <code>endIndex-beginIndex</code>.
-   *
-   * @param      beginIndex   the beginning index, inclusive.
-   * @param      endIndex     the ending index, exclusive.
-   * @return     the specified substring.
-   * @exception  IndexOutOfBoundsException  if the
-   *             <code>beginIndex</code> is negative, or
-   *             <code>endIndex</code> is larger than the length of
-   *             this <code>String</code> object, or
-   *             <code>beginIndex</code> is larger than
-   *             <code>endIndex</code>.
-   */
-  public XMLString substring(int beginIndex, int endIndex)
-  {
-    return new XString(str().substring(beginIndex, endIndex));
-  }
-
-  /**
-   * Concatenates the specified string to the end of this string.
-   *
-   * @param   str   the <code>String</code> that is concatenated to the end
-   *                of this <code>String</code>.
-   * @return  a string that represents the concatenation of this object's
-   *          characters followed by the string argument's characters.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public XMLString concat(String str)
-  {
-
-    // %REVIEW% Make an FSB here?
-    return new XString(str().concat(str));
-  }
-
-  /**
-   * Converts all of the characters in this <code>String</code> to lower
-   * case using the rules of the given <code>Locale</code>.
-   *
-   * @param locale use the case transformation rules for this locale
-   * @return the String, converted to lowercase.
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see     java.lang.String#toUpperCase(Locale)
-   */
-  public XMLString toLowerCase(Locale locale)
-  {
-    return new XString(str().toLowerCase(locale));
-  }
-
-  /**
-   * Converts all of the characters in this <code>String</code> to lower
-   * case using the rules of the default locale, which is returned
-   * by <code>Locale.getDefault</code>.
-   * <p>
-   *
-   * @return  the string, converted to lowercase.
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see     java.lang.String#toLowerCase(Locale)
-   */
-  public XMLString toLowerCase()
-  {
-    return new XString(str().toLowerCase());
-  }
-
-  /**
-   * Converts all of the characters in this <code>String</code> to upper
-   * case using the rules of the given locale.
-   * @param locale use the case transformation rules for this locale
-   * @return the String, converted to uppercase.
-   * @see     java.lang.Character#toUpperCase(char)
-   * @see     java.lang.String#toLowerCase(Locale)
-   */
-  public XMLString toUpperCase(Locale locale)
-  {
-    return new XString(str().toUpperCase(locale));
-  }
-
-  /**
-   * Converts all of the characters in this <code>String</code> to upper
-   * case using the rules of the default locale, which is returned
-   * by <code>Locale.getDefault</code>.
-   *
-   * <p>
-   * If no character in this string has a different uppercase version,
-   * based on calling the <code>toUpperCase</code> method defined by
-   * <code>Character</code>, then the original string is returned.
-   * <p>
-   * Otherwise, this method creates a new <code>String</code> object
-   * representing a character sequence identical in length to the
-   * character sequence represented by this <code>String</code> object and
-   * with every character equal to the result of applying the method
-   * <code>Character.toUpperCase</code> to the corresponding character of
-   * this <code>String</code> object. <p>
-   * Examples:
-   * <blockquote><pre>
-   * "Fahrvergnügen".toUpperCase() returns "FAHRVERGNÜGEN"
-   * "Visit Ljubinje!".toUpperCase() returns "VISIT LJUBINJE!"
-   * </pre></blockquote>
-   *
-   * @return  the string, converted to uppercase.
-   * @see     java.lang.Character#toUpperCase(char)
-   * @see     java.lang.String#toUpperCase(Locale)
-   */
-  public XMLString toUpperCase()
-  {
-    return new XString(str().toUpperCase());
-  }
-
-  /**
-   * Removes white space from both ends of this string.
-   *
-   * @return  this string, with white space removed from the front and end.
-   */
-  public XMLString trim()
-  {
-    return new XString(str().trim());
-  }
-
-  /**
-   * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
-   * of whitespace.  Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
-   * the definition of <CODE>S</CODE></A> for details.
-   * @param   ch      Character to check as XML whitespace.
-   * @return          =true if <var>ch</var> is XML whitespace; otherwise =false.
-   */
-  private static boolean isSpace(char ch)
-  {
-    return XMLCharacterRecognizer.isWhiteSpace(ch);  // Take the easy way out for now.
-  }
-
-  /**
-   * Conditionally trim all leading and trailing whitespace in the specified String.
-   * All strings of white space are
-   * replaced by a single space character (#x20), except spaces after punctuation which
-   * receive double spaces if doublePunctuationSpaces is true.
-   * This function may be useful to a formatter, but to get first class
-   * results, the formatter should probably do it's own white space handling
-   * based on the semantics of the formatting object.
-   *
-   * @param   trimHead    Trim leading whitespace?
-   * @param   trimTail    Trim trailing whitespace?
-   * @param   doublePunctuationSpaces    Use double spaces for punctuation?
-   * @return              The trimmed string.
-   */
-  public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail,
-                                 boolean doublePunctuationSpaces)
-  {
-
-    // %OPT% !!!!!!!
-    int len = this.length();
-    char[] buf = new char[len];
-
-    this.getChars(0, len, buf, 0);
-
-    boolean edit = false;
-    int s;
-
-    for (s = 0; s < len; s++)
-    {
-      if (isSpace(buf[s]))
-      {
-        break;
-      }
-    }
-
-    /* replace S to ' '. and ' '+ -> single ' '. */
-    int d = s;
-    boolean pres = false;
-
-    for (; s < len; s++)
-    {
-      char c = buf[s];
-
-      if (isSpace(c))
-      {
-        if (!pres)
-        {
-          if (' ' != c)
-          {
-            edit = true;
-          }
-
-          buf[d++] = ' ';
-
-          if (doublePunctuationSpaces && (s != 0))
-          {
-            char prevChar = buf[s - 1];
-
-            if (!((prevChar == '.') || (prevChar == '!')
-                  || (prevChar == '?')))
-            {
-              pres = true;
-            }
-          }
-          else
-          {
-            pres = true;
-          }
-        }
-        else
-        {
-          edit = true;
-          pres = true;
-        }
-      }
-      else
-      {
-        buf[d++] = c;
-        pres = false;
-      }
-    }
-
-    if (trimTail && 1 <= d && ' ' == buf[d - 1])
-    {
-      edit = true;
-
-      d--;
-    }
-
-    int start = 0;
-
-    if (trimHead && 0 < d && ' ' == buf[0])
-    {
-      edit = true;
-
-      start++;
-    }
-
-    XMLStringFactory xsf = XMLStringFactoryImpl.getFactory();
-
-    return edit ? xsf.newstr(new String(buf, start, d - start)) : this;
-  }
-}
diff --git a/src/org/apache/xpath/objects/XStringForChars.java b/src/org/apache/xpath/objects/XStringForChars.java
deleted file mode 100644
index 8904b78..0000000
--- a/src/org/apache/xpath/objects/XStringForChars.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.apache.xpath.objects;
-
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-
-import org.apache.xalan.res.XSLMessages;
-import org.apache.xpath.res.XPATHErrorResources;
-
-import java.util.Locale;
-
-
-/**
- * This class will wrap a FastStringBuffer and allow for
- */
-public class XStringForChars extends XString
-{
-  /** The start position in the fsb. */
-  int m_start;
-  
-  /** The length of the string. */
-  int m_length;
-  
-  protected String m_strCache = null;
-  
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param val FastStringBuffer object this will wrap, must be non-null.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   */
-  public XStringForChars(char[] val, int start, int length)
-  {
-    super(val);
-    m_start = start;
-    m_length = length;
-    if(null == val)
-      throw new IllegalArgumentException(
-                          XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FASTSTRINGBUFFER_CANNOT_BE_NULL, null)); //"The FastStringBuffer argument can not be null!!");
-  }
-
-
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param val String object this will wrap.
-   */
-  private XStringForChars(String val)
-  {
-    super(val);
-    throw new IllegalArgumentException(
-                      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING, null)); //"XStringForChars can not take a string for an argument!");
-  }
-  
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public FastStringBuffer fsb()
-  {
-    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS, null)); //"fsb() not supported for XStringForChars!");
-  }
-  
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public void appendToFsb(org.apache.xml.utils.FastStringBuffer fsb)
-  {
-    fsb.append((char[])m_obj, m_start, m_length);
-  }
-
-  
-  /**
-   * Tell if this object contains a java String object.
-   * 
-   * @return true if this XMLString can return a string without creating one.
-   */
-  public boolean hasString()
-  {
-    return (null != m_strCache);
-  }
-
-  
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public String str()
-  {
-    if(null == m_strCache)
-      m_strCache = new String((char[])m_obj, m_start, m_length);
-    
-    return m_strCache;
-  }
-  
-
-  /**
-   * Since this object is incomplete without the length and the offset, we 
-   * have to convert to a string when this function is called.
-   *
-   * @return The java String representation of this object.
-   */
-  public Object object()
-  {
-    return str();
-  }
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value. Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
-      throws org.xml.sax.SAXException
-  {
-    ch.characters((char[])m_obj, m_start, m_length);
-  }
-      
-  /**
-   * Directly call the
-   * comment method on the passed LexicalHandler for the
-   * string-value.
-   *
-   * @param lh A non-null reference to a LexicalHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
-      throws org.xml.sax.SAXException
-  {
-    lh.comment((char[])m_obj, m_start, m_length);
-  }
-  
-  /**
-   * Returns the length of this string.
-   *
-   * @return  the length of the sequence of characters represented by this
-   *          object.
-   */
-  public int length()
-  {
-    return m_length;
-  }
-
-  /**
-   * Returns the character at the specified index. An index ranges
-   * from <code>0</code> to <code>length() - 1</code>. The first character
-   * of the sequence is at index <code>0</code>, the next at index
-   * <code>1</code>, and so on, as for array indexing.
-   *
-   * @param      index   the index of the character.
-   * @return     the character at the specified index of this string.
-   *             The first character is at index <code>0</code>.
-   * @exception  IndexOutOfBoundsException  if the <code>index</code>
-   *             argument is negative or not less than the length of this
-   *             string.
-   */
-  public char charAt(int index)
-  {
-    return ((char[])m_obj)[index+m_start];
-  }
-
-  /**
-   * Copies characters from this string into the destination character
-   * array.
-   *
-   * @param      srcBegin   index of the first character in the string
-   *                        to copy.
-   * @param      srcEnd     index after the last character in the string
-   *                        to copy.
-   * @param      dst        the destination array.
-   * @param      dstBegin   the start offset in the destination array.
-   * @exception IndexOutOfBoundsException If any of the following
-   *            is true:
-   *            <ul><li><code>srcBegin</code> is negative.
-   *            <li><code>srcBegin</code> is greater than <code>srcEnd</code>
-   *            <li><code>srcEnd</code> is greater than the length of this
-   *                string
-   *            <li><code>dstBegin</code> is negative
-   *            <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
-   *                <code>dst.length</code></ul>
-   * @exception NullPointerException if <code>dst</code> is <code>null</code>
-   */
-  public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
-  {
-    System.arraycopy((char[])m_obj, m_start+srcBegin, dst, dstBegin, srcEnd);
-  }
-  
-}
\ No newline at end of file
diff --git a/src/org/apache/xpath/objects/XStringForFSB.java b/src/org/apache/xpath/objects/XStringForFSB.java
deleted file mode 100644
index 62769a5..0000000
--- a/src/org/apache/xpath/objects/XStringForFSB.java
+++ /dev/null
@@ -1,1054 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.objects;
-
-import org.apache.xml.utils.FastStringBuffer;
-import org.apache.xml.utils.XMLString;
-import org.apache.xml.utils.XMLStringFactory;
-import org.apache.xml.utils.XMLCharacterRecognizer;
-
-import java.util.Locale;
-
-/**
- * This class will wrap a FastStringBuffer and allow for
- */
-public class XStringForFSB extends XString
-{
-
-  /** The start position in the fsb. */
-  int m_start;
-
-  /** The length of the string. */
-  int m_length;
-
-  /** If the str() function is called, the string will be cached here. */
-  protected String m_strCache = null;
-
-  /** cached hash code */
-  protected int m_hash = 0;
-
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param val FastStringBuffer object this will wrap, must be non-null.
-   * @param start The start position in the array.
-   * @param length The number of characters to read from the array.
-   */
-  public XStringForFSB(FastStringBuffer val, int start, int length)
-  {
-
-    super(val);
-
-    m_start = start;
-    m_length = length;
-
-    if (null == val)
-      throw new IllegalArgumentException(
-        "The FastStringBuffer argument can not be null!!");
-  }
-
-  /**
-   * Construct a XNodeSet object.
-   *
-   * @param val String object this will wrap.
-   */
-  private XStringForFSB(String val)
-  {
-
-    super(val);
-
-    throw new IllegalArgumentException(
-      "XStringForFSB can not take a string for an argument!");
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public FastStringBuffer fsb()
-  {
-    return ((FastStringBuffer) m_obj);
-  }
-  
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public void appendToFsb(org.apache.xml.utils.FastStringBuffer fsb)
-  {
-    // %OPT% !!! FSB has to be updated to take partial fsb's for append.
-    fsb.append(str());
-  }
-
-  /**
-   * Tell if this object contains a java String object.
-   *
-   * @return true if this XMLString can return a string without creating one.
-   */
-  public boolean hasString()
-  {
-    return (null != m_strCache);
-  }
-
-//  /** NEEDSDOC Field strCount */
-//  public static int strCount = 0;
-//
-//  /** NEEDSDOC Field xtable */
-//  static java.util.Hashtable xtable = new java.util.Hashtable();
-
-  /**
-   * Since this object is incomplete without the length and the offset, we 
-   * have to convert to a string when this function is called.
-   *
-   * @return The java String representation of this object.
-   */
-  public Object object()
-  {
-    return str();
-  }
-
-  /**
-   * Cast result object to a string.
-   *
-   * @return The string this wraps or the empty string if null
-   */
-  public String str()
-  {
-
-    if (null == m_strCache)
-    {
-      m_strCache = fsb().getString(m_start, m_length);
-
-//      strCount++;
-//
-//      RuntimeException e = new RuntimeException("Bad!  Bad!");
-//      java.io.CharArrayWriter writer = new java.io.CharArrayWriter();
-//      java.io.PrintWriter pw = new java.io.PrintWriter(writer);
-//
-//      e.printStackTrace(pw);
-//
-//      String str = writer.toString();
-//
-//      str = str.substring(0, 600);
-//
-//      if (null == xtable.get(str))
-//      {
-//        xtable.put(str, str);
-//        System.out.println(str);
-//      }
-//      System.out.println("strCount: " + strCount);
-
-//      throw e;
-//      e.printStackTrace();
-      // System.exit(-1);
-    }
-
-    return m_strCache;
-  }
-
-  /**
-   * Directly call the
-   * characters method on the passed ContentHandler for the
-   * string-value. Multiple calls to the
-   * ContentHandler's characters methods may well occur for a single call to
-   * this method.
-   *
-   * @param ch A non-null reference to a ContentHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
-          throws org.xml.sax.SAXException
-  {
-    fsb().sendSAXcharacters(ch, m_start, m_length);
-  }
-
-  /**
-   * Directly call the
-   * comment method on the passed LexicalHandler for the
-   * string-value.
-   *
-   * @param lh A non-null reference to a LexicalHandler.
-   *
-   * @throws org.xml.sax.SAXException
-   */
-  public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
-          throws org.xml.sax.SAXException
-  {
-    fsb().sendSAXComment(lh, m_start, m_length);
-  }
-
-  /**
-   * Returns the length of this string.
-   *
-   * @return  the length of the sequence of characters represented by this
-   *          object.
-   */
-  public int length()
-  {
-    return m_length;
-  }
-
-  /**
-   * Returns the character at the specified index. An index ranges
-   * from <code>0</code> to <code>length() - 1</code>. The first character
-   * of the sequence is at index <code>0</code>, the next at index
-   * <code>1</code>, and so on, as for array indexing.
-   *
-   * @param      index   the index of the character.
-   * @return     the character at the specified index of this string.
-   *             The first character is at index <code>0</code>.
-   * @exception  IndexOutOfBoundsException  if the <code>index</code>
-   *             argument is negative or not less than the length of this
-   *             string.
-   */
-  public char charAt(int index)
-  {
-    return fsb().charAt(m_start + index);
-  }
-
-  /**
-   * Copies characters from this string into the destination character
-   * array.
-   *
-   * @param      srcBegin   index of the first character in the string
-   *                        to copy.
-   * @param      srcEnd     index after the last character in the string
-   *                        to copy.
-   * @param      dst        the destination array.
-   * @param      dstBegin   the start offset in the destination array.
-   * @exception IndexOutOfBoundsException If any of the following
-   *            is true:
-   *            <ul><li><code>srcBegin</code> is negative.
-   *            <li><code>srcBegin</code> is greater than <code>srcEnd</code>
-   *            <li><code>srcEnd</code> is greater than the length of this
-   *                string
-   *            <li><code>dstBegin</code> is negative
-   *            <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
-   *                <code>dst.length</code></ul>
-   * @exception NullPointerException if <code>dst</code> is <code>null</code>
-   */
-  public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
-  {
-
-    // %OPT% Need to call this on FSB when it is implemented.
-    // %UNTESTED% (I don't think anyone calls this yet?)
-    int n = srcEnd - srcBegin;
-
-    if (n > m_length)
-      n = m_length;
-
-    if (n > (dst.length - dstBegin))
-      n = (dst.length - dstBegin);
-
-    int end = srcBegin + m_start + n;
-    int d = dstBegin;
-    FastStringBuffer fsb = fsb();
-
-    for (int i = srcBegin + m_start; i < end; i++)
-    {
-      dst[d++] = fsb.charAt(i);
-    }
-  }
-
-  /**
-   * Compares this string to the specified object.
-   * The result is <code>true</code> if and only if the argument is not
-   * <code>null</code> and is a <code>String</code> object that represents
-   * the same sequence of characters as this object.
-   *
-   * @param   anObject   the object to compare this <code>String</code>
-   *                     against.
-   *
-   * NEEDSDOC @param obj2
-   * @return  <code>true</code> if the <code>String </code>are equal;
-   *          <code>false</code> otherwise.
-   * @see     java.lang.String#compareTo(java.lang.String)
-   * @see     java.lang.String#equalsIgnoreCase(java.lang.String)
-   */
-  public boolean equals(XMLString obj2)
-  {
-
-    if (this == obj2)
-    {
-      return true;
-    }
-
-    int n = m_length;
-
-    if (n == obj2.length())
-    {
-      FastStringBuffer fsb = fsb();
-      int i = m_start;
-      int j = 0;
-
-      while (n-- != 0)
-      {
-        if (fsb.charAt(i) != obj2.charAt(j))
-        {
-          return false;
-        }
-
-        i++;
-        j++;
-      }
-
-      return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * @return true if the two objects are equal
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(XObject obj2)
-  {
-
-    if (this == obj2)
-    {
-      return true;
-    }
-
-    String str = obj2.str();
-    int n = m_length;
-
-    if (n == str.length())
-    {
-      FastStringBuffer fsb = fsb();
-      int i = m_start;
-      int j = 0;
-
-      while (n-- != 0)
-      {
-        if (fsb.charAt(i) != str.charAt(j))
-        {
-          return false;
-        }
-
-        i++;
-        j++;
-      }
-
-      return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Tell if two objects are functionally equal.
-   *
-   * @param obj2 Object to compare this to
-   *
-   * NEEDSDOC @param anotherString
-   *
-   * @return true if the two objects are equal
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean equals(String anotherString)
-  {
-
-    int n = m_length;
-
-    if (n == anotherString.length())
-    {
-      FastStringBuffer fsb = fsb();
-      int i = m_start;
-      int j = 0;
-
-      while (n-- != 0)
-      {
-        if (fsb.charAt(i) != anotherString.charAt(j))
-        {
-          return false;
-        }
-
-        i++;
-        j++;
-      }
-
-      return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Compares this string to the specified object.
-   * The result is <code>true</code> if and only if the argument is not
-   * <code>null</code> and is a <code>String</code> object that represents
-   * the same sequence of characters as this object.
-   *
-   * @param   anObject   the object to compare this <code>String</code>
-   *                     against.
-   *
-   * NEEDSDOC @param obj2
-   * @return  <code>true</code> if the <code>String </code>are equal;
-   *          <code>false</code> otherwise.
-   * @see     java.lang.String#compareTo(java.lang.String)
-   * @see     java.lang.String#equalsIgnoreCase(java.lang.String)
-   */
-  public boolean equals(Object obj2)
-  {
-
-    if (null == obj2)
-      return false;
-
-      // In order to handle the 'all' semantics of 
-      // nodeset comparisons, we always call the 
-      // nodeset function.
-    else if (obj2 instanceof XNodeSet)
-      return obj2.equals(this);
-    else if (obj2 instanceof XStringForFSB)
-      return equals((XMLString) this);
-    else
-      return equals(obj2.toString());
-  }
-
-  /**
-   * Compares this <code>String</code> to another <code>String</code>,
-   * ignoring case considerations.  Two strings are considered equal
-   * ignoring case if they are of the same length, and corresponding
-   * characters in the two strings are equal ignoring case.
-   *
-   * @param   anotherString   the <code>String</code> to compare this
-   *                          <code>String</code> against.
-   * @return  <code>true</code> if the argument is not <code>null</code>
-   *          and the <code>String</code>s are equal,
-   *          ignoring case; <code>false</code> otherwise.
-   * @see     #equals(Object)
-   * @see     java.lang.Character#toLowerCase(char)
-   * @see java.lang.Character#toUpperCase(char)
-   */
-  public boolean equalsIgnoreCase(String anotherString)
-  {
-    return (m_length == anotherString.length())
-           ? str().equalsIgnoreCase(anotherString) : false;
-  }
-
-  /**
-   * Compares two strings lexicographically.
-   *
-   * @param   anotherString   the <code>String</code> to be compared.
-   *
-   * NEEDSDOC @param xstr
-   * @return  the value <code>0</code> if the argument string is equal to
-   *          this string; a value less than <code>0</code> if this string
-   *          is lexicographically less than the string argument; and a
-   *          value greater than <code>0</code> if this string is
-   *          lexicographically greater than the string argument.
-   * @exception java.lang.NullPointerException if <code>anotherString</code>
-   *          is <code>null</code>.
-   */
-  public int compareTo(XMLString xstr)
-  {
-
-    int len1 = m_length;
-    int len2 = xstr.length();
-    int n = Math.min(len1, len2);
-    FastStringBuffer fsb = fsb();
-    int i = m_start;
-    int j = 0;
-
-    while (n-- != 0)
-    {
-      char c1 = fsb.charAt(i);
-      char c2 = xstr.charAt(j);
-
-      if (c1 != c2)
-      {
-        return c1 - c2;
-      }
-
-      i++;
-      j++;
-    }
-
-    return len1 - len2;
-  }
-
-  /**
-   * Compares two strings lexicographically, ignoring case considerations.
-   * This method returns an integer whose sign is that of
-   * <code>this.toUpperCase().toLowerCase().compareTo(
-   * str.toUpperCase().toLowerCase())</code>.
-   * <p>
-   * Note that this method does <em>not</em> take locale into account,
-   * and will result in an unsatisfactory ordering for certain locales.
-   * The java.text package provides <em>collators</em> to allow
-   * locale-sensitive ordering.
-   *
-   * @param   str   the <code>String</code> to be compared.
-   *
-   * NEEDSDOC @param xstr
-   * @return  a negative integer, zero, or a positive integer as the
-   *          the specified String is greater than, equal to, or less
-   *          than this String, ignoring case considerations.
-   * @see     java.text.Collator#compare(String, String)
-   * @since   1.2
-   */
-  public int compareToIgnoreCase(XMLString xstr)
-  {
-
-    int len1 = m_length;
-    int len2 = xstr.length();
-    int n = Math.min(len1, len2);
-    FastStringBuffer fsb = fsb();
-    int i = m_start;
-    int j = 0;
-
-    while (n-- != 0)
-    {
-      char c1 = Character.toLowerCase(fsb.charAt(i));
-      char c2 = Character.toLowerCase(xstr.charAt(j));
-
-      if (c1 != c2)
-      {
-        return c1 - c2;
-      }
-
-      i++;
-      j++;
-    }
-
-    return len1 - len2;
-  }
-
-  /**
-   * Returns a hashcode for this string. The hashcode for a
-   * <code>String</code> object is computed as
-   * <blockquote><pre>
-   * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
-   * </pre></blockquote>
-   * using <code>int</code> arithmetic, where <code>s[i]</code> is the
-   * <i>i</i>th character of the string, <code>n</code> is the length of
-   * the string, and <code>^</code> indicates exponentiation.
-   * (The hash value of the empty string is zero.)
-   *
-   * @return  a hash code value for this object.
-   */
-  public int hashCode()
-  {
-
-    int h = m_hash;
-
-    if (h == 0)
-    {
-      int off = m_start;
-      int len = m_length;
-      FastStringBuffer fsb = fsb();
-
-      for (int i = 0; i < len; i++)
-      {
-        h = 31 * h + fsb.charAt(off);
-
-        off++;
-      }
-
-      m_hash = h;
-    }
-
-    return h;
-  }
-
-  /**
-   * Tests if this string starts with the specified prefix beginning
-   * a specified index.
-   *
-   * @param   prefix    the prefix.
-   * @param   toffset   where to begin looking in the string.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the substring of this object starting
-   *          at index <code>toffset</code>; <code>false</code> otherwise.
-   *          The result is <code>false</code> if <code>toffset</code> is
-   *          negative or greater than the length of this
-   *          <code>String</code> object; otherwise the result is the same
-   *          as the result of the expression
-   *          <pre>
-   *          this.subString(toffset).startsWith(prefix)
-   *          </pre>
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   */
-  public boolean startsWith(XMLString prefix, int toffset)
-  {
-
-    FastStringBuffer fsb = fsb();
-    int to = m_start + toffset;
-    int tlim = m_start + m_length;
-    int po = 0;
-    int pc = prefix.length();
-
-    // Note: toffset might be near -1>>>1.
-    if ((toffset < 0) || (toffset > m_length - pc))
-    {
-      return false;
-    }
-
-    while (--pc >= 0)
-    {
-      if (fsb.charAt(to) != prefix.charAt(po))
-      {
-        return false;
-      }
-
-      to++;
-      po++;
-    }
-
-    return true;
-  }
-
-  /**
-   * Tests if this string starts with the specified prefix.
-   *
-   * @param   prefix   the prefix.
-   * @return  <code>true</code> if the character sequence represented by the
-   *          argument is a prefix of the character sequence represented by
-   *          this string; <code>false</code> otherwise.
-   *          Note also that <code>true</code> will be returned if the
-   *          argument is an empty string or is equal to this
-   *          <code>String</code> object as determined by the
-   *          {@link #equals(Object)} method.
-   * @exception java.lang.NullPointerException if <code>prefix</code> is
-   *          <code>null</code>.
-   * @since   JDK1. 0
-   */
-  public boolean startsWith(XMLString prefix)
-  {
-    return startsWith(prefix, 0);
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified character. If a character with value <code>ch</code> occurs
-   * in the character sequence represented by this <code>String</code>
-   * object, then the index of the first such occurrence is returned --
-   * that is, the smallest value <i>k</i> such that:
-   * <blockquote><pre>
-   * this.charAt(<i>k</i>) == ch
-   * </pre></blockquote>
-   * is <code>true</code>. If no such character occurs in this string,
-   * then <code>-1</code> is returned.
-   *
-   * @param   ch   a character.
-   * @return  the index of the first occurrence of the character in the
-   *          character sequence represented by this object, or
-   *          <code>-1</code> if the character does not occur.
-   */
-  public int indexOf(int ch)
-  {
-    return indexOf(ch, 0);
-  }
-
-  /**
-   * Returns the index within this string of the first occurrence of the
-   * specified character, starting the search at the specified index.
-   * <p>
-   * If a character with value <code>ch</code> occurs in the character
-   * sequence represented by this <code>String</code> object at an index
-   * no smaller than <code>fromIndex</code>, then the index of the first
-   * such occurrence is returned--that is, the smallest value <i>k</i>
-   * such that:
-   * <blockquote><pre>
-   * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
-   * </pre></blockquote>
-   * is true. If no such character occurs in this string at or after
-   * position <code>fromIndex</code>, then <code>-1</code> is returned.
-   * <p>
-   * There is no restriction on the value of <code>fromIndex</code>. If it
-   * is negative, it has the same effect as if it were zero: this entire
-   * string may be searched. If it is greater than the length of this
-   * string, it has the same effect as if it were equal to the length of
-   * this string: <code>-1</code> is returned.
-   *
-   * @param   ch          a character.
-   * @param   fromIndex   the index to start the search from.
-   * @return  the index of the first occurrence of the character in the
-   *          character sequence represented by this object that is greater
-   *          than or equal to <code>fromIndex</code>, or <code>-1</code>
-   *          if the character does not occur.
-   */
-  public int indexOf(int ch, int fromIndex)
-  {
-
-    int max = m_start + m_length;
-    FastStringBuffer fsb = fsb();
-
-    if (fromIndex < 0)
-    {
-      fromIndex = 0;
-    }
-    else if (fromIndex >= m_length)
-    {
-
-      // Note: fromIndex might be near -1>>>1.
-      return -1;
-    }
-
-    for (int i = m_start + fromIndex; i < max; i++)
-    {
-      if (fsb.charAt(i) == ch)
-      {
-        return i - m_start;
-      }
-    }
-
-    return -1;
-  }
-
-  /**
-   * Returns a new string that is a substring of this string. The
-   * substring begins with the character at the specified index and
-   * extends to the end of this string. <p>
-   * Examples:
-   * <blockquote><pre>
-   * "unhappy".substring(2) returns "happy"
-   * "Harbison".substring(3) returns "bison"
-   * "emptiness".substring(9) returns "" (an empty string)
-   * </pre></blockquote>
-   *
-   * @param      beginIndex   the beginning index, inclusive.
-   * @return     the specified substring.
-   * @exception  IndexOutOfBoundsException  if
-   *             <code>beginIndex</code> is negative or larger than the
-   *             length of this <code>String</code> object.
-   */
-  public XMLString substring(int beginIndex)
-  {
-
-    int len = m_length - beginIndex;
-
-    if (len <= 0)
-      return XString.EMPTYSTRING;
-    else
-    {
-      int start = m_start + beginIndex;
-
-      return new XStringForFSB(fsb(), start, len);
-    }
-  }
-
-  /**
-   * Returns a new string that is a substring of this string. The
-   * substring begins at the specified <code>beginIndex</code> and
-   * extends to the character at index <code>endIndex - 1</code>.
-   * Thus the length of the substring is <code>endIndex-beginIndex</code>.
-   *
-   * @param      beginIndex   the beginning index, inclusive.
-   * @param      endIndex     the ending index, exclusive.
-   * @return     the specified substring.
-   * @exception  IndexOutOfBoundsException  if the
-   *             <code>beginIndex</code> is negative, or
-   *             <code>endIndex</code> is larger than the length of
-   *             this <code>String</code> object, or
-   *             <code>beginIndex</code> is larger than
-   *             <code>endIndex</code>.
-   */
-  public XMLString substring(int beginIndex, int endIndex)
-  {
-
-    int len = endIndex - beginIndex;
-
-    if (len > m_length)
-      len = m_length;
-
-    if (len <= 0)
-      return XString.EMPTYSTRING;
-    else
-    {
-      int start = m_start + beginIndex;
-
-      return new XStringForFSB(fsb(), start, len);
-    }
-  }
-
-  /**
-   * Concatenates the specified string to the end of this string.
-   *
-   * @param   str   the <code>String</code> that is concatenated to the end
-   *                of this <code>String</code>.
-   * @return  a string that represents the concatenation of this object's
-   *          characters followed by the string argument's characters.
-   * @exception java.lang.NullPointerException if <code>str</code> is
-   *          <code>null</code>.
-   */
-  public XMLString concat(String str)
-  {
-
-    // %OPT% Make an FSB here?
-    return new XString(str().concat(str));
-  }
-
-  /**
-   * Removes white space from both ends of this string.
-   *
-   * @return  this string, with white space removed from the front and end.
-   */
-  public XMLString trim()
-  {
-    return fixWhiteSpace(true, true, false);
-  }
-
-  /**
-   * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
-   * of whitespace.  Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
-   * the definition of <CODE>S</CODE></A> for details.
-   * @param   ch      Character to check as XML whitespace.
-   * @return          =true if <var>ch</var> is XML whitespace; otherwise =false.
-   */
-  private static boolean isSpace(char ch)
-  {
-    return XMLCharacterRecognizer.isWhiteSpace(ch);  // Take the easy way out for now.
-  }
-
-  /**
-   * Conditionally trim all leading and trailing whitespace in the specified String.
-   * All strings of white space are
-   * replaced by a single space character (#x20), except spaces after punctuation which
-   * receive double spaces if doublePunctuationSpaces is true.
-   * This function may be useful to a formatter, but to get first class
-   * results, the formatter should probably do it's own white space handling
-   * based on the semantics of the formatting object.
-   *
-   * @param   trimHead    Trim leading whitespace?
-   * @param   trimTail    Trim trailing whitespace?
-   * @param   doublePunctuationSpaces    Use double spaces for punctuation?
-   * @return              The trimmed string.
-   */
-  public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail,
-                                 boolean doublePunctuationSpaces)
-  {
-
-    int end = m_length + m_start;
-    char[] buf = new char[m_length];
-    FastStringBuffer fsb = fsb();
-    boolean edit = false;
-
-    /* replace S to ' '. and ' '+ -> single ' '. */
-    int d = 0;
-    boolean pres = false;
-
-    for (int s = m_start; s < end; s++)
-    {
-      char c = fsb.charAt(s);
-
-      if (isSpace(c))
-      {
-        if (!pres)
-        {
-          if (' ' != c)
-          {
-            edit = true;
-          }
-
-          buf[d++] = ' ';
-
-          if (doublePunctuationSpaces && (d != 0))
-          {
-            char prevChar = buf[d - 1];
-
-            if (!((prevChar == '.') || (prevChar == '!')
-                  || (prevChar == '?')))
-            {
-              pres = true;
-            }
-          }
-          else
-          {
-            pres = true;
-          }
-        }
-        else
-        {
-          edit = true;
-          pres = true;
-        }
-      }
-      else
-      {
-        buf[d++] = c;
-        pres = false;
-      }
-    }
-
-    if (trimTail && 1 <= d && ' ' == buf[d - 1])
-    {
-      edit = true;
-
-      d--;
-    }
-
-    int start = 0;
-
-    if (trimHead && 0 < d && ' ' == buf[0])
-    {
-      edit = true;
-
-      start++;
-    }
-
-    XMLStringFactory xsf = XMLStringFactoryImpl.getFactory();
-
-    return edit ? xsf.newstr(buf, start, d - start) : this;
-  }
-
-  /**
-   * Convert a string to a double -- Allowed input is in fixed
-   * notation ddd.fff.
-   *
-   * @return A double value representation of the string, or return Double.NaN 
-   * if the string can not be converted.
-   */
-  public double toDouble()
-  {
-
-    int start = m_start;
-    int end = m_length+start;
-    
-    if(0 == end)
-      return Double.NaN;
-      
-    double result = 0.0;
-    int punctPos = end-1;
-    FastStringBuffer fsb = fsb();
-    
-    // Scan to first whitespace character.
-    for (int i = start; i < end; i++) 
-    {
-      char c = fsb.charAt(i);
-      if( !XMLCharacterRecognizer.isWhiteSpace( c ) )
-      {
-        break;
-      }
-      else
-        start++;
-    }
-
-    double sign = 1.0;
-    if (start < end && fsb.charAt(start) == '-')
-    {
-      sign = -1.0;
-
-      start++;
-    }
-    
-    int digitsFound = 0;
-    for (int i = start; i < end; i++)  // parse the string from left to right converting the integer part
-    {
-      char c = fsb.charAt(i);
-      if (c != '.')
-      {
-        if(XMLCharacterRecognizer.isWhiteSpace(c))
-          break;
-        else if (Character.isDigit(c))
-        {
-          result = result * 10.0 + (c - 0x30);
-          digitsFound++;
-        }
-        else
-        {
-          return Double.NaN;
-        }
-      }
-      else
-      {
-        punctPos = i;
-
-        break;
-      }
-    }
-    
-    if (fsb.charAt(punctPos) == '.')  // parse the string from the end to the '.' converting the fractional part
-    {
-      double fractPart = 0.0;
-      for (int i = end - 1; i > punctPos; i--)
-      {
-        char c = fsb.charAt(i);
-        if(XMLCharacterRecognizer.isWhiteSpace(c))
-          continue;
-        else if (Character.isDigit(c))
-        {
-          fractPart = fractPart / 10.0 + (c - 0x30);
-          digitsFound++;
-        }
-        else
-        {
-          return Double.NaN;
-        }
-      }
-
-      result += fractPart / 10.0;
-    }
-    
-    if(0 == digitsFound)
-      return Double.NaN;
-
-    return result * sign;
-  }
-
-}
diff --git a/src/org/apache/xpath/objects/package.html b/src/org/apache/xpath/objects/package.html
deleted file mode 100644
index d834655..0000000
--- a/src/org/apache/xpath/objects/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <title>XPath objects Package.</title>
-  <body>
-    <p>Implementation of XPath polymorphic type objects -- this package will grow 
-    as XPath objects are expanded to support XML Schema data types.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/operations/And.java b/src/org/apache/xpath/operations/And.java
deleted file mode 100644
index 51cb3f8..0000000
--- a/src/org/apache/xpath/operations/And.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-import org.w3c.dom.Node;
-
-/**
- * The 'and' operation expression executer.
- */
-public class And extends Operation
-{
-
-  /**
-   * AND two expressions and return the boolean result. Override
-   * superclass method for optimization purposes.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return {@link org.apache.xpath.objects.XBoolean#S_TRUE} or 
-   * {@link org.apache.xpath.objects.XBoolean#S_FALSE}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    XObject expr1 = m_left.execute(xctxt);
-
-    if (expr1.bool())
-    {
-      XObject expr2 = m_right.execute(xctxt);
-
-      return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-    }
-    else
-      return XBoolean.S_FALSE;
-  }
-  
-  /**
-   * Evaluate this operation directly to a boolean.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a boolean.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return (m_left.bool(xctxt) && m_right.bool(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Bool.java b/src/org/apache/xpath/operations/Bool.java
deleted file mode 100644
index f4fecf4..0000000
--- a/src/org/apache/xpath/operations/Bool.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-import org.apache.xpath.XPathContext;
-
-/**
- * The 'boolean()' operation expression executer.
- */
-public class Bool extends UnaryOperation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject right) throws javax.xml.transform.TransformerException
-  {
-
-    if (XObject.CLASS_BOOLEAN == right.getType())
-      return right;
-    else
-      return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-  
-  /**
-   * Evaluate this operation directly to a boolean.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a boolean.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return m_right.bool(xctxt);
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Div.java b/src/org/apache/xpath/operations/Div.java
deleted file mode 100644
index 58e857f..0000000
--- a/src/org/apache/xpath/operations/Div.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The 'div' operation expression executer.
- */
-public class Div extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(left.num() / right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return (m_left.num(xctxt) / m_right.num(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Equals.java b/src/org/apache/xpath/operations/Equals.java
deleted file mode 100644
index b302ca9..0000000
--- a/src/org/apache/xpath/operations/Equals.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * The '=' operation expression executer.
- */
-public class Equals extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/operations/Gt.java b/src/org/apache/xpath/operations/Gt.java
deleted file mode 100644
index a1ee4b2..0000000
--- a/src/org/apache/xpath/operations/Gt.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * The '>' operation expression executer.
- */
-public class Gt extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return left.greaterThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/operations/Gte.java b/src/org/apache/xpath/operations/Gte.java
deleted file mode 100644
index 42e14be..0000000
--- a/src/org/apache/xpath/operations/Gte.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * The '>=' operation expression executer.
- */
-public class Gte extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return left.greaterThanOrEqual(right)
-           ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/operations/Lt.java b/src/org/apache/xpath/operations/Lt.java
deleted file mode 100644
index 31878ba..0000000
--- a/src/org/apache/xpath/operations/Lt.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * The '<' operation expression executer.
- */
-public class Lt extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return left.lessThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/operations/Lte.java b/src/org/apache/xpath/operations/Lte.java
deleted file mode 100644
index 0ccf4ba..0000000
--- a/src/org/apache/xpath/operations/Lte.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * The '<=' operation expression executer.
- */
-public class Lte extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return left.lessThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/operations/Minus.java b/src/org/apache/xpath/operations/Minus.java
deleted file mode 100644
index 24ee655..0000000
--- a/src/org/apache/xpath/operations/Minus.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The binary '-' operation expression executer.
- */
-public class Minus extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the 
-   *         result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(left.num() - right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return (m_left.num(xctxt) - m_right.num(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Mod.java b/src/org/apache/xpath/operations/Mod.java
deleted file mode 100644
index 36a8ea6..0000000
--- a/src/org/apache/xpath/operations/Mod.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The 'mod' operation expression executer.
- */
-public class Mod extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(left.num() % right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return (m_left.num(xctxt) % m_right.num(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Mult.java b/src/org/apache/xpath/operations/Mult.java
deleted file mode 100644
index e5d10ee..0000000
--- a/src/org/apache/xpath/operations/Mult.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The '*' operation expression executer.
- */
-public class Mult extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(left.num() * right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return (m_left.num(xctxt) * m_right.num(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Neg.java b/src/org/apache/xpath/operations/Neg.java
deleted file mode 100644
index 17fe20d..0000000
--- a/src/org/apache/xpath/operations/Neg.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The unary '-' operation expression executer.
- */
-public class Neg extends UnaryOperation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject right) throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(-right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return -(m_right.num(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/NotEquals.java b/src/org/apache/xpath/operations/NotEquals.java
deleted file mode 100644
index 16c4872..0000000
--- a/src/org/apache/xpath/operations/NotEquals.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-/**
- * The '!=' operation expression executer.
- */
-public class NotEquals extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return (left.notEquals(right)) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-  }
-}
diff --git a/src/org/apache/xpath/operations/Number.java b/src/org/apache/xpath/operations/Number.java
deleted file mode 100644
index 32291f2..0000000
--- a/src/org/apache/xpath/operations/Number.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The 'number()' operation expression executer.
- */
-public class Number extends UnaryOperation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject right) throws javax.xml.transform.TransformerException
-  {
-
-    if (XObject.CLASS_NUMBER == right.getType())
-      return right;
-    else
-      return new XNumber(right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return m_right.num(xctxt);
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Operation.java b/src/org/apache/xpath/operations/Operation.java
deleted file mode 100644
index 0c84f93..0000000
--- a/src/org/apache/xpath/operations/Operation.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-
-import org.w3c.dom.Node;
-
-/**
- * The baseclass for a binary operation.
- */
-public class Operation extends Expression
-{
-
-  /** The left operand expression.
-   *  @serial */
-  protected Expression m_left;
-
-  /** The right operand expression.
-   *  @serial */
-  protected Expression m_right;
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    m_left.fixupVariables(vars, globalsSize);
-    m_right.fixupVariables(vars, globalsSize);
-  }
-
-
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-
-    if (null != m_left && m_left.canTraverseOutsideSubtree())
-      return true;
-
-    if (null != m_right && m_right.canTraverseOutsideSubtree())
-      return true;
-
-    return false;
-  }
-
-  /**
-   * Set the left and right operand expressions for this operation.
-   *
-   *
-   * @param l The left expression operand.
-   * @param r The right expression operand.
-   */
-  public void setLeftRight(Expression l, Expression r)
-  {
-    m_left = l;
-    m_right = r;
-  }
-
-  /**
-   * Execute a binary operation by calling execute on each of the operands,
-   * and then calling the operate method on the derived class.
-   *
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The XObject result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    XObject left = m_left.execute(xctxt);
-    XObject right = m_right.execute(xctxt);
-
-    return operate(left, right);
-  }
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return null;  // no-op
-  }
-}
diff --git a/src/org/apache/xpath/operations/Or.java b/src/org/apache/xpath/operations/Or.java
deleted file mode 100644
index ad4d756..0000000
--- a/src/org/apache/xpath/operations/Or.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XBoolean;
-
-import org.w3c.dom.Node;
-
-/**
- * The 'or' operation expression executer.
- */
-public class Or extends Operation
-{
-
-  /**
-   * OR two expressions and return the boolean result. Override
-   * superclass method for optimization purposes.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return {@link org.apache.xpath.objects.XBoolean#S_TRUE} or 
-   * {@link org.apache.xpath.objects.XBoolean#S_FALSE}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    XObject expr1 = m_left.execute(xctxt);
-
-    if (!expr1.bool())
-    {
-      XObject expr2 = m_right.execute(xctxt);
-
-      return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
-    }
-    else
-      return XBoolean.S_TRUE;
-  }
-  
-  /**
-   * Evaluate this operation directly to a boolean.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a boolean.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public boolean bool(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return (m_left.bool(xctxt) || m_right.bool(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Plus.java b/src/org/apache/xpath/operations/Plus.java
deleted file mode 100644
index 7783aa5..0000000
--- a/src/org/apache/xpath/operations/Plus.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.XPathContext;
-
-/**
- * The '+' operation expression executer.
- */
-public class Plus extends Operation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return new XNumber(left.num() + right.num());
-  }
-  
-  /**
-   * Evaluate this operation directly to a double.
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The result of the operation as a double.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double num(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    return (m_right.num(xctxt) + m_left.num(xctxt));
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/Quo.java b/src/org/apache/xpath/operations/Quo.java
deleted file mode 100644
index 4700552..0000000
--- a/src/org/apache/xpath/operations/Quo.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNumber;
-
-/**
- * The 'quo' operation expression executer. (no longer supported by XPath).
- * @deprecated.
- */
-public class Quo extends Operation
-{
-
-  // Actually, this is no longer supported by xpath...
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param left non-null reference to the evaluated left operand.
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
-    return new XNumber((int) (left.num() / right.num()));
-  }
-}
diff --git a/src/org/apache/xpath/operations/String.java b/src/org/apache/xpath/operations/String.java
deleted file mode 100644
index 3cd380f..0000000
--- a/src/org/apache/xpath/operations/String.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XString;
-
-/**
- * The 'string()' operation expression executer.
- */
-public class String extends UnaryOperation
-{
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject operate(XObject right) throws javax.xml.transform.TransformerException
-  {
-    return (XString)right.xstr(); // semi-safe cast.
-  }
-}
diff --git a/src/org/apache/xpath/operations/UnaryOperation.java b/src/org/apache/xpath/operations/UnaryOperation.java
deleted file mode 100644
index aa3a8aa..0000000
--- a/src/org/apache/xpath/operations/UnaryOperation.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-
-import org.w3c.dom.Node;
-
-/**
- * The unary operation base class.
- */
-public abstract class UnaryOperation extends Expression
-{
-
-  /** The operand for the operation.
-   *  @serial */
-  protected Expression m_right;
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    m_right.fixupVariables(vars, globalsSize);
-  }
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-
-    if (null != m_right && m_right.canTraverseOutsideSubtree())
-      return true;
-
-    return false;
-  }
-
-  /**
-   * Set the expression operand for the operation.
-   *
-   *
-   * @param r The expression operand to which the unary operation will be 
-   *          applied.
-   */
-  public void setRight(Expression r)
-  {
-    m_right = r;
-  }
-
-  /**
-   * Execute the operand and apply the unary operation to the result.
-   *
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return An XObject that represents the result of applying the unary 
-   *         operation to the evaluated operand.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    return operate(m_right.execute(xctxt));
-  }
-
-  /**
-   * Apply the operation to two operands, and return the result.
-   *
-   *
-   * @param right non-null reference to the evaluated right operand.
-   *
-   * @return non-null reference to the XObject that represents the result of the operation.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public abstract XObject operate(XObject right)
-    throws javax.xml.transform.TransformerException;
-}
diff --git a/src/org/apache/xpath/operations/Variable.java b/src/org/apache/xpath/operations/Variable.java
deleted file mode 100644
index fbb6872..0000000
--- a/src/org/apache/xpath/operations/Variable.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.operations;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xml.utils.QName;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPath;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.objects.XNodeSet;
-
-import org.w3c.dom.Node;
-
-import org.apache.xpath.res.XPATHErrorResources;
-import org.apache.xalan.res.XSLMessages;
-
-/**
- * The variable reference expression executer.
- */
-public class Variable extends Expression
-{
-  /** Tell if fixupVariables was called.
-   *  @serial   */
-  private boolean m_fixUpWasCalled = false;
-
-  /** The qualified name of the variable.
-   *  @serial   */
-  protected QName m_qname;
-  
-  /**
-   * The index of the variable, which is either an absolute index to a 
-   * global, or, if higher than the globals area, must be adjusted by adding 
-   * the offset to the current stack frame.
-   */
-  protected int m_index;
-  
-  protected boolean m_isGlobal = false;
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    m_fixUpWasCalled = true;
-    int sz = vars.size();
-    for (int i = vars.size()-1; i >= 0; i--) 
-    {
-      QName qn = (QName)vars.elementAt(i);
-      // System.out.println("qn: "+qn);
-      if(qn.equals(m_qname))
-      {
-        
-        if(i < globalsSize)
-        {
-          m_isGlobal = true;
-          m_index = i;
-        }
-        else
-        {
-          m_index = i-globalsSize;
-        }
-          
-        return;
-      }
-    }
-    java.lang.String msg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_COULD_NOT_FIND_VAR, 
-                                             new Object[]{m_qname.toString()});
-                                             
-    TransformerException te = new TransformerException(msg, m_slocator);
-                                             
-    throw new org.apache.xml.utils.WrappedRuntimeException(te);
-    
-  }
-
-
-  /**
-   * Set the qualified name of the variable.
-   *
-   * @param qname Must be a non-null reference to a qualified name.
-   */
-  public void setQName(QName qname)
-  {
-    m_qname = qname;
-  }
-
-  /**
-   * Dereference the variable, and return the reference value.  Note that lazy 
-   * evaluation will occur.  If a variable within scope is not found, a warning 
-   * will be sent to the error listener, and an empty nodeset will be returned.
-   *
-   *
-   * @param xctxt The runtime execution context.
-   *
-   * @return The evaluated variable, or an empty nodeset if not found.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    // Is the variable fetched always the same?
-    // XObject result = xctxt.getVariable(m_qname);
-    if(m_fixUpWasCalled)
-    {    
-      XObject result;
-      if(m_isGlobal)
-        result = xctxt.getVarStack().getGlobalVariable(xctxt, m_index);
-      else
-        result = xctxt.getVarStack().getLocalVariable(xctxt, m_index);
-  
-      if (null == result)
-      {
-        // This should now never happen...
-        warn(xctxt, XPATHErrorResources.WG_ILLEGAL_VARIABLE_REFERENCE,
-             new Object[]{ m_qname.getLocalPart() });  //"VariableReference given for variable out "+
-  //      (new RuntimeException()).printStackTrace();
-  //      error(xctxt, XPATHErrorResources.ER_COULDNOT_GET_VAR_NAMED,
-  //            new Object[]{ m_qname.getLocalPart() });  //"Could not get variable named "+varName);
-        
-        result = new XNodeSet(xctxt.getDTMManager());
-      }
-  
-      return result;
-    }
-    else
-    {
-      // Hack city... big time.  This is needed to evaluate xpaths from extensions, 
-      // pending some bright light going off in my head.  Some sort of callback?
-      synchronized(this)
-      {
-        org.apache.xml.utils.PrefixResolver prefixResolver = xctxt.getNamespaceContext();
-
-        // Get the current ElemTemplateElement, which must be pushed in as the 
-        // prefix resolver, and then walk backwards in document order, searching 
-        // for an xsl:param element or xsl:variable element that matches our 
-        // qname.  If we reach the top level, use the StylesheetRoot's composed
-        // list of top level variables and parameters.
-
-        if (prefixResolver instanceof org.apache.xalan.templates.ElemTemplateElement)
-        {
-
-          org.apache.xalan.templates.ElemVariable vvar;
-
-          org.apache.xalan.templates.ElemTemplateElement prev = 
-            (org.apache.xalan.templates.ElemTemplateElement) prefixResolver;
-
-          if (!(prev instanceof org.apache.xalan.templates.Stylesheet))
-          {            
-            while ( !(prev.getParentNode() instanceof org.apache.xalan.templates.Stylesheet) )
-            {
-              org.apache.xalan.templates.ElemTemplateElement savedprev = prev;
-
-              while (null != (prev = prev.getPreviousSiblingElem()))
-              {
-                if(prev instanceof org.apache.xalan.templates.ElemVariable)
-                {
-                  vvar = (org.apache.xalan.templates.ElemVariable) prev;
-                
-                  if (vvar.getName().equals(m_qname))
-                  {
-                    m_index = vvar.getIndex();
-                    m_isGlobal = false;
-                    m_fixUpWasCalled = true;
-                    return execute(xctxt);
-                  }
-                }
-              }
-              prev = savedprev.getParentElem();
-            }
-          }
-
-          vvar = prev.getStylesheetRoot().getVariableOrParamComposed(m_qname);
-          if (null != vvar)
-          {
-            m_index = vvar.getIndex();
-            m_isGlobal = true;
-            m_fixUpWasCalled = true;
-            return execute(xctxt);
-          }
-
-        }
-      }
-      throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{m_qname.toString()})); //"Variable not resolvable: "+m_qname);
-    }
-  }
-  
-  /**
-   * Tell if this expression returns a stable number that will not change during 
-   * iterations within the expression.  This is used to determine if a proximity 
-   * position predicate can indicate that no more searching has to occur.
-   * 
-   *
-   * @return true if the expression represents a stable number.
-   */
-  public boolean isStableNumber()
-  {
-    return true;
-  }
-
-}
diff --git a/src/org/apache/xpath/operations/package.html b/src/org/apache/xpath/operations/package.html
deleted file mode 100644
index b4d4bd0..0000000
--- a/src/org/apache/xpath/operations/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>Xalan XPath operations.</title>
-  <body>
-    <p>Support for XPath operations, such as +, -, string(), etc.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/package.html b/src/org/apache/xpath/package.html
deleted file mode 100644
index aa3512c..0000000
--- a/src/org/apache/xpath/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <title>XPath support Package.</title>
-  <body>
-    <p>Implementation of XPath; for the most part, only classes meant for public use are
-    found at this root level of the XPath packages.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/patterns/ContextMatchStepPattern.java b/src/org/apache/xpath/patterns/ContextMatchStepPattern.java
deleted file mode 100644
index 8e0c93e..0000000
--- a/src/org/apache/xpath/patterns/ContextMatchStepPattern.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.patterns;
-
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.Axis;
-import org.apache.xpath.axes.WalkerFactory; // evil import.
-
-/**
- * Special context node pattern matcher.
- */
-public class ContextMatchStepPattern extends StepPattern
-{
-
-  /**
-   * Construct a ContextMatchStepPattern.
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   */
-  public ContextMatchStepPattern(int axis, int paxis)
-  {
-    super(DTMFilter.SHOW_ALL, axis, paxis);
-  }
-
-  /**
-   * Execute this pattern step, including predicates.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (xctxt.getIteratorRoot() == xctxt.getCurrentNode())
-      return getStaticScore();
-    else
-      return this.SCORE_NONE;
-  }
-  
-  /**
-   * Execute the match pattern step relative to another step.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   * NEEDSDOC @param prevStep
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject executeRelativePathPattern(
-          XPathContext xctxt, StepPattern prevStep)
-            throws javax.xml.transform.TransformerException
-  {
-
-    XObject score = NodeTest.SCORE_NONE;
-    int context = xctxt.getCurrentNode();
-    DTM dtm = xctxt.getDTM(context);
-
-    if (null != dtm)
-    {
-      int predContext = xctxt.getCurrentNode();
-      DTMAxisTraverser traverser;
-      
-      int axis = m_axis;
-      
-      boolean needToTraverseAttrs = WalkerFactory.isDownwardAxisOfMany(axis);
-      boolean iterRootIsAttr = (dtm.getNodeType(xctxt.getIteratorRoot()) 
-                                 == DTM.ATTRIBUTE_NODE);
-
-      if((Axis.PRECEDING == axis) && iterRootIsAttr)
-      {
-        axis = Axis.PRECEDINGANDANCESTOR;
-      }
-      
-      traverser = dtm.getAxisTraverser(axis);
-
-      for (int relative = traverser.first(context); DTM.NULL != relative;
-              relative = traverser.next(context, relative))
-      {
-        try
-        {
-          xctxt.pushCurrentNode(relative);
-
-          score = execute(xctxt);
-
-          if (score != NodeTest.SCORE_NONE)
-          {
-	      //score = executePredicates( xctxt, prevStep, SCORE_OTHER, 
-	      //       predContext, relative);
-	      if (executePredicates(xctxt, dtm, context))
-		  return score;
-	      
-	      score = NodeTest.SCORE_NONE;
-          }
-          
-          if(needToTraverseAttrs && iterRootIsAttr
-             && (DTM.ELEMENT_NODE == dtm.getNodeType(relative)))
-          {
-            int xaxis = Axis.ATTRIBUTE;
-            for (int i = 0; i < 2; i++) 
-            {            
-              DTMAxisTraverser atraverser = dtm.getAxisTraverser(xaxis);
-        
-              for (int arelative = atraverser.first(relative); 
-                      DTM.NULL != arelative;
-                      arelative = atraverser.next(relative, arelative))
-              {
-                try
-                {
-                  xctxt.pushCurrentNode(arelative);
-        
-                  score = execute(xctxt);
-        
-                  if (score != NodeTest.SCORE_NONE)
-                  {
-		      //score = executePredicates( xctxt, prevStep, SCORE_OTHER, 
-		      //       predContext, arelative);
-        
-                    if (score != NodeTest.SCORE_NONE)
-                      return score;
-                  }
-                }
-                finally
-                {
-                  xctxt.popCurrentNode();
-                }
-              }
-              xaxis = Axis.NAMESPACE;
-            }
-          }
-
-        }
-        finally
-        {
-          xctxt.popCurrentNode();
-        }
-      }
-
-    }
-
-    return score;
-  }
-
-}
diff --git a/src/org/apache/xpath/patterns/FunctionPattern.java b/src/org/apache/xpath/patterns/FunctionPattern.java
deleted file mode 100644
index 3e9f0c6..0000000
--- a/src/org/apache/xpath/patterns/FunctionPattern.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.patterns;
-
-import org.apache.xpath.XPath;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XObject;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMIterator;
-import org.apache.xml.dtm.Axis;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Match pattern step that contains a function.
- */
-public class FunctionPattern extends StepPattern
-{
-
-  /**
-   * Construct a FunctionPattern from a
-   * {@link org.apache.xpath.functions.Function expression}.
-   *
-   *
-   * @param a should be a {@link org.apache.xpath.functions.Function expression}.
-   *
-   * NEEDSDOC @param expr
-   */
-  public FunctionPattern(Expression expr, int axis, int predaxis)
-  {
-
-    super(0, null, null, axis, predaxis);
-
-    m_functionExpr = expr;
-  }
-
-  /**
-   * Static calc of match score.
-   */
-  public final void calcScore()
-  {
-
-    m_score = SCORE_OTHER;
-
-    if (null == m_targetString)
-      calcTargetString();
-  }
-
-  /**
-   * Should be a {@link org.apache.xpath.functions.Function expression}.
-   *  @serial   
-   */
-  Expression m_functionExpr;
-  
-  /**
-   * This function is used to fixup variables from QNames to stack frame 
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list 
-   * should be searched backwards for the first qualified name that 
-   * corresponds to the variable reference qname.  The position of the 
-   * QName in the vector from the start of the vector will be its position 
-   * in the stack frame (but variables above the globalsTop value will need 
-   * to be offset to the current stack frame).
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    super.fixupVariables(vars, globalsSize);
-    m_functionExpr.fixupVariables(vars, globalsSize);
-  }
-
-  
-  /**
-   * Test a node to see if it matches the given node test.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt, int context)
-          throws javax.xml.transform.TransformerException
-  {
-
-    DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
-    XNumber score = SCORE_NONE;
-
-    if (null != nl)
-    {
-      int n;
-
-      while (DTM.NULL != (n = nl.nextNode()))
-      {
-        score = (n == context) ? SCORE_OTHER : SCORE_NONE;
-
-        if (score == SCORE_OTHER)
-        {
-          context = n;
-
-          break;
-        }
-      }
-
-      // nl.detach();
-    }
-    nl.detach();
-
-    return score;
-  }
-  
-  /**
-   * Test a node to see if it matches the given node test.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt, int context, 
-                         DTM dtm, int expType)
-          throws javax.xml.transform.TransformerException
-  {
-
-    DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
-    XNumber score = SCORE_NONE;
-
-    if (null != nl)
-    {
-      int n;
-
-      while (DTM.NULL != (n = nl.nextNode()))
-      {
-        score = (n == context) ? SCORE_OTHER : SCORE_NONE;
-
-        if (score == SCORE_OTHER)
-        {
-          context = n;
-
-          break;
-        }
-      }
-
-      nl.detach();
-    }
-
-    return score;
-  }
-  
-  /**
-   * Test a node to see if it matches the given node test.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-
-    int context = xctxt.getCurrentNode();
-    DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
-    XNumber score = SCORE_NONE;
-
-    if (null != nl)
-    {
-      int n;
-
-      while (DTM.NULL != (n = nl.nextNode()))
-      {
-        score = (n == context) ? SCORE_OTHER : SCORE_NONE;
-
-        if (score == SCORE_OTHER)
-        {
-          context = n;
-
-          break;
-        }
-      }
-
-      nl.detach();
-    }
-
-    return score;
-  }
-}
diff --git a/src/org/apache/xpath/patterns/NodeTest.java b/src/org/apache/xpath/patterns/NodeTest.java
deleted file mode 100644
index 96c8104..0000000
--- a/src/org/apache/xpath/patterns/NodeTest.java
+++ /dev/null
@@ -1,682 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.patterns;
-
-import org.apache.xpath.compiler.OpCodes;
-import org.apache.xpath.XPath;
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XNumber;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.WhitespaceStrippingElementMatcher;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.ref.ExpandedNameTable;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This is the basic node test class for both match patterns and location path
- * steps.
- */
-public class NodeTest extends Expression
-{
-
-  /**
-   * The namespace or local name for node tests with a wildcard.
-   *  @see <a href="http://www.w3.org/TR/xpath#NT-NameTest">the XPath NameTest production.</a> 
-   */
-  public static final String WILD = "*";
-
-  /**
-   * The URL to pass to the Node#supports method, to see if the
-   * DOM has already been stripped of whitespace nodes. 
-   */
-  public static final String SUPPORTS_PRE_STRIPPING =
-    "http://xml.apache.org/xpath/features/whitespace-pre-stripping";
-
-  /**
-   * This attribute determines which node types are accepted.
-   * @serial
-   */
-  protected int m_whatToShow;
-
-  /**
-   * Special bitmap for match patterns starting with a function.
-   * Make sure this does not conflict with {@link org.w3c.dom.traversal.NodeFilter}.
-   */
-  public static final int SHOW_BYFUNCTION = 0x00010000;
-
-  /**
-   * This attribute determines which node types are accepted.
-   * These constants are defined in the {@link org.w3c.dom.traversal.NodeFilter}
-   * interface.
-   *
-   * @return bitset mainly defined in {@link org.w3c.dom.traversal.NodeFilter}.
-   */
-  public int getWhatToShow()
-  {
-    return m_whatToShow;
-  }
-  
-  /**
-   * This attribute determines which node types are accepted.
-   * These constants are defined in the {@link org.w3c.dom.traversal.NodeFilter}
-   * interface.
-   *
-   * @param what bitset mainly defined in {@link org.w3c.dom.traversal.NodeFilter}.
-   */
-  public void setWhatToShow(int what)
-  {
-    m_whatToShow = what;
-  }
-
-  /**
-   * The namespace to be tested for, which may be null.
-   *  @serial 
-   */
-  String m_namespace;
-
-  /**
-   * Return the namespace to be tested.
-   *
-   * @return The namespace to be tested for, or {@link #WILD}, or null.
-   */
-  public String getNamespace()
-  {
-    return m_namespace;
-  }
-
-  /**
-   * Set the namespace to be tested.
-   *
-   * @param ns The namespace to be tested for, or {@link #WILD}, or null.
-   */
-  public void setNamespace(String ns)
-  {
-    m_namespace = ns;
-  }
-
-  /**
-   * The local name to be tested for.
-   *  @serial 
-   */
-  protected String m_name;
-
-  /**
-   * Return the local name to be tested.
-   *
-   * @return the local name to be tested, or {@link #WILD}, or an empty string.
-   */
-  public String getLocalName()
-  {
-    return (null == m_name) ? "" : m_name;
-  }
-
-  /**
-   * Set the local name to be tested.
-   *
-   * @param name the local name to be tested, or {@link #WILD}, or an empty string.
-   */
-  public void setLocalName(String name)
-  {
-    m_name = name;
-  }
-
-  /**
-   * Statically calculated score for this test.  One of
-   *  {@link #SCORE_NODETEST},
-   *  {@link #SCORE_NONE},
-   *  {@link #SCORE_NSWILD},
-   *  {@link #SCORE_QNAME}, or
-   *  {@link #SCORE_OTHER}.
-   *  @serial
-   */
-  XNumber m_score;
-
-  /**
-   * The match score if the pattern consists of just a NodeTest.
-   *  @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a> 
-   */
-  public static final XNumber SCORE_NODETEST =
-    new XNumber(XPath.MATCH_SCORE_NODETEST);
-
-  /**
-   * The match score if the pattern pattern has the form NCName:*.
-   *  @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a> 
-   */
-  public static final XNumber SCORE_NSWILD =
-    new XNumber(XPath.MATCH_SCORE_NSWILD);
-
-  /**
-   * The match score if the pattern has the form
-   * of a QName optionally preceded by an @ character.
-   *  @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a> 
-   */
-  public static final XNumber SCORE_QNAME =
-    new XNumber(XPath.MATCH_SCORE_QNAME);
-
-  /**
-   * The match score if the pattern consists of something
-   * other than just a NodeTest or just a qname.
-   *  @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a> 
-   */
-  public static final XNumber SCORE_OTHER =
-    new XNumber(XPath.MATCH_SCORE_OTHER);
-
-  /**
-   * The match score if no match is made.
-   *  @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a> 
-   */
-  public static final XNumber SCORE_NONE =
-    new XNumber(XPath.MATCH_SCORE_NONE);
-
-  /**
-   * Construct an NodeTest that tests for namespaces and node names.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   * @param namespace The namespace to be tested.
-   * @param name The local name to be tested.
-   */
-  public NodeTest(int whatToShow, String namespace, String name)
-  {
-    initNodeTest(whatToShow, namespace, name);
-  }
-
-  /**
-   * Construct an NodeTest that doesn't test for node names.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   */
-  public NodeTest(int whatToShow)
-  {
-    initNodeTest(whatToShow);
-  }
-
-  /**
-   * Null argument constructor.
-   */
-  public NodeTest(){}
-
-  /**
-   * Initialize this node test by setting the whatToShow property, and
-   * calculating the score that this test will return if a test succeeds.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   */
-  public void initNodeTest(int whatToShow)
-  {
-
-    m_whatToShow = whatToShow;
-
-    calcScore();
-  }
-
-  /**
-   * Initialize this node test by setting the whatToShow property and the
-   * namespace and local name, and
-   * calculating the score that this test will return if a test succeeds.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   * @param namespace The namespace to be tested.
-   * @param name The local name to be tested.
-   */
-  public void initNodeTest(int whatToShow, String namespace, String name)
-  {
-
-    m_whatToShow = whatToShow;
-    m_namespace = namespace;
-    m_name = name;
-
-    calcScore();
-  }
-
-  /**
-   * True if this test has a null namespace and a local name of {@link #WILD}.
-   *  @serial 
-   */
-  private boolean m_isTotallyWild;
-  
-  /**
-   * Get the static score for this node test.
-   * @return Should be one of the SCORE_XXX constants.
-   */
-  public XNumber getStaticScore()
-  {
-    return m_score;
-  }
-  
-  /**
-   * Set the static score for this node test.
-   * @param score Should be one of the SCORE_XXX constants.
-   */
-  public void setStaticScore(XNumber score)
-  {
-    m_score = score;
-  }
-
-  /**
-   * Static calc of match score.
-   */
-  protected void calcScore()
-  {
-
-    if ((m_namespace == null) && (m_name == null))
-      m_score = SCORE_NODETEST;
-    else if (((m_namespace == WILD) || (m_namespace == null))
-             && (m_name == WILD))
-      m_score = SCORE_NODETEST;
-    else if ((m_namespace != WILD) && (m_name == WILD))
-      m_score = SCORE_NSWILD;
-    else
-      m_score = SCORE_QNAME;
-
-    m_isTotallyWild = (m_namespace == null && m_name == WILD);
-  }
-
-  /**
-   * Get the score that this test will return if a test succeeds.
-   *
-   *
-   * @return the score that this test will return if a test succeeds.
-   */
-  public double getDefaultScore()
-  {
-    return m_score.num();
-  }
-  
-  /**
-   * Tell what node type to test, if not DTMFilter.SHOW_ALL.
-   *
-   * @param whatToShow Bit set defined mainly by 
-   *        {@link org.apache.xml.dtm.DTMFilter}.
-   * @return the node type for the whatToShow.  Since whatToShow can specify 
-   *         multiple types, it will return the first bit tested that is on, 
-   *         so the caller of this function should take care that this is 
-   *         the function they really want to call.  If none of the known bits
-   *         are set, this function will return zero.
-   */
-  public static int getNodeTypeTest(int whatToShow)
-  {
-    // %REVIEW% Is there a better way?
-    if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
-      return DTM.ELEMENT_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
-      return DTM.ATTRIBUTE_NODE;
-      
-    if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
-      return DTM.TEXT_NODE;
-      
-    if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
-      return DTM.DOCUMENT_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
-      return DTM.DOCUMENT_FRAGMENT_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
-      return DTM.NAMESPACE_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
-      return DTM.COMMENT_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
-      return DTM.PROCESSING_INSTRUCTION_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
-      return DTM.DOCUMENT_TYPE_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
-      return DTM.ENTITY_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
-      return DTM.ENTITY_REFERENCE_NODE;
-
-    if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
-      return DTM.NOTATION_NODE;
-      
-    if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
-      return DTM.CDATA_SECTION_NODE;
-
-
-    return 0;
-  }
-
-
-  /**
-   * Do a diagnostics dump of a whatToShow bit set.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by 
-   *        {@link org.apache.xml.dtm.DTMFilter}.
-   */
-  public static void debugWhatToShow(int whatToShow)
-  {
-
-    java.util.Vector v = new java.util.Vector();
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
-      v.addElement("SHOW_ATTRIBUTE");
-      
-    if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
-      v.addElement("SHOW_NAMESPACE");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
-      v.addElement("SHOW_CDATA_SECTION");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
-      v.addElement("SHOW_COMMENT");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
-      v.addElement("SHOW_DOCUMENT");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
-      v.addElement("SHOW_DOCUMENT_FRAGMENT");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
-      v.addElement("SHOW_DOCUMENT_TYPE");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
-      v.addElement("SHOW_ELEMENT");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
-      v.addElement("SHOW_ENTITY");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
-      v.addElement("SHOW_ENTITY_REFERENCE");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
-      v.addElement("SHOW_NOTATION");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
-      v.addElement("SHOW_PROCESSING_INSTRUCTION");
-
-    if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
-      v.addElement("SHOW_TEXT");
-
-    int n = v.size();
-
-    for (int i = 0; i < n; i++)
-    {
-      if (i > 0)
-        System.out.print(" | ");
-
-      System.out.print(v.elementAt(i));
-    }
-
-    if (0 == n)
-      System.out.print("empty whatToShow: " + whatToShow);
-
-    System.out.println();
-  }
-
-  /**
-   * Two names are equal if they and either both are null or
-   * the name t is wild and the name p is non-null, or the two
-   * strings are equal.
-   *
-   * @param p part string from the node.
-   * @param t target string, which may be {@link #WILD}.
-   *
-   * @return true if the strings match according to the rules of this method.
-   */
-  private static final boolean subPartMatch(String p, String t)
-  {
-
-    // boolean b = (p == t) || ((null != p) && ((t == WILD) || p.equals(t)));
-    // System.out.println("subPartMatch - p: "+p+", t: "+t+", result: "+b);
-    return (p == t) || ((null != p) && ((t == WILD) || p.equals(t)));
-  }
-
-  /**
-   * This is temporary to patch over Xerces issue with representing DOM
-   * namespaces as "".
-   *
-   * @param p part string from the node, which may represent the null namespace
-   *        as null or as "".
-   * @param t target string, which may be {@link #WILD}.
-   *
-   * @return true if the strings match according to the rules of this method.
-   */
-  private static final boolean subPartMatchNS(String p, String t)
-  {
-
-    return (p == t)
-           || ((null != p)
-               && ((p.length() > 0)
-                   ? ((t == WILD) || p.equals(t)) : null == t));
-  }
-
-  /**
-   * Tell what the test score is for the given node.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   * @param context The node being tested.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt, int context)
-          throws javax.xml.transform.TransformerException
-  {
-
-    DTM dtm = xctxt.getDTM(context);
-    short nodeType = dtm.getNodeType(context);
-
-    if (m_whatToShow == DTMFilter.SHOW_ALL)
-      return m_score;
-
-    int nodeBit = (m_whatToShow & (0x00000001 << (nodeType - 1)));
-
-    switch (nodeBit)
-    {
-    case DTMFilter.SHOW_DOCUMENT_FRAGMENT :
-    case DTMFilter.SHOW_DOCUMENT :
-      return SCORE_OTHER;
-    case DTMFilter.SHOW_COMMENT :
-      return m_score;
-    case DTMFilter.SHOW_CDATA_SECTION :
-    case DTMFilter.SHOW_TEXT :
-
-      // was: 
-      // return (!xctxt.getDOMHelper().shouldStripSourceNode(context))
-      //       ? m_score : SCORE_NONE;
-      return m_score;
-    case DTMFilter.SHOW_PROCESSING_INSTRUCTION :
-      return subPartMatch(dtm.getNodeName(context), m_name)
-             ? m_score : SCORE_NONE;
-
-    // From the draft: "Two expanded names are equal if they 
-    // have the same local part, and either both have no URI or 
-    // both have the same URI."
-    // "A node test * is true for any node of the principal node type. 
-    // For example, child::* will select all element children of the 
-    // context node, and attribute::* will select all attributes of 
-    // the context node."
-    // "A node test can have the form NCName:*. In this case, the prefix 
-    // is expanded in the same way as with a QName using the context 
-    // namespace declarations. The node test will be true for any node 
-    // of the principal type whose expanded name has the URI to which 
-    // the prefix expands, regardless of the local part of the name."
-    case DTMFilter.SHOW_NAMESPACE :
-    {
-      String ns = dtm.getNodeValue(context);
-
-      return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
-    }
-    case DTMFilter.SHOW_ATTRIBUTE :
-    case DTMFilter.SHOW_ELEMENT :
-    {
-      return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name)))
-             ? m_score : SCORE_NONE;
-    }
-    default :
-      return SCORE_NONE;
-    }  // end switch(testType)
-  }
-  
-  /**
-   * Tell what the test score is for the given node.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   * @param context The node being tested.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt, int context, 
-                         DTM dtm, int expType)
-          throws javax.xml.transform.TransformerException
-  {
-
-    if (m_whatToShow == DTMFilter.SHOW_ALL)
-      return m_score;
-
-    int nodeBit = (m_whatToShow & (0x00000001 
-                   << ((expType >> ExpandedNameTable.ROTAMOUNT_TYPE) - 1)));
-
-    switch (nodeBit)
-    {
-    case DTMFilter.SHOW_DOCUMENT_FRAGMENT :
-    case DTMFilter.SHOW_DOCUMENT :
-      return SCORE_OTHER;
-    case DTMFilter.SHOW_COMMENT :
-      return m_score;
-    case DTMFilter.SHOW_CDATA_SECTION :
-    case DTMFilter.SHOW_TEXT :
-
-      // was: 
-      // return (!xctxt.getDOMHelper().shouldStripSourceNode(context))
-      //       ? m_score : SCORE_NONE;
-      return m_score;
-    case DTMFilter.SHOW_PROCESSING_INSTRUCTION :
-      return subPartMatch(dtm.getNodeName(context), m_name)
-             ? m_score : SCORE_NONE;
-
-    // From the draft: "Two expanded names are equal if they 
-    // have the same local part, and either both have no URI or 
-    // both have the same URI."
-    // "A node test * is true for any node of the principal node type. 
-    // For example, child::* will select all element children of the 
-    // context node, and attribute::* will select all attributes of 
-    // the context node."
-    // "A node test can have the form NCName:*. In this case, the prefix 
-    // is expanded in the same way as with a QName using the context 
-    // namespace declarations. The node test will be true for any node 
-    // of the principal type whose expanded name has the URI to which 
-    // the prefix expands, regardless of the local part of the name."
-    case DTMFilter.SHOW_NAMESPACE :
-    {
-      String ns = dtm.getNodeValue(context);
-
-      return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
-    }
-    case DTMFilter.SHOW_ATTRIBUTE :
-    case DTMFilter.SHOW_ELEMENT :
-    {
-      return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name)))
-             ? m_score : SCORE_NONE;
-    }
-    default :
-      return SCORE_NONE;
-    }  // end switch(testType)
-  }
-
-  /**
-   * Test the current node to see if it matches the given node test.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return execute(xctxt, xctxt.getCurrentNode());
-  }
-  
-  /**
-   * Node tests by themselves do not need to fix up variables.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    // no-op
-  }
-
-}
diff --git a/src/org/apache/xpath/patterns/NodeTestFilter.java b/src/org/apache/xpath/patterns/NodeTestFilter.java
deleted file mode 100644
index e230239..0000000
--- a/src/org/apache/xpath/patterns/NodeTestFilter.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.patterns;
-
-/**
- * This interface should be implemented by Nodes and/or iterators,
- * when they need to know what the node test is before they do
- * getNextChild, etc.
- */
-public interface NodeTestFilter
-{
-
-  /**
-   * Set the node test for this filter.
-   *
-   *
-   * @param nodeTest Reference to a NodeTest that may be used to predetermine 
-   *                 what nodes to return.
-   */
-  void setNodeTest(NodeTest nodeTest);
-}
diff --git a/src/org/apache/xpath/patterns/StepPattern.java b/src/org/apache/xpath/patterns/StepPattern.java
deleted file mode 100644
index 2e8cd74..0000000
--- a/src/org/apache/xpath/patterns/StepPattern.java
+++ /dev/null
@@ -1,962 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.patterns;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.XPathContext;
-import org.apache.xml.utils.PrefixResolver;
-import org.apache.xpath.axes.SubContextList;
-import org.apache.xpath.compiler.PsuedoNames;
-import org.apache.xml.dtm.DTM;
-import org.apache.xml.dtm.DTMFilter;
-import org.apache.xml.dtm.DTMAxisTraverser;
-import org.apache.xml.dtm.Axis;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class represents a single pattern match step.
- */
-public class StepPattern extends NodeTest implements SubContextList
-{
-
-  /** The axis for this test. */
-  protected int m_axis;
-
-  /**
-   * Construct a StepPattern that tests for namespaces and node names.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   * @param namespace The namespace to be tested.
-   * @param name The local name to be tested.
-   * @param axis The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
-   * @param axisForPredicate No longer used.
-   */
-  public StepPattern(int whatToShow, String namespace, String name, int axis,
-                     int axisForPredicate)
-  {
-
-    super(whatToShow, namespace, name);
-
-    m_axis = axis;
-  }
-
-  /**
-   * Construct a StepPattern that doesn't test for node names.
-   *
-   *
-   * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
-   * @param axis The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
-   * @param axisForPredicate No longer used.
-   */
-  public StepPattern(int whatToShow, int axis, int axisForPredicate)
-  {
-
-    super(whatToShow);
-
-    m_axis = axis;
-  }
-
-  /**
-   * The target local name or psuedo name, for hash table lookup optimization.
-   *  @serial
-   */
-  String m_targetString;  // only calculate on head
-
-  /**
-   * Calculate the local name or psuedo name of the node that this pattern will test,
-   * for hash table lookup optimization.
-   *
-   * @see org.apache.xpath.compiler.PsuedoNames
-   */
-  public void calcTargetString()
-  {
-
-    int whatToShow = getWhatToShow();
-
-    switch (whatToShow)
-    {
-    case DTMFilter.SHOW_COMMENT :
-      m_targetString = PsuedoNames.PSEUDONAME_COMMENT;
-      break;
-    case DTMFilter.SHOW_TEXT :
-    case DTMFilter.SHOW_CDATA_SECTION :
-    case (DTMFilter.SHOW_TEXT | DTMFilter.SHOW_CDATA_SECTION) :
-      m_targetString = PsuedoNames.PSEUDONAME_TEXT;
-      break;
-    case DTMFilter.SHOW_ALL :
-      m_targetString = PsuedoNames.PSEUDONAME_ANY;
-      break;
-    case DTMFilter.SHOW_DOCUMENT :
-    case DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT :
-      m_targetString = PsuedoNames.PSEUDONAME_ROOT;
-      break;
-    case DTMFilter.SHOW_ELEMENT :
-      if (this.WILD == m_name)
-        m_targetString = PsuedoNames.PSEUDONAME_ANY;
-      else
-        m_targetString = m_name;
-      break;
-    default :
-      m_targetString = PsuedoNames.PSEUDONAME_ANY;
-      break;
-    }
-  }
-
-  /**
-   * Get the local name or psuedo name of the node that this pattern will test,
-   * for hash table lookup optimization.
-   *
-   *
-   * @return local name or psuedo name of the node.
-   * @see org.apache.xpath.compiler.PsuedoNames
-   */
-  public String getTargetString()
-  {
-    return m_targetString;
-  }
-
-  /**
-   * Reference to nodetest and predicate for
-   * parent or ancestor.
-   * @serial
-   */
-  StepPattern m_relativePathPattern;
-
-  /**
-   * This function is used to fixup variables from QNames to stack frame
-   * indexes at stylesheet build time.
-   * @param vars List of QNames that correspond to variables.  This list
-   * should be searched backwards for the first qualified name that
-   * corresponds to the variable reference qname.  The position of the
-   * QName in the vector from the start of the vector will be its position
-   * in the stack frame (but variables above the globalsTop value will need
-   * to be offset to the current stack frame).
-   * @param globalsSize The number of variables in the global variable area.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-
-    super.fixupVariables(vars, globalsSize);
-
-    if (null != m_predicates)
-    {
-      for (int i = 0; i < m_predicates.length; i++)
-      {
-        m_predicates[i].fixupVariables(vars, globalsSize);
-      }
-    }
-
-    if (null != m_relativePathPattern)
-    {
-      m_relativePathPattern.fixupVariables(vars, globalsSize);
-    }
-  }
-
-  /**
-   * Set the reference to nodetest and predicate for
-   * parent or ancestor.
-   *
-   *
-   * @param expr The relative pattern expression.
-   */
-  public void setRelativePathPattern(StepPattern expr)
-  {
-
-    m_relativePathPattern = expr;
-
-    calcScore();
-  }
-
-  /**
-   * Get the reference to nodetest and predicate for
-   * parent or ancestor.
-   *
-   *
-   * @return The relative pattern expression.
-   */
-  public StepPattern getRelativePathPattern()
-  {
-    return m_relativePathPattern;
-  }
-
-  //  /**
-  //   * Set the list of predicate expressions for this pattern step.
-  //   * @param predicates List of expression objects.
-  //   */
-  //  public void setPredicates(Expression[] predicates)
-  //  {
-  //    m_predicates = predicates;
-  //  }
-
-  /**
-   * Set the list of predicate expressions for this pattern step.
-   * @return List of expression objects.
-   */
-  public Expression[] getPredicates()
-  {
-    return m_predicates;
-  }
-
-  /**
-   * The list of predicate expressions for this pattern step.
-   *  @serial
-   */
-  Expression[] m_predicates;
-
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside
-   * the current subtree.
-   *
-   * NOTE: Ancestors tests with predicates are problematic, and will require
-   * special treatment.
-   *
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-  public boolean canTraverseOutsideSubtree()
-  {
-
-    int n = getPredicateCount();
-
-    for (int i = 0; i < n; i++)
-    {
-      if (getPredicate(i).canTraverseOutsideSubtree())
-        return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Get a predicate expression.
-   *
-   *
-   * @param i The index of the predicate.
-   *
-   * @return A predicate expression.
-   */
-  public Expression getPredicate(int i)
-  {
-    return m_predicates[i];
-  }
-
-  /**
-   * Get the number of predicates for this match pattern step.
-   *
-   *
-   * @return the number of predicates for this match pattern step.
-   */
-  public final int getPredicateCount()
-  {
-    return (null == m_predicates) ? 0 : m_predicates.length;
-  }
-
-  /**
-   * Set the predicates for this match pattern step.
-   *
-   *
-   * @param predicates An array of expressions that define predicates
-   *                   for this step.
-   */
-  public void setPredicates(Expression[] predicates)
-  {
-
-    m_predicates = predicates;
-
-    calcScore();
-  }
-
-  /**
-   * Static calc of match score.
-   */
-  public void calcScore()
-  {
-
-    if ((getPredicateCount() > 0) || (null != m_relativePathPattern))
-    {
-      m_score = SCORE_OTHER;
-    }
-    else
-      super.calcScore();
-
-    if (null == m_targetString)
-      calcTargetString();
-  }
-
-  /**
-   * Execute this pattern step, including predicates.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   * @param currentNode The current node context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt, int currentNode)
-          throws javax.xml.transform.TransformerException
-  {
-
-    DTM dtm = xctxt.getDTM(currentNode);
-
-    if (dtm != null)
-    {
-      int expType = dtm.getExpandedTypeID(currentNode);
-
-      return execute(xctxt, currentNode, dtm, expType);
-    }
-
-    return NodeTest.SCORE_NONE;
-  }
-
-  /**
-   * Execute this pattern step, including predicates.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt)
-          throws javax.xml.transform.TransformerException
-  {
-    return execute(xctxt, xctxt.getCurrentNode());
-  }
-
-  /**
-   * Execute an expression in the XPath runtime context, and return the
-   * result of the expression.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   * @param currentNode The currentNode.
-   * @param dtm The DTM of the current node.
-   * @param expType The expanded type ID of the current node.
-   *
-   * @return The result of the expression in the form of a <code>XObject</code>.
-   *
-   * @throws javax.xml.transform.TransformerException if a runtime exception
-   *         occurs.
-   */
-  public XObject execute(
-          XPathContext xctxt, int currentNode, DTM dtm, int expType)
-            throws javax.xml.transform.TransformerException
-  {
-
-    if (m_whatToShow == NodeTest.SHOW_BYFUNCTION)
-    {
-      if (null != m_relativePathPattern)
-      {
-        return m_relativePathPattern.execute(xctxt);
-      }
-      else
-        return NodeTest.SCORE_NONE;
-    }
-
-    XObject score;
-
-    score = super.execute(xctxt, currentNode, dtm, expType);
-
-    if (score == NodeTest.SCORE_NONE)
-      return NodeTest.SCORE_NONE;
-
-    if (getPredicateCount() != 0)
-    {
-      if (!executePredicates(xctxt, dtm, currentNode))
-        return NodeTest.SCORE_NONE;
-    }
-
-    if (null != m_relativePathPattern)
-      return m_relativePathPattern.executeRelativePathPattern(xctxt, dtm,
-              currentNode);
-
-    return score;
-  }
-
-  /**
-   * New Method to check whether the current node satisfies a position predicate
-   *
-   * @param xctxt The XPath runtime context.
-   * @param predPos Which predicate we're evaluating of foo[1][2][3].
-   * @param dtm The DTM of the current node.
-   * @param context The currentNode.
-   * @param pos The position being requested, i.e. the value returned by 
-   *            m_predicates[predPos].execute(xctxt).
-   *
-   * @return true of the position of the context matches pos, false otherwise.
-   */
-  private final boolean checkProximityPosition(XPathContext xctxt,
-          int predPos, DTM dtm, int context, int pos)
-  {
-
-    try
-    {
-      DTMAxisTraverser traverser =
-        dtm.getAxisTraverser(Axis.PRECEDINGSIBLING);
-
-      for (int child = traverser.first(context); DTM.NULL != child;
-              child = traverser.next(context, child))
-      {
-        try
-        {
-          xctxt.pushCurrentNode(child);
-
-          if (NodeTest.SCORE_NONE != super.execute(xctxt, child))
-          {
-            boolean pass = true;
-
-            try
-            {
-              xctxt.pushSubContextList(this);
-
-              for (int i = 0; i < predPos; i++)
-              {
-                xctxt.pushPredicatePos(i);
-                try
-                {
-                  XObject pred = m_predicates[i].execute(xctxt);
-                  
-                  try
-                  {
-                    if (XObject.CLASS_NUMBER == pred.getType())
-                    {
-                      throw new Error("Why: Should never have been called");
-                    }
-                    else if (!pred.boolWithSideEffects())
-                    {
-                      pass = false;
-    
-                      break;
-                    }
-                  }
-                  finally
-                  {
-                    pred.detach();
-                  }
-                }
-                finally
-                {
-                  xctxt.popPredicatePos();
-                }
-              }
-            }
-            finally
-            {
-              xctxt.popSubContextList();
-            }
-
-            if (pass)
-              pos--;
-
-            if (pos < 1)
-              return false;
-          }
-        }
-        finally
-        {
-          xctxt.popCurrentNode();
-        }
-      }
-    }
-    catch (javax.xml.transform.TransformerException se)
-    {
-
-      // TODO: should keep throw sax exception...
-      throw new java.lang.RuntimeException(se.getMessage());
-    }
-
-    return (pos == 1);
-  }
-
-  /**
-   * Get the proximity position index of the current node based on this
-   * node test.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   * @param predPos Which predicate we're evaluating of foo[1][2][3].
-   * @param findLast If true, don't terminate when the context node is found.
-   *
-   * @return the proximity position index of the current node based on the
-   *         node test.
-   */
-  private final int getProximityPosition(XPathContext xctxt, int predPos, 
-                    boolean findLast)
-  {
-
-    int pos = 0;
-    int context = xctxt.getCurrentNode();
-    DTM dtm = xctxt.getDTM(context);
-    int parent = dtm.getParent(context);
-
-    try
-    {
-      DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.CHILD);
-
-      for (int child = traverser.first(parent); DTM.NULL != child;
-              child = traverser.next(parent, child))
-      {
-        try
-        {
-          xctxt.pushCurrentNode(child);
-
-          if (NodeTest.SCORE_NONE != super.execute(xctxt, child))
-          {
-            boolean pass = true;
-
-            try
-            {
-              xctxt.pushSubContextList(this);
-
-              for (int i = 0; i < predPos; i++)
-              {
-                xctxt.pushPredicatePos(i);
-                try
-                {
-                  XObject pred = m_predicates[i].execute(xctxt);
-  
-                  try
-                  {
-                    if (XObject.CLASS_NUMBER == pred.getType())
-                    {
-                      if ((pos + 1) != (int) pred.numWithSideEffects())
-                      {
-                        pass = false;
-    
-                        break;
-                      }
-                    }
-                    else if (!pred.boolWithSideEffects())
-                    {
-                      pass = false;
-    
-                      break;
-                    }
-                  }
-                  finally
-                  {
-                    pred.detach();
-                  }
-                }
-                finally
-                {
-                  xctxt.popPredicatePos();
-                }
-              }
-            }
-            finally
-            {
-              xctxt.popSubContextList();
-            }
-
-            if (pass)
-              pos++;
-
-            if (!findLast && child == context)
-            {
-              return pos;
-            }
-          }
-        }
-        finally
-        {
-          xctxt.popCurrentNode();
-        }
-      }
-    }
-    catch (javax.xml.transform.TransformerException se)
-    {
-
-      // TODO: should keep throw sax exception...
-      throw new java.lang.RuntimeException(se.getMessage());
-    }
-
-    return pos;
-  }
-
-  /**
-   * Get the proximity position index of the current node based on this
-   * node test.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the proximity position index of the current node based on the
-   *         node test.
-   */
-  public int getProximityPosition(XPathContext xctxt)
-  {
-    return getProximityPosition(xctxt, xctxt.getPredicatePos(), false);
-  }
-  
-  /**
-   * Get the count of the nodes that match the test, which is the proximity
-   * position of the last node that can pass this test in the sub context
-   * selection.  In XSLT 1-based indexing, this count is the index of the last
-   * node.
-   *
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return the count of the nodes that match the test.
-   */
-  public int getLastPos(XPathContext xctxt)
-  {
-    return getProximityPosition(xctxt, xctxt.getPredicatePos(), true);
-  }
-
-  /**
-   * Execute the match pattern step relative to another step.
-   *
-   *
-   * @param xctxt The XPath runtime context.
-   * @param dtm The DTM of the current node.
-   * @param currentNode The current node context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected final XObject executeRelativePathPattern(
-          XPathContext xctxt, DTM dtm, int currentNode)
-            throws javax.xml.transform.TransformerException
-  {
-
-    XObject score = NodeTest.SCORE_NONE;
-    int context = currentNode;
-    DTMAxisTraverser traverser;
-
-    traverser = dtm.getAxisTraverser(m_axis);
-
-    for (int relative = traverser.first(context); DTM.NULL != relative;
-            relative = traverser.next(context, relative))
-    {
-      try
-      {
-        xctxt.pushCurrentNode(relative);
-
-        score = execute(xctxt);
-
-        if (score != NodeTest.SCORE_NONE)
-          break;
-      }
-      finally
-      {
-        xctxt.popCurrentNode();
-      }
-    }
-
-    return score;
-  }
-
-  /**
-   * Execute the predicates on this step to determine if the current node 
-   * should be filtered or accepted.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param dtm The DTM of the current node.
-   * @param currentNode The current node context.
-   *
-   * @return true if the node should be accepted, false otherwise.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  protected final boolean executePredicates(
-          XPathContext xctxt, DTM dtm, int currentNode)
-            throws javax.xml.transform.TransformerException
-  {
-
-    boolean result = true;
-    boolean positionAlreadySeen = false;
-    int n = getPredicateCount();
-
-    try
-    {
-      xctxt.pushSubContextList(this);
-
-      for (int i = 0; i < n; i++)
-      {
-        xctxt.pushPredicatePos(i);
-
-        try
-        {
-          XObject pred = m_predicates[i].execute(xctxt);
-
-          try
-          {
-            if (XObject.CLASS_NUMBER == pred.getType())
-            {
-              int pos = (int) pred.num();
-  
-              if (positionAlreadySeen)
-              {
-                result = (pos == 1);
-  
-                break;
-              }
-              else
-              {
-                positionAlreadySeen = true;
-  
-                if (!checkProximityPosition(xctxt, i, dtm, currentNode, pos))
-                {
-                  result = false;
-  
-                  break;
-                }
-              }
-            
-            }
-            else if (!pred.boolWithSideEffects())
-            {
-              result = false;
-  
-              break;
-            }
-          }
-          finally
-          {
-            pred.detach();
-          }
-        }
-        finally
-        {
-          xctxt.popPredicatePos();
-        }
-      }
-    }
-    finally
-    {
-      xctxt.popSubContextList();
-    }
-
-    return result;
-  }
-
-  /**
-   * Get the string represenentation of this step for diagnostic purposes.
-   *
-   *
-   * @return A string representation of this step, built by reverse-engineering 
-   * the contained info.
-   */
-  public String toString()
-  {
-
-    StringBuffer buf = new StringBuffer();
-
-    for (StepPattern pat = this; pat != null; pat = pat.m_relativePathPattern)
-    {
-      if (pat != this)
-        buf.append("/");
-
-      buf.append(Axis.names[pat.m_axis]);
-      buf.append("::");
-
-      if (0x000005000 == pat.m_whatToShow)
-      {
-        buf.append("doc()");
-      }
-      else if (DTMFilter.SHOW_BYFUNCTION == pat.m_whatToShow)
-      {
-        buf.append("function()");
-      }
-      else if (DTMFilter.SHOW_ALL == pat.m_whatToShow)
-      {
-        buf.append("node()");
-      }
-      else if (DTMFilter.SHOW_TEXT == pat.m_whatToShow)
-      {
-        buf.append("text()");
-      }
-      else if (DTMFilter.SHOW_PROCESSING_INSTRUCTION == pat.m_whatToShow)
-      {
-        buf.append("processing-instruction(");
-
-        if (null != pat.m_name)
-        {
-          buf.append(pat.m_name);
-        }
-
-        buf.append(")");
-      }
-      else if (DTMFilter.SHOW_COMMENT == pat.m_whatToShow)
-      {
-        buf.append("comment()");
-      }
-      else if (null != pat.m_name)
-      {
-        if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
-        {
-          buf.append("@");
-        }
-
-        if (null != pat.m_namespace)
-        {
-          buf.append("{");
-          buf.append(pat.m_namespace);
-          buf.append("}");
-        }
-
-        buf.append(pat.m_name);
-      }
-      else if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
-      {
-        buf.append("@");
-      }
-      else if ((DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT)
-               == pat.m_whatToShow)
-      {
-        buf.append("doc-root()");
-      }
-      else
-      {
-        buf.append("?" + Integer.toHexString(pat.m_whatToShow));
-      }
-
-      if (null != pat.m_predicates)
-      {
-        for (int i = 0; i < pat.m_predicates.length; i++)
-        {
-          buf.append("[");
-          buf.append(pat.m_predicates[i]);
-          buf.append("]");
-        }
-      }
-    }
-
-    return buf.toString();
-  }
-
-  /** Set to true to send diagnostics about pattern matches to the consol. */
-  private static final boolean DEBUG_MATCHES = false;
-
-  /**
-   * Get the match score of the given node.
-   *
-   * @param xctxt The XPath runtime context.
-   * @param context The node to be tested.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public double getMatchScore(XPathContext xctxt, int context)
-          throws javax.xml.transform.TransformerException
-  {
-
-    xctxt.pushCurrentNode(context);
-    xctxt.pushCurrentExpressionNode(context);
-
-    try
-    {
-      XObject score = execute(xctxt);
-
-      return score.num();
-    }
-    finally
-    {
-      xctxt.popCurrentNode();
-      xctxt.popCurrentExpressionNode();
-    }
-
-    // return XPath.MATCH_SCORE_NONE;
-  }
-
-  /**
-   * Set the axis that this step should follow. 
-   *
-   *
-   * @param axis The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
-   */
-  public void setAxis(int axis)
-  {
-    m_axis = axis;
-  }
-
-  /**
-   * Get the axis that this step follows. 
-   *
-   *
-   * @return The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
-   */
-  public int getAxis()
-  {
-    return m_axis;
-  }
-
-}
diff --git a/src/org/apache/xpath/patterns/UnionPattern.java b/src/org/apache/xpath/patterns/UnionPattern.java
deleted file mode 100644
index 67323d2..0000000
--- a/src/org/apache/xpath/patterns/UnionPattern.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.patterns;
-
-import org.apache.xpath.Expression;
-import org.apache.xpath.XPathContext;
-import org.apache.xpath.objects.XObject;
-
-/**
- * <meta name="usage" content="advanced"/>
- * This class represents a union pattern, which can have multiple individual 
- * StepPattern patterns.
- */
-public class UnionPattern extends Expression
-{
-
-  /** Array of the contained step patterns to be tested.
-   *  @serial  */
-  private StepPattern[] m_patterns;
-  
-  /**
-   * No arguments to process, so this does nothing.
-   */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
-  {
-    for (int i = 0; i < m_patterns.length; i++) 
-    {
-      m_patterns[i].fixupVariables(vars, globalsSize);
-    }
-  }
-
-  
-  /**
-   * Tell if this expression or it's subexpressions can traverse outside 
-   * the current subtree.
-   * 
-   * @return true if traversal outside the context node's subtree can occur.
-   */
-   public boolean canTraverseOutsideSubtree()
-   {
-     if(null != m_patterns)
-     {
-      int n = m_patterns.length;
-      for (int i = 0; i < n; i++) 
-      {
-        if(m_patterns[i].canTraverseOutsideSubtree())
-          return true;
-      }
-     }
-     return false;
-   }
-
-  /**
-   * Set the contained step patterns to be tested. 
-   *
-   *
-   * @param patterns the contained step patterns to be tested. 
-   */
-  public void setPatterns(StepPattern[] patterns)
-  {
-    m_patterns = patterns;
-  }
-
-  /**
-   * Get the contained step patterns to be tested. 
-   *
-   *
-   * @return an array of the contained step patterns to be tested. 
-   */
-  public StepPattern[] getPatterns()
-  {
-    return m_patterns;
-  }
-
-  /**
-   * Test a node to see if it matches any of the patterns in the union.
-   *
-   * @param xctxt XPath runtime context.
-   *
-   * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD},
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or
-   *         {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}.
-   *
-   * @throws javax.xml.transform.TransformerException
-   */
-  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
-  {
-
-    XObject bestScore = null;
-    int n = m_patterns.length;
-
-    for (int i = 0; i < n; i++)
-    {
-      XObject score = m_patterns[i].execute(xctxt);
-
-      if (score != NodeTest.SCORE_NONE)
-      {
-        if (null == bestScore)
-          bestScore = score;
-        else if (score.num() > bestScore.num())
-          bestScore = score;
-      }
-    }
-
-    if (null == bestScore)
-    {
-      bestScore = NodeTest.SCORE_NONE;
-    }
-
-    return bestScore;
-  }
-}
diff --git a/src/org/apache/xpath/patterns/package.html b/src/org/apache/xpath/patterns/package.html
deleted file mode 100644
index aaed928..0000000
--- a/src/org/apache/xpath/patterns/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>XPath nodetest and XSLT pattern matching support.</title>
-  <body>
-    <p>Implementation of XPath nodeTest support, and XSLT pattern matching support.<p>
- </body>
-</html>
-
-
diff --git a/src/org/apache/xpath/res/XPATHErrorResourceBundle.java b/src/org/apache/xpath/res/XPATHErrorResourceBundle.java
deleted file mode 100644
index 9f15bb0..0000000
--- a/src/org/apache/xpath/res/XPATHErrorResourceBundle.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.res;
-
-import java.util.*;
-
-/**
- * <meta name="usage" content="internal"/>
- * The default (english) resource bundle.
- */
-public class XPATHErrorResourceBundle extends ListResourceBundle
-{
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /** The association list.         */
-  static final Object[][] contents =
-  {
-    { "ui_language", "en" }, { "help_language", "en" }, { "language", "en" },
-    { "ERROR0001", "0001" }, { "ERROR0002", "0002" }, { "ERROR0003", "0003" },
-    { "ERROR0004", "0004" }, { "ERROR0005", "0005" }, { "ERROR0006", "0006" },
-    { "ERROR0007", "0007" }, { "ERROR0008", "0008" }, { "ERROR0009", "0009" },
-    { "ERROR0010", "0010" }, { "ERROR0011", "0011" }, { "ERROR0012", "0012" },
-    { "ERROR0013", "0013" }, { "ERROR0014", "0014" }, { "ERROR0015", "0015" },
-    { "ERROR0016", "0016" }, { "ERROR0017", "0017" }, { "ERROR0018", "0018" },
-    { "ERROR0019", "0019" }, { "ERROR0020", "0020" }, { "ERROR0021", "0021" },
-    { "ERROR0022", "0022" }, { "ERROR0023", "0023" }, { "ERROR0024", "0024" },
-    { "ERROR0025", "0025" }, { "ERROR0026", "0026" }, { "ERROR0027", "0027" },
-    { "ERROR0028", "0028" }, { "ERROR0029", "0029" }, { "ERROR0030", "0030" },
-    { "ERROR0031", "0031" }, { "ERROR0032", "0032" }, { "ERROR0033", "0033" },
-    { "ERROR0034", "0034" }, { "ERROR0035", "0035" }, { "ERROR0036", "0036" },
-    { "ERROR0037", "0037" }, { "ERROR0038", "0038" }, { "ERROR0039", "0039" },
-    { "ERROR0040", "0040" }, { "ERROR0041", "0041" }, { "ERROR0042", "0042" },
-    { "ERROR0043", "0043" }, { "ERROR0044", "0044" }, { "ERROR0045", "0045" },
-    { "ERROR0046", "0046" }, { "ERROR0047", "0047" }, { "ERROR0048", "0048" },
-    { "ERROR0049", "0049" }, { "ERROR0050", "0050" }, { "ERROR0051", "0051" },
-    { "ERROR0052", "0052" }, { "ERROR0053", "0053" }, { "ERROR0054", "0054" },
-    { "ERROR0055", "0055" }, { "ERROR0056", "0056" }, { "ERROR0057", "0057" },
-    { "ERROR0058", "0058" }, { "ERROR0059", "0059" }, { "ERROR0060", "0060" },
-    { "WARNING0001", "0001" }, { "WARNING0002", "0002" },
-    { "WARNING0003", "0003" }, { "WARNING0004", "0004" },
-    { "WARNING0005", "0005" }, { "WARNING0006", "0006" },
-    { "WARNING0007", "0007" }, { "WARNING0008", "0008" },
-    { "WARNING0009", "0009" }, { "WARNING0010", "0010" },
-    { "WARNING0011", "0011" }
-  };
-}
diff --git a/src/org/apache/xpath/res/XPATHErrorResources.java b/src/org/apache/xpath/res/XPATHErrorResources.java
deleted file mode 100644
index 356b910..0000000
--- a/src/org/apache/xpath/res/XPATHErrorResources.java
+++ /dev/null
@@ -1,1231 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.res;
-
-import org.apache.xml.utils.res.XResourceBundleBase;
-
-
-import java.util.*;
-
-import java.text.DecimalFormat;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING). The array will be
- * automatically filled in with the keys, but you need to
- * fill in the actual message string. Follow the instructions
- * below.
- */
-public class XPATHErrorResources extends XResourceBundleBase
-{
-
-  /** Field ERROR_SUFFIX          */
-  public static final String ERROR_SUFFIX = "ER";
-
-  /** Field WARNING_SUFFIX          */
-  public static final String WARNING_SUFFIX = "WR";
-
-  /** Field MAX_CODE          */
-  public static final int MAX_CODE = 83;  // this is needed to keep track of the number of messages          
-
-  /** Field MAX_WARNING          */
-  public static final int MAX_WARNING = 11;  // this is needed to keep track of the number of warnings
-
-  /** Field MAX_OTHERS          */
-  public static final int MAX_OTHERS = 20;
-
-  /** Field MAX_MESSAGES          */
-  public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-  /** Field contents          */
-  static final Object[][] contents =
-    new Object[MAX_MESSAGES + MAX_OTHERS + 1][2];
-
-  /*
-  * Now fill in the message keys.
-  * This does not need to be updated. If MAX_CODE and MAX_WARNING
-  * are correct, the keys will get filled in automatically with
-  * the value ERxxxx (WRxxxx for warnings) where xxxx is a
-  * formatted number corresponding to the error code (i.e. ER0001).
-  */
-  static
-  {
-    for (int i = 0; i < MAX_CODE + 1; i++)
-    {
-      contents[i][0] = getMKey(i);
-    }
-
-    for (int i = 1; i < MAX_WARNING + 1; i++)
-    {
-      contents[i + MAX_CODE][0] = getWKey(i);
-    }
-  }
-
-  /*
-  * Now fill in the message text.
-  * First create an int for the message code. Make sure you
-  * update MAX_CODE for error messages and MAX_WARNING for warnings
-  * Then fill in the message text for that message code in the
-  * array. Use the new error code as the index into the array.
-  */
-
-  // Error messages...
-
-  /** Field ERROR0000          */
-  public static final int ERROR0000 = 0;
-
-  static
-  {
-    contents[ERROR0000][1] = "{0}";
-  }
-
-  /** Field ER_CURRENT_NOT_ALLOWED_IN_MATCH          */
-  public static final int ER_CURRENT_NOT_ALLOWED_IN_MATCH = 1;
-
-  static
-  {
-    contents[ER_CURRENT_NOT_ALLOWED_IN_MATCH][1] =
-      "The current() function is not allowed in a match pattern!";
-  }
-
-  /** Field ER_CURRENT_TAKES_NO_ARGS          */
-  public static final int ER_CURRENT_TAKES_NO_ARGS = 2;
-
-  static
-  {
-    contents[ER_CURRENT_TAKES_NO_ARGS][1] =
-      "The current() function does not accept arguments!";
-  }
-
-  /** Field ER_DOCUMENT_REPLACED          */
-  public static final int ER_DOCUMENT_REPLACED = 3;
-
-  static
-  {
-    contents[ER_DOCUMENT_REPLACED][1] =
-      "document() function implementation has been replaced by org.apache.xalan.xslt.FuncDocument!";
-  }
-
-  /** Field ER_CONTEXT_HAS_NO_OWNERDOC          */
-  public static final int ER_CONTEXT_HAS_NO_OWNERDOC = 4;
-
-  static
-  {
-    contents[ER_CONTEXT_HAS_NO_OWNERDOC][1] =
-      "context does not have an owner document!";
-  }
-
-  /** Field ER_LOCALNAME_HAS_TOO_MANY_ARGS          */
-  public static final int ER_LOCALNAME_HAS_TOO_MANY_ARGS = 5;
-
-  static
-  {
-    contents[ER_LOCALNAME_HAS_TOO_MANY_ARGS][1] =
-      "local-name() has too many arguments.";
-  }
-
-  /** Field ER_NAMESPACEURI_HAS_TOO_MANY_ARGS          */
-  public static final int ER_NAMESPACEURI_HAS_TOO_MANY_ARGS = 6;
-
-  static
-  {
-    contents[ER_NAMESPACEURI_HAS_TOO_MANY_ARGS][1] =
-      "namespace-uri() has too many arguments.";
-  }
-
-  /** Field ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS          */
-  public static final int ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS = 7;
-
-  static
-  {
-    contents[ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS][1] =
-      "normalize-space() has too many arguments.";
-  }
-
-  /** Field ER_NUMBER_HAS_TOO_MANY_ARGS          */
-  public static final int ER_NUMBER_HAS_TOO_MANY_ARGS = 8;
-
-  static
-  {
-    contents[ER_NUMBER_HAS_TOO_MANY_ARGS][1] =
-      "number() has too many arguments.";
-  }
-
-  /** Field ER_NAME_HAS_TOO_MANY_ARGS          */
-  public static final int ER_NAME_HAS_TOO_MANY_ARGS = 9;
-
-  static
-  {
-    contents[ER_NAME_HAS_TOO_MANY_ARGS][1] = "name() has too many arguments.";
-  }
-
-  /** Field ER_STRING_HAS_TOO_MANY_ARGS          */
-  public static final int ER_STRING_HAS_TOO_MANY_ARGS = 10;
-
-  static
-  {
-    contents[ER_STRING_HAS_TOO_MANY_ARGS][1] =
-      "string() has too many arguments.";
-  }
-
-  /** Field ER_STRINGLENGTH_HAS_TOO_MANY_ARGS          */
-  public static final int ER_STRINGLENGTH_HAS_TOO_MANY_ARGS = 11;
-
-  static
-  {
-    contents[ER_STRINGLENGTH_HAS_TOO_MANY_ARGS][1] =
-      "string-length() has too many arguments.";
-  }
-
-  /** Field ER_TRANSLATE_TAKES_3_ARGS          */
-  public static final int ER_TRANSLATE_TAKES_3_ARGS = 12;
-
-  static
-  {
-    contents[ER_TRANSLATE_TAKES_3_ARGS][1] =
-      "The translate() function takes three arguments!";
-  }
-
-  /** Field ER_UNPARSEDENTITYURI_TAKES_1_ARG          */
-  public static final int ER_UNPARSEDENTITYURI_TAKES_1_ARG = 13;
-
-  static
-  {
-    contents[ER_UNPARSEDENTITYURI_TAKES_1_ARG][1] =
-      "The unparsed-entity-uri function should take one argument!";
-  }
-
-  /** Field ER_NAMESPACEAXIS_NOT_IMPLEMENTED          */
-  public static final int ER_NAMESPACEAXIS_NOT_IMPLEMENTED = 14;
-
-  static
-  {
-    contents[ER_NAMESPACEAXIS_NOT_IMPLEMENTED][1] =
-      "namespace axis not implemented yet!";
-  }
-
-  /** Field ER_UNKNOWN_AXIS          */
-  public static final int ER_UNKNOWN_AXIS = 15;
-
-  static
-  {
-    contents[ER_UNKNOWN_AXIS][1] = "unknown axis: {0}";
-  }
-
-  /** Field ER_UNKNOWN_MATCH_OPERATION          */
-  public static final int ER_UNKNOWN_MATCH_OPERATION = 16;
-
-  static
-  {
-    contents[ER_UNKNOWN_MATCH_OPERATION][1] = "unknown match operation!";
-  }
-
-  /** Field ER_INCORRECT_ARG_LENGTH          */
-  public static final int ER_INCORRECT_ARG_LENGTH = 17;
-
-  static
-  {
-    contents[ER_INCORRECT_ARG_LENGTH][1] =
-      "Arg length of processing-instruction() node test is incorrect!";
-  }
-
-  /** Field ER_CANT_CONVERT_TO_NUMBER          */
-  public static final int ER_CANT_CONVERT_TO_NUMBER = 18;
-
-  static
-  {
-    contents[ER_CANT_CONVERT_TO_NUMBER][1] =
-      "Can not convert {0} to a number";
-  }
-
-  /** Field ER_CANT_CONVERT_TO_NODELIST          */
-  public static final int ER_CANT_CONVERT_TO_NODELIST = 19;
-
-  static
-  {
-    contents[ER_CANT_CONVERT_TO_NODELIST][1] =
-      "Can not convert {0} to a NodeList!";
-  }
-
-  /** Field ER_CANT_CONVERT_TO_MUTABLENODELIST          */
-  public static final int ER_CANT_CONVERT_TO_MUTABLENODELIST = 20;
-
-  static
-  {
-    contents[ER_CANT_CONVERT_TO_MUTABLENODELIST][1] =
-      "Can not convert {0} to a NodeSetDTM!";
-  }
-
-  /** Field ER_CANT_CONVERT_TO_TYPE          */
-  public static final int ER_CANT_CONVERT_TO_TYPE = 21;
-
-  static
-  {
-    contents[ER_CANT_CONVERT_TO_TYPE][1] =
-      "Can not convert {0} to a type#{1}";
-  }
-
-  /** Field ER_EXPECTED_MATCH_PATTERN          */
-  public static final int ER_EXPECTED_MATCH_PATTERN = 22;
-
-  static
-  {
-    contents[ER_EXPECTED_MATCH_PATTERN][1] =
-      "Expected match pattern in getMatchScore!";
-  }
-
-  /** Field ER_COULDNOT_GET_VAR_NAMED          */
-  public static final int ER_COULDNOT_GET_VAR_NAMED = 23;
-
-  static
-  {
-    contents[ER_COULDNOT_GET_VAR_NAMED][1] =
-      "Could not get variable named {0}";
-  }
-
-  /** Field ER_UNKNOWN_OPCODE          */
-  public static final int ER_UNKNOWN_OPCODE = 24;
-
-  static
-  {
-    contents[ER_UNKNOWN_OPCODE][1] = "ERROR! Unknown op code: {0}";
-  }
-
-  /** Field ER_EXTRA_ILLEGAL_TOKENS          */
-  public static final int ER_EXTRA_ILLEGAL_TOKENS = 25;
-
-  static
-  {
-    contents[ER_EXTRA_ILLEGAL_TOKENS][1] = "Extra illegal tokens: {0}";
-  }
-
-  /** Field ER_EXPECTED_DOUBLE_QUOTE          */
-  public static final int ER_EXPECTED_DOUBLE_QUOTE = 26;
-
-  static
-  {
-    contents[ER_EXPECTED_DOUBLE_QUOTE][1] =
-      "misquoted literal... expected double quote!";
-  }
-
-  /** Field ER_EXPECTED_SINGLE_QUOTE          */
-  public static final int ER_EXPECTED_SINGLE_QUOTE = 27;
-
-  static
-  {
-    contents[ER_EXPECTED_SINGLE_QUOTE][1] =
-      "misquoted literal... expected single quote!";
-  }
-
-  /** Field ER_EMPTY_EXPRESSION          */
-  public static final int ER_EMPTY_EXPRESSION = 28;
-
-  static
-  {
-    contents[ER_EMPTY_EXPRESSION][1] = "Empty expression!";
-  }
-
-  /** Field ER_EXPECTED_BUT_FOUND          */
-  public static final int ER_EXPECTED_BUT_FOUND = 29;
-
-  static
-  {
-    contents[ER_EXPECTED_BUT_FOUND][1] = "Expected {0}, but found: {1}";
-  }
-
-  /** Field ER_INCORRECT_PROGRAMMER_ASSERTION          */
-  public static final int ER_INCORRECT_PROGRAMMER_ASSERTION = 30;
-
-  static
-  {
-    contents[ER_INCORRECT_PROGRAMMER_ASSERTION][1] =
-      "Programmer assertion is incorrect! - {0}";
-  }
-
-  /** Field ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL          */
-  public static final int ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL = 31;
-
-  static
-  {
-    contents[ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL][1] =
-      "boolean(...) argument is no longer optional with 19990709 XPath draft.";
-  }
-
-  /** Field ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG          */
-  public static final int ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG = 32;
-
-  static
-  {
-    contents[ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG][1] =
-      "Found ',' but no preceding argument!";
-  }
-
-  /** Field ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG          */
-  public static final int ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG = 33;
-
-  static
-  {
-    contents[ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG][1] =
-      "Found ',' but no following argument!";
-  }
-
-  /** Field ER_PREDICATE_ILLEGAL_SYNTAX          */
-  public static final int ER_PREDICATE_ILLEGAL_SYNTAX = 34;
-
-  static
-  {
-    contents[ER_PREDICATE_ILLEGAL_SYNTAX][1] =
-      "'..[predicate]' or '.[predicate]' is illegal syntax.  Use 'self::node()[predicate]' instead.";
-  }
-
-  /** Field ER_ILLEGAL_AXIS_NAME          */
-  public static final int ER_ILLEGAL_AXIS_NAME = 35;
-
-  static
-  {
-    contents[ER_ILLEGAL_AXIS_NAME][1] = "illegal axis name: {0}";
-  }
-
-  /** Field ER_UNKNOWN_NODETYPE          */
-  public static final int ER_UNKNOWN_NODETYPE = 36;
-
-  static
-  {
-    contents[ER_UNKNOWN_NODETYPE][1] = "Unknown nodetype: {0}";
-  }
-
-  /** Field ER_PATTERN_LITERAL_NEEDS_BE_QUOTED          */
-  public static final int ER_PATTERN_LITERAL_NEEDS_BE_QUOTED = 37;
-
-  static
-  {
-    contents[ER_PATTERN_LITERAL_NEEDS_BE_QUOTED][1] =
-      "Pattern literal ({0}) needs to be quoted!";
-  }
-
-  /** Field ER_COULDNOT_BE_FORMATTED_TO_NUMBER          */
-  public static final int ER_COULDNOT_BE_FORMATTED_TO_NUMBER = 38;
-
-  static
-  {
-    contents[ER_COULDNOT_BE_FORMATTED_TO_NUMBER][1] =
-      "{0} could not be formatted to a number!";
-  }
-
-  /** Field ER_COULDNOT_CREATE_XMLPROCESSORLIAISON          */
-  public static final int ER_COULDNOT_CREATE_XMLPROCESSORLIAISON = 39;
-
-  static
-  {
-    contents[ER_COULDNOT_CREATE_XMLPROCESSORLIAISON][1] =
-      "Could not create XML TransformerFactory Liaison: {0}";
-  }
-
-  /** Field ER_DIDNOT_FIND_XPATH_SELECT_EXP          */
-  public static final int ER_DIDNOT_FIND_XPATH_SELECT_EXP = 40;
-
-  static
-  {
-    contents[ER_DIDNOT_FIND_XPATH_SELECT_EXP][1] =
-      "Error! Did not find xpath select expression (-select).";
-  }
-
-  /** Field ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH          */
-  public static final int ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH = 41;
-
-  static
-  {
-    contents[ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH][1] =
-      "ERROR! Could not find ENDOP after OP_LOCATIONPATH";
-  }
-
-  /** Field ER_ERROR_OCCURED          */
-  public static final int ER_ERROR_OCCURED = 42;
-
-  static
-  {
-    contents[ER_ERROR_OCCURED][1] = "Error occured!";
-  }
-
-  /** Field ER_ILLEGAL_VARIABLE_REFERENCE          */
-  public static final int ER_ILLEGAL_VARIABLE_REFERENCE = 43;
-
-  static
-  {
-    contents[ER_ILLEGAL_VARIABLE_REFERENCE][1] =
-      "VariableReference given for variable out of context or without definition!  Name = {0}";
-  }
-
-  /** Field ER_AXES_NOT_ALLOWED          */
-  public static final int ER_AXES_NOT_ALLOWED = 44;
-
-  static
-  {
-    contents[ER_AXES_NOT_ALLOWED][1] =
-      "Only child:: and attribute:: axes are allowed in match patterns!  Offending axes = {0}";
-  }
-
-  /** Field ER_KEY_HAS_TOO_MANY_ARGS          */
-  public static final int ER_KEY_HAS_TOO_MANY_ARGS = 45;
-
-  static
-  {
-    contents[ER_KEY_HAS_TOO_MANY_ARGS][1] =
-      "key() has an incorrect number of arguments.";
-  }
-
-  /** Field ER_COUNT_TAKES_1_ARG          */
-  public static final int ER_COUNT_TAKES_1_ARG = 46;
-
-  static
-  {
-    contents[ER_COUNT_TAKES_1_ARG][1] =
-      "The count function should take one argument!";
-  }
-
-  /** Field ER_COULDNOT_FIND_FUNCTION          */
-  public static final int ER_COULDNOT_FIND_FUNCTION = 47;
-
-  static
-  {
-    contents[ER_COULDNOT_FIND_FUNCTION][1] = "Could not find function: {0}";
-  }
-
-  /** Field ER_UNSUPPORTED_ENCODING          */
-  public static final int ER_UNSUPPORTED_ENCODING = 48;
-
-  static
-  {
-    contents[ER_UNSUPPORTED_ENCODING][1] = "Unsupported encoding: {0}";
-  }
-
-  /** Field ER_PROBLEM_IN_DTM_NEXTSIBLING          */
-  public static final int ER_PROBLEM_IN_DTM_NEXTSIBLING = 49;
-
-  static
-  {
-    contents[ER_PROBLEM_IN_DTM_NEXTSIBLING][1] =
-      "Problem occured in DTM in getNextSibling... trying to recover";
-  }
-
-  /** Field ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL          */
-  public static final int ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL = 50;
-
-  static
-  {
-    contents[ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL][1] =
-      "Programmer error: EmptyNodeList can not be written to.";
-  }
-
-  /** Field ER_SETDOMFACTORY_NOT_SUPPORTED          */
-  public static final int ER_SETDOMFACTORY_NOT_SUPPORTED = 51;
-
-  static
-  {
-    contents[ER_SETDOMFACTORY_NOT_SUPPORTED][1] =
-      "setDOMFactory is not supported by XPathContext!";
-  }
-
-  /** Field ER_PREFIX_MUST_RESOLVE          */
-  public static final int ER_PREFIX_MUST_RESOLVE = 52;
-
-  static
-  {
-    contents[ER_PREFIX_MUST_RESOLVE][1] =
-      "Prefix must resolve to a namespace: {0}";
-  }
-
-  /** Field ER_PARSE_NOT_SUPPORTED          */
-  public static final int ER_PARSE_NOT_SUPPORTED = 53;
-
-  static
-  {
-    contents[ER_PARSE_NOT_SUPPORTED][1] =
-      "parse (InputSource source) not supported in XPathContext! Can not open {0}";
-  }
-
-  /** Field ER_CREATEDOCUMENT_NOT_SUPPORTED          */
-  public static final int ER_CREATEDOCUMENT_NOT_SUPPORTED = 54;
-
-  static
-  {
-    contents[ER_CREATEDOCUMENT_NOT_SUPPORTED][1] =
-      "createDocument() not supported in XPathContext!";
-  }
-
-  /** Field ER_CHILD_HAS_NO_OWNER_DOCUMENT          */
-  public static final int ER_CHILD_HAS_NO_OWNER_DOCUMENT = 55;
-
-  static
-  {
-    contents[ER_CHILD_HAS_NO_OWNER_DOCUMENT][1] =
-      "Attribute child does not have an owner document!";
-  }
-
-  /** Field ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT          */
-  public static final int ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = 56;
-
-  static
-  {
-    contents[ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT][1] =
-      "Attribute child does not have an owner document element!";
-  }
-
-  /** Field ER_SAX_API_NOT_HANDLED          */
-  public static final int ER_SAX_API_NOT_HANDLED = 57;
-
-  static
-  {
-    contents[ER_SAX_API_NOT_HANDLED][1] =
-      "SAX API characters(char ch[]... not handled by the DTM!";
-  }
-
-  /** Field ER_IGNORABLE_WHITESPACE_NOT_HANDLED          */
-  public static final int ER_IGNORABLE_WHITESPACE_NOT_HANDLED = 58;
-
-  static
-  {
-    contents[ER_IGNORABLE_WHITESPACE_NOT_HANDLED][1] =
-      "ignorableWhitespace(char ch[]... not handled by the DTM!";
-  }
-
-  /** Field ER_DTM_CANNOT_HANDLE_NODES          */
-  public static final int ER_DTM_CANNOT_HANDLE_NODES = 59;
-
-  static
-  {
-    contents[ER_DTM_CANNOT_HANDLE_NODES][1] =
-      "DTMLiaison can not handle nodes of type {0}";
-  }
-
-  /** Field ER_XERCES_CANNOT_HANDLE_NODES          */
-  public static final int ER_XERCES_CANNOT_HANDLE_NODES = 60;
-
-  static
-  {
-    contents[ER_XERCES_CANNOT_HANDLE_NODES][1] =
-      "DOM2Helper can not handle nodes of type {0}";
-  }
-
-  /** Field ER_XERCES_PARSE_ERROR_DETAILS          */
-  public static final int ER_XERCES_PARSE_ERROR_DETAILS = 61;
-
-  static
-  {
-    contents[ER_XERCES_PARSE_ERROR_DETAILS][1] =
-      "DOM2Helper.parse error: SystemID - {0} line - {1}";
-  }
-
-  /** Field ER_XERCES_PARSE_ERROR          */
-  public static final int ER_XERCES_PARSE_ERROR = 62;
-
-  static
-  {
-    contents[ER_XERCES_PARSE_ERROR][1] = "DOM2Helper.parse error";
-  }
-
-  /** Field ER_CANT_OUTPUT_TEXT_BEFORE_DOC          */
-  public static final int ER_CANT_OUTPUT_TEXT_BEFORE_DOC = 63;
-
-  static
-  {
-    contents[ER_CANT_OUTPUT_TEXT_BEFORE_DOC][1] =
-      "Warning: can't output text before document element!  Ignoring...";
-  }
-
-  /** Field ER_CANT_HAVE_MORE_THAN_ONE_ROOT          */
-  public static final int ER_CANT_HAVE_MORE_THAN_ONE_ROOT = 64;
-
-  static
-  {
-    contents[ER_CANT_HAVE_MORE_THAN_ONE_ROOT][1] =
-      "Can't have more than one root on a DOM!";
-  }
-
-  /** Field ER_INVALID_UTF16_SURROGATE          */
-  public static final int ER_INVALID_UTF16_SURROGATE = 65;
-
-  static
-  {
-    contents[ER_INVALID_UTF16_SURROGATE][1] =
-      "Invalid UTF-16 surrogate detected: {0} ?";
-  }
-
-  /** Field ER_OIERROR          */
-  public static final int ER_OIERROR = 66;
-
-  static
-  {
-    contents[ER_OIERROR][1] = "IO error";
-  }
-
-  /** Field ER_CANNOT_CREATE_URL          */
-  public static final int ER_CANNOT_CREATE_URL = 67;
-
-  static
-  {
-    contents[ER_CANNOT_CREATE_URL][1] = "Cannot create url for: {0}";
-  }
-
-  /** Field ER_XPATH_READOBJECT          */
-  public static final int ER_XPATH_READOBJECT = 68;
-
-  static
-  {
-    contents[ER_XPATH_READOBJECT][1] = "In XPath.readObject: {0}";
-  }
-  
-  /** Field ER_XPATH_READOBJECT         */
-  public static final int ER_FUNCTION_TOKEN_NOT_FOUND = 69;
-
-  static
-  {
-    contents[ER_FUNCTION_TOKEN_NOT_FOUND][1] =
-      "function token not found.";
-  }
-  
-   /**  Argument 'localName' is null  */
-  public static final int ER_ARG_LOCALNAME_NULL = 70;
-
-  static
-  {
-    contents[ER_ARG_LOCALNAME_NULL][1] =
-       "Argument 'localName' is null";
-  }
-  
-   /**  Can not deal with XPath type:   */
-  public static final int ER_CANNOT_DEAL_XPATH_TYPE = 71;
-
-  static
-  {
-    contents[ER_CANNOT_DEAL_XPATH_TYPE][1] =
-       "Can not deal with XPath type: {0}";
-  }
-  
-   /**  This NodeSet is not mutable  */
-  public static final int ER_NODESET_NOT_MUTABLE = 72;
-
-  static
-  {
-    contents[ER_NODESET_NOT_MUTABLE][1] =
-       "This NodeSet is not mutable";
-  }
-  
-   /**  This NodeSetDTM is not mutable  */
-  public static final int ER_NODESETDTM_NOT_MUTABLE = 73;
-
-  static
-  {
-    contents[ER_NODESETDTM_NOT_MUTABLE][1] =
-       "This NodeSetDTM is not mutable";
-  }
-  
-   /**  Variable not resolvable:   */
-  public static final int ER_VAR_NOT_RESOLVABLE = 74;
-
-  static
-  {
-    contents[ER_VAR_NOT_RESOLVABLE][1] =
-        "Variable not resolvable: {0}";
-  }
-  
-   /** Null error handler  */
-  public static final int ER_NULL_ERROR_HANDLER = 75;
-
-  static
-  {
-    contents[ER_NULL_ERROR_HANDLER][1] =
-        "Null error handler";
-  }
-  
-   /**  Programmer's assertion: unknown opcode  */
-  public static final int ER_PROG_ASSERT_UNKNOWN_OPCODE = 76;
-
-  static
-  {
-    contents[ER_PROG_ASSERT_UNKNOWN_OPCODE][1] =
-       "Programmer's assertion: unknown opcode: {0}";
-  }
-  
-   /**  0 or 1   */
-  public static final int ER_ZERO_OR_ONE = 77;
-
-  static
-  {
-    contents[ER_ZERO_OR_ONE][1] =
-       "0 or 1";
-  }
-  
-   /**  2 or 3   */
-  public static final int ER_TWO_OR_THREE = 78;
-
-  static
-  {
-    contents[ER_TWO_OR_THREE][1] =
-       "0 or 1";
-  }
-  
-  
-  
-   /**  rtf() not supported by XRTreeFragSelectWrapper   */
-  public static final int ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 78;
-
-  static
-  {
-    contents[ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER][1] =
-       "rtf() not supported by XRTreeFragSelectWrapper";
-  }
-  
-   /**  asNodeIterator() not supported by XRTreeFragSelectWrapper   */
-  public static final int ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 79;
-
-  static
-  {
-    contents[ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER][1] =
-       "asNodeIterator() not supported by XRTreeFragSelectWrapper";
-  }
-  
-   /**  fsb() not supported for XStringForChars   */
-  public static final int ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS = 80;
-
-  static
-  {
-    contents[ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS][1] =
-       "fsb() not supported for XStringForChars";
-  }
-  
-   /**  Could not find variable with the name of   */
-  public static final int ER_COULD_NOT_FIND_VAR = 81;
-
-  static
-  {
-    contents[ER_COULD_NOT_FIND_VAR][1] =
-      "Could not find variable with the name of {0}";
-  }
-  
-   /**  XStringForChars can not take a string for an argument   */
-  public static final int ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING = 82;
-
-  static
-  {
-    contents[ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING][1] =
-      "XStringForChars can not take a string for an argument";
-  }
-  
-   /**  The FastStringBuffer argument can not be null   */
-  public static final int ER_FASTSTRINGBUFFER_CANNOT_BE_NULL = 83;
-
-  static
-  {
-    contents[ER_FASTSTRINGBUFFER_CANNOT_BE_NULL][1] =
-      "The FastStringBuffer argument can not be null";
-  }  
-  
-
-
-  // Warnings...
-
-  /** Field WG_LOCALE_NAME_NOT_HANDLED          */
-  public static final int WG_LOCALE_NAME_NOT_HANDLED = 1;
-
-  static
-  {
-    contents[WG_LOCALE_NAME_NOT_HANDLED + MAX_CODE][1] =
-      "locale name in the format-number function not yet handled!";
-  }
-
-  /** Field WG_PROPERTY_NOT_SUPPORTED          */
-  public static final int WG_PROPERTY_NOT_SUPPORTED = 2;
-
-  static
-  {
-    contents[WG_PROPERTY_NOT_SUPPORTED + MAX_CODE][1] =
-      "XSL Property not supported: {0}";
-  }
-
-  /** Field WG_DONT_DO_ANYTHING_WITH_NS          */
-  public static final int WG_DONT_DO_ANYTHING_WITH_NS = 3;
-
-  static
-  {
-    contents[WG_DONT_DO_ANYTHING_WITH_NS + MAX_CODE][1] =
-      "Do not currently do anything with namespace {0} in property: {1}";
-  }
-
-  /** Field WG_SECURITY_EXCEPTION          */
-  public static final int WG_SECURITY_EXCEPTION = 4;
-
-  static
-  {
-    contents[WG_SECURITY_EXCEPTION + MAX_CODE][1] =
-      "SecurityException when trying to access XSL system property: {0}";
-  }
-
-  /** Field WG_QUO_NO_LONGER_DEFINED          */
-  public static final int WG_QUO_NO_LONGER_DEFINED = 5;
-
-  static
-  {
-    contents[WG_QUO_NO_LONGER_DEFINED + MAX_CODE][1] =
-      "Old syntax: quo(...) is no longer defined in XPath.";
-  }
-
-  /** Field WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST          */
-  public static final int WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST = 6;
-
-  static
-  {
-    contents[WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST + MAX_CODE][1] =
-      "XPath needs a derived object to implement nodeTest!";
-  }
-
-  /** Field WG_FUNCTION_TOKEN_NOT_FOUND          */
-  public static final int WG_FUNCTION_TOKEN_NOT_FOUND = 7;
-
-  static
-  {
-    contents[WG_FUNCTION_TOKEN_NOT_FOUND + MAX_CODE][1] =
-      "function token not found.";
-  }
-
-  /** Field WG_COULDNOT_FIND_FUNCTION          */
-  public static final int WG_COULDNOT_FIND_FUNCTION = 8;
-
-  static
-  {
-    contents[WG_COULDNOT_FIND_FUNCTION + MAX_CODE][1] =
-      "Could not find function: {0}";
-  }
-
-  /** Field WG_CANNOT_MAKE_URL_FROM          */
-  public static final int WG_CANNOT_MAKE_URL_FROM = 9;
-
-  static
-  {
-    contents[WG_CANNOT_MAKE_URL_FROM + MAX_CODE][1] =
-      "Can not make URL from: {0}";
-  }
-
-  /** Field WG_EXPAND_ENTITIES_NOT_SUPPORTED          */
-  public static final int WG_EXPAND_ENTITIES_NOT_SUPPORTED = 10;
-
-  static
-  {
-    contents[WG_EXPAND_ENTITIES_NOT_SUPPORTED + MAX_CODE][1] =
-      "-E option not supported for DTM parser";
-  }
-
-  /** Field WG_ILLEGAL_VARIABLE_REFERENCE          */
-  public static final int WG_ILLEGAL_VARIABLE_REFERENCE = 11;
-
-  static
-  {
-    contents[WG_ILLEGAL_VARIABLE_REFERENCE + MAX_CODE][1] =
-      "VariableReference given for variable out of context or without definition!  Name = {0}";
-  }
-
-  /** Field WG_UNSUPPORTED_ENCODING          */
-  public static final int WG_UNSUPPORTED_ENCODING = 12;
-
-  static
-  {
-    contents[ER_UNSUPPORTED_ENCODING][1] = "Unsupported encoding: {0}";
-  }
-
-  // Other miscellaneous text used inside the code...
-  static
-  {
-    contents[MAX_MESSAGES][0] = "ui_language";
-    contents[MAX_MESSAGES][1] = "en";
-    contents[MAX_MESSAGES + 1][0] = "help_language";
-    contents[MAX_MESSAGES + 1][1] = "en";
-    contents[MAX_MESSAGES + 2][0] = "language";
-    contents[MAX_MESSAGES + 2][1] = "en";
-    contents[MAX_MESSAGES + 3][0] = "BAD_CODE";
-    contents[MAX_MESSAGES + 3][1] =
-      "Parameter to createMessage was out of bounds";
-    contents[MAX_MESSAGES + 4][0] = "FORMAT_FAILED";
-    contents[MAX_MESSAGES + 4][1] =
-      "Exception thrown during messageFormat call";
-    contents[MAX_MESSAGES + 5][0] = "version";
-    contents[MAX_MESSAGES + 5][1] = ">>>>>>> Xalan Version ";
-    contents[MAX_MESSAGES + 6][0] = "version2";
-    contents[MAX_MESSAGES + 6][1] = "<<<<<<<";
-    contents[MAX_MESSAGES + 7][0] = "yes";
-    contents[MAX_MESSAGES + 7][1] = "yes";
-    contents[MAX_MESSAGES + 8][0] = "line";
-    contents[MAX_MESSAGES + 8][1] = "Line #";
-    contents[MAX_MESSAGES + 9][0] = "column";
-    contents[MAX_MESSAGES + 9][1] = "Column #";
-    contents[MAX_MESSAGES + 10][0] = "xsldone";
-    contents[MAX_MESSAGES + 10][1] = "XSLProcessor: done";
-    contents[MAX_MESSAGES + 11][0] = "xpath_option";
-    contents[MAX_MESSAGES + 11][1] = "xpath options: ";
-    contents[MAX_MESSAGES + 12][0] = "optionIN";
-    contents[MAX_MESSAGES + 12][1] = "   [-in inputXMLURL]";
-    contents[MAX_MESSAGES + 13][0] = "optionSelect";
-    contents[MAX_MESSAGES + 13][1] = "   [-select xpath expression]";
-    contents[MAX_MESSAGES + 14][0] = "optionMatch";
-    contents[MAX_MESSAGES + 14][1] =
-      "   [-match match pattern (for match diagnostics)]";
-    contents[MAX_MESSAGES + 15][0] = "optionAnyExpr";
-    contents[MAX_MESSAGES + 15][1] =
-      "Or just an xpath expression will do a diagnostic dump";
-    contents[MAX_MESSAGES + 16][0] = "noParsermsg1";
-    contents[MAX_MESSAGES + 16][1] = "XSL Process was not successful.";
-    contents[MAX_MESSAGES + 17][0] = "noParsermsg2";
-    contents[MAX_MESSAGES + 17][1] = "** Could not find parser **";
-    contents[MAX_MESSAGES + 18][0] = "noParsermsg3";
-    contents[MAX_MESSAGES + 18][1] = "Please check your classpath.";
-    contents[MAX_MESSAGES + 19][0] = "noParsermsg4";
-    contents[MAX_MESSAGES + 19][1] =
-      "If you don't have IBM's XML Parser for Java, you can download it from";
-    contents[MAX_MESSAGES + 20][0] = "noParsermsg5";
-    contents[MAX_MESSAGES + 20][1] =
-      "IBM's AlphaWorks: http://www.alphaworks.ibm.com/formula/xml";
-  }
-
-  // ================= INFRASTRUCTURE ======================
-
-  /** Field BAD_CODE          */
-  public static final String BAD_CODE = "BAD_CODE";
-
-  /** Field FORMAT_FAILED          */
-  public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
-  /** Field ERROR_RESOURCES          */
-  public static final String ERROR_RESOURCES =
-    "org.apache.xpath.res.XPATHErrorResources";
-
-  /** Field ERROR_STRING          */
-  public static final String ERROR_STRING = "#error";
-
-  /** Field ERROR_HEADER          */
-  public static final String ERROR_HEADER = "Error: ";
-
-  /** Field WARNING_HEADER          */
-  public static final String WARNING_HEADER = "Warning: ";
-
-  /** Field XSL_HEADER          */
-  public static final String XSL_HEADER = "XSL ";
-
-  /** Field XML_HEADER          */
-  public static final String XML_HEADER = "XML ";
-
-  /** Field QUERY_HEADER          */
-  public static final String QUERY_HEADER = "PATTERN ";
-
-  /**
-   * Get the association list.
-   *
-   * @return The association list.
-   */
-  public Object[][] getContents()
-  {
-    return contents;
-  }
-
-  /**
-   * Return a named ResourceBundle for a particular locale.  This method mimics the behavior
-   * of ResourceBundle.getBundle().
-   *
-   * @param res the name of the resource to load.
-   * @param locale the locale to prefer when searching for the bundle
-   *
-   * @param className Name of local-specific subclass.
-   * @return the ResourceBundle
-   * @throws MissingResourceException
-   */
-  public static final XPATHErrorResources loadResourceBundle(String className)
-          throws MissingResourceException
-  {
-
-    Locale locale = Locale.getDefault();
-    String suffix = getResourceSuffix(locale);
-
-    try
-    {
-
-      // first try with the given locale
-      return (XPATHErrorResources) ResourceBundle.getBundle(className
-              + suffix, locale);
-    }
-    catch (MissingResourceException e)
-    {
-      try  // try to fall back to en_US if we can't load
-      {
-
-        // Since we can't find the localized property file,
-        // fall back to en_US.
-        return (XPATHErrorResources) ResourceBundle.getBundle(className,
-                new Locale("en", "US"));
-      }
-      catch (MissingResourceException e2)
-      {
-
-        // Now we are really in trouble.
-        // very bad, definitely very bad...not going to get very far
-        throw new MissingResourceException(
-          "Could not load any resource bundles.", className, "");
-      }
-    }
-  }
-
-  /**
-   * Return the resource file suffic for the indicated locale
-   * For most locales, this will be based the language code.  However
-   * for Chinese, we do distinguish between Taiwan and PRC
-   *
-   * @param locale the locale
-   * @return an String suffix which canbe appended to a resource name
-   */
-  private static final String getResourceSuffix(Locale locale)
-  {
-
-    String suffix = "_" + locale.getLanguage();
-    String country = locale.getCountry();
-
-    if (country.equals("TW"))
-      suffix += "_" + country;
-
-    return suffix;
-  }
-
-  /**
-   * Get the error string associated with the error code
-   *
-   * @param errorCode Error code
-   *
-   * @return error string associated with the given error code
-   */
-  public String getMessageKey(int errorCode)
-  {
-
-    if (errorCode > MAX_CODE)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return ERROR_SUFFIX + df.format(errorCode);
-    }
-  }
-
-  /**
-   * Get the warning string associated with the error code
-   *
-   * @param errorCode Error code
-   * 
-   * @return warning string associated with the given error code
-   */
-  public String getWarningKey(int errorCode)
-  {
-
-    if (errorCode > MAX_WARNING)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return WARNING_SUFFIX + df.format(errorCode);
-    }
-  }
-
-  /**
-   * Get the key string for an error based on the integer representation.
-   *
-   * @param errorCode Error code
-   * 
-   * @return key string that may be used for lookup in the association table.
-   */
-  public static String getMKey(int errorCode)
-  {
-
-    if (errorCode > MAX_CODE)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return ERROR_SUFFIX + df.format(errorCode);
-    }
-  }
-
-  /**
-   * Get the key string for an warning based on the integer representation.
-   *
-   * @param errorCode Error code
-   * 
-   * @return key string that may be used for lookup in the association table.
-   */
-  public static String getWKey(int errorCode)
-  {
-
-    if (errorCode > MAX_WARNING)
-      return null;
-    else
-    {
-      DecimalFormat df = new DecimalFormat("0000");
-
-      return WARNING_SUFFIX + df.format(errorCode);
-    }
-  }
-}
diff --git a/src/org/apache/xpath/res/XPATHErrorResources_en.java b/src/org/apache/xpath/res/XPATHErrorResources_en.java
deleted file mode 100644
index 3383077..0000000
--- a/src/org/apache/xpath/res/XPATHErrorResources_en.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.res;
-
-import java.util.*;
-
-/**
- * <meta name="usage" content="advanced"/>
- * Default implementation of XPATHErrorResources.  This is just
- * an empty class.
- */
-public class XPATHErrorResources_en extends XPATHErrorResources
-{
-}
diff --git a/src/org/apache/xpath/res/package.html b/src/org/apache/xpath/res/package.html
deleted file mode 100644
index c1b4732..0000000
--- a/src/org/apache/xpath/res/package.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <title>XPath resources.</title>
-  <body>
-    <p>Contains strings for XPath support that require internationalization.<p>
- </body>
-</html>
-
-
diff --git a/src/trax/trax.properties b/src/trax/trax.properties
deleted file mode 100644
index e593c39..0000000
--- a/src/trax/trax.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Revision$ $Date$
-#
-# Note: This properties file is provided for illustrative purposes
-#       only and is not part of the interface definition.
-#       This properties file is located in the implementation JAR
-#       and different implementations will specify different
-#       implementation classes and output methods.
-#
-
-# The TRaX Stylesheet processor
-trax.processor.xslt=org.apache.xalan.processor.StylesheetProcessor
diff --git a/src/xalanj2.jin b/src/xalanj2.jin
deleted file mode 100644
index 61b84b6..0000000
--- a/src/xalanj2.jin
+++ /dev/null
@@ -1,380 +0,0 @@
-###
-### Jindent 3.23 property file -- http://www.jindent.de
-###
-
-
-
-
-### General -- Convention
-
-conventionName                            = "xalanj2"
-conventionString                          = "'Formatted in $conventionName$ Style on' EEE, MMM d, ''yy"
-conventionNotePosition                    = "none"
-blankLinesToSeparateConventionNote        = 2
-
-
-### General -- Jindent Note
-
-jindentNotePosition                       = "none"
-blankLinesToSeparateJindentNote           = 2
-
-
-
-### Header/Footer -- Header Template
-
-headerSmartMode                           = infinite
-
-headerIdentifyKey                         = "The Apache Software License, Version 1.1"
-
-blankLinesBeforeHeader                    = 0
-header[00]                                = "/*"
-header[01]                                = " * The Apache Software License, Version 1.1"
-header[02]                                = " *"
-header[03]                                = " *"
-header[04]                                = " * Copyright (c) 1999 The Apache Software Foundation.  All rights "
-header[05]                                = " * reserved."
-header[06]                                = " *"
-header[07]                                = " * Redistribution and use in source and binary forms, with or without"
-header[08]                                = " * modification, are permitted provided that the following conditions"
-header[09]                                = " * are met:"
-header[10]                                = " *"
-header[11]                                = " * 1. Redistributions of source code must retain the above copyright"
-header[12]                                = " *    notice, this list of conditions and the following disclaimer. "
-header[13]                                = " *"
-header[14]                                = " * 2. Redistributions in binary form must reproduce the above copyright"
-header[15]                                = " *    notice, this list of conditions and the following disclaimer in"
-header[16]                                = " *    the documentation and/or other materials provided with the"
-header[17]                                = " *    distribution."
-header[18]                                = " *"
-header[19]                                = " * 3. The end-user documentation included with the redistribution,"
-header[20]                                = " *    if any, must include the following acknowledgment:  "
-header[21]                                = " *       "This product includes software developed by the"
-header[22]                                = " *        Apache Software Foundation (http://www.apache.org/).""
-header[23]                                = " *    Alternately, this acknowledgment may appear in the software itself,"
-header[24]                                = " *    if and wherever such third-party acknowledgments normally appear."
-header[25]                                = " *"
-header[26]                                = " * 4. The names "Xalan" and "Apache Software Foundation" must"
-header[27]                                = " *    not be used to endorse or promote products derived from this"
-header[28]                                = " *    software without prior written permission. For written "
-header[29]                                = " *    permission, please contact apache@apache.org."
-header[30]                                = " *"
-header[31]                                = " * 5. Products derived from this software may not be called "Apache","
-header[32]                                = " *    nor may "Apache" appear in their name, without prior written"
-header[33]                                = " *    permission of the Apache Software Foundation."
-header[34]                                = " *"
-header[35]                                = " * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED"
-header[36]                                = " * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES"
-header[37]                                = " * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
-header[38]                                = " * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR"
-header[39]                                = " * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,"
-header[40]                                = " * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT"
-header[41]                                = " * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF"
-header[42]                                = " * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"
-header[43]                                = " * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,"
-header[44]                                = " * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT"
-header[45]                                = " * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"
-header[46]                                = " * SUCH DAMAGE."
-header[47]                                = " * ===================================================================="
-header[48]                                = " *"
-header[49]                                = " * This software consists of voluntary contributions made by many"
-header[50]                                = " * individuals on behalf of the Apache Software Foundation and was"
-header[51]                                = " * originally based on software copyright (c) 1999, Lotus"
-header[52]                                = " * Development Corporation., http://www.lotus.com.  For more"
-header[53]                                = " * information on the Apache Software Foundation, please see"
-header[54]                                = " * <http://www.apache.org/>."
-header[55]                                = " */"
-blankLinesAfterHeader                     = 0
-
-
-### Header/Footer -- Footer Template
-
-footerSmartMode                           = infinite
-
-footerIdentifyKey                         = ""
-
-blankLinesBeforeFooter                    = 0
-footer[00]                                = ""
-blankLinesAfterFooter                     = 0
-
-
-
-### Indentation -- Misc
-
-tabulatorSize                             = 2
-indentSize                                = 2
-firstLevelIndent                          = 0
-indentCaseFromSwitch                      = false
-labelNewLine                              = true
-indentLabels                              = true
-
-minimumCommentIndent                      = 2
-
-indentLeadingsByTabs                      = false
-indentCommentsByTabs                      = false
-indentDeclarationsByTabs                  = false
-indentAssignmentsByTabs                   = false
-
-
-### Indentation -- Alignment
-
-alignComments                             = false
-alignDeclarations                         = false
-alignAssignments                          = false
-alignTernaryConditions                    = false
-alignTernaryExpressions                   = false
-alignTooLongComments                      = false
-
-
-
-### Braces -- Style
-
-leftBraceNewLineGeneral                   = true
-rightBraceNewLineGeneral                  = true
-indentLeftBraceGeneral                    = 0
-indentRightBraceGeneral                   = 0
-indentAfterRightBraceGeneral              = 0
-
-cuddleEmptyBracesGeneral                  = true
-indentCuddledBracesGeneral                = 0
-
-
-leftBraceNewLineClassInterface            = true
-rightBraceNewLineClassInterface           = true
-indentLeftBraceClassInterface             = 0
-indentRightBraceClassInterface            = 0
-indentAfterRightBraceClassInterface       = 0
-
-cuddleEmptyBracesClassInterface           = false
-indentCuddledBracesClassInterface         = 1
-
-
-leftBraceNewLineMethod                    = true
-rightBraceNewLineMethod                   = true
-indentLeftBraceMethod                     = 0
-indentRightBraceMethod                    = 0
-indentAfterRightBraceMethod               = 0
-
-cuddleEmptyBracesMethod                   = true
-indentCuddledBracesMethod                 = 0
-
-
-leftBraceNewLineTryCatch                  = true
-rightBraceNewLineTryCatch                 = true
-indentLeftBraceTryCatch                   = 0
-indentRightBraceTryCatch                  = 0
-indentAfterRightBraceTryCatch             = 0
-
-cuddleEmptyBracesTryCatch                 = true
-indentCuddledBracesTryCatch               = 0
-
-
-### Braces -- Insert At
-
-insertBracesAtIfElse                      = false
-insertBracesAtFor                         = true
-insertBracesAtWhile                       = true
-insertBracesAtDoWhile                     = true
-
-insertParenthesisAtConditions             = false
-
-
-### Braces -- If-Else
-
-singleIfStatementInOneLine                = false
-singleElseStatementInOneLine              = false
-specialElseIfTreatment                    = true
-
-
-
-### JavaDoc -- Misc
-
-deleteJavaDocComments                     = false
-formatJavaDocComments                     = true
-
-insertMissingJavaDocTags                  = true
-deleteObsoleteJavaDocTags                 = false
-
-createPublicClassInterfaceJavaDocs        = true
-createFriendlyClassInterfaceJavaDocs      = true
-createPrivateClassInterfaceJavaDocs       = true
-createProtectedClassInterfaceJavaDocs     = true
-
-createPublicMethodJavaDocs                = true
-createFriendlyMethodJavaDocs              = true
-createPrivateMethodJavaDocs               = true
-createProtectedMethodJavaDocs             = true
-
-createPublicFieldJavaDocs                 = true
-createFriendlyFieldJavaDocs               = true
-createPrivateFieldJavaDocs                = true
-createProtectedFieldJavaDocs              = true
-
-
-### JavaDoc -- Templates
-
-sortExceptionsInTemplates                 = true
-
-javaDocMethodTop[00]                      = "/**"
-javaDocMethodTop[01]                      = " * NEEDSDOC Method $objectName$ "
-javaDocMethodTop[02]                      = " *"
-javaDocMethodParamSeparator[00]           = " *"
-javaDocMethodParam[00]                    = " * NEEDSDOC @param $paramName$"
-javaDocMethodReturn[00]                   = " *"
-javaDocMethodReturn[01]                   = " * NEEDSDOC ($objectName$) @return"
-javaDocMethodExceptionSeparator[00]       = " *"
-javaDocMethodException[00]                = " * @throws $exceptionName$"
-javaDocMethodBottom[00]                   = " */"
-
-javaDocConstructorTop[00]                 = "/**"
-javaDocConstructorTop[01]                 = " * Constructor $objectName$"
-javaDocConstructorTop[02]                 = " *"
-javaDocConstructorParamSeparator[00]      = " *"
-javaDocConstructorParam[00]               = " * NEEDSDOC @param $paramName$"
-javaDocConstructorExceptionSeparator[00]  = " *"
-javaDocConstructorException[00]           = " * @throws $exceptionName$"
-javaDocConstructorBottom[00]              = " */"
-
-javaDocClass[00]                          = "/**"
-javaDocClass[01]                          = " * <meta name="usage" content="internal"/>"
-javaDocClass[02]                          = " * NEEDSDOC Class $objectName$ <needs-comment/>"
-javaDocClass[03]                          = " */"
-
-javaDocInterface[00]                      = "/**"
-javaDocInterface[01]                      = " * <meta name="usage" content="internal"/>"
-javaDocInterface[02]                      = " * NEEDSDOC Interface $objectName$"
-javaDocInterface[03]                      = " */"
-
-javaDocField[00]                          = "/** NEEDSDOC Field $objectName$          */"
-
-
-
-### Comments -- Format/Delete
-
-deleteBlockComments                       = false
-deleteSingleLineComments                  = false
-deleteTrailingComments                    = false
-deleteEndOfLineComments                   = false
-
-formatBlockComments                       = false
-formatSingleLineComments                  = false
-formatTrailingComments                    = false
-formatEndOfLineComments                   = false
-
-
-### Comments -- Exceptions
-
-neverIndentFirstColumnComments            = false
-neverFormatFirstColumnComments            = false
-
-neverFormatHeader                         = false
-neverFormatFooter                         = false
-
-
-
-### Separation -- Misc
-
-keepBlankLines                            = 0
-
-minLinesToInsertBlankLineInClasses        = 3
-minLinesToInsertBlankLineInMethods        = 3
-
-
-### Separation -- Separate
-
-separateChunksByComments                  = true
-allowBreakSeparatedFromCaseBlock          = false
-blankLinesBetweenCaseBlocks               = 0
-blankLinesBetweenChunks                   = 1
-
-comparableImportDepth                     = 2
-blankLinesToSeparateImports               = 1
-
-blankLinesBetweenClassInterface           = 0
-
-
-### Separation -- Insert Blank Lines
-
-blankLinesAfterDeclarations               = 1
-blankLinesAfterMethods                    = 1
-blankLinesAfterClasses                    = 0
-blankLinesAfterInterfaces                 = 0
-
-blankLinesBeforeJavaDocComments           = 1
-blankLinesAfterJavaDocComments            = 0
-
-blankLinesBeforeBlockComments             = 1
-blankLinesAfterBlockComments              = 0
-
-blankLinesBeforeSingleLineComments        = 1
-blankLinesAfterSingleLineComments         = 0
-
-blankLinesBeforeEndOfLineComments         = 1
-blankLinesAfterEndOfLineComments          = 0
-
-blankLinesAfterSwitch                     = 0
-blankLinesAfterPackage                    = 1
-blankLinesAfterLastImport                 = 1
-
-
-
-### Whitespaces -- Padding
-
-separateAssignmentOperators               = true
-separateConditionalOperators              = true
-separateComparisonOperators               = true
-separateNumericalOperators                = true
-
-paddingCastParenthesis                    = false
-paddingParenthesis                        = false
-paddingBrackets                           = false
-paddingBraces                             = true
-
-
-### Whitespaces -- Space Before
-
-spaceBeforeMethodDeclarationParenthesis   = false
-spaceBeforeMethodCallParenthesis          = false
-spaceBeforeBrackets                       = false
-spaceBeforeBracketsInTypes                = false
-spaceBeforeStatementParenthesis           = true
-spaceBeforeConditionBang                  = false
-spaceBeforeCaseColon                      = true
-
-
-### Whitespaces -- Space After
-
-spaceAfterComma                           = true
-spaceAfterSemicolon                       = true
-spaceAfterCasting                         = true
-
-
-### Whitespaces -- No Spaces
-
-noSpacesInEmptyForExpressions             = true
-
-
-
-### Line Wrapping -- Misc
-
-maxFieldElementsPerLine                   = infinite
-
-wrapLines                                 = true
-wrapBecauseOfComments                     = false
-wrapLongMethodNames                       = false
-maxLineLength                             = 78
-deepIndent                                = 45
-forceIndent                               = 8
-forceIndentTolerance                      = 4
-
-allowWrappingAfterAssignments             = true
-allowWrappingAfterParenthesis             = true
-preferWrappingAfterThrows                 = true
-
-
-alwaysWrapThrows                          = false
-alwaysWrapExtends                         = false
-alwaysWrapImplements                      = false
-
-indentWrappedThrows                       = 0
-indentWrappedExtends                      = 0
-indentWrappedImplements                   = 0
diff --git a/todo.xml b/todo.xml
deleted file mode 100644
index 91ecbba..0000000
--- a/todo.xml
+++ /dev/null
@@ -1,408 +0,0 @@
-<?xml version="1.0"?>
-
-<todo title="Things To Do" project="Xalan-Java" major-version="2">
-
- <devs>
-  <!-- in alphabetical order, by last name -->
-  <person name="Scott Boag" email="scott_boag@lotus.com" id="SB" expertise="code">
-    Xalan architect, lead developer on Xalan-J 2.x.
-  </person>
-  <person name="Shane Curcuru" email="Shane_Curcuru@lotus.com" id="SC" expertise="test">
-    Lead tester for API issues, automation framework.
-  </person>
-  <person name="Paul Dick" email="Paul_Dick@lotus.com" id="PD" expertise="test">
-    XSLT Conformance stylesheet issues and Xalan-C testing.
-  </person>
-  <person name="Joseph Kesselman" email="Joseph_Kesselman@lotus.com" id="JK" expertise="code">
-    Xalan-J 2.x developer, compiling/compiled stylesheets experiments.
-  </person>
-  <person name="Donald Leslie" email="donald_leslie@lotus.com" id="DL" expertise="doc">
-    Xalan-J and -C documentation, servlets, applets, and samples.
-  </person>
-  <person name="Costin Manolache" email="cmanolache@yahoo.com" id="CM">
-    Xalan-J 2.x developer.
-  </person>
-  <person name="David Marston" email="David_Marston@lotus.com" id="DM" expertise="test">
-    Lead tester for XSLT Conformance stylesheet issues.
-  </person>
-  <person name="Myriam Midy" email="myriam_midy@lotus.com" id="MM" expertise="code">
-    Xalan-J 1.x and 2.x developer.
-  </person>
-  <person name="Gary L Peskin" email="garyp@firstech.com" id="GP" expertise="code">
-    Xalan-J 1.x and 2.x developer, especially extension mechanisim.
-  </person>
-  <person name="John Gentilin" email="johng@apache.org" id="JG" expertise="code">
-    Major work on the SQL extensions library.
-   </person>
-   <person name="Costin Manolache" email="costin@apache.org" id="CM" expertise="code">
-     JAXP expert.
-   </person>
-
- </devs>
-
- <actions>
-
-   <target-release-description>
-    <date>01/19/01</date>
-    <level>production</level>
-    <goal type="conformance">XSLT 1.0 and XPath 1.0 compliant, 99% conformance test passage.</goal>
-    <goal type="performance">Reasonable, competative performance. [need metrics]</goal>
-    <goal type="stability">Robust.</goal>
-    <goal type="api">API Complete.</goal>
-    <goal type="documentation">Documentation complete.</goal>
-   </target-release-description>
-
-  <!-- Move to completed section when done. -->
-            
-   <action context="code" category="release">
-      No known actions pending for 2.0.0 release.
-   </action>
-  
- </actions>
-
- <actions priority="long-term" >
-  <!-- Move to completed section when done. -->
-
-   <target-release-description>
-    <date>4/15/01</date>
-    <level>beta</level>
-    <goal type="conformance">XSLT 1.1 and XPath 1.0+addendum compliant, 100% conformance test passage.</goal>
-    <goal type="performance">Very good performance. [need metrics]</goal>
-    <goal type="stability">Stable, reasonable.</goal>
-    <goal type="api">API Complete.</goal>
-    <goal type="documentation">Documentation functionally complete.</goal>
-   </target-release-description>
-   
-   <action context="code" category="conformance" who="GP">
-      Verify that the recomposing procedure for each of the recomposable
-      elements matches the standard (including errata).
-   </action>
-
-   <action context="code" category="conformance" who="GP">
-      Fix xsl:output method= so that it only accepts valid values per the
-      standard (xml, html, text, qname-that-is-not-an-ncname).  I'm looking
-      into where this change should be made.
-   </action>
-
-   <action context="code" category="conformance" who="GP">
-      Verify that the element-available function exhibits the proper
-      behavior according to Errata E7 regarding the interaction between the
-      default namespace and the element-available function.
-   </action>
-
-   <action context="code" category="extensions" who="GP">
-      Add compatibility with XalanJ1 NodeSet extension, so that stylehsheets 
-      can work with both processors.
-   </action>
-
-   <action context="code" category="bug" who="SB">
-    Handle qName paramterer to the ContentHandler methods being an empty string.
-    See note from mikael@ingen.reklam.staldal.nu (Mikael Ståldal), 01/01/2001 09:42 AM.
-   </action>
-
-   <action context="code" category="performance" who="SB">
-    Optimize "." patterns to be ultra simple iterator.
-   </action>
-
-   <action context="code" category="performance" who="SB">
-    Optimize "/foo/baz" patterns that have no variability, to a global space, 
-    and don't re-evaluate each time.
-   </action>
-
-  <action context="code" category="feature">
-    Don published a list of proposed extensions a while ago.
-    I would really like to get these implemented.  This is a good
-    area for part-time contributers, as the extensions have limited scope.
-  </action>
-
-  <action context="code" category="performance">
-    Joe could use help with the stylesheet compiler stuff.
-    Lots of work to be done there.  In particular, I would like to
-    figure out how to inline some simple itterator operations,
-    like select="node()" and select="foo".  Also, we need to figure
-    out how to analyze a particular stylesheet's dependencies, and
-    be able to package just those classes in a jar, along with the
-    compiled classes.
-    <issue id="issue-compiler-for-january-release">I suspect it is unlikely this
-    will be ready in time for this release.</issue>
-  </action>
-
-  <action context="test" category="feature" priority="high">
-    @todo need to find an HTML to DOM parser we can use!!
-    Get a good, apache-licensed HTML-to-DOM parser checked into the 
-    xml-xalan\test\java repository, for use by org.apache.qetest.xsl.XHTComparator
-  </action>
-
-  <action context="test" category="tests" priority="medium">
-    Get more real-world stylesheets checked into xml-xalan\test\tests\contrib.
-    We need more real-life examples of how people are using stylesheets, along 
-    with expected outputs (in contrib-gold) - we can then run our test driver 
-    over the whole set of them easily to get more test points.
-    Note: please feel free to contribute tests here - the committers 
-    will review and move tests into conformance, product, etc. test 
-    areas as needed, but we can always just run ContribTest on any tests.
-  </action>
-
-  <action context="test" category="tests" priority="high">
-    Get extension tests checked into xml-xalan\test\tests\extend
-    We have some at Lotus we need to cleanup and checkin, and we 
-    hope to get more examples from Gary and other list members.
-  </action>
-   
-   <action context="code" category="performance" who="SB">
-    Delete nodes in the source tree when possible.  (?? Note sure if this 
-    is do-able by beta2.)
-    <psuedo-code>
-      1) For each expression, tell if expression can traverse outside it's 
-         subtree.
-      2) For each element, tell if any following elements may need to  
-         access that node.
-      3) In instructions that traverse nodes, once the processing of the 
-         node is completed, remove the node if no following elements may 
-         need to access that node.
-      4) Keep the parse events from getting too far ahead of the transform.
-      
-      TODO: In StepPattern, Ancestors tests with predicates are problematic, 
-      and will require special treatment.
-    </psuedo-code>
-   </action>
-
-  <action context="code" category="feature">
-    XPointer built on the XPath package.
-  </action>
-
-  <action context="code" packages="xpath.axes" category="performance">
-    Schema-savy itterators.
-    This is hard because there is no standard API for schemas yet.
-  </action>
-
-  <action context="code" id="stylesheet-analysis" packages="processor" category="performance">
-    Stylesheet analysis module.  When I call a template, where is it likely to walk in the tree?
-    Can I be sure that it will not walk up again?
-  </action>
-
-  <action context="code" packages="stree" category="performance">
-    Related to stylesheet-analysis, the ability to throw away parts of the tree that have been processed,
-    and we know we won't reuse, based on the stylesheet analysis.
-  </action>
-
-  <action context="code" packages="processor" category="performance">
-    Sub-expression elimination.  When I call a series of
-    xsl:when tests, are there common subexpressions that can be
-    executed once and then shared?
-  </action>
-
-  <action context="code">
-  </action>
-
- </actions>
-
- <completed>
-  <!-- Move action sections to here when completed, and date them. -->
-  
-   <action context="doc" category="documentation" who="SB" completed="01/12/01">
-    Update and add to architecture documentation, including package headers.
-   </action>
-
-   <action context="code" category="error-handling" who="SB" completed="01/06/01">
-    Simplify some of the exception nesting, maybe, and make sure error listeners 
-    are being called for all cases.
-    <note>Fixed bug with XPaths in this area.  Most of the nesting is being caused 
-    by TranformerHandler to SAXException nesting, which can be unnested.</note>
-   </action>
-  
-   <action context="code" category="bug" who="SB" completed="01/06/01">
-    Fix 1.8 problems: extend01 (exception), numberformat 06, numberformat16, output77 (exception).
-    JDK 1.1.8, using xml-xalan\test\ConformanceTest.bat, runharness.bat, and testthreads.bat as-is.
-    <note>The number format stuff is a bug in JDK 1.8 and can't easily be fixed 
-    or hacked.</note>
-   </action>
-
-   <!-- action context="code" category="feature" who="SB" completed="01/04/01">
-    Integrate John Gentilin &lt;johnglinux@eyecatching.com> code, 
-    for SQL Extension Enhancements.
-   </action  (CHANGES BACKED OUT OF) -->
-
-   <action context="code" category="bug" who="SB" completed="01/04/01">
-    Implement xsl:strip-space for generic DOM processing.
-   </action>
-
-   <action context="code" category="performance" who="SB" completed="01/03/01">
-    For default transformer, do direct transform without stylesheet.
-   </action>
-   
-   <action context="code" category="documentation" who="SB" completed="01/01/01">
-    Fix some javadoc headers that still have old XalanJ1 text.  For instance, 
-    TransformerImpl.
-   </action>
-  
-   <action context="code" category="bugs" who="SB" completed="12/31/00">
-    Fix bug with Shane's s2s test hang.
-   </action>
-   
-   <action context="code" category="bugs" who="SB, JK" completed="12/31/00">
-    Fix bug with rare intermittent failures, probably in the STree.
-    <note>Verification testing on JK's machine needed.</note>
-   </action>
-
-   <action context="code" category="performance" who="SB" completed="12/26/00">
-    Optimize "/foo/baz" patterns to use simple child walkers.
-   </action>
-  
-  <action context="test" who="SC" category="minitest" priority="medium" completed="12/08/00">
-    Create Minitest automated test for developers to run before checkin; 
-    verifies basic functionality of TRAX interface and Xalan processor. 
-    (Still todo, minor: get xalan-dev list to vote to use this)
-  </action>
-
-  <action context="code" category="architecture" priority="high" who="SB" completed="12/10/00">
-    Fix remaining axes tests.
-  </action>
-
-  <action context="code" category="performance" priority="high" who="MM" completed="12/8/00">
-    When using STree for the input, use STree for the document() and
-    result tree fragments.
-  </action>
-
-  <action context="code" category="architecture, conformance" priority="high" who="SB" completed="12/06/00">
-    Restructure OutputFormat class to be based on properties.  Make sure 
-    include/import conformance is correct.
-  </action>
-  
-  <action context="code" category="architecture" priority="high" who="SB" completed="12/06/00">
-    Make entities in the html serializer to be resource file driven.
-  </action>
-  
-  <action context="code" category="architecture" priority="high" who="SB" completed="12/06/00">
-    Removed linefeed normalization from serializers.  I think.
-  </action>
-
-  <action context="code" completed-date="10/31/00">
-    Make this todo list.
-  </action>
-
-  <action context="code" who="SB"  category="trax" completed-date="11/06/00">
-    implement javax.trax interfaces.
-  </action>
-
-  <action context="code" packages="serialize" who="SB"  category="feature"
-          completed-date="11/17/00">
-    Implement DOMSerializer on SerializerToXML.
-  </action>
-
-  <action context="code" who="SB" packages="xpath.axes" category="performance"
-          priority="high" completed-date="11/17/00">
-    implement fast iterator for "foo" pattern.
-  </action>
-
-  <action context="code" who="MM" category="performance" priority="high" completed-date="11/29/00">
-    optimize xsl:key and key() stuff by building hash table of iterators for
-    each key.
-  </action>
-
-  <action context="code" category="code-cleanup" priority="medium" completed="12/01/00">
-    Clean up treatment of null namespaces, re "" vs. null.
-    <completed-comment>I consider this to be pretty good in most places.  "" 
-    equals the default namespace.  No pending plans for action, other than ongoing 
-    cleanup and javadoc as it occurs.</completed-comment>
-  </action>
-  
-  <action context="code"  category="conformance" priority="high" completed="12/10/00">
-    Implement namespace aliasing.
-  </action>
-
-  <action context="code" packages="templates" category="conformance" priority="medium"
-          note="done?" completed="11/29/00">
-    Catch multiple definitions of a variable with the same name and scope.
-  </action>
-  
-  <action context="code" category="code-cleanup" priority="medium" completed="11/25/00">
-    Move org.apache.xalan.utils package to org.apache.xml.utils.
-    remove resource dependencies on xalan and/or xpath package.
-  </action>
-  
-  <action context="code" category="code-cleanup, performance" packages="templates"
-   priority="medium" who="GP" completed="11/30/00">
-    Refactored the recompose logic to operate more cleanly and quickly. Fixed TemplateList
-    to properly order templates.
-  </action>
-  
-  <action context="code" category="code-cleanup" packages="extensions"
-   priority="medium" who="GP" completed="10/29/00">
-    Improved error reporting for java extension method errors.
-  </action>
-  
-  <action context="code" category="documentation" priority="medium" who="GP" completed="11/23/00">
-    Updated documentation for Extension Handling to conform to the new extension mechanism.
-  </action>
-  
-  <action context="code" category="feature" priority="medium" who="GP" completed="12/03/00">
-    Changed extension mechanism to load extensions using the thread's ContextClassLoader,
-    if available.
-  </action>
-  
-  <action context="code" category="feature" packages="extensions" 
-   priority="medium" who="GP" completed="11/28/00">
-    Implement tokenize extension.  Implement element-available and function-available for
-    built-in elements and functions.
-  </action>
-  
-  <action context="code" category="code-cleanup" packages="extensions" 
-   priority="medium" who="GP" completed="11/07/00">
-     Fix handling of xsl:fallback elements within extension elements that process their own
-     code (like redirect).
-  </action>
-  
-  <action context="code" category="code-cleanup" packages="compiler" 
-   priority="medium" who="GP" completed="11/09/00">
-     Cleaned up compiler handling of getWhatToShow() to result in cleaner code and provide
-     a more accurate filter.
-  </action>
-  
-  <action context="code" who="SB" packages="xpath.axes" category="performance" priority="high" completed="12/13/00">
-    implement fast iterator for "@foo" pattern.
-  </action>
-
-  <action context="code" who="SB" packages="xpath.axes" category="performance" priority="high" completed="12/14/00">
-    implement fast iterator for "//foo" pattern.
-  </action>
-  
-   <action context="code" category="code-cleanup" who="DL" packages="xalanservlet" priority="medium" completed="12/15/00">
-     Rewrite the sample servlet to use the TrAX interfaces and eliminate setting system properties
-     within the servlet.
-  </action>  
-
-  <action context="code" who="SB" packages="org.apache.xalan.serialize" category="samples" priority="high" completed="12/16/00">
-    Fix the serializer so it can serialize arbitrary XPath expression results (other than Document nodes).
-    As it currently stands, the ApplyXPath sample only works when you give it an expression that returns 
-    the entire Document.
-  </action>
-  
-  <action context="code" category="documentation" priority="high" completed="12/17/00">
-    Fill in all NEEDSDOC sections.
-  </action>
-
-  <action context="code" category="code-cleanup" who="DL" packages="xalan.client" priority="medium" completed="12/17/00">
-    Rewrite the client applet to use the TrAX interfaces, and move fetching of source
-    documents and stylesheets to the trusted worker thread to get around IE security restrictions.
-  </action>
-
-  <action context="code"  category="conformance" priority="high" completed="12/19/00">
-    Check relative URL resolution with notations and unparsed entities.
-    Not sure if there is a bug here.  See note from Thomal Maesing on
-    10/24/2000, titled "Antwort: Re:".
-  </action>
-
-  <action context="test" category="feature" priority="high" completed="12/19/00">
-    Update the xml-xalan\test\viewResults.xsl stylesheet to show 
-    differences between two result files from the same test (eg.
-    show differences from a results-before.xml run before a developer 
-    makes a change, with results-after.xml, which was after the 
-    developer's change.)
-    This could be a bunch of stuff added to viewResults.xsl or could 
-    be a separate stylesheet. See <b>SC</b> for details.
-  </action>
-
- </completed>
-
-</todo>
diff --git a/todo.xsl b/todo.xsl
deleted file mode 100644
index 6ff8cac..0000000
--- a/todo.xsl
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-<xsl:variable name="title" select="concat(todo/@project, ' ', todo/@major-version)"/>
-  <xsl:template match="/">
-    <HTML>
-      <HEAD>
-         <TITLE><xsl:value-of select="$title"/></TITLE>
-      </HEAD>
-      <BODY>
-
-        <H2><xsl:value-of select="concat($title, ': ', todo/@title)"/></H2>
-        <p><font size="-1">See a 
-          <xsl:element name="a">
-            <xsl:attribute name="href">#developer-list</xsl:attribute>
-            <xsl:text>list of developers/initials.</xsl:text>
-          </xsl:element>
-        </font></p>
-        <font size="-1"><p>Planned releases: 
-            <BR/><xsl:for-each select="todo/actions/target-release-description">
-              <xsl:element name="a">
-                <xsl:attribute name="href">#release-date-<xsl:value-of select="date"/></xsl:attribute>
-                <xsl:value-of select="date"/>
-              </xsl:element><xsl:text> </xsl:text><xsl:text> </xsl:text>
-            </xsl:for-each>
-            <xsl:element name="a">
-                <xsl:attribute name="href">#release-date-completed</xsl:attribute>
-                <xsl:text>Completed</xsl:text>
-              </xsl:element>
-
-        </p></font>
-        <xsl:for-each select="todo">
-          <xsl:for-each select="actions">
-              <xsl:for-each select="target-release-description">
-                <p>
-                  <xsl:apply-templates/>
-                </p>
-              </xsl:for-each>
-              <xsl:for-each select="action">
-                <xsl:if test="normalize-space(.)">
-                  <p>
-                   <xsl:number/>) <xsl:apply-templates/>
-                   <xsl:if test="@*">
-                    <BR/>
-                   </xsl:if>
-                   <xsl:apply-templates select="@*"/>
-                  </p>
-                </xsl:if>
-            </xsl:for-each>
-            <HR/>
-          </xsl:for-each>
-
-          <xsl:for-each select="completed">
-              <xsl:element name="a">
-                <xsl:attribute name="name">release-date-completed</xsl:attribute>
-                <H3>Completed: </H3>
-              </xsl:element>
-            <xsl:for-each select="action">
-              <xsl:if test="normalize-space(.)">
-                <p>
-                 <xsl:number/>) <xsl:apply-templates/>
-                 <xsl:if test="@*">
-                  <BR/>
-                 </xsl:if>
-                 <xsl:apply-templates select="@*"/>
-                </p>
-              </xsl:if>
-          </xsl:for-each>
-          <HR/>
-        </xsl:for-each>
-
-        <xsl:call-template name="developer-list"/>
-       </xsl:for-each>
-
-      </BODY>
-    </HTML>
-  </xsl:template>
-
-  <xsl:template match="action/@*">
-  <!-- Add link to the who attributes to corresponding item in developer-list -->
-    <b><xsl:value-of select="name(.)"/>:</b><xsl:text> </xsl:text>
-      <xsl:choose>
-        <xsl:when test="name(.)='who'">
-          <xsl:element name="a">
-            <xsl:attribute name="href">#personref-<xsl:value-of select="."/></xsl:attribute>
-            <xsl:value-of select="."/>
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."/>
-        </xsl:otherwise>
-      </xsl:choose>
-    <xsl:if test="not (position()=last())">
-      <xsl:text>, </xsl:text>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="target-release-description/date">
-      <xsl:element name="a">
-        <xsl:attribute name="name">release-date-<xsl:value-of select="."/></xsl:attribute>
-        <b><xsl:text>For release: </xsl:text><xsl:value-of select="."/></b>
-      </xsl:element>
-    
-  </xsl:template>
-
-  <xsl:template match="issue">
-    <BR/><b>Issue </b><xsl:text>[</xsl:text><xsl:value-of select="@id"/>
-    <xsl:text>]: </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="target-release-description/level">
-    <xsl:text>, </xsl:text><xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="target-release-description/goal">
-    <BR/><b>Goal </b><xsl:text>[</xsl:text><xsl:value-of select="@type"/>
-    <xsl:text>]: </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-
-
-  <xsl:template name="developer-list">
-    <H3>
-      <xsl:element name="a">
-        <xsl:attribute name="name">developer-list</xsl:attribute>
-        <xsl:text>Developers:</xsl:text>
-      </xsl:element>
-    </H3>
-    <p>A list of some of people currently working on working on <xsl:value-of select="/todo/@project"/>:</p>
-    <ul>
-    <xsl:for-each select="devs/person">
-      <li>
-        <a href="mailto:{@email}">
-          <xsl:value-of select="@name"/>
-        </a>
-         <xsl:element name="a">
-           <xsl:attribute name="name"><xsl:text>personref-</xsl:text><xsl:value-of select="@id"/></xsl:attribute>
-           <xsl:text> (</xsl:text><xsl:value-of select="@id"/><xsl:text>)</xsl:text>
-         </xsl:element>
-         <BR/><xsl:value-of select="."/>
-      </li>
-    </xsl:for-each>
-    </ul>
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/trax_bugs.xml b/trax_bugs.xml
deleted file mode 100644
index cb6f9c5..0000000
--- a/trax_bugs.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<?xm-well_formed path="E:\xml-xalan\java\bugs.dtd"?>
-<!-- This should contain *only* SPRs (Software Problem Reports) for the TrAX API 
-     interfaces and classes. -->
-<Sprs><Spr><Name>TRAXSPR0001</Name>
-<DateCreated>11/15/2000</DateCreated>
-<State>Open</State>
-<TestDesc>SAXTransformerFactoty#FEATURE should document support for all TransformerFactories.</TestDesc><Details><![CDATA[In SAXTransformerFactoty:
-
-    /** If {@link javax.xml.transform.TransformerFactory#getFeature}
-     * returns true when passed this value as an argument,
-     * the TransformerFactory returned from
-     * {@link javax.xml.transform.TransformerFactory#newInstance} may
-     * be safely cast to a SAXTransformerFactory.
-     */
-    public static final String FEATURE =
-
-I propose you remove the phrase "returned from
-TransforerFactory.newInstance". Isn't the intent that feature testing
-can be done on all TransformerFactories, regardless how they are
-created? It can be like this instead:
-
-    /** If {@link javax.xml.transform.TransformerFactory#getFeature}
-     * returns true when passed this value as an argument,
-     * the TransformerFactory can be safely cast to a
-     * SAXTransformerFactory.
-     */]]></Details></Spr><Spr><Name>TRAXSPR0002</Name>
-<DateCreated>11/15/2000</DateCreated>
-<State>Open</State>
-<TestDesc>OutputKeys#method should document qname instead of qname-but-not-ncname</TestDesc><Details><![CDATA[In OutputKeys:
-
-    /**
-     * method = "xml" | "html" | "text" | <var>qname-but-not-ncname</var>.
-     *
-     * <p>The method attribute identifies the overall method that
-     * should be used for outputting the result tree.  Other
-     * non-namespaced values may be used,
-
-This is contradictary, change "qname-but-not-ncname" to "qname".]]></Details></Spr>
-<Spr><Name>TRAXSPR0003</Name>
-<DateCreated>11/15/2000</DateCreated>
-<State>Open</State>
-<TestDesc></TestDesc><Details><![CDATA[]]></Details></Spr>
-<Spr><Name>TRAXSPR0004</Name>
-<DateCreated>11/15/2000</DateCreated>
-<State>Open</State>
-<TestDesc></TestDesc><Details><![CDATA[]]></Details></Spr>
-<Spr><Name>TRAXSPR0005</Name>
-<DateCreated>11/15/2000</DateCreated>
-<State>Open</State>
-<TestDesc></TestDesc><Details><![CDATA[]]></Details></Spr>
-
-</Sprs>
diff --git a/xdocs/sources/design/compilation.gif b/xdocs/sources/design/compilation.gif
deleted file mode 100644
index 675d7d4..0000000
--- a/xdocs/sources/design/compilation.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/conceptual.gif b/xdocs/sources/design/conceptual.gif
deleted file mode 100644
index 283fee5..0000000
--- a/xdocs/sources/design/conceptual.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/data.gif b/xdocs/sources/design/data.gif
deleted file mode 100644
index 0f28a17..0000000
--- a/xdocs/sources/design/data.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/design2_0_0.xml b/xdocs/sources/design/design2_0_0.xml
deleted file mode 100644
index 02dd509..0000000
--- a/xdocs/sources/design/design2_0_0.xml
+++ /dev/null
@@ -1,277 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<s1 title="Xalan-J 2.0 Design">
-  <p><img src="xmllogo.gif" alt="xmllogo.gif"/></p>
-  <p>Author: Scott Boag<br/>State: In Progress</p>
-  <ul> 
-	   <li><link anchor="intro">Introduction</link></li>
- 	   <li><link anchor="requirements">Xalan Requirements</link></li>
-	   <li><link anchor="overarch">Overview of Architecture</link></li>
-	   <li><link anchor="process">Process Module</link></li>
-	   <li><link anchor="templates">Templates Module</link></li>
-	   <li><link anchor="transformer">Transformer Module</link></li>
-       <ul>
-         <li><link anchor="stree">Stree Module</link></li>
-         <li><link anchor="extensions">Extensions Module</link></li>
-     </ul>
-	   <li><link anchor="xpath">XPath Module</link></li>
-       <ul><li><link anchor="xpathdbconn">XPath Database Connection</link></li></ul>
-	   <li><link anchor="utils">Utils Package</link></li>         
-	   <li><link anchor="other">Other Packages</link></li>         
-	   <li><link anchor="compilation">Xalan Stylesheet Complilation to Java</link></li><li><link anchor="optimizations">Future Optimizations</link></li><li><link anchor="coding">Coding Conventions</link></li>
-	        
-   <li><jump href="../apidocs/index.html">Xalan-J 2.0 Javadoc</jump></li>
-  </ul><anchor name="intro"/>
-  <s2 title="Introduction"> 
-	 <p>This document presents the basic design for Xalan-J 2.0, which is a
-		<jump href="http://www.awl.com/cseng/titles/0-201-89542-0/techniques/refactoring.htm">refactoring</jump>
-		and redesign of the Xalan-J 1.x processor.   This document will expand and grow over time, and is also incomplete in some sections, though hopefully overall accurate.  The reader should be able to get a good overall idea of the internal design of Xalan, and begin to understand the process flow, and also the technical challenges.</p> 
-	 <p>The main goals of this redesign are
-		to: </p><ol> 
-		<li>Make the design and code more understandable by Open Source
-		  people.</li> 
-		<li>Reduce code size and complexity.</li>
-		<li>By simplifying the code, make optimization easier.</li> 
-		<li>Make modules generally more localized, and less tangled with other
-		  modules.</li> 
-		<li>Conform to the <jump href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_063_jaxp11.html">javax.xml.transform  (TrAX [Transformations for XML])</jump> interfaces.</li> 
-	 <li>Increase the ability to incrementally produce the result tree.</li></ol> 
-	 <p>The techniques used toward these goals are to:</p> 
-	 <ol> 
-		<li>In general, flatten the hierarchy of packages, in order to make the
-		  structure more apparent from the top-level view.</li> 
-		<li>Break the construction and the validation of the XSLT stylesheet from
-		  the stylesheet objects themselves.</li>
-		<li>Drive the construction of the stylesheet through a table, so that it
-		  is less prone to error.</li> 
-		<li>Break the transformation process into a separate package, away from
-		  the stylesheet objects.</li> 
-		<li>Create this design document, as a starting point for people interested in
-		  approaching the code.</li> 
-	 </ol> 
-	 <p>The goals are not:</p> 
-	 <ol> 
-		<li>To add more features in the progress of this refactoring. This is
-		  design and code clean-up in order to meet the above-named goals. We expect that it will be <em>much</em> easier to add
-		  features once this work is completed.</li> 
-		<li>To optimize code for the sake of optimization. However, we
-		  expect that the code will be faster once this work is complete.</li> 
-	 </ol> 
-	 <p>How well we've achieved the goals will be measured by feedback from the
-		<jump href="http://archive.covalent.net/">Xalan-dev</jump> list, and by software metrics tools.</p> 
-	 <p>Please note that the diagrams in this design document are meant to be
-		useful abstractions, and may not always be exact.</p> 
-  </s2><anchor name="requirements"/> 
-  <s2 title="Xalan Requirements">
-  <p>These are the concrete general requirements of Xalan, as I understand them, and covering both the Java and C++ versions.  These requirements have been built up over time by experience with product groups and general users.</p><ol><li>Java, C++ Versions.</li><li>XSLT 1.0 conformance, and beyond. (i.e. conform to the current W3C recommendation).</li><li>Have design and Code understandable by Open Source Community.</li><li>Ability to interoperate with standard APIs.  (SAX2, DOM2, JAXP)  [this is currently Less of an issue with C++].</li><li>High Performance (Raw performance, Incremental ability, Scaleability to large documents, Reduction of Garbage Collection for the Java version.)</li><li>Tooling API (Access stylesheet data structures, Access source node from result event, Ask runtime questions, Debugging API).</li><li>Support addressing of XML in standalone fashion (i.e. XPath API).</li><li>Extensibility (Ability to call Java, Ability to call JavaScript, other languages).</li><li>Multiple data sources (JDBC, LDAP, other data sources, Direct XML repository coupling).</li></ol></s2><anchor name="overarch"/> 
-  <s2 title="Overview of Architecture"> 
-	 <p>The following diagram shows the XSLT abstract processing model.  A transformation expressed in XSLT describes rules for transforming a <jump href="http://www.w3.org/TR/xpath#data-model">Source Tree </jump> into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. In constructing the result tree, elements from the source tree can be filtered and reordered, and arbitrary structure can be added.
-
-</p><p>The term "tree", as used within this document, describes an
-			 abstract structure that consists of nodes or events that may be produced by
-			 XML. A Tree physically may be a DOM tree, a series of well balanced parse
-			 events (such as those coming from a SAX2 ContentHander), a series of requests
-			 (the result of which can describe a tree), or a stream of marked-up
-			 characters.</p><p><img src="xslt_abstract.gif" alt="xslt_abstract.gif"/></p><p>The primary interface for Xalan 2.0 external usage is defined in the <jump href="../apidocs/javax/xml/transform/package-summary.html#package_description">javax.xml.transform</jump> interfaces.  These interfaces define a standard and powerful interface to perform tree-based transformations.</p> 
-	 <p>The internal architecture of Xalan 2.0 is divided into four major modules, and various smaller
-		modules. The main modules are:</p> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/processor/package-summary.html">org.apache.xalan.processor</jump></label> 
-		<item>The module that processes the stylesheet, and provides the main
-		  entry point into Xalan.</item> 
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/templates/package-summary.html">org.apache.xalan.templates</jump></label> 
-		<item>The module that defines the stylesheet structures, including the
-		  Stylesheet object, template element instructions, and Attribute Value
-		  Templates. </item> 
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/transformer/package-summary.html">org.apache.xalan.transformer</jump></label> 
-		<item>The module that applies the source tree to the Templates, and
-		  produces a result tree.</item> 
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xpath/package-summary.html">org.apache.xpath</jump></label> 
-		<item>The module that processes both XPath expressions, and XSLT Match
-		  patterns.</item> 
-	 </gloss> 
-	 <p>In addition to the above modules, Xalan implements the
-		<jump href="../apidocs/javax/xml/transform/package-summary.html#package_description">javax.xml.transform</jump> interfaces, and depends on the
-	 <jump href="http://www.megginson.com/SAX/Java/index.html">SAX2</jump> and <jump href="http://www.w3.org/TR/DOM-Level-2/">DOM</jump> packages.
-</p><p><img src="trax.gif" alt="trax.gif"/></p><p>There is also a general utilities package that contains both XML utility
-	 classes such as QName, but generally useful classes such as
-	 StringToIntTable.</p> 
-	 <p>In the diagram below, the dashed lines denote visibility. All packages
-		access the SAX2 and DOM packages.</p> 
-	 <p><img src="xalan1_1x1.gif" alt="xalan1_1x1.gif"/></p> 
-	 <p>In addition to the above packages, there are the following additional
-		packages:</p> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/client/package-summary.html">org.apache.xalan.client</jump></label> 
-		<item>This package has a client applet. I suspect this should be moved
-		  into the samples directory.</item> 
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/extensions/package-summary.html">org.apache.xalan.extensions</jump></label> 
-		<item>This holds classes belonging to the Xalan extensions mechanism,
-		  which allows Java code and script to be called from within a stylesheet.</item>
-		
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/lib/package-summary.html">org.apache.xalan.lib</jump></label> 
-		<item>This is the built-in Xalan extensions library, which holds
-		  extensions such as Redirect (which allows a stylesheet to produce multiple
-		  output files).</item> 
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/res/package-summary.html">org.apache.xalan.res</jump></label> 
-		<item>This holds resource files needed by Xalan, such as error message
-		  resources.</item> 
-	 </gloss> 
-	  
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/trace/package-summary.html">org.apache.xalan.trace</jump></label> 
-		<item>This package contains classes and interfaces that allow a caller to
-		  add trace listeners to the transformation, allowing an interface to XSLT
-		  debuggers and similar tools.</item> 
-	 </gloss> 
-	 <gloss> 
-		<label><jump href="../apidocs/org/apache/xalan/xslt/package-summary.html">org.apache.xalan.xslt</jump></label> 
-		<item>This package holds the Xalan2 command line processor.</item> 
-	 </gloss> 
-  <p>A more conceptual view of this architecture is as follows:</p><p><img src="conceptual.gif" alt="Picture of conceptual architecture."/></p></s2><anchor name="process"/> 
-  <s2 title="Process Module"> 
-	 <p>The <jump href="../apidocs/org/apache/xalan/processor/package-summary.html">org.apache.xalan.processor</jump> module implements the
-		<jump href="../apidocs/javax/xml/transform/TransformerFactory.html">javax.xml.transform.TransformerFactory</jump> interface, which provides a
-		factory method for creating a concrete Processor instance, and provides methods
-		for creating a <jump href="../apidocs/javax/xml/transform/Templates.html">javax.xml.transform.Templates</jump> instance, which, in
-		Xalan and XSLT terms, is the Stylesheet. Thus the task of the process module is
-		to read the XSLT input in the form of a file, stream, SAX events, or a DOM
-		tree, and produce a Templates/Stylesheet object.</p> 
-	 <p>The overall strategy is to define a schema in that dictates the legal
-		structure for XSLT elements and attributes, and to associate with those
-		elements construction-time processors that can fill in the appropriate fields
-		in the top-level Stylesheet object, and also associate classes in the templates
-		module that can be created in a generalized fashion. This makes the validation
-		object-to-class associations centralized and declarative.</p> 
-	 <p>The schema's root class is
-		<jump href="../apidocs/org/apache/xalan/processor/XSLTSchema.html">org.apache.xalan.processor.XSLTSchema</jump>, and it is here that the
-		XSLT schema structure is defined. XSLTSchema uses
-		<jump href="../apidocs/org/apache/xalan/processor/XSLTElementDef.html">org.apache.xalan.processor.XSLTElementDef</jump> to define elements, and
-		<jump href="../apidocs/org/apache/xalan/processor/XSLTAttributeDef.html">org.apache.xalan.processor.XSLTAttributeDef</jump> to define attributes.
-		Both classes hold the allowed namespace, local name, and type of element or
-		attribute. The XSLTElementDef also holds a reference to a
-		<jump href="../apidocs/org/apache/xalan/processor/XSLTElementProcessor.html">org.apache.xalan.processor.XSLTElementProcessor</jump>, and a sometimes a
-		<code>Class</code> object, with which it can create objects that derive from
-		<jump href="../apidocs/org/apache/xalan/templates/ElemTemplateElement.html">org.apache.xalan.templates.ElemTemplateElement</jump>. In addition, the
-		XSLTElementDef instance holds a list of XSLTElementDef instances that define
-		legal elements or character events that are allowed as children of the given
-		element.</p> 
-	 <p>The implementation of the <jump href="../apidocs/javax/xml/transform/TransformerFactory.html">javax.xml.transform.TransformerFactory</jump>
-		interface is in <jump href="../apidocs/org/apache/xalan/processor/TransformerFactoryImpl.html">org.apache.xalan.processor.TransformerFactoryImpl</jump>,
-		which creates a <jump href="../apidocs/org/apache/xalan/processor/StylesheetHandler.html">org.apache.xalan.processor.StylesheetHandler</jump>
-		instance. This instance acts as the ContentHandler for the parse events, and is
-		handed to the <jump href="../apidocs/org/xml/sax/XMLReader.html">org.xml.sax.XMLReader</jump>, which the StylesheetProcessor
-		uses to parse the XSLT document. The <code>StylesheetHandler</code> then receives the parse
-		events, which maintains the state of the construction, and passes the events on
-		to the appropriate <code>XSLTElementProcessor</code> for the given event, as dictated by the
-		<code>XSLTElementDef</code> that is associated with the given event.</p> 
-	 </s2><anchor name="templates"/> 
-  <s2 title="Templates Module"> 
-	 <p>The <jump href="../apidocs/org/apache/xalan/templates/package-summary.html">org.apache.xalan.templates</jump> module implements the
-		<jump href="../apidocs/javax/xml/transform/Templates.html">javax.xml.transform.Templates</jump> interface, and defines a set of
-		classes that represent a Stylesheet. The primary purpose of this module is to
-		hold stylesheet data, not to perform procedural tasks associated with the
-		construction of the data, nor tasks associated with the transformation itself.
-		</p> 
-	 <p>The base class of all templates objects that are associated with an XSLT element is the <jump href="../apidocs/org/apache/xalan/templates/ElemTemplateElement.html">ElemTemplateElement</jump> object, which in turn implements <jump href="../apidocs/org/apache/xml/utils/UnImplNode.html">UnImplNode</jump>.  A <code>ElemTemplateElement</code> object must be immutable once it's constructed, so that it may be shared among multiple threads concurrently.  Ideally, a <code>ElemTemplateElement</code> should be a data object only, and be used via a visitor pattern.  However, in practice this is impractical, because it would cause too much data exposure and would have a significant impact on performance.  Therefore, each <code>ElemTemplateElement</code> class has an <jump href="../apidocs/org/apache/xalan/templates/ElemTemplateElement.html#execute(org.apache.xalan.transformer.TransformerImpl, org.w3c.dom.Node, org.apache.xml.utils.QName)">execute</jump> method where it performs it's transformation duties.  A <code>ElemTemplateElement</code> also knows it's position in the source stylesheet, and can answer questions about current namespace nodes.</p><p>A <jump href="../apidocs/org/apache/xalan/templates/StylesheetRoot.html">StylesheetRoot</jump>, which implements the
-		<code>Templates</code> interface, is a type of <jump href="../apidocs/org/apache/xalan/templates/StylesheetComposed.html">StylesheetComposed</jump>,
-		which is a <jump href="../apidocs/org/apache/xalan/templates/Stylesheet.html">Stylesheet</jump> composed of itself and all included
-		<code>Stylesheet</code> objects. A <code>StylesheetRoot</code> has a global
-		imports list, which is a list of all imported <code>StylesheetComposed</code>
-		instances. From each <code>StylesheetComposed</code> object, one can iterate
-		through the list of directly or indirectly included <code>Stylesheet</code>
-		objects, and one call also iterate through the list of all
-		<code>StylesheetComposed</code> objects of lesser import precedence.
-		<code>StylesheetRoot</code> is a <code>StylesheetComposed</code>, which is a
-		<code>Stylesheet</code>.</p> 
-	 <p>Each stylesheet has a set of properties, which can be set by various
-		means, usually either via an attribute on xsl:stylesheet, or via a top-level
-		xsl instruction (for instance, xsl:attribute-set). The get methods for these
-		properties only access the declaration within the given <code>Stylesheet</code>
-		object, and never takes into account included or imported stylesheets. The
-		<code>StylesheetComposed</code> derivative object, if it is a root
-		<code>Stylesheet</code> or imported <code>Stylesheet</code>, has "composed"
-		getter methods that do take into account imported and included stylesheets, for
-		some of these properties.</p> 
-	  
-  </s2><anchor name="transformer"/> 
-  <s2 title="Transformer Module"> 
-	 <p>The <jump href="../apidocs/org/apache/xalan/transformer/package-summary.html">Transformer</jump> module is in charge of run-time transformations.  The <jump href="../apidocs/org/apache/xalan/transformer/TransformerImpl.html">TransformerImpl</jump> object, which implements the TrAX <jump href="../apidocs/javax/xml/transform/Transformer.html">Transformer</jump> interface, and has an association with a <jump href="../apidocs/org/apache/xalan/templates/StylesheetRoot.html">StylesheetRoot</jump> object, begins the processing of the source tree (or provides a <jump href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html">ContentHandler</jump> reference via the <jump href="../apidocs/org/apache/xalan/stree/SourceTreeHandler.html">SourceTreeHandler</jump>), and performs the transformation.  The Transformer package does as much of the transformation as it can, but element level operations are generally performed in the <jump href="../apidocs/org/apache/xalan/templates/ElemTemplateElement.html#execute(org.apache.xalan.transformer.TransformerImpl, org.w3c.dom.Node, org.apache.xalan.utils.QName)">ElemTemplateElement.execute(...)</jump> methods.</p><p>Result Tree events are fed into a <jump href="../apidocs/org/apache/xalan/transformer/ResultTreeHandler.html">ResultTreeHandler</jump> object, which acts as a layer between the direct calls to the result 
-tree content handler (often a <jump href="../apidocs/org/apache/xalan/serialize/package-summary.html">Serializer</jump>), and the <code>Transformer</code>.  For one thing, 
- we have to delay the call to
- startElement(name, atts) because of the
- xsl:attribute and xsl:copy calls.  In other words,
- the attributes have to be fully collected before you
- can call startElement.</p><p>Other important classes in this package are:</p><gloss><label>CountersTable and Counter</label><item>The <jump href="../apidocs/org/apache/xalan/transformer/Counter.html">Counter</jump> class does incremental counting for support of xsl:number.
- This class stores a cache of counted nodes (m_countNodes). 
-  It tries to cache the counted nodes in document order... 
- the node count is based on its position in the cache list.  The <jump href="../apidocs/org/apache/xalan/transformer/CountersTable.html">CountersTable</jump> class is a table of counters, keyed by <jump href="../apidocs/org/apache/xalan/templates/ElemNumber.html">ElemNumber</jump> objects, each 
- of which has a list of <code>Counter</code> objects.</item></gloss><gloss><label>KeyIterator, KeyManager, and KeyTable</label><item>These classes handle mapping of keys declared with the xsl:key element.  They attempt to work incrementally, locating nodes on request but indexing all as they traverse the tree, and stopping when the requested node is found.  If a requested node is not found, then the entire tree will be traversed.  Such is the nature of xsl:key.</item></gloss><gloss><label>TransformState</label><item>This interface is meant to be used by a consumer of SAX2 events produced by Xalan, and enables the consumer 
- to get information about the state of the transform.  It 
- is primarily intended as a tooling interface.</item></gloss><p>Even though the following modules are defined in the <code>org.apache.xalan</code> package, instead of the transformer package, they are defined in this section as they are mostly related to runtime transformation.</p><anchor name="stree"/>
-  <s3 title="Stree Module [and discussions about streaming]">
-  <p>The Stree module implements the default <jump href="http://www.w3.org/TR/xpath#data-model">Source Tree </jump> for Xalan, that is to be transformed.  It implements read-only <jump href="http://www.w3.org/TR/DOM-Level-2/">DOM2</jump> interfaces, and provides some information needed for fast transforms, such as document order indexes.  It also attempts to allow an incremental transform by launching the transform on a secondary thread as soon as the SAX2 <jump href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html#startDocument()">StartDocument</jump> event has occurred.  When the transform requests a node, and the node is not present, the getFirstChild and GetNextSibling methods will wait until the child node has arrived, or an <jump href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String)">endElement</jump> event has occurred.</p><p>Note that the secondary thread is an issue.  It would be better to do the same thing as described above on a single thread, but using the parser in 'pull' mode, or simply with a parseNext method so the parse would occur in blocks.  However, this model would only be possible</p><p>This kind of incrementality is not perfect because it still requires an entire source tree to be concretely built.  There have been a lot of good discussions on the xalan-dev list about how to do static analysis of a stylesheet, and be able to allocate only the nodes needed by the transform, while they are needed (or not allocate source objects at all).</p></s3>
-<anchor name="serializer"/>
-<s3 title="Serializer Module">
-<p>XML serialization is a term used for turning a tree or set of events into a stream, and should not be confused with Java object serialization.  The Xalan serializers implement the <jump href="http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/ContentHandler.html">ContentHandler</jump> to turn parser events coming from the transform, into a stream of XML, HTML, or plain text.  The serializers also implement the <jump href="../apidocs/org/apache/xalan/serializer/Serializer.html">Serializer</jump> which allows the transform process to set XSLT output properties and the output stream or Writer.</p></s3><anchor name="extensions"/>
-<s3 title="Extensions Module">
-<p>This package contains an implementation of Xalan Extension Mechanism, which uses the <jump href="http://oss.software.ibm.com/developerworks/opensource/bsf/">Bean Scripting Framework</jump>.
-
-The Bean Scripting Framework (BSF) is an architecture for incorporating scripting into Java applications and applets.  Scripting languages such as Netscape Rhino (Javascript), VBScript, Perl, Tcl, Python, NetRexx and Rexx can be used to augment XSLT's functionality.  In addition, the Xalan extension mechanism allows use of Java classes.  See the <jump href="http://xml.apache.org/xalan/extensions.html">Xalan-J 2 extension documentation</jump> for a description of using extensions in a stylesheet. Please note that the W3C XSL Working Group is working on a specification for standard extension bindings, and this module will change to follow that specification.  </p><p>[More needed... -sb]</p></s3></s2><anchor name="xpath"/> 
-  <s2 title="XPath Module"> 
-	 <p>This module is pulled out of the Xalan package, and put in the org.apache package, to emphasize that the intention is that this package can be used independently of the XSLT engine, even though it has dependencies on the Xalan utils module.</p><p><img src="org_apache.gif" alt="xalan ---> xpath"/></p> 
-  <p>The XPath module first compiles the XPath strings into expression trees, and then executes these expressions via a call to the XPath execute(...) function.  </p>  <p>Major classes are:</p><gloss><label>XPath</label><item>Represents a compiled XPath.  Major function is <code>XObject execute(XPathContext xctxt, Node contextNode, 
-                         PrefixResolver namespaceContext)</code>.</item></gloss><gloss><label>XPathAPI</label><item>The methods in this class are convenience methods into the
- low-level XPath API.</item></gloss><gloss><label>XPathContext</label><item>Used as the runtime execution context for XPath.</item></gloss><gloss><label>DOMHelper</label><item>Used as a helper for handling DOM issues.  May be subclassed to take advantage 
-   of specific DOM implementations.</item></gloss><gloss><label>SourceTreeManager</label><item>bottlenecks all management of source trees.  The methods
- in this class should allow easy garbage collection of source 
- trees, and should centralize parsing for those source trees.</item></gloss><gloss><label>Expression</label><item>The base-class of all expression objects, allowing polymorphic behaviors.</item></gloss><p>The general architecture of the XPath module is divided into the compiler, and categories of expression objects.</p><p><img src="xpath.gif" alt="xpath modules"/></p><p>The most important module is the axes module.  This module implements the DOM2 <jump href="http://www.w3.org/TR/DOM-Level-2/traversal.html#Iterator-overview">NodeIterator</jump> interface, and is meant to allow XPath clients to either override the default behavior or to replace this behavior.</p><p>The <jump href="../apidocs/org/apache/xpath/axes/LocPathIterator.html">LocPathIterator</jump> and <jump href="../apidocs/org/apache/xpath/axes/UnionPathIterator.html">UnionPathIterator</jump> classes implement the <jump href="http://www.w3.org/TR/DOM-Level-2/java-binding.html#org.w3c.dom.traversal.NodeIterator">NodeIterator</jump> interface, and polymorphically use <jump href="../apidocs/org/apache/xpath/axes/AxesWalker.html">AxesWalker</jump> derived objects to execute each step in the path.  The whole trick is to execute the <code>LocationPath</code> in depth-first document order so that nodes can be found without necessarily looking ahead or performing a breadth-first search.  Because a document order depth-first search requires state to be saved for many expressions, the default operations create "Waiter" clones that have to wait while the main <code>AxesWalkers</code> traverses child nodes (think carefully about what happens when a "//foo/baz" expression is executed).   Optimization is done by implementing specialized iterators and <code>AxesWalkers</code> for certain types of operations.  The decision as to what type of iterator or walker will be created is done in the <jump href="../apidocs/org/apache/xpath/axes/WalkerFactory.html">WalkerFactory</jump> class.</p><p>[Frankly, the implementation of the default AxesWalker, with it's waiters, is the one totally incomprehensible part of Xalan.  It gets especially difficult because you can not look to the node ahead.  I would be very interested if any rocket scientists out there can come up with a better algorithm.]</p><anchor name="xpathdbconn"/>
-<s3 title="XPath Database Connection">
-<p>An important part of the XPath design in both Xalan 1 and Xalan 2, is to enable database connections to be used as drivers directly to the XPath <jump href="http://www.w3.org/TR/xpath#location-paths">LocationPath</jump> handling.  This allows databases to be directly connected to the transform, and be able to take advantage of internal indexing and the like.  While in Xalan 1 this was done via the <jump href="http://xml.apache.org/xalan/apidocs/org/apache/xalan/xpath/XLocator.html">XLocator</jump> interface, in Xalan 2 this interface is no longer used, and has been replaced by the DOM2 <jump href="http://www.w3.org/TR/DOM-Level-2/traversal.html#Iterator-overview">NodeIterator</jump> interface.  An application or extension should be able to install their own NodeIterator for a given document.</p><p><img src="data.gif" alt="data.gif"/></p><p>[More to do]</p></s3></s2><anchor name="utils"/> 
-  <s2 title="Utils Package"> 
-  <p>This package contains general utilities for use by both the xalan and xpath packages.</p></s2><anchor name="other"/>
-  <s2 title="Other Packages"> 
-	 <gloss><label>client</label><item>Implementation of Xalan Applet [should we keep this?].
-
-</item></gloss> 
-		 
-		 
-		<gloss><label>lib</label><item>Implementation of Xalan-specific extensions.</item></gloss><gloss><label>res</label><item>Contains strings that require internationalization.</item></gloss></s2><anchor name="compilation"/>
-<s2 title="Xalan Stylesheet Complilation to Java">
-<p>We are doing some work on compiling stylesheet objects to Java.  This is a work in progress, and is not meant for general use yet.  For the moment, we are writing out Java text files, and then compiling them to bytecodes via javac, rather than directly producing bytecodes.  The CompilingStylesheetProcessor derives from TransformerFactoryImpl to produce these classes, which are then bundled into a jar file.  For the moment the full Xalan jar is required, but we're looking at ways to only use a subset of Xalan, so that only a minimal jar would be required.</p><p><img src="compilation.gif" alt="compilation.gif"/></p></s2><anchor name="optimizations"/>
-<s2 title="Future Optimizations">
-<p>This section enumerates some optimizations that we're planning to do in future versions of Xalan.</p><p>Likely near term optimizations (next six months?):</p><ol><li>By pre-analysis of the stylesheet, prune nodes from the tree that have been processed and can be predicted that they won't be visited again.</li><li>Eliminate redundent expressions (xsl:when, variable sets, rooted patterns, etc.).</li><li>Optimize variable patterns such as &lt;xsl:variable name="foo"&gt;&lt;xsl:variable select="yada"/&gt;&lt;/xsl:variable&gt; into &lt;xsl:variable name="foo" select="string(yada)"/&gt;, in order to reduce result tree fragment creation.</li><li>Reduce size of Stree nodes.</li><li>Implement our own NamespaceSupport class (the SAX2 one is too expensive).</li><li>More specialization of itterators and walkers.</li><li>Full Java compilation support.</li><li>Schema Awareness (if "//foo", the Schema can tell us where to look, but we need standard interface to Schemas).</li></ol><p>Likely longer term optimizations (12-18 months?):</p><ol><li>On-the-fly indexing.</li><li>Predict if nodes won't be processed at all, and so don't build them, achieve full streaming support for a certain class of stylesheets.</li></ol></s2><anchor name="coding"/> 
-  <s2 title="Coding Conventions"> 
-	 <p>This section documents the coding conventions used in the Xalan
-		source.</p> 
-	 <ol> 
-		<li>Class files are arranged with constructors and possibly an init()
-		  function first, public API methods second, package specific, protected, and
-		  private methods following (arranged based on related functionality), member
-		  variables with their getter/setter access methods last.</li> 
-		<li>Non-static member variables are prefixed with "m_".</li> 
-		<li>static final member variables should always be upper case, without
-		  the "m_" prefix. They need not have accessors.</li> 
-		<li>Private member variables that are not accessed outside the class need
-		  not have getter/setter methods declared.</li> 
-		<li>Private member variables that are accessed outside the class should
-		  have either package specific or public getter/setter methods declared. All
-		  accessors should follow the bean design patterns.</li> 
-		<li>Package-scoped member variables, public member variables, and
-		  protected member variables should not be declared.</li> 
-	 </ol> 
-  </s2><anchor name="open"/> 
-  
-</s1>
diff --git a/xdocs/sources/design/org_apache.gif b/xdocs/sources/design/org_apache.gif
deleted file mode 100644
index 105f264..0000000
--- a/xdocs/sources/design/org_apache.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/process.gif b/xdocs/sources/design/process.gif
deleted file mode 100644
index c7a871e..0000000
--- a/xdocs/sources/design/process.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/trax.gif b/xdocs/sources/design/trax.gif
deleted file mode 100644
index 8eb9614..0000000
--- a/xdocs/sources/design/trax.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/xalan.gif b/xdocs/sources/design/xalan.gif
deleted file mode 100644
index ca4a57c..0000000
--- a/xdocs/sources/design/xalan.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/xalan1_1x1.gif b/xdocs/sources/design/xalan1_1x1.gif
deleted file mode 100644
index c9e1536..0000000
--- a/xdocs/sources/design/xalan1_1x1.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/xmllogo.gif b/xdocs/sources/design/xmllogo.gif
deleted file mode 100644
index b63188d..0000000
--- a/xdocs/sources/design/xmllogo.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/xpath.gif b/xdocs/sources/design/xpath.gif
deleted file mode 100644
index cf28f9c..0000000
--- a/xdocs/sources/design/xpath.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/design/xslt_abstract.gif b/xdocs/sources/design/xslt_abstract.gif
deleted file mode 100644
index fa041a6..0000000
--- a/xdocs/sources/design/xslt_abstract.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/entities.ent b/xdocs/sources/entities.ent
deleted file mode 100644
index a45dccb..0000000
--- a/xdocs/sources/entities.ent
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml encoding="US-ASCII"?>
-
-<!ENTITY xslt4j "Xalan-Java">
-<!ENTITY xslt4j2 "Xalan-Java 2">
-<!ENTITY xslt4j-dist "xalan-j_2_2_D10">
-<!ENTITY xslt4j-current "&xslt4j; version 2.2.D10">
-<!ENTITY xml4j "Xerces-Java">
-<!ENTITY xml4j-used "&xml4j; version 1.4.3">
-<!ENTITY xslt4c "Xalan-C++">
-<!ENTITY xml4c "Xerces-C++">
-<!ENTITY download "The &xslt4j-current; download from xml.apache.org includes xerces.jar from &xml4j-used;.">
-
-<!ENTITY xsltcwhatsnewhead '<li><link anchor="xsltc">XSLTC</link></li>'>
-                         
-<!ENTITY xsltcwhatsnew '<anchor name="xsltc"/><s2 title="XSLTC">
-                <p>In April 2001, Sun donated XSLTC to the Xalan project. XSLTC compiles stylesheets into translets and
-                provides a runtime environment for using translets to transform XML documents. Initially, XSLTC is
-                available in a separate JAR. Over time, we plan to integrate the two codebases. For more information,
-                see <link idref="xsltc_usage">Using XSLTC</link>, <link idref="readme" anchor="xsltcreleasenotes">XSLTC 
-                Release Notes</link>, and <jump href="xsltc/index.html">XSLTC Design</link>.</p>
-                </s2>'>
-                
-<!ENTITY xsltcreleasenotesentry '<li><link anchor="xsltcreleasenotes">XSLTC Release Notes</link></li>'>
-
-<!ENTITY xsltcsampleshead '<li><link anchor="translets">translets</link></li>'>
-
-<!ENTITY xsltcsamples '<anchor name="translets"/><s2 title="Translets">
-                 <ul>
-                 <li><link anchor="xsltc1">JAXPTransletOneTransformation</link></li>
-                 <li><link anchor="xsltc2">JAXPTransletMultipleTransformations</link></li>
-                 </ul>
-                 <p>See also: <link idref="readme" anchor="xsltcdemos">XSLTC demos</link>.</p><anchor name="xsltc1"/>
-                 <p>You can use the TrAX/JAXP 1.1 interfaces to compile and run translets. For this release, you must still
-                 use StreamSource objects for the XSL stylesheet and XML input document, and a StreamResult object for the 
-                 transformation output. For an overview of the usage patterns these samples illustrate, see 
-                 <link idref="xsltc_usage" anchor="api">Calling XSLTC with the TrAX/JAXP API</link>.</p>
-                 <anchor name="xsltcprepare"/>
-                 <p><em>Important:</em> To run these samples, you must compile the sample class files and adjust the 
-                 system classpath.</p>
-                 <ol>
-                   <li>To compile the samples, you can run the Ant build from the root directory as follows:<br/><br/>
-                   <code>&nbsp;&nbsp;build xsltc.samples</code><br/><br/></li>
-                   <li>Add xsltc.jar, runtime.jar, BCEL.jar, java_cup.jar, and the samples/translets subdirectory to 
-                   the classpath</li>
-                 </ol>
-                 <note>The JAR files listed above are in the bin directory. 
-                 The samples/translets directory contains the sample class files as well as the translet class file that is
-                 generated at tun time (todo.class from the todo.xsl stylesheet).</note> 
-                 <anchor name="xsltc1"/>
-                 <s3 title="JAXPTransletOneTransformation">
-                 <p>What it does: Uses the XSLTC TransformerFactory to compile a translet and use
-                 the translet to transform the XSLTC to-do list from XML into HTML.</p>
-                 <p>Complete the <link anchor="xsltcprepare">steps detailed above</link>, and run this sample 
-                 from the translets subdirectory with</p>
-                 <p><code>java JAXPTransletOneTransformation</code></p>
-                 <p>View the result in todo-xsltc.html.</p>
-                 </s3><anchor name="xsltc2"/>
-                 <s3 title="JAXPTransletMultipleTransformations">
-                 <p>What it does: Uses the XSLTC TransformerFactory to compile a translet and use
-                 the Templates object associated with the translet to transform the XSLTC and Xalan to-do lists from XML 
-                 into HTML.</p>
-                 <p>Complete the <link anchor="xsltcprepare">steps detailed above</link>, and run this sample 
-                 from the translets subdirectory with</p>
-                 <p><code>java JAXPTransletOneTransformation</code></p>
-                 <p>View the results in todo-xsltc.html and todo-xalan.html.</p>                
-                 </s3>
-                 </s2>'>
-                
diff --git a/xdocs/sources/xalan-collate.xsl b/xdocs/sources/xalan-collate.xsl
deleted file mode 100644
index 7ccaad1..0000000
--- a/xdocs/sources/xalan-collate.xsl
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-<xsl:template match ="/">
-  <documentation>
-    <chapter id="index"><xsl:copy-of select="document('xalan/index.xml')"/></chapter>  
-    <chapter id="whatsnew"><xsl:copy-of select="document('xalan/whatsnew.xml')"/></chapter>
-    <chapter id="overview"><xsl:copy-of select="document('xalan/overview.xml')"/></chapter>
-    <chapter id="getstarted"><xsl:copy-of select="document('xalan/getstarted.xml')"/></chapter>
-    <chapter id="faq"><xsl:copy-of select="document('xalan/faq.xml')"/></chapter>
-    <chapter id="samples"><xsl:copy-of select="document('xalan/samples.xml')"/></chapter>
-    <chapter id="commandline"><xsl:copy-of select="document('xalan/commandline.xml')"/></chapter>
-    <chapter id="usagepatterns"><xsl:copy-of select="document('xalan/usagepatterns.xml')"/></chapter>
-    <chapter id="trax"><xsl:copy-of select="document('xalan/trax.xml')"/></chapter>
-    <chapter id="extensions"><xsl:copy-of select="document('xalan/extensions.xml')"/></chapter>
-    <chapter id="extensionslib"><xsl:copy-of select="document('xalan/extensionslib.xml')"/></chapter>
-    <chapter id="readme"><xsl:copy-of select="document('xalan/readme.xml')"/></chapter>
-    <chapter id="api">
-      <s1 title="Java API">
-        <p>Javadoc for the entire Xalan-Java API:</p>
-        <ul>
-          <li><jump href="apidocs/index.html">Xalan-Java 2 API</jump></li>
-          <li><jump href="compat_apidocs/index.html">Xalan-Java 1 compatibility API</jump></li>
-        </ul>         
-      </s1>
-    </chapter>
-  </documentation>
-</xsl:template>
-</xsl:stylesheet>
-
-
diff --git a/xdocs/sources/xalan-jlocal.xml b/xdocs/sources/xalan-jlocal.xml
deleted file mode 100644
index e1f149e..0000000
--- a/xdocs/sources/xalan-jlocal.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book SYSTEM "sbk:/style/dtd/book.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-
-<book title="Xalan XSL Transformer User's Guide" copyright="2001 The Apache Software Foundation">
-  <resources source="sbk:/sources/xalan/resources.xml"/>
-  <document id="whatsnew" label="What's New" source="xalan/whatsnew.xml"/>
-  <document id="dtm" label="DTM" source="xalan/dtm.xml"/>
-  <document id="xsltc_usage" label="XSLTC Translets" source="xalan/xsltc_usage.xml"/>
-  <separator/>
-  <document id="overview" label="Overview" source="xalan/overview.xml"/>
-  <document id="getstarted" label="Getting Started" source="xalan/getstarted.xml"/>
-  <separator/>
-  <faqs id="faq" label="FAQs" source="xalan/faq.xml"/>
-  <separator/>
-  <document id="samples" label="Sample Apps" source="xalan/samples.xml"/>
-  <document id="commandline" label="Command Line" source="xalan/commandline.xml"/>
-  <separator/>
-  <document id="usagepatterns" label="Usage Patterns" source="xalan/usagepatterns.xml"/>
-  <separator/>
-  <document id="trax" label="TrAX" source="xalan/trax.xml"/>
-  <external href="apidocs/index.html" label="API (Javadoc)"/>
-  <separator/>
-  <document id="extensions" label="Extensions" source="xalan/extensions.xml"/>
-  <document id="extensionslib" label="Extensions Library" source="xalan/extensionslib.xml"/>
-  <separator/>
-  <document id="readme" label="Release Notes" source="xalan/readme.xml"/>
-  <separator/>
-  <external href="design/design2_0_0.html" label="Xalan 2 Design"/>
-  <external href="xsltc/index.html" label="XSLTC Design"/>
-  <separator/>
-  <external href="readme.html#bugs" label="Bugs"/>
-  <external href="http://xml.apache.org/xalan-j/test/overview.html" label="Testing"/>
-  <separator/>
-  <external href="todo.html#developer-list" label="Credits"/>
-  <external href="xsltc/todo.html#developer-list" label="XSLTC Credits"/>  
-</book>
diff --git a/xdocs/sources/xalan-jsite.xml b/xdocs/sources/xalan-jsite.xml
deleted file mode 100644
index fbedb93..0000000
--- a/xdocs/sources/xalan-jsite.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book SYSTEM "sbk:/style/dtd/book.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-
-<book title="Xalan XSL Transformer User's Guide" copyright="2001 The Apache Software Foundation">
-  <resources source="sbk:/sources/xalan/resources.xml"/>
-  <external href="../index.html" label="Home"/>
-  <separator/>
-  <document id="index" label="Xalan-J 2.2.D10" source="xalan/index.xml"/>
-  <document id="whatsnew" label="What's New" source="xalan/whatsnew.xml"/>
-  <document id="dtm" label="DTM" source="xalan/dtm.xml"/>  
-  <document id="xsltc_usage" label="XSLTC Translets" source="xalan/xsltc_usage.xml"/>
-  <separator/>
-  <document id="overview" label="Overview" source="xalan/overview.xml"/>
-  <document id="getstarted" label="Getting Started" source="xalan/getstarted.xml"/>
-  <separator/>
-  <faqs id="faq" label="FAQs" source="xalan/faq.xml"/>
-  <separator/>
-  <document id="samples" label="Sample Apps" source="xalan/samples.xml"/>
-  <document id="commandline" label="Command Line" source="xalan/commandline.xml"/>
-  <separator/>
-  <document id="usagepatterns" label="Usage Patterns" source="xalan/usagepatterns.xml"/>
-  <separator/>
-  <document id="trax" label="TrAX" source="xalan/trax.xml"/>
-  <external href="apidocs/index.html" label="API (Javadoc)"/>
-  <separator/>
-  <document id="extensions" label="Extensions" source="xalan/extensions.xml"/>
-  <document id="extensionslib" label="Extensions Library" source="xalan/extensionslib.xml"/>
-  <separator/>
-  <document id="readme" label="Release Notes" source="xalan/readme.xml"/>
-  <separator/>
-  <external href="design/design2_0_0.html" label="Xalan 2 Design"/>
-  <external href="xsltc/index.html" label="XSLTC Design"/>  
-  <separator/>
-  <external href="readme.html#bugs" label="Bugs"/>  
-  <external href="http://xml.apache.org/xalan-j/test/overview.html" label="Testing"/>
-  <separator/>
-  <external href="todo.html#developer-list" label="Credits"/>
-  <external href="xsltc/todo.html#developer-list" label="XSLTC Credits"/>      
-</book>
diff --git a/xdocs/sources/xalan/commandline.xml b/xdocs/sources/xalan/commandline.xml
deleted file mode 100644
index d34f0da..0000000
--- a/xdocs/sources/xalan/commandline.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
- 
-
-<s1 title="Command-Line Utility">
-   
-   <s2 title="Using the Command-Line Utility">
-      <p>To perform a transformation, you can call &xslt4j; from the command line (or script), 
-      an applet, an application, or a servlet (see <link idref="usagepatterns">Usage Patterns</link>).</p>
-     <p>The org.apache.xalan.xslt.Process main() method provides a command-line interface
-    for performing XSL transformation. To perform a transformation from the command line or a script,
-    do the following:</p>
- 		<ol>
-    <li>Download &xslt4j;.<br/><br/></li> 
-    <li><link idref="getstarted" anchor="classpath">Set the Java classpath</link> to include xalan.jar and
-    xerces.jar (or another conformant XML Parser -- see <link idref="usagepatterns" anchor="plug">Plugging in 
-    the Transformer and XML parser</link>).<br/><br/></li>
-    <li>Call java and the Process class with the appropriate flags and
-    arguments (described below). The following command line, for example, includes the -IN, -XSL,
-    and -OUT flags with their accompanying arguments -- the XML source document, the XSL
-    stylesheet, and the output file:<br/><br/>
-    <code>java org.apache.xalan.xslt.Process -IN foo.xml -XSL foo.xsl -OUT foo.out</code>
-    </li></ol>
-    <p>The command line utility can take the following flags and arguments (the flags are case insensitive):</p> 
-      <source>-IN inputXMLURL
--XSL XSLTransformationURL
--OUT outputFileName
--V (Version info)
--QC (Quiet Pattern Conflicts Warnings)
--Q  (Quiet Mode)
--LF (Use linefeeds only on output -- default is CR/LF)
--CR (Use carriage returns only on output -- default is CR/LF)
--INDENT (Number of spaces to indent each level in output tree --default is 0)
--TT (Trace the templates as they are being called)
--TG (Trace each result tree generation event)
--TS (Trace each selection event)
--TTC (Trace the template children as they are being processed)
--EDUMP [optional]FileName (Do stackdump on error)
--XML (Use XML formatter and add XML header)
--TEXT (Use simple Text formatter)
--HTML (Use HTML formatter)
--PARAM name value (Set a stylesheet parameter)
--DIAG put out timing diagnostics
--URIRESOLVER fullClassName (Use a custom URIResolver)
--ENTITYRESOLVER fullClassName (Use a custom EntityResolver)
--CONTENTHANDLER fullClassName (Use a custom ContentHandler)
-</source>
-      <p>Use <code>-IN</code> to specify the XML source document.</p> 
-      <p>Use <code>-XSL</code> to specify the XSL stylesheet file.</p>
-      <p>Use <code>-TEXT</code> if you want the output to include only element values (not element tags with element names and
-      attributes).</p>
-      <p>Use <code>-HTML</code> to write 4.0 transitional HTML (some elements, such as &lt;br&gt;, are
-      not well formed XML).</p>
-      <p>To set stylesheet parameters from the command line, use <br/>
-      <code>java org.apache.xalan.xslt.Process -PARAM <ref>name value</ref></code></p>
-      <p>The value is passed to the transformer as a String.</p>
-      <p>Use <code>-URIRESOLVER</code> with a fully qualified class name to utilize a custom implementation of the
-      <jump href="apidocs/javax/xml/transform/URIResolver.html">URIResolver</jump> TrAX interface to resolve URIs for
-       xsl:include, xsl:import, and the document() function.</p>
-       <p>Use <code>-ENTITYRESOLVER</code> with a fully qualified class name to utilize a custom implementation of the
-       <jump href="apidocs/org/xml/sax/EntityResolver.html">EntityResolver</jump> SAX interface to handle external entity references.</p>
-       <p>Use <code>-CONTENTHANDLER</code> with a fully qualified class name to utilize a custom implementation of the 
-       <jump href="apidocs/org/xml/sax/ContentHandler.html">ContentHandler</jump> SAX interface to serialize output.</p>
-   </s2>
-</s1>
diff --git a/xdocs/sources/xalan/dtm.xml b/xdocs/sources/xalan/dtm.xml
deleted file mode 100644
index 25cdd09..0000000
--- a/xdocs/sources/xalan/dtm.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-
-<s1 title="&xslt4j; DTM">
-<ul>
-  <li><link anchor="intro">Introduction</link></li>
-  <li><link anchor="settings">Performance settings</link></li>  
-</ul><anchor name="intro"/>
-<s2 title="Introduction">
-  <p>The Document Table Model (DTM) is an interface to a Document Model designed specifically for the needs of our XPath and XSLT 
-  implementations. The motivation behind this model is to optimize performance and minimize storage.</p>
-  <p>Specifically, DTM avoids the overhead of instantiating the objects the standard DOM requires to represent a tree of nodes. 
-  DTM uses unique integer "handles" to identify nodes, integer ID values to represent URLs, local names, and expanded names, and 
-  integer index and length references to a string buffer to represent the text value of each node.</p>
-  <p>In general, the "read" APIs to DTM resemble those of the W3C Document Object Model (<resource-ref idref="dom"/>) interface. 
-  However, in place of the DOM object tree of nodes, DTM uses integer arrays and string pools to represent the structure and content 
-  of the XML document to be transformed. DTM also structures the document's contents slightly differently, to better match the XPath 
-  data model; some details and constraints present in a standard DOM are suppressed, and a few XPath-specific features are added.</p>
-  <p>DTM is intended to be a read-only model, and so does not attempt to replicate the DOM's write or create-node operations.</p> 
-  <p>The details of constructing a DTM vary depending on which implementation of this API you are using. Two reference implementations are
-  currently available:</p>
-<ul>
-  <li>SAX2DTM (built via a SAX stream)</li>
-  <li>DOM2DTM (which provides DTM access to an existing DOM)</li>
-</ul> 
-  <p>Both DTMs can be built incrementally (see <link anchor="incremental">incremental transforms</link>). When operating incrementally, the
-  DTM allows the Xalan processor to begin reading the DTM and performing the transformation while the DTM is still being assembled 
-  (for example, while the parser is still parsing the XML source), and attempts to do only as much work as is needed to support the
-  read requests actually made by the XPath or XSLT processor.</p>
-  <p>For the convenience of user-written extensions, a proxy mechanism presents the contents of the DTM as a read-only subset of the DOM.</p>
-  </s2><anchor name="settings"/>
-  <s2 title="DTM performance settings">
-  <p>&xslt4j; implements two DTM performance features that you can control with the TransformerFactory
-  <jump href="apidocs/javax/xml/transform/TransformerFactory.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute(String name, Object value)</jump>
-  method.</p>
-  <table>
-  <tr>
-    <th>Attribute name (URL)</th>
-    <th>Default setting</th>
-    <th>Description</th>
-  </tr>
-  <tr>
-    <td>"http://xml.apache.org/xalan/features/incremental"</td>
-    <td>false</td>
-    <td><link anchor="incremental">incremental transforms</link></td>
-  </tr>
-  <tr>
-    <td>"http://xml.apache.org/xalan/features/optimize"</td>
-    <td>true</td>
-    <td><link anchor="optimized">optimized transforms</link></td>
-  </tr>
-  </table>
-  <p>Both of these DTM settings are described below.</p>
-  <anchor name="incremental"/>
-  <s3 title="http://xml.apache.org/xalan/features/incremental">
-   <p>Set this feature to true to enable incremental transformations. If set to false (the default), the transform and the parse 
-   are performed on the same thread.</p>
-   <note> When set to true: If the parser is Xerces, we perform an
-incremental transform on a single thread using the Xerces
-   "parse on demand" feature. If the parser is not Xerces, we run the
-transform in one thread and the parse in another. Exception: if the
-   parser is not Xerces and the XML source is a DOMSource, setting this
-feature to true has no effect.</note>
-   <p>Example: setting incremental transforms to true:</p>
-   <source>javax.xml.transform.TransformerFactory tFactory =
-            javax.xml.transform.TransformerFactory.newInstance();
- // setAttribute() takes a String and an Object.            
-  tFactory.setAttribute
-            ("http://xml.apache.org/xalan/features/incremental", 
-             java.lang.Boolean.TRUE);
-  ...</source>
-  </s3><anchor name="optimized"/>
-  <s3 title="http://xml.apache.org/xalan/features/optimize">
-   <p>When set to true (the default), this feature enables optimizations that may involve structural rewrites of the stylesheet. 
-   Any tool that requires direct access to the stylesheet structure should set this feature to false.</p>
-</s3>
-</s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/extensions.xml b/xdocs/sources/xalan/extensions.xml
deleted file mode 100644
index 52dbf99..0000000
--- a/xdocs/sources/xalan/extensions.xml
+++ /dev/null
@@ -1,762 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-
-<s1 title="&xslt4j; Extensions">
-<ul>
-<li><link anchor="intro">Introduction</link></li>
-<li><link anchor="supported-lang">Supported languages</link></li>
-<li><link anchor="basic-pattern">The basic pattern</link></li>
-<li><link anchor="setup-runtime">Setting up the runtime environment</link></li>
-<li><link anchor="basic-syntax">Syntax</link></li>
-<li><link anchor="ext-elements">Using an extension element</link></li>
-<li><link anchor="ext-functions">Using extension functions</link></li>
-<li><link anchor="java-namespace">Alternative: using the abbreviated syntax for extensions implemented in Java</link></li>
-<li>Examples: <link anchor="ex-basic">basic JavaScript example</link>, <link anchor="ex-java-namespace">using the java namespace</link>, <link anchor="ex-java">using a Java Hashtable</link>, <link anchor="ex-javascript">using a JavaScript array</link></li>
-</ul><anchor name="intro"/>
-  <s2 title="Introduction">
-  <p>For those situations where you would like to augment the functionality of XSLT with calls to a procedural language, &xslt4j; supports the creation and use of extension elements and extension functions. &xslt4j; also provides a growing <link idref="extensionslib">extensions library</link> available for your use. An extension (a collection of elements and functions) inhabits a namespace, either a namespace you declare and designate as an extensions namespace, or one of the predefined namespaces that &xslt4j; provides. For information about XML namespaces, see <jump href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</jump>.</p>
-
-<p><em>Extension elements</em>  Unlike a literal result element, which the stylesheet simply transfers to the result tree, an extension element performs an action. For example, you can use the Redirect extension elements shipped with &xslt4j; to redirect portions of your transformation output to one or more files. Extension elements may contain attributes, text nodes, other elements, basically any valid XML. Extension elements may perform quite sophisticated actions, given that the extension routine (the implementation) has direct access to the XSLT processor context object and to the element. In many cases the implementation returns void or null; if it does return a value, that value is placed in the transformation result tree.</p>
-
-<p><em>Extension functions</em>  You can think of extension functions as extending the core library of functions that XPath provides. An extension function passes arguments to the extension implementation and returns a value. You can use extension functions to return values that XSLT can interact with directly (node-set, result tree fragment, string, boolean, and number) as well as values (of any type) that you pass in turn to other extension functions. Extension functions written in Java can also access certain items in the XSLT execution environment through an <jump href="apidocs/org/apache/xalan/extensions/ExpressionContext.html">ExpressionContext</jump> interface.</p>
-
-<p>XSLT extensions are specified in the <jump href="http://www.w3.org/TR/xslt#extension">XSLT Recommendation</jump>.  This document focuses on the &xslt4j; implementation of those requirements, not on XSLT extensions in general. For additional information on extensions, consult the Recommendation or the other resources listed in <link idref="overview" anchor="uptospeed">Getting up to speed with XSLT</link>.</p>
-</s2><anchor name="supported-lang"/>
-<s2 title="Supported languages">
-<p>Extensions written in Java are directly supported by &xslt4j;.  For extensions written in languages other than Java, &xslt4j; uses the <resource-ref idref="bsf"/>, an architecture for incorporating scripting into Java applications and applets. BSF allows an application to take advantage of scripting while being independent of any specific scripting language. To date, we have tested extensions implemented in JavaScript. Other languages with BSF support appear in the table below.</p>
-<p>BSF requires bsf.jar on the classpath. This JAR file is shipped with &xslt4j; and is required only if you have extensions written in languages other than Java. The additional JAR files or DLLs required to support extensions written in other languages are listed in the table below. These files are available from the sources indicated and are not shipped with &xslt4j;.</p>
-<table>
-  <tr>
-    <td><em>Language</em></td>
-    <td><em>Version</em></td>
-    <td><em>Requirements</em></td>
-  </tr>
-  <tr>
-    <td>Mozilla Rhino (JavaScript)<br/><br/></td>
-    <td>1.5<br/><br/></td>
-    <td>js.jar available from 
-				    http://www.mozilla.org/rhino<br/><br/></td>
-  </tr>
-  <tr>
-    <td>NetRexx<br/><br/></td>
-    <td>1.148 up <br/><br/></td>
-    <td>NetRexxC.zip available from http://www2.hursley.ibm.com/netrexx<br/><br/></td>
-  </tr>
-    <tr>
-    <td>BML<br/><br/></td>
-    <td>2.4<br/><br/></td>
-    <td>bmlall.jar available from http://oss.software.ibm.com/developerworks/projects/bsf<br/><br/></td>
-  </tr>
-    <tr>
-    <td>JPython<br/><br/></td>
-    <td>1.1-beta3<br/><br/></td>
-    <td>python.jar available from http://www.jpython.org/<br/><br/></td>
-  </tr>
-    <tr>
-    <td>Jacl<br/><br/></td>
-    <td>1.1.1<br/><br/></td>
-    <td> jacl.jar and tcljava.jar from http://www.scriptics.com/java<br/><br/></td>
-  </tr>
-    <tr>
-    <td>Win32 ActiveScript langs
-	JScript, VBScript<br/><br/></td>
-    <td><br/><br/></td>
-    <td>MSVCP60.DLL from Microsoft, appropriate language DLLs from Microsoft 
-    http://msdn.microsoft.com/scripting<br/><br/></td>
-  </tr>
-    <tr>
-    <td>PerlScript<br/><br/></td>
-    <td><br/><br/></td>
-    <td>ActivePerl from http://www.activestate.com/<br/><br/></td>
-  </tr>  
-</table>
-</s2><anchor name="basic-pattern"/>
-<s2 title="The basic pattern">
-<p>Let's examine a simple example. The stylesheet below uses an extension element and an extension function to transform an element in the XML source into a statement in the output indicating the date by which a customer can expect a response to a given enquiry.</p>
-
-<p>The source element contains a numdays attribute. The extension element contains a multiplier attribute, which is used to set a variable in the extension. The extension function computes the deadline, that is the current date plus numdays * multiplier. So for &lt;deadline numdays="3"/&gt; (in the XML source) and &lt;my-ext:timelapse multiplier="2"/&gt; (in the stylesheet), the extension computes a deadline 6 days from now, and the stylesheet template transforms the deadline element into a string along the lines of <code>&lt;p&gt;We have logged your enquiry and will respond by April 29, 2000 12:07:16 PM EST.&lt;/p&gt;</code></p>
-<note>The extension function could include both numdays and multiplier as arguments, thus bypassing the need for the extension element, but the purpose here is to illustrate the usage pattern for extension elements.</note>
-<p>As you review this stylesheet, please note the following:</p>
-<ol>
-	  <li>The declaration of the Xalan lxslt namespace, which provides support for the component and
-     component/script elements:<br/><br/>
-    <code>xmlns:lxslt="http://xml.apache.org/xslt"</code><br/><br/></li>
-    <li>The declaration of a namespace for this extension:<br/><br/>
-    <code>xmlns:my-ext="ext1"</code><br/><br/></li>
-  	<li>The designation of this namespace prefix as an extension prefix. This causes any element in the namespace associated with this prefix to be treated as an extension element rather than a literal result element.<br/><br/>
-     <code>extension-element-prefixes="my-ext"</code><br/><br/></li>
-	  <li>The lxslt:component with attributes designating the namespace prefix and the elements and
-     functions this extension provides.<br/><br/></li>
-  	<li>The lxslt:script subelement with a JavaScript implementation of the extension. For Java
-     extensions, the lxslt:script element has a src attribute that you set to identify the Java class.</li>
-</ol><anchor name="ex-basic"/>   
-<source>&lt;?xml version="1.0"?&gt;
-&lt;!--Namespaces are global if you set them in the stylesheet element--&gt;
-&lt;xsl:stylesheet 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="1.0"   
-    xmlns:lxslt="http://xml.apache.org/xslt"
-    xmlns:my-ext="ext1"
-    extension-element-prefixes="my-ext"&gt;
-    
-  &lt;!--The component and its script are in the lxslt namespace and define the 
-    implementation of the extension.--&gt;
-  &lt;lxslt:component prefix="my-ext" elements="timelapse" functions="getdate"&gt;
-    &lt;lxslt:script lang="javascript"&gt;
-      var multiplier=1;
-      // The methods or functions that implement extension elements always take 2
-      // arguments. The first argument is the XSL Processor context; the second 
-      // argument is the element node.
-      function timelapse(xslProcessorContext, elem)
-      {
-        multiplier=parseInt(elem.getAttribute("multiplier"));
-        // The element return value is placed in the result tree.
-        // If you do not want a return value, return null.
-        return null;
-      }
-      function getdate(numdays)
-      {
-        var d = new Date();
-        var totalDays = parseInt(numdays) * multiplier;
-        d.setDate(d.getDate() + totalDays);
-        return d.toLocaleString();
-      }
-    &lt;/lxslt:script&gt;
-  &lt;/lxslt:component&gt;
-      
-  &lt;xsl:template match="deadline"&gt;
-    &lt;p&gt;&lt;my-ext:timelapse multiplier="2"/&gt;We have logged your enquiry and will 
-      respond by &lt;xsl:value-of select="my-ext:getdate(string(@numdays))"/&gt;.&lt;/p&gt;
-  &lt;/xsl:template>
-
-&lt;/xsl:stylesheet&gt;
-</source>
-</s2><anchor name="setup-runtime"/>
-<s2 title="Setting up the runtime environment">
-<p>To run the preceding example, bsf.jar and js.jar must be on the classpath. Remember that bsf.jar must be on the classpath to run any extension written in a language other than Java. For extensions implemented in a scripting language, see the additional requirements in <link anchor="supported-lang">Supported languages</link>.</p>
-</s2><anchor name="basic-syntax"/>
-<s2 title="Syntax">
-<p>You can always use the pattern illustrated above to set up and use extension elements and extension functions. For extension elements and functions implemented in Java, you can also use an abbreviated syntax, described in <link anchor="java-namespace">Alternative: using the abbreviated syntax for extensions implemented in Java</link>. Unless you are using the abbreviated syntax, do the following:</p>
-<s3 title="1. Declare the lxslt namespace">
-<p><br/><code>xmlns:lxslt="http://xml.apache.org/xslt"</code></p>
-<p>The lxslt namespace provides support for the lxslt:component element and lxslt:script subelement.</p>
-</s3>
-<s3 title="2. Declare a unique namespace for each extension prefix">
-<p><br/><code>xmlns:<ref>prefix</ref>=<ref>URI</ref></code></p>
-<p>The <ref>prefix</ref> identifies the namespace, and <ref>URI</ref> is an arbitrary (but unique) string that matches the value of the prefix attribute of an lxslt:component element in the stylesheet.<br/>
-Example: <code>xmlns:ext1="xyz"</code><br/><br/></p>
-</s3>
-<s3 title="3. If you are using extension elements, designate the extension element prefixes">
-<p><br/>This step is required only if you are using extension elements.  If you are using extension functions only, you can skip this step.</p>
-<p>In the stylesheet element, write:</p> 
-<p><code>extension-element-prefixes="<ref>prefix-1 prefix-2 ...</ref>"</code></p>
-<p>In a literal result element or extension element include the xsl prefix:</p>
-<p><code>xsl:extension-element-prefixes="<ref>prefix1 prefix2 ...</ref>"</code></p>
-<p>Keep in mind that where you declare namespaces and designate extension prefixes determines the scope of those namespaces.To make your extensions available throughout the stylesheet, include these settings and attribute in the stylesheet element.</p>
-</s3>
-<s3 title="4. (Optional) Exclude the extension namespace declaration from the result tree">
-<p><br/>By default, namespace declarations are included in the transformation output. To exclude namespaces from the output, use</p>
-<p><code>exclude-result-prefixes="<ref>prefix-1 prefix-2 ...</ref>"</code></p>
-<p>in the stylesheet element or</p>
-<p><code>xsl:exclude-result-prefixes="<ref>prefix-1 prefix-2 ...</ref>"</code></p> 
-<p>in a literal result element or extension element.</p>
-</s3>
-<s3 title="5. Set up an lxslt:component">
-<p><br/>In the scope of the lxslt namespace declaration:</p>
-<p><code>&lt;lxslt:component prefix="<ref>prefix</ref>" </code><br/>
-   <code>&nbsp;&nbsp;&nbsp;&nbsp;functions="<ref>func-1 func-2 ...func-n</ref>"</code><br/> 
-   <code>&nbsp;&nbsp;&nbsp;&nbsp;elements="<ref>elem-1 elem-2 ...elem-n</ref>"&gt;</code><br/>
-   <code>&nbsp;&nbsp;&lt;!--See lxslt:script below--&gt;</code><br/>
-   <code>&lt;/lxslt:component&gt;</code></p>
-<p>where <ref>func-1 func-2 ... func-n</ref> and <ref>elem-1 elem-2 ... elem-n</ref> designate the functions and elements the extension provides and the stylesheet uses. You can use the function-available and element-available functions to determine at run time whether a function or element designated in the lxslt:component is actually available.</p>
-<note>If the component is implemented in Java, the values of the <code>functions</code> and <code>elements</code> attributes are ignored. The function-available and element-available functions use reflection to examine the actual Java methods.</note>
-</s3>
-<anchor name="setup-script"/>
-<s3 title="6. Set up the lxslt:script element">
-<p><br/>In each lxslt:component, you must include exactly one lxslt:script element. If the extension is implemented in JavaScript:</p>
-<p><code>&lt;lxslt:script lang="javascript" &gt;</code><br/>
-<code>&nbsp;&nbsp;&lt;!--The implementation script--&gt;</code><br/>
-<code>&lt;/lxslt:script&gt;</code></p>
-<p>For other scripting languages supported by BSF, use the same approach as for JavaScript. &xslt4j; plans to add support for using the src attribute to identify another document that contains the implementation script; this feature is not yet supported.</p>
-<p>If the extension is implemented in Java, you have three choices for the format of the src attribute in the lxslt:script element.</p>
-<p><code>&lt;lxslt:script lang="javaclass" src="xalan://<ref>FQCN</ref>"/&gt;</code>
-<br/>where <ref>FQCN</ref> is the fully qualified class name.
-<br/>Example: <code>&lt;lxslt:script lang="javaclass" src="xalan://java.util.Hashtable"/&gt;</code></p>
-<p><code>&lt;lxslt:script lang="javaclass" src="xalan://<ref>PJPN</ref>"/&gt;</code>
-<br/>where <ref>PJPN</ref> is the beginning of or the complete name of a java package.
-<br/>Example: <code>&lt;lxslt:script lang="javaclass" src="java.util"/&gt;</code></p>
-<p><code>&lt;lxslt:script lang="javaclass" src="http://xml.apache.org/xslt/java"/&gt;</code></p>
-<p>The different formats for the value of the src attribute when using Java extensions are more fully explained in <link anchor="java-namespace-declare">Declare the namespace</link>.</p>
-</s3>
-<s3 title="Implicit DTD for lxslt:component">
-<source>&lt;!ELEMENT lxslt:component (lxslt:script)&gt;
-&lt;!ATTLIST lxslt:component
-  prefix CDATA #REQUIRED
-  elements NMTOKENS #IMPLIED
-  functions NMTOKENS #IMPLIED&gt;
-
-&lt;!ELEMENT lxslt:script (#PCDATA | EMPTY)?&gt;
-&lt;!ATTLIST lxslt:script
-  lang CDATA #REQUIRED
-  src CDATA #IMPLIED&gt;</source>
-</s3>
-</s2><anchor name="ext-elements"/>
-<s2 title="Using an extension element">
-<p>Extension elements pass the extension two objects:</p>
-<ul>
-<li><jump href="apidocs/org/apache/xalan/extensions/XSLProcessorContext.html">org.apache.xalan.extensions.XSLProcessorContext</jump>, which provides access to the XSL processor, the XML source tree, the stylesheet tree, the current context node, and the current mode (if any).<br/><br/></li>
-<li><jump href="apidocs/org/apache/xalan/templates/ElemExtensionCall.html">org.apache.xalan.templates.ElemExtensionCall</jump>, which provides the API for interacting with the extension element.</li>
-</ul>
-<p>You can use the ElemExtensionCall getAttribute(String name) method, for example, to read element attributes in their raw form.  Use the getAttribute(String name, Node sourceNode, XSLTEngineImpl processor) method to evaluate the attribute as an attribute value template.  Note that the method names are the same but the method signatures are different.  For full details, see the <jump href="apidocs/org/apache/xalan/templates/ElemExtensionCall.html">Javadoc</jump> for the ElemExtensionCall class.</p>
-<s3 title="Implementing an extension element">
-<p>For each extension element in a namespace, the implementation must be a Java method with the following signature, or the scripting language equivalent:</p>
-<p><code><ref>Type element</ref>(org.apache.xalan.extensions.XSLProcessorContext, </code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;org.apache.xalan.templates.ElemExtensionCall extensionElement)</code></p>
-<p>where <ref>Type</ref> designates the return type and <ref>element</ref> is the local part of the extension element name (the element name without the namespace prefix). In the method signature, you may also use superclasses of the indicated types.</p>
-<p>If the extension element is implemented in a loosely typed scripting language, such as JavaScript, the arguments and return value are untyped.</p>
-<p><em>Caution:</em> The value returned by an extension element is placed in the transformation result. If you are not interested in a return value, use a public void Java method or return null from a scripting language function.</p>
-<p>Java example: <code>public void myElement</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(org.apache.xalan.extensions.XSLProcessorContext, </code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;org.apache.xalan.templates.ElemExtensionCall extensionElement)</code></p>
-<p>JavaScript example: <code>function myElement(xslProcContext, element)</code></p>
-<p>The <link idref="extensionslib" anchor="redirect">Redirect extension</link> in the extensions library contains three extension elements.</p>
-</s3>
-
-</s2><anchor name="ext-functions"/>
-<s2 title="Using extension functions">
-<p>Extension functions may include arguments of any type and return a value of any type.</p>
-<p>XSLT recognizes five data types: node-set, result-tree-fragment, string, boolean, and number. You can use XPath expressions to set variables with values of these types. You can also pass literals for string, boolean, and number arguments. If you want to pass an argument of a type that XSLT does not recognize, use another extension function to return an object of that type. The stylesheet that appears in <link anchor="format-date-stylesheet">Formatting a date</link>, for example uses extension functions to return a Date object and a SimpleDateFormat object, and then uses these objects to call another extension function.</p>
-<s3 title="Data type mapping and method selection">
-<p>When calling an extension function written in a language other than Java, objects of the following Java classes will always be passed to the extension function:</p>
-  <table>
-    <tr>
-      <th>XSLT Type</th>
-      <th>Java Type</th>
-    </tr>
-    <tr>
-       <td>Node-Set</td>
-       <td>org.w3c.dom.traversal.NodeIterator</td>
-    </tr>
-    <tr>
-       <td>String</td>
-       <td>java.lang.String</td>
-    </tr>
-    <tr>
-       <td>Boolean</td>
-       <td>java.lang.Boolean</td>
-    </tr>
-    <tr>
-       <td>Number</td>
-       <td>java.lang.Double</td>
-    </tr>
-    <tr>
-       <td>Result Tree Fragment</td>
-       <td>org.w3c.dom.DocumentFragment</td>
-    </tr>
-  </table>
-<p>Any non-XSLT type is passed without conversion.</p>
-<p>When calling an extension function written in Java, the extension function signature can specify any of the indicated Java types, as explained below:</p>
-  <table>
-    <tr>
-      <th>XSLT Type</th>
-      <th>Java Types</th>
-    </tr>
-    <tr>
-       <td>Node-Set</td>
-       <td>org.w3c.dom.traversal.NodeIterator, org.w3c.dom.NodeList, org.w3c.dom.Node or its subclasses, java.lang.String, java.lang.Object, char, [double, float, long, int, short, byte,] boolean</td>
-    </tr>
-    <tr>
-       <td>String</td>
-       <td>java.lang.String, java.lang.Object, char, [double, float, long, int, short, byte,] boolean</td>
-    </tr>
-    <tr>
-       <td>Boolean</td>
-       <td>boolean, java.lang.Boolean, java.lang.Object, java.lang.String</td>
-    </tr>
-    <tr>
-       <td>Number</td>
-       <td>double, java.lang.Double, float, long, int, short,char, byte, boolean, java.lang.String, java.lang.Object</td>
-    </tr>
-    <tr>
-       <td>Result Tree Fragment</td>
-       <td>org.w3c.dom.traversal.NodeIterator, org.w3c.dom.NodeList, org.w3c.dom.Node or its subclasses, java.lang.String, java.lang.Object, char, [double, float, long, int, short, byte,] boolean</td>
-    </tr>
-    <tr>
-       <td>Non-XSLT Type</td>
-       <td>the native type or any of its superclasses, double, float, long, int, short, char, byte, java.lang.String</td>
-    </tr>
-  </table>
-<p>When calling extension functions written in Java, &xslt4j; selects the method to call as follows:</p>
-<ol>
-  <li>&xslt4j; selects all methods whose name matches the extension function name as specified in <link anchor="ext-func-calls">Extension function Java calls</link>.</li>
-  <li>From this list of methods, &xslt4j; determines which methods are <ref>qualified</ref>.</li>
-  <li>Each qualified method is assigned a score based on the table shown above. To assign the score to a given method, &xslt4j; examines each of the XSLT argument types in the function invocation in the stylesheet. For each argument, the appropriate row in the table above is selected. Then, the corresponding Java parameter type in the method signature in the Java program is scored. Types which appear earlier in the list are given a higher score.  That is, the list appears in order of scoring preference from highest to lowest. Types shown in square brackets have equal priority.</li>
-  <li>The method with the highest score is invoked after the arguments are converted to the appropriate type. If more than one method has the highest score, an exception is thrown.</li>
-</ol>
-<p>Any extension function written in Java can have a first parameter of type <code>org.apache.xalan.extensions.ExpressionContext</code>. Any method with an ExpressionContext as the first parameter will score higher than any method which does not have an ExpressionContext as a first parameter.</p>
-</s3>
-
-<anchor name="ext-func-retval"/>
-<s3 title="Return values">
-<p>The &xslt4j; extension mechanism examines the class of the value returned from a function and converts the value into an XSLT type according to the following table:</p>
-  <table>
-    <tr>
-      <th>Java Types</th>
-      <th>XSLT Type</th>
-    </tr>
-    <tr>
-       <td>org.w3c.dom.traversal.NodeIterator<br/>org.apache.xml.dtm.DTM<br/>org.apache.xml.dtm.DTMAxisIterator<br/>org.apache.xml.dtm.DTMIterator<br/>org.w3c.dom.Node</td>
-       <td>Node-Set</td>
-    </tr>
-    <tr>
-       <td>java.lang.String</td>
-       <td>String</td>
-    </tr>
-    <tr>
-       <td>java.lang.Boolean</td>
-       <td>Boolean</td>
-    </tr>
-    <tr>
-       <td>java.lang.Number</td>
-       <td>Number</td>
-    </tr>
-    <tr>
-       <td>org.w3c.dom.DocumentFragment</td>
-       <td>Result Tree Fragment</td>
-    </tr>
-    <tr>
-       <td>org.apache.xpath.objects.XObject</td>
-       <td>Specified XSLT Type</td>
-    </tr>
-    <tr>
-       <td>All other classes</td>
-       <td>Non-XSLT Type</td>
-    </tr>
-  </table>
-  <p>Note that the above test is applied using <code>instanceof</code> so that any subclasses of the classes listed above will be treated the same as the listed superclass.  For example, a <code>java.lang.Double</code> will be treated the same as a <code>java.lang.Number</code> and will be converted to an XSLT Number.</p>
-  <note>The return value conversion can somtimes cause confusion.  For example, if your extension function returns an object that is a subclass of NodeIterator, that object will be converted by &xslt4j; to an XSLT Node-Set.  If you later attempt to treat that object as a non-XSLT object of your original class and try to invoke a method on that object, your method invocation will fail.</note>
-</s3>
-
-<anchor name="ext-func-calls"/>
-<s3 title="Extension function Java calls">
-<p>The technique for instantiating Java objects and calling Java methods depends on the format of the extension namespace that was declared.  See <link anchor="java-namespace-declare">Declare the namespace</link> for the three different formats of namespace declarations for Java extensions. For each namespace format, the section below describes how to instantiate an object, how to invoke an instance method, and how to invoke a static method. The sections below explain, for each syntax, which methods are <ref>qualified</ref> for method selection as described in the preceeding section.</p>
-<s4 title="Class format namespace">
-<p><br/><em>To create an instance of an object</em>:
-<br/><code><ref>prefix</ref>:new (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix. A new instance is to be created with the <ref>args</ref> constructor arguments (if any). All constructor methods are qualified for method selection.
-<br/>Example: <code>&lt;xsl:variable name="myType"</code>
-<br/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-class:new()"&gt;</code></p>
-
-<p><em>To invoke an instance method on a specified object</em>:
-<br/><code><ref>prefix</ref>:<ref>methodName</ref> (<ref>object</ref>, <ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix and <ref>methodName</ref> is the name of the method to invoke on <ref>object</ref> with the <ref>args</ref> arguments. <ref>object</ref> must be an object of the class indicated by the namespace declaration.  Otherwise, the case shown immediately below will apply. Only instance methods with  the name <ref>methodName</ref> are qualified methods. If a matching method is found, <ref>object</ref> will be used to identify the object instance and <ref>args</ref> will be passed to the invoked method.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-class:valueOf($myType, string(@population))"&gt;</code></p>
-
-<p><em>To invoke an instance method on a default object</em>:
-<br/><code><ref>prefix</ref>:<ref>methodName</ref> (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix and <ref>methodName</ref> is the name of the method to invoke with the <ref>args</ref> arguments. The first <ref>arg</ref>, if any, must not be an object of the class indicated by the namespace declaration.  Otherwise, the case shown immediately above will apply. Only instance methods with the name <ref>methodName</ref> are qualified methods. If a matching method is found, a default instance of the class will be created if it does not already exist.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-class:valueOf(string(@population))"&gt;</code></p>
-
-<p><em>To invoke a static method</em>:
-<br/><code><ref>prefix</ref>:<ref>methodName</ref> (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix and <ref>methodName</ref> is the name of the method to invoke with the <ref>args</ref> arguments. Only static methods with the name <ref>methodName</ref> are qualified methods. If a matching method is found, <ref>args</ref> will be passed to the invoked static method.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-class:printit(string(@population))"&gt;</code></p>
-</s4>
-<s4 title="Package format namespace">
-<p><br/><em>To create an instance of an object</em>:
-<br/><code><ref>prefix</ref>:<ref>subpackage</ref>.<ref>class</ref>.new (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix, <ref>subpackage</ref> is the rest of the package name (the beginning of the package name was in the namespace declaration), and <ref>class</ref> is the name of the class. A new instance is to be created with the <ref>args</ref> constructor arguments (if any). All constructor methods are qualified for method selection.
-<br/>Example: <code>&lt;xsl:variable name="myType"</code>
-<br/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-package:extclass.new()"&gt;</code></p>
-
-<p><em>To invoke an instance method on a specified instance</em>:
-<br/><code><ref>prefix</ref>:<ref>methodName</ref> (<ref>object</ref>, <ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix and <ref>methodName</ref> is the name of the method to invoke on <ref>object</ref> with the <ref>args</ref> arguments. Only instance methods of the <ref>object</ref> with the name <ref>methodName</ref> are qualified methods. If a matching method is found, <ref>object</ref> will be used to identify the object instance and <ref>args</ref> will be passed to the invoked method.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-package:valueOf($myType, string(@population))"&gt;</code></p>
-
-<p><em>To invoke a static method</em>:
-<br/><code><ref>prefix</ref>:<ref>subpackage</ref>.<ref>class</ref>.<ref>methodName</ref> (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix, <ref>subpackage</ref> is the rest of the package name (the beginning of the package name was in the namespace declaration), <ref>class</ref> is the name of the class, and <ref>methodName</ref> is the name of the method to invoke with the <ref>args</ref> arguments. Only static methods with the name <ref>methodName</ref> are qualified methods. If a matching method is found, <ref>args</ref> will be passed to the invoked static method.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="my-package:extclass.printit(string(@population))"&gt;</code></p>
-<note>Unlike the class format namespace, there is no concept of a default object since the namespace declaration does not identify a unique class.</note>
-</s4>
-<s4 title="Java format namespace">
-<p><br/><em>To create an instance of an object</em>:
-<br/><code><ref>prefix</ref>:<ref>FQCN</ref>.new (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix for the Java namespace and <ref>FQCN</ref> is the fully qualified class name of the class whose constructor is to be called. A new instance is to be created with the <ref>args</ref> constructor arguments (if any). All constructor methods are qualified for method selection.
-<br/>Example: <code>&lt;xsl:variable name="myHash"</code>
-<br/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="java:java.util.Hashtable.new()"&gt;</code></p>
-
-<p><em>To invoke an instance method on a specified instance</em>:
-<br/><code><ref>prefix</ref>:<ref>methodName</ref> (<ref>object</ref>, <ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix and <ref>methodName</ref> is the name of the method to invoke on <ref>object</ref> with the <ref>args</ref> arguments. Only instance methods of the <ref>object</ref> with the name <ref>methodName</ref> are qualified methods. If a matching method is found, <ref>object</ref> will be used to identify the object instance and <ref>args</ref> will be passed to the invoked method.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="java:put($myHash, string(@region), $newpop)"&gt;</code></p>
-
-<p><em>To invoke a static method</em>:
-<br/><code><ref>prefix</ref>:<ref>FQCN</ref>.<ref>methodName</ref> (<ref>args</ref>)</code></p>
-<p>where <ref>prefix</ref> is the extension namespace prefix, <ref>FQCN</ref> is the fully qualified class name of the class whose static method is to be called, and <ref>methodName</ref> is the name of the method to invoke with the <ref>args</ref> arguments. Only static methods with the name <ref>methodName</ref> are qualified methods. If a matching method is found, <ref>args</ref> will be passed to the invoked static method.
-<br/>
-Example: <code>&lt;xsl:variable name="new-pop"</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select="java:java.lang.Integer.valueOf(string(@population))"&gt;</code></p>
-<note>Unlike the class format namespace, there is no concept of a default object since the namespace declaration does not identify a unique class.</note>
-</s4>
-</s3>
-
-<s3 title="Passing Nodes to java">
-<p>Please keep in mind that <em>all</em> LocationPath expressions return a node-set, even if the expression only returns a single attribute or a text node (node-sets with one member). You can use the XSLT string() function (as in the syntax examples above) to convert a node-set value to string, and the number() function to convert a node-set value to number (a double).</p>
-<p>If you want to pass a node-set to an extension function, set up a Java method to accept an 
-org.w3c.dom.NodeList (or an org.apache.xpath.NodeSet, which implements NodeList, if you want to modify the nodes).</p>
-<p>Suppose, for example, you have a myExtensions.ProcessNodes class with the following doSomething method:</p>
-<p><code>public static boolean doSomething(org.w3c.dom.NodeList nList)</code></p>
-<p>Assuming you set up this extension in the node-ext namespace, any of the following extension calls from a stylesheet are syntactically possible:</p>
-<p><code>&lt;!--Process the current node--&gt;</code><br/>
-<code>&lt;xsl:variable name="success" select="node-ext:MyExtensions.ProcessNodes.doSomething(.)"/&gt;</code></p>
-<p><code>&lt;!--Process all nodes in current context--></code><br/>
-<code>&lt;xsl:variable name="success" select="node-ext:MyExtensions.ProcessNodes.doSomething(*)"/&gt;</code></p>
-<p><code>&lt;!-- Process all nodes --></code><br/>
-<code>&lt;xsl:variable name="success" select="node-ext:MyExtensions.ProcessNodes.doSomething(/*)"/&gt;</code></p>
-<p><code>&lt;!--Process the foo/baz nodes in current context --></code><br/>
-<code>&lt;xsl:variable name="success" select="node-ext:MyExtensions.ProcessNodes.doSomething(foo/baz)"/&gt;</code></p>
-<p><code>&lt;!--Process the/foo/baz and /bar/saz nodes --></code><br/>
-<code>&lt;xsl:variable name="success" select="node-ext:MyExtensions.ProcessNodes.doSomething(/foo/baz | /bar/saz)"/&gt;</code></p>
-<p>The NodeList is in fact a list of references into the XML document, so keep in mind that getNextSibling(), for example, gets you the next sibling in the document, which may not be the next Node in the NodeList.</p>
-</s3>
-<s3 title="Implementing extension functions">
-<p>For each extension function in a namespace which is implemented in a language other than Java, the implementation must include a method with the following signature, or the scripting language equivalent:</p>
-<p><code>public <ref> object function</ref>(<ref>args</ref>)</code></p>
-<p>where <ref>object</ref> is the return type, <ref>function</ref> is the local part of the extension function name (the function name without the namespace prefix), and <ref>args</ref> correspond to the arguments in the function call.</p>
-<p>In addition, for extension functions implemented in Java, the implementation may include either a Java method with the signature shown above or one with the following signature:</p>
-<p><code>public <ref> object function</ref>(org.apache.xalan.extensions.ExpressionContext, <ref>args</ref>)</code></p>
-</s3>
-</s2><anchor name="java-namespace"/>
-<s2 title="Alternative: using the abbreviated syntax for extensions implemented in Java">
-<p>For extension functions and extension elements implemented in Java, Xalan permits an abbreviated syntax. When you use the abbreviated syntax, you do not use an lxslt:component to designate the functions.</p>
-<p>The abbreviated syntax supports the use of extension functions and extension elements implemented in Java. You cannot use this syntax with extensions implemented in JavaScript or another scripting language.</p>
-<anchor name="java-namespace-declare"/>
-<s3 title="Declare the namespace">
-<p>Declare the namespace for your extensions using one of the following three formats. The technique for invoking an extension for each format is explained in <link anchor="ext-func-calls">Extension function Java calls</link>.</p>
-<p><em>class format:</em> <code>xmlns:my-class="xalan://<ref>FQCN</ref>"</code></p>
-<p>where <ref>FQCN</ref> is the fully qualified class name.
-<br/>Examples: <code>xmlns:my-class="xalan://java.util.Hashtable"</code>
-<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>xmlns:my-class="xalan://mypackage.myclass"</code></p>
-<p><em>package format:</em> <code>xmlns:my-class="xalan://<ref>PJPN</ref>"</code></p>
-<p>where <ref>PJPN</ref> is a partial java package name.  That is, it is the beginning of or the complete name of a java package.
-<br/>Examples: <code>xmlns:my-package="xalan://java.util"</code>
-<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>xmlns:my-package="xalan://mypackage"</code></p>
-<p><em>Java format:</em> <code>xmlns:java="http://xml.apache.org/xslt/java"</code></p>
-<note>Although the namespace declarations for the class and package formats are shown with the xalan:// prefix, the current implementation for those formats will simply use the string to the right of the rightmost forward slash as the Java class name. This format, however, is the preferred format for extension namespace declarations.</note>
-<note>The class: prefix which was sometimes required in earlier versions of &xslt4j; is no longer required.</note>
-<note>These formats are also available when coding the src attribute of the lxslt:script element as explained in <link anchor="setup-script">Set up the lxslt:script element</link>.</note>
-</s3>
-<s3 title="Use the namespace when you make extension calls">
-<p>Use the declared prefix with the syntax described in <link anchor="ext-func-calls">Extension function Java calls</link>.</p>
-<p>That is all. You do not include an lxslt:component element. Using the abbreviated syntax clearly involves less setup than using the lxslt:component/lxslt:script approach.</p>
-<note>We recommend that, for extensions coded in Java, the abbreviated syntax should always be used since the lxslt:component/lxslt:script constructs add no functionality.</note>
-</s3><anchor name="ex-java-namespace"/> 
-<s3 title="Example: Formatting a date">
-<p>This example uses extension functions to call the SimpleDateFormat class and the IntDate class. IntDate uses String arguments to set up a Date object:</p>
-<source>import java.util.Date;
-import java.util.Calendar;
-
-public class IntDate
-{
-  public static Date getDate(String year, String month, String day)
-    {
-      // Date(int, int, int) has been deprecated, so use Calendar to
-      // set the year, month, and day.
-      Calendar c = Calendar.getInstance();
-      // Convert each argument to int.
-      c.set ( Integer.parseInt(year),
-              Integer.parseInt(month),
-              Integer.parseInt(day) );
-      return c.getTime();
-    }
-}</source>
-<p>The template transforms date elements with four attributes. For example, it transforms <code>&lt;date format="EEEE, MMM dd, yyyy" year="2000" month="4" day="27"/&gt;</code> into &lt;p&gt;Date: Thursday, April 27, 2000.&lt;/p&gt;.</p>
-<p>As you review this stylesheet, please keep the following in mind:</p>
- <ul>
-  <li>The exclude-result-prefixes stylesheet attribute prevents the java namespace declaration from
-   appearing in the output.</li>
-  <li>The XSLT type returned by any LocationPath expression is node-set, so the XSLT string
-    function is used to convert the format, year, month, and day attribute values from node-sets to
-    strings.</li>
-  <li>The format attribute provides a String argument for constructing a java.text.SimpleDateFormat
-    object.</li>
-    <li>The IntDate class uses String values provided by the year, month, and day attributes, to set the
-    date. XSLT can pass number values, but these are converted into doubles.</li>
-  <li>The formatter variable holds a SimpleDateFormat object, and the date variable holds a Date object.
-    XSLT does not understand either of these types, but they are used to call the SimpleDateFormat format
-     method. In that call, $formatter is the object, and $date is the argument. The syntax for calling
-     Java constructors and methods is described above in <link anchor="ext-func-calls">Extension function Java calls</link>.</li>    
- </ul><anchor name="format-date-stylesheet"/>   
-<source>&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="1.0"   
-    xmlns:java="http://xml.apache.org/xslt/java"
-    exclude-result-prefixes="java"&gt;
-    
-  &lt;!--Other templates for transforming the rest of
-                                            the XML source documents--&gt;
-  
-  &lt;xsl:template match="date"&gt; 
-    &lt;xsl:variable name="year" select="string(./@year)"/&gt;
-    &lt;xsl:variable name="month" select="string(./@month)"/&gt; 
-    &lt;xsl:variable name="day" select="string(./@day)"/&gt;          
-    &lt;xsl:variable name="format" select="string(./@format)"/&gt;
-
-    &lt;xsl:variable name="formatter"       
-        select="java:java.text.SimpleDateFormat.new($format)"/&gt;
-
-    &lt;xsl:variable name="date" 
-        select="java:IntDate.getDate($year, $month, $day)"/&gt;
-
-    &lt;p&gt;Date: &lt;xsl:value-of select="java:format($formatter, $date)"/&gt;&lt;/p&gt;
-  &lt;/xsl:template&gt;
-&lt;/xsl:stylesheet&gt;  
-</source>
-</s3>
-</s2>
-<s2 title="Examples: using Java and JavaScript to implement the same extension">
-<p>This section contains two examples. The first example uses a Java extension to transform a set of name elements  into an alphabetical and numbered list. The second example uses a JavaScript script to do the same. Both examples include equivalent extension elements and an extension function.</p>
-<anchor name="ex-java"/> 
-<s3 title="Java implementation">
-<p>MyCounter.java</p>
-<source>Import java.util.*;
-
-public class MyCounter {
-  Hashtable counters = new Hashtable ();
-
-  public MyCounter () 
-  {}
-
-  public void init
-             ( org.apache.xalan.extensions.XSLProcessorContext context,
-               org.apache.xalan.templates.ElemExtensionCall extElem ) 
-  {
-    String name = extElem.getAttribute("name");
-    String value = extElem.getAttribute("value");
-    int val;
-    try 
-    {
-      val = Integer.parseInt (value);
-    } 
-    catch (NumberFormatException e) 
-    {
-      e.printStackTrace ();
-      val = 0;
-    }
-    counters.put (name, new Integer (val));
-  }
-
-  public int read(String name) 
-  {
-    Integer cval = (Integer) counters.get (name);
-    return (cval == null) ? 0 : cval.intValue ();
-  }
-
-  public void incr
-             ( org.apache.xalan.extensions.XSLProcessorContext context,
-               org.apache.xalan.templates.ElemExtensionCall extElem) 
-  {
-    String name = extElem.getAttribute("name");
-    Integer cval = (Integer) counters.get(name);
-    int nval = (cval == null) ? 0 : (cval.intValue () + 1);
-    counters.put (name, new Integer (nval));
-  }
-}
-</source>
-<p>An XML source document:</p>
-<source>&lt;?xml version="1.0"?&gt;
-&lt;doc&gt;
-  &lt;name first="David" last="Marston"/&gt;
-  &lt;name first="David" last="Bertoni"/&gt;
-  &lt;name first="Donald" last="Leslie"/&gt;
-  &lt;name first="Emily" last="Farmer"/&gt;
-  &lt;name first="Jack" last="Donohue"/&gt;
-  &lt;name first="Myriam" last="Midy"/&gt;
-  &lt;name first="Paul" last="Dick"/&gt;
-  &lt;name first="Robert" last="Weir"/&gt;
-  &lt;name first="Scott" last="Boag"/&gt;
-  &lt;name first="Shane" last="Curcuru"/&gt;
-&lt;/doc&gt;</source>
-<p>The stylesheet:</p>
-<source>&lt;?xml version="1.0"?&gt; 
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:lxslt="http://xml.apache.org/xslt"
-                xmlns:counter="MyCounter"
-                extension-element-prefixes="counter"
-                version="1.0"&gt;
-
-  &lt;lxslt:component prefix="counter"
-                   elements="init incr" functions="read"&gt;
-    &lt;lxslt:script lang="javaclass" src="xalan://MyCounter"/&gt;
-  &lt;/lxslt:component&gt;
-
-  &lt;xsl:template match="/"&gt;
-    &lt;HTML&gt;
-      &lt;H1&gt;Names in alphabetical order&lt;/H1&gt;
-      &lt;counter:init name="index" value="1"/&gt;
-      &lt;xsl:for-each select="doc/name"&gt;
-        &lt;xsl:sort select="@last"/&gt;
-        &lt;xsl:sort select="@first"/&gt;
-        &lt;p&gt;
-        &lt;xsl:text&gt;[&lt;/xsl:text&gt;
-        &lt;xsl:value-of select="counter:read('index')"/&gt;
-        &lt;xsl:text&gt;]. &lt;/xsl:text&gt;
-        &lt;xsl:value-of select="@last"/&gt;
-        &lt;xsl:text&gt;, &lt;/xsl:text&gt;
-        &lt;xsl:value-of select="@first"/&gt;
-        &lt;/p&gt;
-        &lt;counter:incr name="index"/&gt;
-      &lt;/xsl:for-each&gt;
-    &lt;/HTML&gt;
-  &lt;/xsl:template&gt;
- 
-&lt;/xsl:stylesheet&gt;
-</source>
-<p>Transformation output:</p>
-<source>&lt;HTML&gt;
-&lt;H1&gt;Names in alphabetical order&lt;/H1&gt;
-&lt;p&gt;[1]. Bertoni, David&lt;/p&gt;
-&lt;p&gt;[2]. Boag, Scott&lt;/p&gt;
-&lt;p&gt;[3]. Curcuru, Shane&lt;/p&gt;
-&lt;p&gt;[4]. Dick, Paul&lt;/p&gt;
-&lt;p&gt;[5]. Donohue, Jack&lt;/p&gt;
-&lt;p&gt;[6]. Farmer, Emily&lt;/p&gt;
-&lt;p&gt;[7]. Leslie, Donald&lt;/p&gt;
-&lt;p&gt;[8]. Marston, David&lt;/p&gt;
-&lt;p&gt;[9]. Midy, Myriam&lt;/p&gt;
-&lt;p&gt;[10]. Weir, Robert&lt;/p&gt;
-&lt;/HTML&gt;</source>
-</s3><anchor name="ex-javascript"/> 
-<s3 title="JavaScript implementation">
-<p></p>
-<source>&lt;?xml version="1.0"?&gt; 
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:lxslt="http://xml.apache.org/xslt"
-                xmlns:counter="MyCounter"
-                extension-element-prefixes="counter"
-                version="1.0"&gt;
-
-  &lt;lxslt:component prefix="counter"
-                   elements="init incr" functions="read"&gt;
-    &lt;lxslt:script lang="javascript"&gt;
-      var counters = new Array();
-
-      function init (xslproc, elem) {
-        name = elem.getAttribute ("name");
-        value = parseInt(elem.getAttribute ("value"));
-        counters[name] = value;
-        return null;
-      }
-
-      function read (name) {
-        // Return a string.
-        return "" + (counters[name]);
-      }
-
-      function incr (xslproc, elem)
-      {
-        name = elem.getAttribute ("name");
-        counters[name]++;
-        return null;
-      }
-    &lt;/lxslt:script&gt;
-  &lt;/lxslt:component&gt;
-
-  &lt;xsl:template match="/"&gt;
-    &lt;HTML&gt;
-      &lt;H1&gt;Names in alphatebical order&lt;/H1&gt;
-      &lt;counter:init name="index" value="1"/&gt;
-      &lt;xsl:for-each select="doc/name"&gt;
-        &lt;xsl:sort select="@last"/&gt;
-        &lt;xsl:sort select="@first"/&gt;
-        &lt;p&gt;
-        &lt;xsl:text&gt;[&lt;/xsl:text&gt;
-        &lt;xsl:value-of select="counter:read('index')"/&gt;
-        &lt;xsl:text&gt;]. &lt;/xsl:text&gt;
-        &lt;xsl:value-of select="@last"/&gt;
-        &lt;xsl:text&gt;, &lt;/xsl:text&gt;
-        &lt;xsl:value-of select="@first"/&gt;
-        &lt;/p&gt;
-        &lt;counter:incr name="index"/&gt;
-      &lt;/xsl:for-each&gt;
-    &lt;/HTML&gt;
-  &lt;/xsl:template&gt;
- 
-&lt;/xsl:stylesheet&gt;
-</source>
-<p>This stylesheet produces the same output as the preceding example with the Java extension.</p>
-</s3>
-</s2>
-</s1>
diff --git a/xdocs/sources/xalan/extensionslib.xml b/xdocs/sources/xalan/extensionslib.xml
deleted file mode 100644
index 798bc44..0000000
--- a/xdocs/sources/xalan/extensionslib.xml
+++ /dev/null
@@ -1,489 +0,0 @@
-<?xml version="1.0" standalone="no"?> 
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="Extensions library">
-<ul>
-<li><link anchor="intro">Introduction</link></li>
-<li><link anchor="xalanns">Xalan namespace</link></li>
-<li><link anchor="redirect">Redirect</link></li>
-<li><link anchor="nodeset">nodeset</link></li>
-<li><link anchor="intersection">intersection</link></li>
-<li><link anchor="difference">difference</link></li>
-<li><link anchor="distinct">distinct</link></li>
-<li><link anchor="hassamenodes">hasSameNodes</link></li>
-<li><link anchor="sql">SQL library</link></li>
-<li><link anchor="pipedocument">PipeDocument</link></li>
-<li><link anchor="evaluate">evaluate</link></li>
-<li><link anchor="tokenize">tokenize</link></li>
-<li><link anchor="groupitem">group and item</link> <ref>(to be done)</ref></li>
-<li><link anchor="type">type</link> <ref>(to be done)</ref></li>
-<li><link anchor="todate">toDate</link> <ref>(to be done)</ref></li>
-<li><link anchor="formatdate">formatDate</link> <ref>(to be done)</ref></li>
-<li><link anchor="grep">grep</link> <ref>(to be done)</ref></li>
-<li><link anchor="foreachtoken">forEachToken</link> <ref>(to be done)</ref></li>
-<li>Examples: <link anchor="ex-redirect">Redirect</link>, <link anchor="ex-nodeset">nodeset</link>, <link anchor="ex-sql">SQL library</link></li>
-</ul><anchor name="intro"/>
-<s2 title= "Introduction">
-<p>Extension elements and functions provide a powerful mechanism
-for extending and simplifying what you can do with an XLST processor like
-Xalan. With input and contributions from the XML open-source developer community, we are working on placing the most useful
-extensions in an extensions library distributed with &xslt4j;. If you have ideas and/or contributions you would like to make, please email us at the <human-resource-ref idref="xalandev"/>.</p>
-</s2><anchor name="xalanns"/>
-<s2 title="Xalan namespace">
-<p>Where it makes sense, we are placing the new Xalan extensions in the org.apache.xalan.lib.Extensions class and we have defined a namespace for this class:</p>
-<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>http://xml.apache.org/xalan</code></p>
-<p>If you are calling &xslt4j;-supplied extensions, we recommend that you define this namespace in your stylesheet element, and call the extension using the namespace prefix that you have associated with that namespace. That way, if we later reorganize how the &xslt4j;-supplied extensions are stored, you won't have to modify your stylesheet.</p>
-<p>For an example that uses this namespace, see <link anchor="ex-nodeset">Example with the nodeset extension function</link>.</p>
-</s2><anchor name="redirect"/>
-<s2 title= "Redirect">
-<p>A standard XSL transformation involves an XSL stylesheet, an XML source tree, and the transformation result tree. The transformation sends the entire result to a single <jump href="apidocs/org/apache/trax/Result.html">org.apache.trax.Result</jump> object.</p> 
-<p>The Redirect extension 
-(<jump href="apidocs/org/apache/xalan/xslt/extensions/Redirect.html">org.apache.xalan.xslt.extensions.Redirect</jump>) supplies three extension elements that you can use to redirect portions of your transformation output to multiple files: &lt;open&gt;, &lt;write&gt;, and &lt;close&gt;. If you use the &lt;write&gt; element alone, the extension opens a file, writes to it, and closes the file immediately. If you want explicit control over the opening and closing of files, use &lt;write&gt; in conjunction with the &lt;open&gt; and &lt;close&gt; elements.</p>
-<p>Each of these elements includes a file attribute and/or a select attribute to designate the output file. The file attribute takes a string, so you can use it to directly specify the output file name. The select attribute takes an XPath expression, so you can use it to dynamically generate the output file name. If you include both attributes, the Redirect extension first evaluates the select attribute, and falls back to the file attribute if the select attribute expression does not return a valid file name.</p>
-<anchor name="ex-redirect"/> 
-<s3 title="Example with the Redirect extension">
-<p>Suppose you are outputting the bulk of your result tree to one file, but you want to output the transformation of all &lt;foo&gt; elements and their children to another file. The following example illustrates the basic structure of the XML source:</p>
-<source>&lt;?xml version="1.0"?&gt; 
-&lt;doc&gt;
-  &lt;foo file="foo.out"&gt;
-    Testing Redirect extension:
-      &lt;bar&gt;A foo subelement text node&lt;/bar&gt;
-  &lt;/foo&gt;
-  &lt;main&gt;
-    Everything else
-  &lt;/main&gt;  
-&lt;/doc&gt;</source>
-<p>This stylesheet redirects part of the output to a secondary file:</p>
-<source>
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="1.0"
-    xmlns:lxslt="http://xml.apache.org/xslt"
-    xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
-    extension-element-prefixes="redirect"&gt;
-
-  &lt;xsl:template match="/"&gt;
-    &lt;standard-out&gt;
-      Standard output:
-      &lt;xsl:apply-templates/&gt;
-    &lt;/standard-out&gt;
-  &lt;/xsl:template&gt;
-  
-  &lt;xsl:template match="main"&gt;
-    &lt;main&gt;
-      &lt;xsl:apply-templates/&gt;
-    &lt;/main&gt;
-  &lt;/xsl:template&gt;
-  
-  &lt;xsl:template match="/doc/foo"&gt;
-    &lt;redirect:write select="@file"&gt;
-      &lt;foo-out&gt;
-        &lt;xsl:apply-templates/&gt;
-      &lt;/foo-out&gt;
-    &lt;/redirect:write&gt;
-  &lt;/xsl:template&gt;
-  
-  &lt;xsl:template match="bar"&gt;
-    &lt;foobar-out&gt;
-      &lt;xsl:apply-templates/&gt;
-    &lt;/foobar-out&gt;
-  &lt;/xsl:template&gt;
-  
-&lt;/xsl:stylesheet&gt;</source>
-<p>The standard output is:</p>
-<source>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;standard-out&gt;
-  Standard output:
-  &lt;main&gt;
-    Everything else.
-  &lt;/main&gt;
-&lt;standard-out&gt;</source>
-<p>The output redirected to foo.out is:</p>
-<source>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;foo-out&gt;
-    Testing Redirect extension:
-    &lt;foobar-out&gt;foo subelement text node&lt;/foobar-out&gt;
-  &lt;/foo-out&gt;</source>
-<p>For more information on using the Redirect extension to send output to multiple files, examine the <link idref="samples" anchor="ext1">SimpleRedirect</link> sample and see the <jump href="apidocs/org/apache/xalan/lib/Redirect.html">Redirect</jump> class Javadoc.</p>  
-</s3></s2><anchor name="nodeset"/>
-<s2 title= "nodeset">
-<p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
-<code>nodeset (result-tree-fragment)</code>  casts a result tree fragment into a node-set.</p>
-<note>When you bind a variable to a template, rather than to the value generated by a select expression, the data type of the variable is result tree fragment. For more information, see <jump href="http://www.w3.org/TR/xslt#section-Result-Tree-Fragments">Result Tree Fragments</jump>.</note>
-<anchor name="ex-nodeset"/>
-<s3 title="Example with the nodeset extension function">
-<p>The following stylesheet uses the nodeset extension function to cast a result tree fragment into a node-set that can then be navigated in standard XPath manner. It uses the http://xml.apache.org/xalan namespace to provide access to the nodeset() method in xml.apache.xalan.lib.Extensions.</p>
-<source>&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-                   version="1.0"
-                   xmlns:xalan="http://xml.apache.org/xalan"
-                   exclude-result-prefixes="xalan"&gt;
-&lt;xsl:template match="/"&gt;
-  &lt;out&gt;
-	  &lt;xsl:variable name="rtf"&gt;
-      &lt;docelem&gt;
-        &lt;elem1&gt;
-          &lt;elem1a&gt;ELEMENT1A&lt;/elem1a&gt;
-          &lt;elem1b&gt;,ELEMENT1B&lt;/elem1b&gt;
-        &lt;/elem1&gt;
-        &lt;elem2&gt;
-          &lt;elem2a&gt;ELEMENT2A&lt;/elem2a&gt;
-        &lt;/elem2&gt;
-      &lt;/docelem&gt;
-    &lt;/xsl:variable&gt;     
-      &lt;xsl:for-each select="xalan:nodeset($rtf)/docelem//*"&gt;
-        &lt;xsl:value-of select="name(.)"/&gt;&lt;xsl:text&gt;,&lt;/xsl:text&gt;
-      &lt;/xsl:for-each>
-  &lt;/out>
-&lt;/xsl:template> 
-&lt;/xsl:stylesheet&gt;</source>
-<p>The output of running this stylesheet (with any XML input source) is a comma-delimited list of the element names in the node-set<br/>
-&nbsp;&nbsp;<code>&lt;out&gt;elem1,elem1a,elem1b,elem2,elem2a&lt;/out&gt;</code></p>
-<note>For illustration purposes, the preceding stylesheet pays no attention to the structure and content of the XML input document. Instead, it processes the template (in the stylesheet) bound to the variable named rtf.</note>
-
-</s3>
-</s2><anchor name="intersection"/>
-<s2 title="intersection">
-<p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
-<code>intersection (node-set1, node-set2)</code>  function returns a node-set with all nodes that are in ns1 and in ns2 .</p>
-</s2><anchor name="difference"/>
-<s2 title= "difference">
-<p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
-<code>difference(node-set1, node-set2)</code> returns a node-set with the nodes in node-set1 and not in node-set2.</p>
-</s2><anchor name="distinct"/>
-<s2 title= "distinct">
- <p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
- distinct (node-set) returns a node-set containing nodes with distinct string values. If more than one node in the node-set 
- contains the same text node value, distinct only returns the first of these nodes that it finds.</p>
-</s2><anchor name="hassamenodes"/>
-<s2 title= "hasSameNodes">
-<p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
-<code>hasSameNodes(node-set1, node-set2)</code> returns true if both node-set1 and node-set2 contain exactly the same set of nodes.</p>
-</s2><anchor name="sql"/>
-<s2 title= "SQL library">
-<note>For UML Diagrams of the SQL Library, see <jump href="http://xml.apache.org/xalan-j/Xalan-SQL-Extension/DiagramIndex.html">SQL Library UML Diagrams</jump>.</note>
-<ul>
-<li><link anchor="sqlconn">Setting up a connection</link></li>
-<li><link anchor="sqlparam">Parameterized queries</link></li>
-<li><link anchor="ex-sql">SQL library example</link></li>
-<li><link idref="samples" anchor="sql">SQL library sample applications</link></li>
-</ul>
-<p><em>**Experimental**</em> Provides extension functions for connecting to a JDBC data source, executing a query,
-and optionally working incrementally through a "streamable" result set. <ref>Due to a bug, caching, not streaming, is currently 
-the default mode of operation.</ref> </p>
-<note>Many features of the SQL library, including support for connection pools, parameterized queries, caching,  
-and added support for extracting connection information and query parameters from XML source documents exist
-thanks to John Gentilin (johnglinux@eyecatching.com), who has also added a number of SQL library samples.</note>
-<p><em>The SQL extension use in streaming mode of a single row-set node to incrementally return a query result set is experimental. If you use streaming mode, you can only access row elements one at a time moving forward through the result set. The use of XPath expressions in your stylesheet, for example, that attempt to return nodes from the result set in any other manner may produce unpredictable results.</em></p>
-<p><jump href="apidocs/org/apache/xalan/lib/sql/XConnection.html">org.apache.xalan.lib.sql.XConnection</jump> provides a number 
-of extension functions that you can use in your stylesheet.</p>
-    <ol>
-      <li>new() -- Use one of the XConnection constructors to connect to a data source, and return an XConnection
-       object. You can use one of the constructors creates a connection pool from which stylesheets can obtain connections 
-       to a datasource. To support connction pools, SQL library includes a ConnectionPool interface and a implementation:
-       DefaultConnectionPool. You can also provide your own ConnectionPool implementation.<br/><br/></li>
-      <li>query() -- Use the XConnection object query() method to return a "streamable" result set in the form of a row-set
-       node. Work your way through the row-set one row at a time. The same row element is used over and over again, so you can
-       begin "transforming" the row-set before the entire result set has been returned.<br/><br/></li>
-       <li>pquery(), addParameter(), addParameterFromElement(), clearParameters() -- Use the XConnection pquery() method in 
-       conjunction with these other methods to set up and execute parameterized queries.<br/><br/></li>
-       <li>Use disableCacheNodes() to use streaming node, and enableCacheNodes() to cache the query result set. <br/><br/></li>
-      <li>close() -- Use the XConnection object close() method to terminate the connection.</li>      
-    </ol>
-    <p>The query() and pquery() extension functions return a Document node that contains (as needed) an array of column-header elements, 
-    a single row element that is used repeatedly, and an array of col elements. Each column-header element (one per column in
-    the row-set) contains an attribute (ColumnAttribute) for each of the column descriptors in the ResultSetMetaData object. 
-    Each col element contains a text node with a textual representation of the value for that column in the current row.</p>
-    <anchor name="sqlconn"/>
-    <s3 title="Setting up a connection">
-    <p>You can place connection information (JDBC driver, datasource URL, and usually user ID and password) in stylesheets or
-     in XML source documents.</p> 
-     <p>The following stylesheet fragment uses stylesheet parameters to designate a JDBC driver and datasource. The default
-     parameter values can be overridden with runtime parameter values.</p>
-     <source>&lt;xsl:param name="driver" select="'org.enhydra.instantdb.jdbc.idbDriver'"/&gt;
-&lt;xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/&gt;
-&lt;xsl:param name="query" select="'SELECT * FROM import1'"/&gt;</source>
-      <p>You can also obtain connection information from the XML source document that you use for the transformationl. Suppose 
-      you have the following DBINFO nodeset in an XML document:</p>
-      <source>&lt;DBINFO&gt;
-  &lt;dbdriver&gt;org.enhydra.instantdb.jdbc.idbDriver&lt;/dbdriver&gt;
-  &lt;dburl&gt;jdbc:idb:../../instantdb/sample.prp&lt;/dburl&gt;
-  &lt;user&gt;jbloe&lt;/user&gt;
-  &lt;password&gt;geron07moe&lt;/password&gt;
-&lt;/DBINFO&gt;</source>
-       <p>In the stylesheet, you can extract this information as follows:</p>
-       <source>&lt;xsl:stylesheet version 1.0
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extension-element-prefixes="sql"&gt;
-&nbsp;&nbsp;&lt;xsl:param name="cinfo" select="//DBINFO"/&gt;
-&nbsp;&nbsp;&lt;xsl:variable name="db" select="sql:new($cinfo)"/&gt;
-....</source> 
-      <p>For an example of both approaches, see <link idref="samples" anchor="basic-conn">Basic Connection</link> samples.</p>
-      <p>You can also create a named connection pool that is maintained external to &xslt4j;.</p>
-      <source>import org.apache.xalan.lib.sql.DefaultConnectionPool;
-import org.apache.xalan.lib.sql.XConnectionPoolManager;
-...
-DefaultConnectionPool cp = new DefaultConnectionPool();
-cp.setDriver("org.enhydra.instantdb.jdbc.idbDriver");
-cp.setURL("jdbc:idb:../../instantdb/sample.prp");
-cp.setUser("jbloe");
-cp.setPassword("geron07moe");
-// Start with 10 connections.
-cp.setMinConnections(10);
-cp.enablePool();
-// Register the connection pool so stylesheets can use it.
-XConnectionPoolManager pm = new XConnectionPoolManager();
-pm.registerPool("extpool", cp);</source>
-      <p>A stylesheet can use this connection pool as follows:</p>
-      <source>&lt;xsl:stylesheet version 1.0
-     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-     xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-     extension-element-prefixes="sql"&gt;
-...
-  &lt;xsl:variable name="db" select="sql:new($driver, 'extpool')"/&gt;</source>
-      <p>For an example, see the <link idref="samples" anchor="ext-conn">ExternalConnection</link> sample.</p>
-    </s3><anchor name="sqlparam"/>
-    <s3 title="Parameterized queries">
-      <p>To define a parameterized query, use a SQL query string with a question mark (?) for each parameter. You can provide 
-      the parameter values at runtime with stylesheet parameters or with nodes in the XML source document. For each parameter, 
-      you should also designate the SQL data type.</p>
-      <p>XConnection provides a number of addParameter() methods and an addParameterFromElement() method that you can use 
-      as extension functions to pull in the parameter values (in the order the parameters appear in the query). To
-      execute the query and return the result set, call the pquery() method as an extension function. There are two variations 
-      of the pquery() method. The one you should ordinarily use includes as arguments the SQL query string and a string list 
-      (delimited by the space, tab, or line feeds) of parameter types. For example:</p>
-      <source>&lt;xsl:variable name="resultset" 
-        select=sql:pquery($XConnectionObj, 
-                          'select * from X where Y = ? and Z = ?',
-                          'int string')"/&gt;</source>
-      <p>For a complete example, see the <link idref="samples" anchor="pquery">Parameterized query</link> sample.</p>
-  </s3><anchor name="ex-sql"/> 
-    <s3 title="Example with SQL library">
-    <p>This example displays the result set from a table in a sample InstantDB database. It is also
-    available as a sample application; see <link idref="samples" anchor="ext6">6-sqllib-instantdb</link>.</p>
-<source>&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
-                extension-element-prefixes="sql"&gt;
-  &lt;xsl:output method="html" indent="yes"/&gt;
-  &lt;xsl:param name="query" select="'SELECT * FROM import1'"/&gt;
- 
-  &lt;xsl:template match="/"&gt;
-    &lt;!-- 1. Make the connection --&gt;
-    &lt;xsl:variable name="products"
-                  select="sql:new('org.enhydra.instantdb.jdbc.idbDriver',
-                                'jdbc:idb:.\instantdb\sample.prp')"/&gt;
-    &lt;HTML&gt;
-      &lt;HEAD&gt;
-      &lt;/HEAD&gt;
-      &lt;BODY&gt;
-        &lt;TABLE border="1"&gt;
-        &lt;!--2. Execute the query --&gt;
-        &lt;xsl:variable name="table" select='sql:query($products, $query)'/&gt;
-          &lt;TR&gt;
-          &lt;!-- Get column-label attribute from each column-header--&gt;
-          &lt;xsl:for-each select="$table/row-set/column-header"&gt;
-            &lt;TH&gt;&lt;xsl:value-of select="@column-label"/&gt;&lt;/TH&gt;
-          &lt;/xsl:for-each&gt;
-          &lt;/TR&gt;
-          &lt;xsl:apply-templates select="$table/row-set/row"/&gt;
-          &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
-        &lt;/TABLE&gt;
-      &lt;/BODY&gt;
-    &lt;/HTML&gt; 
-    &lt;!-- 3. Close the connection --&gt;
-    &lt;xsl:value-of select="sql:close($products)"/&gt;
-  &lt;/xsl:template&gt;
-
-  &lt;xsl:template match="row"&gt;
-        &lt;TR&gt;
-          &lt;xsl:apply-templates select="col"/&gt;
-        &lt;/TR&gt;
-  &lt;/xsl:template&gt;
-
-  &lt;xsl:template match="col"&gt;
-    &lt;TD&gt;
-      &lt;!-- Here is the column data -->
-      &lt;xsl:value-of select="text()"/>
-    &lt;/TD>
-  &lt;/xsl:template>
-
-&lt;/xsl:stylesheet&gt;
-</source>
-</s3>
-  
-  </s2><anchor name="pipedocument"/>
-  <s2 title="pipeDocument">
-  <p>Implemented in <jump href="apidocs/org/apache/xalan/lib/PipeDocument.html">org.apache.xalan.lib.PipeDocument</jump>,<br/>
-  the pipeDocument extension element pipes an XML document through a series of one or more transformations. The output of
-  each transformation is piped to the next transformation. The final transofrmation creates a target file.</p>
-  
-  <p>Suppose, for example,you have a stylesheet that is processing a "book" document with elements designating the 
-  documents to be transformed. This primary stylesheet generates a table of contents for the book. For each source 
-  document it uses a pipeDocument extension element to pipe the document through a series of one or more transformations.</p>
-  <s3 title="Sample: generating a table of contents and an HTML &quot;book&quot;">
-    <p>An XML "book" document contains a number of doc elements like the following:<br/>
-    <code>&lt;doc source="sources/intro.xml" id="intro" label="Introduction"&gt;</code></p>
-    <p>The source attribute identifies the document to be transformed, the id is the output file name, 
-    and the primary stylesheet places the label in the table-of-contents link.</p>
-    <p>The stylesheet declares the pipeDocument namespace, designates the namespace prefix as an extension element prefix,
-    and contains a parameter designating where the output files are to be placed:</p>
-  <source>&lt;xsl:stylesheet version="1.0"
-   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-   xmlns:pipe="xalan://PipeDocument"
-   extension-element-prefixes="pipe"&gt;
-   
-&lt;xsl:param  name="destdir" value="html/output"&gt;
-...</source>
-<p>This stylesheet contains a template where each doc element is processed. For each doc element, the stylesheet adds an 
-entry to the table-of-contents document. The extension element pipes the specified document through a series of two 
-transformations, with an stylesheet input parameter for the first transformation. The pipeDocument target attribute 
-designates the output from the second transformation.</p>
-
-<source>&lt;xsl:template match="doc"&gt;
-  &lt;p&gt;
-    &lt;a href={$destdir}&gt;&lt;xsl:value-of select="@label"/&gt;&lt;a&gt;
-  &lt;/p&gt;
-
-  &lt;pipe:pipeDocument   source="{@source}" target="{$destdir/@id}"&gt;
-    &lt;stylesheet href="ss1.xsl"&gt;
-      &lt;param name="doc-id" value="@id"/&gt;
-    &lt;/stylesheet&gt;
-    &lt;stylesheet href="ss2.xsl"/&gt;   
-  &lt;/pipe:pipeDocument&gt;
-  
-&lt;/xsl:template&gt;</source>
- 
-   <p>Notes:</p>
-   <ul>
-   <li>The base URI for the source attribute is the XML "book" document.</li>
-   <li>The target attribute is taken as is (the base is the current user directory from which this transformation is being run).</li>
-   <li>The stylsheet containg the extension element is the base URI for the stylesheet hrefs.</li>
-   </ul>
-</s3>
-<s3 title="Variation: using pipeDocument in an empty stylesheet">
-<p>Suppose you want to pipe a document through a series of transformations. You can use the pipeDocument extension element
-to perform this operation by placing the extension element in an otherwise empty stylesheet.</p>
-<p>The following stylesheet is used to merge the Xalan documents into a book (the first transformation), and transform the book
-into a tree of formatting objects, which can then be used to generate a PDF file. This transformation is invoked as follows:</p>
-<p><code>java org.apache.xalan.xslt.Process -in printbook.xml</code><br/>
-<code> -param source printbook.xml</code><br/>
-<code> -param target xalanbook.fo</code></p>
-<p>There is no XML input document or output document for the primary transformation, which does no more than invoke
-the extension element.</p>
-<source>&lt;?xml version='1.0'?&gt;
-
-&lt;xsl:stylesheet version="1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:pipe="xalan://org.apache.xalan.lib.PipeDocument"
-                extension-element-prefixes="pipe"&gt;
-
-&lt;xsl:param name="source"/&gt;
-&lt;xsl:param name="target"/&gt;
-
-&lt;xsl:template match="/"&gt;
-
-  &lt;pipe:pipeDocument 
-        source="{$source}"
-        target="{$target}"&gt;
-    &lt;stylesheet href="printbook_assemble.xsl"/&gt;
-    &lt;stylesheet href="bkbook8x11_xalan.xsl"/&gt;
-  &lt;/pipe:pipeDocument&gt;
-  
-&lt;/xsl:template&gt;
-
-&lt;/xsl:stylesheet&gt;</source>
-
-</s3>  
-  </s2><anchor name="evaluate"/>
-  <s2 title= "evaluate">
-  <p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
-<code>evaluate (xpath-expression)</code> function returns the result of evaluating the xpath-expression in the current 
-XPath expression context (automatically passed in by the extension mechanism).</p>
-<p>Use the evaluation extension function when the value of the expression is not known until run time.</p>
-</s2><anchor name="tokenize"/>
-<s2 title="tokenize">
-<p>Implemented in <jump href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
-<code>tokenize (tokenize-string, delimiters)</code><br/>
-or<br/>
-<code>tokenize (tokenize-string)</code> function returns a node-set containing one text node for each token in the tokenize-string.</p>
-<p>The delimiters determine which characters are used to divide the tokenize-string into individual tokens. If you do not include
-the delimiters argument, the function uses tab (&amp;#x09), linefeed (&amp;#x0A), return (&amp;#x0D), and space (&amp;#x20) as delimiters.
-If tokenize-string is an empty string or contains only delimiters, the result is an empty node-set.</p>
-</s2><anchor name="groupitem"/>
-<s2 title= "group and item">
-<p><em>To be done.</em> Provides efficient grouping of items with a common value.</p>
-</s2><anchor name="type"/>
-<s2 title= "type">
-<p><em>To be done.</em> Returns a string that represents the Schema or DTD type.</p>
-</s2><anchor name="todate"/>
-<s2 title="to-date">
-<p><em>To be done.</em> Takes a string as input, and returns a long value representing the date.</p>
-</s2><anchor name="formatdate"/>
-<s2 title="format-date">
-<p><em>To be done.</em> Takes a date string, and formats it according to a specification.</p>
-</s2><anchor name="grep"/>
-<s2 title="grep">
-<p><em>To be done.</em> Performs a grep function and returns the substring.</p>
-</s2><anchor name="foreachtoken"/>
-<s2 title="for-each-token">
-<p><em>To be done.</em> Tokenizes a string, treats each token as a DOM Text node, and executes the
-sub-template.</p>
-</s2>
-</s1>
diff --git a/xdocs/sources/xalan/faq.xml b/xdocs/sources/xalan/faq.xml
deleted file mode 100644
index 729b9c1..0000000
--- a/xdocs/sources/xalan/faq.xml
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" standalone="no"?> 
-<!DOCTYPE faqs SYSTEM "../../style/dtd/faqs.dtd">
-
-<faqs title="Frequently asked questions">
-
-  <faq title="Where do I go to learn about XSLT">  
-    <q>Where do I go to learn about XSLT?</q>    
-    <a><p>The definitive sources are the W3C XSLT and XPath recommendations: <resource-ref idref="xslt"/> and 
-    <resource-ref idref="xpath"/>.</p>
-    <p>For a brief listing of tutorials, discussion forums, and other materials, see <link idref="overview"
-     anchor="uptospeed">Getting up to speed with XSLT</link>.</p></a>
-  </faq>
-
-  <faq title="Which version of Xerces should I be using?">  
-    <q>Which version of Xerces should I be using?</q>    
-    <a><p>&xslt4j-current; has been tested with &xml4j-used;. See <link idref="readme" anchor="status">Status</link>.</p></a>
-  </faq>
-  
-  <faq title="Compatibility with &xslt4j; version 1">
-   <q>How do I run applications that use the &xslt4j; version 1 API with &xslt4j2;</q>
-   <a><p>Use the Xalan-Java 1 compatibility JAR to recompile and run your &xslt4j; 1 applications with &xslt4j2;. For more information, see 
-   <link idref="usagepatterns" anchor="compat">Using the &xslt4j; version 1 API</link>.</p></a>
-  </faq>
-    
-  <faq title="TrAX and JAXP">
-    <q>What are TrAX and JAXP, and are they related?</q>
-    <a><p>TrAX is the Transformation API for XML. In November 2000, TrAX was revised and incorporated into JAXP, the JAVA API for XML
-    Processing. JAXP (including TrAX) provides users a standard, vendor-neutral API for working with (and transforming) XML documents. 
-    You can use this API to build applications that are not bound to the particular implementation details of a given XML parser or XSL
-    transformer.</p>
-    <p>&xslt4j; includes the JAXP packages, implements the TrAX portion of that API (javax.xml.transform....), and includes xerces.jar from
-    &xml4j;, which implements the parser portion of the API (javax.xml.parser....).</p>
-<p>For more information, see <link idref="trax">TRaX (Transformation API for XML)</link> and <resource-ref idref="jaxp11"/>.</p></a>
-  </faq>
-  <faq title="Chaining transformations">  
-    <q>How do you chain together a series of transformations?"</q>
-    
-    <a><p>&xslt4j; supports two strategies for chaining together a series of transformations such that the output of each 
-    transformation provides input for the next transformation.</p>
-    <ul>
-      <li>For each transformation in the series, you can set one SAX ContentHandler to process the input, and another ContenHandler to process
-       the output.<br/><br/></li>
-      <li>You can also set up a series of parent-child relationships between an XMLReader and one or more XMLFilters.</li> 
-    </ul>
-    <p>For the details and links to examples, see <link idref="usagepatterns" anchor="outasin">Using transformation output as input for 
-    another transformation</link>.<anchor name="jdk13"/></p></a>
-  </faq>
-  
-  <faq title="Issues running Xalan on JDK 1.3">
-  <q>I'm having a problem building or running &xslt4j; on the JDK 1.3.</q>
-  <a><p>The JDK 1.3 automatically places everything in the lib/ext directory in front of everything you place on the classpath. If this directory contains a version of DOM, JAXP, or Xerces that predates the &xslt4j; distribution you are using, you may have problems!</p> 
-<p>The IBM JDK 1.3 includes an earlier version of xerces.jar in the lib/ext directory, a version that does not implement the JAXP 1.1 interfaces and therefore does not work with the current Xalan release. Accordingly, you must either purge the xerces.jar that is in that directory or overwrite it with the xerces.jar that is included with the Xalan distribution.</p>
-<p>The SUN JDK 1.3 includes a pre-1.1 version of the JAXP in crimson.jar. Either purge the crimson.jar in that directory or overwrite it with a newer crimson.jar that includes and implements the JAXP 1.1 interfaces.</p></a>  
-  </faq>
-  <faq title="a &quot;DOM006 Hierarchy request error&quot;">
-  <q>Why do I get a "DOM006 Hierarchy request error" when I try to transform into a DOM Document node?</q>
-  <a>
-  <p>This error occurs when Xalan tries to add a Node to a Document node where it isn't allowed. For example, attempting to add non-whitespace
-  text to the DOM Document node produces this error.</p>
-   <p>The error can also occur when a Document node is created with the DOMImplementation createDocument() method, which takes a qualified name
-    as an argument and creates an element node.  If you then pass the returned Document node to Xalan, you get a "DOM006 Hierarchy request
-    error" when Xalan tries to add a second element to the Document node. The solution is to either use the DocumentBuilder newDocument() method
-    to create a Document that does not contain an element node, or use a DocumentFragment. It should be noted that the 
-    DocumentBuilder newDocument() method is "Non-preferred" according to the JAXP 1.1 documentation.</p>
-  </a>
-  </faq>
-  
-  <faq title="Speeding up transformations">
-  
-    <q>What can I do to speed up transformations?</q>
-    
-    <a><p>In the ongoing development of &xslt4j;, enhancing performance is the primary goal of the &xslt4j; team.
-    Here are some preliminary suggestions for you to keep in mind as you set up your applications:</p><ul>
-    <li>Use a Templates object (with a different Transformers for each transformation) to perform multiple transformations with the same 
-    set of stylesheet instructions (see <link idref="usagepatterns" anchor="multithreading">Multithreading</link>).<br/><br/></li>         
-    <li>Set up your stylesheets to function efficiently.<br/><br/></li>
-       <ul>
-         <li>Don't use "//" (descendant axes) patterns near the root of a large document.<br/><br/></li>
-         <li>Use xsl:key elements and the key() function as an efficient way to retrieve node sets.<br/><br/></li>
-         <li>Where possible, use pattern matching rather than xsl:if or xsl:when statements.<br/><br/></li>
-         <li>xsl:for-each is fast because it does not require pattern matching.<br/><br/></li>
-         <li>Keep in mind that xsl:sort prevents incremental processing.<br/><br/></li>
-         <li>When you create variables, &lt;xsl:variable name="fooElem" select="foo"/&gt; is usually faster than
-         &gt;xsl:variable name="fooElem"&gt;&lt;xsl:value-of-select="foo"/&gt;&lt;/xsl:variable&gt;.<br/><br/></li>
-         <li>Be careful using the last() function.<br/><br/></li>
-         <li>The use of index predicates within match patterns can be expensive.<br/><br/></li>
-         <li>Decoding and encoding is expensive.<br/><br/></li>
-       </ul>
-     <li>For the ultimate in server-side scalability, perform transform operations on the client. For examples, see 
-     <link idref="samples" anchor="appletxmltohtml">appletXMLtoHTML</link> and <link idref="samples"
-     anchor="get-todo-list">get-todo-list</link>.</li>
-    </ul></a>
-  </faq>
-
-  <faq title="NoClassDefFound errors">
-  
-    <q>I'm getting a NoClassDefFound error. What has to be on the classpath?</q>
-    
-    <a><ol>
-    <li>xalan.jar and xerces.jar (or the XML parser you are using) must always be on the classpath.<br/><br/></li>
-    <li>To run the samples in the samples subdirectories, xalansamples.jar must be on the classpath. To run the servlet (in
-    samples/servlet), xalanservlet.jar must be on the classpath along with the javax.servlet and javax.servlet.http packages. Sun distributes
-    the javax.servlet packages in the JSWDK servlet.jar file.<br/><br/></li>
-    <li>To run extensions (including the samples in samples/extensions), bsf.jar, and bsfengines.jar must be on the 
-    classpath. To run extensions implemented in JavaScript, js.jar must also be on the classpath. For information on what 
-    you need to run extensions implemented in other scripting languages, see <link idref="extensions"
-    anchor="supported-lang">Supported languages</link>.<br/><br/></li>
-    <li>To run applications that use the &xslt4j; version 1 API, you must put xalanj1compat.jar on the classpath, recompile the application,
-    and be sure xalanj1compat.jar is on the classpath at run time (see <link idref="usagepatterns" anchor="compat">Using the &xslt4j; version 1
-    API)</link>.</li>
-    </ol>
-    <p>For more information, see <link idref="getstarted" anchor="classpath">Setting up the system classpath</link>.</p>
-    <p><anchor name="environmentcheck"/><em>Using the EnvironmentCheck utility:</em> To help diagnose classpath problems, try running Xalan's environment checking utility, checked in at 
-    xml-xalan/java/src/org/apache/xalan/xslt/EnvironmentCheck.</p>
-    <p>You can run this utility from the command line as follows:</p>
-    <p><code>java org.apache.xalan.xslt.EnvironmentCheck [-out outFile]</code></p>
-    <p>You can also call this utility from within your application. For example,</p>
-    <p><code>boolean environmentOK = (new EnvironmentCheck()).checkEnvironment (yourPrintWriter);</code></p>
-    <p>Be sure to run EnvironmentCheck in the environment where you are experiencing the problem. For example, if you get a 
-    NoClassDefFound error from a command-line application, run EnvironmentCheck on the command line with exactly the same 
-    classpath. If the error occurs inside your Java application (or in a servlet, etc.), be sure to call the 
-    EnvironmentCheck checkEnvironment(...) method from within your running application.</p>
-    </a>
-   </faq>
- 
-	<faq title="Stylesheet validation">
-		<q>How do I validate an XSL stylesheet?</q>
-		<a>
-      <p>An XSL stylesheet is an XML document, so it can have a DOCTYPE and be subject to validation, right? </p>
-      <p>The XSLT Recommendation includes a <jump href="http://www.w3.org/TR/xslt#dtd">DTD Fragment 
-      for XSL Stylesheets</jump> with some indications of what you need to do to create a complete DTD for a given
-      stylesheet. Keep in mind that stylesheets can include literal result elements and produce output that is not valid
-      XML.</p>
-      <p>You can use the xsl:stylesheet doctype defined in xsl-html40s.dtd for stylesheets that generate HTML.</p>
-		</a>
-	</faq>
-    
-    <faq title="Retrieving nodes in the default namespace">
-     <q>XPath isn't retrieving nodes that are in the default namespace I defined. How do I get them?</q>
-     <a><p>If you are looking for nodes in a namespace, the XPath expression must include a namespace prefix that you have mapped to the
-       namespace with an xmlns declaration. If you have declared a default namespace, it does not have a prefix (see 
-       <jump href="http://www.w3.org/TR/xpath.html#node-tests">XPath Node Tests</jump>). In order to construct XPath expressions 
-       to retrieve nodes from this namespace, you must add a namespace declaration that provides a prefix you can include in the XPath
-        expressions.</p>
-       <p>Suppose, for example, you you want to locate nodes in a default namespace declared as follows:<br/>
-       <code>xmlns="http://my-namespace"</code></p>
-       <p>Add a nampespace declaration with a prefix:<br/>
-       <code>xmlns:foo="http://my-namespace"</code></p>       
-       <p>Then you can use foo: in your XPath expression.</p>
-       <p>Hint: Don't use default namespaces, and the problem doesn't arise.</p></a>
-    </faq>
-       
-    <faq title="Using the 'signature' file to verify a download">
-      <q>How do I use the "signature" file to verify my download?</q>
-      <a>
-        <p>For each Xalan download file in <resource-ref idref="xslt4j-distdir"/>, there is a corresponding signature file. 
-        The signature file for xalan-j_2_0_1.tar.gz, for example, is xalan-j_2_0_1.tar.gz.sig.</p>
-        <p>The .sig files are PGP signatures of the actual .zip or .tar.gz
-        download files.  You can use these files to verify the authenticiy of the download. You do not need the .sig file to 
-        use the corresponding donwload file.</p>
-        <p>To check the authenticity of a Xalan distribution, you need a copy of
-        PGP which is available in a number of licenses, including some free
-        non-commercial licenses, either from an mit.edu site or on
-        the pgp.com site. Once you have a version of PGP installed, you
-        should be able to 'verify the signature' of the .sig file, which basically verifies that the corresponding 
-        .zip or tar.gz file has not been changed since we signed it.</p>
-      </a>
-    </faq>
-    <faq title="Setting output encoding">
-    <q>Why is the output character encoding I set in the stylesheet not being used?</q>
-    <a>
-    <p>If you use a character output stream to instantiate the 
-    <jump href="apidocs/javax/xml/transform/stream/StreamResult.html">StreamResult</jump> object which holds the 
-    transformation output, the Writer uses its own encoding, not the encoding you specify
-    in the stylesheet.</p>
-    <p>If you want to use the stylesheet output encoding, do not use StreamResult(java.io.Writer) to
-    instantiate the holder for the output. Alternatively, you can specify the encoding when you create a Writer 
-    (java.io.OutputStreamWriter). Once the Writer exists, you cannot change its encoding.</p>
-    </a>
-    </faq>
-    <faq title="Servlet unable to find classes for extension functions/elements">
-    <q>My servlet cannot find classes that implement extension functions or elements. What can I do?</q>
-    <a>
-    <p>If you install xalan.jar in the servlet engine's lib directory (e.g., tomcat/lib), as opposed to the servlet's 
-    lib directory, then the Xalan classes are loaded by a classloader that does not see the classes in the servlet's
-    classloader (i.e., the extension classes, if you placed them there). The Xalan classes try to load the extension 
-    classes using their own classloader, and that attempt fails.</p>
-    <p>Workaround: place xalan.jar in the servlet's lib directory and NOT in the servlet engine's lib directory. 
-    Another workaround is to place the extension classes also in the servlet engine's lib directory, but you
-    generally want to avoid cluttering that directory.</p>
-    <p>Thanks to Gunnlauger Thor Briem (gthb@dimon.is) for providing this information. </p>
-    </a>
-  </faq>
-  <faq title="Namespace not supported by SAXParser">
-  <q>Why am I getting a "Namespace not supported by SAXParser exception?</q>
-  <a>
-  <p>We have seen this probem arise for two quite different reasons:</p>
-  <ul>
-  <li>SAX1 interfaces are on your classpath in front of the SAX2 interfaces provided with your XML
-  parser.<br/><br/>
-  or<br/><br/></li>
-  <li>The parser you are using to process a stylesheet Source and generate a Transformer does not have the 
-  namespaceAware property set to true.</li>
-  </ul>
-  <p><em>SAX1 on the classpath</em></p>
-  <p>SAX1 should not be on your classpath. The SAX1 interfaces and implementations of the SAX1 SAXPparser
-  are not namespace aware.</p>
-  <p>To help diagnose your classpath, you can use the <link anchor="environmentcheck">EnvironmentCheck
-  utility</link>. If you are running under JDK 1.3, see <link anchor="jdk13">Issues running Xalan on JDK
-  1.3</link>. If you are running a servlet, make sure the servlet engine is not placing SAX1 on the
-  classpath.</p>
-  <p><em>Setting the parser to be namespace aware</em></p>
-  <p>When you create a Transformer, you must use a namespace-aware parser to parse the stylesheet.</p>
-  <p>If you use a TransformerFactory to process a stylesheet Source and generate a Transformer, the
-  TransformerFactory instructs the  SAXParserFactory to set the parser's namespaceAware property to true.
-  But if you call the parser directly, you may need to set the namespaceAware property yourself. For
-  example:</p>
-<source>javax.xml.parsers.SAXParserFactory spFactory =
-  javax.xml.parsers.SAXParserFactory.newInstance();
-spFactory.setNamespaceAware(true);</source>
-<note>For more information about setting the namespaceAware property, and SAX2 vs. JAXP default settings, see <jump href="http://xml.apache.org/~edwingo/jaxp-faq.html#nsDefaults">JAXP FAQ: Warning about namespace processing defaults</jump>.</note>
-</a>
-</faq>
-</faqs>
diff --git a/xdocs/sources/xalan/getstarted.xml b/xdocs/sources/xalan/getstarted.xml
deleted file mode 100644
index 96495a5..0000000
--- a/xdocs/sources/xalan/getstarted.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" standalone="no"?>  
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-
-<s1 title="Getting Started">
-<ul>
-<li><link anchor="download">Downloading what you need</link></li>
-<li><link anchor="classpath">Setting up the system classpath</link></li>
-<li><link anchor="samples">Trying out the samples</link></li>
-<li><link anchor="commandline">Performing your own transformations from the command line</link></li>
-<li><link anchor="java-apps">Setting up your own XSLT applications</link></li>
-</ul>
-<anchor name="download"/>
-<s2 title="Downloading what you need">
-<p>To use Xalan, you need the following:</p>
-<ul>
-<li>The JDK or JRE 1.1.8, 1.2.2, or 1.3</li>
-<li>xalan.jar</li>
-<li>xerces.jar (or another <link idref="usagepatterns" anchor="plug">XML Parser</link>)</li>
-</ul>
-<p>You can get the JDK or JRE from <jump href="http://www.ibm.com/java/jdk">ibm.com/java/jdk/</jump> or <jump href="http://www.java.sun.com">java.sun.com</jump>.</p> 
-<p>Download <resource-ref idref="xslt4j-dist-zip"/> or <resource-ref idref="xslt4j-dist-targz"/>. Both of these files contain <resource-ref idref="xslt4j-current"/> (with xalan.jar) and xerces.jar from <resource-ref idref="xml4j-used"/>. You can use a zip or tar utility to expand these files into a full build.</p>
-
-<p>If you plan to run <link idref="extensions">XSLT extensions</link>, you need bsf.jar, which is included in the &xslt4j; distribution. If you plan to run XSLT extensions implemented in Javascript or another scripting language, you will need one or more additional files as indicated in <link idref="extensions" anchor="supported-lang">extensions language requirements</link>.</p>
-</s2><anchor name="classpath"/>
-<s2 title="Setting up the system classpath">
-<p>At the very minimum, you must include xalan.jar and xerces.jar (or another conformant XML parser -- see <link idref="usagepatterns" anchor="plug">Plugging in a Transformer and XML parser</link>) on the system classpath. To run the sample applications, include xalansamples.jar (all samples other than the servlet) and xalanservlet.jar. To run extensions, include bsf.jar. All these JAR files are distributed with &xslt4j;. For extensions implemented in JavaScript or another scripting language, see <link idref="extensions" anchor="supported-lang">extensions language requirements</link> to identify any additional JAR files you must place on the classpath and where you can get them.</p>
-<p>If you are using JDK or JRE 1.1.8, also include classes.zip on the classpath. If you are using JDK or JRE 1.2, include tools.jar on the classpath.</p>
-<note>If you are running Xalan on a 1.1.8 platform or recompiling Xalan on any platform, be sure to put xalan.jar in front of xerces.jar on the classpath. Both JAR files include the org.w3c.dom packages. Xerces has added a number of DOM level-3 methods. These are not yet part of the W3C DOM recommendation, and Xalan does not support these methods.</note>
-</s2><anchor name="samples"/>
-<s2 title="Trying out the samples">
-<p>The &xslt4j; distribution includes a number of basic sample applications. These samples are easy to run, and you can review the source files -- all of which are brief -- to see just how they work.</p>
-<p>To run the samples, do the following:</p>
-<ol>
-<li>Set up your classpath (see above), including xalansamples.jar and (for the servlet) xalanservlet.jar.</li>
-<li>Be sure the java executable is on your path.</li>
-<li>Go to the samples subdirectory containing the sample (use the DOS shell if you are running Windows).</li>
-<li>Use the java executable to run the sample from the command line.</li>
-<li>Examine the application source and result files.</li>
-</ol>
-<p>For example, go to the SimpleTransform subdirectory and issue the following command:</p>
-<p><code>java SimpleTransform</code></p>
-<p>The sample writes the transformation result  to a file (birds.out). To see how the example works, examine the source files: birds.xml, birds.xsl, and SimpleTransform.java.</p>
-<p>The extensions examples require additional JAR files on the classpath, and the procedure for running the sample applet and sample servlet is different. For more information about all the samples, see <link idref="samples">&xslt4j; Samples</link>.</p>
-</s2><anchor name="commandline"/>
-<s2 title="Performing your own transformations from the command line">
-<p>java.org.apache.xalan.xslt.Process provides a basic utility for performing transformations from the command line. You use this utility, for example, to run several of the extensions samples. The command line for most standard transformations is as follows:</p>
-<p><code>java org.apache.xalan.xslt.Process -in <ref>xmlSource</ref></code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;-xsl <ref>stylesheet</ref> -out <ref>outputfile</ref></code></p>
-<p>where <ref>xmlSource</ref> is the XML source file name, <ref>stylesheet</ref> is the XSL stylesheet file name, and <ref>outputfile</ref> is the output file name.</p>
-<p>If you want the output to be displayed on the screen, simply omit the -out flag and argument.</p>
-<p>You can use this utility to try out XSL stylesheets you have written, to make sure they do what you expect with the XML source files they are designed to transform. The utility provides useful messages if the source file or stylesheet is not well formed. For more information, see <link idref="commandline">Command-Line Utility</link>.</p>
-</s2><anchor name="java-apps"/>
-<s2 title="Setting up your own Java applications">
-<p>You can start by using your own XML source files and XSL stylesheets with the sample applications, which illustrate a number of the <link idref="usagepatterns">basic usage patterns</link>.</p>
-<p>Here is the basic TRaX procedure to keep in mind when you set up a transformation:</p>
-<ol>
-<li>Use the <jump href="apidocs/javax/xml/transform/TransformerFactory.html">TransformerFactory</jump> static newInstance() method to instantiate a TransformerFactory.<br/><br/></li>
-<li>Use the TransformerFactory newTransformer(Source stylesheet) method to process the transformation instructions in an XSLT stylesheet Source (producing under the covers a <jump href="apidocs/javax/xml/transform/Templates.html">Templates</jump> object) and generate a <jump href="apidocs/javax/xml/transform/Transformer.html">Transformer</jump>.<br/><br/></li>
-<li>Use the Transformer transform(Source xmlSource, Result transformResult) method to apply the transformation instructions (the Templates object) to the XML Source and produce the transformation Result.<br/><br/></li>
-</ol>
-<p>For more information about this procedure and its variations, see <link idref="usagepatterns">Basic Usage Patterns</link>.</p>
-</s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/history.xml b/xdocs/sources/xalan/history.xml
deleted file mode 100644
index 4196721..0000000
--- a/xdocs/sources/xalan/history.xml
+++ /dev/null
@@ -1,1407 +0,0 @@
-<s3 title="Changes for &xslt4j; 2.2.D9">
-<p> Core (Non-XSLTC) source code updates:</p>
-<ul><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTInfo.properties<br/><ref>Committer's log entry: </ref>2.2.D8<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>2.2.D8<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer NodeSortKey.java<br/><ref>Committer's log entry: </ref>Submitted fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2851.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Just added some stuff to diagnose bugs for flavor th.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes WalkerFactory.java
- java/src/org/apache/xpath/compiler Compiler.java
- java/src/org/apache/xpath/patterns
- ContextMatchStepPattern.java StepPattern.java<br/><ref>Committer's log entry: </ref>These are changes submitted (offline) by Mukund Raghavachari/Watson/IBM@IBMUS.
-
- This fixes a bug with match="chapter//footnote[1]" patterns.
-
- The main change here is minor to remove the automatic attachment of parent::* 
-to simple step patterns.
-
- He has re-implemented executePredicates to be
- more efficient. Given a pattern such as row[6], it
- does not iterate over the entire axis until it reaches
- the node to see if it is the sixth node. Rather,
- starting from the current node, it works backwards
- (preceding siblings) until it either runs out of nodes
- or finds more than six nodes that match the
- predicate [I can explain it better if desired].
- This optimization improves performance slightly
- overall. It helps decoy and patterns most (by
- about 10%).
-
- The other optimization that I implemented was the
- following. For a pattern foo[][3][][4] ..., where more
- than one predicate is a number (position check),
- in checking the predicate [4], the fact that the
- current node has passed foo[][3] implies that it is
- the only node that is the third node among its
- siblings that passes foo[]. Therefore, any
- subsequent position checks can be true if and
- only if the position is [1]. This optimization is not
- used by the xsltmark benchmarks and so does
- not offer any performance benefits.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes DescendantIterator.java<br/><ref>Committer's log entry: </ref>Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1336<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/compiler Lexer.java<br/><ref>Committer's log entry: </ref>Resize the m_patternMap if m_patternMapSize exceeds the bounds.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions
- ExtensionHandlerGeneral.java
- ExtensionHandlerJavaPackage.java
- ExtensionsTable.java MethodResolver.java
- java/src/org/apache/xalan/lib Extensions.java
- java/src/org/apache/xalan/lib/sql ConnectionPoolManager.java
- java/src/org/apache/xalan/processor ProcessorLRE.java
- ProcessorTemplateElem.java StylesheetHandler.java
- TransformerFactoryImpl.java XSLTAttributeDef.java
- XSLTElementProcessor.java
- java/src/org/apache/xalan/res XSLTErrorResources.java
- java/src/org/apache/xalan/serialize CharInfo.java
- WriterToUTF8Buffered.java
- java/src/org/apache/xalan/templates ElemExtensionCall.java
- ElemExtensionDecl.java ElemMessage.java
- FuncDocument.java FuncFormatNumb.java
- OutputProperties.java StylesheetRoot.java
- java/src/org/apache/xalan/transformer TrAXFilter.java
- TransformerHandlerImpl.java
- TransformerIdentityImpl.java TransformerImpl.java
- java/src/org/apache/xalan/xslt Process.java
- java/src/org/apache/xml/dtm DTMException.java
- DTMManager.java
- java/src/org/apache/xml/dtm/ref ChunkedIntArray.java
- CoroutineManager.java CoroutineSAXParser.java
- CoroutineSAXParser_Xerces.java DTMBuilder.java
- DTMDefaultBase.java DTMDefaultBaseIterators.java
- DTMDefaultBaseTraversers.java
- DTMManagerDefault.java
- IncrementalSAXSource_Filter.java
- IncrementalSAXSource_Xerces.java
- java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java
- java/src/org/apache/xml/utils ObjectPool.java QName.java
- URI.java
- java/src/org/apache/xpath NodeSet.java NodeSetDTM.java
- VariableStack.java XPath.java XPathContext.java
- java/src/org/apache/xpath/axes WalkerFactory.java
- java/src/org/apache/xpath/functions FuncSubstring.java
- FunctionDef1Arg.java
- java/src/org/apache/xpath/objects
- XRTreeFragSelectWrapper.java XStringForChars.java
- java/src/org/apache/xpath/operations Variable.java
- java/src/org/apache/xpath/res XPATHErrorResources.java<br/><ref>Committer's log entry: </ref>Getting all (almost all) error message strings into the resource bundle<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/27/2001<br/><ref>Removed: </ref>java/src/org/apache/xml/dtm/ref DTMBuilder.java<br/><ref>Committer's log entry: </ref>Accidentally added. Now deleting.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath Expression.java
- java/src/org/apache/xpath/axes AxesWalker.java
- LocPathIterator.java PredicatedNodeTest.java
- ReverseAxesWalker.java
- java/src/org/apache/xpath/objects XNumber.java
- java/src/org/apache/xpath/operations Variable.java<br/><ref>Committer's log entry: </ref>If a proximity predicate is a stable number (variable or number literal) then,
- once the node is found, don't keep searching! (since only one
- node is possible).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/30/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMDefaultBase.java<br/><ref>Committer's log entry: </ref>In getNextNamespaceNode and getFirstNamespaceNode, was
- sometimes returning a node without the DTM identity bits.
- Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2878.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/30/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/compiler OpMap.java<br/><ref>Committer's log entry: </ref>Throw real error instead of runtime error in getFirstPredicateOpPos
- for better error reporting.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/30/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes PredicatedNodeTest.java
- java/src/org/apache/xpath/compiler OpMap.java<br/><ref>Committer's log entry: </ref>Bit of a hack to make /descendant-or-self::north with getFirstPredicateOpPos
- where getFirstPredicateOpPos was always throwing an error if
- there was not a predicate (!! Should have been discovered before
- now?!?!). If -2 return -2 (instead of throwing an error), and
- handle this case in PredicatedNodeTest#initPredicateInfo.<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/30/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ObjectArray.java
- SQLDocument.java SQLErrorDocument.java
- XConnection.java<br/><ref>Committer's log entry: </ref>Added the original pquery and streaming mode functionality
- Submitted by: John Gentilin<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/30/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/lib/sql DTMDocument.java<br/><ref>Committer's log entry: </ref>Added DTM Document, a common impl between SQLDocument and SQLErrorDocument
- Submitted by: John Gentilin<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/30/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes DescendantIterator.java
- WalkerFactory.java<br/><ref>Committer's log entry: </ref>Fix addresses http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=XalanJ2,
- and a whole class of related problems.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/objects XNodeSet.java XObject.java
- java/src/org/apache/xpath/patterns StepPattern.java<br/><ref>Committer's log entry: </ref>Detach expressions in match patterns. Also, defined
- numWithSideEffects and boolWithSideEffects (for lack of
- better names) that will increment the iterator, and call these
- for predicates. The combination of these results in about an
- 18% performance improvement for decoy.xsl.
- Credits to Mukund Raghavachari/Watson/IBM@IBMUS.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions
- ExtensionHandlerGeneral.java
- java/src/org/apache/xalan/res XSLTErrorResources.java
- java/src/org/apache/xalan/templates ElemExtensionDecl.java<br/><ref>Committer's log entry: </ref>Add support for external scripts (ie, the src attribute on a script element)<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath XPathContext.java
- java/src/org/apache/xpath/axes ChildTestIterator.java
- OneStepIteratorForward.java<br/><ref>Committer's log entry: </ref>In XPathContext#createDTMIterator(int node), call 
-OneStepIteratorForward(Axis.SELF)
- instead of DescendantIterator. This addresses one of the bugs
- in http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2925
- (i.e. &lt;xsl:copy-of select="xalan:nodeset($stylesheets)"/&gt;...
- The DescendantIterator was enumerating all of the nodes in the RTF
- rather than just the one.)<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ConnectionPool.java
- ConnectionPoolManager.java DTMDocument.java
- DefaultConnectionPool.java ObjectArray.java
- PooledConnection.java SQLDocument.java
- SQLErrorDocument.java XConnection.java<br/><ref>Committer's log entry: </ref>Added Error Managment and javadocs
- Submitted by: John Gentilin<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/01/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/patterns StepPattern.java<br/><ref>Committer's log entry: </ref>Fixed some major problems with position() and last() in secondary
- predicates for match patterns. Credit goes to
- Mukund Raghavachari/Watson/IBM@IBMUS for flagging these.<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>08/01/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql XConnection.java<br/><ref>Committer's log entry: </ref>Update after building Unit Test's
- Submitted by: John Gentilin<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>08/01/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLTAttributeDef.java<br/><ref>Committer's log entry: </ref>Fix for Bugzilla 2930. Fix from Alexander Rudnev. Handle namespaced elements.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/01/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm DTMAxisIterator.java
- java/src/org/apache/xml/dtm/ref DTMAxisIteratorBase.java
- DTMDefaultBaseIterators.java
- java/src/org/apache/xpath/axes OneStepIterator.java<br/><ref>Committer's log entry: </ref>Addresses http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2945
-
- Bug was caused by (redundent) cloneWithReset being called from
- the UnionPathIterator, and the iterator in OneStepIterator not being
- reset. (Need to review: check other iterators for this.)
-
- Call reset on the iterator in OneStepIterator#reset. Reset the position
- value in the ancestor iterator reset. Define DTMAxisIterator#cloneIterator
- to not reset the iterator position, and fix the implementations of
- this to not call clone.reset().<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java
- java/src/org/apache/xpath NodeSetDTM.java
- java/src/org/apache/xpath/functions FuncExtFunction.java
- java/src/org/apache/xpath/objects XBoolean.java
- XNodeSet.java XNumber.java XObject.java<br/><ref>Added: </ref>java/src/org/apache/xpath/objects XNodeSetForDOM.java<br/><ref>Committer's log entry: </ref>Address http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2925
-
- Create new XObject, XNodeSetForDOM, which is constructed
- from a Node, NodeList, or NodeIterator, and acts the same as
- XNodeSet, except it returns the original object for object(),
- nodeset(), and nodelist().
-
- Add XObject#create(Object val, XPathContext xctxt), which is
- called from TransformerImpl#setParameter(s), and
- FuncExtFunction#execute (for the return values of the
- extension).
-
- XBoolean and XNumber now also have Boolean and Number
- constructors, in which case the original object will also be
- returned from the object() method.
-
- This should make the conversion from java object to XObject
- consistent between function returns and setParameter. These
- changes should also fix a bug where NodeLists weren't being converted.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/03/2001<br/><ref>Added: </ref>java/src/org/apache/xml/utils NamespaceSupport2.java<br/><ref>Committer's log entry: </ref>Replacement for org.xml.sax.helpers.NamespaceSupport; extends
- that API so it can be easily swapped in.
-
- Current changes;
-
- Minor code reorg. I'm sorry, but I find classes easier to read
- if fields are defined before methods reference them rather than
- at end, especially when inner classes are present.
-
- Punt stack vector in favor of doubly-linked list. (It was already
- singly-linked in parallel with the vector!)
-
- The whole dirty-tables concept was broken, because Context's
- ctor always called copyTables and thus always marked tables
- dirty. It also wasted some time setting itself only to be reset by
- setParent. I've fixed both by parameterizing the ctor and making
- copyTables specific to prep-for-new-declaration. (Could be
- moved back into the declaration method, for that matter.)
-
- I'm dubious about the caches in processName. As far as I can
- tell, Xalan per se never actually uses that method...
-
- The use of Hashtables is questionable. Hashtable is
- known to be inefficient and oversynchronized in older JVMs, and
- the fact that this is a bidirectional mapping suggests that an
- approach similar to our own String Pool -- lighter-weight, more
- targeted, hashing without reduplicating the two column tables --
- would be a win. Since these are typically short sets, even
- simple linear search is worth considering!<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor StylesheetHandler.java
- java/src/org/apache/xalan/templates ElemTemplateElement.java
- java/src/org/apache/xalan/transformer ResultTreeHandler.java
- TransformSnapshotImpl.java<br/><ref>Committer's log entry: </ref>Cutover to NamespaceSupport2, q.v.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils NamespaceSupport2.java<br/><ref>Committer's log entry: </ref>Continuing code review.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils NamespaceSupport2.java<br/><ref>Committer's log entry: </ref>More efficient prefixes-for-specific-URI. This may wind up being
- redone yet again if/when the underlying storage representation
- changes.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>08/03/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/lib PipeDocument.java<br/><ref>Committer's log entry: </ref>PipeDocument extension element (the pipeDocument method).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/04/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java
- java/src/org/apache/xpath NodeSet.java NodeSetDTM.java<br/><ref>Committer's log entry: </ref>Bug fixed regarding the current() function in the root template
- (related to bug#1269). Bug was reported by David Marston
- offline. The test for this is conf/copy/copy29.
-
- In TransformerImpl#applyTemplateToNode, create a NodeSetDTM and pass it to 
-m_xcontext.pushContextNodeList(cnl);.
- In NodeSetDTM fix getCurrentNode so that it doesn't use m_next-1
- (which simply appears to be completely wrong). Do the same for
- NodeSet... though I don't think this will be called anywhere in
- Xalan.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/04/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm DTMAxisIterator.java
- java/src/org/apache/xml/dtm/ref DTMAxisIteratorBase.java
- DTMDefaultBaseIterators.java<br/><ref>Committer's log entry: </ref>Provide method for DTMAxisIterator to get the current root node
- of the iteration.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/04/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/objects XObject.java<br/><ref>Committer's log entry: </ref>In response to regression posted on xalan-dev by John Gentilin 
-&lt;johnglinux@eyecatching.com&gt;
- on 08/03/2001 06:49 PM. When the XNodeSet taks a DTMIterator, it
- will call val.getDTMManager();, which will call LocPathIterator#getDTMManager,
- which will call m_execContext..getDTMManager(), which means
- that setRoot has to be called on the iterator before it is added to
- XNodeSet. Thus, call setRoot on the OneStepIterator in
- create(Object, XPathContext) before it is added to the XNodeSet.
- The regression was related to fix for 
-http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2925.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes OneStepIterator.java<br/><ref>Committer's log entry: </ref>For the OneStepIterator(DTMAxisIterator iterator) constructor,
- initialize the node tests to DTMFilter.SHOW_ALL (duh).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/objects XObject.java<br/><ref>Added: </ref>java/src/org/apache/xpath/objects XObjectFactory.java<br/><ref>Committer's log entry: </ref>Move create methods from XObject to XObjectFactory, in response
- to cyclic build problems encountered with javac 1.1.8.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils NamespaceSupport2.java<br/><ref>Committer's log entry: </ref>Moved anonomous class to PrefixEnumerator, in response
- to problems encountered with 1.1.8 build.
- Joe may want to fix this in another way, as
- I'm sure the anon class is probably a bit
- cheaper?<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath VariableStack.java<br/><ref>Committer's log entry: </ref>Address http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2972,
- where it was throwing a NPE instead of reporting that the variable
- was being accessed before it was bound (i.e. the variable was being
- accessed inside an RTF for that same variable).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerHandlerImpl.java<br/><ref>Committer's log entry: </ref>Remove m_hasStarted variable and associated assertion.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMDefaultBaseIterators.java<br/><ref>Committer's log entry: </ref>Addresses bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3001.
- In the cloneIterator function of PrecedingIterator, the cloned array
- was being sized for _maxAncestors, which defaults to 8. But if the
- _stack was resized, it will copy more into the new stack than is
- allocated. The solution is to allocate the new clone._stack array to
- _stack.length.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils NamespaceSupport2.java<br/><ref>Committer's log entry: </ref>Don't create caches unless used (which I don't think they are, in Xalan).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMDefaultBaseIterators.java<br/><ref>Committer's log entry: </ref>Made _maxAncestors not static, as this is
- not compatible with 1.1.8 (reported by
- Gary Peskin).<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils NamespaceSupport2.java<br/><ref>Committer's log entry: </ref>Playing a hunch, I moved the Context objects out of NamespaceSupport2.
- They're now a second class in the same file rather than being an inner class.
- That reduces the size of the Context2 object, and its initialization time, by
- removing the need for it to carry a reference to the NamespaceSupport2
- object that created it.
-
- Performance seems significantly improved... even (surprisingly!) on the
- getDeclaredPrefixes operation. Memory usage also seems better, as
- expected.
-
- NamespaceSupport2 is still acounting for about 5%
- of the time spent in the ResultTreeHandler, according
- to my latest trace. Apparently we are calling
- getDeclaredPrefixes an obscenely large number of
- times, and the Vector.elements call is adding up. We
- may want to look at where this is being called from
- and whether we can reduce the number of invocations.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer ResultTreeHandler.java<br/><ref>Committer's log entry: </ref>Performance improvement; avoid scanning the same list twice.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerHandlerImpl.java TransformerImpl.java
- java/src/org/apache/xalan/xslt Process.java
- java/src/org/apache/xml/dtm/ref
- IncrementalSAXSource_Filter.java
- java/src/org/apache/xml/utils DefaultErrorHandler.java
- java/src/org/apache/xpath/operations Variable.java<br/><ref>Committer's log entry: </ref>This checkin hopefully fixes many problems with bad diagnostics lately, but
- at the expense of a slight change in behavior. The rule now is, the
- DefaultErrorHandler never outputs location info for error and fatalError... 
-this has to be done
- by the catcher of the exception. Convenience methods for this are
- in DefaultErrorHandler#printLocation. This method will unwrap the
- exception as close to the originating source as possible.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions
- XSLProcessorContext.java
- java/src/org/apache/xml/dtm DTMIterator.java
- java/src/org/apache/xml/dtm/ref DTMAxisIteratorBase.java
- java/src/org/apache/xpath NodeSetDTM.java
- java/src/org/apache/xpath/axes AttributeIterator.java
- AxesWalker.java ChildIterator.java
- ChildTestIterator.java DescendantIterator.java
- FilterExprWalker.java LocPathIterator.java
- OneStepIterator.java OneStepIteratorForward.java
- ReverseAxesWalker.java UnionPathIterator.java
- WalkingIteratorSorted.java
- java/src/org/apache/xpath/objects XObjectFactory.java<br/><ref>Committer's log entry: </ref>Changes to allow some dynamic determination in WalkerIteratorSorted to
- see if the nodes really need to be sorted. Added isDocOrdered() and
- getAxis() to both DTMIterator and AxesWalker, and implemented
- appropriate overloads in derived or implementing classes. In FilterExprWalker
- return the contained DTMIterator's getAxis(). In WalkerIteratorSorted,
- implement canBeWalkedInNaturalDocOrder() function that is called
- from setRoot(...). If this function returns true, than don't sort the nodes
- in setRoot, and in all other respects treat this as if it is a simple
- WalkingIterator.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Fix for bugzilla 1251. Make sure exceptions are thrown when we're on the main 
-thread.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes AxesWalker.java
- WalkerFactory.java WalkingIteratorSorted.java<br/><ref>Committer's log entry: </ref>Eliminate do/while check for duplicates in AxesWalker#nextNode()
- by using WalkingIteratorSorted for cases where both the preceding[-sibling]
- and following[-sibling] axes are being walked, and for "@*/foo" patterns
- ("@attr/foo" patterns still use WalkingIterator).<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>08/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates FuncFormatNumb.java<br/><ref>Committer's log entry: </ref>Fix bugzilla bug 3036 
-(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3036). When no 
-xsl:decimal-format element is supplied in the composed stylesheet, the defaults 
-specified in the Recommendation section 12.3 should be used for the attribute 
-values, not locale-specific defaults.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>08/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java<br/><ref>Committer's log entry: </ref>Fix for bugzilla 3060 
-(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3060). Prefixes and
- namespaceURIs are kept in the same Vector, m_prefixMappings. The entries are 
-stored as pairs of vector elements. The even elements contain the prefix and 
-the odd elements contain the URI. In two routines, getPrefix and endElement, 
-the appropriate prefix or URI was being located in the Vector using an 
-indexOf. However, in this case where the prefix and the URI were the same, the 
-routine was looking for the URI but finding the prefix instead of the URI. It 
-tried tried to back up one to get the prefix and underflowed the Vector size.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>08/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer ResultTreeHandler.java
- TransformerImpl.java<br/><ref>Committer's log entry: </ref>Implement ErrorHandler in ResultTreeHandler so that fatal errors can get 
-passed in to the SAXHandler. Also change the code in TransformerImpl to call 
-fatalError in case of an error instead of endDocument. (overlaps with URI 
-handling fix...)<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>08/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- TransformerFactoryImpl.java
- java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java
- java/src/org/apache/xml/utils SystemIDResolver.java<br/><ref>Committer's log entry: </ref>Fix code to handle absolute paths from unix systems. This fix is part of an 
-ongoing process and is just meant to fix a few pending bugs. More changes are 
-expected in this area.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>Change version for xalan2.2.D9 build<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemElement.java
- java/src/org/apache/xalan/transformer ResultTreeHandler.java
- java/src/org/apache/xml/utils DefaultErrorHandler.java<br/><ref>Committer's log entry: </ref>ResultTreeHandler was pushing a new namespace context but failing to note 
-that result in more pushes than pops. Cleaned up the execute() method of 
-ElemElement to make it more understandable (to me) and added a few comments. 
-The DefaultErrorHandler was not flushing Writers that it created. Since the 
-Writers are never closed (and cannot be as there is no close method), error 
-messages were failing to appear.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm DTMManager.java<br/><ref>Committer's log entry: </ref>Increasing the number of bits used to identify DTM nodes, at the expense of 
-decreasing the number of DTMs that a DTMManager can track simultaneously. Some 
-other code has been updated to track this change (and to better track posible 
-future changes), as have the IDKEY testcases.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMDefaultBase.java
- DTMDocumentImpl.java DTMManagerDefault.java<br/><ref>Committer's log entry: </ref>Increasing the number of bits used to identify DTM nodes, at the expense of 
-decreasing the number of DTMs that a DTMManager can track simultaneously. Some 
-other code has been updated to track this change (and to better track posible 
-future changes), as have the IDKEY testcases.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/functions FuncGenerateId.java<br/><ref>Committer's log entry: </ref>Increasing the number of bits used to identify DTM nodes, at the expense of 
-decreasing the number of DTMs that a DTMManager can track simultaneously. Some 
-other code has been updated to track this change (and to better track posible 
-future changes), as have the IDKEY testcases.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath NodeSetDTM.java<br/><ref>Committer's log entry: </ref>Try to support getRoot. Fixes problem with TransformStateTest.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>08/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes WalkerFactory.java<br/><ref>Committer's log entry: </ref>Fix problem with duplicate nodes produced from a walking iterator<br/><br/></li></ul><note>This release includes no updates of the compatibility source code (now deprecated).</note>
-</s3>
-<s3 title="Changes for &xslt4j; 2.2.D8">
-<p> Core (Non-XSLTC) source code updates:</p><ul><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Code Update
- Submitted by:John Gentilin<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Fixed DTM.NULL compile error<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TreeWalker2Result.java<br/><ref>Committer's log entry: </ref>Redundant test removed, possibly redundant code flagged for %REVIEW%<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java
- java/src/org/apache/xalan/transformer
- TransformerHandlerImpl.java
- java/src/org/apache/xml/dtm/ref DTMDefaultBase.java
- DTMDocumentImpl.java DTMManagerDefault.java
- IncrementalSAXSource.java
- IncrementalSAXSource_Filter.java
- IncrementalSAXSource_Xerces.java
- java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
- java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java
- java/src/org/apache/xml/utils SuballocatedIntVector.java<br/><ref>Committer's log entry: </ref>IncrementalSAXSource replaces CoroutineSAXParser -- simpler API,
- hence less risk of programming errors introducing timing windows. I hope.
- A few performance-related tweaks are also included in this check-in.
- Only very minor gains are expected.<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ObjectArray.java
- SQLDocument.java<br/><ref>Committer's log entry: </ref>Project Update<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Oops.Should have been checked in as part of the IncrementalSAXSource cutover. 
-Sorry!<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>07/23/2001<br/><ref>Modified: </ref>java build.xml
- java/src/org/apache/xml/dtm/ref
- IncrementalSAXSource_Filter.java
- java/src/org/apache/xml/utils/synthetic JavaUtils.java<br/><ref>Committer's log entry: </ref>3 small fixes to the build process ( to make it work with jdk1.4 and crimson)
-
- - exclude IncrementalSAXSource_Xerces if xerces is not detected
- - comment-out the "main" in IncrementalSAXSource_Filter.java ( it is a
- test, but has deps on xerces )
- - don't try to load the compiler in syntetic/JavaUtils. This is a mess,
- it was debated on tomcat-dev and ant-dev, as you may know some people
- decided to remove the internal compiler class ( sun.tools.javac.Main ),
- and that brakes jasper, ant and now xalan.
-
- It seems right now the only portable way to run the compiler is via command
- line call in a separate process ( jikes can easily make up for the
- overhead of creating a new process and doesn't leave garbage ).
-
- Question: is synthetic used ? Seems like a very usefull package, but if
- xalan is not using it it might be better to move it to xml-commons or
- jakarta-commons or some other place.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/24/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Don't set m_level anymore, as it looks like Joe commented out it's
- initialization. m_level is no longer called by Xalan, and the implementation
- can calculate it when it is called.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/24/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java<br/><ref>Committer's log entry: </ref>Fixed bug 2758 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2758). The 
-flag indicating that a call to startDocument() in the resultContentHandler was 
-necessary was not being reset for multiple transforms.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/25/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java<br/><ref>Committer's log entry: </ref>Fix bug 2727 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2727). 
-Attributes which contain a namespace prefix are indicated by placing a negative 
-number in the appropriate entry in the m_dataOrQName array. The absolute value 
-of this number is an entry in m_data. However, in this example, there were no 
-text nodes before the first namespaced attribute so the entry in m_data had an 
-array index of 0. This resulted in an entry of zero, not a negative number, in 
-m_dataOrQName. This situation got several routines which tested for &lt; 0 
-confused. I looked at several ways of fixing this but decided to just always 
-allocate m_data.elementAt(0) entry to a dummy entry. The other solutions 
-involved runtime checking which could slow down this piece of code and I felt 
-that wasting one entry was worth it to not slow down the run time.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/26/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize
- WriterToUTF8Buffered.java<br/><ref>Committer's log entry: </ref>Fix bugzilla bug 2639 
-(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2639) where buffer was 
-overflowing because the expansion of the Unicode characters into multiple UTF8 
-characters was not being properly taken into account. Many thanks to 
-Gunnlaugur Thor Briem for his "multiply by three" trick.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/26/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer NodeSorter.java<br/><ref>Committer's log entry: </ref>Commented out NumberFormat m_formatter = NumberFormat.getNumberInstance();.
-
- Mukund reported:
-
- a minor improvement for alphabetize.xsl is to comment out the line
-
- //NumberFormat m_formatter = NumberFormat.getNumberInstance();
-
- in NodeSorter.java. The variable m_formatter does not seem to be used 
-anywhere, and the performance difference is:
-
- Before: alphabetize 10 90 5108 196 156 34.58 
-OK
- After : alphabetize 10 70 4316 196 156 
-40.93 OK<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTInfo.properties<br/><ref>Committer's log entry: </ref>2.2.D8<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>2.2.D8<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer NodeSortKey.java<br/><ref>Committer's log entry: </ref>Submitted fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2851.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Just added some stuff to diagnose bugs for flavor th.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes WalkerFactory.java
- java/src/org/apache/xpath/compiler Compiler.java
- java/src/org/apache/xpath/patterns
- ContextMatchStepPattern.java StepPattern.java<br/><ref>Committer's log entry: </ref>These are changes submitted (offline) by Mukund Raghavachari/Watson/IBM@IBMUS.
-
- This fixes a bug with match="chapter//footnote[1]" patterns.
-
- The main change here is minor to remove the automatic attachment of parent::* 
-to simple step patterns.
-
- He has re-implemented executePredicates to be
- more efficient. Given a pattern such as row[6], it
- does not iterate over the entire axis until it reaches
- the node to see if it is the sixth node. Rather,
- starting from the current node, it works backwards
- (preceding siblings) until it either runs out of nodes
- or finds more than six nodes that match the
- predicate [I can explain it better if desired].
- This optimization improves performance slightly
- overall. It helps decoy and patterns most (by
- about 10%).
-
- The other optimization that I implemented was the
- following. For a pattern foo[][3][][4] ..., where more
- than one predicate is a number (position check),
- in checking the predicate [4], the fact that the
- current node has passed foo[][3] implies that it is
- the only node that is the third node among its
- siblings that passes foo[]. Therefore, any
- subsequent position checks can be true if and
- only if the position is [1]. This optimization is not
- used by the xsltmark benchmarks and so does
- not offer any performance benefits.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes DescendantIterator.java<br/><ref>Committer's log entry: </ref>Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1336<br/><br/></li></ul><note>This release includes no updates of the compatibility source code (now deprecated).</note>
-</s3>
-<s3 title="Changes for &xslt4j; 2.2.D7">
-<p> Core (Non-XSLTC) source code updates:</p><ul><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMManagerDefault.java<br/><ref>Committer's log entry: </ref>Since the real root of our tree may be a DocumentFragment, we need to
- use getParent to find the root, instead of getOwnerDocument. Otherwise
- DOM2DTM#getHandleOfNode will be very unhappy.
- Result of report via private mail by Carsten Ziegeler of breakage
- in Cocoon.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize SerializerToHTML.java
- SerializerToXML.java<br/><ref>Committer's log entry: </ref>Made m_maxCharacter, accumDefaultEscape,
- accumDefaultEntity, and m_isRawStack
- protected by request from Johannes Farrenkopf
- and Frank Nestel.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/functions FuncNormalizeSpace.java<br/><ref>Committer's log entry: </ref>In executeCharsToContentHandler check first for
- DTM.NULL before trying to get the DTM.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils FastStringBuffer.java<br/><ref>Committer's log entry: </ref>Fix bug reported by "Carsten Ziegeler" &lt;cziegeler@sundn.de&gt;.
- Test for this is whitespace23.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils SuballocatedIntVector.java<br/><ref>Committer's log entry: </ref>Drop some bounds tests for cases which shouldn't arise in the first place, 
-since this is an inner-loop method.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils SuballocatedByteVector.java
- SuballocatedIntVector.java<br/><ref>Committer's log entry: </ref>Synch SuballocatedByteVector with changed SuballocatedIntVector<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref CoroutineSAXParser.java<br/><ref>Committer's log entry: </ref>Revert back to throwing a shutdownException if (arg == null) in co_yield. I 
-see this
- occur if the parser is Crimson with output\output01, and it causes
- a hang if the shutdownException is not thrown.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize SerializerToXML.java<br/><ref>Committer's log entry: </ref>Make accumDefaultEntity and accumDefaultEscape non-final.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes ChildTestIterator.java
- OneStepIterator.java
- java/src/org/apache/xpath/functions FuncExtFunction.java<br/><ref>Committer's log entry: </ref>Fix for John G. for the SQL extension: handle return types of
- DTM and DTMAxisIterator.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>In executeChildTemplates, somehow there was a popMode without
- a corresponding pushMode. The pushMode was added.
- Addresses bug posted by Stephane Bailliez &lt;sbailliez@imediation.com&gt;
- on the xalan-dev list on 07/09/2001 07:28 AM.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions ExpressionContext.java
- java/src/org/apache/xalan/templates StylesheetRoot.java
- java/src/org/apache/xpath VariableStack.java
- XPathContext.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla 2355 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2355&gt;. To make the 
-functionality clearer, I've changed the method name from getVariable to 
-getVariableOrParam since the routine will pick up either one. Also fixed a 
-bug where top level variables and parameters were not getting marked as such.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib Extensions.java
- java/src/org/apache/xpath XPathContext.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla 2523 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2523&gt;. evaluate extension 
-function was not refactored with DTM. Also need to add function to 
-XPathContext.XPathExpressionContext to allow an extension to obtain the 
-associated XPathContext.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes DescendantIterator.java<br/><ref>Committer's log entry: </ref>Fix problem with descendant-or-self and from root pattern. When from root, 
-descedant or self was not recognized.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java<br/><ref>Committer's log entry: </ref>Quick patch to handle case where someone wants to build a DTM from
- an Element rather than from a Document. The Attr handling might want to
- move down into addNode.
-
- This opens several cans of worms -- what if the next user wants the
- root of their DTM to be an EntityReference node, which has no DTM
- node equivalent -- but we'll eat those when we get to them.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib Extensions.java<br/><ref>Committer's log entry: </ref>Modify distinct() extension so that it no longer relies on DOMHelper which is 
-deprecated but uses ExpressionContext.toString().<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTErrorResources.java
- java/src/org/apache/xalan/trace PrintTraceListener.java
- java/src/org/apache/xalan/transformer TransformerImpl.java
- java/src/org/apache/xalan/xslt Process.java
- java/src/org/apache/xml/dtm DTM.java
- java/src/org/apache/xml/dtm/ref DTMDocumentImpl.java
- ExpandedNameTable.java
- java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
- java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java<br/><ref>Added: </ref>java/src/org/apache/xalan/lib NodeInfo.java
- java/src/org/apache/xalan/transformer XalanProperties.java
- java/src/org/apache/xml/dtm/ref NodeLocator.java<br/><ref>Committer's log entry: </ref>Application of patch submitted by Ovidiu Predescu &lt;ovidiu@cup.hp.com&gt;
- for file, line, column number information for XML source document.
-
- [A made one change: m_sourceSystemId, m_sourceLine, and
- m_sourceColumn are not created with the member variable
- initializer, since they are initialized in setProperty.]
-
- The following patch is a rework of a previous patch I've submitted on
- May 24 against the Stree model, current at that time. This time the
- patch is against the DTM model, and makes use of DTM features to
- optimize the lookup time and storage requirements. I hope this time
- the patch gets incorporated in the CVS repository, before any major
- rework happens again ;-).
-
- As with the previous patch, there is no overhead in space or time if
- source information is not needed.
-
- From a user perspective, this feature can be turned on by passing the
- -L flag to Xalan when invoking it from the command
- line. Programmatically you can also enable it by invoking the
- setProperty method on the TransformerImpl:
-
- TransformerImpl impl = ((TransformerImpl) transformer);
- 
-impl.setProperty(org.apache.xalan.transformer.XalanProperties.SOURCE_LOCATION,
- Boolean.TRUE);
-
- A Transformer "property" is different from a "feature": while a
- feature is specific to all the transformer instances and usually
- refers to an implementation aspect, a property is a runtime capability
- that is set per Transformer instance. Currently the only property
- added by this patch is the source location in the XML source document.
-
- The patch adds two methods to the DTM interface:
-
- public void setProperty(String property, Object value);
- public SourceLocator getSourceLocatorFor(int node);
-
- The second method is used to obtain the source location given a node
- handle.
-
- There are two ways you can make use of the source location. The first
- one is from within a stylesheet, where you can have something like
- this:
-
- &lt;xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:nodeinfo="xalan://org.apache.xalan.lib.NodeInfo"
- version="1.0"&gt;
-
- &lt;xsl:template match="*"&gt;
- //node &lt;xsl:value-of select="name()"/&gt;
- //file &lt;xsl:value-of select="nodeinfo:systemId()"/&gt;
- //line &lt;xsl:value-of select="nodeinfo:lineNumber()"/&gt;
- //column &lt;xsl:value-of select="nodeinfo:columnNumber()"/&gt;
- &lt;xsl:apply-templates/&gt;
- &lt;/xsl:template&gt;
-
- &lt;/xsl:stylesheet&gt;
-
- If no arguments are passed to the systemId(), lineNumber() or
- columnNumber() functions, the corresponding information of the current
- context node is returned. A node can be passed as argument to the
- above functions, in which case the corresponding information about
- that node is returned. If a node set containing multiple nodes is
- passed as argument, only the information of the first node in the set
- is returned.
-
- The second way of obtaining the source location is
- programmatically. Given a Node instance, one can obtain the owner DTM
- and the node handle (an integer) that represents the
- node. Unfortunately I didn't see any way of hiding this: if you find
- one please let me know and I'll fix it.
-
- The following example is extracted from PrintTraceListener and
- illustrates the API:
-
- Node sourceNode = ev.m_sourceNode;
- int nodeHandler = ((DTMNodeProxy)sourceNode).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)sourceNode).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- m_pw.println("Selected source node '" + sourceNode.getNodeName()
- + "', at " + locator);<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/compiler Compiler.java<br/><ref>Committer's log entry: </ref>Fix bug 2175 &lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2175&gt; by 
-adding the current time to the method key to ensure method key uniqueness. 
-Multiple Compilers were getting the same hashCode, particularly in Visual Age 
-for Java, due to aggressive garbage collection. Added the current time in 
-mills to distinguish between the different functions being compiled.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemVariable.java
- StylesheetRoot.java
- java/src/org/apache/xpath VariableStack.java
- java/src/org/apache/xpath/operations Variable.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla 2355 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2355&gt;. Added code to 
-populate m_index for global variables and parameters. If the backward search 
-for templates reaches the top level, use the list of composed top-level 
-variables and parameters from StylesheetRoot.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMNodeProxy.java<br/><ref>Committer's log entry: </ref>Now implements DocumentFragment.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTInfo.properties<br/><ref>Committer's log entry: </ref>Updated version to 2.2.0.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>Updated version to 2.2.0.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMNodeProxy.java<br/><ref>Committer's log entry: </ref>Fixed very ugly bug, left-over from DTM1, in getValue, where +1 was being 
-added per the old attribute structure of DTM1.<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ConnectionPool.java
- DefaultConnectionPool.java PooledConnection.java
- QueryParameter.java XConnection.java<br/><ref>Added: </ref>java/src/org/apache/xalan/lib/sql ConnectionPoolManager.java
- ObjectArray.java SQLDocument.java
- SQLErrorDocument.java<br/><ref>Removed: </ref>java/src/org/apache/xalan/lib/sql Column.java
- ColumnAttribute.java ColumnData.java
- ColumnHeader.java ExtensionError.java Row.java
- RowSet.java SQLExtensionError.java
- StreamableNode.java XConnectionPoolManager.java
- XStatement.java<br/><ref>Committer's log entry: </ref>First round of changes to port DOM mode to DTM Mode
- Submitted by: John Gentilin mailto://johng@apache.org<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java<br/><ref>Committer's log entry: </ref>Check if locator property is set before trying to use locator fields<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/trace PrintTraceListener.java<br/><ref>Committer's log entry: </ref>Don't print locator message if locator is null<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerHandlerImpl.java<br/><ref>Committer's log entry: </ref>In startDocument, run m_contentHandler.startDocument before you start the 
-thread.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Call wait for initial events before the the transform is started.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref CoroutineSAXParser.java<br/><ref>Committer's log entry: </ref>Allow co_yield to be called after the parse has finished.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java
- SQLErrorDocument.java<br/><ref>Committer's log entry: </ref>Added setProperty and getSourceLocatorFor empty methods.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>07/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java<br/><ref>Committer's log entry: </ref>Fix problem reported by Carsten Ziegeler &lt;cziegeler@sundn.de&gt;. Using 
-ApplyXPath (or doing a transformation) with DOM input was resulting in an NPE 
-due to declareNamespaceInContext() being called before setting m_exptype which 
-is needed by declareNamespaceInContext().<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerHandlerImpl.java<br/><ref>Committer's log entry: </ref>Add pauseForTransformThreadStartup. Call this in startDocument just
- after starting the transform thread. This should get rid of any variability
- with racing threads.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions
- XSLProcessorContext.java<br/><ref>Committer's log entry: </ref>Fix problem reported by jason heddings &lt;Jason.Heddings@Sun.COM&gt;.
-
- "In v2.0.1, I was able to pass a Node to this function and have the node
- be copied to the result tree (as expected). In the source code for
- XSLProcessorContext, it appears that the only objects that can be sent
- to the result tree are XObjects. Everything else is converted to a
- String. So for instance, I can no longer create a ProcessingInstruction
- and pass it to the result tree via this method since the PI is simply
- converted to a String."<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize SerializerToHTML.java<br/><ref>Committer's log entry: </ref>Application of patch submitted by Benjamin Riefenstahl 
-&lt;Benjamin.Riefenstahl@ision.net&gt;
-
- Motivation: We are using Xalan to generate HTML pages. We have the
- requirement to integrate code for ad banners. The ad server provider
- has written the code to use with compatibility to NetScape 4 in mind.
- The code uses the NetScape proprietory &lt;LAYER&gt; element and &lt;IFRAME&gt;
- elements for other browsers. The SRC attributes of these elements
- contain URLs with several URL parameters separated by '&amp;', as is the
- common convention.
-
- Problem: The code is integrated in our XSL stylesheets. In the
- stylesheet the '&amp;' has to be written as the entity '&amp;amp;'. That's
- ok. The problem is that in the output the '&amp;' is also written as
- '&amp;amp;' which is not ok, because NetScape doesn't understand that.
- OTOH the same URL is written with '&amp;' when used in an &lt;A&gt; element.
-
- Solution: This goes down to a different handling of attribute values
- in the class SerializeToHTML, depending on whether the attribute in
- question is known to contain a URI or not. Xalan knows this for &lt;A&gt;
- but not for &lt;LAYER&gt; and &lt;IFRAME&gt;. When I compare the list in
- SerializeToHTML.java with the HTML specs, I find a couple of other
- missing URI attributes in SerializeToHTML.java. When I add the
- missing pieces, the generation works fine.
-
- Patch: Here is the patch (diff -c) for xalan-j_2_2_D6. I also have
- one for xalan-j_2_0_1 which is the version I actually tested this
- with. Please let me know if this is insufficient or the patch is
- wrong or if there is something else I can do to fix this problem.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java<br/><ref>Committer's log entry: </ref>On code review of previous checkin from Gary P., we determined there
- was a problem with the point at which type was declared a
- DTM.NAMESPACE_NODE. So that part was moved back up (actuall
- a bit higher than where it was before),
- and the call to declareNamespaceInContext was moved a bit
- further down.<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql XConnection.java<br/><ref>Committer's log entry: </ref>Project Update
- Submitted by: John Gentilin mailto://johng@apache.org<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Project Update
- Submitted by: John gentilin mailto://johng@apache.org<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Fixup from previous check-in, defined new
- functions.
- Submitted by: John Gentilin mailto://johng@apache.org<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Project Update<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>reduced Attribute's for testing<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>07/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java<br/><ref>Committer's log entry: </ref>Minor hack to catch an attribute value being null.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemNumber.java
- java/src/org/apache/xalan/transformer Counter.java
- CountersTable.java KeyRefIterator.java
- java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
- java/src/org/apache/xpath NodeSetDTM.java
- java/src/org/apache/xpath/axes LocPathIterator.java
- UnionPathIterator.java WalkingIteratorSorted.java
- java/src/org/apache/xpath/objects XNodeSet.java
- XRTreeFrag.java<br/><ref>Committer's log entry: </ref>Add new parameter to NodeSetDTM constructor. We need to have a DTMManager on 
-hand. Change code to use the new constructors.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>07/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java<br/><ref>Committer's log entry: </ref>OOps! Back out this last change. Old code on my machine!!!<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>07/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql SQLDocument.java<br/><ref>Committer's log entry: </ref>Fixed a few bugs, almost there
- Submitted by: John Gentilin mailto://johng@apache.org<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref CoroutineManager.java
- CoroutineSAXParser.java
- CoroutineSAXParser_Xerces.java<br/><ref>Added: </ref>java/src/org/apache/xml/dtm/ref IncrementalSAXSource.java
- IncrementalSAXSource_Filter.java
- IncrementalSAXSource_Xerces.java<br/><ref>Committer's log entry: </ref>Starting to phase out Coroutine*Parser* in favor of IncrementalSAXSource*.
- The latter simplifies the code, and should help us avoid some of the
- confusion that can arise in using the older tools.
-
- Most importantly, it greatly simplifies the calling sequences, by discarding
- the "which file do you want to parse" and "do you want to parse any more
- files" transactions. These now operate _only_ as filters, and only as single
- -use (though in fact the Xerces-specific version is reusable, and we may
- reintroduce that feature in the generic filtering version at a later date).
-
- Note too that we have swept the CoroutineManager completely
- under the covers of the filter's API. There's no particular reason to expose
- that implementation detal to the outside world.
-
- Still to be done: Rework the rest of Xalan to use the new code.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref CoroutineParser.java<br/><ref>Committer's log entry: </ref>Starting to phase out Coroutine*Parser* in favor of IncrementalSAXSource*.
- See comment in previous check-in; I just missed this one....<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/dtm/ref DTMStringPool.java<br/><ref>Committer's log entry: </ref>doc.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTInfo.properties<br/><ref>Committer's log entry: </ref>2.2.D7<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>07/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>2.2.D7<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>07/18/2001<br/><ref>Removed: </ref>java/src/org/apache/xml/dtm/ref DTMBuilder.java<br/><ref>Committer's log entry: </ref>Obsolete<br/><br/></li></ul><note>This release includes no updates of the compatibility source code (now deprecated).</note>
-</s3>
-<s3 title="Changes for &xslt4j; 2.2.D6">
-     <p><em>Important: Xerces has added a number of DOM level-3 methods to its DOM interfaces. The DOM level-3 proposal
-is currently a working draft (it is not yet a W3C recommendation), and Xalan does not support these new methods. 
-To run Xalan in the JDK 1.1.8 platform, you must put xalan.jar (with its DOM level-2 interfaces) in front of 
-xerces.jar on the system class path. If you want to rebuild Xalan (on JDK 1.1.8 or higher), you must put Xalan 
-in front of xerces.jar on the system class path.</em></p>
-
-     <p>This beta release includes the following non-XSLTC code changes:</p>     
-     <ul>
-       <li>Costin Manolache has slightly modified the CoRoutine stuff so that a you can compile and run everything but the CoRoutineXercesParser without having Xerces on the classpath.<br/><br/></li>
-       <li>Joseph Kesselman added chunked int array stuff to address our scaling problems that Mukund &amp; co. uncovered.  This was a fairly mechanical, but still substantial, change.  No bugs have yet been discovered that relate to this.  This is probably the most controversial change.<br/><br/></li>       
-       <li>The Process class now outputs incrementally if the output is standard out.  This is mostly for testing purposes, but it makes general sense.<br/><br/></li>
-       <li>Bug was fixed with setting the incremental flag in TransformerFactoryImpl.  Clearly the change was made but never tested.  Simply a missing 'else'.<br/><br/></li>
-       <li>Fix for Bugzilla Bug 2275, Xalan did not fire the right templates.  This was substantial and somewhat risky.  Xalan had several problems related to the last() function.  Fixes cover four axes files.<br/><br/></li>                     
-       <li>Change PrintTraceListener to output the file, as well as the line numbers.  This is really a feature change, but simple, and aids diagnosing problems with multi-part stylesheets.<br/><br/></li>       
-       <li>XPath fix: the XPath API wasn't working correctly due to a problem with with NodeSet/NodeIterator adapters.  This fix ended up interacting quite a bit with the #2275 fix.<br/><br/></li>
-       <li>Fix for the Norm Walsh bug posted 06/20/2001: iterators weren't always being cloned correctly from the variable value stack.  This fix is not without some risk, though we haven't seen any problems since Scott Boag made it.<br/><br/></li>
-       <li>David Bertoni added missing html element properties to SerializerToHTML.java.<br/><br/></li>
-       <li>Shance Curcuru modified TransformerFactoryImpl.setAttribute() to accept a String ("true" or "false") as well as a Boolean object to set the value of a Boolean attribute.<br/><br/></li>
-       <li>TransformerHandlerImpl was threading when incrementality is turned off. Scott Boag has fixed this bug.</li>       
-     </ul>
-</s3>     
-   <anchor name="dtm"/>
-     <s3 title="Changes for &xslt4j; 2.2.D2">
-     <p>This release includes the following changes:</p>
-     <ul>
-       <li>Deprecation of the <link idref="usagepatterns" anchor="compat">Xalan-Java 1 compatiblity API</link></li>
-       <li>The DTM</li>
-       <li>Other optimization work</li>
-     </ul>
-     <p>The primary focus of the 2.2 Developer releases is incorporation of all our work over the past several months on the Document Table
-      Model (<link idref="dtm">DTM</link>).</p>
-
-<p>As a result of the changes in *internal* api, you may encounter problems with extensions. We have done some bug fixing in support
-for extensions since 2.2.D1.  John Gentilin is working on fixing the SQL library extension,which currently is broken. Please report 
-any problems you find (see <link anchor="bugs">bugs</link>).</p>
-
-<p>The DTM and related work provides faster performance and less accumulation of garbage... though it is an
-ongoing battle.  Brief summary:</p>
-<ul>
-<li>The DTM identifies nodes with 32-bit integer handles.
-The DTM has many features, including direct character dispatch to SAX2,
-native DTM iterators and "traversers", multiple document management, etc.<br/><br/></li>
-<li>Joe Kesselman's CoRoutine parsers, which are in a threaded SAX flavor
-and in a Xerces parseMore() flavor (no threads).  These do away with the
-"race" conditions that occured in the original code, and should make Xalan
-much more robust.<br/><br/></li>
-<li>*Much* more robust XPath itteration.  The "waiting" iterators of old are
-no more, and good riddance.  There is stil lots more we want to do with
-this mechanism.  (There is something here called MatchIterators, but it's
-not being used yet for various reasons.  We will be taking advantage of
-these down the line.)<br/><br/></li>
-<li>A fair amount of XObject creation reduction.  You can now get boolean,
-number, nodeset, and string values directly from an Expression, instead of
-going through an XObject.<br/><br/></li>
-<li>XMLString, which allows us to work with string objects that don't wrap
-Java's String object. These objects get their character data from an array or
-Fast String Buffer.<br/><br/></li>
-<li>Serializers now only do internal buffering if they know they are writing
-to a FileStream.<br/><br/></li>
-<li>The variable stack mechanism has been redisigned, so that it is no
-longer so interpretive, and we believe it is much more robust.<br/><br/></li>
-<li> Some small amount of stylesheet rewriting (but not yet redundent
-expression elimination), in particular to reduce full RTF creation and
-interpretation.</li>
-</ul>
-<p>&xslt4j; implements two DTM performance features that you can control with the TransformerFactory
-<jump href="apidocs/javax/xml/transform/TransformerFactory.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute()</jump>
-method. See <link idref="dtm" anchor="settings">DTM performance settings</link></p>
-     </s3>
-     <s3 title="Changes for &xslt4j; 2.1.0">
-     <p>This release includes a number of bug fixes to &xslt4j; and TrAX. 
-     We have also enhanced the ApplyXSLT servlet. It can now be set up to use a compiled Templates object to respond to multiple
-     client transformation requests involving the same stylesheet.</p>
-<!--This XML fragment contains a list of source code updates to place in an <s3> section of readme.xml--><p>Core source code updates:</p><ul><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>03/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor StylesheetHandler.java
- java/src/org/apache/xpath Expression.java XPath.java
- XPathContext.java
- java/src/org/apache/xpath/compiler Compiler.java
- XPathParser.java<br/><ref>Committer's log entry: </ref>Renamed "assert()" to "assertion()".
-
- Assert can be a keyword, and brake the compilation.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer KeyWalker.java<br/><ref>Committer's log entry: </ref>Throw an error message if the key name in a key function was not defined<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>03/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils FastStringBuffer.java<br/><ref>Committer's log entry: </ref>Reworked "chunk growth" algorithm again. Growing mode not
- yet adequately tested, but fixed-size mode (which is what Xalan
- is currently using) is simpler code and shows improved performance.<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>03/20/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xslt EnvironmentCheck.java<br/><ref>Committer's log entry: </ref>Utility class to check your JVM environment for common problems<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>03/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt EnvironmentCheck.java<br/><ref>Committer's log entry: </ref>Added more .jar sizes to jarVersions listing<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>03/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils FastStringBuffer.java<br/><ref>Committer's log entry: </ref>We've reworked the algorithm again. The fixed-chunk-size mode (initial
- and max. chunk sizes equal) runs essentially unchanged, though with a
- few cycles less overhead. The variable-chunk-size mode now uses a
- recursive-encapsulation scheme, where the first chunk may itself be a
- FastStringBuffer whose total length equals one chunk; every so often
- we push the existing data down one level and restart with a larger
- chunk size. The new scheme has been stress-tested and is apparently
- working. At this writing, however, Xalan uses only the fixed-size
- mode (initial size equals max size), and no effort has been made to
- find the optimial values for the tuning parameters. It does appear
- likely that the best values will vary with usage patterns, but we hope
- to find a good compromise.
-
- I'll probably be putting this aside for a while to work on other things.
- If someone wants to experiment with varying the block sizes and
- how frequently they grow, and suggest good performance/memory
- tradeoff points, go for it!<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>03/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils FastStringBuffer.java<br/><ref>Committer's log entry: </ref>Minor tweak to the javadoc.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>03/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils FastStringBuffer.java<br/><ref>Committer's log entry: </ref>reset() versus setLength(0).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/26/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemForEach.java<br/><ref>Committer's log entry: </ref>Fix for bug# 1116, getMatchedTemplate throws ClassCastException.
- Don't push template unless it is a xsl:template.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/26/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates OutputProperties.java<br/><ref>Committer's log entry: </ref>Patches submitted by Patrick Moore &lt;patrickm@rioport.com&gt;
- on 03/15/2001 01:25 PM:
-
- This proposed change does a number of things:
-
- 1. Problem: HTML output method does not uses XML output properties as
- default.
-
- In both org/apache/xalan/templates/output_html.properties and in the java
- doc for
- org/apache/xalan/templates/OutputProperties#getDefaultMethodProperties(Strin
- g) It specifically states that all OutputProperties use the
- output_xml.properties as a base. In the code this is not true for html. This
- is now changed to match the comments
-
- 2. Problem: unclear IOException.
-
- If there was a problem loading the XML properties file. The wrapped
- exception now will say which file was trying to be loaded. If the file did
- not exist I was getting a very strange "Stream closed" IOException message.
-
- 3. Problem: the streams were not closed after reading the property file.
-
- Fixed.
-
- 4. Problem: the double-check locking mechanism does not work in Java (see
- bug #919)
-
- &lt;http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-toolbox.html&gt;
-
- 5. QUESTION: now if there is a default properties (i.e.
- output_xml.properties has been loaded) but the expected properties file does
- not exist a error message will be printed to System.err and the processing
- will continuing using just the default properties (output_xml.properties) I
- felt that this is the best behavior.
-
- (comment by sboag: I think it's better to
- throw a runtime exception in this case.
- but we can discuss this over time. For now
- the patch was modified to do the runtime exception).<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLTSchema.java
- java/src/org/apache/xalan/stree SourceTreeHandler.java
- java/src/org/apache/xalan/templates ElemForEach.java
- ElemLiteralResult.java
- java/src/org/apache/xalan/transformer QueuedSAXEvent.java
- ResultTreeHandler.java TransformerImpl.java
- java/src/org/apache/xml/utils BoolStack.java
- java/src/org/apache/xpath XPathContext.java<br/><ref>Committer's log entry: </ref>This check-in contains a couple things that overlapped on my
- system, so I'm checking them in together.
- 1) Unfinished (in progress) implementation of TransformSnapshot mechanism,
- which will hopefully allow a result ContentHandler to take a snapshot
- at a given point, and the restart execution from that point at some
- later time. For tooling support.
- 2) Check to make sure SourceTreeHandler isn't being entered twice,
- which is related to the cocoon bug from a couple of weeks ago. This
- will just help diagnose such a problem in the future.
- 3) Removed the error stack trace print from postExceptionFromThread.
- 4) Report exception in SourceTreeHandler#endDocument after
- the join, if we can determine that the posted exception won't be
- caught elsewhere.
- 5) removed some catches that simply rethrew the exception
- (thanks to Patrick Moore &lt;patrickm@rioport.com&gt;).
- See my note on 3/27/2001 to Patrick for more info
- on the last two.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/27/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/transformer TransformSnapshot.java
- TransformSnapshotImpl.java<br/><ref>Committer's log entry: </ref>Unfinished (in progress) implementation of TransformSnapshot mechanism,
- which will hopefully allow a result ContentHandler to take a snapshot
- at a given point, and the restart execution from that point at some
- later time. For tooling support.on the last two.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/29/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- ProcessorStylesheetElement.java
- ProcessorTemplateElem.java StylesheetHandler.java
- XSLTElementDef.java XSLTElementProcessor.java
- XSLTSchema.java<br/><ref>Committer's log entry: </ref>Try to catch element order and required element errors during stylesheet 
-object creation. This new code adds an order and a required field to 
-XSLElementDef objects where it is applicable.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>04/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Fix bugzilla bug 1170. If we're trying an xsl:apply-imports at the top level 
-(ie there are no
- imported stylesheets), we need to indicate that there is no matching template 
-and prevent and infinite recursion by using the built-in template.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>04/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions MethodResolver.java<br/><ref>Committer's log entry: </ref>Code cleanup submitted by Art Welch &lt;art_w@EASTPOINT.COM&gt;.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils TreeWalker.java<br/><ref>Committer's log entry: </ref>Add locator support to TreeWalker<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>04/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- QueuedStartElement.java<br/><ref>Committer's log entry: </ref>Small fix made for getCurrentNode.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>04/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils TreeWalker.java<br/><ref>Committer's log entry: </ref>Commented out extra call to getData()... this could be a big performance
- improvement for some stylesheets.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformSnapshotImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>Additional support for tooling. Allow tools to take a snapshot of context and 
-restart execution at that point.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- XSLTElementProcessor.java
- java/src/org/apache/xalan/res XSLTErrorResources.java
- java/src/org/apache/xalan/transformer
- TransformSnapshotImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>Misc stuff left out from previous check in<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/functions FuncCurrent.java<br/><ref>Committer's log entry: </ref>Don't assume that the object returned by getSubContextList() is a 
-PredicatedNodeTest object.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor ProcessorInclude.java
- TransformerFactoryImpl.java
- java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java
- java/src/org/apache/xml/utils TreeWalker.java<br/><ref>Committer's log entry: </ref>Create new TreeWalker constructor that takes a systemId parameter. Change 
-TreeWalker to change fields in the locator and not set it for each node.<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>04/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath XPath.java<br/><ref>Committer's log entry: </ref>Fix Bugzilla bug:
- PR: 1106
- Submitted by: elharo@metalab.unc.edu<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>04/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql QueryParameter.java
- SQLExtensionError.java XConnection.java<br/><ref>Committer's log entry: </ref>Minor Javadoc updates (add @author name, remove declared but unthrown @throws)<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>04/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql Column.java
- ColumnAttribute.java ColumnData.java
- ColumnHeader.java Row.java RowSet.java
- StreamableNode.java XConnection.java
- XStatement.java<br/><ref>Committer's log entry: </ref>Support for Streamable Mode- John Gentilin<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>04/24/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/objects XObject.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla bug 1015 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1015&gt;.
- Fix prevents null pointer exceptions when null non-XSLT arguments are
- passed to an extension function.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>04/24/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions MethodResolver.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla bug 1015 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1015&gt;.
- Fix prevents null pointer exceptions when null non-XSLT arguments are
- passed to an extension function.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/24/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Fix copy/paste error. Want to use TransformerFactoryImpl's class loader.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>04/24/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformSnapshotImpl.java<br/><ref>Committer's log entry: </ref>Keep a copy of current contextNodeList is there is one<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>04/25/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt EnvironmentCheck.java<br/><ref>Committer's log entry: </ref>Added checkDirForJars() which checks java.ext.dirs as well now<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>04/26/2001<br/><ref>Added: </ref>java/src/javax/xml/transform package.html
- java/src/javax/xml/transform/dom package.html
- java/src/javax/xml/transform/sax package.html
- java/src/javax/xml/transform/stream package.html<br/><ref>Committer's log entry: </ref>Add package.html for each package in javax.xml.transform.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>04/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Resolve bug 1496 &lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1496&gt; 
-where xsl:param statements were not being reset properly if the TransformerImpl 
-was reused.<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>04/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/stree DocImpl.java<br/><ref>Committer's log entry: </ref>Fix for #1561<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>04/29/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/functions FuncExtFunction.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla bug 1373 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1373&gt;.
- Added code to support return of Integer or Long by an external function.
- Code was contributed by Patrick Moore &lt;patmoore@ieee.org&gt;.<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>05/03/2001<br/><ref>Modified: </ref>java/src/javax/xml/transform/stream StreamResult.java
- StreamSource.java<br/><ref>Committer's log entry: </ref>Small fix to avoid file:////path that may fail on some JDK.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>05/04/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql package.html<br/><ref>Committer's log entry: </ref>Preliminary updates for John G's work.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>05/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Check for a null contextNodeList before returning its clone<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>05/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/stree StreeDOMBuilder.java<br/><ref>Committer's log entry: </ref>Set the element's level correctly, before we process attributes.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java<br/><ref>Committer's log entry: </ref>Resolve bugzilla 1648 
-(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1648).
- TransformerIdentityImpl was improperly using an old LexicalHandler when 
-invoked for a second transform.
- This bug only affects identity transforms with StreamResults.
- Many thanks to John Keyes &lt;johnkeyes@yahoo.com&gt; for reporting this bug.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>05/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>Updated version number to 2.1.0<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>05/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTInfo.properties<br/><ref>Committer's log entry: </ref>Updated version number to 2.1.0<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/functions FuncExtFunction.java<br/><ref>Committer's log entry: </ref>Change submitted by Patrick Moore &lt;patmoore@ieee.org&gt; as part of bugzilla 
-1373 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1373).
- Return value from extension function is now generalized so that all 
-derivatives of Number are now properly handled.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>05/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLTSchema.java<br/><ref>Committer's log entry: </ref>Set the correct order of xsl:include elements<br/><br/></li><li><ref>Committed by </ref>johng@apache.org<ref> on </ref>05/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql Column.java
- ColumnAttribute.java ColumnData.java
- ColumnHeader.java ConnectionPool.java
- DefaultConnectionPool.java ExtensionError.java
- PooledConnection.java QueryParameter.java Row.java
- RowSet.java SQLExtensionError.java
- StreamableNode.java XConnection.java
- XConnectionPoolManager.java XStatement.java
- package.html<br/><ref>Committer's log entry: </ref>Updates Javadocs
- Submitted by:John Gentilin mailto://johnglinux@eyecatching.com<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Correct typo introduced in revision 1.30 causing problems with transforms on 
-Unix platforms.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemChoose.java<br/><ref>Committer's log entry: </ref>Correct bugzilla bug 1748 
-&lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1748&gt;.
- When evaluating xsl:when, the xsl:choose element was used to resolve 
-namespace prefixes instead of
- the xsl:when element itself. This caused namespace prefixes defined on the 
-xsl:when to be ignored.<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>05/15/2001<br/><ref>Modified: </ref>java/src/javax/xml/parsers DocumentBuilderFactory.java
- SAXParserFactory.java
- java/src/javax/xml/transform TransformerFactory.java<br/><ref>Committer's log entry: </ref>Use the context class loader if available.
-
- The implementation is based on ExtensionHandler, and it's needed in order
- to work in certain environments ( like tomcat ).<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>05/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions ExtensionHandler.java
- ExtensionHandlerGeneral.java<br/><ref>Committer's log entry: </ref>Make getClassForName a public method. There are few other places in xalan
- where Class.forName is used, and this can create problems in some cases
- where the Thread.getContextClassLoader should be used.
-
- getClassForName uses introspection to call getContextClassLoader
- ( so it works in JDK1.1 ).
-
- In ExtensionHandlerGeneral, use the thread loader to find BSF ( it may be
- possible that xalan is installed in CLASSPATH, but BSF is in a webapp ).<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>05/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- CompilingStylesheetHandler.java
- java/src/org/apache/xalan/serialize SerializerFactory.java<br/><ref>Committer's log entry: </ref>2 more instances where Class.forName was used.
-
- Use the method in ExtensionHandler for consistency ( we could move it in
- org.apache.xml.utils, but for now it's easier to just use it as it is )<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>05/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/stree SourceTreeHandler.java
- java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>This is the "thread pooling hook".
-
- It slightly changes the API used to create and wait for the transform thread.
- Instead of using threadCreate() and Thread.start() that creates a new thread
- and thread.join() that waits for a thread to end, we now use a 
-ThreadControler
- class that has the equivalent methods:
- - run( Runnable ) - executes a task in a thread. The default implementation
- is identical with what we had, using new Thread() and start()
- - waitTread() - waits for a task to end. The default impl. is identical with
- the previous code, using thread.join().
-
- Someone wanting to use a thread pool for xalan will have to extend
- the ThreadControler and override the 2 methods, then call setThreadController.
-
- Xalan itself doesn't implement a thread pool right now ( for mosts uses it's
- not even needed - if you just do few transforms for example ), instead
- a server that runs xalan could plug it's own thread pool.<br/><br/></li><li><ref>Committed by </ref>Gary L Peskin &lt;garyp@firstech.com&gt;<ref> on </ref>05/15/2001<br/><ref>Committer's log entry: </ref>
-&gt; Use the context class loader if available.
-&gt;
-&gt; The implementation is based on ExtensionHandler, and it's needed in order
-&gt; to work in certain environments ( like tomcat ).
-&gt;
-&gt;<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>05/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ExtensionError.java<br/><ref>Committer's log entry: </ref>Fixed "conflict" in javadoc comments.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>05/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql package.html<br/><ref>Committer's log entry: </ref>Editing pass.<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>05/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc TransletOutputHandler.java<br/><ref>Committer's log entry: </ref>bug # 1406 fixed, omit xml header implemented<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>05/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Update Javadoc and remove commented out reference to properties file
- PR:Bugzilla1627<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer ResultTreeHandler.java<br/><ref>Committer's log entry: </ref>Resolve bug 1330 &lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1330&gt;.
- setContentHandler failed to also reset m_lexicalHandler if the ContentHandler
- was also a LexicalHandler. This caused the old LexicalHandler to be used 
-which
- was pointing to a previous result tree.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Resolve bug 1762 &lt;http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1762&gt;.
- TransformerFactoryImpl's URIResolver was not propagated to created 
-Transformers.
- Modified code to propagate.<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>05/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils TreeWalker.java
- SystemIDResolver.java<br/><ref>Committer's log entry: </ref>Catch SecurityException whenever accessing System.getProperty("user.dir");
- minor javadoc update<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>05/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemCopy.java
- ElemValueOf.java
- java/src/org/apache/xalan/transformer TreeWalker2Result.java
- java/src/org/apache/xpath/functions FuncLast.java<br/><ref>Committer's log entry: </ref>Fix for bugs reported by the Eclipse folks for TransformState, where
- some operations (xsl:value-of, xsl-copy) were not pushing the
- current node on the current node stack. Addresses
- http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1524.<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>05/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates OutputProperties.java<br/><ref>Committer's log entry: </ref>Catch SecurityException as needed
- PR: Bugzilla1258<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates OutputProperties.java<br/><ref>Committer's log entry: </ref>Fix to the following bug reported by dims@yahoo.com:
-
- loadPropertiesFile method in org\apache\xalan\templates\OutputProperties.java 
-does not fall back
- to the Thread Context Class Loader to load properties files like 
-output_xml.properties etc. This
- is causing problems in ServletExec_3_1+C2.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates OutputProperties.java<br/><ref>Committer's log entry: </ref>Correct implementation of ContextClassLoader to support case where properties 
-file is to be loaded by a different ClassLoader than the OutputProperties 
-class. Thanks to Davanum Srinivas &lt;dims@yahoo.com&gt; for this code and for 
-reporting this bug.
- loadPropertiesFile should eventually be moved into a thread-specific class.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>05/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- TransformerFactoryImpl.java
- java/src/org/apache/xalan/serialize CharInfo.java
- java/src/org/apache/xpath/functions FuncSystemProperty.java<br/><ref>Committer's log entry: </ref>Modify getResourceAsStream calls to use the contextClassLoader, if available.
- This is a temporary fix until we can centralize this function.<br/><br/></li></ul><note>This release includes no updates of the compatibility source code.</note>
- </s3>
- 
-<s3 title="Changes for &xslt4j; 2.0.1">
-<p>This release includes a number of bug fixes to the &xslt4j; and TrAX core and Xalan-Java 1 compability API. We have also</p>
-<ul>
-  <li>Entered all known &xslt4j; 2 <link anchor="bugs">bugs</link> in the Apache Bugzilla database<br/><br/></li>
-  <li>Added support for using custom URIResolver, EntityResolver, and ContentHandler implementations with the <link
-      idref="commandline">command-line utility</link><br/><br/></li> 
-  <li>Upgraded from Ant 1.2 to Ant 1.3 for our <link anchor="build">builds</link> (the new ant.jar is in the bin directory).</li>
-</ul>
-<p>Core source code updates:</p>
-<ul>
-<li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes ChildWalkerMultiStep.java<br/><ref>Committer's log entry: </ref>Fix for bug reported by "Chris P. McCabe" &lt;chris_mccabe@choicehotels.com&gt;
- 02/06/2001 06:55 PM.
- Defensive fix for if the last used walker is null, then don't check to
- see if it is a fast walker! Without this, a null pointer exception is
- very possible.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Fixes for exceptions being thrown that weren't being passed through
- the error listener.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes FollowingWalker.java<br/><ref>Committer's log entry: </ref>Fix for bug reported by Dave Haffner &lt;dave.haffner@xmls.com&gt;
- 02/06/2001 04:03 AM
- In parentNode(), don't screen out nextAncestor, since the parent
- is never actually returned. This sets things up correctly for firstChild
- and nextSibling.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes PrecedingWalker.java<br/><ref>Committer's log entry: </ref>Fix for bug reported by Dave Haffner &lt;dave.haffner@xmls.com&gt;
- 02/06/2001 04:03 AM
- In nextSibling(), don't return null if isAncestorOfRootContext, instead
- do next.getFirstChild().<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath SourceTreeManager.java<br/><ref>Committer's log entry: </ref>Fix for bug reported by anders.domeij@uc.se
- 02/07/2001 09:35 AM
- removed extra bogus TransformerException decl in resolveURI<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/stree SourceTreeHandler.java<br/><ref>Committer's log entry: </ref>Fix bug reported by Jason Harrop &lt;jharrop@bigpond.net.au&gt;
- 02/07/2001 08:12 PM
- Don't process comment or whitespace events if inside a startDTD/endDTD
- event.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/axes WalkerFactory.java<br/><ref>Committer's log entry: </ref>In indirect response to bug posted by "Thee Boon Hoo" &lt;theebh@newstakes.com&gt;
- 02/07/2001 09:37 PM
-
- "//table[1]" patterns would give one node
- when they should have given 2, when applied to Boon Hoo's
- source.
- "//table[1]" is equivelent to
- "/descendant-or-self::node()/table[1]",
- and so must return the first table child
- of each table-inst element.
-
- An optimization was optimizing this to
- "/descendant-or-self::table, which is
- fine as long as indexing isn't used. Since
- we can not tell until runtime if indexing
- is being used, we have to turn of this
- optimization for all predicated "//foo[xx]"
- patterns.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor StylesheetPIHandler.java
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Patch for Dmitri IIyin to use the specified URIResolver.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemNumber.java<br/><ref>Committer's log entry: </ref>Number Expression should be evaluated then rounded up.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Create a document fragment for the output node, for -flavor d2d.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/compiler Compiler.java<br/><ref>Committer's log entry: </ref>Better error message when quo is used.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemCallTemplate.java
- ElemChoose.java ElemCopy.java ElemFallback.java
- ElemIf.java ElemLiteralResult.java
- ElemTemplate.java
- java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Remove extra method/call to TransformerImpl.executeChildTemplates()<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/patterns NodeTest.java<br/><ref>Committer's log entry: </ref>Return an empty string instead of null from getLocalName() when the
- nodetest does not have a name. Encountered with the SQL extension,
- in response to bug reported by "Michael Kay" &lt;mhkay@iclway.co.uk&gt;,
- 02/08/2001 08:57 AM.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ColumnData.java<br/><ref>Committer's log entry: </ref>In getData() return an empty string instead of null if there is
- no data to be obtained.
- In response to bug reported by "Michael Kay" &lt;mhkay@iclway.co.uk&gt;,
- 02/08/2001 08:57 AM.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>02/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/extensions MethodResolver.java<br/><ref>Committer's log entry: </ref>Correct ConversionInfo array for Node-Set and RTF. Remove DocumentFragment 
-from RTF and replace with NodeList. Remove duplicate Boolean from both. Fix 
-Boolean conversion to make java.lang.Boolean higher than string.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ColumnHeader.java
- RowSet.java XStatement.java<br/><ref>Committer's log entry: </ref>Use null nodetest to mean the same as "node()". This fixes a bug reported
- by "Voytenko, Dimitry" &lt;DVoytenko@SECTORBASE.COM&gt;
- where &lt;xsl:copy-of select="sql:query(...)"/&gt;
- crashes with NullPointerException, i.e.
- there are cases where we really don't want
- to set the NodeTest.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/compiler XPathParser.java<br/><ref>Committer's log entry: </ref>Check for null token before checking if it is a letter<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java<br/><ref>Committer's log entry: </ref>Fix made for bug reported by "Glencross, Christian" 
-&lt;Christian.Glencross@gs.com&gt;
- on 02/16/2001 10:18 AM.
- Xerces 1.2.3 SAX parser calls
- handler.setDocumentLocator() before handler.startDocument().
- TransformerIdentityImpl.m_resultContentHandler isn't initialised until
- TransformerIdentityImpl.startDocument() is called.
- Added lazy construction of result handler
- in setDocumentLocator, in addition to
- startDocument.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>02/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib Extensions.java<br/><ref>Committer's log entry: </ref>Correct implementation of string value of a node.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>02/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql Column.java
- ColumnAttribute.java ColumnData.java
- ColumnHeader.java Row.java RowSet.java
- StreamableNode.java XConnection.java
- XStatement.java package.html<br/><ref>Committer's log entry: </ref>Added experimental usage metatag to all classes in this package,
- and an explanatory note to package.html.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/stree ElementImpl.java<br/><ref>Committer's log entry: </ref>Bug fix attributed to Norman Walsh &lt;ndw@nwalsh.com&gt;, on
- 02/20/2001 09:50 AM. if the attribute 'name' doesn't occur in the AttList, 
-the
- result of getIndex(name) is -1, but
- getChildAttribute() would incorrectly
- return the first attribute. Fix returns
- null if index &lt; 0.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize SerializerToXML.java
- java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java<br/><ref>Committer's log entry: </ref>Implement DeclHandler for identity transforms<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>02/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Fix for bug originally reported by Daryl Beattie &lt;DarylB@screamingmedia.com&gt;
- on 02/14/2001 04:16 PM. A hang was occuring inside the use
- of a Result Tree Fragment. When the result tree fragement was
- being created, the Redirect extension was being called, which
- called createResultContentHandler which set the ContentHandler
- in the Transformer, but not in the ResultTreeHandler. Then, Redirect
- called Transformer#executeChildTemplates(
- ElemTemplateElement elem, Node sourceNode, QName mode, 
-ContentHandler handler)
- which saves the reference to the original content handler in
- the transformer, and then sets the new one by calling setContentHandler,
- which sets the ContentHandler in the ResultTreeHandler as well
- as the Transformer. When it tried to restore the old ContentHandler,
- it restored the value in the ResultTreeHandler to a Serializer, instead
- of the correct ContentHandler. When transformToRTF then called
- endDocument on it's resultTreeFragment, the event was sent
- to the Serializer instead of the SourceTreeHandler, and thus the
- isComplete flag was not set, and thus the hang. (whew!)
- The fix is in executeChildTemplates save the value of the
- resultTreeHandler's contentHandler as well as Transformer's
- content handler, and restore them both. A more architectual fix
- could be made, but not without high risk, so I think this is the best
- and safest way to fix it.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>02/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTInfo.properties<br/><ref>Committer's log entry: </ref>Changed version to 2.0.1<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>02/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor XSLProcessorVersion.java<br/><ref>Committer's log entry: </ref>Changed version to 2.0.1<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>02/28/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTErrorResources.java<br/><ref>Committer's log entry: </ref>Update text of error messages
- Submitted by: Andreas Zehnpfund<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>02/28/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Update printArgOptions() with better text and to better reflect actual
- options that are currently supported; catch missing -IN argument<br/><br/></li><li><ref>Committed by </ref>jkesselm@apache.org<ref> on </ref>03/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/client XSLTProcessorApplet.java
- java/src/org/apache/xalan/processor StylesheetHandler.java
- TransformerFactoryImpl.java
- java/src/org/apache/xalan/stree DocImpl.java
- StreeDOMBuilder.java TextImpl.java
- java/src/org/apache/xalan/templates OutputProperties.java
- java/src/org/apache/xalan/xslt Process.java
- java/src/org/apache/xml/utils FastStringBuffer.java
- java/src/trax trax.properties<br/><ref>Committer's log entry: </ref>New approach to FastStringBuffer, and changes needed to support it.
- We still need to do some serious work on both the initial values of the
- tuning parameters and the heuristics driving the "chunk growth" algorithms.
- Currently set for fixed-sized chunks of 8Kch in main tree, .5Kch in RTF.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemElement.java
- ElemForEach.java ElemLiteralResult.java
- java/src/org/apache/xalan/transformer
- ClonerToResultTree.java QueuedSAXEvent.java
- QueuedStartDocument.java QueuedStartElement.java
- ResultTreeHandler.java TransformerImpl.java
- TreeWalker2Result.java<br/><ref>Committer's log entry: </ref>Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=741.
-
- 1) ResultTreeHandler now implements the TransformState interface.
- 2) Queued state such as the current node and the current template is stored 
-as part of QueuedStartElement. Storage will only occur if the ContentHandler 
-implements TransformClient.
- 3) When state is requested (for instance TransformState#getCurrentElement()), 
-if the queued element is null or not pending (for instance, in a characters 
-event), it will get the state from the transformer, otherwise it will get the 
-state from the queued element.
-
- Other fixes were attempted for this problem, including trying to
- get rid of queueing altogether, and flushing a bit earlier before
- the state was pushed on the various stacks, but both of
- these had show-stopping issues (see discussions
- on xalan-dev).
-
- Note that for the moment the ContextNodeList is node
- cloned as it needs to be in order for
- TransformState#getContextNodeList.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>03/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemParam.java
- java/src/org/apache/xpath Arg.java VariableStack.java<br/><ref>Committer's log entry: </ref>The field Arg.isParamVar was attempting to serve two functions: to indicate 
-variable Frame entries which are not currently activated and to indicate Frames 
-containing parameters passed with xsl:with-param. When processing was finished 
-for a node in a node-set, the isParamVar flag was turned on to indicate the 
-Frame slot was available. Unfortunately, this also indicated that the item was 
-passed as a parameter which it wasn't. This fix changes isParamVar into to 
-fields, isAvailable which indicates that the slot is available and 
-isFromWithParam indicating the Frame slot came from an xsl:with-param or a 
-top-level parameter passed in via the tranformerImpl.setParameter() API.
- I have tested this change against the conformance suite and had no 
-regression. I've also submitted a test case which fails on the existing 
-codebase but works okay after this fix.
- It is possible that I've missed something with regard to the API setParameter 
-calls but we can fix those if problems are reported.<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>03/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils FastStringBuffer.java<br/><ref>Committer's log entry: </ref>Correct operation when length of content to be appended is zero.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize SerializerToXML.java<br/><ref>Committer's log entry: </ref>Fix closing out doctype declaration<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils SystemIDResolver.java<br/><ref>Committer's log entry: </ref>Change SystemIdResolver to default to user.dir if the base URI is null<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>03/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java
- java/src/org/apache/xpath VariableStack.java<br/><ref>Committer's log entry: </ref>Parameters set with setParameter were available to stylesheet as variable 
-references ($myParam) even though there was no xsl:param element to receive it.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer
- TransformerIdentityImpl.java<br/><ref>Committer's log entry: </ref>Check if there is a DeclHandler before calling it.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils WrappedRuntimeException.java<br/><ref>Committer's log entry: </ref>Patch attributed to Patrick Moore &lt;patrickm@rioport.com&gt; on 03/09/2001.
- Adds another constructor to pass in the error message.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemAttribute.java
- ElemElement.java<br/><ref>Committer's log entry: </ref>Checkin addresses http://nagoya.apache.org/bugzilla/show_bug.cgi?id=923.
- elemAttribute now derives from elemElement so the basic name resolution
- code can be shared. Breaks attribset24 test, but I think the newer
- behavior is better. New virtual methods overloaded by elemAttribute are
- constructNode, resolvePrefix, and validateNodeName. Also, in the
- elemAttribute#execute method, checks are made to make sure an
- element is pending.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils SystemIDResolver.java<br/><ref>Committer's log entry: </ref>Added getAbsoluteURI(String url), and merge
- with Myriam's changes.
- Part of fix for problem found when
- investigating http://nagoya.apache.org/bugzilla/show_bug.cgi?id=906.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Call getAbsoluteURI(String url) for the source URL.
- Fix for problem found when
- investigating http://nagoya.apache.org/bugzilla/show_bug.cgi?id=906.
- This tries to force us always having an absolute URL in the processing
- stack as the base URL, which should be OK, I hope.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer TransformerImpl.java<br/><ref>Committer's log entry: </ref>Call getAbsoluteURI(String url) for the source URL.
- Fix for problem found when
- investigating http://nagoya.apache.org/bugzilla/show_bug.cgi?id=906.
- This tries to force us always having an absolute URL in the processing
- stack as the base URL, which should be OK, I hope.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/transformer QueuedEvents.java
- QueuedStartElement.java ResultTreeHandler.java<br/><ref>Committer's log entry: </ref>The user for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=741 reported
- problems on testing, so these changes are a re-fix. He tested and
- everything seems OK now. There actually may be a slight performance
- improvement involved here.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize SerializerToHTML.java<br/><ref>Committer's log entry: </ref>Applied patches from dmitri.ilyin@memiq.com (Dmitri Ilyin)
- from http://nagoya.apache.org/bugzilla/show_bug.cgi?id=705.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath XPathAPI.java<br/><ref>Committer's log entry: </ref>Applied patch submitted by nboyd@atg.com (Norris Boyd)
- at http://nagoya.apache.org/bugzilla/show_bug.cgi?id=702.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/serialize Encodings.java<br/><ref>Committer's log entry: </ref>Applied patch submitted by havardw@underdusken.no (H嶡rd Wigtil).
- Also added "XXX-X" variants for all "XXX_X" java encoding names.
- I'm not totally confident that this is the right thing to do, but I can't
- see that it will hurt, except to make the table a bit larger. I
- would prefer to be safe and make sure we handle the encoding.
- See my comments in http://nagoya.apache.org/bugzilla/show_bug.cgi?id=718.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates ElemTemplateElement.java
- StylesheetRoot.java<br/><ref>Committer's log entry: </ref>Minor changes to better bottleneck throwing of Runtime exceptions
- during processing.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Catch all exceptions thrown when processing stylesheet, and send
- them to the error listener. There's probably some danger of having
- the same error sent to the error listener multiple times, but better too
- many reports, than none, I guess.
- This addresses http://nagoya.apache.org/bugzilla/show_bug.cgi?id=906.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql XConnection.java
- XStatement.java<br/><ref>Added: </ref>java/src/org/apache/xalan/lib/sql ConnectionPool.java
- DefaultConnectionPool.java ExtensionError.java
- PooledConnection.java QueryParameter.java
- SQLExtensionError.java XConnectionPoolManager.java<br/><ref>Committer's log entry: </ref>These are John Gentilin &lt;johnglinux@eyecatching.com&gt;
- patches for connection pooling and parameterized
- queries. These should be considered to be unstable
- right now, as we are still working on some things.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor ProcessorInclude.java
- TransformerFactoryImpl.java
- java/src/org/apache/xalan/serialize SerializerToXML.java
- java/src/org/apache/xalan/stree StreeDOMHelper.java
- java/src/org/apache/xalan/transformer ResultTreeHandler.java
- TransformerIdentityImpl.java TreeWalker2Result.java
- java/src/org/apache/xml/utils AttList.java TreeWalker.java
- java/src/org/apache/xpath DOM2Helper.java XPathContext.java<br/><ref>Committer's log entry: </ref>The DOM2Helper#isNodeAfter(Node node1, Node node2) method
- has been fixed so that it no longer does the try/catch thing if one
- of the nodes doesn't implement DOMOrder, but instead does an
- instanceof test. In StreeDOMHelper, it overloads this method and
- *does* do the try/catch business, since almost always both nodes
- will implement DOMOrder in this case, and this will be faster than
- an instanceof test. Also, in various classes, I did some stuff to try
- and make sure that a DOM2Helper wasn't being created and used
- when a StreeDOMHelper is needed.
-
- This addresses http://nagoya.apache.org/bugzilla/show_bug.cgi?id=800
- and should give a good performance fix for foreign DOM processing.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath/patterns NodeTest.java<br/><ref>Committer's log entry: </ref>Xerces at some point decided to use "" instead
- of null for null namespaces. There has been a
- discussion between Gary Peskin in
- Joe Kessleman on xalan-dev about this,
- but I hadn't been fully keeping up the the
- thread that well, and missed it's relation to
- this problem. I include some of the discussion
- at the end of this note. I made Xalan be able to
- compare a "" namespace to null for now, until
- we get this resolved.
-
- The gist of the discussion on xalan-dev regarding this is:
-
- &gt;&gt;1. Declare the Xerces-J support of schemas to have a bug and ask that
- &gt;&gt;Xerces be corrected to always use a null namespace URI to indicate that
- &gt;&gt;there is no default namespace. Even if the Xerces people change this
- &gt;&gt;behavior, is this correct?
- &gt;
- &gt; Yes. If your description of the problem is accurate (you should probably
- &gt; submit a more detailed case so it can be reproduced in the lab), this is a
- &gt; parser/DOM-builder bug.<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>03/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ExtensionError.java<br/><ref>Committer's log entry: </ref>Removed ( commented out ) dump() method and the imports in ExtensionError.
-
- So far the method doesn't seem to be used ( no warning in the compile ).
-
- The problem is that this method is breaking the build with crimson ( since
- it uses xerces-specific classes ). It is possible to implement it on top
- of the serialization classes that are part of xalan - if someone needs the
- method I'll try to port it.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils TreeWalker.java<br/><ref>Committer's log entry: </ref>Added back in the TreeWalker(ContentHandler contentHandler)
- constructor, because I'm worried I'll break more dependent code.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/res XSLTErrorResources.java
- java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Implement new arguments for the command line interface: URIResolver, 
-EntityResolver and ContentHandler<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/templates FuncFormatNumb.java<br/><ref>Committer's log entry: </ref>Fix error message to say that 2 or 3 arguments are required.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>03/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/processor ProcessorLRE.java
- java/src/org/apache/xalan/res XSLTErrorResources.java<br/><ref>Committer's log entry: </ref>Better error message for missing or incorrect XSLT namespace declaration in a 
-stylesheet<br/><br/></li><li><ref>Committed by </ref>garyp@apache.org<ref> on </ref>03/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib Redirect.java
- java/src/org/apache/xalan/transformer TransformerImpl.java
- java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Remember the Result that was used to trigger the transform. Access that 
-result from the Redirect extension to make file references in Redirect relative 
-to the original result URI.
- If this is not available, references are relative to the source URI.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xpath VariableStack.java<br/><ref>Committer's log entry: </ref>Added protection for null pointer exception that I discovered when
- running some Cocoon tests. Since I've never seen this before,
- I assume this is related to the changes that Gary made, but am
- unsure as it's 4:00 in the morning and I'm too tired to look into it deeply.<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>03/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>Remove check for missing -IN arg; there are a number of use
- cases for calling Process.main without an XML document<br/><br/></li><li><ref>Committed by </ref>costin@apache.org<ref> on </ref>03/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xslt Process.java<br/><ref>Committer's log entry: </ref>A (last ? ) place where XMLReaderFactory was used without
- trying jaxp first. I used the same code that is used in all other
- places in xalan.
-
- With this change, the parser defined in XSLTInfo.properties will be used
- only if jaxp is not available.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>03/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xml/utils StringVector.java<br/><ref>Committer's log entry: </ref>Added missing @serial Javadoc tags.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/lib/sql ConnectionPool.java
-                        DefaultConnectionPool.java ExtensionError.java
-                        SQLExtensionError.java XConnection.java
-                        XConnectionPoolManager.java XStatement.java<br/><ref>Committer's log entry: </ref>Update from John Gentilin &lt;johnglinux@eyecatching.com&gt; to
-  fix connection cleanup.<br/><br/></li></ul><p>Compatibility source code updates:</p><ul><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/02/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTInputSource.java
- XSLTResultTarget.java<br/><ref>Committer's log entry: </ref>Implement some more methods for compatibility<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>02/02/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTInputSource.java<br/><ref>Committer's log entry: </ref>Fixed javadoc for api that was just added back.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>02/02/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTResultTarget.java<br/><ref>Committer's log entry: </ref>Fixed javadoc for api that was just added back.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/02/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTEngineImpl.java<br/><ref>Committer's log entry: </ref>Fix problem with calling the processor with a liaison<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/02/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTEngineImpl.java<br/><ref>Committer's log entry: </ref>Fix problem where source file was being parsed more than once and if using an 
-input stream, we would get a read error<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/12/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTEngineImpl.java<br/><ref>Committer's log entry: </ref>Set system id in stylesheet handler<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/14/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTInputSource.java<br/><ref>Committer's log entry: </ref>Call local setSystemId.<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/15/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt XSLTEngineImpl.java<br/><ref>Committer's log entry: </ref>Fix problem with processing an input source created from a reader with no 
-systemId
- Fix problem with reading an input source file twice if it has a PI<br/><br/></li><li><ref>Committed by </ref>mmidy@apache.org<ref> on </ref>02/22/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xslt StylesheetRoot.java<br/><ref>Committer's log entry: </ref>Add getOutputMethod API.<br/><br/></li><li><ref>Committed by </ref>dleslie@apache.org<ref> on </ref>03/07/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xpath/xml
- XMLParserLiaisonDefault.java<br/><ref>Committer's log entry: </ref>Put in Apache copyright.<br/><br/></li><li><ref>Committed by </ref>sboag@apache.org<ref> on </ref>03/13/2001<br/><ref>Modified: </ref>java/compat_src/org/apache/xalan/xpath/xml TreeWalker.java
- java/compat_src/org/apache/xalan/xslt XSLTEngineImpl.java<br/><ref>Committer's log entry: </ref>Made changes for change to API for XalanJ2 TreeWalker, which
- now requires that the DOM helper be created by the caller.</li>
- </ul>
-</s3>
-
-<s3 title="Changes for &xslt4j; version 2.0.0">
-<p>Release 2.0 includes several bug fixes to the &xslt4j; and TrAX core and to the Xalan-Java 1 compatibility API. We also updated bsf.jar to the <resource-ref idref="bsf"/> release candidate 2.2, which fixes a bug running JPython extensions.</p>
-<p><em>Core bug fixes:</em></p>
-<ul>
-  <li>A threading problem showed up when using multiple processors. We fixed it by using a separate XPathContext object to do whitespace node
-   matches (xsl:strip-space).<br/><br/></li>
-  <li>Fixed a bug running Norm Walsh's DocBook stylesheets by not setting the variable stack position if the FilterExprWalker is not owned by a
-  top-level NodeIterator.<br/><br/></li>
-  <li>Fixed a problem with null namespace being passed from xsl:element. This bug also surfaced while processing DocBook
-   stylesheets.<br/><br/></li>
-  <li>In the interest of stability, we now treat "unknown error in XPath" as a fatal error.<br/><br/></li>
-  <li>Added support in stylesheet processing instructions for "text/xml" and "application/xml+xslt" mime types.<br/><br/></li>
-  <li>Fixed tokenizing of stylesheet processing instructions to allow parameters to be passed to server in href attributes.<br/><br/></li>
-  <li>Fixed a bug passing Transformer creation error messages to ErrorListener when an ErrorListener has been set on
-   TransformerFactory.<br/><br/></li>
-  <li>When using an Exception to instantiate a FactoryConfigurationError (extends Error), we now propagate the Exception message to 
-  super().<br/><br/></li>
-  <li>Added defensive code to ElemTemplateElement for handling a null URI.<br/><br/></li>
-  <li>When using an Exception to instantiate a TransformerException (extends Exception), we now propagate the Exception message to super() 
-  rather than a generic message.<br/><br/></li>
-  <li>Fixed a bug (the generation of an unwanted entity reference) performing the identity transformation 
-  (see <link idref="usagepatterns" anchor="serialize">Serializing output</link>) with an XML document containing a DOCTYPE
-   declaration.<br/><br/></li>
-   <li>Message manager modified so that the SourceLocator must always be passed in,
-  which will make a major difference in getting line number information.<br/><br/></li> 
-  <li>xsl:element's handling of namespace attribute and prefix in
-  name attribute changed so that it no longer manufactures prefixes...
-  it always tries its best to match the prefix entered.<br/><br/></li>  
-  <li>Bug fixed with namespace contexts in the stylesheet processor.
-  The bug could cause &lt;a xmlns:a="x"&gt;&lt;b&gt; to produce &lt;a xmlns:a="x"&gt;&lt;b xmlns:a="x"&gt;.<br/><br/></li>  
-  <li>Modified processing of xsl:message to enhance it as a debugging aid. Line numbers are now output with each
-  message. If the terminate attribute is true (the default is false) the message is sent to the console, and an exception is thrown with the
-  message "Stylesheet directed termination".<br/><br/></li>
-  <li>In TransformerException, check that the cause != null when checking for a contained exception.<br/><br/></li>
-  <li>Fixed a problem validating non-namespaced attributes and a problem allowing non-namespaced attributes to be children of the
-   stylesheet element.<br/><br/></li>
-   <li>Fixed checking of number of arguments in document() function.<br/><br/></li>
-   <li>Fixed problem with mutation of templates at run time. Templates resolution now takes place during the compose() method.<br/><br/></li>
-   <li>Fixed some minor threading issues in org.apache.xalan.stree (Child, Parent, ElementImpl, SourceTreeHandler).<br/><br/></li>
-   <li>Synchronized TrAX API functions subject to mutation to prevent mutation during a transformation.<br/><br/></li>
-   <li>Fixed bug reported by Jano Elovirta: substring() was returning an error if the start index is larger than the string.<br/><br/></li>   
-   <li>Set StringKey.toString() to return the underlying String (m_str), thus avoiding a potential symmetry problem with the equals() method
-   reported by Ito Kazumitsu.<br/><br/></li>
-   <li>In response to note from Ito Kazumitsu, changed Java encoding name "EUCJIS" in FormatterToXML to "EUC_JP".<br/><br/></li>
-   <li>When Xalan creates a FileOutputStream, it now closes the stream before exiting.<br/><br/></li>
-   <li>Fixed handling of an exception that can be thrown while building a DOM.<br/><br/></li>
-   <li>Fixed a problem reported by Dimitry Voytenko serializing compiled stylesheets.<br/><br/></li>
-   <li>For support of applets, modified TransformerFactory System.getProperty() calls to catch SecurityExceptions.<br/><br/></li>
-   <li>Fixed a bug reported by Krishna Mohan Meduri setting output properties.<br/><br/></li>
-   <li>Fixed error recovery when xsl:element encounters a bad name or unresolvable prefix.<br/><br/></li>
-   <li>Added AbstractMethodError handling to existing NoSuchMethodError handling as a fallback to the XMLReaderFactory for XML parsers that do
-       not implement the JAXP parsers interface for creating an XMLReader<br/><br/></li>
-   <li>Fixed bug with cloned iterators reported by Tim Sean.<br/><br/></li>
-   <li>Fixed null pointer exception that could occur with getValue("xxx").<br/><br/></li>
-   <li>Fixed bug reported by Tim Sean handling the xml:space attribute.</li>
-</ul>
-<p><em>Bug fixes in the <link idref="usagepatterns" anchor="compat">Xalan-Java 1 compatibility API</link>:</em></p>
-<ul>
-  <li>Fixed ProblemListener (for processing error messages) to derive from &xslt4j; 2 ErrorHandler.<br/><br/></li>
-  <li>Fixed evaluation of stylesheet string parameters to conform to &xslt4j; 1 behavior (expressions for &xslt4j; 1 vs. String objects 
-  for &xslt4j; 2).<br/><br/></li>    
-  <li>Added XPathSupport and XPathSupportDefault, and fixed the derivation of XObject sub-types (XString, etc.).<br/><br/></li>
-  <li>Fixed bug with XSLTProcessor process(xmlIn, null, out) method so that it uses the StylesheetRoot (if one exists) that has been created
-   with the processStylesheet() method.</li>
-</ul>
-<p>For a list of tasks in the &xslt4j2; To-Do list that have been completed, see <jump href="todo.html#release-date-completed">Tasks completed</jump>.</p>
-</s3>
-
-<s3 title="Changes for &xslt4j; version 2.0.D07">
-<p>&xslt4j; 2.0.D07 incorporates a <link idref="usagepatterns" anchor="compat">Xalan-Java 1 compatibility jar</link>, some performance enhancements, and a number of bug fixes for bugs found in version 2.0.D06.</p>
-<ul>
-<li>Fixed handling of disable-output-escaping="no".  Previously, once it was turned on, it could not be turned off.<br/><br/></li>
-<li>Fixed a bug with whitespace handling where Xalan was incorrectly checking for whitespace 
-    stripping before collation of multiple whitespace events into a single text node.<br/><br/></li>
-<li>Whitespace stripping wasn't working with input DOMs before.  This is now fixed.<br/><br/></li>
-<li>Fixed many exception handling problems and problems with error reporting.<br/><br/></li>
-<li>Fixed a bug resetting parameters in Transformer clearParameters().<br/><br/></li>
-<li>Fixed a bug where CDATA sections were not matching the text() node test.<br/><br/></li>
-<li>Made better memory allocation problem with result tree fragments.<br/><br/></li>
-<li>Made result tree fragment parsing of numbers consistent with strings.<br/><br/></li>
-<li>Exceptions thrown from extensions should now be properly reported via the error listener.<br/><br/></li>
-<li>Fixed hard-coded stack dump set off by m_reportInPostExceptionFromThread variable.<br/><br/></li>
-<li>Fixed intermittent threading problem with text nodes being dropped.<br/><br/></li>
-<li>Fixed problem with variable evaluation inside of union expressions.</li>
-</ul>
-</s3>
-<s3 title="Changes for &xslt4j; version 2.0.D06">
-<p>We have fixed the bugs reported in &xslt4j; 2.0.D05. Along with several other enhancements, 
-we have also fixed a number of bugs found by testing and our users:</p>
-<ul>
-<li>Fixed some threading problems and improved support for handling Exceptions thrown in a secondary thread.<br/><br/>
-Note: To support incremental output, &xslt4j; performs the transformation in a second thread while building the source tree in the main thread.<br/><br/></li>
-<li>Fixed problems encountered in piping (utilizing transformation output as input for another transformation).<br/><br/></li>
-<li>Fixed problems handling attributes and adding attributes to result tree.<br/><br/></li>
-<li>Added defensive checking for null entities, null namespaces, and empty strings passed in for URIs and local names.<br/><br/></li>
-<li>We now conform to the SAX convention of representing null namespaces with empty strings.<br/><br/></li>
-<li>Fixed a bug encountered evaluating a variable in a predicate expression applied to child nodes.<br/><br/></li>
-<li>Changed names of serializers from FormatterTo<ref>Xxx</ref> to SerializerTo<ref>Xxx</ref>. See 
-<jump href="apidocs/org/apache/xalan/serialize/package-summary.html">Package org.apache.xalan.serialize</jump>.<br/><br/></li>
-<li>Improved debugging support in a number of areas.</li>
-</ul>
-</s3>
-<s3 title="Changes for &xslt4j; version 2.0.D05">
-<p>All of the bugs reported in &xslt4j; 2.0.D01 have been fixed. The remainder of this section discusses two changes that we believe are of particular importance:</p>
-<p><em>TrAX</em></p>
-<p>The Transformation API for XML (TrAX) that &xslt4j2; implements has undergone substantial revisions since the release of &xslt4j; 2.0.D01. TrAX has joined the Java API for XML Parsing (JAXP) as part of the Sun&reg; <resource-ref idref="jsr063"/>. Accordingly, the TrAX package names have changed. The conceptual organization has also changed somewhat: The primary transformation interfaces are defined in javax.xml.transform, with concrete classes for managing stream input/output, SAX parsers and ContentHandler, and DOM parsers and DOM trees in javax.xml.transform.stream, javax.xml.transform.sax, and javax.xml.transform.dom. For more information, see <link idref="trax">TRaX (Transformation API for XML)</link>, and review <link idref="usagepatterns">Usage Patterns</link>.</p>
-<anchor name="outputprops"/><p><em>Output properties</em></p>
-<p>The handling of xsl:output properties has changed: org.apache.xalan.serialize.OutputFormat and apache.xalan.templates.OutputFormatExtended were removed and replaced with org.apache.xalan.templates.OutputProperties. The SerializerFactory getSerializer() method now takes Properties rather than a String indicating the output method. You can replace <code>getSerializer("xml")</code>, for example, with <code>getSerializer(OutputProperties.getDefaultMethodProperties("xml"))</code>.</p>
-<p>HTML, XML, and text xsl:output properties are specified in property files in org.apache.xalan.templates: output_html.properties, output_xml.properties, and output_text.properties.</p>
-<p>You can start using the output properties defined in these files in your stylesheets. For example, you can turn URL escaping off in HTML output with<br/><code>{http\u003a//xml.apache.org/xslt}use-url-escaping=no</code><br/>
-and you can control indenting with<br/>
-<code>{http\u003a//xml.apache.org/xslt}indent-amount=<ref>n</ref></code></p>
-<note>The colon after the "http" protocol must be escaped.</note>
-<p>Character-to-entity mapping is specified in org.apache.xalan.serialize: HTMLEntities.res and XMLEntities.res. You can override entity ref 
-mapping from a stylesheet. For example:</p>
-<source>&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-         xmlns:xalan="http://xml.apache.org/xslt" version="1.0"&gt;
-
-  &lt;xsl:output xalan:entities="myentities.ent"/&gt;
-
-  &lt;xsl:template match="/"&gt;
-    &lt;out&gt;&amp;#125;&lt;/out&gt;
-  &lt;/xsl:template&gt;
-
-&lt;/xsl:stylesheet&gt;</source>
-<p>=== myentities.ent ===</p>
-<source>quot 34
-amp 38
-lt 60
-gt 62
-lala 125</source>
-<p>The output is:</p>
-<source>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;out&gt;&amp;lala;&lt;/out&gt;</source>
-<p>See also <link idref="usagepatterns" anchor="outputprops">Setting output properties in your stylesheets</link>.</p>
-</s3>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/index.xml b/xdocs/sources/xalan/index.xml
deleted file mode 100644
index 8a10974..0000000
--- a/xdocs/sources/xalan/index.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="&xslt4j-current;">
-<!--note>A later Developer release has been posted in the <resource-ref idref="xslt4j-distdir"/>. For the changes that have occurred since &xslt4j-current;, consult the xml-xalan-cvs@apache.org mailing list, or download the release and consult the release notes.</note-->
-  <s2 title="What is it?">
-    <p>Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements the
-     W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath). It can be used from the command line,
-     in an applet or a servlet, or as a module in other program.</p>
-  </s2>
-  <s2 title="I've heard of &xslt4j;, but what is version 2?">
-    <p>&xslt4j; version 2 recasts Xalan as an implementation of the <link idref="trax">TRaX (Transformation API for XML)</link> interfaces, part of the <resource-ref idref="jaxp11"/>. TRaX provides a
-    modular framework and a standard API for performing XML transformations, and it utilizes system properties to determine which Transformer and which XML parser to use.</p>
-     <p>&xslt4j; version 2 also builds on <resource-ref idref="sax2"/>, <resource-ref idref="dom2"/>, and the XML parser API in
-     <resource-ref idref="jaxp"/>.</p>
-     <p>For more information, see <link idref="whatsnew">What's new in &xslt4j2;</link>.</p>
-     <note>&xslt4c; version 1 is no longer supported and no longer available from xml.apache.org.</note>
-  </s2>
-  <s2 title="How about this release?">
-  <p>&xslt4j-current; is a Developer release. To improve performance, it uses the Document Table Model (<link idref="dtm">DTM</link>) to represent the XML source document to be transformed. Please send your feedback to the <human-resource-ref idref="xalandev"/>.</p>
-  </s2> 
-  <s2 title="How do I get it?">
-    <p>Download and unzip either of the following:</p>
-    <ul>
-      <li><resource-ref idref="xslt4j-dist-zip"/></li>
-      <li><resource-ref idref="xslt4j-dist-targz"/></li>
-    </ul>     
-  </s2>
-  
-  <s2 title="Where do I get Xerces?">
-    <p>The Xalan download includes xerces.jar from &xml4j-used;. This is all you need to run Xalan with the Xerces XML parser. 
-    You can, however, download the complete Xerces distribution from the <resource-ref idref="xml4j-distdir"/>.</p>
-    <note>If you plan to use a different XML parser, see <link idref="usagepatterns" anchor="plug">Plugging in a Transformer
-     and XML parser</link>.</note> 
-  </s2>
-  <s2 title="What else do I need?">
-    <p>You need the Java Development Kit or Java Runtime 1.1.8, 1.2.2, or 1.3, which you can obtain from <jump
-    href="http://www.ibm.com/java/jdk">ibm.com/java/jdk/</jump> or <jump href="http://www.java.sun.com">java.sun.com</jump>.</p> 
-  </s2>  
-    <s2 title="For more information...">
-    <p>For more information, go to <link idref="overview">Xalan Overview</link> and <link idref="getstarted">Getting
-    Started</link>. All of the Xalan documentation on this website is included in the Xalan download, as are a number of
-    <link idref="samples">Samples</link> to help you start using &xslt4j2; to transform XML documents.</p>
-  </s2>  
-</s1> 
\ No newline at end of file
diff --git a/xdocs/sources/xalan/overview.xml b/xdocs/sources/xalan/overview.xml
deleted file mode 100644
index c3dd7ec..0000000
--- a/xdocs/sources/xalan/overview.xml
+++ /dev/null
@@ -1,204 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
- 
-<s1 title="&xslt4j; Overview">
-<ul>
-<li><link anchor="intro">Introduction</link></li>
-<li><link anchor="features">&xslt4j; Features</link></li>
-<li><link anchor="towork">Getting to work with &xslt4j;</link></li>
-<li><link anchor="uptospeed">Getting up to speed with XSLT</link></li>
-<li><link anchor="glossary">Glossary</link></li>
-</ul><anchor name="intro"/>
-  <s2 title="Introduction">
-    <p>&xslt4j; (named after a rare musical instrument) fully implements the <resource-ref idref="xslt"/> and the 
-    <resource-ref idref="xpath"/>. XSLT is the first part of the XSL stylesheet language for XML. It includes the XSL
-     Transformation vocabulary and XPath, a language for addressing parts of XML documents. For links to background materials, 
-    discussion groups, frequently asked questions, and tutorials on XSLT, see <link anchor="uptospeed">Getting up
-    to speed with XSLT</link>.</p> 
-    <note>XSL also includes a vocabulary for formatting documents, which is not part of &xslt4j;. 
-    For more information, see <resource-ref idref="xslt"/> and the <jump
-    href="http://xml.apache.org/fop">Apache XML FOP (Formatting Objects Project)</jump>.</note>
-    <p>You use the XSLT language to compose XSL stylesheets. An XSL stylesheet contains instructions for
-     transforming XML documents from one document type into another document type (XML, HTML, or other). In structural
-     terms, an XSL stylesheet specifies the transformation of one tree of nodes (the XML input) into another tree of nodes 
-     (the output or transformation result).</p>
-    <note>The XSL stylesheet may generate and refer to cascading style sheets (<jump
-    href="http://www.w3.org/Style/CSS/">CSS</jump>) as part of its output.</note> 
-    <p>In the following example, the foo.xsl stylesheet is used to transform foo.xml into foo.out:</p>
-    <p>foo.xml:</p>
-        <source>&lt;?xml version="1.0"?>
-&lt;doc>Hello&lt;/doc></source>
-        <p>foo.xsl:</p>
-        <source>&lt;?xml version="1.0"?> 
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-&lt;xsl:template match="doc">
-&lt;out>&lt;xsl:value-of select="."/>&lt;/out>
-&lt;/xsl:template>
-&lt;/xsl:stylesheet></source>
-<p>foo.out:</p>
-<source>&lt;out>Hello&lt;/out></source>
-<p>By default, &xslt4j; uses &xml4j;, and it may be configured with system properties to work with other XML parsers (see <link idref="usagepatterns" anchor="plug">Plugging in a Transformer and XML parser</link>). The input may be submitted in the form of a stream of XML markup (from a URI, a character or byte stream, or another transformation), a SAX InputStream, or a DOM Node.</p>
-<p>&xslt4j; performs the transformations specified in the XSL stylesheet and packages a sequence of SAX events that may be serialized to an output stream or writer, used to build a DOM tree, or forwarded as input to another transformation.</p>
-      </s2><anchor name="features"/>
-   	  <s2 title="&xslt4j; Features">
-	    <ul> 
-		    <li>Implements the relevant W3C specifications: <resource-ref idref="xslt"/> and <resource-ref idref="xpath"/>.<br/><br/></li>
-        <li>Implements <link idref="trax">TRaX (Transformation API for XML)</link>, now part of <resource-ref idref="jaxp"/>, and builds on
-         <resource-ref idref="sax2"/> and <resource-ref idref="dom2"/>.<br/><br/></li>
-    	  <li>May be configured to work with any XML parser, such
-        <jump href="http://xml.apache.org/xerces-j/index.html">&xml4j;</jump>, that implements <resource-ref
-        idref="jaxp"/> (see <link idref="usagepatterns" anchor="plug">Plugging in an XML
-         parser</link>).<br/><br/></li>
-    	  <li>Can process Stream, SAX or DOM input, and output to a Stream, SAX or DOM.<br/><br/></li>
-        <li>Transformations may be chained (the output of one transformation may be the input for
-         another).<br/><br/></li>
-        <li>May be run from the <link idref="commandline">command line</link> for convenient file-to-file
-            transformations.<br/><br/></li>
-    	  <li>Includes an <link idref="usagepatterns" anchor="applet">applet wrapper</link>.<br/><br/></li>
-        <li>May be used in a <link idref="samples" anchor="servlet">servlet</link> to transform XML documents into
-        HTML and serve the results to clients.<br/><br/></li>
-        <li>Supports the creation of <link idref="extensions">Java and scripting language extensions</link>. and
-         provides a growing library of extension elements and functions.</li>
-	    </ul> 
-	  </s2><anchor name="towork"/>
-    <s2 title="Getting to work with &xslt4j;">
-     <p>For instructions and some suggestions about how to get started using &xslt4j;, see 
-     <link idref="getstarted">Getting Started</link>.</p>
-    </s2><anchor name="uptospeed"/>
-    <s2 title="Getting up to speed with XSLT">
-    <p>If you are still working through the details of the XSLT spec (the W3C 1.0 Recommendation), you may want 
-    to consult one or more of the following:</p>
-    <ul>
-        <li>XSLT - XSL Transformations in 
-        <jump href="http://www.brics.dk/~amoeller/XML/">The XML Revolution: Technologies for the future Web</jump> by
-        Anders M&oslash;ller and Michael I. Schwartzbach (Web pages, but designed for sequential reading)</li>
-        <li>Crane Softwright's <jump href="http://www.CraneSoftwrights.com/training/">Free preview of Practical
-         Transformation Using XSLT and XPath</jump><br/><br/></li>
-       <li>Doug Tidwell's <jump href="http://www.oreilly.com/catalog/xslt/">XSLT</jump>, O'Reilly, 2001<br/><br/></li>                 
-       <li>Bob Ducharme's <jump href="http://www.manning.com/ducharme/index.html">XSLT Quickly</jump>, Manning Publications,
-        2001<br/><br/></li>                 
-       <li>John Robert Gardner and Zarella Rendon's 
-       <jump href="http://vig.prenhall.com/catalog/academic/product/1,4096,0130404462,00.html">XSLT and XPath: A Guide to
-        Transformations</jump>, Prentice-Hall, 2001<br/><br/></li>                 
-       <li>Michael Kay's <jump href="http://www.wrox.com/Books/Book_Details.asp?ISBN=1861005067">XSLT Programmer's
-       Reference</jump>, 2nd ed., Wrox Press, 2001<br/><br/></li>
-       <li>Steven Holzner's <jump href="http://www.newriders.com/books/title.cfm?isbn=0735711364">Inside XSLT</jump>, 
-       New Riders, 2001<br/><br/></li>                 
-       <li>Neil Bradley's <jump href="http://www.awlonline.com/product/0,2627,0201674874,00.html">XSL Companion</jump>,
-        Addison-Wesley, 2000<br/><br/></li>                 
-       <li>Khun Yee Fung's <jump href="http://www.awlonline.com/product/0,2627,0201711036,00.html">XSLT: Working with XML and
-        HTML</jump>, Addison-Wesley, 2001<br/><br/></li>                 
-        <li>Dave Pawson's <resource-ref idref="dpawsonxslfaq"/> to search out particular answers and techniques<br/><br/></li>
-         <li>Miloslav Nic's <jump href="http://zvon.vscht.cz/HTMLonly/XSLTutorial/Books/Book1/index.html">XSL Tutorial</jump>,
-         a collection of stylesheet examples<br/><br/></li>
-        <li>Elliotte Rusty Harold's <jump href="http://metalab.unc.edu/xml/books/bible/updates/14.html">Chapter 14 of 
-        the XML Bible: XSL Transformations</jump><br/><br/></li>
-        <li>The Mulberry <jump href="http://www.mulberrytech.com/xsl/xsl-list/">XSL-List -- Open Forum on XSL</jump> 
-        (of interest to XSL users at all levels)<br/><br/></li>
-        <li>Objects by Design's <jump href="http://www.objectsbydesign.com/projects/xmi_to_html.html">Transforming XMI to
-         HTML</jump> (oriented towards XMI, "an XML-based, stream representation of a UML model," but also covers "generic"
-         XML transformations) and their related <jump href="http://objectsbydesign.com/projects/xslt/xslt_by_example.html">XSLT
-         by Example</jump><br/><br/></li>         
-         <li>OASIS (the Organization for the Advancement of Structured Information Standards): 
-         <jump href="http://www.oasis-open.org/cover/xsl.html">Extensible Stylesheet Language (XSL)</jump> by Robin
-         Cover<br/><br/></li>
-         <li>Donald Ball's <jump href="http://www.webslingerZ.com/balld/xsl/designer_manual.xml">A Guide to XML and XSL for
-         Designers</jump><br/><br/></li>         
-    </ul>
-    <p>When you come across other useful introductory or background materials, please email <human-resource-ref
-     idref="xalandev"/>, so we can add them to this list.</p>
-    
-    </s2><anchor name="glossary"/>
-    <s2 title="Glossary">
-      <gloss>
-        <label>XSLT Namespace</label>
-        <item>The <jump href="http://www.w3.org/TR/REC-xml-names/">XML namespace</jump> for XSLT. An XML namespace is a 
-        collection of element and attribute names, identified by a Unique Resource Identifier (URI), which often takes the form of
-        a URL, but is really just a unique string, not a pointer to a web page. The XSLT namespace URI is
-        http://www.w3.org/1999/XSL/Transform. In each XSLT stylesheet, you must declare this namespace in the stylesheet element
-        tag and bind it to a local prefix. Like the XSLT specification, we always use xsl as the XSLT namespace prefix in our
-        descriptions and examples, although you are free to bind any prefix to this namespace.<br/><br/></item>
-        
-        <label>XSL Instruction</label>
-        <item>Any tag associated with the XSLT namespace.<br/><br/></item>
-        
-        <label>Template</label>
-        <item>An element, usually with child elements, that specifies a "rule" or set of 
-        instructions to perform when a particular kind of node is encountered in the source tree.<br/><br/></item>
-                
-        <label>XSL Template Instruction</label>
-        <item>Any tag that occurs inside an xsl:template element and is associated with the XSLT namespace.<br/><br/></item>
-                   
-        <label>Source Tree</label>
-        <item>The XML tree input to the XSL process.<br/><br/></item>
-        
-        <label>Result Tree</label>
-        <item>The tree that is output by the XSL process.<br/><br/></item>
-                
-        <label>Match Pattern</label>
-        <item>The part of a template that defines the kind(s) of nodes to which the template applies.<br/><br/></item>
-
-      </gloss>
-      <p>For more definitions of XSLT terminology, see Dave Pawson's 
-      <jump href="http://www.dpawson.co.uk/xsl/vocab.html">XSLT Terminology
-      Clarification</jump> and the Glossary in Michael Kay's 
-      <jump href="http://www.wrox.com/Consumer/Store/Details.asp?ISBN=1861003129">XSLT Programmer's Reference</jump>.</p>
-    </s2>
-</s1> 
diff --git a/xdocs/sources/xalan/readme.xml b/xdocs/sources/xalan/readme.xml
deleted file mode 100644
index 3cbf92b..0000000
--- a/xdocs/sources/xalan/readme.xml
+++ /dev/null
@@ -1,286 +0,0 @@
-<?xml version="1.0" standalone="no"?> 
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd"[
-<!ENTITY done-j SYSTEM "DONE">
-<!ENTITY xsltcreleasenotes SYSTEM "xsltc_constraints.xml">
-
-<!ENTITY history-j SYSTEM "history.xml">]>
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="Release Notes">
-<p>&xslt4j-current;</p>
- <ul>
-  <li><link anchor="status0">Status</link></li>&xsltcreleasenotesentry;
-  <li><link anchor="build">Build Notes</link></li>
-  <li><link anchor="contact">Getting in touch</link></li>
-  <li><link anchor="history">History of software changes</link></li>
- </ul><anchor name="status0"/>
-  <s2 title="Status">
-   <ul>
-    <li><link anchor="done">Changes since version 2.2.D9</link></li>
-    <li><link anchor="other">Other points of interest</link></li>
-    <li><link anchor="bugs">Bugs</link></li>
-    <li><link anchor="status">Version of Xerces to use</link></li>
-    <li><link anchor="to-do">To-do tasks for future &xslt4j; releases</link></li>
-   </ul>
-     <anchor name="done"/>
-     <s3 title="Changes since &xslt4j; 2.2.D9">
-     <p>&xslt4j-current; is a Developer release. For enhanced performance, it incorporates the 
-     <link idref="dtm">DTM</link>.</p>
-     <note>The SQL Extension library has been updated to work with DTM.</note>
-     &done-j;
-     </s3>
-     <anchor name="other"/>
-     <s3 title="Other points of interest">
-     <ul>
-     <li>Handling xsl:namespace-alias declarations: In release 2.0.D01, we reported the need to do some research concerning exactly how Xalan
-     should handle xsl:namespace-alias declarations. As a result of discussions among members of the W3C Working Group on XSL, we have reached a
-     more precise consensus on how namespaces should be represented when an xsl:namespace-alias declaration is in effect.<br/><br/>
-     If a literal result element has a namespace prefix, the prefix will be preserved and the namespace URI of the element will be as
-     specified in the xsl:namespace-alias element, but the result-prefix is not required to appear in the result. This also applies to the
-     two other cases of "Literal namespace URI" mentioned in the XSLT Recommendation on 
-     <jump href="http://www.w3.org/TR/xslt#literal-result-element">Literal Result Elements</jump>. More simply, if the stylesheet calls for
-     &lt;axsl:foo&gt; to be output as a literal result element, then it will be output as &lt;axsl:foo&gt; in the result, but the namespace
-     associated with this "axsl" prefix will be as designated in the xsl:namespace-alias declaration.<br/><br/></li>
-     <li>For HTML output, &xslt4j2; outputs character entity references (&amp;copy; etc.) for the special characters designated in  
-     <jump href="http://www.w3.org/TR/xhtml1/#dtds">Appendix A. DTDs of the XHTML 1.0: The Extensible HyperText Markup
-     Language</jump>. &xslt4j; 1.x, on the other hand, outputs literal characters for some of these special characters.<br/><br/></li>
-     <li>In conformance with the <jump href="http://www.w3.org/TR/xslt#section-HTML-Output-Method">XSLT Recommendation on the HTML 
-     Output Method</jump> and <jump href="http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.1">Section B.2.1 of the HTML 4.0
-     Recommendation</jump>, &xslt4j2; uses %hh encoding for each byte of the UTF-8 representation of non-ASCII characters in HTML URI
-     attributes.<br/><br/></li>
-     <li>When your stylesheet asks for an explicit carriage-return character (&amp;#13;) to be inserted into the output, it is output during
-     the serialization process in escaped form unless escaping has been disabled.  When your stylesheet asks for an explicit line-feed character
-     (&amp;#10;) to be output, the system-default line-break character(s) is/are output during the serialization process.  Also keep in mind that
-     the XML parser normalizes line-breaks to line-feeds when it sends character events to the processor.<br/><br/></li>
-     <li>If your XML input is a DOM, use the javax.xml.parsers.DocumentBuilderFactory setCoalescing() method to set coalescing to true (it is
-     false by default), if you want to append CDATA sections to adjacent text sections to form a single text node (as the XPath standard calls
-      for), and if the XML parser supports this feature (&xml4j-used; does not).</li>
-     </ul>
-     </s3><anchor name="bugs"/>
-     <s3 title="Bugs">
-     <p>All known &xslt4j; bugs are listed in <resource-ref idref="bugzilla"/>. For a list of open bugs with links to each bug
-      report, see <resource-ref idref="buglist"/>. If you find a new bug, please enter a XalanJ2 bug report in this
-      database.</p>
-     <note>Before you can enter your first bug report, you must submit your email address to Bugzilla and receive a password.</note> 
-     <p>We strongly encourage you write patches for problems you find and submit them to
-      xalan-dev@xml.apache.org. We review the patches we receive to make sure they do not break something else, and (assuming they 
-     do not) include them in our next release. In the interest of fixing bugs, adding enhancements, and addressing outstanding design
-     issues, we sincerely want (and need!) your active participation in the ongoing development of Xalan.</p>
-     </s3>     
-     <anchor name="status"/>
-     <s3 title="Version of Xerces to use"> 
-       <p>The &xslt4j-current; has been tested with &xml4j-used;. &download; For information about including xerces.jar on the system class path, see <link idref="getstarted" anchor="classpath">Setting up the system class path</link>.</p>
-       <p><em>Important</em> You may experience unpredictable anomalies if your Xalan and Xerces builds are not in synch. If you download an update to Xalan, check the release notes to determine which version of Xerces you should use.</p>
-       <note>You can use Xalan with other XML parsers that implement the <resource-ref idref="jaxp"/>. See 
-       <link idref="usagepatterns" anchor="plug">Plugging in the Transformer and XML parser</link>.</note>
-     </s3>
-     <anchor name="to-do"/>
-     <s3 title="To-do tasks">
-       <p>For a list of goals, tasks, and target dates for completion, see <jump href="todo.html">Xalan-Java Version 2: Things To Do</jump>. 
-       As tasks are completed, they are moved from the to-do list to 
-       <jump href="todo.html#release-date-completed">Completed</jump>.</p>
-       <p>The source document for the to-do list is an active document in the Apache CVS repository: 
-       <jump href="http://xml.apache.org/websrc/cvsweb.cgi/xml-xalan/java/todo.xml">xml-xalan/java/todo.xml</jump>.</p>
-      </s3> 
-  </s2>
-    &xsltcreleasenotes;  
-  <anchor name="build"/>  
-  <s2 title="Build Notes">
-<ul>
-<li><link anchor="ant">Using Ant</link></li>
-<li><link anchor="jar">Rebuilding xalan.jar</link></li>
-<li><link anchor="samples">Rebuilding sample applications</link></li>
-<li><link anchor="doc">Rebuilding the &xslt4j; documentation</link></li>
-</ul>
-<anchor name="ant"/>
-   <s3 title="Using Ant">
-     <p>Apache <resource-ref idref="ant"/> is a flexible, powerful, and easy-to-use Java build tool that we include with the
-     &xslt4j; distribution. The Ant JAR file is in the bin directory, and the cross-platform XML build file (build.xml) is in 
-     the root directory along with a Windows32 batch file (build.bat) and a UNIX shell file (build.sh). The build file defines 
-     the "targets" that you can use Ant to build. The batch and shell files set up the classpath and launch Ant with the target 
-     (and any other arguments) you provide.</p>
-     <p><em>Instructions for using Ant</em></p>
-     <ol>
-       <li>Set the JAVA_HOME environment variable to the JDK root directory.<br/><br/>
-       If you are using JDK 1.1.8, you must also put classes.zip in the JDK bin directory on the classpath. You can use Ant 
-       with JDK 1.1.8 to compile and jar the &xslt4j; source files, but you must have JDK 1.2.2 or higher to build the
-       documentation.<br/><br/></li>
-       <li>Depending on your environment, run the batch file (build.bat) or shell file (build.sh) from the &xslt4j; root
-       directory, optionally with arguments (see the table of targets below).<br/><br/>
-       The batch/shell file adds several JAR files to the classpath and launches Ant with any arguments you provide. If you
-       provide no target, Ant compiles the source files and rebuilds xalan.jar (the "jar" target).</li>
-     </ol>
-     <p>You can also set up your classpath manually (see build.bat or build.sh for the details), and then run Ant as
-     follows:<br/><br/>
-     <code>java org.apache.tools.ant.Main <ref>target</ref></code><br/><br/>
-     where <ref>target</ref> is nothing (for the default target) or one of the following.</p>
-     <table>
-       <tr><td><em>Target</em></td><td><em>What Ant does</em></td></tr>
-       <tr><td>compile</td><td>compiles Xalan-Java in build/classes.</td></tr>
-       <tr><td>jar (the default)</td><td>creates xalan.jar in the build directory</td></tr>
-       <tr><td>samples</td><td>compiles and jars the sample apps in build/xalansamples.jar</td></tr>
-       <tr><td>servlet</td><td>compiles and jars the sample servlet in build/xalanservlet.jar</td></tr>       
-       <tr><td>docs</td><td>creates the HTML User's Guide in build/docs</td></tr>
-       <tr><td>javadocs</td><td>generates the API documentation in ./build/docs/apidocs</td></tr>
-       <tr><td>dist</td><td>generates a complete distribution tree with zip and tar.gz distribution files in build</td></tr>
-       <tr><td>clean</td><td>purges the build and distribution</td></tr> 
-  </table>
-  <p>If you build a target that depends on other targets, Ant creates those other targets in the correct order.</p>
-   </s3><anchor name="jar"/> 
-   <s3 title="Rebuilding &xslt4j;">
-     <p>The &xslt4j; build is in xalan.jar. The &xslt4j; source code tree is in the src directory.</p>
-     <p>If you are using Ant, the target is jar (the default). For more information, see <link anchor="ant">Using
-     Ant</link>.</p>
-     <p>If you want to do the build without Ant, keep the following in mind:</p>
-     <ul>
-     <li>Set the classpath to include the src directory, xerces.jar, bsf.jar, and bsfengines.jar.</li>
-     <li>Use a Java compiler (such as the IBM Just-In-Time compiler or the Sun javac) to compile all the .java files in the src
-     tree. </li>
-     <li>Use the Sun jar utility to store the resulting .class files in xalan.jar</li>
-     </ul>
-   </s3><anchor name="samples"/>
-   <s3 title="Rebuilding a sample application">
-   <p>If you modify a sample and want to recompile it, you can run the Java compiler in the directory containing the
-   example. Be sure xalan.jar and xerces.jar are on the classpath. To recompile (and run!) the class files in the
-   Servlet subdirectory, the javax.servlet and javax.servlet.http packages must also be on the classpath. Sun
-   distributes these packages in the JSWDK 1.0.1 servlet.jar file.</p> 
-   <p>After recompiling a sample, you can use the Sun jar utility to place your new .class files in
-    xalansamples.jar.</p>
-    <p>You can use Ant with the samples target to recompile the samples and place the unpackaged class files in xalansamples.jar.
-     For more information, see <link anchor="ant">Using Ant</link>.</p>
-    <note>To rebuild (and to run) the sample servlet, the javax.servlet and javax.servlet.http packages must be on your
-    classpath.</note>
-   </s3><anchor name="doc"/>
-   <s3 title="Rebuilding the &xslt4j; documentation">
-     <p>&xslt4j; includes a number of XML source files, XSL stylesheets, document type definition (DTD)
-      files, entity relationship (ENT) files, graphics, and a JavaScript file that provide the input for the Xalan
-      HTML User's Guide, and the overview and package-level documents used during the generation of Javadoc.</p>
-      <p>To rebuild the documentation, you must use the StyleBook tool and the JDK 1.2.2 java and javadoc
-      tools. StyleBook (which uses Xalan and Xerces) is in stylebook-1.0-b2.jar. Some of the document definition files,
-      stylesheets, and resources are stored in xml-site-style.tar.gz, and are unzipped when you run Ant as described
-       below.</p>
-      <p>You can use Ant with the docs target to regenerate the User's Guide and with the javadocs target to regenerate the
-      Javadoc API documentation. For more information, see <link anchor="ant">Using Ant</link>.</p>
-      <p>If you want to rebuild the documentation without using Ant, keep the following in mind:</p>
-       <ul>
-       <li>Unzip xml-site-style.tar.gz into the xdocs directory (the operation places files in a number of subdirectories).
-       <br/><br/></li>
-       <li>Be sure stylebook-1.0-b2.jar, xalanjdoc.jar, xalan.jar, bsf.jar, bsfengines.jar, and xerces.jar are on the class
-       path.<br/><br/></li>
-       <li>To build doc in a build/docs subdirectory, run StyleBook from the xdocs directory as follows:<br/><br/>
-       <code>java org.apache.stylebook.StyleBook "targetDirectory=../build/docs/" sources/xalanLocal.xml style</code>
-       <br/><br/></li>
-       <li>To build the HTML source files that javadoc needs for the TrAX top-level and package-level documentation, add
-       a build/docs/apdidocs/javax/xml/transform directory and run the Xalan command-line utility from the xdocs directory 
-       as follows (all one line):<br/><br/>
-<code>
-java org.apache.xalan.xslt.Process 
-  -in sources/trax/trax.xml
-  -param package-root '../../../src/'
-  -xsl style/stylesheets/spec.xsl 
-  -out build/docs/apidocs/javax/xml/transform/trax.html</code><br/><br/></li>
-        <li>Before you run javadoc, make sure the following directory structure exists under the Xalan root
-         directory: build/docs/apidocs.<br/><br/></li>
-       <li>To build the API documentation, run the JDK 1.2.2 javadoc tool from the xdocs directory (all one line):<br/><br/>
-<code>
-javadoc -doclet xalanjdoc.Standard 
- -docletpath ../bin/xalanjdoc.jar 
- -private
- -overview ../src/javadocOverview.html -sourcepath ../src 
- -group TrAX "javax.xml.transform*" 
- -group Xalan_Core "org.apache.xalan.processor:
-        org.apache.xalan.templates:
- org.apache.xalan.transformer"
- -group XPath "org.apache.xpath*"
- -group Utilities "org.apache.xml.utils*"
- -group Xalan_Other "org.apache.xalan.client:
-        org.apache.xalan.dtm:
- org.apache.xalan.extensions:org.apache.xalan.res:
- org.apache.xalan.stree:org.apache.xalan.trace:
- org.apache.xalan.xslt" 
- -group Xalan_Extensions "org.apache.xalan.lib*" 
- -group Serializers "org.apache.xalan.serialize" 
- org.apache.xalan.client org.apache.xalan.dtm 
- org.apache.xalan.extensions org.apache.xalan.lib 
- org.apache.xalan.lib.sql org.apache.xalan.processor 
- org.apache.xalan.res org.apache.xalan.stree 
- org.apache.xalan.templates org.apache.xalan.trace 
- org.apache.xalan.transformer org.apache.xalan.xslt 
- org.apache.xpath org.apache.xpath.axes 
- org.apache.xpath.compiler org.apache.xpath.functions 
- org.apache.xpath.objects org.apache.xpath.operations 
- org.apache.xpath.patterns org.apache.xpath.res
- org.apache.xalan.serialize javax.xml.transform  
- javax.xml.transform.dom javax.xml.transform.sax 
- javax.xml.transform.stream javax.xml.parsers
- -d ../build/docs/apidocs -windowtitle "Xalan-Java 2" 
- -doctitle "Xalan-Java 2" -bottom "Copyright &#169; 
-  2000 Apache XML Project. All Rights Reserved."
-</code></li>
-</ul>
-  </s3>    
- </s2><anchor name="contact"/>
- <s2 title="Getting in Touch">
-  <p>Your feedback is more than welcome. Offers of help are even more so! Perhaps you would like to take on an active role in the ongoing development, testing, and documentation of &xslt4j;?</p> 
-<p>Please email your comments, questions, suggestions, and offers to join the Xalan team to <human-resource-ref idref="xalandev"/>.</p>
- </s2><anchor name="history"/>
- <s2 title="Cumulative history of software changes">
-   <p>The following sections list the changes in each release since &xslt4j; version 2.0.D01.</p>
-   &history-j;
- </s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/resources.xml b/xdocs/sources/xalan/resources.xml
deleted file mode 100644
index 670426c..0000000
--- a/xdocs/sources/xalan/resources.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="US-ASCII"?>
-<!DOCTYPE resources [
-  <!ENTITY % externalEntity SYSTEM "../entities.ent">
-  %externalEntity;
-  <!ELEMENT resources (resource|human-resource)+>
-  <!ELEMENT resource EMPTY>
-  <!ATTLIST resource 		
-        id CDATA #IMPLIED
-				title CDATA #IMPLIED
-				location CDATA #IMPLIED>
-  <!ELEMENT human-resource EMPTY>
-  <!ATTLIST human-resource 	
-        id CDATA #IMPLIED
-				name CDATA #IMPLIED
-				mailto CDATA #IMPLIED>
-   ]>  
-<resources> 	
-  <resource id="xslt4j-current" 
-            title="&xslt4j-current;" 
-            location="http://xml.apache.org/xalan"/>
-  <resource id="xslt4j-dist-zip" 
-            title="&xslt4j-dist;.zip" 
-            location="http://xml.apache.org/dist/xalan-j/&xslt4j-dist;.zip"/>
-  <resource id="xslt4j-dist-targz" 
-            title="&xslt4j-dist;.tar.gz" 
-            location="http://xml.apache.org/dist/xalan-j/&xslt4j-dist;.tar.gz"/>
-  <resource id="xslt4j-distdir" 
-            title="xalan-j distribution directory" 
-            location="http://xml.apache.org/dist/xalan-j/"/>
-  <resource id="xml4j-used" 
-            title="&xml4j-used;" 
-            location="http://xml.apache.org/xerces-j/index.html"/>
-  <resource id="xml4j-distdir" 
-            title="xerces-j distribution directory" 
-            location="http://xml.apache.org/dist/xerces-j/"/>
-  <resource id="ant" title="Ant" 
-            location="http://jakarta.apache.org/ant/index.html"/>
-  <resource id="ApacheLicense" 
-            title="The Apache Software License, Version 1.1" 
-            location="http://xml.apache.org/dist/LICENSE.txt"/>
-  <resource id="bugzilla"
-            title="Bugzilla (the Apache bug database)"
-            location="http://nagoya.apache.org/bugzilla"/>
-  <resource id="buglist"
-            title="XalanJ2 open bugs"         
-            location="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=XalanJ2&amp;short_desc=&amp;short_desc_type=substring&amp;long_desc=&amp;long_desc_type=substring&amp;bug_file_loc=&amp;bug_file_loc_type=substring&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;cmdtype=doit&amp;order=%27Importance%27"/>                   
-  <resource id="bsf"
-            title="Bean Scripting Framework (BSF)"
-            location="http://oss.software.ibm.com/developerworks/projects/bsf"/>     
-	
-  <resource id="Readme" 
-            title="Xalan Repository Release Notes" 
-            location="http://www.apache.org/websrc/cvsweb.cgi/xml-xalan/README"/>
-            
-  <resource id="xslt" title="Extensible Stylesheet Language (XSL) Version 1.0 W3C Candidate Recommendation"
-   location="http://www.w3.org/TR/xsl"/>
-
-  <resource id="dpawsonxslfaq" title="XSL Frequently Asked Questions" location="http://www.dpawson.co.uk/xsl/xslfaq.html"/>
-  
-  <resource id="xslt" 
-            title="W3C Recommendation XSL Transformations (XSLT) Version 1.0"
-            location="http://www.w3.org/TR/xslt"/>
-  
-  <resource id="xpath" 
-            title="XML Path Language (XPath) Version 1.0" 
-            location="http://www.w3.org/TR/xpath"/>            
-            
-  <resource id="dom" 
-            title="DOM" 
-            location="http://www.w3.org/DOM"/>
-  <resource id="dom2" 
-            title="DOM level 2" 
-            location="http://www.w3.org/TR/DOM-Level-2/"/>
-
-  <resource id="sax" 
-            title="SAX" 
-            location="http://www.megginson.com/SAX/sax.html"/>
-  <resource id="sax2" 
-            title="SAX 2" 
-            location="http://www.megginson.com/SAX/Java/index.html"/>
-  <resource id="jaxp" 
-            title="Java API for XML Parsing 1.0" 
-            location="http://java.sun.com/xml/docs/api/index.html"/>
-  <resource id="jaxp11" 
-            title="Java API for XML Processing 1.1 Public Review 2" 
-            location="http://java.sun.com/aboutJava/communityprocess/review/jsr063/jaxp-pd2.pdf"/>
-  <resource id="jsr063"
-            title="Java Specification Request 63"
-            location="http://java.sun.com/aboutJava/communityprocess/review/jsr063"/>
-            
-  <resource id="compatapi"
-            title="Xalan-Java 1 compatibility Javadoc"
-            location="compat_apidocs/index.html"/>
-            
-  <human-resource id="xalandev" 
-                  name="Xalan Development Mailing List" 
-                  mailto="xalan-dev@xml.apache.org"/>
-</resources>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/samples.xml b/xdocs/sources/xalan/samples.xml
deleted file mode 100644
index 7f157d3..0000000
--- a/xdocs/sources/xalan/samples.xml
+++ /dev/null
@@ -1,484 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="&xslt4j2; Samples">
-<ul>
-<li><link anchor="simpletransform">SimpleTransform</link></li>
-<li><link anchor="usestylesheetpi">UseStylesheetPI</link></li>
-<li><link anchor="usestylesheetparam">UseStylesheetParam</link></li>
-<li><link anchor="sax2sax">SAX2SAX</link></li>
-<li><link anchor="dom2dom">DOM2DOM</link></li>
-<li><link anchor="pipe">Pipe</link></li>
-<li><link anchor="usexmlfilters">UseXMLFilters</link></li>
-<li><link anchor="applyxpath">ApplyXPath</link></li>
-<li><link anchor="appletxmltohtml">AppletXMLtoHTML</link></li>
-<li><link anchor="get-todo-list">get-todo-list</link></li>
-<li><link anchor="servlet">servlet</link></li>
-<li><link anchor="extensions">Extensions</link></li>
-<li><link anchor="trace">Trace</link></li>
-<li><link anchor="validate">Validate</link></li>
-<li><link anchor="trax">trax</link></li>&xsltcsampleshead;
-</ul>  
-	  <s2 title="Samples to help you get started">
-    <p>Each of the subdirectories in the &xslt4j; java/samples directory contains the source files for one or more
-     sample applications. The class files for the samples are in xalansamples.jar (everything except the servlet) and xalanservlet.jar, so to run the samples, you should place these JAR files on the system classpath.</p>
-     <p>With most of the samples, you can use the following procedure:</p>
-     <ol>
-     <li>Be sure xalan.jar, xalansamples.jar, and xerces.jar are on the system class
-      path. For the extension examples, bsf.jar and (for the JavaScript extensions) js.jar must also be on the class
-      path.</li>
-     <li>Be sure the java executable is on your path.</li>
-     <li>Go to the samples subdirectory containing the sample (use the DOS shell if you are running Windows).</li>
-     <li>Run the sample from the command line (as indicated below).</li>
-    <li>Examine the application source files. You may also want to modify the source files. Remember that if you
-     modify a java file, you must recompile the class and place it on the classpath before you can run the
-     modified application.</li>
-     </ol>      
-    <p>The basic command line for running most of the samples is </p> 
-    <p><code>java <ref>classname args</ref></code></p>
-    <p>where <ref>classname</ref> is the sample class and <ref>args</ref> are the arguments, if any. As described in
-     the following sections, some samples take no arguments. The UseStylesheetParam sample takes an
-     additional argument. Several samples in extensions use the &xslt4j; 
-     <link idref="commandline">command-line utility</link>, so they take arguments for the XML source
-     file and the XSL stylesheet.</p>
-  	</s2><anchor name="simpletransform"/>
-    <s2 title="SimpleTransform">
-    <p>What it does: The SimpleTransform class uses the birds.xsl stylesheet to transform birds.xml, and prints the
-     output to birds.out.</p>
-    <p>You can run it from the SimpleTransform subdirectory with</p>
-    <p><code>java SimpleTransform</code></p>
-    </s2><anchor name="usestylesheetpi"/>
-    <s2 title="UseStylesheetPI">
-    <p>What it does: The UseStylesheetPI class uses the stylesheet processing instruction in the XML source document to determine
-     which stylesheet to use to perform the transformation.</p>
-     <p>You can run it from the UseStylesheetPI subdirectory with</p>
-     <p><code>java UseStylesheetPI</code></p>
-     <p>For more information, see <link idref="usagepatterns" anchor="embed">Working with embedded stylesheets</link>.</p>
-    </s2><anchor name="usestylesheetparam"/>
-    <s2 title="UseStylesheetParam">
-      <p>What it does: The UseStyleSheetParam class uses foo.xsl and a stylesheet parameter to transform foo.xml,
-       and prints the output to System.out. The stylesheet parameter appears as a text node in the output.</p>
-    <p>Run this sample from the UseStylesheetParam subdirectory with</p> 
-    <p><code>java UseStylesheetParam <ref>param</ref></code></p>
-    <p>where <ref>param</ref> is the stylesheet parameter value (a string of your choice).</p>  
-    </s2><anchor name="sax2sax"/>
-  <s2 title="SAX2SAX">
-  <p>What it does: Explicitly set the SAX XMLReader and SAX ContentHandler for processing the stylesheet (birds.xsl), processing the XML input (birds.xml), and producing the output (birds.out).</p>
-  <p>Run this sample from the SAX2SAX subdirectory with</p>
-   <p><code>java SAX2SAX</code></p>
-    </s2><anchor name="dom2dom"/>
-    <s2 title="DOM2DOM">
-    <p>What it does: the DOM2DOM class uses the birds.xsl stylesheet to transform a DOM Document generated from birds.xml,
-     produces an output DOM, and traverses the DOM, printing the traversal to System.out. In contrast to SimpleTransform,
-      DOM2DOM illustrates the procedure for processing an input DOM and creating an output DOM that is available for
-      further processing.</p>
-   <p>You can run it from the DOM2DOM subdirectory with</p>
-    <p><code>java DOM2DOM</code></p>
-    </s2><anchor name="pipe"/>
-    <s2 title="Pipe">
-    <p>What it does: Pipes the output from one transformation to a second transformation, then from the second
-    transformation to the third transformation. Transformer1 is the ContentHandler for the XMLReader (which parses the
-    input document). Transformer2 provides the ContentHandler for Transformer1, and Transformer3 for Transformer2.</p>
-    <note>Pipe and UseXMLFilters illustrate two strategies for using the output of one transformation as the input for
-    another transformation. The Pipe sample incorporates a "push" model -- Transformer1 "pushes" its output to
-    Transformer2, and so on -- whereas in the UseXMLFilters sample, Transformer3 "pulls" its input from Transformer2,
-    and so on.</note>
-    <p>Run this sample from the Pipe subdirectory with</p> 
-    <p><code>java Pipe</code></p>
-    </s2><anchor name="usexmlfilters"/>
-    <s2 title="UseXMLFilters">
-    <p>What it does: Chains together the same transformations as the preceding Pipe sample. Using each Transformer
-     object as an extension of the SAX XMLFilter interface, sets the XMLReader as the parent of filter1,
-     filter1 as the parent of filter2, and filter2 as the parent of of filter3.</p>
-     <p><img src="xmlfilters.gif" alt="xmlfilters.gif"/></p>
-      <p>Run this sample from the UseXMLFilters subdirectory with</p>
-   <p><code>java UseXMLFilters</code></p>
-    </s2><anchor name="applyxpath"/>
-    <s2 title="ApplyXPath">
-    <p>What it does: ApplyXPath uses the <jump href="apidocs/org/apache/xpath/XPathAPI.html">XPathAPI</jump> convenience methods to
-    execute an XPath expression against an XML document and return the nodes (if any) it finds.</p>
-     <note>You can use this sample as an aid when you want to find out what a given XPath expression returns from a
-     given XML file. Keep in mind that the context node (base point of evaluation) for the XPath expression is the document
-     root.</note>
-    <p>Run this sample from the ApplyXPath subdirectory with</p> 
-    <p><code>java ApplyXPath <ref>XMLFile XPathExpression</ref></code></p>
-    <p>where <ref>XMLFile</ref> is an XML source file and <ref>XPathExpression</ref> is an XPath expression to
-     apply to that file. The ApplyXPath subdirectory contains an XML file named foo.xml --<br/>
-     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>&lt;doc&gt;&lt;name first="David" last="Marston"/&gt;...&lt;/doc></code><br/> -- so you can try command
-     lines like</p>
-    <p><code>java ApplyXPath foo.xml /</code></p>
-    <p>and</p>
-    <p><code>java ApplyXPath foo.xml /doc/name/@first</code></p>
-    <p>For more information, see <link idref="usagepatterns" anchor="xpath">Working with XPath expressions</link>.</p>
-    </s2><anchor name="appletxmltohtml"/>
-    <s2 title="AppletXMLtoHTML">
-    <p>The applet uses a stylesheet to transform an XML document into HTML. It displays the XML document, the
-     stylesheet, and the HTML output.</p>
-    <p>How to run it: Open appletXMLtoHTML.hmtl in the Internet Explorer 5 browser.</p>
-    <note>This and the following sample applet do not work in the Netscape Communicator 4.7. We have some work to do to get
-    our basic strategy of using system properties to identify the Transformer and XML Parser to work in the Netscape applet
-    sandbox.<br/><br/>
-    Both applets look for xalan.jar and xerces.jar in the bin subdirectory. If you have placed these JAR files
-    elsewhere, adjust the applet archive setting in client.html and get-todo-list.html accordingly.</note>
-    </s2><anchor name="get-todo-list"/>
-    <s2 title="get-todo-list">
-    <p>This applet uses todo.xsl to transform todo.xml and display the result. The XML source (todo.xml) is a snapshot of an
-     ongoing list of tasks and task completions for the &xslt4j2; project that is maintained in the xml-xalan/java
-     subdirectory of the Apache CVS repository.</p>
-     <p>How to run it: Open get-todo-list.html in the Internet Explorer 5 browser.</p>
-    </s2><anchor name="servlet"/>
-    <s2 title="servlet">
-   <p>For a general introduction, see <link idref="usagepatterns" anchor="servlet">Using &xslt4j; in a servlet</link>.</p>
-    <p>The servlet subdirectory contains four sample servlets that use &xslt4j; to perform transformations. These servlets 
-    are in a package named servlet and are compiled in xalanservlet.jar. To run these samples, you must place 
-    xalanservlet.jar, and any XML and XSL files you want to use on a web server with a servlet engine, place 
-    xalanservlet.jar, xalan.jar, and xerces.jar on the servlet engine class path, and configure the servlet engine to
-    locate the XML and XSL files, and the properties file used by ApplyXSL.</p>
-    <p><link anchor="simplexsltservlet">servlet.SimpleXSLTServlet</link> applies a particular stylesheet to a particular 
-    XML document.</p> 
-    <p><link anchor="usestylesheetparamservlet">servlet.UseStylesheetParamServlet</link> sets a stylesheet parameter 
-    (the parameter name is hardwired into the servlet), and requires the user to supply parameters for the 
-    XML document and XSL stylesheet.</p>
-    <p><link anchor="jspsample">jspSample.jsp</link> is a Java ServerPage that sets a stylesheet parameter and applies the
-     stylesheet to the XML document.</p>
-    <p><link anchor="xsltservletwithparams">servlet.XSLTServletWithParams</link> accepts parameters for the XML document, 
-    the XSL stylesheet, and any number of stylesheet parameters.</p>
-    <p><link anchor="applyxslt">servlet.ApplyXSLT</link> (and associated classes) is closer to a production level servlet. It accepts parameters, provides a 
-    listener for capturing and reporting debugger messages, and supports  use of a property file to determine which 
-    stylesheet to apply based on the identity of the client browser/device.</p>
-    <anchor name="simplexsltservlet"/>
-    <s3 title="servlet.SimpleXSLTServlet">
-    <p>What it does: servlet.SimpleXSLTServlet applies the todo.xsl stylesheet to todo.xml and returns the transformation result to the
-    HTTP client.</p>
-    <p>To run this servlet: place todo.xsl and todo.xml (from the distribution root directory) in the directory where your servlet engine
-    looks for HTTP documents, place xalanservlet.jar on the servlet engine classpath, and set up an HTML page to call the servlet as
-    follows:</p>
-<gloss><label>http://localhost/servlethome/servlet.SimpleXSLTServlet</label></gloss>
-     </s3><anchor name="usestylesheetparamservlet"/>
-     <s3 title="servlet.UseStylesheetParamServlet">
-     <note>Paul Campbell &lt;seapwc@halcyon.com&gt; wrote this servlet and the following explanatory text.
-     Thank you, Paul!</note>
-     <p>What it does: The client (perhaps an HTML form ) specifies an XML document, a stylesheet, and a value to be passed
-      to the stylesheet for a stylesheet parameter named "param1". The servlet performs the transformation and returns
-      the output to the client. The client must specify which stylesheet (containing a "param1" stylesheet parameter") 
-      and XML file are to be used.</p>
-     <p>How to run it: Configure your application server (Tomcat, Websphere or JServ, for example)
-     so it can find servlet.UseStylesheetParamServlet (in xalanservlet.jar) as well as the XML document 
-     and XSL stylesheet. For example, you can copy fooparam.xml and fooparam.xsl from samples/servlet to the application 
-     server root directory for documents.</p>
-     <p>Then you can set up an HTML client to call the servlet with arguments along the lines of</p>
-    <gloss><label>http://localhost/servlethome/servlet.UseStylesheetParamServlet?
-    XML=fooparam.xml&amp;XSL=fooparam.xsl&amp;PVAL=GoodBye</label></gloss>
-     <p>In the doGet() method, the servlet obtains the PVAL value "GoodBye") from the servlet request and passes it to the 
-     stylesheet as the paramValue argument in a Transformer setParameter() call:</p>
-      <p><code>String paramValue = httpServletRequest.getParameter("PVAL");</code><br/>
-      <code>...</code><br/>
-     <code>transformer.setParameter("param1", paramValue);</code></p>
- <p>The result is returned to the client:</p>
-<p><code>&lt;html&gt;&lt;body&gt;&lt;p&gt;GoodBye&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</code></p>
-     </s3><anchor name="jspsample"/>
-     <s3 title="jspSample.jsp">
-     <note>Paul Campbell &lt;seapwc@halcyon.com&gt; wrote this Java Server Page.</note>
-     <p>This Java Server Page performs essentially the same operation as 
-     <link anchor="usestylesheetparamservlet">servlet.UseStylesheetParamServlet</link>. It applies a stylesheet parameter 
-      to a stylesheet (fooparam.xsl), applies the stylesheet to an XML source document (fooparam.xml), and returns the
-      result.</p>     
-     </s3><anchor name="xsltservletwithparams"/>
-     <s3 title="servlet.XSLTServletWithParams">
-     <p>What it does: servlet.XSLTServletWithParams takes parameters in the request -- a URL parameter for
-     the XML input document URL and an xslURL parameter for the stylesheet URL.</p>
-     <p>To use XSLTServletWithParams to perform the same transformation as SimplestServlet: 
-     place todo.xsl and todo.xml in the directory where your servlet engine looks for HTTP documents, place
-     xalanservlet.jar on the servlet engine classpath, and set up an HTML page to call the servlet as follows:</p>
-<gloss><label>http://localhost/servlethome/servlet.XSLTServletWithParams?URL=file:todo.xml&amp;
-xslURL=file:todo.xsl</label></gloss>
-     <p>If the XML document contains an associated stylesheet (a stylesheet Processing Instruction) that you want to use, simply omit the
-     xslURL parameter.</p>
-     <p>If the stylesheet takes stylesheet parameters, you can include them in the URL. For example to set set the param1
-     stylesheet parameter to foo, include param1=foo in the URL.</p>
-     </s3><anchor name="applyxslt"/>
-     <s3 title="servlet.ApplyXSLT">
-    <p>What it does: The client (which you must set up) specifies an XML document and a stylesheet. The servlet
-     performs the transformation and returns the output to the client. You can use media.properties to specify 
-    which stylesheet is to be used depending on the client browser/device.</p>
-    <note>The source files for this servlet include ApplyXSLT.java, ApplyXSLTProperties.java, DefaultApplyXSLTProperties.java,
-    ApplyXSLTListener.java, and ApplyXSLTException.java.</note>
-    <p>To run the servlet: put xalanservlet.jar on the servlet engine classpath, configure your servlet engine so it can find the 
-     stylesheets and properties file in the servlet subdirectory (and in xalanservlet.jar), and set up an HTML page to call
-     servlet.ApplyXSLT with arguments as illustrated below.</p>
-     <p>Examples:</p>
-<gloss>
-<label>http://localhost/servlethome/servlet.ApplyXSLT?URL=/data.xml&amp;xslURL=
-/style.xsl</label>
-<item>...applies the style.xsl stylesheet to the data.xml data. Both files are<br/>
-served from the Web server's HTTP document root.<br/><br/></item>
-<label>http://localhost/servlethome/servlet.ApplyXSLT?URL=/data.xml&amp;xslURL=
-/style.xsl&amp;debug=true</label>
-<item>...ensures that XML and XSL processor messages are returned in the event of problems
-applying style.xsl to data.xml<br/><br/></item>
-<label>http://localhost/servlethome/servlet.ApplyXSLT/data.xml?xslURL=/style.xsl</label>
-<item>...applies the style.xsl stylesheet to the data.xml data, just like the first example.
-This is an alternative way of specifying the XML XSLTInputSource by utilizing the HTTP request's path
-information.<br/><br/></item>
-<label>http://localhost/servlethome/servlet.ApplyXSLT/data.xml</label>
-<item>...examines data.xml for an associated XSL stylesheet (a stylesheet Processing Instruction). If multiple XSLs are associated with the data, the stylesheet whose media attribute maps to your browser type will be chosen.  If no mapping is successful, the primary associated stylesheet is used.<br/><br/></item>
-<label>http://localhost/servlet/data.xml</label>
-<item>...provides the same function as the previous example, but this example assumes
-that /servlet/data.xml has been mapped to be executed by this servlet.  The servlet engine may be configured
-to map all or some *.xml files to this servlet through the use of servlet aliases or filters.<br/><br/></item>
-<label>http://localhost/servlet/data.xml?catalog=http://www.xml.org/dtds/oag.xml</label>
-<item>...supplements any servlet-configured XCatalog
-with a catalog of supply chain DTDs residing at the XML.ORG DTD repository.</item>
-</gloss>     
-   </s3>
-     </s2><anchor name="extensions"/>
-    <s2 title="Extensions">
-    <p>For an introduction to the creation and use of extension elements and extension functions, and
-    for information about the extensions library distributed with &xslt4j;, see
-    <link idref="extensions">Extensions</link>.</p>
-    <ul>
-      <li><link anchor="ext1">1-redir</link></li>
-      <li><link anchor="ext2">2-basicJscript</link></li>
-      <li><link anchor="ext3">3-java-namespace</link></li>
-      <li><link anchor="ext4">4-numlistJava</link></li>
-      <li><link anchor="ext5">5-numlistJScript</link></li>
-      <li><link anchor="sql">SQL library extensions</link></li>
-    </ul>
-    <p>The extensions subdirectory contains six samples with &xslt4j; extensions. Two of the samples use
-     extensions implemented in JavaScript, and four of the samples use extensions implemented in Java.</p>
-     <p>To run these examples, you must place bsf.jar (distributed with &xslt4j;), and js.jar
-      (version 1.5, available from 
-      <jump href="http://www.mozilla.org/rhino">http://www.mozilla.org/rhino</jump>) on the classpath. 
-     You do not need js.jar on the classpath for the samples that use Java extensions. </p>
-     <p>Use java.org.apache.xalan.xslt.Process, the &xslt4j; command-line utility, to run most of these samples from
-      the <link idref="commandline">command line</link>. The command line must include an -in flag with the 
-      XML source and an -xsl flag with the XSL stylesheet. If you want the output to be written to a file, rather
-      than to the screen, add an -out flag with the output file name.</p>
-      <p>Run these samples from the extensions directory as follows (each of the following is a single command
-       line):</p> 
-
-      <anchor name="ext1"/>
-      <s3 title="1-redir">
-      <p>What it does: Uses the Redirect extension elements shipped with &xslt4j; to direct output to two output
-        files.</p>
-      <p>Run this sample from the extensions subdirectory with</p> 
-       <p><code>java org.apache.xalan.xslt.Process -in 1-redir.xml</code><br/>
-       &nbsp;&nbsp;<code>-xsl 1-redir.xsl</code></p>
-      <p>The standard (non-redirected) output is written to the screen. The redirected output is written to 1-redir-out, or
-      whatever filename you assign to the doc/foo @file attribute in 1-redir.xml. The stylesheet gets the file name for
-      redirected output from the XML input file.</p>
-      </s3><anchor name="ext2"/>
-      <s3 title="2-basicJscript">
-      <p>What it does: Uses an extension element and extension function implemented in JavaScript to compute a
-      deadline for responding to a customer inquiry.</p>
-      <note>js.jar must be on the classpath.</note>
-      <p>Run this sample from the extensions subdirectory with</p>
-      <p><code>java org.apache.xalan.xslt.Process -in 2-basicJscript.xml</code>
-         <br/>&nbsp;&nbsp;<code>-xsl 2-basicJscript.xsl</code></p>     
-      </s3><anchor name="ext3"/>
-      <s3 title="3-java-namespace">
-      <p>What it does: Uses extension functions to format dates. This sample illustrates use of the predefined java
-        extension namespace to provide ready access to extensions implemented in Java.</p>
-      <p>Run this sample from the extensions subdirectory with</p> 
-      <p><code>java org.apache.xalan.xslt.Process -in 3-java-namespace.xml</code>
-         <br/>&nbsp;&nbsp;<code>-xsl 3-java-namespace.xsl</code></p>    
-      </s3><anchor name="ext4"/>
-      <s3 title="4-numlistJava">
-      <p>What it does: Uses a Java extension to transform a set of name elements into a numbered and alphabetized
-       list.</p>
-      <p>Run this sample from the extensions subdirectory with</p> 
-      <p><code>java org.apache.xalan.xslt.Process -in numlist.xml</code> 
-        <br/>&nbsp;&nbsp;<code>-xsl 4-numlistJava.xsl</code></p>    
-      </s3><anchor name="ext5"/>
-      <s3 title="5-numlistJscript">
-      <p>What it does: Uses a JavaScript  extension to transform a set of name elements into a numbered and
-      alphabetized list. This sample performs the same operations as the preceding Java extension.</p>
-      <note>js.jar must be on the classpath.</note>
-    <p>Run this sample from the extensions subdirectory with</p>
-      <p><code> java org.apache.xalan.xslt.Process -in numlist.xml</code>
-        <br/>&nbsp;&nbsp;<code>-xsl 5-numlistJscript.xsl</code></p>
-      </s3>
-      </s2><anchor name="sql"/>
-      <s2 title="SQL Library extensions">
-      <p>The SQL Library extension samples use <link idref="extensionslib" anchor="sql">SQL library XConnection
-      extension</link>to connect to an InstantDB datasource, perform queries, and return query result sets.</p>
-      <note>To run these samples, you must include idb.jar on the classpath. We have placed a copy of idb.jar from
-      InstantDB version 3.25 in samples/extensions/instantdb. For information about InstantDB, see
-      <jump href="http://instantdb.enhydra.org/software/documentation/index.html">InstantDB</jump>
-      and the <jump href="http://instantdb.enhydra.org/software/license/index.html">Enydra Public
-      License</jump>.</note>      
-      <ul>
-      <li><link anchor="ext6">6-sqllib-instantdb</link></li>
-      <li><link anchor="basic-conn">Basic Connections</link></li>      
-      <li><link anchor="ext-conn">ExternalConnection</link></li>      
-      <li><link anchor="pquery">Parameterized query</link></li>
-      <li><link anchor="streamable">Streamable</link></li>
-      <li><link anchor="showerror">Show-error</link></li>
-      </ul>
-      <note>Except for 6-sqllib-instantdb, all these samples have been created by John Gentilin 
-      (johnglinux@eyecatching.com) to take illustrate the rich feature set he has contributed to the SQL Library. 
-      To run each of these samples, be sure  you are in the appropriate extensions/sql subdirectory.</note>
-     <anchor name="ext6"/>
-      <s3 title="6-sqllib-instantdb">
-      <p>What it does: Uses the SQL library XConnection extension to connect to the InstantDB sample database, 
-      performs a query, and returns the query result in an HTML table.</p>
-      <p>Add idb.jar to the classpath, and run this sample from the extensions subdirectory:</p>
-      <p><code>java org.apache.xalan.xslt.Process</code>
-      <br/>&nbsp;&nbsp;<code>-xsl 6-sqllib-instantdb.xsl -out import1.html</code></p>
-      </s3><anchor name="basic-conn"/>
-      <s3 title="Basic-Connection">
-      <p><em>Contributed by John Gentilin (johnglinux@eyecatching.com).</em></p>
-      <p>What it does: illustrates two strategies for connecting to a database, executing a static query, and returning 
-      the query result.</p>
-      <p>The first strategy is to get connection information along with the static query from the stylesheet (dbtest.xsl)\
-      in the form of stylesheet parameters.</p>      
-      <p>The second strategy is to get connection information from a nodeset in an XML source document (dbInfo.xml).</p>
-      
-      <p>Add extensions/instantdb/idb.jar to the classpath, and run this sample from the extensions/sql/basic-connection 
-       directory.</p>
-       <p>1. To get connection information from the stylesheet:</p>
-      <p><code>java org.apache.xalan.xslt.Process</code>
-      <br/>&nbsp;&nbsp;<code>-xsl dbtest.xsl -out import1.html</code></p>
-      <p>2. To get connection information in the form of a nodeset from the XML source document:</p>      
-      <p><code>java org.apache.xalan.xslt.Process</code>
-      <br/>&nbsp;&nbsp;<code>-in dbinfo.xml -xsl dbtest-cinfo.xsl</code> 
-      <br/>&nbsp;&nbsp;<code>-out import1.html</code></p>
-      <p>3. To get connection information from the stylesheet and dump the raw result set to an XML file:</p>
-      <p><code>java org.apache.xalan.xslt.Process</code>
-      <br/>&nbsp;&nbsp;<code>-xsl DumpSQL.xsl -out import1.xml</code></p>
-    </s3> <anchor name="ext-conn"/>
-    <s3 title="ExternalConnection">
-    <p><em>Contributed by John Gentilin (johnglinux@eyecatching.com).</em></p>
-    <p>What it does: The ExternalConnection classes uses the default implementation of the ConnectionPool interface 
-    to create a pool of connections. A stylesheet in turn uses a connection from this pool to instantiate an 
-    XConnection object and connect to a datasouce.</p>
-    <p>The stylesheet uses this named connection pool to instantiate an XConnection object and connect to the datasource.</p>
-    <p>The ExternalConnection class is in xalansamples.jar. Be sure xalansamples.jar and idb.jar are on the classpath, and 
-    run this sample from the extensions/sql/ext-connection directory:</p>
-    <p><code>java ExternalConnection</code></p>
-    <p>ExternalConnection creates the ConnectionPool, and performs a transformation wiht dbtest.xsl, which draws 
-    from the pool to instantiate an XConnection object, connect to the datasource, execute a static query, and return the
-    query result.</p>
-    </s3><anchor name="pquery"/>
-    <s3 title="Parameterized query">
-    <p><em>Contributed by John Gentilin (johnglinux@eyecatching.com).</em></p>
-    <p>What it does: connect to a datasource, execute a parameterized query, and return the result. The XML source document
-    provides the parameter value as well as the connection information. The parameter value is in a node in the XML source.</p>
-    <p>The stylesheet gets the required connection and parameter information from the XML source, sets up and executes the
-    parameterized query, and retuns the query result set.</p>
-    <p>Be sure idb.jar is on the classpath, and run this sample from the sql/pquery subdirectory:</p>
-    <p><code>java org.apache.xalan.xslt.Process -in dbInfo.xml</code>
-    <br/><code>-xsl dbTest.xsl -out dbTest.html</code></p>    
-    </s3><anchor name="streamable"/>
-    <s3 title="Streamable">
-    <p><em>Contributed by John Gentilin (johnglinux@eyecatching.com).</em></p>    
-    <p>What it does: Illustrates enabling and disabling of caching the streamable result set returned by a query.</p>
-    <p>The stylesheets use the XConnection enableCacheNodes() and disableCacheNodes() methods.</p>
-    <p>Be sure idb.jar is on the classpath, and run these samples from the sql/streamable subdirectory.</p>
-    <p>1. To turn caching on:</p>
-    <p><code>java org.apache.xalan.xslt.Process</code>
-    <br/><code>-xsl cachedNodes.xsl</code></p>
-    <p>1. To turn caching off:</p>
-    <p><code>java org.apache.xalan.xslt.Process</code>
-    <br/><code>-xsl streamNodes.xsl</code></p>
-    <p>3. <ref>To be added</ref></p>
-    </s3><anchor name="showerror"/>
-    <s3 title="Show-error">
-    <p><em>Contributed by John Gentilin (johnglinux@eyecatching.com).</em></p>
-    <p>What it does: use the SQL library ExtensionError class to return an error message in the output stream. The stylesheet
-    calls a template with a select statement that returns a nodeset when an error occurs.</p>
-    <source>&lt;xsl:variable name="table" select='sql:query($db, $query)'/&gt;
-  &lt;xsl:apply-templates select="$table/row-set" /&gt;	
-  &lt;xsl:apply-templates select="$table/ext-error"/&gt;</source>
-  <p>With idb.jar on the classpath, run this sample from the extensions/sql/show-error subdirectory:</p>
-  <p><code>java org.apache.xalan.xslt.Process</code>
-  <br/><code> -xsl <ref>invalidSomething.xsl</ref> -out dbtestout.html</code></p>
-  <p>where <ref>invalidSomething.xsl</ref> is <code>invalidConn.xsl</code> (specifies a database that does not exist), 
-  <code>invalidQuery.xsl</code> (specifies a table that does not exist), or <code>invalidPQuery.xsl</code> (includes
-  too many parameters for the parameterized query).</p>
-    </s3>
-    </s2><anchor name="trace"/>
-    <s2 title="Trace">
-      <p>What it does: Trace uses the TraceListener and TraceManager classes to log transformation events.</p>
-      <p>Run this sample from the Trace subdirectory with</p>
-      <p><code>java Trace</code></p>
-      <p>and examine the result in events.log. For more information, see <link idref="usagepatterns" anchor="debugging">Debugger
-      Interface</link></p>
-     </s2><anchor name="validate"/>
-     <s2 title="Validate">
-     <p>What it does: Uses the <jump href="apidocs\javax\xml\parsers\SAXParser.html">JAXP SAXParser</jump> with a SAX event handler 
-     (extends <jump href="apidocs/org/xml/sax/helpers/DefaultHandler.html">DefaultHandler</jump> and implements 
-     <jump href="apidocs/org/xml/sax/ext/LexicalHandler.html">LexicalHandler</jump>) to verify that XML files conform to their declared 
-     document type. You can use this utility to verify that an individual file or all the .xml files in a directory are
-     well-formed and valid. Each .xml file should contain a DOCTYPE declaration.</p>
-     <p>Run this sample from any directory with</p>
-     <p><code>java Validate <ref>file-or-dir-name</ref> [<ref>logfile</ref></code>]</p>
-     <p>where <ref>file-or-dir-name</ref> is an XML file or directory pathname, and <ref>logfile</ref> designates a log.
-     If you omit the second argument, Validate reports its findings to the screen.</p>
-     <note>A limitation: Files containing document parts appear to fail if you check them with Validate. Check readme.xml, 
-     which "includes" by entity reference a number of files, and it passes. The parse operation scans the entire document
-     with the includes. Check an "included" file (such as history.xml) as if it were an independent document and it fails.</note>
-     </s2>
-     <anchor name="trax"/>
-     <s2 title="trax">
-     <p>What it does: run a number of samples illustrating uses of the <link idref="trax">TRaX (Transformation API for XML)</link> interfaces.</p>
-     <p>Run this sample from the trax subdirectory with</p>
-     <p><code>java Examples</code></p>
-     <p>and examine the source in Examples.java and ExampleContentHandler.java.</p>
-     </s2>&xsltcsamples;
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/trax.xml b/xdocs/sources/xalan/trax.xml
deleted file mode 100644
index d688da5..0000000
--- a/xdocs/sources/xalan/trax.xml
+++ /dev/null
@@ -1,382 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="Transformation API For XML">
-<ul>
- <li><link anchor="intro">Introduction</link></li>
- <li><link anchor="terminology">General Terminology</link></li>
- <li><link anchor="requirements">Requirements</link></li>
- <li><link anchor="model">Model</link></li>
- <li><link anchor="patterns">Patterns</link></li> 
-</ul><anchor name="intro"/>
-<s2 title="Introduction">   
-<p>This document describes the transformation API for XML (TrAX), the set of APIs contained in
-	 <jump href="apidocs/javax/xml/transform/package-summary.html">javax.xml.transform</jump>, <jump href="apidocs/javax/xml/transform/stream/package-summary.html">javax.xml.transform.stream</jump>, <jump href="apidocs/javax/xml/transform/dom/package-summary.html">javax.xml.transform.dom</jump>, and <jump href="apidocs/javax/xml/transform/sax/package-summary.html">javax.xml.transform.sax</jump>.</p> 
-  
-<p>There is a broad need for Java applications to be able to transform XML
-	 and related tree-shaped data structures. In fact, XML is not normally very
-	 useful to an application without going through some sort of transformation,
-	 unless the semantic structure is used directly as data. Almost all XML-related
-	 applications need to perform transformations. Transformations may be described
-	 by Java code, Perl code, <jump href="http://www.w3.org/TR/xslt">XSLT</jump>
-	 Stylesheets, other types of script, or by proprietary formats. The inputs, one
-	 or multiple, to a transformation, may be a URL, XML stream, a DOM tree, SAX
-	 Events, or a proprietary format or data structure. The output types are the
-	 pretty much the same types as the inputs, but different inputs may need to be
-	 combined with different outputs.</p> 
-  
-<p>The great challenge of a transformation API is how to deal with all the
-	 possible combinations of inputs and outputs, without becoming specialized for
-	 any of the given types.</p> 
-  
-<p>The Java community will greatly benefit from a common API that will
-	 allow them to understand and apply a single model, write to consistent
-	 interfaces, and apply the transformations polymorphically. TrAX attempts to
-	 define a model that is clean and generic, yet fills general application
-	 requirements across a wide variety of uses. </p> 
-   
-</s2><anchor name="terminology"/>	 
-<s2 title="General Terminology"> 
-	 
-<p>This section will explain some general terminology used in this
-		document. Technical terminology will be explained in the Model section. In many
-		cases, the general terminology overlaps with the technical terminology.</p> 
-	 
-<gloss>
-<label>Tree</label>
-<item>This term, as used within this document, describes an
-			 abstract structure that consists of nodes or events that may be produced by
-			 XML. A Tree physically may be a DOM tree, a series of well balanced parse
-			 events (such as those coming from a SAX2 ContentHander), a series of requests
-			 (the result of which can describe a tree), or a stream of marked-up
-			 characters.</item>
-
-<label>Source Tree(s)</label>
-<item>One or more trees that are the inputs to the
-			 transformation.</item>
-
-<label>Result Tree(s)</label>
-<item>One or more trees that are the output of the
-			 transformation.</item>
-
-
-
-<label>Transformation</label>
-<item>The process of consuming a stream or tree to produce
-			 another stream or tree.</item>
-
-
-
-<label>Identity (or Copy) Transformation</label>
-<item>The process of transformation from a source to a result,
-			 making as few structural changes as possible and no informational changes. The
-			 term is somewhat loosely used, as the process is really a copy. from one
-			 "format" (such as a DOM tree, stream, or set of SAX events) to
-			 another.</item>
-
-
-
-<label>Serialization</label>
-<item>The process of taking a tree and turning it into a stream. In
-			 some sense, a serialization is a specialized transformation.</item>
-
-
-
-<label>Parsing</label>
-<item>The process of taking a stream and turning it into a tree. In
-			 some sense, parsing is a specialized transformation.</item>
-
-
-
-<label>Transformer</label>
-<item>A Transformer is the object that executes the transformation.
-			 </item>
-
-
-
-<label>Transformation instructions</label>
-<item>Describes the transformation. A form of code, script, or
-			 simply a declaration or series of declarations.</item>
-
-
-
-<label>Stylesheet</label>
-<item>The same as "transformation instructions," except it is
-			 likely to be used in conjunction with <jump href="http://www.w3.org/TR/xslt">XSLT</jump>.</item>
-
-
-
-<label>Templates</label>
-<item>Another form of "transformation instructions." In the TrAX
-			 interface, this term is used to describe processed or compiled transformation
-			 instructions. The Source flows through a Templates object to be formed into the
-			 Result.</item>
-
-
-
-<label>Processor</label>
-<item>A general term for the thing that may both process the
-			 transformation instructions, and perform the transformation.</item>
-
-       
-
-
-<label>DOM</label>
-<item>Document Object Model, specifically referring to the
-			 <jump href="http://www.w3.org/TR/DOM-Level-2%20">Document Object Model
-			 (DOM) Level 2 Specification</jump>.</item>
-
-
-<label>SAX</label>
-<item>Simple API for XML, specifically referring to the
-			 <jump href="http://www.megginson.com/SAX/SAX2">SAX 2.0
-			 release</jump>.</item>
-</gloss> 
-</s2> <anchor name="requirements"/>
-<s2 title="Requirements"> 
-  
-<p>The following requirements have been determined from broad experience
-	 with XML projects from the various members participating on the JCP.</p> 
-  
-<ul>
-<li>TrAX must provide a clean, simple
-		interface for simple uses.</li>
-<li>TrAX must be powerful enough to be
-		applied to a wide range of uses, such as, e-commerce, content management,
-		server content delivery, and client applications.</li>
-<li>A processor that implements a TrAX
-		interface must be optimizeable. Performance is a critical issue for most
-		transformation use cases.</li>
-<li>As a specialization of the above
-		requirement, a TrAX processor must be able to support a compiled model, so that
-		a single set of transformation instructions can be compiled, optimized, and
-		applied to a large set of input sources.</li>
-<li>TrAX must not be dependent an any
-		given type of transformation instructions. For instance, it must remain
-		independent of <jump href="http://www.w3.org/TR/xslt">XSLT</jump>.</li>
-<li>TrAX must be able to allow processors
-		to transform DOM trees.</li>
-<li>TrAX must be able to allow processors to
-		produce DOM trees.</li>
-<li>TrAX must allow processors to transform
-		SAX events.</li>
-<li>TrAX must allow processors to produce SAX
-		events.</li>
-<li>TrAX must allow processors to
-		transform streams of XML.</li>
-<li>TrAX must allow processors to produce
-		XML, HTML, and other types of streams.</li>
-<li>TrAX must allow processors to
-		implement the various combinations of inputs and outputs within a single
-		processor.</li>
-<li>TrAX must allow processors
-		to implement only a limited set of inputs. For instance, it should be possible
-		to write a processor that implements the TrAX interfaces and that only
-		processes DOM trees, not streams or SAX events.</li>
-<li>TrAX should allow a
-		processor to implement transformations of proprietary data structures. For
-		instance, it should be possible to implement a processor that provides TrAX
-		interfaces that performs transformation of JDOM trees.</li>
-<li>TrAX must allow the setting
-		of serialization properties, without constraint as to what the details of those
-		properties are.</li>
-<li>TrAX must allow the setting
-		of parameters to the transformation instructions.</li>
-<li>TrAX must support the
-		setting of parameters and properties as XML Namespaced items (i.e., qualified
-		names).</li>
-<li>TrAX must support URL
-		resolution from within the transformation, and have it return the needed data
-		structure.</li>
-<li>TrAX must have a mechanism for
-		reporting errors and warnings to the calling application.</li>
-</ul>  
-   
-</s2> <anchor name="model"/>
-<s2 title="Model"> 
-  
-<p>The section defines the abstract model for TrAX, apart from the details
-	 of the interfaces.</p> 
-  
-<p>A TRaX <link anchor="pattern-TransformerFactory">TransformerFactory</link> is an object
-	 that processes transformation instructions, and produces
-	 <link anchor="pattern-Templates">Templates</link> (in the technical
-	 terminology). A <link anchor="pattern-Templates">Templates</link>
-	 object provides a <link anchor="pattern-Transformer">Transformer</link>, which transforms one or
-	 more <link anchor="pattern-Source">Source</link>s into one or more
-	 <link anchor="pattern-Result">Result</link>s.</p> 
-  
-<p>To use the TRaX interface, you create a
-	 <link anchor="pattern-TransformerFactory">TransformerFactory</link>,
-	 which may directly provide a <link anchor="pattern-Transformer">Transformers</link>, or which can provide
-	 <link anchor="pattern-Templates">Templates</link> from a variety of
-	 <link anchor="pattern-Source">Source</link>s. The
-	 <link anchor="pattern-Templates">Templates</link> object is a processed
-	 or compiled representation of the transformation instructions, and provides a
-	 <link anchor="pattern-Transformer">Transformer</link>. The
-	 <link anchor="pattern-Transformer">Transformer</link> processes a
-	 <link anchor="pattern-Transformer">Source</link> according to the
-	 instructions found in the <link anchor="pattern-Templates">Templates</link>, and produces a
-	 <link anchor="pattern-Result">Result</link>.</p> 
-  
-<p>The process of transformation from a tree, either in the form of an
-	 object model, or in the form of parse events, into a stream, is known as
-	 <ref>serialization</ref>. We believe this is the most suitable term for
-	 this process, despite the overlap with Java object serialization.</p> 
-</s2><anchor name="patterns"/>
-<s2 title="TRaX Patterns">
-<p>The intent, responsibilities, and thread safety of TrAX objects:</p>
-<ul>
-  <li><link anchor="pattern-Processor">Processor</link></li>
-  <li><link anchor="pattern-TransformerFactory">TransformerFactory</link></li>
-  <li><link anchor="pattern-Templates">Templates</link></li>
-  <li><link anchor="pattern-Transformer">Transformer</link></li>
-  <li><link anchor="pattern-Source">Source</link></li>
-  <li><link anchor="pattern-Result">Result</link></li>  
-</ul>
-<anchor name="pattern-Processor"/><s3 title="Processor">
-<gloss>
-<label>Intent</label>
-<item>Generic concept for the
-  set of objects that implement the TrAX interfaces.</item>
-<label>Responsibilities</label>
-<item>Create compiled transformation instructions, transform
-  sources, and manage transformation parameters and
-  properties.</item>
-<label>Thread safety</label>
-<item>Only the Templates object can be
-  used concurrently in multiple threads. The rest of the processor does not do
-  synchronized blocking, and so may not be used to perform multiple concurrent
-  operations.</item>
-</gloss>
-</s3> <anchor name="pattern-TransformerFactory"/>
-<s3 title="TransformerFactory">
-<gloss>
-<label>Intent</label>
-<item>Serve as a vendor-neutral Processor interface for
-  <jump href="http://www.w3.org/TR/xslt">XSLT</jump> and similar
-  processors.</item>
-<label>Responsibilities</label>
-<item>Serve as a factory for a concrete
-  implementation of an TransformerFactory, serve as a direct factory for
-  Transformer objects, serve as a factory for Templates objects, and manage
-  processor specific features.</item>
-<label>Thread safety</label>
-<item>A TransformerFactory may not perform mulitple concurrent
-  operations.</item>
-</gloss>  
-</s3><anchor name="pattern-Templates"/>
-<s3 title="Templates">
-<gloss>
-<label>Intent</label>
-<item>The runtime representation of the transformation instructions.</item>
-<label>Responsibilities</label>
-<item>A data bag for transformation instructions; act as a factory
-  for Transformers.</item>
-<label>Thread safety</label>
-<item>Threadsafe for concurrent
-  usage over multiple threads once construction is complete.</item>
-</gloss>  
-</s3><anchor name="pattern-Transformer"/>
-<s3 title="Transformer">
-<gloss>
-<label>Intent</label>
-<item>Act as a per-thread
-  execution context for transformations, act as an interface for performing the
-  transformation.</item>
-<label>Responsibilities</label>
-<item>Perform the
-  transformation.</item>
-<label>Thread safety</label>
-<item>Only one instance per thread
-  is safe.</item>
-</gloss>  
-<note>The Transformer is bound to the Templates
-  object that created it.</note>
-</s3><anchor name="pattern-Source"/>
-<s3 title="Source">
-<gloss>
-<label>Intent</label>
-<item>Serve as a
-  single vendor-neutral object for multiple types of input.</item>
-<label>Responsibilities</label>
-<item>Act as simple data holder for System IDs, DOM nodes, streams,
-  etc.</item>
-<label>Thread safety</label>
-<item>Threadsafe concurrently over multiple
-  threads for read-only operations; must be synchronized for edit
-  operations.</item>
-</gloss>  
-</s3><anchor name="pattern-Result"/>
-<s3 title="Result">
-<p>Alternative name: ResultTarget.</p>
-<gloss>
-<label>Intent</label>
-<item>Serve
-  as a single object for multiple types of output, so there can be simple process
-  method signatures.</item>
-<label>Responsibilities</label>
-<item>Act as simple data holder for
-  output stream, DOM node, ContentHandler, etc.</item>
-<label>Thread safety</label>
-<item>Threadsafe concurrently over multiple threads for read-only,
-  must be synchronized for edit.</item>
-</gloss>
-</s3> 
- </s2>
- </s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/usagepatterns.xml b/xdocs/sources/xalan/usagepatterns.xml
deleted file mode 100644
index b60710e..0000000
--- a/xdocs/sources/xalan/usagepatterns.xml
+++ /dev/null
@@ -1,533 +0,0 @@
-<?xml version="1.0" standalone="no"?> 
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="Basic usage patterns">
-<ul>
-<li><link anchor="basic">Basic steps</link></li>
-<li><link anchor="plug">Plugging in the Transformer and XML parser</link></li>
-<li><link anchor="outputprops">Setting output properties in your stylesheets</link></li>
-<li><link anchor="outputencoding">Caution: setting output encoding in the stylesheet</link></li>
-<li><link anchor="embed">Working with embedded stylesheets</link></li>
-<li><link anchor="params">Setting stylesheet parameters</link></li>
-<li><link anchor="serialize">Serializing output</link></li>
-<li><link anchor="sax">Explicitly working with SAX</link></li>
-<li><link anchor="outasin">Using transformation output as input for another transformation</link></li>
-<li><link anchor="dom">Processing and producing DOM trees</link></li>
-<li><link anchor="xpath">Working with XPath expressions</link></li>
-<li><link anchor="applet">Using the &xslt4j; applet wrapper</link></li>
-<li><link anchor="servlet">Using &xslt4j; in a servlet</link></li>
-<li><link anchor="extensions">Creating and using extensions</link></li>
-<li><link anchor="multithreading">Multithreading</link></li>
-<li><link anchor="debugging">Debugger interface</link></li>
-<li><link anchor="compat">Using the &xslt4j; version 1 API</link> <em>[Deprecated]</em></li>
-</ul>
-<anchor name="basic"/>
-  <s2 title="Basic steps">
-    <ol>
-    <li><link anchor="transformerfactory">Instantiate a TransformerFactory</link></li>
-    <li><link anchor="transformer">Process the stylesheet and generate a Transformer</link></li>
-    <li><link anchor="transformation">Perform the transformation</link></li>
-  </ol>
-    <p>The following example illustrates the three basic steps involved in performing a transformation.</p>
-    <source>// 1. Instantiate a TransformerFactory.
-javax.xml.transform.TransformerFactory tFactory = 
-                  javax.xml.transformerTransformerFactory.newInstance();
-
-// 2. Use the TransformerFactory to process the stylesheet Source and
-//    generate a Transformer.
-javax.xml.transform.Transformer transformer = tFactory.newTransformer
-                (new javax.xml.transform.stream.StreamSource("foo.xsl");
-
-// 3. Use the Transformer to transform an XML Source and send the
-//    output to a Result object.
-transformer.transform
-    (new javax.xml.transform.stream.StreamSource("foo.xml"), 
-     new javax.xml.transform.stream.StreamResult( new
-                                  java.io.FileOutputStream("foo.out")));</source>
-  <note>For a working example of this model at its simplest, see SimpleTransform.java in the java/samples/SimpleTransform subdirectory.</note>
-  </s2><anchor name="transformerfactory"/>
-  <s2 title="1. Instantiate a TransformerFactory">
-  <p><jump href="apidocs/javax/xml/transform/TransformerFactory.html">TransformerFactory</jump> is an abstract class with a static newInstance() method that instantiates the concrete subclass designated by the javax.xml.transform.TransformerFactory system property.</p>
-  <p>The default setting for this system property is <jump href="apidocs/org/apache/xalan/processor/TransformerFactoryImpl.html">org.apache.xalan.processor.TransformerFactoryImpl</jump>.</p>
-</s2><anchor name="transformer"/>
-  <s2 title="2. Use the TransformerFactory to process the stylesheet Source and produce a Transformer">
-<p>The TransformerFactory <jump href="apidocs/javax/xml/transform/TransformerFactory.html#newTransformer(javax.xml.transform.Source)">newTransformer(Source xslSource)</jump> method processes the stylesheet Source into a Templates object and returns a Transformer that you can use to perform a transformation (apply the Templates object to an XML Source).</p>
-<p>You may provide the stylesheet Source in the form of a stream of XML markup (<jump href="apidocs/javax/xml/transform/stream/StreamSource.html">StreamSource</jump>), a DOM Node (<jump href="apidocs/javax/xml/transform/dom/DOMSource.html">DOMSource</jump>), or a SAX InputSource (<jump href="apidocs/javax/xml/transform/sax/SAXSource.html">SAXSource</jump>). To specify a StreamSource, you may use a system ID or file name (using URI syntax), a java.io.InputStream, or a java.io.Reader. The use of DOMSource and SAXSource are illustrated in subsequent sections.</p>
-<note>If you plan to use the stylesheet Source to transform multiple XML Sources, you should use the TransformerFactory <jump href="apidocs/javax/xml/transform/TransformerFactory.html#newTemplates(javax.xml.transform.Source)">newTemplates(Source xslSource)</jump> method to explicitly generate a Templates object. For each transformation, use the Templates object to generate a new Transformer. For the details, see <link anchor="multithreading">Multithreading</link>.</note>
-</s2><anchor name="transformation"/>
-<s2 title="3. Use the Transformer to perform a transformation">
-<p>Use the Transformer <jump href="apidocs/javax/xml/transform/Transformer.html#transform(javax.xml.transform.Source,javax.xml.transform.Result">transform(Source xmlSource, Result transformResult)</jump> method to transform  the XML Source and place the transformation output in a Result object.</p>
-<p>Just as with the stylesheet, you can supply the XML Source in the form of a <jump href="apidocs/javax/xml/transform/stream/StreamSource.html">StreamSource</jump>, <jump href="apidocs/javax/xml/transform/dom/DOMSource.html">DOMSource</jump>, or <jump href="apidocs/javax/xml/transform/sax/SAXSource.html">SAXSource</jump>. Likewise, the Result may be a <jump href="apidocs/javax/xml/transform/stream/StreamResult.html">StreamResult</jump>, <jump href="apidocs/javax/xml/transform/dom/DOMResult.html">DOMResult</jump>, or <jump href="apidocs/javax/xml/transform/sax/SAXResult.html">SAXResult</jump>.</p>
-<p>For each node in the XML source, the Transformer uses the transformation instructions in the Templates object to determine which template to apply: one of the templates in the Templates object, a default template rule as specified in the XSLT spec, or none.</p>
-</s2><anchor name="plug"/>
-<s2 title="Plugging in a Transformer and XML parser">
-<p>The Java API for XML Processing interfaces enable you to isolate your application from the internal implementation details of a given Transformer, SAX parser, or DOM parser. For each of these objects, there is an abstract Factory class with a static newInstance() method that instantiates a concrete Factory which wraps the underlying implementation. These newInstance() methods use system property settings to determine which implementation to instantiate.</p>
-<p>&xslt4j; is distributed with a system property setting for the Xalan XSLT Transformer. This setting is in xalan.jar in META-INF/services (see src/META-INF/services).</p>
-<gloss>
-  <label>System property</label>
-    <item>Setting</item>
-  <label><code>javax.xml.transform.TransformerFactory</code></label>
-   <item><code>org.apache.xalan.processor.TransformerFactoryImpl</code></item>
-</gloss>
-<p>If you are using Xerces, the XML parser factory settings are as follows:</p>
-<gloss>
-  <label>System property</label>
-    <item>Setting</item>
-  <label><code>javax.xml.parsers.DocumentBuilderFactory</code></label>
-   <item><code>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</code></item>    
-  <label><code>javax.xml.parsers.SAXParserFactory</code></label>
-   <item><code>org.apache.xerces.jaxp.SAXParserFactoryImpl</code></item>
- </gloss>
-<p>You can change any of these settings as follows (in order of precedence):</p>
-<ol>
-  <li>Set the system property from the command line when you launch Java or from within your application.<br/><br/></li>
-  <li>Set the system property in jaxp.properties in the JAVA_HOME/lib directory, where JAVA_HOME is the root of the JDK.<br/><br/></li>
-  <li>Revise the entry in src/META-INF/services and rebuild xalan.jar or xerces.jar (depending on which entry you have changed).<br/><br/></li>
-</ol>
-<p>For example, to use the Crimson XML parser in place of the Xerces XML parser, place Crimson on the class path and set the 
-<code>javax.xml.parsers.SAXParserFactory</code> system property to <code>org.apache.crimson.jaxp.SAXParserFactoryImpl</code>.</p>
-<p>For more information about the mechanism used to determine system property values and how you can plug other implementations into your applications, see "Section 3: Plugability Layer" in the <ref>Java API for XML Processing</ref> at 
-<jump href="http://java.sun.com/aboutJava/communityprocess/review/jsr063/index.html">JSR-000063 1.1</jump>.</p> 
-</s2><anchor name="outputprops"/>
-<s2 title="Setting output properties in your stylesheets">
-<p>Output properties for XML, HTML, and Text transformation output are defined in property files in the org.apache.xalan.templates package.</p>
-<p>You can change these settings as follows:</p>
-<ol>
-  <li>Declare the xalan namespace in your stylesheet element (xmlns:xalan="http://xml.apache.org/xslt").<br/><br/></li>
-  <li>Use the namespace prefix you assign (for example, "xalan") to redefine properties of interest in the stylesheet xsl:output
-      element (for example, xalan:indent-amount="5").</li>
-</ol>
-<p>The following stylesheet fragment declares the xalan namespace and sets indent-amount to 2:</p>
-<source>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xsl:stylesheet version="1.0" 
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:xalan="http://xml.apache.org/xslt"&gt;
-                
-  &lt;xsl:output method="xml" 
-              encoding="UTF-8"
-              indent="yes" 
-              xalan:indent-amount="2"/&gt;</source>
-  <p>If you want to change the property settings globally, edit the values in the property files in src/org/apache/xalan/templates, 
-  and use Ant to <link idref="readme" anchor="jar">rebuild xalan.jar</link>.</p>
-<p>The properties files define the following properties:</p>
-<p><ref>output_xml.properties</ref>:</p>
-<table>
-  <tr>
-    <th>Property</th>
-    <th>Default value</th>
-  </tr>  
-  <tr>
-    <td>xalan:indent-amount</td>
-    <td>0</td>
-  </tr>
-  <tr>
-    <td>xalan:content-handler</td>
-    <td>org.apache.xalan.serialize.SerializerToXML</td>
-  </tr>
-</table>
-<p><ref>output_html.properties</ref>:</p>
-<table>
-  <tr>
-    <th>Property</th>
-    <th>Default value</th>
-  </tr>  
-  <tr>
-    <td>xalan:indent-amount</td>
-    <td>0</td>
-  </tr>
-  <tr>
-    <td>xalan:content-handler</td>
-    <td>org.apache.xalan.serialize.SerializerToHTML</td>
-  </tr>
-  <tr>
-    <td>xalan:entities</td>
-    <td>HTMLEntities.res</td>
-  </tr>
-  <tr>
-    <td>xalan:use-url-escaping</td>
-    <td>yes</td>
-  </tr>
-  <tr>
-    <td>xalan:omit-meta-tag</td>
-    <td>no</td>
-  </tr>
-</table>
-<note>You can also create your own HTML entity file (mapping characters to entities) 
-or edit src/org/apache/xalan/serialize/HTMLEntities.res and rebuild xalan.jar.</note>
-<p><ref>output_text.properties</ref>:</p>
-<table>  
-  <tr>
-    <th>Property</th>
-    <th>Default value</th>
-  </tr>
-  <tr>
-    <td>xalan:content-handler</td>
-    <td>org.apache.xalan.serialize.SerializerToText</td>
-  </tr>
-</table>
-</s2><anchor name="outputencoding"/>
-<s2 title="Caution: setting output encoding in the stylesheet">
-<p>When you use the &lt;xsl:output&gt; encoding attribute to set output character encoding, you should not 
-use StreamResult(java.io.Writer) to construct a 
-<jump href="apidocs/javax/xml/transform/stream/StreamResult.html">StreamResult</jump> object to hold the transformation result.
-If you do, the Writer uses its own encoding rather than the encoding specified in the stylesheet.</p>
-<p>If you want to use a Writer, you can specify an encoding when you create the Writer (java.io.OutputStreamWriter). Once the 
-Writer exists, you cannot reset the encoding it uses.</p>
-</s2><anchor name="embed"/>
-<s2 title="Working with embedded stylesheets">
-<p>An XML Source may include an <jump href="http://www.w3.org/TR/xml-stylesheet/">xml-stylesheet processing instruction</jump> which identifies the stylesheet to be used to process the document. As indicated by the processing instruction <ref>href</ref> attribute, the stylesheet itself may be embedded in the XML document or located elsewhere.</p>
-<p>Suppose you have an XML document (foo.xml) with the following xml-stylesheet processing instruction:</p>
-<p><code>&lt;?xml-stylesheet type="text/xml" href="foo.xsl"?&gt;</code></p>
-<p>The following fragment, uses this instruction to locate the stylesheet (foo.xsl in the same directory as foo.xml) and create a Templates object. Note the use of the TransformerFactory getAssociatedStylesheet() in step 2a.</p>
-<note>An XML document may include more than one xml-stylesheet processing instruction, hence the support for working with multiple stylesheets. If more than one stylesheet is returned, the other stylesheets are imported into the first stylesheet.</note>
-<source>// 1. Instantiate the TransformerFactory.
-javax.xml.transform.TransformerFactory tFactory = 
-                    javax.xml.transform.TransformerFactory.newInstance();
-// 2a. Get the stylesheet from the XML source.
-String media = null , title = null, charset = null;
-javax.xml.transform.Source stylesheet = tFactory.getAssociatedStylesheet
-                   (new StreamSource("foo.xml"),media, title, charset);
-
-// 2b. Process the stylesheet and generate a Transformer.
-Transformer transformer = tFactory.newTransformer(stylesheet);
-
-// 3. Use the Transformer to perform the transformation and send the
-//    the output to a Result object.
-transformer.transform
-             (new javax.xml.transform.stream.StreamSource("foo.xml"),
-              new StreamResult (new java.io.FileOutputStream("foo.out")));</source>
-<p>For a sample that uses this technique, see <link idref="samples" anchor="usestylesheetpi">UseStylesheetPI</link>.</p>
-<p>You can also instruct the <link idref="commandline">command-line utility</link> to use stylesheet processing
-instructions:</p>
-<ol>
-  <li>Include the <code>-in</code> flag with an XML source that contains a stylesheet processing instruction.<br/><br/></li>
-  <li>Do not include the <code>-xsl</code> flag.</li>
-</ol>
-</s2><anchor name="serialize"/>
-<s2 title="Serializing output">
-<p>In some cases, you may want to "transform" a DOM tree into a stream, which the XML community calls serialization. <link idref="trax">TRaX (Transformation API for XML)</link> and the &xslt4j; Transformer implementation provide direct support for this operation. Simply use the TransformerFactory newTransformer() method (no arguments) to create a Transformer that you can use to "copy" a DOMSource to a StreamResult. For examples, see Examples.exampleDOM2DOM(), Examples.exampleSerializeNode(), and Examples.exampleAsSerializer() in the <link idref="samples" anchor="trax">trax sample</link>.</p>
-</s2><anchor name="params"/>
-<s2 title="Setting stylesheet parameters">
-<p>An XSLT stylesheet may include parameters that are set at run time each time a transformation is performed. To set a stylesheet parameter, use the Transformer 
-<jump href="apidocs/javax/xml/transform/Transformer.html#setParameter(java.lang.String,java.lang.Object)">setParameter(String name, Object value)</jump> method. For a working example, see UseStylesheetParam.java in the samples/UseStylesheetParam subdirectory.</p>
-<p>You can also set a parameter with the command-line utility by including the <code>-param</code> flag. For example:</p>
-<p><code>java org.apache.xalan.xslt.Process -in foo.xml -xsl foo.xsl -param param1 foobar</code></p>
-<p>where <code>param</code> is the parameter name and <code>foobar</code> is the parameter value. The parameter namespace is null.</p>
-<note>&xslt4j2; processes string parameters. You are no longer required (as you were with &xslt4j; version 1) to enclose strings in single 
-quotes (') as string expressions.</note>
-</s2><anchor name="sax"/>
-<s2 title="Explicitly working with SAX">
-  <p>&xslt4j; uses the SAX event model to process stylesheets, to parse XML input documents, and to produce output. For each of these operations, an XMLReader reads input, firing parse events, and a ContentHandler listens to the XMLReader and executes parse event methods.</p>
-<p>When you use the basic procedure described above for performing transformations, &xslt4j; takes care of many of the SAX details under the covers. You are free to make these details explicit, which simply means that you can intervene in the procedure to accommodate the precise environment in which your application operates.</p>
-<p>Suppose, for example, you are using a custom XMLReader, perhaps doing more than just parsing static XML documents) to generate &xslt4j; SAX parse events. You might even have a custom reader for producing/processing stylesheets. You can cast the TransformerFactory to a SAXTransformerFactory, which provides access to a TransformerHandler, which you can set as the ContentHandler for this reader.</p>
-  <p>The following example explicitly sets up the XMLReader and ContentHandlers, and replicates the <link anchor="basic">basic steps</link> described above.</p>
-  <source>// Instantiate a TransformerFactory.
-javax.xml.transform.TransformerFactory tFactory = 
-                    javax.xml.transform.TransformerFactory.newInstance();
-// Verify that the TransformerFactory implementation you are using
-// supports SAX input and output (&xslt4j; does!).
-if (tFactory.getFeature(javax.xml.transform.sax.SAXSource.FEATURE) &amp;&amp; 
-    tFactory.getFeature(javax.xml.transform.sax.SAXResult.FEATURE))
-  { 
-    // Cast the TransformerFactory to SAXTransformerFactory.
-    javax.xml.transform.sax.SAXTransformerFactory saxTFactory = 
-                   ((javax.xml.transform.SAXTransformerFactory) tFactory);
-    // Create a Templates ContentHandler to handle parsing of the 
-    // stylesheet.
-    javax.xml.transform.sax.TemplatesHandler templatesHandler = 
-                                        saxTFactory.newTemplatesHandler();
-
-    // Create an XMLReader and set its ContentHandler.
-    org.xml.sax.XMLReader reader = 
-                   org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
-    reader.setContentHandler(templatesHandler);
-    
-    // Parse the stylesheet.                       
-    reader.parse("foo.xsl");
-
-    // Get the Templates object (generated during the parsing of the stylesheet)
-    // from the TemplatesHandler.
-    javax.xml.transform.Templates templates = 
-                                          templatesHandler.getTemplates();
-    // Create a Transformer ContentHandler to handle parsing of 
-    // the XML Source.  
-    javax.xml.transform.sax.TransformerHandler transformerHandler 
-                           = saxTFactory.newTransformerHandler(templates);
-    // Reset the XMLReader's ContentHandler to the TransformerHandler.
-    reader.setContentHandler(transformerHandler);
-
-    // Set the ContentHandler to also function as a LexicalHandler, which
-    // can process "lexical" events (such as comments and CDATA). 
-    reader.setProperty("http://xml.org/sax/properties/lexical-handler", 
-                        transformerHandler);
-
-    // Set up a Serializer to serialize the Result to a file.
-    org.apache.xalan.serialize.Serializer serializer = 
-    org.apache.xalan.serialize.SerializerFactory.getSerializer
-    (org.apache.xalan.templates.OutputProperties.getDefaultMethodProperties
-                                                                   ("xml"));
-    serializer.setOutputStream(new java.io.FileOutputStream("foo.out"));
-    // The Serializer functions as a SAX ContentHandler.
-    javax.xml.transform.Result result =
-      new javax.xml.transform.sax.SAXResult(serializer.asContentHandler());
-    transformerHandler.setResult(result);
-      
-    // Parse the XML input document.
-    reader.parse("foo.xml");</source>
-</s2><anchor name="outasin"/>
-<s2 title="Using transformation output as input for another transformation">
-
-<p>You can chain together a series of transformations such that the output of each transformation provides input for the next transformation. &xslt4j; supports two basic strategies for chaining a series of transformations:</p>
-<ul>
-  <li>Use the SAXTransformerFactory to process the stylesheet and create a TransformerHandler for each transformation. Then you can set
-the first TransformerHandler as the ContentHandler for the XMLReader that parses the input, make the second TransformerHandler the ContentHandler for the output of the first TransformerHandler, and so on. For more detail and an example, see the <link idref="samples" anchor="pipe">Pipe</link> sample.<br/><br/></li>
-  <li>Use the SAXTransformerFactory to process the stylesheet and create a SAX XMLFilter for each transformation. Set an XMLReader as the parent of the first XMLFilter, the first XMLFilter as the parent of the second XMLFilter, and so on. You launch the series of transformations by instructing the last XMLFilter to parse the XML Source for the first transformation. For more detail and an example, see the <link idref="samples" anchor="usexmlfilters">UseXMLFilters</link> sample.</li>
-</ul>
-</s2><anchor name="dom"/>
-<s2 title="Processing and producing DOM trees">
-  <p>In some cases, the input and/or desired output for a transformation may be a DOM tree object. The javax.xml.transform.DOM package provides <jump href="apidocs/javax/xml/transform/dom/DOMSource.html">DOMSource</jump> and a <jump href="apidocs/javax/xml/transform/dom/DOMResult.html">DOMResult</jump>, either or both of which you can use when you perform a transformation.</p>
-<p>In some cases, your application provides input in the form of a DOM tree, which accelerates the transformation process, since the input has in effect already been processed. To produce DOM input from a stream, you can use a <jump href="apidocs/javax/xml/parsers/DocumentBuilderFactory.html">DocumentBuilderFactory</jump> to produce a <jump href="apidocs/javax/xml/parsers/DocumentBuilder.html">DocumentBuilder</jump> with which you can parse the XML input into a DOM Document, as illustrated below.</p>
-<source>// Instantiate a DocumentBuilderFactory.
-javax.xml.parsers.DocumentBuilderFactory dfactory =
-                    javax.xml.parsers.DocumentBuilderFactory.newInstance();
-// Use the DocumentBuilderFactory to provide access to a DocumentBuilder.
-javax.xml.parsers.DocumentBuilder dBuilder = dfactory.newDocumentBuilder();
-// Use the DocumentBuilder to parse the XML input.
-org.w3c.dom.Document inDoc = dBuilder.Parse("foo.xml");</source>
-<p>To produce DOM output, simply use a Transformer to transform to a DOMResult object.</p>
-<source>// Generate a Transformer.
-javax.xml.transform.Transformer transformer = tFactory.newTransformer
-                  (new javax.xml.transform.Stream.StreamSource("foo.xsl"));
-// Create an empy DOMResult object for the output.
-javax.xml.transform.dom.DOMResult domResult =
-                                   new javax.xml.transform.dom.DOMResult();
-// Perform the transformation.
-transformer.transform(new javax.xml.transform.dom.DOMSource(inDoc)
-                      domResult;
-// Now you can get the output Node from the DOMResult.
-org.w3c.dom.Node node = domResult.getNode();</source>
-<note>Create a new DOMResult object or use DOMResult.setNode() to assign a new container each time you want to perform a transformation 
-and place the output in a DOMResult object.</note>
-<p>The <link idref="samples" anchor="dom2dom">DOM2DOM</link> illustrates both procedures, and serializes the DOMResult to System.out.</p>
-</s2><anchor name="xpath"/>
-<s2 title="Working with XPath expressions">
-<p>XSLT stylesheets use XPath expressions to select nodes, specify conditions, and generate text for the result tree. XPath provides an API that you can call directly. For example, you may want to select nodes programmatically and do your own processing without a stylesheet.</p>
-<p>XPath is an independent entity, with clients other than XSLT processors (such as XPointer). Accordingly, &xslt4j2; has packaged XPath as a separate module (org.apache.xpath and its subpackages), although concurrently this module does use some utility classes packaged in org.apache.xalan.utils. The org.apache.xpath.XPathAPI class contains convenience methods that you can use to return single DOM Nodes, NodeIterators, and XObjects. Apart from their own functionality, these methods also provide a path into the lower-level XPath API that you may find useful.</p>
-<p>For an example that uses the XPathAPI convenience methods to execute XPath expressions against XML source files, see <link idref="samples" anchor="applyxpath">ApplyXPath</link>.</p>
-</s2><anchor name="applet"/>
-<s2 title="Using the &xslt4j; applet wrapper">
-<ol> 
-<li>Include <jump href="apidocs/org/apache/xalan/client/XSLTProcessorApplet.html">XSLTProcessorApplet</jump> in an HTML client.<br/><br/></li>
-<li>Specify the XML source document and XSL stylesheet.<br/><br/>
-You can use the DocumentURL and StyleURL PARAM tags or the <jump href="apidocs/org/apache/xalan/client/XSLTProcessorApplet.html#setDocumentURL(java.lang.String)">setdocumentURL()</jump> and <jump href="apidocs/org/apache/xalan/client/XSLTProcessorApplet.html#setStyleURL(java.lang.String)">setStyleURL()</jump> methods. If the XML document contains a stylesheet Processing Instruction (PI), you do not need to specify an XSL stylesheet.<br/><br/></li>
-<li>Call the <jump href="apidocs/org/apache/xalan/client/XSLTProcessorApplet.html#transformToHtml(java.lang.String,java.lang.String)">transformToHtml()</jump> or <jump href="apidocs/org/apache/xalan/client/XSLTProcessorApplet.html#getHtmlText()">getHtmlText()</jump> method, which performs the transformation and returns the new document as a String.</li></ol>
-<note>The transformToHTML() method takes arguments for the XML source document and XSL stylesheet. The getHtmlText() method takes no arguments: it uses property or parameter settings, as in the example below.</note>
-<p>For an example, see the <link idref="samples" anchor="appletxmltohtml">AppletXMLtoHTML</link> sample applet. The &lt;applet&gt; tag is in samples/AppletXMLtoHTML/client.html:</p>
-<source>&lt;applet  
-    name="xslControl"
-    code="org.apache.xalan.client.XSLTProcessorApplet.class"
-    archive="../../bin/xalan.jar,../../bin/xerces.jar"
-    height="0"
-    width"0">
-    &lt;param name="documentURL" value="xalanApplets.xml"/&gt;
-    &lt;param name="styleURL" value="s1ToHTML.xsl"/&gt;
-&lt;/applet&gt;</source>
-<p>When the user clicks the Transform button, the HTML client calls the getHtmlText() method, and puts the returned HTML text in a frame for the user to view.</p>
-
-</s2><anchor name="servlet"/>
-<s2 title="Using &xslt4j; in a servlet">
-<p>You can set up a servlet to use &xslt4j; to respond to requests for XML documents by transforming those documents into HTML and serving them to web browsers. To respond to HTTP GET requests, all you need to do is overwrite the HttpServlet doGet() method with a procedure that instantiates a Transformer and uses it to perform a transformation. As the following example shows, you can generate a ResultStream that a PrintWriter writes to the HttpResponse OutputStream, returning the transformation output to the web browser.</p>
-<source>
-public class SampleXSLTServlet extends javax.servlet.http.HttpServlet {
-  
-  // Respond to HTTP GET requests from browsers.
-  public void doGet (javax.servlet.http.HttpServletRequest request,
-                     javax.servlet.http.HttpServletResponse response)
-    throws javax.servlet.ServletException, java.io.IOException
-  {
-    // Set content type for HTML.
-    response.setContentType("text/html; charset=UTF-8");    
-    // Output goes to the response PrintWriter.
-    java.io.PrintWriter out = response.getWriter());
-    try
-    {	
-      javax.xml.transform.TransformerFactory tFactory = 
-                javax.xml.transform.TransformerFactory.newInstance();
-      // Get the XML input document and the stylesheet, both in the servlet
-      // engine document directory.
-      javax.xml.transform.Source xmlSource = 
-                new javax.xml.transform.stream.StreamSource
-                             (new java.net.URL("file:foo.xml").openStream());
-      javax.xml.transform.Source xslSource = 
-                new javax.xml.transform.stream.StreamSource
-                             (new java.net.URL("file:foo.xsl").openStream());
-      // Generate the transformer.
-      javax.xml.transform.Transformer transformer = 
-                             tFactory.newTransformer(xslSource);
-      // Perform the transformation, sending the output to the response.
-      transformer.transform(xmlSource, 
-                           new javax.xml.transform.stream.StreamResult(out));
-    }
-    // If an Exception occurs, return the error to the client.
-    catch (Exception e)
-    {
-      out.write(e.getMessage());
-      e.printStackTrace(out);    
-    }
-    // Close the PrintWriter.
-    out.close();
-  }  
-}</source>
-<p>For a working sample, see <link idref="samples" anchor="simplexsltservlet">SimpleXSLTServlet</link>.</p>
-<p>In the preceding example, the URLs for the XML document and XSL stylesheet are hardcoded in the servlet. You can also create a servlet that parses the request URL for input parameters specifying the XML document, XSL stylesheet, and any relevant stylesheet parameters. For samples, see <link idref="samples"
-anchor="usestylesheetparamservlet">UseStylesheetParamServlet</link> and <link idref="samples" anchor="xsltservletwithparams">XSLTServletWithParams</link>. For a more robust and complex sample that also employs a properties file to determine which stylesheet to use depending on the client browser/device, see <link idref="samples" anchor="applyxslt">ApplyXSLT</link>.</p>
-</s2><anchor name="extensions"/>
-<s2 title="Creating and using extensions">
-<p>For those cases where you want to be able to call procedural code from within a stylesheet, the &xslt4j; Extensions facility supports the creation of extension elements and extension functions. See <link idref="extensions">Extensions</link> and <link idref="samples" anchor="extensions">Extensions samples</link>.</p>
-</s2><anchor name="multithreading"/>
-<s2 title="Multithreading">
-<p>A given Templates object may be used repeatedly and even in multiple threads running concurrently for the transformation of XML input, but you should use the Templates object to instantiate a separate Transformer for each transformation you perform. The Templates object is an immutable runtime representation of the structure and content of a stylesheet (which may include and import multiple stylesheet sources). A Transformer, on the other hand, is a lightweight object that tracks state information during the transformation, and should only be used to perform a single transformation.</p>
-
-<p>If you want to perform multiple transformations (sequentially or concurrently) with the same stylesheet instructions, do the following:</p>
-<ol>
-  <li>Use the TransformerFactory <jump href="apidocs/javax/xml/transform/TransformerFactory.html#newTemplates(javax.xml.transform.Source)">newTemplates(Source xslSource)</jump> method to create a Templates object.<br/><br/></li>
-<li>For each transformation, use the Templates object <jump href="apidocs/javax/xml/transform/Templates.html#newTransformer()">newTransformer()</jump> method to create a Transformer, and use that Transformer's 
-<jump href="apidocs/javax/xml/transform/Transformer.html#transform(javax.xml.transform.Source,javax.xml.transform.Result)">transform(Source xmlSource, Result transformResult)</jump> method to perform the transformation.</li>
-</ol>
-<p>For an example, see Examples.exampleUseTemplatesObj() in the <link idref="samples" anchor="trax">trax sample</link>.</p>
-</s2><anchor name="debugging"/>
-<s2 title="Debugger Interface">
-		<p>&xslt4j; contains a debugger interface in the org.apache.xalan.xslt.trace package:</p> 
-		<ul>
-		  <li><jump href="apidocs/org/apache/xalan/trace/TraceListener.html">TraceListener</jump> is an interface that debuggers 
-		  can implement. Or, like the <link idref="commandline">command-line utility</link>, you can use the <jump
-      href="apidocs/org/apache/xalan/trace/PrintTraceListener.html">PrintTraceListener</jump> implementation of that interface.
-      <br/><br/></li>
-      <li>You can register a TraceListener with the 
-      <jump href="apidocs/org/apache/xalan/trace/TraceManager.html">TraceManager</jump> associated
-      with the Transformer that will perform a given transformation.<br/><br/></li>
-		  <li><jump href="apidocs/org/apache/xalan/trace/TracerEvent.html">TracerEvent</jump> is an event that is 
-		  passed to the TraceListener.trace function. It is called before a node is 'executed' in the stylesheet.<br/><br/></li>
-		  <li><jump href="apidocs/org/apache/xalan/trace/GenerateEvent.html">GenerateEvent</jump> is an event that is 
-		  passed to the TraceListener.generated() function. It is called after an event occurs to create something in the result
-      tree.<br/><br/></li>
-      <li><jump href="apidocs/org/apache/xalan/trace/SelectionEvent.html">SelectionEvent</jump> is an event triggered by the
-       selection of a stylesheet node.</li>
-		</ul>
-    <p>The <link idref="commandline">command-line utility</link> uses the debugger interface when you include one or more of the
-     following switches: <code>-TT</code>, <code>-TG</code>, <code>-TS</code>, <code>-TTC</code>.</p>
-    <p>Example:</p>
-<source>import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.trace.PrintTraceListener;
-...
-// Set up a PrintTraceListener object to print to a file.
-java.io.FileWriter fw = new java.io.FileWriter("events.log");
-java.io.PrintWriter pw = new java.io.PrintWriter(fw);
-PrintTraceListener ptl = new PrintTraceListener(pw);
-
-// Print information as each node is 'executed' in the stylesheet.
-ptl.m_traceElements = true;
-// Print information after each result-tree generation event.
-ptl.m_traceGeneration = true;
-// Print information after each selection event.
-ptl.m_traceSelection = true;
-// Print information whenever a template is invoked.
-ptl.m_traceTemplates = true;
-
-// Set up the transformation    
-javax.xml.transform.TransformerFactory tFactory = 
-                     javax.xml.trnasform.TransformerFactory.newInstance();
-javax.xml.transform.Transformer transformer = 
-  tFactory.newTransformer(new javax.xml.transform.stream.StreamSource
-                                                             ("foo.xsl"));
-
-// Cast the Transformer object to TransformerImpl.
-if (transformer instanceof TransformerImpl) {
-  TransformerImpl transformerImpl = (TransformerImpl)transformer;
-  
-  // Register the TraceListener with the TraceManager associated 
-  // with the TransformerImpl.
-  TraceManager trMgr = transformerImpl.getTraceManager();
-  trMgr.addTraceListener(ptl);
-  
-  // Perform the transformation --printing information to
-  // the events log during the process.
-  transformer.transform
-      ( new javax.xml.transform.stream.StreamSource("foo.xml"), 
-        new javax.xml.transform.stream.StreamResult
-                                    (new java.io.FileWriter("foo.out")) );
-}
-// Close the PrintWriter and FileWriter.
-pw.close();
-fw.close();</source>
-<p>For a sample application that uses this technique, see <link idref="samples" anchor="trace">Trace</link>.</p>
-</s2><anchor name="compat"/>
-<s2 title="Using the &xslt4j; version 1 API">
-<note><em>The compatibility jar (xalanj1compat.jar), which provides support for Xalan-Java 1 API, has been deprecated. All 
-support for this API will be removed in the next releaase. If you have not already done so, we stongly urge you to shift immediately to the Xalan-Java 2/JAXP 1.1 API.</em><br/><br/>
-<em>&xslt4j; version 1 is no longer supported and no longer available from xml.apache.org.</em></note>
-<p>The bin directory includes a compatibility jar, xalanj1compat.jar, that lets you rebuild your Xalan-Java 1.x applications to run with Xalan-Java 2. As a point of reference, this JAR includes the API required to recompile the Xalan-Java 1.x core sample applications (excluding the sample extensions) and run them with Xalan-Java 2. To use this compatibility layer with an existing Xalan-Java 1.x application, do the following:</p>
-<ol>
-<li>Place xalanj1compat.jar on the system classpath in front of the Xalan-Java 2 xalan.jar (both are in the bin directory).<br/><br/></li>
-<li>Recompile your application. It it does not compile, you may be using Xalan-Java 1.x API that the compatibility layer does not support. <br/><br/></li>
-<li>Run the recompiled application with xalanj1compat.jar on the system classpath in front of the Xalan-Java 2 xalan.jar.</li>
-</ol>
-<p>We urge our Xalan-Java 1.x users to start using Xalan-Java 2. That is where we are concentrating our efforts to improve performance and fix any outstanding bugs. To see what portion of the Xalan-Java 1.x API we have included in xalanj1compat.jar, see <resource-ref idref="compatapi"/>. For example, the compatibility layer does not support the use of Xalan-Java 1.x extensions. If you feel that we should extend our compatibility JAR to support additional Xalan-Java 1.x API calls, please let us know exactly what you would like to see.</p>
-</s2>
-</s1>
diff --git a/xdocs/sources/xalan/whatsnew.xml b/xdocs/sources/xalan/whatsnew.xml
deleted file mode 100644
index 72fd573..0000000
--- a/xdocs/sources/xalan/whatsnew.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="What's new in &xslt4j2;">
-<ul>
-     <li><link anchor="design">New design</link></li>
-     <li><link anchor="dtm">Document Table Model (DTM)</link></li>
-  </ul><anchor name="design"/>
-  <s2 title="New Design">
-  <p>&xslt4j2; represents a fundamental redesign of Xalan. The primary objective of this redesign is an easier-to-use, more understandable, and more modular API that encourages wider participation in its ongoing development by the open-source XML developer community, and that lends itself to "streaming," the production of transformation output while the input is still being parsed.</p>
-<p>&xslt4j2; builds on <resource-ref idref="sax2"/>, <resource-ref idref="dom2"/>, and the <resource-ref idref="jaxp"/>. For example, &xslt4j2; incorporates the SAX parsing event model in its support for the incremental production of transformation output. &xslt4j2; also implements the  standard TrAX API (see below) that enables you to code your XML applications without reference to the internal details of a particular Transformer or XML parser.</p>
-<p>Given the scope of the redesign, the changes with respect to <jump href="http://xml.apache.org/xalan/index.html">&xslt4j; 1.x</jump> are global in nature. For an introduction to the &xslt4j2; usage patterns, see <link idref="usagepatterns">Basic Usage Patterns</link>.</p>
-<p>&xslt4j2; implements the <link idref="trax">TRaX (Transformation API for XML)</link> interfaces. The product of extensive open-source collaboration by members of the XML developer community, TrAX provides a conceptual framework and a standard API for performing XML transformations. During its evolution, the TrAX API has undergone several revisions. We believe this API has now reached or is very close to final form. In November 2000, TrAX was incorporated into <resource-ref idref="jsr063"/>, the Java API for XML Processing 1.1 , which has been published for public review (see <resource-ref idref="jaxp11"/>). We strongly encourage you to utilize the TrAX framework when you use &xslt4j2; to perform XML transformations.</p>
-<p>The basic organization of TrAX is quite simple: use a TransformerFactory to process transformation instructions and generate a Transformer, with which you can apply the processed transformation instructions to your XML Source, producing a transformation Result. For more detail, see <link idref="usagepatterns" anchor="basic">Basic steps</link>.</p>
-<p>As part of the Java API for XML Processing, TraX provides a stable framework for plugging Transformers (like &xslt4j;) and XML parsers (like &xml4j;) into your applications without tying yourself to the internal details of those implementations. See <link idref="usagepatterns" anchor="plug">Plugging in a Transformer and XML parser</link>.</p>
-</s2><anchor name="dtm"/>
-<s2 title="&xslt4j; DTM">
-<p>In place of the DOM object tree of nodes, the Document Table Model (DTM) uses integer arrays and string pools to represent the structure and content of the XML document to be transformed. The motivation behind this model is to optimize performance and minimize storage. For more information, see <link idref="dtm">DTM</link>.</p>
-</s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/xmlfilters.gif b/xdocs/sources/xalan/xmlfilters.gif
deleted file mode 100644
index 2b4d640..0000000
--- a/xdocs/sources/xalan/xmlfilters.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xalan/xsltc_constraints.xml b/xdocs/sources/xalan/xsltc_constraints.xml
deleted file mode 100644
index 1d06d9a..0000000
--- a/xdocs/sources/xalan/xsltc_constraints.xml
+++ /dev/null
@@ -1,1111 +0,0 @@
-<anchor name="xsltcreleasenotes"/>
-<s2 title="XSLTC Release Notes">
-<p>For this release, please note the following changes, additions, omissions, problems, procedures for running demos, and new support for the TrAX API.</p>
-<ul>
-  <li><link anchor="xsltcnew">Changes and New Features</link></li>
-  <li><link anchor="xsltcconf">Conformance</link></li>
-  <li><link anchor="xsltcknownproblems">Known Problems</link></li>
-  <li><link anchor="xsltcdemos">Running Demos</link></li>  
-  <li><link anchor="xsltctrax">Translets and TrAX</link></li>
-    <li><link anchor="xsltchistory">History of XSLTC software changes</link></li>
-</ul>
-<anchor name="xsltcnew"/>
-<s3 title="Changes since &xslt4j; 2.2.D9">
-<p>XSLTC source code updates:</p>
-<ul><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java<br/><ref>Committer's log entry: </ref>I added a flag to the compiler/Parser class that is set if the outermost 
-element
- in the stylesheet contains a definition of the XSL namespace. The parser 
-already
- has a global variable '_target' that is set if the stylesheet contains a
- &lt;?xml-stylesheet?&gt; PI or not. The compiler will now flag an error if neither
- flags are set after the whole XSL/XML input document has been parsed.
- PR: bugzilla 1780
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler UnionPathExpr.java<br/><ref>Committer's log entry: </ref>Added a small fix that orders the expressions inside a union in such a way 
-that
- expressions with an attribute axis or attribute node type will be put first.
- PR: bugzilla 2921
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java<br/><ref>Committer's log entry: </ref>A small fix that will allow top-level elements of an unknown URI.
- XSLTC now ignored the element(s), while it previously reported an error
- of an unsupported XSLT extension.
- PR: bugzilla 2840
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- TextOutput.java<br/><ref>Committer's log entry: </ref>A start on a fix for output DOCTYPE declarations based on the attributes
- of the &lt;xsl:output&gt; element. I also added a fix for bug 2863, to prevent
- us from outputting namespace delcaration that point a prefix to the null
- URI (such as 'xmlns:blob=""').
- PR: bugzilla 2863
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler xpath.cup<br/><ref>Committer's log entry: </ref>bug 2553, fixes AbbreviatedAbsoluteLocationPath,
- some relative location paths still give duplicates, will need to filter.<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/cmdline Transform.java
- java/src/org/apache/xalan/xsltc/compiler Output.java
- java/src/org/apache/xalan/xsltc/runtime DefaultRun.java
- DefaultSAXOutputHandler.java TextOutput.java
- java/src/org/apache/xalan/xsltc/trax TransformerImpl.java<br/><ref>Committer's log entry: </ref>Implemented support for the doctype-system and doctype-public attributes
- of the &lt;xsl:output/&gt; element. The translet post-processor (TextOutput) can
- now be instanciated with a ContentHandler and an optional LexicalHandler.
- The LexicalHandler will receive notofications of the DOCTYPE declaration.
- The default SAX output handler now implements both ContentHandler and
- LexicalHandler. The LexicalHandler only handles the startDTD() method,
- by outputting the DOCTYPE declaration, and all other methods are empty.
- The trax.Transformer implementation has also been updated to use the
- LexicalHandler, but I still have not found any way in which a SAX client
- can set the LexicalHandler.
- PR: bugzilla 1504
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XslElement.java<br/><ref>Committer's log entry: </ref>A minor change to the class handling the &lt;xsl:element&gt; element to be more
- in-sync with the XSLT 1.0 spec (and M.Kay's book). This in order to make
- it more readable and maintainable. I was trying to debug the code for
- something I thought was a bug, and it was just impossible to navigate.
- This change was necessary, even though the code functioned as it should.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LiteralElement.java
- Parser.java<br/><ref>Committer's log entry: </ref>Fix for outputting all necessary namespace declarations with LREs.
- PR: bugzilla 2863
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom ReverseIterator.java<br/><ref>Committer's log entry: </ref>A fix to allow reverse iterators to be reset (inside nested for-each loops).
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/15/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java<br/><ref>Committer's log entry: </ref>bug fix 2553, new iterator to get rid of dups<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/15/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/compiler
- FilteredAbsoluteLocationPath.java<br/><ref>Committer's log entry: </ref>bug fix 2553, new abs location path<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler xpath.cup
- Constants.java<br/><ref>Committer's log entry: </ref>bug fix 2553, updated Constants for dup processing
- and updated CUP rule for AbbreviatedAbsoluteLocationPaths<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom AbsoluteIterator.java
- DOMImpl.java DupFilterIterator.java
- StepIterator.java UnionIterator.java<br/><ref>Committer's log entry: </ref>Implementation of id() and key() pattern - finally!
- Added a small fix to the DOMImpl$DescendantIterator to prevent NPEs.
- PR: bugzilla 1376
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler IdKeyPattern.java
- KeyCall.java Mode.java Output.java Parser.java
- TestSeq.java xpath.cup<br/><ref>Committer's log entry: </ref>Forgot an 'import' in DupFilterIterator
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- SAXAdapter.java TextOutput.java
- TransletOutputBase.java<br/><ref>Committer's log entry: </ref>missing file<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java<br/><ref>Committer's log entry: </ref>Added another fix for the missing DOCTYPE declaration. XSLTC will now output
- DOCTYPE declarations for HTML output if either doctype-system or doctype-
- public is declared in the &lt;xsl:output&gt; element. XSL output will get a
- DOCTYPE declaration only if doctype-system is declared.
- PR: 1504
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom AbsoluteIterator.java<br/><ref>Committer's log entry: </ref>
-
-
-<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler xpath.cup<br/><ref>Committer's log entry: </ref>turning on filtering, bug 2553<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java<br/><ref>Committer's log entry: </ref>Removed a bad optimisation in the duplicate filter iterator.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler xpath.cup<br/><ref>Committer's log entry: </ref>re-activated the no dups filtering, dont know how
- this got reverted back to no filtering, but it is fixed again.<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler IdKeyPattern.java
- Key.java KeyCall.java Parser.java Sort.java
- xpath.cup
- java/src/org/apache/xalan/xsltc/compiler/util
- CompareGenerator.java NodeSortRecordGenerator.java
- java/src/org/apache/xalan/xsltc/dom DTDMonitor.java
- DupFilterIterator.java KeyIndex.java
- NodeSortRecord.java NodeSortRecordFactory.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java BasisLibrary.java<br/><ref>Committer's log entry: </ref>Major update for id() and key(). Patterns containing id() and key() are
- now 100% supported (about time), and id() and key() expressions should
- now work in all (at least most) combinations.
- PR: bugzilla 1376 (!!!) and 2624
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java<br/><ref>Committer's log entry: </ref>A small fix for a cleanup I did in the basis library (it broke the
- substring() function)&gt;
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime TextOutput.java<br/><ref>Committer's log entry: </ref>Added small fix to prevent NPE in output handler.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/compiler Variable.java
- VariableRef.java VariableRefBase.java
- java/src/org/apache/xalan/xsltc/compiler/util
- MultiHashtable.java
- java/src/org/apache/xalan/xsltc/dom DOMImpl.java
- java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
- TextOutput.java TransletOutputBase.java<br/><ref>Committer's log entry: </ref>Added element/attribute prefix information in the internal DOM.
- This should fix some problems we have had with the copy and copy-of
- elements. Added a few lines of code in an attempt to speed up the DOM builder.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DTDMonitor.java<br/><ref>Committer's log entry: </ref>An attempt to optimise the building of the ID index. The previous version of
- this code would traverse the DOM once for each type of element that had a
- defined ID attribute. The new version traverses the DOM once, and looks up
- each element's type in a hashtable to determine its ID attribute type (if 
-any).
- The new version of the code does not use string comparisons, like the old one.
- This update was done to compensate for the possible performance degradation of
- having implemented an element/attribute prefix array in the internal DOM.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/21/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TemplatesHandlerImpl.java TemplatesImpl.java
- TransformerHandlerImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>Protected some methods in our TrAX code that are not defined in the TrAX API.
- These methods were never intended for public use and should have been defined
- as "protected" to begin with.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/22/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XslElement.java<br/><ref>Committer's log entry: </ref>Fix for a problem with some combinations of &lt;xsl:element&gt; and namespace
- aliasing. The output lacked the necessary namespace definitions when an
- element created with &lt;xsl:element&gt; was given a qname with a prefix that
- was mapped to some other prefix.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler ParameterRef.java<br/><ref>Committer's log entry: </ref>removed typeCheck(), uses the base classes method now<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler
- VariableRefBase.java<br/><ref>Committer's log entry: </ref>added default typeCheck() to this base class<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler RelationalExpr.java<br/><ref>Committer's log entry: </ref>bug fix 2838, cast to type real if both operands are
- ResultTreeType<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc DOM.java
- java/src/org/apache/xalan/xsltc/compiler
- AbsoluteLocationPath.java AbsolutePathPattern.java
- AncestorPattern.java ApplyTemplates.java
- BooleanExpr.java CallTemplate.java CastExpr.java
- Constants.java Copy.java CopyOf.java
- DocumentCall.java FilterExpr.java
- FilteredAbsoluteLocationPath.java ForEach.java
- FunctionCall.java Key.java KeyCall.java
- LastCall.java LocalNameCall.java Mode.java
- NameCall.java NamespaceUriCall.java Number.java
- Param.java ParameterRef.java
- ParentLocationPath.java ParentPattern.java
- PositionCall.java Predicate.java
- RelationalExpr.java Sort.java Step.java
- StepPattern.java Stylesheet.java
- SyntaxTreeNode.java Template.java TestSeq.java
- Text.java TransletOutput.java ValueOf.java
- Variable.java VariableRef.java Whitespace.java
- XSLTC.java
- java/src/org/apache/xalan/xsltc/compiler/util
- ClassGenerator.java ErrorMsg.java
- MethodGenerator.java NodeSetType.java NodeType.java
- ResultTreeType.java
- java/src/org/apache/xalan/xsltc/dom Axis.java
- DOMAdapter.java DOMImpl.java LoadDocument.java
- MultiDOM.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java BasisLibrary.java<br/><ref>Committer's log entry: </ref>Changes all calls from the compiled translet code to the DOM to be calls
- to the DOM interface (and not to a specific DOM class). I did this to make
- it possible to plugi in any DOM implementation.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/compiler Constants.java
- TransletOutput.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- TextOutput.java TransletOutputBase.java<br/><ref>Committer's log entry: </ref>Added an &lt;xsltc:output&gt; extension to allow for multiple output files. I know
- that this is not a prioritised task, but I need this for a little project I
- am working on.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/28/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Param.java
- ParameterRef.java Variable.java VariableBase.java
- VariableRef.java
- java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetType.java NodeType.java ReferenceType.java
- ResultTreeType.java StringType.java Type.java<br/><ref>Committer's log entry: </ref>A few fixes for the regression caused by my last (huge) putback.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/28/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DupFilterIterator.java<br/><ref>Committer's log entry: </ref>A fix for the position() function when using duplicate filter iterators.
- PR: n/
- Obtained from: N/A
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li></ul>
-</s3>
-<anchor name="xsltcconf"/>
-<s3 title="XSLT 1.0 Conformance and Extensions">
-<p>XSLTC does not yet support the following features of the <resource-ref idref="xsl"/>:</p>
-<ul>
-  <li>The namespace axis is not implemented. You cannot get a node set containing the namespace nodes
-    in scope from a context node in the document tree. Otherwise, namespace functionality is implemented.</li>
-</ul>
-<p>XSLTC does not support a number of features that are not required by the XSLT 1.0 specification,
-but which are supported by a number of other XSLT processors:</p>
-<ul>
-  <li>Incomplete support for extension elements and external Java functions. Currently you can set up an extension function
-    to call a static Java function. For the extension namespace, use<br/>
-    &nbsp;&nbsp;&nbsp;&nbsp;http://xml.apache.org/xalan/xsltc/java/&lt;class&gt;<br/>
-    where &lt;class&gt; identifies the class with the static method.</li>
-  <li>Lack of support for the redirection of output to multiple
-    output files from within a stylesheet (equivalent to xalan:redirect or
-    saxon:output).</li>
-  <li>XSLTC does not implement a node-set extension to convert result tree fragments to
-    node-sets. This would enable sorting and grouping of nodes assigned to a tree </li>
-</ul>
-</s3>
-<anchor name="xsltcknownproblems"/>
-<s3 title="Known Problems">
-<ul>
-  <li>Casting variables: XSLTC requires you to explicitly type cast values 
-  returned by variables or expressions, when you use them in tests. Always a good
-  practice, but it may seem like overkill in some in contexts, where other XSLT processors
-  automatically assume or convert to the correct type. For example. unless you cast $country
-  to a string in the following apply-templates, entry nodes whose &lt;country&gt; elements
-  contain a string matching the global $country parameter are NOT selected.<br/><br/>
-&nbsp;&nbsp;&nbsp;&nbsp;<code>&lt;xsl:apply-templates select="entry[country=string($country)]"/&gt;</code></li>
-  <li>Order dependency of conditions within a predicate: If you have a predicate in a select or match
-  expression that has multiple conditions, one of which contains a union (X or Y), put it last. 
-  Otherwise, the predicate fails to match node that it should.</li>
-  <li>When using DOM caching, as shown in the Servlet demo, if the source document is local to the 
-  server, the cache is not refreshed when the source XML document is modified. This 
-  problem does not apply when the source is associated with a URL.</li>
-  <li>If you have a list of references included or imported stylesheets, put any with 
-  a relative path last; otherwise, stylesheets in the current directory are not found.</li>
-  <li>[1] should be treated equivalent to position()=1, but it is not. Therefore, if 
-  you get unexpected results using such shortcut positional predicates, substitute the 
-  full postion()= version.</li>
-  <li>XSLTC fails to match existing nodes when match expressions have 
-  multiple steps with predicates containing the position function.
-  The following examples are taken from the XSLTMark oddtemplates.xsl test:<br/><br/>
-  <code>&nbsp;&nbsp;&nbsp;&nbsp;match='top/*[position()=2]'</code><br/>
-  <code>&nbsp;&nbsp;&nbsp;&nbsp;match='top/*[6]/kid[2]'</code><br/>
-  <code>&nbsp;&nbsp;&nbsp;&nbsp;match='top/*[position()=last()]'</code><br/></li>
-  <li>XSTLC has problems with output escaping, see bug 1403.</li>
-  <li>Case-order option with sorting is ignored.</li>
-  <li>As a minor side-effect of implementing simplified stylesheets, if you inadvertenly 
-  go to compile a stylesheet and give the name of the .xml doc instead of the .xsl doc,
-  it may compile without a warning. In some cases, the compiler aborts with an error 
-  about too many branches.</li>
-</ul>
-</s3>
-<anchor name="xsltcdemos"/>
-<s3 title="Running Demos">
-<p>XSLTC provides demos for using XSLTC as a servlet and as a handler for 
-Brazil (a new and powerful Web techology from Sun labs). To run these demos,
-download Brazil from sunlabs:</p>
-<p><code>&nbsp;&nbsp;&nbsp;&nbsp;<jump href="http://research.sun.com/research/download/index.html">http://research.sun.com/research/download/index.html</jump></code></p>
-<p>and the java extensions for servlets from Sun:</p>
-<p><code>&nbsp;&nbsp;&nbsp;&nbsp;
-<jump href="http://java.sun.com/products/servlet/download.html">
-http://java.sun.com/products/servlet/download.html</jump>
-</code></p>
-<p>The translet must be specified as a pure class name, accessible
-through the Brazil handler's classpath. For example:</p>
-<p><code>&nbsp;&nbsp;&nbsp;&nbsp;translet=mk054</code></p>
-<p>The document must be specified as a valid URL. For example:</p>
-<p><code>&nbsp;&nbsp;&nbsp;&nbsp;document=http://server/path/to/filename.xml</code></p>
-<p>If the file is local to the Brazil handler, it has to be
-specified using the "file:filename.xml" format.</p>
-<note>You also need to make the Brazil and javax classes available from your classpath</note>
-<p>See also: <link idref="samples" anchor="translets">sample JAXP translets</link>.</p>
-</s3>
-
-<anchor name="xsltctrax"/>
-<s3 title="Translets and TrAX">
-<p>
-The Translet API has been extended to conform with the JAXP1.1 TrAX model.
-This release contains the first implementation of that extension. Two
-new classes have been added to the Translet XSLT codebase, they are:</p>
-<p>(1) <code>org.apache.xalan.xsltc.runtime.TransformerFactoryImpl</code> -<br/>
-&nbsp;&nbsp;&nbsp;&nbsp;the Translet implementation of a SAXTransformerFactory.</p>
-<p>(2) <code>org.apache.xalan.xsltc.runtime.TransletTemplates</code> -
-&nbsp;&nbsp;&nbsp;&nbsp;the Translet implementation of a Templates object.</p>
-<p>
-The existing XSLT class 'org.apache.xalan.xsltc.runtime.AbstractTranslet'
-that implements the Translet interface is now also extending the 
-javax.xml.transform.Transformer abstract class.
-</p>
-<p>
-This implementation is only a partial implementation, with many limitations.
-These limitations include:
-</p>
-<ol>
-<li>Currently  'StreamSource' and 'StreamResult' are the only
- TrAX Sources and Results that are supported.</li>
-<li>The translet is compiled everytime a call is made to the<br/>
-<code>TransformerFactoryImpl 'newTransformer()'</code> method.</li>
-<li>The translet is compiled everytime a call is made to the <br/>
-<code>TemplateFactoryImpl 'newTransformer()'</code> method.</li>
-<li>Translet are currently not cached. (See (2) and (3)).</li>
-<li>Several abstract methods from SAXTransformerFactory still need to
-be implemented in the xsltc.runtime.TransformerFactoryImpl class:<br/><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;TemplatesHandler newTemplatesHandler()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;TransformerHandler newTransformerHandler()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;TransformerHandler newTransformerHandler(Source src)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;TransformerHandler newTransformerHandler(Templates templates)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;XMLFilter newXMLFilter(Source src)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;XMLFilter newXMLFilter(Templates templates)</code></li>
-<li>Several abstract methods from Transformer still need to be implemented in the 
-AbstractTranslet class:<br/><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;ErrorListener getErrorListener()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setErrorListener(ErrorListener)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;Properties getOutputProperties()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;String getOutputProperty(String name)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setOutputProperties(Properties props)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setOutputProperty(String name, String value)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;URIResolver getURIResolver()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setURIResolver(URIResolver resolver)</code></li>
-<li>Abstract method from Templates still need to be implemented in the TransletTemplates class:<br/><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;Properties getOutputProperties()</code></li>
-<li>Several abstract methods from TransformerFactory still need to be implemented 
-in the <code>xsltc.runtime.TransformerFactoryImpl</code> class:<br/><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;ErrorListener getErrorListener()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setErrorListener(ErrorListener listener)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;Object getAttribute(String name)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setAttribute(String name, Object value)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;boolean getFeature(String name)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;URIResolver getURIResolver()</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;void setURIResolver(URIResolver resolver)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;Source getAssociatedStylesheet(Source src, String media, String title,</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String charset)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;Templates newTemplates(Source xslSrc)</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;Transformer newTransformer()</code></li>
-<li>Whenever possible, the required methods that are currently unimplemented will throw an 
-exception if someone tries to call them- this will alert the user that the method is not implemented. 
-The message is of the form:<br/><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&lt;Class Name&gt;:&lt;Method Name&gt;( &lt;args&gt; ) not implemented yet.&quot;</code>
-</li>
-</ol>
-</s3>
-<anchor name="xsltchistory"/>
-<s3 title="History of XSLTC software changes">
-<p>The following sections list XSLT changes back to the incorporation of XSLTC into &xslt4c;.</p>
-
-<s4 title="XSLTC source code updates for &xslt4j; 2.2.D9">
-<p>XSLTC source code updates:</p><ul><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java<br/><ref>Committer's log entry: </ref>Integrated fix for problem with count() function for certain iterators.
- PR: Bugzilla 1407
- Obtained from: n/a
- Submitted by: John Howard &lt;johnh@schemasoft.com&gt;
- Reviewed by: Morten Jorgensen &lt;morten@xml.apache.org&gt;<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/30/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc DOM.java
- java/src/org/apache/xalan/xsltc/compiler EqualityExpr.java
- FilterParentPath.java Parser.java Predicate.java
- Step.java SyntaxTreeNode.java Variable.java
- XSLTC.java
- java/src/org/apache/xalan/xsltc/dom DOMAdapter.java
- DOMImpl.java MultiDOM.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultSAXOutputHandler.java
- TextOutput.java
- java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Added code that will speed up predicates such as //foo[@attr=$var],
- //foo[bar = $var] and //foo/[@attr = 'str'].
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Expression.java
- Param.java ParameterRef.java Predicate.java
- Stylesheet.java SyntaxTreeNode.java Variable.java
- VariableRef.java WithParam.java<br/><ref>Committer's log entry: </ref>Fix for parameter and variable handling. This fix makes sure variable slots
- are released once a variable goes out of scope. I have also extracted common
- functionality from Variable and Param into VariableBase, and similarly
- extracted some functionality from VariableRef and ParameterRef into a new
- class VariableRefBase. This can potentially make some code more efficient as
- one can test for 'if (blob instanceof VariableBase)' instead of testing on
- both Variable and Param.
- PR: Bugzilla 2661 and 2699
- Obtained from: n/a
- Submitted by: John Howard &lt;JohnH@schemasoft.com&gt;
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/31/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/compiler VariableBase.java
- VariableRefBase.java<br/><ref>Committer's log entry: </ref>Forgot to add these two in my last putback.
- PR: none
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Predicate.java
- Step.java Stylesheet.java XSLTC.java<br/><ref>Committer's log entry: </ref>Removed type-cast error in Stylesheet.java
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler VariableBase.java
- java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java<br/><ref>Committer's log entry: </ref>Removed some of the linefeeds we output in the default SAX output handler
- to produce output more similar to Saxon (for testing purposes).
- Added a test for null-pointers in the new VariableBase class.
- PR: bugzilla 2922 &amp; 2598
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org`<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/31/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom NodeCounter.java<br/><ref>Committer's log entry: </ref>Added a small fix to prevent unwanted output when using the xsl:number
- element.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/01/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Constants.java
- If.java Key.java Predicate.java Step.java When.java
- java/src/org/apache/xalan/xsltc/compiler/util
- CompareGenerator.java
- java/src/org/apache/xalan/xsltc/dom NodeCounter.java
- java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java<br/><ref>Committer's log entry: </ref>A few changes to make our output look more like Saxon's (to simplyfy
- test diffs).
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/01/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax TransformerImpl.java
- DOM2SAX.java<br/><ref>Committer's log entry: </ref>add support for DOMResult handling<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/01/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/trax SAX2DOM.java<br/><ref>Committer's log entry: </ref>work in progress, converted needed for DOMResult<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax TransformerImpl.java<br/><ref>Committer's log entry: </ref>added setting of systemId in DOMSource handling<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax SAX2DOM.java
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerHandlerImpl.java<br/><ref>Committer's log entry: </ref>Added an implementation of the TransformerHandler interface of TrAX/JAXP.
- Implemented the 4 methods in TransformerFactory to instanciate this
- TransformerHandler implementation.
- Added an attribute of the TransformerFactory which contains the default
- name for generated translet classes (the default name is GregorSamsa from
- Kafka's Metemorphosis), but should be set by the user in cases where the
- Templates implementation cannot get the systemId from the Source object.<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java
- java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java
- TransformerHandlerImpl.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/trax
- TemplatesHandlerImpl.java<br/><ref>Committer's log entry: </ref>Added missing TemplatesHandlerImpl file (implementation of the TrAX
- TemplatesHandler interface).
- Added initial implementation of getAssociatedStylesheet() in
- the TransformerFactoryImpl class.
- Changed behaviour of TransformerHandlerImpl class with regard to
- the setResult() method. This method now has to be called before
- startDocument() is called, which gives XSLTC the same behaviour
- as Xalan.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/02/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java
- XSLTC.java
- java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Added support for the TransformerFactory's getAssociatedStylesheet()
- method. Added similar methods to the native XSLTC API, as they can come
- in handy.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Constants.java
- DocumentCall.java
- java/src/org/apache/xalan/xsltc/dom LoadDocument.java<br/><ref>Committer's log entry: </ref>Fix for the document() function. The code compiled by DocumentCall now
- passes the context URI to the LoadDocument.document() method, and the
- document() method resolves the base/new URIs and constructs an absolute
- path/URI to the document to load.
- PR: bugzilla 2832
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax DOM2SAX.java<br/><ref>Committer's log entry: </ref>new recursive parse(InputSource) implemented<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax DOM2SAX.java<br/><ref>Committer's log entry: </ref>upated<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax DOM2SAX.java<br/><ref>Committer's log entry: </ref>updated again<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java
- java/src/org/apache/xalan/xsltc/trax SAX2DOM.java<br/><ref>Committer's log entry: </ref>Fix to get around problem with Crimson. Crimson does not like attribute-
- nodes to be created with 'null' or "" namespace URI. Added an if-test to
- invoke setAttribute(name, value) instead of setAttributeNS(uri, name, value).
- Had to add a little test to DOMImpl$DOMBuilder.makeAttributeNode() to get
- around an internal NPE problem.
- PR: n/a
- Obtained from: n.a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/03/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler CopyOf.java
- Step.java
- java/src/org/apache/xalan/xsltc/dom DOMImpl.java
- UnionIterator.java<br/><ref>Committer's log entry: </ref>Fix for union-iterators wrapping one or more attribute-iterators.
- Attributes should be wrapped in TypedAttributeIterator objects and not
- SingletonIterator objects when they occur insude unions.
- Fix for copying attribute nodes using &lt;xsl:copy&gt; and &lt;xsl:copy-of&gt;
- PR: bugzilla 2603
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom LoadDocument.java<br/><ref>Committer's log entry: </ref>Added code behind the document() function to force the parser to be
- namespace aware (Crimson is pr. default, Xerces is not).
- PR: bugzilla 2862
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime TextOutput.java<br/><ref>Committer's log entry: </ref>Fix to prevent escaping of attribute values in HTML output.
- PR: bugzilla 3003
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime TextOutput.java<br/><ref>Committer's log entry: </ref>Fix for grouping a sequence of text nodes inside one CDATA section.
- PR: bugzilla 3005
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler ForEach.java
- xpath.cup
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java<br/><ref>Committer's log entry: </ref>Fix for passing node-sets as parameters into a template with a for-each loop.
- The ForEach class resets its node iterator by default. This behaviour is not
- desierd for iterators that are passed in through a parameter, so I added an
- it-test that checks if the iterator is of type 'Reference'.
- PR: bugzilla 2468
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler
- AbsolutePathPattern.java<br/><ref>Committer's log entry: </ref>Fix for a certain combination of absolute path patterns and ancestor patterns,
- such as &lt;xsl:template match="/foo//*"/&gt;.
- PR: bugzilla 2836
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler DocumentCall.java<br/><ref>Committer's log entry: </ref>Fix for document() function. Prevents run-time error.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XslElement.java<br/><ref>Committer's log entry: </ref>Added a test to the &lt;xsl:element&gt; element to verify that the element name
- given in the 'name' attribute contains something other than an empty string.
- PR: bugzilla 2794
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LiteralElement.java<br/><ref>Committer's log entry: </ref>Applied a fix to our class for handling literal result elements. The only
- attributes in the XSLT namespace we handle in LREs are exclude-result-prefixes
- and extension-element-prefixes. We have a test to check if an attribute is
- in the XSLT namespace, and if it is we ignore the attribute. This test was
- placed before the test for the two XSLT attributes we do want to handle,
- causing us to ignore all xsl:exclude-result-prefixes attributes in LREs.
- PR: bugzilla 1506
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Attribute.java
- AttributeSet.java Copy.java UseAttributeSets.java
- XslAttribute.java
- java/src/org/apache/xalan/xsltc/dom DOMImpl.java<br/><ref>Committer's log entry: </ref>Fix and performance improvement for attribute sets.
- PR: bugzilla 2536
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>08/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Copy.java<br/><ref>Committer's log entry: </ref>Fix for use of attribute sets with the xsl:copy element. We were a bit too
- restrictive in our tests to see if it was safe to send the attributes to
- the output handler. We only compiled in a test to see if the copied node
- was an elment, but should also have tested if the xsl:copy element's
- parent node was a LRE or a xsl:element element.
- PR: bugzilla 2538
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li></ul>
-</s4>
-<s4 title="XSLTC source code updates for &xslt4j; 2.2.D8">
-<p>XSLTC source code updates:</p><ul><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java
- java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>Added support for SAXSource and SAXResult in TransformerFactoryImpl
- and TransformerFactory. I had to add a new consturctor the the
- default SAX output handler (in the xsltc runtime library) to acommodate
- the SAXResult TrAX output handler.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java
- java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Added default error-reporting behaviour for our trax code (error messages
- are dumped to System.err).
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>in progress, adding DOMSource support<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>07/20/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/trax DOM2SAX.java<br/><ref>Committer's log entry: </ref>new class, DOM2SAX, supports DOMSources, in progress<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Import.java
- Include.java Stylesheet.java XSLTC.java
- java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/compiler SourceLoader.java<br/><ref>Committer's log entry: </ref>Added a SourceLoader interface to the compiler package. This interface can
- be used to plug in an external document loader for imported and/or
- included stylesheets. The trax.TransformerImpl class is updated to
- implement this interface and act as an adapter between the internal XSLTC
- SourceLoader interface and TrAX's URIResolver interface.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@apache.org
- Reviewed by: morten@apache.org<br/><br/></li><li><ref>Committed by </ref>amiro@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime Constants.java<br/><ref>Committer's log entry: </ref>Added the NAMESPACE_FEATURE constant. Checked to see if it was in
- org.xml.sax first, but it wasn't. Since this constant is used both
- at compile and runtime, it should be in the runtime Constants class
- as well as the compile Constants class. Runtime code needs to be
- kept separate from the compile time code.<br/><br/></li><li><ref>Committed by </ref>amiro@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime DefaultRun.java
- java/src/org/apache/xalan/xsltc/cmdline Transform.java
- java/src/org/apache/xalan/xsltc/dom DocumentCache.java<br/><ref>Committer's log entry: </ref>Added import for org.apache.xalan.xsltc.runtime.Constants;
- to the runtime classes that need to use the NAMESPACE_FEATURE constant
- and had them reference it rather than define it themselves.<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java<br/><ref>Committer's log entry: </ref>minor changes for DOMSource impl support<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Added DOMSource support for stylesheet<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>07/20/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax DOM2SAX.java<br/><ref>Committer's log entry: </ref>updated convertor which supports DOMSource impl<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java<br/><ref>Committer's log entry: </ref>Added a small fix to the compiler (XSLTC.java) to make sure that the SAX
- parser reference was not reset prior to compiling the translet.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>Added support for DOMSource as input to our Transformer implementation<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Import.java
- Sort.java
- java/src/org/apache/xalan/xsltc/dom NodeSortRecord.java
- NodeSortRecordFactory.java<br/><ref>Committer's log entry: </ref>For some reason I decided to optimise the &lt;xsl:sort&gt; functionaility. The
- sort records we used has some global values stored behind methods, but are
- now static fields. Somewhat faster.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Import.java
- Include.java<br/><ref>Committer's log entry: </ref>Fix for problem with import &amp; include introduced with the latest updated
- for TrAX URIResolvers.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java<br/><ref>Committer's log entry: </ref>Integrated fix for problem with count() function for certain iterators.
- PR: Bugzilla 1407
- Obtained from: n/a
- Submitted by: John Howard &lt;johnh@schemasoft.com&gt;
- Reviewed by: Morten Jorgensen &lt;morten@xml.apache.org&gt;<br/><br/></li></ul>
-</s4>
-<s4 title="XSLTC source code updates for &xslt4j; 2.2.D7">
-<ul><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/09/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Constants.java
- Param.java StepPattern.java Stylesheet.java
- SyntaxTreeNode.java Variable.java WithParam.java
- java/src/org/apache/xalan/xsltc/dom KeyIndex.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java BasisLibrary.java
- DefaultRun.java Parameter.java TextOutput.java<br/><ref>Committer's log entry: </ref>Loads of small fixes and a good few comments added to the source code.
- The major fixes are one fix for variable/parameter handlingi and one for
- key/id index handling. XSLTC now correctly updates the value of parameters
- with changing default values, such as with
- &lt;xsl:param name="foo" select="current()"/&gt;.
- Also updated bit-arrays to correctly return single node ids, so that the
- key() and id() functions return the correct number of nodes (they would
- sometimes skip the first node in the defined node set for the key/id).
- Added some structure and loads of comments to the Translet base class.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/10/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler
- AncestorPattern.java AttributeSet.java
- CallTemplate.java CastExpr.java EqualityExpr.java
- Expression.java FunctionCall.java If.java
- Import.java Include.java Mode.java NameBase.java
- Param.java ParameterRef.java Parser.java
- StepPattern.java SyntaxTreeNode.java Template.java
- TestSeq.java Variable.java VariableRef.java
- XSLTC.java XslAttribute.java
- java/src/org/apache/xalan/xsltc/compiler/util ErrorMsg.java
- ReferenceType.java
- java/src/org/apache/xalan/xsltc/dom MultiDOM.java
- StepIterator.java
- java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java<br/><ref>Committer's log entry: </ref>A wide range of fixes provided by Erwin Bolwidt.
- o) fix for long IF and GOTO instructions inside translets.
- 'wide' GOTOs are now used (GOTO_W) instead of plain GOTO
- to allow longer jump offsets
- o) fix for illegal field/method names in the translet.
- Methods and fields no longer contain the '.' or '-' characters
- o) source filenames (and if possible also line numbers) are now
- provided with error and warning messages
- o) external functions that are not supported by XSLTC do not cause
- compile errors. They will still cause a warning message at
- compile-time if they are not wrapped in proper &lt;xsl:if&gt; or
- &lt;xsl:when&gt; elements that test on the availability of the function,
- and will cause a runtime error if the function is attempted called.
- o) added type cast from reference-type to node-type
- o) some other smaller fixes to prevent null-pointer exceptions
- Other changes:
- o) code cleanup and some added comments
- PR: n/a
- Obtained from: n/a
- Submitted by: Erwin Bolwidt &lt;ejb@klomp.org&gt;
- Reviewed by: Morten Jorgensen &lt;morten@xml.apache.org&gt;<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java
- SyntaxTreeNode.java XSLTC.java<br/><ref>Committer's log entry: </ref>Cleaned up the XSLTC compiler class in an attempt to make it more flexible.
- This class was originally written as a command-line interface, but it has
- now grown huge and messy. I separated the command-line stuff from the
- methods that make up the actual functionality and made some methods public.
- This is part of the preparation for our new implementation of the JAXP
- Templates object.
- PR: n/a
- Obtained from: n.a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime DefaultRun.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/cmdline Compile.java
- Transform.java<br/><ref>Committer's log entry: </ref>Extracted the command-line stuff from the core XSLTC packages. The command-
- line handling is now in xalan.xsltc.cmdline.Compile and
- xalan.xsltc.cmdline.Transform. The command-line stuff is still left in
- xalan.xsltc.compiler.XSLTC and xalan.xsltc.runtime.DefaultRun for backwards
- compatability. This should be removed shortly.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/cmdline Compile.java
- java/src/org/apache/xalan/xsltc/compiler XSLTC.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/cmdline/getopt GetOpt.java
- GetOptsException.java IllegalArgumentException.java
- MissingOptArgException.java
- java/src/org/apache/xalan/xsltc/trax TemplatesImpl.java
- TransformerImpl.java<br/><ref>Removed: </ref>java/src/org/apache/xalan/xsltc/util/getopt GetOpt.java
- GetOptsException.java IllegalArgumentException.java
- MissingOptArgException.java<br/><ref>Committer's log entry: </ref>Moved the org.apache.xalan.xsltc.util.getopt package to
- org.apache.xalan.xsltc.cmdline.getopt. Also added some skeleton
- code in a new org.apache.xalan.xsltc.trax directory.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax TransletTemplates.java<br/><ref>Committer's log entry: </ref>minor adjustment
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>removed obselete try/catch<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java
- java/src/org/apache/xalan/xsltc/trax TemplatesImpl.java
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Removed: </ref>java/src/org/apache/xalan/xsltc/trax TransletTemplates.java<br/><ref>Committer's log entry: </ref>A first stab at our new TrAX design.`
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java
- java/src/org/apache/xalan/xsltc/trax TemplatesImpl.java
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>A few minor adjustments to yesterdays JAXP/TrAX implementation. These is one
- change in the way the compiler (XSLTC) generates bytecode arrays, and the
- rest is basically a cleanup of error reporting and a few added comments.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/16/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DocumentCache.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/trax OutputSettings.java<br/><ref>Committer's log entry: </ref>Reduced the refresh rate of the DocumentCache to 1 second.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>amiro@apache.org<ref> on </ref>07/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DocumentCache.java<br/><ref>Committer's log entry: </ref>Submitted by: Tom Amiro
- Fixes bug 1591. Changed the lastModified() method to return
- the correct timestamp for local files beginnig with the "file:"
- protocol. Incorporated Brian Ewin's suggestion to use URLdecode.
- Todd Miller and Morten Jorgensen<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java
- java/src/org/apache/xalan/xsltc/trax TemplatesImpl.java
- TransformerFactoryImpl.java TransformerImpl.java<br/><ref>Committer's log entry: </ref>Added some javadoc comments to our trax stuff. Added preliminary support
- for getting/setting output properties, and for getting/setting URL resolvers.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc TransletOutputHandler.java
- java/src/org/apache/xalan/xsltc/cmdline Transform.java
- java/src/org/apache/xalan/xsltc/compiler Output.java
- Stylesheet.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java DefaultRun.java
- DefaultSAXOutputHandler.java SAXAdapter.java
- StringValueHandler.java TextOutput.java
- TransletOutputBase.java<br/><ref>Committer's log entry: </ref>A series of changes to the XSLTC output handling to accomodate the
- set/getOutputSettings() methods in the TrAX API.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime TextOutput.java<br/><ref>Committer's log entry: </ref>Fixed the handling of the 'cdata-section-elements' attribute of the
- &lt;xsl:output&gt; element. Previously we output the whole element, including
- all contents, child elements and the start- and end-tags in one big
- CDATA section. We now correctly output only immediate text child-nodes
- as CDATA sections.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc Translet.java
- java/src/org/apache/xalan/xsltc/dom LoadDocument.java
- java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java
- java/src/org/apache/xalan/xsltc/trax TransformerImpl.java<br/><ref>Committer's log entry: </ref>Added implementation of get/setOutputProperties() of the Transformer
- implementation.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>07/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DocumentCache.java<br/><ref>Committer's log entry: </ref>Added (a rather brutal) handling of all Exceptions thrown in the
- DocumentCache.getLastModified() method. This class is provided only
- as an example/skeleton, but should still - for various reasons -
- be provided in the base 'xsltc.dom' package.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li></ul>
-</s4>
-<s4 title="XSLTC source code updates for the &xslt4j; 2.2.D releases up to and including 2.2.D6">
-<ul><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>05/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Text.java<br/><ref>Committer's log entry: </ref>bug fix 1403, output escaping fixed<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>05/23/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime TextOutput.java<br/><ref>Committer's log entry: </ref>bug fix 1403, output escaping fixed<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java<br/><ref>Committer's log entry: </ref>stylesheet compilation error listening added for
- TrAX support<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java<br/><ref>Committer's log entry: </ref>stylesheet compilation error listening added for
- TrAX support<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>stylesheet compilation error listening added for
- TrAX support<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>Transformer factory's setErrorListener() now throws
- IllegalArgumentException is listener is null<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>translet transformation errors now forwarded to
- TrAX error listener when applicable<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/05/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java<br/><ref>Committer's log entry: </ref>translet transformation errors now forwarded to
- TrAX error listener when applicable<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime AttributeList.java<br/><ref>Committer's log entry: </ref>Added a constructor for copying an org.xml.sax.Attributes to our
- org.apache.xalan.xsltc.runtime.AttributeList.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler ApplyImports.java
- ApplyTemplates.java Attribute.java
- AttributeSet.java AttributeValueTemplate.java
- BinOpExpr.java CallTemplate.java Comment.java
- ConcatCall.java Constants.java Copy.java
- CopyOf.java DecimalFormatting.java
- DocumentCall.java Expression.java Fallback.java
- ForEach.java FormatNumberCall.java
- FunctionAvailableCall.java FunctionCall.java
- If.java Import.java Include.java Key.java
- LiteralAttribute.java LiteralElement.java
- LiteralExpr.java LogicalExpr.java Message.java
- NamespaceAlias.java Number.java Output.java
- Param.java Parser.java ProcessingInstruction.java
- QName.java RelationalExpr.java Sort.java
- Stylesheet.java SymbolTable.java
- SyntaxTreeNode.java Template.java Text.java
- TransletOutput.java UnaryOpExpr.java ValueOf.java
- Variable.java When.java Whitespace.java
- WithParam.java XSLTC.java XslAttribute.java
- XslElement.java xpath.cup
- java/src/org/apache/xalan/xsltc/compiler/util
- MethodType.java<br/><ref>Committer's log entry: </ref>Removed the intermediate DOM used to contain the input document (the
- stylesheet) for the compiler. The compiler now uses SAX2 to import
- the stylesheet, and all references to DOM interfaces have been removed.
- This means that most classes representing XSL elements have been
- changed, but most classes representing XPath functions, expressions
- and patterns are unchanged.
- PR: After suggestion from Scott Boag
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/compiler
- UnsupportedElement.java<br/><ref>Committer's log entry: </ref>Adding a class for handling unsupported stylesheet elements
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java<br/><ref>Committer's log entry: </ref>Minor fix to make sure that attributes are processed in the correct order.
- PR: n/a
- Obtained from: n.a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java<br/><ref>Committer's log entry: </ref>Minor change in output indentation/line feeds.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xmp.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler
- LocationPathPattern.java Parser.java Template.java<br/><ref>Committer's log entry: </ref>Fixed the code that resolves conflicts between templates with identical
- patterns. The order of the templates is not taken into account - after
- import precedence and priority has been checked.
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- DefaultSAXOutputHandler.java<br/><ref>Committer's log entry: </ref>Reverted changes to SAX output handler.
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/06/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java
- Template.java xpath.cup<br/><ref>Committer's log entry: </ref>unified Parser error reporting to use Mortens
- reportError routine<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/07/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler BinOpExpr.java
- FunctionCall.java Otherwise.java Param.java
- RelationalExpr.java Stylesheet.java
- SyntaxTreeNode.java Variable.java When.java
- XSLTC.java XslElement.java<br/><ref>Committer's log entry: </ref>Updated a few classes that were still calling Parser.addError(),
- Parser.addWarning() and Parser.addFatalError() to use the new common
- error handler Prarser.reportError(int category, ErrorMsg message).
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Parser.java
- java/src/org/apache/xalan/xsltc/runtime DefaultRun.java<br/><ref>Committer's log entry: </ref>Added two lines of code to explicitly set the feature
- "http://xml.org/sax/features/namespaces" of the SAXParser to "true".
- The default is "true" but xerces seems to set it to "false", and this
- caused some problems for our Stylesheet and XML doc parsers (which are
- both using SAX2).
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Constants.java
- Parser.java
- java/src/org/apache/xalan/xsltc/runtime DefaultRun.java<br/><ref>Committer's log entry: </ref>A few more changes to make sure the parsers used are namespace aware.
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/08/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LiteralElement.java
- SyntaxTreeNode.java XslAttribute.java
- XslElement.java<br/><ref>Committer's log entry: </ref>The change from using DOM to using SAX in the stylesheet input caused some
- of the elements in the Abstract Syntax Tree (AST) to be out of order. I
- added a few lines of code to the xsl:element/attribute handling code to
- fix this.
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler AttributeSet.java
- Choose.java Constants.java If.java
- LiteralElement.java Stylesheet.java
- UseAttributeSets.java When.java XSLTC.java
- XslAttribute.java<br/><ref>Committer's log entry: </ref>This putback contains three fixes:
- o) fix for complex &lt;xsl:attribute-set&gt; inheritance structures
- o) fix for xsl:element-available() function used in &lt;xsl:when&gt; or
- &lt;xsl:if&gt; to test support for various extension elements
- o) fix for preserving namespace prefixes for &lt;xsl:attribute&gt; output.
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Constants.java
- UseAttributeSets.java ValueOf.java
- XslAttribute.java
- java/src/org/apache/xalan/xsltc/compiler/util
- AttributeSetMethodGenerator.java<br/><ref>Committer's log entry: </ref>Fix to allow iterator access within attribute sets. This is necessary for
- attribute sets that contain attributes whose values are generated by XSL
- functions such as position() and last().
- Obtained from: test mk013
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime TextOutput.java<br/><ref>Committer's log entry: </ref>Added output character escaping for non-breaking space characters.
- I cannot believe we've waited this long before doing this. Madness!
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java
- Parser.java<br/><ref>Committer's log entry: </ref>support for java.io.InputStream StreamSources<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/11/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransletTemplates.java<br/><ref>Committer's log entry: </ref>support for java.io.InputStream StreamSources<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LogicalExpr.java<br/><ref>Committer's log entry: </ref>Fix for bug 1511. Predicates on the format ((a or b) and c) are not
- handled correctly. I added a small piece of code to direct the true-list
- of the OR expression to the beginning of the AND test.
- PR: Bugzilla 1511
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
- TextOutput.java<br/><ref>Committer's log entry: </ref>Fix attribute node-set comparisons. There was a bug in one of the compare()
- methods of the BasisLibrary class which prevented attribute values from
- being compared. The method compared node IDs instead of node values.
- Pretty stupid bug, but now it is solved anyway.
- PR: Bugzilla 1409
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Mode.java<br/><ref>Committer's log entry: </ref>Fix to make sure that the implicit "text()" pattern is run when templates
- containing "text()" in their pattern fail. XSLTC would not previously
- invoke the built-in pattern for "text()" if a stylesheet contained a
- template such as &lt;xsl:template pattern="foo/bar/text()" .../&gt;
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XslElement.java<br/><ref>Committer's log entry: </ref>Modified test for legal element names in &lt;xsl:element&gt;. The element name is
- treated as an attribute value. Whitespaces are not allowed in plain text
- element names, but should be allowed inside "{...}" attribute values.
- PR: Bugzilla 1489
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java<br/><ref>Committer's log entry: </ref>A fix for the preceding:: iterator
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom DOMImpl.java<br/><ref>Committer's log entry: </ref>Minor re-adjustment to last fix for preceding:: iterator
- PR: 1407
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler ForEach.java
- XSLTC.java<br/><ref>Committer's log entry: </ref>Fix to prevent compiler warnings to be output more than once.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler AttributeSet.java<br/><ref>Committer's log entry: </ref>Final fix (for now) for attribute sets. In cases where multiple
- &lt;xsl:attribute-set.../&gt; elements make up one attribute set (ie. they share
- the same name) attributes that occured last in the stylesheet will take
- precedence.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/12/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>added support for java.io.InputStream StreamSources<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LogicalExpr.java<br/><ref>Committer's log entry: </ref>Fix for code handling logical expressions and combinations of logical
- expressions. Mindblowing stuff, but it now seems to work as it should.
- Added another few lines of code to properly direct the program flow in
- compiled predicates with various combinations of "and" and "or" expressions.
- PR: Bugzilla 1511
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/13/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/dom SingletonIterator.java<br/><ref>Committer's log entry: </ref>Fix for singleton iterators encapsulating variable references.
- PR: Bugzilla 1412
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/14/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LiteralElement.java<br/><ref>Committer's log entry: </ref>Added one-line fix to prevent null-pointer error. Simple code cleanup.
- PR: n/a
- Obtained from: suggestion by Guoliang Cao &lt;cao@ispsoft.com&gt;
- Submitted by: cao@ispsoft.com
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/15/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler LogicalExpr.java<br/><ref>Committer's log entry: </ref>Fix to prevent compile-time null-pointer exceptions for certain logical
- expressions. Some nexted AND-expressions would cause this error because
- their true-list would not be backpatched. This would result in an
- instruction list with one or more branch instructions with no target,
- such as a GOTO(null) or an IFEQ(null) instruction.
- PR: none, bug found in test run and fixed immediately
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>curcuru@apache.org<ref> on </ref>06/17/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler
- AbsoluteLocationPath.java ApplyImports.java
- ApplyTemplates.java CastExpr.java CopyOf.java
- DocumentCall.java EqualityExpr.java Expression.java
- FilterExpr.java FilterParentPath.java ForEach.java
- FunctionCall.java IdKeyPattern.java Key.java
- KeyCall.java NameBase.java ParentLocationPath.java
- Parser.java Predicate.java RelationalExpr.java
- Step.java UnionPathExpr.java
- java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetType.java NodeType.java ReferenceType.java
- ResultTreeType.java Type.java
- java/src/org/apache/xalan/xsltc/dom UnionIterator.java
- java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java<br/><ref>Committer's log entry: </ref>OK, I'm going to make a wild guess and assume that sboag's recent commit
- of /NodeSet/NodeSetDTM/ got a little out of control and shouldn't have
- gone down into org.apache.xalan.xsltc - undone to fix compile error<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/18/2001<br/><ref>Removed: </ref>java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetType.java<br/><ref>Committer's log entry: </ref>Removing NodeSetType (renamed to NodeSetDTMType).
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler/util Type.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetDTMType.java<br/><ref>Committer's log entry: </ref>
-<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/18/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler/util Type.java<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetType.java<br/><ref>Removed: </ref>java/src/org/apache/xalan/xsltc/compiler/util
- NodeSetDTMType.java<br/><ref>Committer's log entry: </ref>
-
-
-<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/19/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler ContainsCall.java
- FunctionCall.java If.java LogicalExpr.java
- Param.java QName.java StartsWithCall.java
- SymbolTable.java SyntaxTreeNode.java Template.java
- Variable.java xpath.cup
- java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java<br/><ref>Committer's log entry: </ref>Fix for function calls used as clauses in logical expressions.
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>Tom.Amiro@Sun.COM<ref> on </ref>06/19/2001<br/><ref>Committer's log entry: </ref>
-&gt; Fix for function calls used as clauses in logical expressions.
-&gt; Submitted by: morten@xml.apache.org
-&gt; Reviewed by: morten@xml.apache.org
-&gt;
-&gt;<br/><br/></li><li><ref>Committed by </ref>Morten.Jorgensen@sun.com<ref> on </ref>06/19/2001<br/><ref>Committer's log entry: </ref>
-&gt; &gt; Fix for function calls used as clauses in logical expressions.
-&gt; &gt; Submitted by: morten@xml.apache.org
-&gt; &gt; Reviewed by: morten@xml.apache.org
-&gt; &gt;
-&gt; &gt;<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/25/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>added check to see if stylesheet is already an URL<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/25/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransletTemplates.java<br/><ref>Committer's log entry: </ref>added check to see if stylesheet is already an URL<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/25/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/runtime TrAXFilter.java<br/><ref>Committer's log entry: </ref>proto<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/25/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>removed debug statements<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/26/2001<br/><ref>Removed: </ref>java/src/org/apache/xalan/xsltc/runtime TrAXFilter.java
- TransformerFactoryImpl.java TransletTemplates.java<br/><ref>Committer's log entry: </ref>in process of moving these to new subdir<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/26/2001<br/><ref>Added: </ref>java/src/org/apache/xalan/xsltc/trax TrAXFilter.java
- TransformerFactoryImpl.java TransletTemplates.java<br/><ref>Committer's log entry: </ref>moved from runtime subdir to its own trax subdir<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>fixed bug with deriving translet name from
- stylesheet name that included paths, e.g. /tmp/foo.xsl<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Predicate.java<br/><ref>Committer's log entry: </ref>This update allows variables that contain references to result-tree fragments
- to be used inside position filters.
- PR: n/a
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/runtime
- AbstractTranslet.java<br/><ref>Committer's log entry: </ref>added url handling in doTransform<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax
- TransformerFactoryImpl.java<br/><ref>Committer's log entry: </ref>added a new sys property called 'transletPool'
- to allow user to set the destination directory for generated translets<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/trax TransletTemplates.java<br/><ref>Committer's log entry: </ref>added a new sys property called 'transletPool'
- to allow user to set the destination directory for generated translets<br/><br/></li><li><ref>Committed by </ref>tmiller@apache.org<ref> on </ref>06/27/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler XSLTC.java<br/><ref>Committer's log entry: </ref>made private method setDestDirectory() public to
- support the new transletPool system property.<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/28/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Predicate.java
- Step.java Stylesheet.java VariableRef.java
- java/src/org/apache/xalan/xsltc/compiler/util
- MethodGenerator.java NodeSortRecordGenerator.java
- ResultTreeType.java TestGenerator.java<br/><ref>Committer's log entry: </ref>Various bugfixes in the way auxiliary classes access variables/fields in
- the main translet class. Fixes a few VAR tests and customer tests.
- Pmorten@xml.apache.org:<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/29/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler Choose.java
- ElementAvailableCall.java
- FunctionAvailableCall.java Parser.java When.java<br/><ref>Committer's log entry: </ref>Fix for element-available() and function-available() calls. Ties these
- calls to tables in the XSL parser and the symbol-table (the actual
- implementation) instead of using redundant and not-up-to-date tables
- in the classes that implement the X-avaiable() calls.
- I also cleaned up the Choose call so that it now properly handles
- all types of function calls in the xsl:when elements' test clause.<br/><br/></li><li><ref>Committed by </ref>morten@apache.org<ref> on </ref>06/29/2001<br/><ref>Modified: </ref>java/src/org/apache/xalan/xsltc/compiler ForEach.java
- Param.java Variable.java
- java/src/org/apache/xalan/xsltc/compiler/util
- MethodGenerator.java<br/><ref>Committer's log entry: </ref>Added a fix for local variables inside nested xsl:for-each elements.
- Local variables are usually not initialized to any default value (such as
- with general Java classes), because code compiled for &lt;xsl:variable&gt;
- elements always assign values to variable slots before they are accessed.
- But the code structure generated by nested &lt;xsl:for-each&gt; elements is too
- much for the JVMs verifier to get around, so we have to initialize all
- local variables inside such loops to zero, false, null, whatever.
- This takes care some of our runtime-errors caused by apparent corrupt code.
- (The JVMs verifier thinks that it is corrupt, but it isn't really.)
- PR: none
- Obtained from: n/a
- Submitted by: morten@xml.apache.org
- Reviewed by: morten@xml.apache.org<br/><br/></li></ul>
- </s4>
- <s4 title="XSLTC Changes for &xslt4j; 2.1.0">
-<p>The Sun XSLTC team (david.hofert@east.sun.com, tom.amiro@east.sun.com, todd.miller@east.sun.com, 
-morten.jorgensen@Ireland.sun.com) has checked <link idref="xsltc_usage">XSLTC</link> into the Xalan
-source tree, and we have begun the process of merging XSLTC into Xalan. XSLTC provides a compiler for compiling
-stylesheets into translets, and a streamlined runtime environment for using translets to transform XML input. 
-In the near term, XSLTC will appear in a separate JAR file (xsltc.jar) with its own API and command-line
-utilities. You can already use the same JAXP interfaces to perform
-transformations with the Xalan transformer and with translets. Over time, we plan to merge the two codebases.
-<ref>See <jump href="xsltc/index.html">XSLTC Design Documents</jump>.</ref></p>
-<p>Since this is the first release of XSLTC on Apache (xml.apache.org), changes are  
-relative to Preview 5 of XSLTC posted on www.sun.com/xml/developers.</p>
-<ul>
-  <li>Simplified stylesheets are now implemented.</li>
-  <li>Base package name has changed from <code>com.sun.xslt</code> to <code>org.apache.xalan.xsltc</code></li>
-  <li>You no longer have to get the BCEL.jar file; it is included in the distribution.</li>
-  <li>The Project X parser components and APIs have all been replaced with JAXP equivalents. 
-  Consequently, you may deploy XSLTC with JAXP-conformant parsers, such as Xerces or Crimson.</li>
-  <li>Previously undocumented feature: -x. You can use the -x option on the java command line when you
-  compile translets or run them to get more detailed information on errors.</li>
-  <li>Addition of -s to DefaultRun - a new -s option has been added to the DefaultRun class 
-  for use with test auotmation. When you use the option, it prevents System.exit() from being called when 
-  and exception is encountered.</li>
-</ul>
-</s4> 
-</s3>
-</s2>
\ No newline at end of file
diff --git a/xdocs/sources/xalan/xsltc_usage.xml b/xdocs/sources/xalan/xsltc_usage.xml
deleted file mode 100644
index 2200ba2..0000000
--- a/xdocs/sources/xalan/xsltc_usage.xml
+++ /dev/null
@@ -1,655 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="Using XSLTC">
-
-<ul>
-<li><link anchor="intro">Introduction</link></li>
-  <li><link anchor="classpath">Setting the system classpath for XSLTC</link></li>
-  <li><link anchor="compile">Compiling translets from the command line</link></li>
-  <li><link anchor="run">Running translets from the command line</link></li>
-  <li><link anchor="api">Calling XSLTC with the TrAX/JAXP API</link></li>
-  <li><link anchor="native_api">Calling XSLTC with the native API</link></li>
-  <li><link anchor="constraints">XSLTC usage constraints</link></li>  
-</ul>
-<p>See also: <jump href="xsltc/index.html">XSLTC Design</jump></p>
-<anchor name="intro"/>
-<s2 title="Introduction">
-<p>XSLT provides a compiler and a runtime processor. Use the compiler to compile an XSL stylesheet into a translet, a set of Java classes. Use the runtime processor to apply the translet to an XML document and perform a transformation.</p>
-<note>To compile translets, you must be running the JDK or JRE 1.2 or higher. You can run translets with the JDK or JRE 1.1.8 or higher.</note>
-</s2><anchor name="classpath"/>
-<s2 title="Setting the system classpath for XSLTC">
-<p>To compile translets, run translets, and use the XSLTC API, put the following on the system classpath:</p>
-<table>
-<tr>
-  <th>Classes or JAR</th>
-  <th>To compile a translet</th>
-  <th>To run a translet</th>
-  <th>To use the XSLTC API</th>
-</tr>
-<tr>
-  <td>the translet</td>
-  <td></td>
-  <td>required</td>
-  <td>required</td>  
-</tr>
-<tr>
-  <td>xsltc.jar</td>
-  <td>required</td>
-  <td>required</td>
-  <td>required</td>  
-</tr>
-<!-- TWA - xml.jar has old project x stuff; was able to compile and run without it -->
-<!--
-<tr>
-  <td>xml.jar</td>
-  <td>required</td>
-  <td>required</td>
-  <td>required</td>  
-</tr>
--->
-<tr>
-  <td>runtime.jar</td>
-  <td>required</td>
-  <td></td>
-  <td>required</td>  
-</tr>
-<tr>
-  <td>BCEL.jar</td>
-  <td>required</td>
-  <td></td>
-  <td>required</td>  
-</tr>
-<tr>
-  <td>Jlex.jar</td>
-  <td></td>
-  <td></td>
-  <td>required</td>  
-</tr>
-<tr>
-  <td>java_cup.jar</td>
-  <td></td>
-  <td></td>
-  <td>required</td>  
-</tr>
-</table>
-<p>The JAR files listed above are in the &xslt4j; bin directory. The translet is the set of class files or the JAR file that you generate with the compiler; see <link anchor="compile">Compiling translets</link>.</p>
-<p>If you are using JDK or JRE 1.1.8, also include classes.zip on the classpath. If you are using JDK or JRE 1.2, include tools.jar on the classpath.</p>
-<note>For the time being, the Xalan processor and XSLT do not yet use the same DOM, SAX, and parser infastructures. Accordingly, you may find it necessary to reset the system classpath each time you switch between the Xalan processor and XSLTC. For information on setting the classpath for the Xalan processor, see <link idref="getstarted" anchor="classpath">Setting the system classpath for Xalan</link>.</note>
-</s2>
-<anchor name="compile"/>
-<s2 title="Compiling translets from the command line">
-    <ul>
-      <li><link anchor="comp-synopsis">Synopis</link></li>
-      <li><link anchor="comp-args">Flags and arguments</link></li>
-      <li><link anchor="comp-examples">Examples</link></li>
-    </ul>
-	<p>The XSLT Compiler is a Java-based tool for compiling XSLT
-	stylesheets into lightweight and portable Java byte codes 
-	called translets.</p>  
-
-	<p>The XSLT Compiler can be run on any platform including UNIX,
-	Windows, NT, or Mac that supports Java 1.2.x or later. The generated
-	translets can be run on any platform that supports a Java
-	Runtime Environment, including a Palm Pilot with J2ME CLDC 
-	(Java 2 Micro Edition, Connected Limited Device Configuration).</p>
-    
-    <p>To run the compiler from the command line or a script, <link anchor="classpath">set the classpath</link> and 
-    run the XSLTC class with the appropriate flags and arguments (described below).</p>
-    <anchor name="comp-synopsis"/>
-<s3 title="Synopsis">
-<p>
-<code>java org.apache.xalan.xsltc.compiler.XSLTC</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;[-o &lt;output&gt;] [-d &lt;directory&gt;] [-j &lt;jarfile&gt;]</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;[-p &lt;package name&gt;] [-u] &lt;stylesheet&gt;...</code></p> 
-
-</s3><anchor name="comp-args"/>
-<s3 title="Flags and arguments">
-	<p>The following flags and arguments are supported:</p>
-
-<source>-o &lt;output&gt;
-   Specifies the name of the generated translet class.
-   If you omit this argument, the translet class is
-   named &lt;stylesheet&gt;. Translets are written as 
-   .class files.
-
--d &lt;directory&gt;
-   Specifies the destination directory. If you omit
-   this argument, the translet class files are placed
-   in the current working directory.
-
--j &lt;jarfile&gt;
-   Outputs the generated translet class files into a 
-   jar file named &lt;jarfile&gt;.jar. When this option is 
-   used, only the jar file is output.
-
--p &lt;package name&gt;
-   Specifies a package name for the generated translet
-   classes.		
-
--u  &lt;stylesheet&gt;
-  Specifies the stylesheet with a URI such as 
-  'http://myserver/stylesheet1.xsl'.
-
-   &lt;stylesheet&gt;
-   (No flag) The pathname of the stylesheet file.</source>
-
-</s3><anchor name="comp-examples"/>
-<s3 title="Examples">
-	<p>The following examples assume that you have already set the classpath to include the translet and the required JAR
-    files (see <link anchor="classpath">setting the system classpath</link>).</p>
-
-	<p><em>Example 1:</em>  Creating a translet from the hamlet.xsl stylesheet.</p>
-	<p><code>java org.apache.xalan.xsltc.compiler.XSLTC</code><br/>
-    <code>&nbsp;&nbsp;&nbsp;&nbsp; hamlet.xsl</code></p>    
-    <p>Example 1 produces a set of class files such as hamlet.class, hamlet$0.class, hamlet$1.class.</p>	
-
-	<p><em>Example 2:</em>  Outputting to a JAR file.</p>
-    <p><code>java org.apache.xalan.xsltc.compiler.XSLTC</code><br/>
-    <code>&nbsp;&nbsp;&nbsp;&nbsp; -j hamlet.jar hamlet.xsl</code></p>
-    <p>Example 2 produces hamlet.jar, which contains the translet class files.</p>	
-
-	<p><em>Example 3:</em> Specifying the translet class name. </p> 
-	<p><code>java org.apache.xalan.xsltc.compiler.XSLTC</code><br/>
-    <code>&nbsp;&nbsp;&nbsp;&nbsp; -o newhamlet hamlet.xsl</code></p>
-    <p>Example 3 producs a set of class files such as newhamlet.class, newhamlet$0.class, etc., rather than hamlet.class,
-    hamles$0.class, etc.</p>
-
-
-	<p><em>Example 4:</em> Compiling multiple stylesheets.</p>
-	<p><code>java org.apache.xalan.xsltc.compiler.XSLTC</code><br/>
-    <code>&nbsp;&nbsp;&nbsp;&nbsp; hamlet1.xsl hamlet2.xsl hamlet3.xsl</code></p>
-    <p>Example 4 produces three translets and set of class files derived from the three stylesheets.</p>
-
-	<p><em>Example 5:</em> Package Specification.</p>
-	<p><code>java org.apache.xalan.xsltc.compiler.XSLTC</code><br/>
-    <code>&nbsp;&nbsp;&nbsp;&nbsp; -p com.mycompany.translets hamlet.xsl</code></p>
-    <p>Example 5 produces a set of class files such as com/mycompany/translets/hamlet.class,
-	com/mycompany/translets/hamlet$0.class', etc.</p>
-</s3>
-</s2><anchor name="run"/>
-<s2 title="Running translets from the command line">
-    <ul>
-      <li><link anchor="run-synopsis">Synopis</link></li>
-      <li><link anchor="run-args">Flags and arguments</link></li>
-      <li><link anchor="run-examples">Examples</link></li>
-    </ul>
-
-    <p>The Sun XSLT runtime processor is a Java-based tool for 
-	transforming XML document files using a translet (compiled 
-	stylesheet). </p>
-
-	<p>The XSLT processor can be run on any platform including UNIX,
-	Windows, NT, Mac that supports Java, including a Palm Pilot
-	with J2ME CLDC (Java 2 Micro Edition, Connected Limited Device
-	Configuration).</p>
-    
-    <p>To run  translet from the command line or a script, <link anchor="classpath">set the classpath</link> (be sure to include
-     the translet) and run the translset with the appropriate flags and arguments (described below).</p>
-<anchor name="run-synopsis"/>
-<s3 title="Synopsis">
-<p><code>java &lt;translet&gt;</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp; {-u &lt;document_url&gt; | &lt;document&gt;} &lt;class&gt;</code><br/>
-<code>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;name1&gt;=&lt;value1&gt; ...]</code></p>
-
-</s3><anchor name="run-args"/>
-<s3 title="Flags and arguments">
-
-	<p>The following flags and arguments are supported:</p>
-
-<source>-u
-   Specifies the XML input &lt;document&gt; with a URI,
-   such as 'http://myserver/hamlet.xml'.		
-
-Arguments wirhout flags:
-
-   &lt;document&gt;     		
-   Filename of the XML input document. 
-   
-   &lt;document_url&gt;     	
-   URI of the XML input document (see the -u flag above). 
-
-   &lt;class&gt;
-   The translet that performs the transformation. The translet
-   may take a set of stylesheet parameters specified as
-   name-value pairs. The format for a name-value pair is
-   &lt;name&gt;=&lt;value&gt;.</source>
-</s3><anchor name="run-examples"/>
-<s3 title="Examples">
-
-	<p>The following examples assume that you have already set the classpath to include the translet and the required JAR
-    files (see <link anchor="classpath">setting the system classpath</link>).</p>
-    <p>A possible variation: You have set the classpath to include the required JAR files, but when you run the translet,
-    you use the java -cp flag to add the current working directory (containing the translet class files you have just generated)
-    to the classpath.</p>
-    <p><ref>Windows:</ref><code> java -cp .;%CLASSPATH% ...</code><br/>
-       <ref>UNIX:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ref><code> java -cp .:$CLASSPATH ...</code></p>
-    
-    <p><em>Example 1:</em> Processing an XML document.</p>
-
-	<p><code>java org.apache.xalan.xsltc.runtime.DefaultRun</code><br/>
-       <code>&nbsp;&nbsp;&nbsp;&nbsp;  hamlet.xml hamlet</code></p> 
-
-	<p>Example 1 uses the specified translet (hamlet) to transform the specified XML input document (hamlet.xml). 
-    The XML input document is in the current working directory. The translet was created by using
-    org.apache.xalan.xslt.compiler.XSLTC to compile an XSL stylesheet (hamlet.xsl). </p>
-
-	<p><em>Example 2:</em> Passing stylesheet parameters to the translet.</p>
-
-	<p><code>java org.apache.xalan.xsltc.runtime.DefaultRun</code><br/>
-       <code>&nbsp;&nbsp;&nbsp;&nbsp; hamlet.xml hamlet</code><br/>
-       <code>&nbsp;&nbsp;&nbsp;&nbsp; speaker=HAMLET 'scene=SCENE IV'</code></p>
-
-	<p>Example 2 passes "HAMLET" to the stylesheet for the stylesheet parameter named speaker, and "SCENE IV" for the
-    stylesheet parameter named scene. The second name-value pair was placed in single quotes to 
-    specify a value containing a space.</p>
-    
-    <p><em>Example 3:</em> Processing an XML input document specified with a URI.</p>
-
-	<p><code>java org.apache.xalan.xsltc.runtime.DefaultRun</code><br/>
-       <code>&nbsp;&nbsp;&nbsp;&nbsp;  -u http://zarya.east/test.xml hamlet</code></p>
-
-	<p>Example 3 applies the translet (hamlet) to the XML input document (http://zarya.east/test.xml hamlet). Inclusion of
-    the flag (-u) is optional.</p>
-</s3>
-</s2><anchor name="api"/>
-<s2 title="Calling XSLTC with the TrAX/JAXP API">
-<p>G. Todd Miller has begun integrating the translet with the TrAX/JAXP 1.1 API. See <jump href="xsltc/xsltc_trax.html">The Translet API &amp; TrAX</jump>. Accordingly, it is now possible to set a system property and use a TransformerFactory to generate a Transformer that performs a transformation by compiling and running a translet.</p>
-
-
-<p>When you use the JAXP 1.1 API to run &xslt4j;, the <code>javax.xml.transformer.TransformerFactory</code> system property is set to <code>org.apache.xalan.processor.TransformerFactoryImpl</code>. As it currently stands, this Xalan implementation of TransformerFactory always uses the Xalan Transformer to perform transformations. To use translets to perform transformations, set this system property to <code>org.apache.xalan.xsltc.runtime.TransformerFactoryImpl</code>. For information on setting this and related system properties designating XML parsere and XSL transformer, see <link idref="usagepatterns" anchor="plug">Plugging in a Transformer and XML parser</link>.</p>
-<p>To Use the JAXP 1.1 API to perform transformations with translets do the following:</p>
-<ol>
-  <li>Set the <code>javax.xml.transformer.TransformerFactory</code> system property as indicated above.<br/><br/></li>
-  <li>Instantiate a TransformerFactory.<br/><br/></li>
-  <li>Assuming you want to perform a series of transformations with the same translet, use the TransformerFactory and a
-   StreamSource XSL stylesheet to generate a Templates object (the translet). If you are performing a single
-   transformation, use the TransformerFactory and the StreamSource object to instantiate a Transformer.<br/><br/></li>
-  <li>Perform the transformation, using a StreamSource object for the XML input and a StreamResult object to hold the
-   transformation output.</li>
-</ol>
-<s3 title="Examples">
-<p><em>Example 1:</em> Using a translet/Templates object for multiple transformations</p>
-<source>import java.util.Properties;
-import javax.xml.transform.Transformer;
-import java.io.FileOutputStream;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Templates;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-...
-// Set the TransformerFactory system property.
-// Note: For more flexibility, load properties from a properties file.
-String key = "javax.xml.transform.TransformerFactory";
-String value = "org.apache.xalan.xsltc.runtime.TransformerFactoryImpl";
-Properties props = System.getProperties();
-props.put(key, value);
-System.setProperties(props);
-...
-String xslInURI;
-// Instantiate the TransformerFactory, and use it along with a SteamSource
-// XSL stylesheet to create a translet as a Templates object.
-TransformerFactory tFactory = TransformerFactory.newInstance();
-Templates translet = tFactory.newTemplates(new StreamSource(xslInURI));
-...
-String xmlInURI;
-String htmlOutURI;
-...
-// For each transformation, instantiate a new Transformer, and perform
-// the transformation from a StreamSource to a StreamResult;
-Transformer transformer = translet.newTransformer();
-transformer.transform(new StreamSource(xmlInURI),
-                      new StreamResult(new FileOutputStream(htmlOutURI)));
-...</source>
-<p>For a working sample that illustrates this usage pattern, see <link idref="samples" anchor="xsltc1">JAXPTransletOneTransformation</link>.</p>
-<p><em>Example 2:</em> Compiling a translet/Templates object for a single transformation</p>
-<source>import java.util.Properties;
-import javax.xml.transform.TransformerFactory;
-import java.io.FileOutputStream;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-...
-// Set the TransformerFactory system property.
-// Note: For more flexibility, load properties from a properties file.
-String key = "javax.xml.transform.TransformerFactory";
-String value = "org.apache.xalan.xsltc.runtime.TransformerFactoryImpl";
-Properties props = System.getProperties();
-props.put(key, value);
-System.setProperties(props);
-...
-String xslInURI;
-String xmlInURI;
-String htmlOutURI;
-// Instantiate the TransformerFactory, and use it along with a SteamSource
-// XSL stylesheet to create a Transformer.
-TransformerFactory tFactory = TransformerFactory.newInstance();
-Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
-// Perform the transformation from a StreamSource to a StreamResult;
-transformer.transform(new StreamSource(xmlInURI),
-                      new StreamResult(new FileOutputStream(htmlOutURI)));</source>
-<p>For a working sample that illustrates this usage pattern, see <link idref="samples" anchor="xsltc2">JAXPTransletMultipleTransformations</link>.</p>
-</s3>
-</s2><anchor name="native_api"/>
-<s2 title="Calling XSLTC with the native API">
-<p>This section demonstrates how to use the native XSLTC API in a standalone Java application.</p> 
-<p>Processing an XML document with a translet involves three main steps:</p>
-<ol> 
-  <li><link anchor="native_compile">Compile the stylesheet to a translet</link>.</li>
-  <li><link anchor="native_parse">Parse the input XML document</link>.</li> 
-  <li><link anchor="native_transform">Use the translet to transform the XML document</link>.</li>
-</ol><anchor name="native_overview"/>
-<s3 title="Code overview">
-<p>XsltApp.java illustrates the basic structure for coding a transformation with the native XSLTC API. In the following listing, the method for performing each of the three steps is an empty shell. The methods are filled in the listings in subsequent sections.</p>
-<source>import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.dom.DOMImpl;
-
-public class XsltApp {
-  public static void main(String[] args) {
-    XsltApp proc = new XsltApp();
-    proc.run(args);
-  }
-
-  public void run(String[] args) {
-    if (args.length != 2) {
-      System.err.println("Usage:\n\tprocessor &lt;xmlfile&gt; &lt;xslfile&gt;" +
-            "\n\n\twhere &lt;xmlfile&gt; = xml input filename, and" +
-            "\n\t      &lt;xslfile&gt; = stylesheet filename.");
-      System.exit(1);
-    }
-    String xmldocFilename     = args[0];
-    String stylesheetFilename = args[1];
-
-    // Compile the stylesheet to a translet
-    Translet translet = compileStylesheet(stylesheetFilename);
-
-    // Parse the input XML document
-    DOMImpl dom = getDOM(xmldocFilename);
-
-    // Transform the XML document against the translet
-    doTransform(translet, dom);
-    System.exit(0);
-  }
-  
-  // compile the stylesheet [Empty shell: see below]
-  private Translet compileStylesheet(String stylesheetName) { return null; }
-
-  // parse the input XML document [Empty shell: see below]
-  private DOMImpl getDOM(String xmldocname) { return null; }
-
-  // transform the XML document [Empty shell: see below]
-  private void doTransform(Translet translet, DOMImpl dom) { }
-}</source>
-
-<p>XsltApp takes two command line arguments: the input XML document filename, and the
-XSL stylesheet filename. The public run() method processes the commandline args,
-and then carries out the three steps.</p> 
-<p>The first step is accomplished by calling the compileStylesheet() method. This method
-takes the stylesheet filename as input (String), and returns an instance
-of the translet, as type org.apache.xalan.xsltc.Translet.</p>
-
-<p>The input XML document now needs to be parsed. This is accomplished by the getDOM() method. This method takes the XML document's filename (String)
-and returns the Document Object Model for the document, as an object of
-type org.apache.xalan.xsltc.dom.DOMImpl. </p>
-
-<p>Finally, the transformation prescribed by the stylesheet is carried out by
-calling the doTransform() method. This method takes the translet (compiled
-stylesheet) and the dom (Document Object Model for the XML document) as
-input parameters. In this example, the results of the transformation are
-output to standard output, so this method returns nothing. </p>
-
-<p>If all three steps are carried out successfully, the application exits with
-a successful (zero) value.</p>
-
-<p>The following sections examine each of the three steps in detail.</p>
-</s3><anchor name="native_compile"/>
-<s3 title="1. Compiling the Stylesheet to a Translet">
-<p>The 'compileStylesheet' method:</p>
-
-<source>import java.io.File;
-import java.net.MalformedURLException; 
-import org.apache.xalan.xsltc.compiler.XSLTC;
-...
-  private Translet compileStylesheet(String stylesheetName) {
-    Translet retval = null;
-    String transletName = stylesheetName.substring(0,
-                              stylesheetName.indexOf('.'));
-    try {
-      XSLTC xsltc = new XSLTC();
-      xsltc.init();
-      File stylesheet = new File(stylesheetName);
-      xsltc.compile(stylesheet.toURL());
-      Class clazz = Class.forName(transletName);
-      retval = (Translet)clazz.newInstance();
-    } 
-    catch (MalformedURLException e) {
-      System.err.println("Could not create URL to stylesheet file: " +
-                          stylesheetName + ".\n" + e.getMessage());
-      System.exit(1);
-    } 
-    catch (ClassNotFoundException e) {
-      System.err.println("Could not find class file: " +
-                          transletName + ".class .\n" + e.getMessage());
-      System.exit(1);
-    } 
-    catch (InstantiationException e) {
-      System.err.println("Could not instantiate class file: " +
-                          transletName + ".class .\n" + e.getMessage());
-      System.exit(1);
-    } 
-    catch (IllegalAccessException e) {
-      System.err.println("Could not instantiate class file: " +
-            transletName + ".class, illegal access.\n" + e.getMessage());
-      System.exit(1);
-    }
-    return retval;
-  }</source>
-
-<p>This method reads in the stylesheet file, compiles it to Java bytecodes 
-(the translet), and then writes the bytecodes to the filesystem, as a 
-series of .class files. Their base name is derived from the name of the 
-stylesheet. </p>
-
-<p>The XSLT compiler object (org.apache.xalan.xsltc.compiler.XSLTC), is created,
-initialized and then its compile() method is called passing in a URL
-to the stylesheet itself. Once the .class files have been written,
-the translet is instantiated using Java reflection to create the Class
-and then a new instance of the Class as 'retval' of type 
-org.apache.xalan.xsltc.Translet. </p>
-
-<p>Notice all of the various exceptions that could be thrown in the process
-have been handled with explicit warning messages and a System.exit with a non-zero return value. 
-In your applications, you may want to handle these exceptions differently.</p>
-
-</s3><anchor name="native_parse"/>
-<s3 title="2. Parsing the XML Document">
-
-<p>Parsing the input XML document is handled in the getDOM() method:</p>
-
-<source>import java.io.IOException;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.ParserConfigurationException;
-import org.apache.xalan.xsltc.compiler.Constants;
-import org.apache.xalan.xsltc.dom.DTDMonitor;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-...
-  private DTDMonitor _dtdMonitor = null;
-
-  private DOMImpl getDOM(String xmldocname) {
-    final SAXParserFactory factory = SAXParserFactory.newInstance();
-    try {
-      factory.setFeature(Constants.NAMESPACE_FEATURE, true);
-    } 
-    catch (Exception e) {
-      factory.setNamespaceAware(true);
-    }
-    final DOMImpl dom = new DOMImpl();
-    dom.setDocumentURI(xmldocname);
-    XMLReader reader = null;
-    SAXParser parser = null;
-    _dtdMonitor = new DTDMonitor();
-    try {
-      parser = factory.newSAXParser();
-      reader = parser.getXMLReader();
-      reader.setContentHandler(dom.getBuilder());
-      _dtdMonitor.handleDTD(reader);
-      reader.parse(xmldocname);
-    } 
-    catch (ParserConfigurationException e) {
-      System.err.println("SAX Parser is not configured properly.\n"+
-                          e.getMessage());
-      System.exit(1);
-    } 
-    catch (SAXException e ) {
-      System.err.println("SAX Parser could not be created.\n"+
-                          e.getMessage());
-      System.exit(1);
-    } 
-    catch (IOException e ) {
-      System.err.println("XML Reader could not read xml document '"+
-                          xmldocname + "'," + e.getMessage());
-      System.exit(1);
-    }
-    return dom;
-  }</source>
-
-<p>The method parses the input XML document and creates a Document
-Object Model to return to the run() method for later use. To parse the 
-document we use a javax.xml.parsers.SAXParser, from the JAXP.  The JAXP
-model uses a factory method; accordingly we first create the factory,
-which is of type javax.xml.parsers.SAXParserFactory. After configuring 
-the factory to handle namespaces, the procedure gets an org.xml.sax.XMLReader
-from the SAXParser. The reader is registered
-with the class DTDMonitor, and then the reader is instructed to parse
-the XML document. The DOMImpl object is returned to the main() method.</p> 
-
-<note>Before the document is parsed, the DOMImpl is configured with the
-XML document's URI with a call to the setDocumentURI() method. This
-is necessary to define the origin of the document from which the DOM tree
-is built. This information is needed for xsl:import, xsl:include, and
-the document() function.</note>
-</s3><anchor name="native_transform"/>
-<s3 title="3. Doing the Transformation">
-
-<p>Now everything is set to carry out the XSL transformation. The doTransform()
-method takes a reference to the Translet object generated 
-from the stylesheet, and the DOMImpl object created from the XML document.</p>
-
-<source>import java.io.IOException;
-import org.apache.xalan.xsltc.runtime.DefaultSAXOutputHandler;
-import org.apache.xalan.xsltc.runtime.TextOutput;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import org.apache.xalan.xsltc.TransletException;
-...
-  private void doTransform(Translet translet, DOMImpl dom) {
-    DefaultSAXOutputHandler outputhandlr = null;
-    TextOutput textoutput = null;
-    try {
-      outputhandlr= new DefaultSAXOutputHandler(System.out, "utf-8");
-      textoutput = new TextOutput(outputhandlr, "utf-8");
-    } 
-    catch (IOException e) {
-      System.err.println("Could not create SAX Output Handler."+
-                          e.getMessage());
-      System.exit(1);
-    }
-  
-    // for XSL keys
-    AbstractTranslet absTranslet = (AbstractTranslet)translet;
-    absTranslet.setIndexSize(dom.getSize());
-    _dtdMonitor.buildIdIndex(dom, 0, absTranslet);
-
-    try {
-      absTranslet.transform(dom, textoutput);
-    } 
-    catch (TransletException e) {
-      System.err.println("Could not transform XML document."+
-                          e.getMessage());
-      System.exit(1);
-    }
-  }</source>
-
-<p>The Translet's transform() method takes two arguments: the DOMImpl
-reference created in the getDOM() method, and an xsltc.runtime.TextOutput
-object. TextOutput is a ContentHandler wrapper class that implements the
-xsltc.TransletOutputHandler interface. In this example, the content
-handler (DefaultSAXOutputHandler) is wrapped.</p>     
-
-<p>Translet is an interface. AbstractTranslet is a class that implements that
-interface. Before the transform() method is called, setIndexSize(int)
-is called to pass in the maximum DOM size to the translet and the DTDMonitor
-is called to build the node index that the Key (xsl:key implementation)
-class uses. This is a general case, if you are not using keys, then you
-do not need to set the index size, consequently you would not need to
-work with the AbstractTranslet either. In that case, you can  use the
-Translet directly by calling translet.transform(dom, textoutput). </p>
-</s3><anchor name="native_conclusion"/>
-<s3 title="Conclusion">
-<p>The native XSLT compiler API provides a way to compile an XSL stylesheet
-into a translet. The translet can then be used to transform the DOMImpl
-of an input XML document.   This example demonstrated how to compile a
-stylesheet into a translet, parse an input XML document, and then transform
-the XML document using the translet.</p>
-</s3></s2><anchor name="constraints"/>
-<s2 title="XSLTC usage constraints">
-<p>See <link idref="readme" anchor="xsltcconf">Conformance issues</link> and <link idref="readme" 
-anchor="xsltcknownproblems">Known problems</link>.</p>
-</s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xalandesign.xml b/xdocs/sources/xalandesign.xml
deleted file mode 100644
index 702da28..0000000
--- a/xdocs/sources/xalandesign.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book SYSTEM "sbk:/style/dtd/book.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2000, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-
-<book title="Xalan 2.0.0 Design" copyright="2000 The Apache Software Foundation">
- 
-  <document id="design2_0_0"
-            label="Xalan-J 2.0.0 Design"
-            source="design/design2_0_0.xml"/>    
-</book>
-  
\ No newline at end of file
diff --git a/xdocs/sources/xsltc.xml b/xdocs/sources/xsltc.xml
deleted file mode 100644
index 34fb692..0000000
--- a/xdocs/sources/xsltc.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book SYSTEM "sbk:/style/dtd/book.dtd">
-
-<book title="XSLTC Design" copyright="2001 The Apache Software Foundation">
- 
-  <document id="index"
-            label="Overview"
-            source="xsltc/index.xml"/>
-
- <separator/>
-
-  <document id="xsltc_compiler"
-            label="Compiler design"
-            source="xsltc/xsltc_compiler.xml"/>
-
- <separator/>
- 
-   <document id="xsl_whitespace_design"
-            label="Whitespace"
-            source="xsltc/xsl_whitespace_design.xml"/>
-
-  <document id="xsl_sort_design"
-            label="xsl:sort"
-            source="xsltc/xsl_sort_design.xml"/> 
-
-  <document id="xsl_key_design"
-            label="Keys"
-            source="xsltc/xsl_key_design.xml"/> 
-
-  <document id="xsl_comment_design"
-            label="Comment design"
-            source="xsltc/xsl_comment_design.xml"/>
- 
-  <separator/>
-
-  <document id="xsl_lang_design"
-            label="lang()"
-            source="xsltc/xsl_lang_design.xml"/> 
-
-  <document id="xsl_unparsed_design"
-            label="Unparsed entities"
-            source="xsltc/xsl_unparsed_design.xml"/> 
-  
- <separator/>
-   
-  <document id="xsltc_runtime"
-            label="Runtime"
-            source="xsltc/xsltc_runtime.xml"/> 
-            
- <separator/>
-
-  <document id="xsltc_dom"
-            label="Internal DOM"
-            source="xsltc/xsltc_dom.xml"/>            
-            
-  <document id="xsltc_namespace"
-            label="Namespaces"
-            source="xsltc/xsltc_namespace.xml"/>             
-            
- <separator/>
- 
-   <document id="xsltc_trax"
-             label="Translet &amp; TrAX"
-             source="xsltc/xsltc_trax.xml"/>
- <separator/>
- <external href="todo.html" label="To-do list"/>
-            
-</book>
-  
\ No newline at end of file
diff --git a/xdocs/sources/xsltc/DOMInterface.gif b/xdocs/sources/xsltc/DOMInterface.gif
deleted file mode 100644
index 8f8919e..0000000
--- a/xdocs/sources/xsltc/DOMInterface.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/DOMLocking.gif b/xdocs/sources/xsltc/DOMLocking.gif
deleted file mode 100644
index cae33b4..0000000
--- a/xdocs/sources/xsltc/DOMLocking.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/README b/xdocs/sources/xsltc/README
deleted file mode 100644
index e7b498e..0000000
--- a/xdocs/sources/xsltc/README
+++ /dev/null
@@ -1,246 +0,0 @@
-=======================================================================
-         README FILE FOR THE SUN XSLT COMPILER
-                 Preview Version 6 
-                    April, 2001
-           Copyright (c) Sun Microsystems, 2001
-=======================================================================
-
-The Sun XSLT Compiler (XSLTC) is a Java-based tool for compiling XSL 
-stylesheets into extremely lightweight and portable Java byte code. 
-The Sun XSLTC Java Runtime environment can then process XML files 
-against these compiled stylesheets (Translets) to generate any manner 
-of output per the style-sheet instructions.
-
-This preview version of the XSLT Compiler can be run on any 
-platform -- including UNIX, Windows, NT, Mac -- that supports 
-Java2 or later. The Translets (compiled stylesheets) can be run on any 
-Java platform including a Palm Pilot with J2ME CLDC 
-(Java 2 Micro Edition, Connected Limited Device Configuration). 
-While the compiler itself requires Java2,translets are designed to run 
-anywhere Java is available.
-
-Almost all functions of the XLST 1.0 language are implemented; 
-more than enough to show you how this new approach to XSLT works 
-and its advantages! Using the samples provided, you will be able 
-to see for yourself. Also, demos for the Palm Pilot, Applets, and 
-Servlets are provided.
-
------------------------------------------------------------------------
-ATTRIBUTIONS
------------------------------------------------------------------------
-The XSLT Compiler program uses the CUP Parser Generator
-for Java, Copyright 1996-1999 by Scott Hudson, Frank Flannery,
-C. Scott Ananian.  For more details, please see:
-http://www.cs.princeton.edu/~appel/modern/java/CUP/
-
-The XSLT Compiler program also uses a modified version of the
-Byte Code Engineering Library (BCEL), formerly known as 
-(JavaClass API), Copyright 2000 Markus Dahm.
-
-** Please note that this additional package, BCEL, is
-** needed in order to generate the class files from the compiler.
-** Without the BCEL package, this preview version of the
-** compiler WILL NOT WORK.  BCEL is freely available for
-** download as described below.
-
------------------------------------------------------------------------
-REQUIRED PACKAGE
------------------------------------------------------------------------
-BCEL (formerly JavaClass) by Markus Dahm has been 
-used to automatically create class files from the XSLT compiler output.  
-You must obtain the BCEL.jar file and install it before using the 
-XSLT compiler.
-
-The simplest way to download the BCEL.jar file from 
-
-    http://bcel.sourceforge.net/downloads.html
-
-is to use the "JAR file (without docs)" link.
-
-You may want to obtain the precompiled class files and documentation.
-To download them to a Unix system:
-
-    1) Choose the "latest version (Precompiled + docs)" 
-       Gzipped Tar-File or ZIP-File link.
-
-    2) Unpack and expand the downloaded BCEL files in your 
-       download directory (e.g., /usr/local).
-
-    3) Change directory to BCEL.
-
-    4) Create the jar file BCEL.jar.
-    
-       From within the BCEL directory, you can either use the 
-       included GNUmakefile or create the jar yourself.
-       
-       To use the GNUmakefile, type the command 'make jar'.
-       
-       To create the jar yourself, type the command:
-       
-         jar cvf BCEL.jar `find de gnu -name \*.class` listclass.class
-
-To download the precompiled class files and documentation 
-to a Windows system:
-
-    1) Choose the "latest version (Precompiled + docs)" 
-       ZIP-File link.
-
-    2) Unzip the downloaded BCEL files in your 
-       download directory.
-
-    3) Change directory to BCEL and from a DOS command line,
-       type the command:
-
-         jar -cvf BCEL.jar de\fub\bytecode\classfile\*.class
-           gnu\regexp\*.class listclass.class
-
-To complete the BCEL setup:
-
-    1) Install XSLTC, as described in the section below,
-       "HOW TO INSTALL XSLTC AND RUN THE SAMPLES."
-
-    2) Copy the BCEL.jar file into the "lib" directory
-       under your "xsltc" directory.
-
-       You are now set to run the XSLT compiler.
-
-------------------------------------------------------------
-ADDITIONS FROM VERSION 5 (of the PREVIEW COMPILER)
-------------------------------------------------------------
-
-Support for 
-
-	- Simplified Stylesheets
-	- id() and key() in match patterns
-
-------------------------------------------------------------
-XSLT 1.0 Features Not Suported in PREVIEW VERSION 6
-------------------------------------------------------------
-
-The following XSLT 1.0 features are not yet supported:
-
-    * Nonstatic external Java methods. 
-      You may call static Java functions
-      using a namespace prefix matching the class name that is 
-      associated with the following URL:
-      
-        http://www.sun.com/xsltc/java/YourJavaClass
-      
-    * Namespace axis
-
-------------------------------------------------------------
-LIST OF FILES
-------------------------------------------------------------
-
-The files included in this preview package are as follows:
-
-xsltc-1_0-alpha5-bin.zip
-   <install dir>/xsltc
-      LICENSE.txt           (license file)
-      XSLTCprn_lg.txt       (copyright notice)
-      README                (this file)
-      README.api            (describes Translet API)
-      README.xslt           (describes runtime command line interface)
-      README.xsltc          (describes compiler command line interface)
-      bin 
-         xslt               (runtime for Unix)
-         xsltc              (compiler for Unix)
-
-         xslt.bat           (runtime for DOS)
-         xsltc.bat          (compiler for DOS)
-      demo
-         README
-         TransletDemo.prc (Palm Pilot install file)
-      lib
-         xml.jar
-         xsltc.jar
-         xsltcrt.jar               ('rt' = runtime)
-         [BCEL.jar goes here] (see REQUIRED PACKAGE above)
-      samples
-         set of xml and xsl files for you to try
-      src
-         subset of the runtime package to complement README.api
-         plus an Applet demo and a servlet demo
-         com/sun/xslt/demo/servlet
-             README.servlet        (describes Servlet demo)
-         com/sun/xslt/demo/applet
-             README.applet         (describes Applet demo)
-
-------------------------------------------------------------
-HOW TO INSTALL XSLTC AND RUN THE SAMPLES
-------------------------------------------------------------
-
-1. Unzip the files in a directory of your choice, for example
-   from the user directory '/home/user1', the distribution
-   zip file can be unzipped using the jar command as:
-
-   jar xvf xsltc-1_0-alpha5-bin.zip 
-
-   The subdirectory 'xslt' will be created in '/home/user1'.
-
-2. Set the XSLT environment variable to point to your installation
-   directory. Set your PATH environment variable to include
-   the bin directory of XSLT. 
-
-   For example, in the bash shell:
- 
-      export XSLT=/home/user1/xslt
-      export PATH=$XSLT/bin:$PATH
-
-3. Compile the stylesheet to produce a Java class file.
-
-   For example, on the Unix platform, to compile the play1.xsl
-   stylesheet for the play.xml document:
-
-      cd /home/user1/xsltc/samples
-      xsltc play1.xsl
-
-   The compiled stylesheet will be in the main Java class file 
-   'play1.class'
-
-   NOTE: The 'xlstc' shell script adds the required jars to your CLASSPATH
-
-   For example, on the Windows platform, to compile the play1.xsl
-   stylesheet for the play.xml document:
-   
-      set classpath=c:\xsltc\samples;c:\xsltc\lib\xsltc.jar;
-      c:\xsltc\lib\xsltcrt.jar;c:\xsltc\lib\xml.jar;
-      c:\xsltc\lib\BCEL.jar;.
-      cd c:\xsltc\samples
-      java com.sun.xslt.compiler.XSLTC play1.xsl
-
-4. Use the compiled Java class file (play1.class) to transform 
-   the example XML document.
-
-   For example, on the Unix platform:
-
-      xslt play.xml play1
-
-   For example, on the Windows platform:
-
-      java com.sun.xslt.runtime.DefaultRun play.xml play1
-
-   The result is sent to standard output.
-
-   NOTE: When running the compiled stylesheet, you 
-         just specify the name of its Java class, not its
-         file name (e.g., play1, not play1.class).
-         You do not include the ".class" extension, nor
-         the path to the class. The class is found by means 
-         of the Java CLASSPATH variable. If you run
-         the translet from a directory other
-         than the directory in which the compiled
-         stylesheet class is located, you need to add 
-         that directory to your Java CLASSPATH. Also, you
-         need to remove directories from your CLASSPATH 
-         for prior installations of XSLTC and any references 
-         to Sun's project X parser (com.sun.xml.tree)
-         installed from some other XML application/tool.
- 
-   NOTE: The javadocToHtml sample calls external Java methods
-         from the JavadocFormatter class. Before compiling the
-         javadocToHtml.xsl stylesheet, compile the 
-         JavadocFormatter class using 'javac'.
-
-------------------------------------------------------------
-END OF README
diff --git a/xdocs/sources/xsltc/README.APACHE b/xdocs/sources/xsltc/README.APACHE
deleted file mode 100644
index c7cd61f..0000000
--- a/xdocs/sources/xsltc/README.APACHE
+++ /dev/null
@@ -1,86 +0,0 @@
-README.APACHE
-=====================================================================
-Entire source tree and support packages are located in the single jar
-file 'apache.jar'. 
-
-
-Installation
--------------
-
-(1) create directory [Root], unpack 'apache.jar' there.
-	ex) % cd /tmp; mkdir xsltc_apache 
-	    % cd xsltc_apache
-        copy apache.jar to xsltc_apache directory
-	    % jar xvf apache.jar 
-	cleanup
-	    % rm -rf META-INF apache.jar
-
-    Unpacking the jar file will result in the following tree:
-
-	[Root]
-	  External/
-	    BCEL/                ... contains BCEL.jar
-	    JLex/                ... contains JLex.jar
-	    java_cup/            ... contains java_cup.jar, runtime/runtime.jar
-	    xml-tr2/             ... contains xml.jar
-	  bin/
-	    xslt
-	    xsltc
-	  doc/
-	    api/                 ... contains javadoc for api
-	  src/
-	    GNUmakefile
-	    GNUmakefile.allinc
-	    docs/
-	      LICENSE.txt
-	      Message.txt
-	      README
-	      README.api
-	      README.xslt
-	      README.xsltc
-	      XSLTCprn_lg.txt*
-	      xsltcA3.txt
-	    org/
-	      apache/
-		xalan/
-		  xsltc/
-		     (src tree)  ... all the source code files
-
-
-    The 'src tree' is a hierarchy of the following packages:
-	org.apache.xalan.xsltc
-	org.apache.xalan.xsltc.compiler
-	org.apache.xalan.xsltc.compiler.util
-	org.apache.xalan.xsltc.dom
-	org.apache.xalan.xsltc.runtime
-	org.apache.xalan.xsltc.util
-	org.apache.xalan.xsltc.util.getopt
-
-
-(2) make bin programs executable
-	    % chmod +x bin/*
-
-(3) set env variable to point to top of directory [Root]
-	ex) % setenv XSLT /tmp/xsltc_apache
-
-(4) compile sources (uses gnu make and the provides 'GNUmakefile'). This
-    will create java classes in [Root]/classes, e.g. /tmp/xsltc_apache/classes.
-    (No need to set your CLASSPATH variable.)
-    
-	ex) % cd src; gmake again
-
-    Note: the 'again' target forces everything to be built from scratch,
-    including the java_cup source files. Subsequent builds can be done
-    using the 'classes' target. 
-
-(5) make the javadoc
-	ex) % gmake jdoc
-
-(6) add bin directory to your executable path, 
-	ex) % set path=($XSLT/bin $path)
-
-(7) test distribution, given a stylesheet (test.xsl) and an input xml doc
-    (test.xml), and be sure current working directory (.) is in your
-    CLASSPATH.
- 	% xsltc test.xsl		... creates translet, test.class
-	% xslt test.xml test		... runs translet on xml input	
diff --git a/xdocs/sources/xsltc/README.api b/xdocs/sources/xsltc/README.api
deleted file mode 100644
index 601b092..0000000
--- a/xdocs/sources/xsltc/README.api
+++ /dev/null
@@ -1,422 +0,0 @@
-============================================================
-         README FILE FOR THE SUN XSLT COMPILER API
-                  Preview Version 5 
-                    February, 2001
-           Copyright (c) Sun Microsystems, 2001
-============================================================
-
-The Sun XSLT Compiler (XSLTC) is a Java-based tool for 
-compiling XSL stylesheets into extremely lightweight and 
-portable Java byte code. The Sun XSLTC Java Runtime environment 
-can then process XML files against these compiled stylesheets 
-(Translets) to generate any manner of output per the style-
-sheet instructions.
-
-CONTENTS OF THIS DOCUMENT:
-	1. HOW TO INCLUDE TRANSLETS IN YOUR APPLICATIONS
-	2. FULL CODE EXAMPLE 1, (uses a SAX DocumentHandler).
-	3. COMPILING AND RUNNING THE EXAMPLE 
-	4. FULL CODE EXAMPLE 2, (uses DefaultSAXOutputHandler). 
-	5. APPENDIX (TextOut and DefaultSAXOutputHandler)
-
-
-
-
-1. HOW TO INCLUDE TRANSLETS IN YOUR APPLICATIONS
----------------------------------------------------------------------
-
-Translets implement the interface com.sun.xslt.Translet
-that you will find in the src directory.
-
-public interface Translet {
-    public void transform(DOM document, TransletOutputHandler handler)
-	throws TransletException;
-
-    public void transform(DOM document, TransletOutputHandler[] handlers)
-	throws TransletException;
-
-    public void transform(DOM document, NodeIterator iterator,
-                          TransletOutputHandler handler) throws 
-			  TransletException;
-
-    public Object addParameter(String name, Object value);
-
-    public void buildKeys(DOM document, NodeIterator iterator,
-                          TransletOutputHandler handler, int root) throws 
-			  TransletException;
-
-    public String getOutputEncoding();
-}
-
-The Translet takes a DOMImpl object (created from an input XML document),
-as input and transforms it. The results of the transformation are 
-sent to an  event-based output handler that implements the 
-com.sun.xslt.TransletOutputHandler interface :
-
-
-public interface com.sun.xslt.TransletOutputHandler {
-    public void startDocument() throws TransletException;
-    public void endDocument() throws TransletException;
-    public void characters(char[] characters, int offset, int length)
-        throws TransletException;
-    public void startElement(String elementName) throws TransletException;
-    public void endElement(String elementName) throws TransletException;
-    public void attribute(String attributeName, String attributeValue)
-        throws TransletException;
-    public void comment(String comment) throws TransletException;
-    public void processingInstruction(String target, String data)
-        throws TransletException;
-    public void setType(int type);
-    public void setIndent(boolean indent);
-    public boolean setEscaping(boolean escape) throws TransletException;
-    public void insertCdataElement(String elementName);
-}
-
-
-You create an instance of the class that implements the Translet interface
-using Java reflection:
-
-  Class clazz = Class.forName("classname");
-  Translet translet = (Translet) clazz.newInstance();
-
-where "classname" is the name of the class generated by XSLTC.
-In order to execute a transformation, both a document and a SAX-like
-handler (TransletOutputHandler) are needed.
-A document instance can be created with the aid of SAX-complaint XML parser.
-For example, using Sun's parser you would write,
-
-  import com.sun.xslt.dom.DOMImpl;
-  import com.sun.xml.parser.Parser;
-  import com.sun.xml.parser.Resolver;
-
-  // Create new instances of DOM and Parser
-  DOMImpl dom = new DOMImpl();
-  Parser parser = new Parser();
-
-  // Set a SAX handler to build a DOM tree
-  parser.setDocumentHandler(dom.getBuilder());
-
-  // Parse the document and build a DOM tree
-  InputSource input = new InputSource(
-                          new FileReader("xmlfile.xml"));
-  parser.parse(input);
-  
-In this example a document is parsed from a file, but it is also 
-possible to parse a document from a URI by writing,
-
-  parser.parse("http://.../xmlfile.xml");
-
-To transform the input XML document, a call is made to the translet's
-transform() method. In order to do its work, the transform() method
-takes two arguments, (1) the DOMImpl object created from parsing
-the input XML document, and (2) an output handler. The output handler
-must implement the org.xml.sax.DocumentHandler interface.  You 
-have the option of: (1) writing your own class that implements 
-DocumentHandler, or (2) using our default class
-'com.sun.xslt.runtime.DefaultSAXOutputHandler' instead.  
-The source code for our DefaultSAXOutputHandler is included
-in this package in the com/sun/xslt/runtime directory. 
-This is a change from the previous releases of
-our compiler API. If you  wanted to create your own 
-output handler in previous releases, you would have write a class that 
-implemented the interface TransletOutputHandler. This change was made
-so that users could more easily plug in any SAX compliant output
-handler. To plug in the SAX compliant output handler,
-(whether it is a user written class or our DefaultSAXOutputHandler)
-into the transform() method, it must be wrapped in a
-TextOutput object first. 
-
-The Translet.transform() method may also take an array of output handlers. 
-In this case the transformation will be able to select which handler 
-to send output to by using the extension element <translet:output port="n"> 
-where 'n' is a 0-based index in the array of output handlers.
-
-Lets take a look at the code needed to carry out both of the options
-for passing the SAX output handler to the translet's transform() method:
-
-   (1) You would write your own output handler that implements
-       the org.xml.sax.DocumentHandler interface, pass this class
-       into our com.sun.xslt.runtime.TextOutput class which itself
-       implements the TransletOutputHandler interface.
-
-   (2) You would create an instance of the default SAX output handler,
-       com.sun.xslt.runtime.DefaultSAXOutputHandler, pass this
-       instance into our com.sun.xslt.runtime.TextOutput class which
-       itself implements the TransletOutputHandler interface.
-
-
-In option (1), we want to use a SAX compliant output handler that we write
-ourselves. In this case we create our Handler class, which implements 
-org.xml.sax.DocumentHandler:
-
-import org.xml.sax.DocumentHandler;
-
-// user supplied SAX Handler:
-class Handler implements DocumentHandler {
-    public void startDocument() throws SAXException {}
-
-    public void endDocument() throws SAXException {}
-
-    public void characters(char[] characters, int offset, int length)
-        throws SAXException
-    {
-        System.out.println(new String(characters, offset, length));
-    }
-    public void startElement(String elementName, AttributeList attrs)
-        throws SAXException {}
-    public void endElement(String elementName) throws SAXException {}
-    public void setDocumentLocator(Locator loc) {}
-    public void ignorableWhitespace(char[] characters, int offset, int length)
-        throws SAXException {}
-    public void processingInstruction(String target, String data)
-        throws SAXException {}
-}
-
-Now before we pass our handler to the transform() method, we wrap it
-in a TextOutput object (which implements the TransletOutputHandler
-interface for us).  Then given the instantiated translet class, 
-the transform method could be called as:
-
-	import com.sun.xslt.runtime.TextOutput;
-
-	DOMImpl dom;
-        ...
-        Handler saxHandler;
-        TextOutput textOutput;
-        try {
-            saxHandler = new Handler();
-            textOutput = new TextOutput(saxHandler);
-            translet.transform(dom, textOutput);
-        } catch (TransletException  e){
-	    ...
-        } catch (IOException  e){
-	    ...
-        }
-
-
-By using the TextOutput wrapper class, one can also control the character
-encoding. The TextOutput class has an additional constructor that takes
-the DocumentHandler and a String that describes the encoding, for example
-'textOutput' could have been created as:
-
-	textOutput = new TextOutput(saxHandler, "utf-8");
-
-Finally, option (2) is much like option (1) except you do not have
-to write your own DocumentHandler. We provide one by default. To use the
-default one, instantiate 'com.sun.xslt.runtime.DefaultSAXOutputHandler'
-rather than instantiating your own class (such as Handler above):
-
-	import com.sun.xslt.runtime.DefaultSAXOutputHandler;
-	import com.sun.xslt.runtime.TextOutput;
-
-	DefaultSAXOutputHandler defhandlr;
-	try {
-            defhandlr = new DefaultSAXOutputHandler(System.out, "utf-8");
-            translet.transform(dom, new TextOutput(defhandlr));
-        } catch (TransletException  e){
-	    ...
-        } catch (IOException  e){
-	    ...
-        }
-
-For a quick reference to the TextOutput and DefaultSAXOutputHandler
-constructors available, see the Appendix. 
-
-In the following sections, full code examples are shown.
-	
-Finally, if you want the transformation results in the DOM form:
-
-DOM result = new DOM();
-translet.transform(dom, result.getOutputDomBuilder());
-
-If the compiled stylesheet requires the values of global 
-parameters to be set, you should call addParameter() before 
-calling the transform() method.
-
- 
-2. FULL CODE EXAMPLE 1, XsltApp.java, uses a SAX DocumentHandler.
-	This example corresponds to option (1) in discussion above.
-------------------------------------------------------------------
-import java.io.FileReader;
-import java.io.IOException;
-import com.sun.xslt.dom.DOMImpl;
-import com.sun.xslt.runtime.TextOutput;
-import com.sun.xslt.Translet;
-import com.sun.xslt.TransletException;
-import com.sun.xml.parser.Parser;
-import org.xml.sax.AttributeList;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-
-// Create a SAX Output Handler
-class Handler implements DocumentHandler {
-    public void startDocument() throws SAXException {}
-
-    public void endDocument() throws SAXException {}
-
-    public void characters(char[] characters, int offset, int length)
-        throws SAXException
-    {
-        System.out.println(new String(characters, offset, length));
-    }
-
-    public void startElement(String elementName, AttributeList attrs)
-        throws SAXException {}
-
-    public void endElement(String elementName) throws SAXException {}
-
-    public void setDocumentLocator(Locator loc) {}
-
-    public void ignorableWhitespace(char[] characters, int offset, int length)
-        throws SAXException {}
-
-    public void processingInstruction(String target, String data)
-        throws SAXException {}
-
-}
-
-public class XsltApp {
-   public static void main(String[] args){
-        XsltApp app = new XsltApp();
-        app.run(args);
-   }
-
-   public void run(String[] args){
-        if(args.length != 2){
-                usage();
-        }
-        String inputFileName = args[0];
-        String transletName = args[1];
-
-        DOMImpl dom = new DOMImpl();
-        Parser parser = new Parser();
-        parser.setDocumentHandler(dom.getBuilder());
-        InputSource input = null;
-        try {
-            input = new InputSource(new FileReader(inputFileName));
-        } catch( java.io.FileNotFoundException e){
-            System.err.println("File " + inputFileName + " not found");
-            System.exit(1);
-        }
-
-        try {
-            parser.parse(input);
-        } catch (org.xml.sax.SAXException e){
-            System.err.println("Error: " + e);
-            System.exit(1);
-        } catch (IOException e){
-            System.err.println("Error: " + e);
-            System.exit(1);
-        }
-
-        Class transletPluggable = null;
-        try {
-            transletPluggable = Class.forName(transletName);
-        } catch (java.lang.ClassNotFoundException e){
-            System.err.println("Error: " + e);
-            System.exit(1);
-        }
-
-        Translet translet = null;
-        try {
-            translet = (Translet)transletPluggable.newInstance();
-        } catch (java.lang.Exception e){
-            System.err.println("Error instantiating pluggable translet");
-            System.exit(1);
-        }
-
-        Handler saxHandler;
-        TextOutput textOutput;
-        try {
-            saxHandler = new Handler();
-            textOutput = new TextOutput(saxHandler, "utf-8");
-            translet.transform(dom, textOutput);
-        } catch (TransletException  e){
-            System.err.println("Error: " + e);
-            System.exit(1);
-        } catch (IOException  e){
-            System.err.println("Error: " + e);
-            System.exit(1);
-        }
-   }
-
-   public void usage(){
-        System.out.println("Usage: \n" +
-                "     xsltapp <xml_file> <translet_name>\n\n" +
-                "     where <file> is xml source (e.g. play.xml). \n" +
-                "     and  <translet_name> is java class (e.g. play1). \n"
-        );
-        System.exit(1);
-   }
-}
-
-
-
-3. COMPILING AND RUNNING THE EXAMPLE:
----------------------------------------------------------------------
-
-To compile the example above, assuming you unpacked the code
-into the directory /tmp:
-
-javac -classpath "/tmp/xsltc/lib/xml.jar:/tmp/xsltc/lib/BCEL.jar:/tmp/xsltc
-/lib/xsltcrt.jar" XsltApp.java
-
-To run the example on xml document 'play.xml' and stylesheet 'play1.xsl':
-
-(1) compile the stylesheet:
-        xsltc play1.xsl
- 
-    this will produce the translet 'play1.class'.
-
-(2) run the translet with the XsltApp demo:
-
-java -classpath /tmp/xsltc/lib/xsltcrt.jar:/tmp/xsltc/lib/xml.jar:. XsltApp play
-.xml play1
-
-
- 
-4. FULL CODE EXAMPLE 2, DefaultRun.java
-	This example corresponds to option (2) in the discussion above.
-------------------------------------------------------------------
-See the source file for the class 'com.sun.xslt.runtime.DefaultRun',
-which is included in the src directory. It uses the 
-'DefaultSAXOutputHandler' approach.
-
-
-
-
-5. APPENDIX
-------------------------------------------------------------------
-
-TextOutput
-----------
-
-package com.sun.xslt.runtime;
-
-public final class TextOutput implements TransletOutputHandler {
-	public TextOutput(DocumentHandler handler) throws IOException;
-	public TextOutput(DocumentHandler handler, String encoding) throws
-		IOException;
-}
-
-
-DefaultSAXOutputHandler
------------------------
-package com.sun.xslt.runtime;
-
-public class DefaultSAXOutputHandler implements DocumentHandler{
-	public DefaultSAXOutputHandler(Writer writer) throws IOException;
-	public DefaultSAXOutputHandler(OutputStream out, String encoding)
-	    throws IOException;
-	public DefaultSAXOutputHandler(String filename, String encoding)
-            throws IOException;
-	...
-}
-
-
-
-------------------------------------------------------------
-END OF README
diff --git a/xdocs/sources/xsltc/README.xslt b/xdocs/sources/xsltc/README.xslt
deleted file mode 100644
index 3c0cbe8..0000000
--- a/xdocs/sources/xsltc/README.xslt
+++ /dev/null
@@ -1,97 +0,0 @@
-NAME
-	xslt - Sun XSLT runtime processor. 
-
-
-SYNOPSIS
-	xslt [-j <jarfile>] {-u <document_url> | <document>} <class> 
-             [<name1>=<value1> ...]
-
-
-DESCRIPTION
-	The Sun XSLT runtime processor is a Java-based tool for 
-	transforming XML document files using a translet (compiled 
-	stylesheet). 
-
-	The XSLT processor can be run on any platform including UNIX,
-	Windows, NT, Mac that supports Java, including a Palm Pilot
-	with J2ME CLDC (Java 2 Micro Edition, Connected Limited Device
-	Configuration).
-
-OPTIONS
-
-	The following options are supported:
-
-	-j <jarfile>
-		gets the translet <class> from the specified <jarfile>
-		instead of from the user's CLASSPATH.	
-
-	-u
-		Specifies that the XML <document> location will be a URI
-		such as 'http://myserver/hamlet.xml'.		
-
-
-OPERANDS
-
-	The following operands are supported:
-
-	<document>     		An XML document to be processed. 
-	<document_url>     	An XML document to be processed, specified
-				as a URL (See -u option above). 
-
-	<class>			The translet that will do the processing.
-				The translet may optionally take a set of 
-				global parameters specified as name-value 
-				pairs. A name-value pair uses the format
-				<name>=<value>.
-
-EXAMPLES
-	Example 1:  Processing an XML document.
-
-	example%  xslt hamlet.xml hamlet 
-
-	where the current working directory contains an XML document
-	'hamlet.xml' to be processed by the translet class 'hamlet'.
-	The translet would have been created initially using
-	xsltc to compile a XSLT stylesheet named 'hamlet.xsl'. 
-
-	Example 2:  Loading translet from a jar file. 
-
-	example%  xslt -j hamlet.jar hamlet.xml hamlet
-
-	In this case the translet class 'hamlet' is loaded from the
-	specified jar file, 'hamlet.jar' instead of from the user's
-	CLASSPATH.
-
-	Example 3: If the translet defined global parameters, then 
-	these can be passed on the command line to the runtime processor
-	as a space separated list of name-value pairs using the format
-	<name>=<value>. For example,
-
-	example%  xslt hamlet.xml hamlet speaker=HAMLET 'scene=SCENE IV'
-
-	Notice that the second name-value pair had to be quoted due to 
-	the intervening space in the value "SCENE IV".
-
-	example% xslt -u http://zarya.east/test.xml hamlet
-
-	where the xml document 'test.xml' can be specified as a URL.
-
-FILES
-	file.xml		input XML document to be processed. 
-	file.class		byte code file.
-	file.jar		java archive file.
-	
-SEE ALSO
-	xsltc, jar.
-
-BUGS
-	Refer to the top-level README included in this release.
-
-AUTHORS
-	Jacek Ambroziak,                       jacek.ambroziak@East.Sun.COM
-	Santiago Pericas-Geertsen,    santiago.pericasgeertsen@East.Sun.COM 
-
-	Contributors:
-
-	Morten Jorgensen		   morten.jorgensen@Ireland.Sun.COM
-	G. Todd Miller,                            todd.miller@East.Sun.COM
diff --git a/xdocs/sources/xsltc/README.xsltc b/xdocs/sources/xsltc/README.xsltc
deleted file mode 100644
index 50c77d4..0000000
--- a/xdocs/sources/xsltc/README.xsltc
+++ /dev/null
@@ -1,116 +0,0 @@
-NAME
-	xsltc - Sun XSLT Compiler 
-
-
-SYNOPSIS
-	xsltc [-o <output>] [-d <directory>] [-j <jarfile>] 
-	      [-p <package name>]
-              [-u] <stylesheet>... 
-
-
-DESCRIPTION
-	The Sun XSLT Compiler is a Java-based tool for compiling XSLT
-	stylesheets into lightweight and portable Java byte codes 
-	called translets.  
-
-	The XSLT Compiler can be run on any platform including UNIX,
-	Windows, NT, Mac that supports Java 1.2.x or later. The generated
-	translets can be run on any platform that supports a Java
-	Runtime Environment, including a Palm Pilot with J2ME CLDC 
-	(Java 2 Micro Edition, Connected Limited Device Configuration).
-
-OPTIONS
-
-	The following options are supported:
-
-	-o <output>
-		Changes the name of the generated translet class.
-		By default, the translet class would be named
-		<stylesheet>, if -o <output> is set, then the 
-		translet class would be named <output>. Translet
-		class files are written as .class files.
-
-	-d <directory>
-		Changes the destination directory. By default, any
-		translet class files generated would be placed in 
-		the current working directory. If -d <directory> 
-		is specified, the files would be output to <directory>.
-
-	-j <jarfile>
-		Outputs all generated translet class files into a 
-		jar file named <jarfile>.jar. When this option is 
-		used only a jar file will be output.
-
-	-p <package name>
-		Specify a package name for all generated translet
-		classes.		
-
-	-u
-		Specifies that <stylesheet> location will be a URI
-		such as 'http://myserver/stylesheet1.xsl'.		
-
-
-OPERANDS
-
-	The following operand is supported:
-
-	<stylesheet>    A path name of an input stylesheet file. 
-
-
-EXAMPLES
-	Example 1:  Creating a translet from stylesheet 'hamlet.xsl'.
-
-	example%  xsltc hamlet.xsl
-
-	would produce a set of class files such as 'hamlet.class',
-	'hamlet$0.class', 'hamlet$1.class'.
-
-	Example 2:  Outputting all classes into a jar file.
-
-	example%  xsltc -j hamlet.jar hamlet.xsl
-
-	would produce a single jar file output, 'hamlet.jar' which would
-	contain all the generated .class files for the hamlet translet.
-
-	Example 3: Naming the class file.  
-
-	example%  xsltc -o newhamlet hamlet.xsl
-
-	would produce a set of class files such as 'newhamlet.class',
-	'newhamlet$0.class', etc rather than the default which would 
-	be 'hamlet.class', 'hamlet$0.class', etc.	
-
-	Example 4: Multiple stylesheets. 
-
-	example%  xsltc hamlet1.xsl hamlet2.xsl hamlet3.xsl
-
-	would produce a set of class files derived from the three
-	stylesheets. 
-
-	Example 5: Package Specification.
-
-	example% xsltc -p com.mycompany.translets hamlet.xsl
-
-	would produce a set of class files such as 
-	'com/mycompany/translets/hamlet.class',
-	'com/mycompany/translets/hamlet$0.class', etc.
-
-FILES
-	file.xsl		input XSLT stylesheet
-	file.class		byte code file
-	file.jar		java archive file
-	
-SEE ALSO
-	xslt, jar.
-
-BUGS
-	Refer to the top-level README included in this release.
-
-AUTHORS
-	Jacek Ambroziak,                       jacek.ambroziak@East.Sun.COM
-	Santiago Pericas-Geertsen,    santiago.pericasgeertsen@East.Sun.COM 
-
-	Contributors:
-
-	Morten Jorgensen		   morten.jorgensen@Ireland.Sun.COM
-	G. Todd Miller,                            todd.miller@East.Sun.COM
diff --git a/xdocs/sources/xsltc/README2 b/xdocs/sources/xsltc/README2
deleted file mode 100644
index c7cd61f..0000000
--- a/xdocs/sources/xsltc/README2
+++ /dev/null
@@ -1,86 +0,0 @@
-README.APACHE
-=====================================================================
-Entire source tree and support packages are located in the single jar
-file 'apache.jar'. 
-
-
-Installation
--------------
-
-(1) create directory [Root], unpack 'apache.jar' there.
-	ex) % cd /tmp; mkdir xsltc_apache 
-	    % cd xsltc_apache
-        copy apache.jar to xsltc_apache directory
-	    % jar xvf apache.jar 
-	cleanup
-	    % rm -rf META-INF apache.jar
-
-    Unpacking the jar file will result in the following tree:
-
-	[Root]
-	  External/
-	    BCEL/                ... contains BCEL.jar
-	    JLex/                ... contains JLex.jar
-	    java_cup/            ... contains java_cup.jar, runtime/runtime.jar
-	    xml-tr2/             ... contains xml.jar
-	  bin/
-	    xslt
-	    xsltc
-	  doc/
-	    api/                 ... contains javadoc for api
-	  src/
-	    GNUmakefile
-	    GNUmakefile.allinc
-	    docs/
-	      LICENSE.txt
-	      Message.txt
-	      README
-	      README.api
-	      README.xslt
-	      README.xsltc
-	      XSLTCprn_lg.txt*
-	      xsltcA3.txt
-	    org/
-	      apache/
-		xalan/
-		  xsltc/
-		     (src tree)  ... all the source code files
-
-
-    The 'src tree' is a hierarchy of the following packages:
-	org.apache.xalan.xsltc
-	org.apache.xalan.xsltc.compiler
-	org.apache.xalan.xsltc.compiler.util
-	org.apache.xalan.xsltc.dom
-	org.apache.xalan.xsltc.runtime
-	org.apache.xalan.xsltc.util
-	org.apache.xalan.xsltc.util.getopt
-
-
-(2) make bin programs executable
-	    % chmod +x bin/*
-
-(3) set env variable to point to top of directory [Root]
-	ex) % setenv XSLT /tmp/xsltc_apache
-
-(4) compile sources (uses gnu make and the provides 'GNUmakefile'). This
-    will create java classes in [Root]/classes, e.g. /tmp/xsltc_apache/classes.
-    (No need to set your CLASSPATH variable.)
-    
-	ex) % cd src; gmake again
-
-    Note: the 'again' target forces everything to be built from scratch,
-    including the java_cup source files. Subsequent builds can be done
-    using the 'classes' target. 
-
-(5) make the javadoc
-	ex) % gmake jdoc
-
-(6) add bin directory to your executable path, 
-	ex) % set path=($XSLT/bin $path)
-
-(7) test distribution, given a stylesheet (test.xsl) and an input xml doc
-    (test.xml), and be sure current working directory (.) is in your
-    CLASSPATH.
- 	% xsltc test.xsl		... creates translet, test.class
-	% xslt test.xml test		... runs translet on xml input	
diff --git a/xdocs/sources/xsltc/all_namespaces.gif b/xdocs/sources/xsltc/all_namespaces.gif
deleted file mode 100644
index 38034b7..0000000
--- a/xdocs/sources/xsltc/all_namespaces.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/cast_expression.gif b/xdocs/sources/xsltc/cast_expression.gif
deleted file mode 100644
index 9bb0090..0000000
--- a/xdocs/sources/xsltc/cast_expression.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/compiler_AST.gif b/xdocs/sources/xsltc/compiler_AST.gif
deleted file mode 100644
index 69871b6..0000000
--- a/xdocs/sources/xsltc/compiler_AST.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/compiler_DOM.gif b/xdocs/sources/xsltc/compiler_DOM.gif
deleted file mode 100644
index a056cbb..0000000
--- a/xdocs/sources/xsltc/compiler_DOM.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/compiler_architecture.gif b/xdocs/sources/xsltc/compiler_architecture.gif
deleted file mode 100644
index e57d661..0000000
--- a/xdocs/sources/xsltc/compiler_architecture.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/dom_namespace1.gif b/xdocs/sources/xsltc/dom_namespace1.gif
deleted file mode 100644
index 2b9418e..0000000
--- a/xdocs/sources/xsltc/dom_namespace1.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/dom_namespace2.gif b/xdocs/sources/xsltc/dom_namespace2.gif
deleted file mode 100644
index 7fce24d..0000000
--- a/xdocs/sources/xsltc/dom_namespace2.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/dom_namespace3.gif b/xdocs/sources/xsltc/dom_namespace3.gif
deleted file mode 100644
index d62b9b8..0000000
--- a/xdocs/sources/xsltc/dom_namespace3.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/index.xml b/xdocs/sources/xsltc/index.xml
deleted file mode 100644
index cbe1878..0000000
--- a/xdocs/sources/xsltc/index.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="Introduction to XSLTC">
-    <p><ref>Design documents by <jump href="mailto:morten@xml.apache.org">Morten J&oslash;rgensen</jump> 
-    - updated 06.03.2001</ref></p>
-<ul>
-  <li><link anchor="compiler">Compiler design</link></li>
-  <li><link anchor="runtime">Runtime library/DOM design</link></li>
-  <li><link idref="xsltc_trax">Integration of the Translet API and TrAX</link> (by G Todd Miller)</li> 
-   
-</ul>
-<p>See also <jump href="../xsltc_usage.html">Using XSLTC</jump>.</p>
-<anchor name="compiler"/>
- <s2 title="Compiler design">
-  <p><link idref="xsltc_compiler"><img src="compiler_architecture.gif" alt="compiler_architecture.gif"/></link></p>
-  <p><ref>Figure 1: Compiler architecture overview</ref></p>
-  <p>Click on the picture to jump to the overall design document for the compiler.</p>
-    <p>Each XSL element/function and XPath expression/pattern is represented by
-  its own class in the Abstract Syntax Tree (AST). Some of these classes have
-  their own design documents (I am working on the rest of them):</p>
-    <s3 title="XSL elements">
-        <ul>
-          <li>
-            <link idref="xsl_whitespace_design">&lt;xsl:preserve-space&gt;/&lt;xsl:strip-space&gt;</link>
-          </li>
-          <li>
-            <link idref="xsl_sort_design">&lt;xsl:sort&gt;</link>
-          </li>
-          <li>
-            <link idref="xsl_key_design">&lt;xsl:key&gt;</link>
-          </li>
-          <li>
-            <link idref="xsl_comment_design">&lt;xsl:comment&gt;/&lt;xsl:message&gt;</link>
-          </li>
-        </ul>
-        </s3>
-        <s3 title="XSL functions">
-        <ul>
-          <li>
-            <link idref="xsl_key_design">key()</link>
-          </li>
-          <li>
-            <link idref="xsl_lang_design">lang()</link>
-          </li>
-          <li>
-            <link idref="xsl_unparsed_design">unparsed-entity-uri()</link>
-          </li>
-        </ul>
-  </s3>
-  </s2><anchor name="runtime"/>
-  <s2 title="Runtime library/DOM design">
-  <p><link idref="xsltc_runtime"><img src="runtime_architecture.gif" alt="runtime_architecture.gif"/></link></p>
-  <p><ref>Figure 2: Runtime library architecture overview</ref></p>
-  <p>Click on the picture to jump to the overall design document for the XSLTC
-  runtime library. This document describes the structure of the compiled
-  translet as well as the translet runtime library.</p> 
-  <p>The <link idref="xsltc_dom">Internal DOM</link> describes the components and structure of the internal DOM,
-   support for DOM2 navigation, the DOM adapter, DOM multiplexer, and DOM builder.</p>
-    <p><link idref="xsltc_namespace">Namespaces</link> explains how XSLTC (including the compiler) handles
-     namespaces.</p>   
-  </s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xsltc/key_relations.gif b/xdocs/sources/xsltc/key_relations.gif
deleted file mode 100644
index 946d4dc..0000000
--- a/xdocs/sources/xsltc/key_relations.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/match_namespace1.gif b/xdocs/sources/xsltc/match_namespace1.gif
deleted file mode 100644
index 4d0056d..0000000
--- a/xdocs/sources/xsltc/match_namespace1.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/match_namespace2.gif b/xdocs/sources/xsltc/match_namespace2.gif
deleted file mode 100644
index db10277..0000000
--- a/xdocs/sources/xsltc/match_namespace2.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/namespace_stack.gif b/xdocs/sources/xsltc/namespace_stack.gif
deleted file mode 100644
index a469d23..0000000
--- a/xdocs/sources/xsltc/namespace_stack.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/output_namespaces1.gif b/xdocs/sources/xsltc/output_namespaces1.gif
deleted file mode 100644
index 5068fc2..0000000
--- a/xdocs/sources/xsltc/output_namespaces1.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/output_namespaces2.gif b/xdocs/sources/xsltc/output_namespaces2.gif
deleted file mode 100644
index aaf7cf7..0000000
--- a/xdocs/sources/xsltc/output_namespaces2.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/pattern_objects.gif b/xdocs/sources/xsltc/pattern_objects.gif
deleted file mode 100644
index ea07393..0000000
--- a/xdocs/sources/xsltc/pattern_objects.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/runtime_architecture.gif b/xdocs/sources/xsltc/runtime_architecture.gif
deleted file mode 100644
index 9c8e2e7..0000000
--- a/xdocs/sources/xsltc/runtime_architecture.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/runtime_type_mapping.gif b/xdocs/sources/xsltc/runtime_type_mapping.gif
deleted file mode 100644
index 769a993..0000000
--- a/xdocs/sources/xsltc/runtime_type_mapping.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/sort_objects.gif b/xdocs/sources/xsltc/sort_objects.gif
deleted file mode 100644
index 0ec7cbb..0000000
--- a/xdocs/sources/xsltc/sort_objects.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/type_mapping.gif b/xdocs/sources/xsltc/type_mapping.gif
deleted file mode 100644
index bb3cbb9..0000000
--- a/xdocs/sources/xsltc/type_mapping.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/type_mappings.gif b/xdocs/sources/xsltc/type_mappings.gif
deleted file mode 100644
index 31f888c..0000000
--- a/xdocs/sources/xsltc/type_mappings.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/typecast.gif b/xdocs/sources/xsltc/typecast.gif
deleted file mode 100644
index 2a9c168..0000000
--- a/xdocs/sources/xsltc/typecast.gif
+++ /dev/null
Binary files differ
diff --git a/xdocs/sources/xsltc/xsl_comment_design.xml b/xdocs/sources/xsltc/xsl_comment_design.xml
deleted file mode 100644
index fcc0fef..0000000
--- a/xdocs/sources/xsltc/xsl_comment_design.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="&lt;xsl:comment&gt; / &lt;xsl:message&gt;">
-  <ul>
-  <li><link anchor="functionality">Functionality</link></li>
-  <li><link anchor="implementation">Implementation</link></li>  
-  </ul>
-<anchor name="functionality"/>
-<s2 title="Functionality">
-
-  <p>The <code>&lt;xsl:comment&gt;</code> element is used to insert XML comments
-  into the result document. The comment is inserted as follows in the XSL
-  stylesheet:</p>
-
-  <source>    &lt;element&gt;
-      &lt;xsl:comment&gt;This is a comment!&lt;/xsl:comment&gt;
-    &lt;/element&gt;</source>
-
-  <p>and it will be output in the result document as follows:</p>
-
-  <source>    &lt;element&gt;
-      &lt;!-- This is a comment! --&gt;
-    &lt;/element&gt;</source>
-
-  <p>The <code>&lt;xsl:message&gt;</code> element is used to send messages to
-  who/whatever is performing the transformation. The message can be displayed
-  in a terminal, a dialog box, etc. The  <code>&lt;xsl:message&gt;</code> element
-  is used in the same way as the <code>&lt;xsl:comment&gt;</code> element,
-  however the message is <em>not</em> output in the result document.</p>
-
-  <p>The <code>&lt;xsl:message&gt;</code> element has an attribute
-  <code>"terminate"</code> which can be used to terminate the transformation at any
-  given stage. This is useful when using message to give information about
-  illegal values in the input document.</p>
-</s2><anchor name="implementation"/>
-<s2 title="Implementation">
-
-  <p>The output handler class has a method for outputting comments in the
-  output document and messages to the operator. The code compiled for a
-  comment gathers all text that goes into the comment in a StringValueHandler
-  object, retrieves the full text string from this handler, and then finally
-  sends it to the output handler. Similarly the code compiled for a message
-  will simply send the message to the output handler in use.</p>
-
-  <p>Messages will be output to the terminal (stdout) when a transformation
-  is run in a terminal. The message will be output before the beginning of the
-  output document. Messages will be shown in a dialog box if a transformation
-  is run in an applet.</p>
-
-  <p><code>&lt;xsl:message&gt;</code> elements that use the <code>"terminate"</code>
-  attribute to abort transformations cause an exception to be thrown. A
-  RuntimeException is used for this, and the exception text is:</p>
-  <p><code>Termination forced by an xsl:message instruction</code></p>
-  </s2>
-</s1>  
\ No newline at end of file
diff --git a/xdocs/sources/xsltc/xsl_key_design.xml b/xdocs/sources/xsltc/xsl_key_design.xml
deleted file mode 100644
index aa137f6..0000000
--- a/xdocs/sources/xsltc/xsl_key_design.xml
+++ /dev/null
@@ -1,214 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="&lt;xsl:key&gt; / key() / KeyPattern">
-  <ul>
-    <li><link anchor="functionality">Functionality</link></li>
-    <li><link anchor="implementation">Implementation</link></li>    
-  </ul>
-  <anchor name="functionality"/>
-  <s2 title="Functionality">
-
-  <p>The <code>&lt;xsl:key&gt;</code> element is a top-level element that can be
-  used to define a named index of nodes from the source XML tree(s). The
-  element has three attributes:</p>
-
-  <ul>
-    <li>
-      <code>name</code> - the name of the index
-    </li>
-    <li>
-      <code>match</code> - a pattern that defines the nodeset we want
-      indexed
-    </li>
-    <li>
-      <code>use</code> - an expression that defines the value to be used
-      as the index key value.
-    </li>
-  </ul>
-
-  <p>A named index can be accessed using either the <code>key()</code> function or
-  a KeyPattern. Both these methods address the index using its defined name
-  (the "name" attribute above) and a parameter defining one or more lookup
-  values for the index. The function or pattern returns a node set containing
-  all nodes in the index whose key value match the parameter's value(s):</p>
-
-  <source>
-    &lt;xsl:key name="book-author" match="book" use="author"/&gt;
-    :
-    :
-    &lt;xsl:for-each select="key('book-author', 'Mikhail Bulgakov')"&gt;
-      &lt;xsl:value-of select="author"/&gt;
-      &lt;xsl:text&gt;: &lt;/xsl:text&gt;
-      &lt;xsl:value-of select="author"/&gt;
-      &lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;
-    &lt;/xsl:for-each&gt;
-  </source>
-
-  <p>The KeyPattern can be used within an index definition to create unions
-  and intersections of node sets:</p>
-
-<source>
-    &lt;xsl:key name="cultcies" match="farmer | fisherman" use="name"/&gt;
-</source>
-
-  <p>This could of course be done using regular <code>&lt;xsl:for-each&gt;</code>
-  and <code>&lt;xsl:select&gt;</code> elements. However, if your stylesheet
-  accesses the same selection of nodes over and over again, the transformation
-  will be much more efficient using pre-indexed keys as shown above.</p>
- </s2><anchor name="implementation"/>
- <s2 title="Implementation">
-
-  <p>AbstractTranslet has a global hashtable that holds an index for each named
-  key in the stylesheet (hashing on the "name" attribute of xsl:key).
-  AbstractTranslet has a couple of public methods for inserting and retrieving
-  data from this hashtable:</p>
-
-<source>
-    public void buildKeyIndex(String name, int nodeID, String value);
-    public KeyIndex KeyIndex getKeyIndex(String name);
-</source>
-
-  <p>The Key class compiles code that traverses the input DOM and extracts
-  nodes that match some given parameters (the <code>"match"</code> attribute of the
-  <code>&lt;xsl:key&gt;</code> element). A new element is inserted into the named
-  key's index. The nodes' DOM index and the value translated from the 
-  <code>"use"</code> attribute of the <code>&lt;xsl:key&gt;</code> element are stored
-  in the new entry in the index.</p>
-
-  <p>The index itself is implemented in the <code>KeyIndex</code> class.
-  The index has an hashtable with all the values from the matching nodes (the
-  part of the node used to generate this value is the one specified in the
-  <code>"use"</code> attribute). For every matching value there is a Vector
-  holding a list of all node indexes for which this value gives a match:</p>
-
-  <p><img src="key_relations.gif" alt="key_relations.gif"/></p>
-  <p><ref>Figure 1: Indexing tables</ref></p>
-
-  <p>The <code>KeyIndex</code> class implements the <code>NodeIterator</code>
-  interface, so that it can be returned directly by the implementation of the
-  <code>key()</code> function. This is how the index generated by
-  <code>&lt;xsl:key&gt;</code> and the node-set returned by the <code>key()</code> and
-  KeyPattern are tied together. You can see how this is done in the
-  <code>translate()</code> method of the <code>KeyCall</code> class.</p>
-
-  <p>The <code>key()</code> function can be called in two ways:</p>
-
-<source>
-    key('key-name','value')
-    key('key-name','node-set')
-</source>
-
-  <p>The first parameter is always the name of the key. We use this value to
-  lookup our index from the _keyIndexes hashtable in AbstractTranslet:</p>
-
-<source>
-    il.append(classGen.aloadThis());
-    _name.translate(classGen, methodGen);
-    il.append(new INVOKEVIRTUAL(getKeyIndex));
-</source>
-
-  <p>This compiles into a call to
-  <code>AbstractTranslet.getKeyIndex(String name)</code>, and it leaves a
-  <code>KeyIndex</code> object on the stack. What we then need to do it to
-  initialise the <code>KeyIndex</code> to give us nodes with the requested value.
-  This is done by leaving the <code>KeyIndex</code> object on the stack and pushing
-  the <code>"value"</code> parameter to <code>key()</code>, before calling
-  <code>lookup()</code> on the index:</p>
-
-<source>
-    il.append(DUP);  // duplicate the KeyIndex obejct before return
-    _value.translate(classGen, methodGen);
-    il.append(new INVOKEVIRTUAL(lookup));
-</source>
-
-  <p>This compiles into a call to <code>KeyIndex.lookup(String value)</code>. This
-  will initialise the <code>KeyIndex</code> object to return nodes that match the
-  given value, so the <code>KeyIndex</code> object can be left on the stack when
-  we return. This because the <code>KeyIndex</code> object implements the
-  <code>NodeIterator</code> interface.</p>
-
-  <p>This matter is a bit more complex when the second parameter of
-  <code>key()</code> is a node-set. In this case we need to traverse the nodes in
-  the set and do a lookup for each node in the set. What I do is this:</p>
-
-  <ul>
-    <li>
-      construct a <code>KeyIndex</code> object that will hold the return node-set
-    </li>
-    <li>
-      find the named <code>KeyIndex</code> object from the hashtable in
-      AbstractTranslet
-    </li>
-    <li>
-      get an iterator for the node-set and do the folowing loop:</li>
-      <ul>
-        <li>get string value for current node</li>
-        <li>do lookup in KeyIndex object for the named index</li>
-        <li>merge the resulting node-set into the return node-set</li>
-      </ul>
-    <li>
-      leave the return node-set on stack when done
-    </li>
-  </ul>
-
-  <p>The only work that remains is to update the <code>merge()</code> method of
-  the <code>KeyIndex</code> class so that it eliminates duplicate nodes in the
-  resulting node-set.</p>
-  </s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsl_lang_design.xml b/xdocs/sources/xsltc/xsl_lang_design.xml
deleted file mode 100644
index b8c0bf0..0000000
--- a/xdocs/sources/xsltc/xsl_lang_design.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="lang() function">
-  <ul>
-    <li><link anchor="functionality">Functionality</link></li>
-    <li><link anchor="implementation">Implementation</link></li>    
-  </ul>
-  <anchor name="functionality"/>
-  <s2 title="Functionality">
-
-  <p>The <code>xml:lang</code> can be used to determine the language for a node or
-  a node-set. The attribute can be used to store language-specific data in an
-  XML document:</p>
-
-  <source>
-    &lt;phrases&gt;
-      &lt;greeting xml:lang="en"&gt;Hello!&lt;/greeting&gt;
-      &lt;greeting xml:lang="no"&gt;Hei!&lt;/greeting&gt;
-      &lt;greeting xml:lang="fr"&gt;Salut!&lt;/greeting&gt;
-      &lt;greeting xml:lang="es"&gt;Hola!&lt;/greeting&gt;
-      &lt;greeting xml:lang="de"&gt;Sweinhund!&lt;/greeting&gt;
-    &lt;/phrases&gt;
-  </source>
-
-  <p>The XSL stylesheet can use the <code>lang()</code> function to select the
-  element with the desired language:</p>
-
-  <source>
-    &lt;xsl:template match="greeting"&gt;
-      &lt;xsl:if test="lang("de")&gt;
-        &lt;xsl:value-of select="."/&gt;
-        &lt;xsl:text&gt; Grossglucklicher wunche!&lt;/xsl:text&gt;
-      &lt;/xsl:if&gt;
-    &lt;/xsl:template&gt;
-  </source>
-</s2> <anchor name="implementation"/>
-<s2 title="Implementation">
-
-  <p>The DOM interface has been given a method that returns the language for
-  a given node. The language is returned as a string (on whatever format is
-  used in the XML document - should be iso), and may be null if no language is
-  defined.</p>
-
-  <source>
-    public String DOM.getLanguage(int node);
-  </source>
-
-  <p>The BasisLibrary class has a static method that will compare the language
-  of the context node with some other language and return the result as a
-  boolean.</p>
-
-  <source>
-    public static boolean BasisLibrary.testLanguage(String language, DOM dom, int node);
-  </source>
-
-  <p>The compiled code for the <code>lang()</code> method calls this method in the
-  BasisLibrary and leaves the result on the stack for the calling element.</p>
-  </s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsl_sort_design.xml b/xdocs/sources/xsltc/xsl_sort_design.xml
deleted file mode 100644
index 6dda3a4..0000000
--- a/xdocs/sources/xsltc/xsl_sort_design.xml
+++ /dev/null
@@ -1,211 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="&lt;xsl:sort&gt;">
-  <ul>
-    <li><link anchor="functionality">Functionality</link></li>
-    <li><link anchor="sort-class">The Sort class</link></li>
-    <li><link anchor="sortingiterator-class">The SortingIterator class</link></li>
-    <li><link anchor="nodesortrecord-class">The NodeSortRecord class</link></li>    
-    <li><link anchor="nodesortrecordfactory-class">The NodeSortRecordFactory class</link></li>
-  </ul>
-  
-  <anchor name="functionality"/>
-  <s2 title="Functionality">
-
-  <p>The <code>&lt;xsl:sort&gt;</code> element is used to define a sort key which
-  specifies the order in which nodes selected by either
-  <code>&lt;xsl:apply-templates&gt;</code> or <code>&lt;xsl:for-each&gt;</code> are
-  processed. The nodes can be sorted either in numerical or alphabetic order,
-  and the alphabetic order may vary depeinding on the language in use. The
-  nodes can be sorted either in ascending or descending order.</p>
-
-  </s2><anchor name="sort-class"/>
-  <s2 title="The Sort class">
-
-  <p>Static methods of the Sort class is responsible for generating the
-  necessary code for invoking SortingIterators under
-  <code>&lt;xsl:apply-templates&gt;</code> and <code>&lt;xsl:for-each&gt;</code>
-  elements. Both these elements can have several <code>&lt;xsl:sort&gt;</code>
-  child nodes defining primary, secondary, teriary, etc. keys. The code for
-  <code>&lt;xsl:apply-templates&gt;</code> and <code>&lt;xsl:for-each&gt;</code>
-  create  vectors containg a Sort object for each sort key. The object methods
-  of the Sort object encapsulate a container for key-specific data (such as the
-  sort key itself, sort order, sort type, and such) while the static methods
-  take a vector of Sort objects and generate the actual code.</p>
-
-  <p>The <code>translate()</code> method of the Sort object is never called. The
-  vectors containing the Sort objects for a <code>&lt;xsl:apply-templates&gt;</code>
-  or <code>&lt;xsl:for-each&gt;</code> element are instead passed to the static
-  <code>translateSortIterator()</code> method. This method compiles code that
-  instanciates a SortingIterator object that will pass on a node-set in a
-  specific order to the code handling the <code>&lt;xsl:apply-templates&gt;</code>
-  or <code>&lt;xsl:for-each&gt;</code> element.</p>
-
-  </s2><anchor name="sortingiterator-class"/>
-  <s2 title="The SortingIterator class">
-
-  <p>The SortingIterator class is responsible for sorting nodes encapsulated in
-  sort obects. These sort objects must be of a class inheriting from
-  NodeSortRecord, a the SortingIterator object needs a factory object providing
-  it with the correct type of objects:</p>
-
-  <p><img src="sort_objects.gif" alt="sort_objects.gif"/></p>
-  <p><ref>Figure 1: SortingIterator</ref></p>
-
-  <p>The SortingIterator class is fairly dumb and leaves much of the work to the
-  NodeSortRecord class. The iterator gets the NodeSortRecords from the factory
-  object and sorts them using quicksort and calling <code>compareTo()</code> on
-  pairs of NodeSortRecord objects.</p>
-
-  </s2><anchor name="nodesortrecord-class"/>
-  <s2 title="The NodeSortRecord class">
-
-  <p>The static methods in the Sort class generates a class inheriting from
-  NodeSortRecord, with the following overloaded methods:</p>
-
-  <ul>
-    <li><em>Class Constructor</em></li>
-      <ul><li>The class constructor is overloaded to create sort-key global
-      tables, such as an array containing the sort order for all the sort keys
-      and another array containg all the sort types. Different sort order/types
-      can be specified for the different levels of sort keys, but we assume that
-      the same language is used for all levels.</li></ul>
-      
-    <li><code>extractValueFromDOM(int level)</code></li>
-      <ul><li>This method is called by the SortingIterator object to extract the
-      value for a specific sort key for a node. The SortingIterator will only
-      use this method once and will cache the returned value for later use. The
-      method will only be called if absultely necessary.</li></ul>
-
-    <li><code>compareType(int level)</code></li>
-      <ul><li>This method returns the sort type for one sort key level. Returns
-      either <code>COMPARE_STRING</code> or <code>COMPARE_NUMERIC</code>.</li></ul>
-    
-    <li><code>sortOrder(int level)</code></li>
-      <ul><li>This method returns the sort order for one sort key level. Returns
-      either <code>COMPARE_ASCENDING</code> or <code>COMPARE_DESCENDING</code></li></ul>
-    
-    <li><code>getCollator(int level)</code></li>
-      <ul><li>This method returns a Collator object for language-specific
-      string comparisons. The same Collator is used for all levels of the key.
-      </li></ul> 
-  </ul>
-
-  <p>The <code>compareTo()</code> method of the NodeSortRecord base class deserves
-  a bit of attention. It takes its own node (from the this pointer) and another
-  node and compares, if necessary, the values for all sort keys:</p>
-
-  <source>
-    /**
-     * Compare this sort element to another. The first level is checked first,
-     * and we proceed to the next level only if the first level keys are
-     * identical (and so the key values may not even be extracted from the DOM)
-     */
-    public int compareTo(NodeSortRecord other) {
-	int cmp;
-    
-	for (int level=0; level&lt;_levels; level++) {
-	    
-	    // Compare the two nodes either as numeric or text values
-	    if (compareType(level) == COMPARE_NUMERIC) {
-		final Double our = numericValue(level);
-		final Double their = other.numericValue(level);
-		if (our == null) return(-1);
-		if (their == null) return(1);
-		cmp = our.compareTo(their);
-	    }
-	    else {
-		String our = stringValue(level);
-		String their = other.stringValue(level);
-		if (our == null) return(-1);
-		if (their == null) return(1);
-		cmp = getCollator().compare(our,their);
-	    }
-	    
-	    // Return inverse compare value if inverse sort order
-	    if (cmp != 0) {
-		if (sortOrder(level) == COMPARE_DESCENDING)
-		    return(0 - cmp);
-		else
-		    return(cmp);
-	    }
-	    
-	}
-	return(0);
-    }
-  </source>
-
-  <p>The two methods <code>stringValue(int level)</code> and 
-  <code>numericValue(int level)</code> return values for one level of the sort key
-  of a node. These methods cache these values after they are first read so that
-  the <code>DOM.getNodeValue()</code> is only called once. Also, the algorithm
-  used for these two methods assure that <code>DOM.getNodeValue()</code> is only
-  called when needed. The value for a node's secondary sort key is never
-  retrieved if the node can be uniquely identified by its primary key.</p>
-
-  </s2><anchor name="nodesortrecordfactory-class"/>
-  <s2 title="The NodeSortRecordFactory class">
-
-  <p>After the static methods of the Sort class has generated the new class for
-  sort objects it generates code that instanciates a new NodeSortRecordFactory
-  object. This object is passed as a parameter to SortingIterators constructor
-  and is used by the iterator to generate the necessary sort objects.</p>
-
-  </s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsl_unparsed_design.xml b/xdocs/sources/xsltc/xsl_unparsed_design.xml
deleted file mode 100644
index c74d749..0000000
--- a/xdocs/sources/xsltc/xsl_unparsed_design.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="unparsed-entity-uri()">
-  <ul>
-    <li><link anchor="functionality">Functionality</link></li>
-    <li><link anchor="implementation">Implementation</link></li>
-  </ul>
-  
-  <anchor name="functionality"/>
-  <s2 title="Functionality">
-
-
-  <p>The <code>unparsed-entity-uri()</code> function gives access to declarations
-  of unparsed entities in the DTD of the source document. If the DTD contains
-  the declaration:</p>
-
-  <source>
-    &lt;!ENTITY mom-picture SYSTEM "http://www.home.com/mom.jpg" NDATA JPEG&gt;
-  </source>
-
-  <p>the expression <code>unparsed-entity-uri('mom-picture')</code> returns an
-  URI for the file <code>mom.jpg</code>.</p>
-
-  </s2><anchor name="implementation"/>
-  <s2 title="Implementation">
-
-  <p>Unparsed entities must be gathered from the XML input document at the time
-  when the DOM is built. To achieve this our parser must parse the document DTD
-  (if any) and store all data of type NDATA (not XML data) in a
-  hashtable in the AbstractTranslet object. All the compiled code for this
-  function needs to do is call a method in the translet for retrieving the
-  value for the requested element:</p>
-
-  <source>
-    public String AbstractTranslet.getUnparsedEntity(String entityName);
-  </source>
-
-  <p>The translet will use the supplied <code>entityName</code> to look up the
-  value in the hashtable and then leave the string value on the stack for the
-  element that called <code>lang()</code>.</p>
-  </s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsl_whitespace_design.xml b/xdocs/sources/xsltc/xsl_whitespace_design.xml
deleted file mode 100644
index 83b29db..0000000
--- a/xdocs/sources/xsltc/xsl_whitespace_design.xml
+++ /dev/null
@@ -1,342 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="&lt;xsl:strip/preserve-space&gt;">
-  <ul>
-    <li><link anchor="functionality">Functionality</link></li>
-    <li><link anchor="identify">Identifying strippable whitespace nodes</link></li>
-    <li><link anchor="which">Determining which nodes to strip</link></li>
-    <li><link anchor="strip">Stripping nodes</link></li>
-    <li><link anchor="filter">Filtering whitespace nodes</link></li>
-  </ul>
-  
-  <anchor name="functionality"/>
-  <s2 title="Functionality">
-
-  <p>The <code>&lt;xsl:strip-space&gt;</code> and <code>&lt;xsl:preserve-space&gt;</code>
-  elements are used to control the way whitespace nodes in the source XML
-  document are handled. These elements have no impact on whitespace in the XSLT
-  stylesheet. Both elements can occur only as top-level elements, possible more
-  than once, and the elements are always empty</p>
- 
-  <p>Both elements take one attribute &quot;elements&quot; which contains a
-  whitespace separated list of named nodes which should be or preserved
-  stripped from the source document. These names can be on one of these three
-  formats (NameTest format):</p>
-
-  <ul>
-    <li>
-      All whitespace nodes:
-      <code>elements=&quot;*&quot;</code>
-    </li>
-    <li>
-      All whitespace nodes with a namespace:
-      <code>elements=&quot;&lt;namespace&gt;:*&quot;</code>
-    </li>
-    <li>
-      Specific whitespace nodes: <code>elements=&quot;&lt;qname&gt;&quot;</code>
-    </li>
-  </ul>
-
-  </s2><anchor name="identify"/>
-  <s2 title="Identifying strippable whitespace nodes">
-
-  <p>The DOM detects all text nodes and assigns them the type <code>TEXT</code>.
-  All text nodes are scanned to detect whitespace-only nodes. A text-node is
-  considered a whitespace node only if it consist entirely of characters from
-  the set { 0x09, 0x0a, 0x0d, 0x20 }. The DOM implementation class has a static
-  method used to detect such nodes:</p>
-
-<source>
-    private static final boolean isWhitespaceChar(char c) {
-        return c == 0x20 || c == 0x0A || c == 0x0D || c == 0x09;
-    }
-</source>
-
-  <p>The characters are checked in probable order.</p>
-
-  <p> The DOM has a bit-array that is used to  tag text-nodes as strippable
-  whitespace nodes:</p>
-
-  <source>private int[] _whitespace;</source>
-
-  <p>There are two methods in the DOM implementation class for accessing this
-  bit-array: <code>markWhitespace(node)</code> and <code>isWhitespace(node)</code>.
-  The array is resized together with all other arrays in the DOM by the
-  <code>DOM.resizeArrays()</code> method. The bits in the array are set in the
-  <code>DOM.maybeCreateTextNode()</code> method. This method must know whether
-  the current node is a located under an element with an
-  <code>xml:space=&quot;&lt;value&gt;&quot;</code> attribute in the DOM, in which
-  case it is not a strippable whitespace node.</p>
-
-  <p>An auxillary class, WhitespaceHandler, is used for this purpose. The class
-  works in a way as a stack, where you "push" a new strip/preserve setting
-  together with the node in which this setting was determined. This means that
-  for every time the DOM builder encounters an <code>xml:space</code> attribute
-  it will invoke a method on an instance of the WhitespaceHandler class to
-  signal that a new preserve/strip setting has been encountered. This is done
-  in the <code>makeAttributeNode()</code> method. The whitespace handler stores the
-  new setting and pushes the current element node on its stack. When the
-  DOM builder closes up an element (in <code>endElement()</code>), it invokes
-  another method of the whitespace handler to check if the strip/preserve
-  setting is still valid. If the setting is now invalid (we're closing the
-  element whose node id is on the top of the stack) the handler inverts the
-  setting and pops the element node id off the stack. The previous
-  strip/preserve setting is then valid, and the id of node where this setting
-  was defined is on the top of the stack.</p>
-
-  </s2><anchor name="which"/>
-  <s2 title="Determining which nodes to strip">
-
-  <p>A text node is never stripped unless it contains only whitespace
-  characters (Unicode characters 0x09, 0x0A, 0x0D and 0x20). Stripping a text
-  node means that the node disappears from the DOM; so that it is never
-  included in the output and that it is ignored by all functions such as
-  <code>count()</code>. A text node is preserved if any of the following apply:</p>
-
-  <ul>
-    <li>
-      the element name of the parent of the text node is in the set of
-      elements listed in <code>&lt;xsl:preserve-space&gt;</code>
-    </li>
-    <li>
-      the text node contains at least one non-whitespace character
-    </li>
-    <li>
-      an ancenstor of the whitespace text node has an attribute of
-      <code>xsl:space=&quot;preserve&quot;</code>, and no close ancestor has and
-      attribute of <code>xsl:space=&quot;default&quot;</code>.
-    </li>
-  </ul>
-
-  <p>Otherwise, the text node is stripped. Initially the set of 
-  whitespace-preserving element names contains all element names, so the
-  default behaviour is to preserve all whitespace text nodes.</p>
-
-  <p>This seems simple enough, but resolving conflicts between matching
-  <code>&lt;xsl:strip-space&gt;</code> and <code>&lt;xsl:preserve-space&gt;</code>
-  elements requires a lot of thought. Our first consideration is import
-  precedence; the match with the highest import precedence is always chosen.
-  Import precedence is determined by the order in which the compared elements
-  are visited. (In this case those elements are the top-level
-  <code>&lt;xsl:strip-space&gt;</code> and <code>&lt;xsl:preserve-space&gt;</code>
-  elements.) This example is taken from the XSLT recommendation:</p>
-
-  <ul>
-    <li>stylesheet A imports stylesheets B and C in that order;</li>
-    <li>stylesheet B imports stylesheet D;</li>
-    <li>stylesheet C imports stylesheet E.</li>
-  </ul>
-
-  <p>Then the order of import precedence (lowest first) is D, B, E, C, A.</p>
-
-  <p>Our next consideration is the priority of NameTests (XPath spec):</p>
-  <ul>
-    <li>
-      <code>elements=&quot;&lt;qname&gt;&quot;</code> has priority 0
-    </li>
-    <li>
-      <code>elements=&quot;&lt;namespace&gt;:*&quot;</code> has priority -0.25
-    </li>
-    <li>
-      <code>elements=&quot;*&quot;</code> has priority -0.5
-    </li>
-  </ul>
-
-  <p>It is considered an error if the desicion is still ambiguous after this,
-  and it is up to the implementors to decide what the apropriate action is.</p>
-
-  <p>With all this complexity, the normal usage for these elements is quite
-  smiple; either preserve all whitespace nodes but one type:</p>
-
-  <source>&lt;xsl:strip-space elements="foo"/&gt;</source>
-
-  <p>or strip all whitespace nodes but one type:</p>
-
-  <source>
-    &lt;xsl:strip-space elements="*"/&gt;
-    &lt;xsl:preserve-space elements="foo"/&gt;</source>
-
-  </s2><anchor name="strip"/>
-  <s2 title="Stripping nodes">
-
-  <p>The ultimate goal of our design would be to totally screen all stripped
-  nodes from the translet; to either physically remove them from the DOM or to
-  make it appear as if they are not there. The first approach will cause
-  problems in cases where multiple translets access the same DOM. In the future
-  we wish to let translets run within servlets / JSPs with a common DOM cache.
-  This DOM cache will keep copies of DOMs in memory to prevent the same XML
-  file from being downloaded and parsed several times. This is a scenarios we
-  might see:</p>
-
-    <p><img src="DOMInterface.gif" alt="DOMInterface.gif"/></p>
-    <p><ref>Figure 1: Multiple translets accessing a common pool of DOMs</ref></p>
-
-  <p>The three translets running on this host access a common pool of 4 DOMs.
-  The DOMs are accessed through a common DOM interface. Translets accessing
-  a single DOM will have a DOMAdapter and a single DOMImpl object behind this
-  interface, while translets accessing several DOMs will be given a MultiDOM
-  and a set of DOMImpl objects.</p>
-
-  <p>The translet to the left may want to strip some nodes from the shared DOM
-  in the cache, while the other translets may want to preserve all whitespace
-  nodes. Our initial thought then is to keep the DOM as it is and somehow
-  screen the left-hand translet of all the whitespace nodes it does not want to
-  process. There are a few ways in which we can accomplish this:</p>
-
-  <ul>
-    <li>
-      The translet can, prior to starting to traverse the DOM, send a reference
-      to the tables containing information on which nodes we want stripped to
-      the DOM interface. The DOM interface is then responsible for hiding all
-      stripped whitespace nodes from the iterators and the translet. A problem
-      with this approach is that we want to omit the DOM interface layer if
-      the translet is only accessing a single DOM. The DOM interface layer will
-      only be instanciated by the translet if the stylesheet contained a call
-      to the <code>document()</code> function.<br/><br/>
-    </li>
-    <li>
-      The translet can provide its iterators with information on which nodes it
-      does not want to see. The translet is still shielded from unwanted
-      whitespace nodes, but it has the hassle of passing extra information over
-      to most iterators it ever instanciates. Note that all iterators do not
-      need be aware of whitepspace nodes in this case. If you have a look at
-      the figure again you will see that only the first level iterator (that is
-      the one closest to the DOM or DOM interface) will have to strip off
-      whitespace nodes. But, there may be several iterators that operate
-      directly on the DOM ( invoked by code handling XSL functions such as
-      <code>count()</code>) and every single one of those will need to be told
-      which whitespace nodes the translet does not want to see.<br/><br/>
-    </li>
-    <li>
-      The third approach will take advantage of the fact that not all
-      translets will want to strip whitespace nodes. The most effective way of
-      removing unwanted whitespace nodes is to do it once and for all, before
-      the actual traversal of the DOM starts. This can be done by making a
-      clone of the DOM with exlusive-access rights for this translet only. We
-      still gain performance from the cache because we do not have to pay the
-      cost of the delay caused by downloading and parsing the XML source file.
-      The cost we have to pay is the time needed for the actual cloning and the
-      extra memory we use.<br/><br/>
-      Normally one would imagine the translet (or the wrapper class that
-      invokes the translet) calls the DOM cache with just an URL and receives
-      a reference to an instanciated DOM. The cache will either have built
-      this DOM on-demand or just passed back a reference to an existing tree.
-      In this case the DOM would need an extra call that a translet would use
-      to clone a DOM, passing the existing DOM reference to the cache and
-      recieving a new reference to the cloned DOM. The translet can then do
-      whatever it wants with this DOM (the cache need not even keep a reference
-      to this tree).
-    </li>
-  </ul>
-  
-  <p>We are lucky enough to be able to combine the first two approaches. All
-  iterators that directly access the DOM (axis iterators) are instanciated by
-  calls to the DOM interface layer (the DOM class). The actual iterators are
-  created in the DOM implementation layer (the DOMImpl class). So, we can pass
-  references to the preserve/strip whitespace tables to the DOM, and the DOM
-  will make sure that all axis iterators return node sets with respect to these
-  tables.</p>
-  </s2><anchor name="filter"/> 
-  <s2 title="Filtering whitespace nodes">
-
-  <p>For each axis iterator and for <code>DOM.makeStringValue()</code> and
-  <code>DOM.stringValueAux()</code> we must apply a filter for eliminating all
-  unwanted whitespace nodes. To achive this we must build a very efficient
-  predicate for determining if the current node should be stripped or not. This
-  predicate is built by <code>Whitespace.compilePredicate()</code>. This method is
-  static and builds a predicate for a vector of WhitespaceRule objects. (The
-  WhitespaceRule class is defined within the Whitespace class.) Each
-  WhitespaceRule object contains information for a single element listed
-  in an <code>&lt;xsl:strip/preserve-space&gt;</code> element, and is broken down
-  into the following information:</p>
-
-  <ul>
-    <li>the namespace (can be the default namespace)</li>
-    <li>the element name or "<code>*</code>"</li>
-    <li>the type of rule; NS:EL, NS:<code>*</code> or <code>*</code></li>
-    <li>the priority of the rule (based on import precedence and type)</li>
-    <li>the action; either strip or preserver</li>
-  </ul>
-
-  <p>The Vector of WhitespaceRules is arranged in order of priority and
-  redundant rules are removed. A predicate method is then compiled into the
-  translet as:</p>
-
-<source>
-    public boolean stripSpace(int node);
-</source>
-
-  <p>Unfortunately this method cannot be declared static.</p>
-
-  <p>When the Stylesheet objectcompiles the <code>topLevel()</code> method of the
-  translet it checks for the existance of the <code>stripSpace()</code> method. If
-  this method exists the <code>topLevel()</code> will be compiled to pass the
-  translet to the DOM as a StripWhitespaceFilter (the translet implements this
-  interface when the <code>stripSpace()</code> method is compiled).</p>
-
-  <p>All axis iterators and the <code>DOM.makeStringValue()</code> and
-  <code>DOM.stringValueAux()</code> methods check for the existance of this filter
-  (it is kept in a global variable in the DOM implementation class) and takes
-  the appropriate actions. The methods in the DOM for returning axis iterators
-  will place a StrippingIterator on top of the axis iterator if the filter is
-  present, and the two methods just mentioned will return empty strings for
-  whitespace nodes that should be stripped.</p>
- 
-  </s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsltc_compiler.xml b/xdocs/sources/xsltc/xsltc_compiler.xml
deleted file mode 100644
index ae4d69d..0000000
--- a/xdocs/sources/xsltc/xsltc_compiler.xml
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="XSLTC Compiler Design">
-    <ul>  
-     <li><link anchor="overview">Compiler Overview</link></li>
-     <li><link anchor="ast">Building an Abstract Syntax Tree</link></li>
-     <li><link anchor="typecheck">Type-check and Cast Expressions</link></li>
-     <li><link anchor="compile">Code generation</link></li>
-    </ul>
-
-    <anchor name="overview"/>
-    <s2 title="Compiler overview">
-
-    <p>The input stylesheet is parsed using the SAX 1-based parser from Sun's
-    Project X:</p>   
-    <ul>
-      <li><code>com.sun.xml.parser.Parser</code></li>
-    </ul>
-
-    <p>This parser builds a DOM from the stylesheet document, and hands this
-    DOM over to the compiler. The compiler uses its own specialised parser to
-    parse XPath expressions and patterns:</p>
-    <ul>
-      <li><code>com.sun.xslt.compiler.XPathParser</code></li>
-    </ul>
-    <p>Both parsers are encapsulated in XSLTC's parser class:</p>
-    <ul>
-      <li><code>com.sun.xslt.compiler.Parser</code></li>
-    </ul>
-
-    </s2><anchor name="ast"/>
-    <s2 title="Building an Abstract Syntax Tree">
-    <ul>
-      <li><link anchor="mapping">Mapping stylesheet elements to Java classes</link></li>
-      <li><link anchor="domxsl">Building a DOM tree from the input XSL file</link></li>      
-    </ul>
-    <p>The SAX parser builds a standard W3C DOM from the source stylesheet.
-    This DOM does not contain all the information needed to represent the
-    whole stylesheet. ( Remember that XSL is two languages; XML and XPath.
-    The DOM only covers XML. ) The compiler uses the DOM to build an
-    abstract syntax tree (AST) that contains all the nodes from the DOM, plus
-    additional nodes for the XPath expressions.</p>
-    <anchor name="mapping"/>
-    <s3 title="Mapping stylesheets elements to Java classes">
-    <p>Each XSL element is represented by a class in the
-    <code>com.sun.xslt.compiler</code> package. The Parser class contains a
-    Hashtable that that maps XSL instructions to classes that inherit from a
-    common parent class 'Instruction' (which again inherits from
-    'SyntaxTreeNode'). This mapping is set up in the <code>initClasses()</code> method:</p>
-<source>    private void initStdClasses() {
-	try {
-	    initStdClass("template",    "Template");
-	    initStdClass("param",       "Param");
-	    initStdClass("with-param",  "WithParam");
-	    initStdClass("variable",    "Variable");
-	    initStdClass("output",      "Output");
-	    :
-	    :
-	    :
-	}
-    }
-
-    private void initClass(String elementName, String className)
-	throws ClassNotFoundException {
-	_classes.put(elementName,
-		     Class.forName(COMPILER_PACKAGE + '.' + className));
-    }</source>
-    </s3><anchor name="domxsl"/>
-    <s3 title="Building a DOM tree from the input XSL file">
-    <p>The parser instanciates a DOM that holds the input XSL stylesheet. The
-    DOM can only handle XML files and will not break up and identify XPath
-    patterns/expressions (these are stored as attributes to the various
-    nodes in the tree) or calls to XSL functions(). Each XSL instruction gets
-    its own node in the DOM, and the XPath patterns/expressions are stored as
-    attributes of these nodes. A stylesheet looking like this:</p>
-<source>
-    &lt;xsl:stylesheet .......&gt;
-      &lt;xsl:template match="chapter"&gt;
-        &lt;xsl:text&gt;Chapter&lt;/xsl:text&gt;
-        &lt;xslvalue-of select="."&gt;
-      &lt;/xsl:template&gt;
-    &lt;/xsl&gt;stylesheet&gt;
-</source>
-    <p>will be stored in the DOM as indicated in the following picture:</p>
-    <p><img src="compiler_DOM.gif" alt="compiler_DOM.gif"/></p>
-    <p><ref>Figure 1: DOM containing XSL stylesheet</ref></p>
-    <p>The pattern '<code>match="chapter"</code>' and the expression
-    '<code>select="."</code>' are stored as attributes for the nodes
-    '<code>xsl:template</code>' and '<code>xsl:value-of</code>' respectively.
-    These attributes are accessible through the DOM interface.</p>
-    </s3>
-     <s3 title="Creating the Abstract Syntax Tree from the DOM">
-    <p>What we have to do next is to create a tree that also holds the XSL
-    specific elements; XPath expressions and patterns (with possible filters)
-    and calls to XSL functions. This is done by parsing the DOM and creating an
-    instance of a subclass of 'SyntaxTreeNode' for each node in the DOM. A node
-    in the DOM containing an XSL instruction (for example, "xsl:template") results in an
-    instance of the correspoding class derived from the HashTable created by
-    the parser (in this case in instance of the 'Template' class).</p>
-
-    <p>Each class that inherits SyntaxTreeNode has a vector called
-    '<code>_contents</code>' that holds references to all the children of the node
-    (if any). Each node has a method called '<code>parseContents()</code>'. It is
-    the responsibility of this method to parse any XPath expressions/patterns
-    that are expected and found in the node's attributes. The XPath patterns
-    and instructions are tokenised using the auto-generated class 'XPathParser'
-    (generated using JavaCup and JLex). The tokenised expressions/patterns
-    will result in a small sub-tree owned by the syntax tree node.</p>
-
-    <p>XSL nodes holding expressions has a pointer called '<code>_select</code>' that
-    points to a sub-tree representing the expression. This can be seen for
-    instance in the 'Template' class:</p>
-    <p><img src="compiler_AST.gif" alt="compiler_AST.gif"/></p>
-    <p><ref>Fiugre 2: Sample Abstract Syntax Tree</ref></p>
-    <p>In this example _select only points to a single node. In more complex
-    expressions the pointer will point to an whole sub-tree.</p>
-     </s3>
-     </s2><anchor name="typecheck"/>
-    <s2 title="Type-check and Cast Expressions">
-    <p>In many cases we will need to typecast the top node in the expression
-    sub-tree to suit the expected result-type of the expression, or to typecast
-    child nodes to suit the allowed types for the various operators in the
-    expression. This is done by calling 'typeCheck()' on the root-node in the
-    XSL tree. Each SyntaxTree node is responsible for its own type checking
-    (ie. the <code>typeCheck()</code> method must be overridden). Let us say that
-    our pattern was:</p>
-    <p><code>&lt;xsl:value-of select=&quot;1+2.73&quot;/&gt;</code></p>
-    <p><img src="typecast.gif" alt="typecast.gif"/></p>
-    <p><ref>Figure 3: XPath expression type conflict</ref></p>
-    <p>The number 1 is an integer, and the number 2.73 is a real number, so the
-    1 has to be promoted to a real. This is done ny inserting a new node between
-    the [1] and the [+]. This node will convert the 1 to a real number:</p>
-    <p><img src="cast_expression.gif" alt="cast_expression.gif"/></p>
-    <p><ref>Figure 4: Type casting</ref></p>
-
-    <p>The inserted node is an object of the class CastExpr. The SymbolTable
-    that was instanciated in (1) is used to determine what casts are needed for
-    the various operators and what return types the various expressions will
-    have.</p>
-
-    </s2><anchor name="compile"/>
-    <s2 title="Code generation">
-    <ul>
-      <li><link anchor="toplevelelem">Compiling top-level elements</link></li>
-      <li><link anchor="templatecode">Compiling template code</link></li>
-      <li><link anchor="instrfunc">Compiling XSL instructions and functions</link></li>            
-    </ul>
-    <p>A general rule is that all classes that represent elements in the XSL
-    tree/document, i.e., classes that inherit from SyntaxTreeNode, output
-    bytecode in the 'translate()' method.</p>
-    <anchor name="toplevelelem"/>
-    <s3 title="Compiling top-level elements">
-    <p>The bytecode that handles top-level elements must be generated before any
-    other code. The '<code>translate()</code>' method in these classes are mainly
-    called from these methods in the Stylesheet class:</p>
-
-<source>    private String compileBuildKeys(ClassGenerator classGen);
-    private String compileTopLevel(ClassGenerator classGen, Enumeration elements);
-    private void compileConstructor(ClassGenerator classGen, Output output);</source>
-
-    <p>These methods handle most top-level elements, such as global variables
-    and parameters, <code>&lt;xsl:output&gt;</code> and
-    <code>&lt;xsl:decimal-format&gt;</code> instructions.</p>
-    </s3><anchor name="templatecode"/>
-    <s3 title="Compiling template code">
-    <p>All XPath patterns in <code>&lt;xsl:apply-template&gt;</code> instructions
-    are converted into numeric values (known as the pattern's kernel 'type').
-    All templates with identical pattern kernel types are grouped together and
-    inserted into a table with its assigned type. (This table is found in the
-    Mode class. There will be one such table for each mode that is used in the
-    stylesheet). This table is used to build a big <code>switch()</code> statement
-    in the translet's <code>applyTemplates()</code> method. This method is initially
-    called with the root node of the input document.</p>
-    <p>The <code>applyTemplates()</code> method determines the node's type and passes
-    this type to the <code>switch()</code> statement to look up the matching
-    template.</p>
-
-    <p>There may be several templates that share the same pattern kernel type.
-    Here are a few examples of templates with patterns that all have the same
-    kernel type:</p>
-
-<source>    &lt;xsl:template match=&quot;A/C&quot;&gt;
-    &lt;xsl:template match=&quot;A/B/C&quot;&gt;
-    &lt;xsl:template match=&quot;A | C&quot;&gt;</source>
-
-    <p>All these templates will be grouped under the type for <code>&lt;C&gt;</code>
-    and will all get the same kernel type (the type for <code>"C"</code>). The last
-    template will be grouped both under <code>"C"</code> and <code>"A"</code>. If the
-    type identifier for <code>"C"</code> in this case is 8, all these templates will
-    be put under <code>case 8:</code> in <code>applyTemplates()</code>'s big
-    <code>switch()</code> statement. The Mode class will insert extra code to choose
-    which template code to invoke.</p>
-    </s3><anchor name="instrfunc"/>
-    <s3 title="Compiling XSL instructions and functions">
-
-    <p>The template code is generated by calling <code>translate()</code> on each
-    Template object in the abstract syntax tree. This call will be propagated
-    down the tree and every element will output the bytecodes necessary to
-    complete its task.</p>
-
-    <p>Each node will call 'translate()' on its children, and possibly on
-    objects representing the node's XPath expressions, before outputting its
-    own bytecode. In that way the correct sequence of instructions is generated.
-    Each one of the child nodes is responsible of creating code that leaves the
-    node's output value (if any) on the stack. The typical procedure for the
-    parent node is to create code that consumes these values off the stack and
-    then leave its own output on the stack for its parent.</p>
-
-    <p>The tree-structure of the stylesheet is in this way closely tied with
-    the stack-based JVM. The design does not offer any obvious way of extending
-    the compiler to output code for other VMs or processors.</p>
-   </s3>
-  </s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xsltc/xsltc_dom.xml b/xdocs/sources/xsltc/xsltc_dom.xml
deleted file mode 100644
index 93557dd..0000000
--- a/xdocs/sources/xsltc/xsltc_dom.xml
+++ /dev/null
@@ -1,483 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="XSLTC Internal DOM">
-  <ul>
-    <li><link anchor="functionality">General functionlaity</link></li>
-    <li><link anchor="components">Components of the internal DOM</link></li>
-    <li><link anchor="structure">Internal structure</link></li>
-    <li><link anchor="navigation">Tree navigation</link></li>
-    <li><link anchor="namespaces">Namespaces</link></li>
-    <li><link anchor="w3c">W3C DOM2 navigation support</link></li>
-    <li><link anchor="adapter">The DOM adapter - DOMAdapter</link></li>
-    <li><link anchor="multiplexer">The DOM multiplexer - MultiDOM</link></li>
-    <li><link anchor="builder">The DOM builder - DOMImpl$DOMBuilder</link></li>
-  </ul>
-
-  <anchor name="functionality"/>
-  <s2 title="General functionality">
-  <p>The internal DOM gives the translet access to the XML document(s) it has
-  to transform. The interface to the internal DOM is specified in the DOM.java
-  class. This is the interface that the translet uses to access the DOM. 
-  There is also an interface specified for DOM caches -- DOMCache.java</p>
-
-  </s2><anchor name="components"/>
-  <s2 title="Components of the internal DOM">
-
-  <p>This DOM interface is implemented by three classes:</p>
-  <ul>
-    <li><em>org.apache.xalan.xsltc.dom.DOMImpl</em><br/><br/>
-      This is the main DOM class. An instance of this class contains the nodes
-      of a <em>single</em> XML document.<br/>br/>
-    </li>
-    <li><em>org.apache.xalan.xsltc.dom.MultiDOM</em><br/><br/>
-      This class is best described as a DOM multiplexer. XSLTC was initially
-      designed to operate on a single XML document, and the initial DOM and
-      the DOM interface were designed and implemented without the
-      <code>document()</code> function in mind. This class will allow a translet
-      to access multiple DOMs through the original DOM interface.<br/><br/>
-    </li>
-    <li><em>org.apache.xalan.xsltc.dom.DOMAdapter</em><br/>br/>
-      The DOM adapter is a mediator between a DOMImpl or a MultiDOM object and
-      a single translet. A DOMAdapter object contains mappings and reverse
-      mappings between node  types in the DOM(s) and node types in the translet.
-      This mediator is needed to allow several translets access to a single DOM.
-      <br/>br/>
-    </li>
-    <li><em>org.apache.xalan.xsltc.dom.DocumentCache</em><br/>br/>
-      A sample DOM cache (implementing DOMCache) that is used with our sample
-      transformation applications.
-    </li>
-  </ul>
-
-  <p><img src="DOMInterface.gif" alt="DOMInterface.gif"/></p>
-  <p><ref>Figure 1: Main components of the internal DOM</ref></p>
-
-  <p>The figure above shows how several translets can access one or more
-  internal DOM from a shared pool of cached DOMs. A translet can also access a
-  DOM tree outside of a cache. The Stylesheet class that represents the XSL
-  stylesheet to compile contains a flag that indicates if the translet uses the
-  <code>document()</code> function. The code compiled into the translet will act
-  accordingly and instanciate a MultiDOM object if needed (this code is compiled
-   in the compiler's <code>Stylesheet.compileTransform()</code> method).</p>
-
-  </s2><anchor name="structure"/>
-  <s2 title="Internal Structure">
-  <ul>
-    <li><link anchor="node-id">Node identification</link></li>
-    <li><link anchor="element-nodes">Element nodes</link></li>
-    <li><link anchor="attribute-nodes">Attribute nodes</link></li>    
-    <li><link anchor="text-nodes">Text nodes</link></li>
-    <li><link anchor="comment-nodes">Comment nodes</link></li>    
-    <li><link anchor="pi"></link>Processing instructions</li>
-  </ul>
-  <anchor name="node-id"/>
-  <s3 title="Node identifation">
-
-  <p>Each node in the DOM is represented by an integer. This integer is an
-  index into a series of arrays that describes the node. Most important is
-  the <code>_type[]</code> array, which holds the (DOM internal) node type. There
-  are some general node types that are described in the DOM.java interface:</p>
-
-<source>
-    public final static int ROOT                   = 0;
-    public final static int TEXT                   = 1;
-    public final static int UNUSED                 = 2;
-    public final static int ELEMENT                = 3;
-    public final static int ATTRIBUTE              = 4;
-    public final static int PROCESSING_INSTRUCTION = 5;
-    public final static int COMMENT                = 6;
-    public final static int NTYPES                 = 7;
-</source>
-
-  <p>Element and attribute nodes will be assigned types based on their expanded
-  QNames. The <code>_type[]</code> array is used for this:</p>
-
-<source>
-    int    type      = _type[node];             // get node type
-</source>
-
-  <p>The node type can be used to look up the element/attribute name in the
-  element/attribute name array <code>_namesArray[]</code>:</p>
-
-<source>
-    String name      = _namesArray[type-NTYPES]; // get node element name
-</source>
-
-  <p>The resulting string contains the full, expanded QName of the element or
-  attribute. Retrieving the namespace URI of an element/attribute is done in a
-  very similar fashion:</p>
-
-<source>
-    int    nstype    = _namespace[type-NTYPES]; // get namespace type
-    String namespace = _nsNamesArray[nstype];   // get node namespace name
-</source>
-  </s3><anchor name="element-nodes"/>
-  <s3 title="Element nodes">
-
-  <p>The contents of an element node (child nodes) can be identified using
-  the <code>_offsetOrChild[]</code> and <code>_nextSibling[]</code> arrays. The
-  <code>_offsetOrChild[]</code> array will give you the first child of an element
-  node:</p>
-
-<source>
-    int    child     = _offsetOrChild[node];    // first child
-    child = _nextSibling[child];                // next child
-</source>
-
-  <p>The last child will have a &quot;<code>_nextSibling[]</code>&quot; of 0 (zero).
-  This value is OK since the root node (the 0 node) will not be a child of
-  any element.</p>
-
-  </s3><anchor name="attribute-nodes"/>
-  <s3 title="Attribute nodes">
-
-  <p>The first attribute node of an element is found by a lookup in the
-  <code>_lengthOrAttr[]</code> array using the node index:</p>
-
-<source>
-    int    attribute = _offsetOrChild[node];    // first attribute
-    attribute = _nextSibling[attribute];        // next attribute
-</source>
-
-  <p>The names of attributes are contained in the <code>_namesArray[]</code> just
-  like the names of element nodes. The value of attributes are store the same
-  way as text nodes:</p>
-
-<source>
-    int    offset    = _offsetOrChild[attribute]; // offset into character array
-    int    length    = _lengthOrAttr[attribute];  // length of attribute value
-    String value     = new String(_text, offset, length);
-</source>
-  </s3><anchor name="text-nodes"/>
-  <s3 title="Text nodes">
-
-  <p>Text nodes are stored identically to attribute values. See the previous
-  section on <link anchor="attribute-nodes">attribute nodes</link>.</p>
-  </s3><anchor name="comment-nodes"/>
-  <s3 title="Comment nodes">
-
-  <p>The internal DOM does currently <em>not</em> contain comment nodes. Yes, I
-  am quite aware that the DOM has a type assigned to comment nodes, but comments
-  are still not inserted into the DOM.</p>
-  </s3><anchor name="pi"/>
-  <s3 title="Processing instructions">
-
-  <p>Processing instructions are handled as text nodes. These nodes are stored
-  identically to attribute values. See the previous section on
-  <link anchor="attribute-nodes">attribute nodes</link>.</p>
-
-  </s3></s2><anchor name="navigation"/>
-  <s2 title="Tree navigation">
-
-  <p>The DOM implementation contains a series of iterator that implement the
-  XPath axis. All these iterators implement the NodeIterator interface and
-  extend the NodeIteratorBase base class. These iterators do the job of
-  navigating the tree using the <code>_offsetOrChild[]</code>, <code>_nextSibling</code>
-  and <code>_parent[]</code> arrays. All iterators that handles XPath axis are
-  implemented as a private inner class of DOMImpl. The translet uses a handful
-  of methods to instanciate these iterators:</p>
-
-<source>
-    public NodeIterator getIterator();
-    public NodeIterator getChildren(final int node);
-    public NodeIterator getTypedChildren(final int type);
-    public NodeIterator getAxisIterator(final int axis);
-    public NodeIterator getTypedAxisIterator(final int axis, final int type);
-    public NodeIterator getNthDescendant(int node, int n);
-    public NodeIterator getNamespaceAxisIterator(final int axis, final int ns);
-    public NodeIterator orderNodes(NodeIterator source, int node);
-</source>
-
-  <p>There are a few iterators in addition to these, such as sorting/ordering
-  iterators and filtering iterators. These iterators are implemented in
-  separate classes and can be instanciated directly by the translet.</p>
-
-  </s2><anchor name="namespaces"/>
-  <s2 title="Namespaces">
-
-  <p>Namespace support was added to the internal DOM at a late stage, and the
-  design and implementation of the DOM bears a few scars because of this. 
-  There is a separate <link idref="xsltc_namespace">design
-  document</link> that covers namespaces.</p>
-
-  </s2><anchor name="w3c"/>
-  <s2 title="W3C DOM2 navigation support">
-
-  <p>The DOM has a few methods that give basic W3C-type DOM navigation. These
-  methods are:</p>
-
-<source>
-    public Node makeNode(int index);
-    public Node makeNode(NodeIterator iter);
-    public NodeList makeNodeList(int index);
-    public NodeList makeNodeList(NodeIterator iter);
-</source>
-
-  <p>These methods return instances of inner classes of the DOM that implement
-  the W3C Node and NodeList interfaces.</p>
-
-  </s2><anchor name="adapter"/>
-  <s2 title="The DOM adapter - DOMAdapter">
-  <ul>
-    <li><link anchor="translet-dom">Translet/DOM type mapping</link></li>
-    <li><link anchor="whitespace">Whitespace text-node stripping</link></li>
-    <li><link anchor="method-mapping">Method mapping</link></li>
-  </ul>
-  <anchor name="translet-dom"/>
-  <s3 title="Translet/DOM type mapping">
-
-  <p>The DOMAdapter class performs the mappings between DOM and translet node
-  types, and vice versa. These mappings are necessary in order for the translet
-  to correctly identify an element/attribute in the DOM and for the DOM to
-  correctly identify the element/attribute type of a typed iterator requested
-  by the translet. Note that the DOMAdapter also maps translet namespace types
-  to DOM namespace types, and vice versa.</p>
-
-  <p>The DOMAdapter class has four global tables that hold the translet/DOM
-  type and namespace-type mappings. If the DOM knows an element as type
-  19, the DOMAdapter will translate this to some other integer using the
-  <code>_mapping[]</code> array:</p>
-
-<source>
-    int domType = _mapping[transletType];
-</source>
-
-  <p>This action will be performed when the DOM asks what type a specific node
-  is. The reverse is done then the translet wants an iterator for a specific
-  node type. The DOMAdapter must translate the translet-type to the type used
-  internally in the DOM by looking up the <code>_reverse[]</code> array:</p>
-
-<source>
-    int transletType = _mapping[domType];
-</source>
-
-  <p>There are two additional mapping tables: <code>_NSmapping[]</code> and
-  <code>_NSreverse[]</code> that do the same for namespace types.</p>
-  </s3><anchor name="whitespace"/>
-  <s3 title="Whitespace text-node stripping">
-
-  <p>The DOMAdapter class has the additional function of stripping whitespace
-  nodes in the DOM. This functionality had to be put in the DOMAdapter, as
-  different translets will have different preferences for node stripping.</p>
-  </s3><anchor name="method-mapping"/>
-  <s3 title="Method mapping">
-
-  <p>The DOMAdapter class implements the same <code>DOM</code> interface as the
-  DOMImpl class. A DOMAdapter object will look like a DOMImpl tree, but the
-  translet can access it directly without being concerned with type mapping
-  and whitespace stripping. The <code>getTypedChildren()</code> demonstrates very
-  well how this is done:</p>
-
-<source>
-    public NodeIterator getTypedChildren(int type) {
-        // Get the DOM type for the requested typed iterator
-        final int domType = _reverse[type];
-        // Now get the typed child iterator from the DOMImpl object
-        NodeIterator iterator = _domImpl.getTypedChildren(domType);
-        // Wrap the iterator in a WS stripping iterator if child-nodes are text nodes
-	if ((domType == DOM.TEXT) &amp;&amp; (_filter != null))
-	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
-	return(iterator);
-    }
-</source>
-
-  </s3></s2><anchor name="multiplexer"/>
-  <s2 title="The DOM multiplexer - MultiDOM">
-
-  <p>The DOM multiplexer class is only used when the compiled stylesheet uses
-  the <code>document()</code> function. An instance of the MultiDOM class also
-  implements the DOM interface, so that it can be accessed in the same way
-  as a DOMAdapter object.</p>
-
-  <p>A node in the DOM is identified by an integer. The first 8 bits of this
-  integer are used to identify the DOM in which the node belongs, while the
-  lower 24 bits are used to identify the node within the DOM:</p>
-    <table>
-      <tr>
-        <td>31-24</td>
-        <td>23-16</td>
-        <td>16-8</td>
-        <td>7-0</td>
-      </tr>
-      <tr>
-        <td>DOM id</td>
-        <td colspan="3">node id</td>
-      </tr>
-    </table>
-
-  <p>The DOM multiplexer has an array of DOMAdapter objects. The topmost 8
-  bits of the identifier is used to find the correct DOM from the array. Then
-  the lower 24 bits are used in calls to methods in the DOMAdapter object:</p>
-
-<source>
-    public int getParent(int node) {
-	return _adapters[node>>>24].getParent(node &amp; 0x00ffffff) | node &amp; 0xff000000;
-    }
-</source>
-
-  <p>Note that the node identifier returned by this method has the same upper 8
-  bits as the input node. This is why we <code>OR</code> the result from
-  <code>DOMAdapter.getParent()</code> with the top 8 bits of the input node.</p>
-
-  </s2><anchor name="builder"/>
-  <s2 title="The DOM builder - DOMImpl$DOMBuilder">
-  <ul>
-    <li><link anchor="startelement">startElement()</link></li>
-    <li><link anchor="endelement">endElement()</link></li>
-    <li><link anchor="startprefixmapping">startPrefixMapping()</link></li>
-    <li><link anchor="endprefixmapping">endPrefixMapping()</link></li>
-    <li><link anchor="characters">characters()</link></li>
-    <li><link anchor="startdocument">startDocument()</link></li>
-    <li><link anchor="enddocument">endDocument()</link></li>
-  </ul>
-
-  <p>The DOM builder is an inner class of the DOM implementation. The builder
-  implements the SAX2 <code>ContentHandler</code> interface and populates the DOM
-  by receiving SAX2 events from a SAX2 parser (presently xerces). An instance
-  of the DOM builder class can be retrieved from <code>DOMImpl.getBuilder()</code>
-  method, and this handler can be set as an XMLReader's content handler:</p>
-
-<source>
-    final SAXParserFactory factory = SAXParserFactory.newInstance();
-    final SAXParser parser = factory.newSAXParser();
-    final XMLReader reader = parser.getXMLReader();
-    final DOMImpl dom = new DOMImpl();
-    reader.setContentHandler(dom.getBuilder());
-</source>
-
-  <p>The DOM builder will start to populate the DOM once the XML parser starts
-  generating SAX2 events:</p>
-  <anchor name="startelement"/>
-  <s3 title="startElement()">
-
-  <p>This method can be called in one of two ways; either with the expanded
-  QName (the element's separate uri and local name are supplied) or as a
-  normal QName (one String on the format prefix:local-name). The DOM stores
-  elements as expanded QNames so it needs to know the element's namespace URI.
-  Since the URI is not supplied with this call, we have to keep track of
-  namespace prefix/uri mappings while we're building the DOM. See 
-  <code><link anchor="startprefixmapping">startPrefixMapping()</link></code> below for details on
-  namespace handling.</p>
-
-  <p>The <code>startElement()</code> inserts the element as a child of the current
-  parent element, creates attribute nodes for all attributes in the supplied
-  &quot;<code>Attributes</code>&quot; attribute list (by a series of calls to
-  <code>makeAttributeNode()</code>), and finally creates the actual element node
-  (by calling <code>internElement()</code>, which inserts a new entry in the
-  <code>_type[]</code> array).</p>
-  </s3><anchor name="endelement"/>
-  <s3 title="endElement()">
-
-  <p>This method does some cleanup after the <code>startElement()</code> method,
-  such as revering <code>xml:space</code> settings and linking the element's
-  child nodes.</p>
-  </s3><anchor name="startprefixmapping"/>
-  <s3 title="startPrefixMapping()">
-
-  <p>This method is called for each namespace declaration in the source
-  document. The parser should call this method before the prefix is referenced
-  in a QName that is passed to the <code>startElement()</code> call. Namespace
-  prefix/uri mappings are stored in a Hashtable structure. Namespace prefixes
-  are used as the keys in the Hashtable, and each key maps to a Stack that
-  contains the various URIs that the prefix maps to. The URI on top of the
-  stack is the URI that the prefix currently maps to.</p>
-
-  
-    <p><img src="namespace_stack.gif" alt="namespace_stack.gif"/></p>
-    <p><ref>Figure 2: Namespace handling in the DOM builder</ref></p>
-
-
-  <p>Each call to <code>startPrefixMapping()</code> results in a lookup in the
-  Hashtable (using the prefix), and a <code>push()</code> of the URI onto the
-  Stack that the prefix maps to.</p>
-  </s3><anchor name="endprefixmapping"/>
-  <s3 title="endPrefixMapping()">
-
-  <p>A namespace prefix/uri mapping is closed by locating the Stack for the
-  prefix, and then <code>pop()</code>'ing the topmost URI off this Stack.</p>
-  </s3><anchor name="characters"/>
-  <s3 title="characters()">
-
-  <p>Text nodes are stored as simple character sequences in the character array
-  <code>_text[]</code>. The start and lenght of a node's text can be determined by
-  using the node index to look up <code>_offsetOrChild[]</code> and
-  <code>_lengthOrAttribute[]</code>.</p>
-
-  <p>We want to re-use character sequences if two or more text nodes have
-  identical content. This can be achieved by having two different text node
-  indexes map to the same character sequence. The <code>maybeReuseText()</code>
-  method is always called before a new character string is stored in the
-  <code>_text[]</code> array. This method will locate the offset of an existing
-  instance of a character sequence.</p>
-  </s3><anchor name="startdocument"/>
-  <s3 title="startDocument()">
-
-  <p>This method initialises a bunch of data structures that are used by the
-  builder. It also pushes the default namespace on the namespace stack (so that
-  the &quot;&quot; prefix maps to the <code>null</code> namespace).</p>
-  </s3><anchor name="enddocument"/>
-  <s3 title="endDocument()">
-
-  <p>This method builds the <code>_namesArray[]</code>, <code>_namespace[]</code>
-  and <code>_nsNamesArray[]</code> structures from temporary datastructures used
-  in the DOM builder.</p>
-
-   </s3>
- </s2>
-</s1>   
\ No newline at end of file
diff --git a/xdocs/sources/xsltc/xsltc_namespace.xml b/xdocs/sources/xsltc/xsltc_namespace.xml
deleted file mode 100644
index a9ab323..0000000
--- a/xdocs/sources/xsltc/xsltc_namespace.xml
+++ /dev/null
@@ -1,606 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-  <s1 title="XSLTC and Namespaces">
-  <ul>
-    <li><link anchor="functionality">Functionality</link></li>
-    <li><link anchor="overview">Namespace overview</link></li>
-    <li><link anchor="NSA">The DOM &amp; namespaces</link></li>    
-    <li><link anchor="NSB">Namespaces in the XSL stylesheet</link></li>
-    <li><link anchor="NSC">Namespaces in the output document</link></li>
-  </ul>
-  <anchor name="functionality"/>
-  <s2 title="Functionality">
-
-    <p>Namespaces are used when an XML documents has elements have the same
-    name, but are from different contexts, and thus have different meanings
-    and interpretations. For instance, a <code>&lt;TITLE&gt;</code> element can
-    be a HTML title element in one part of the XML document, while it in other
-    parts of the document the <code>&lt;TITLE&gt;</code> element is used for
-    encapsulating the title of a play or a book. This sort of confusion is
-    very common when reading XML source from multiple documents, but can also
-    occur within a single document.</p>
-
-    <p>Namespaces have three very important properties: a name, a prefix (an
-    alias for its name) and a scope. Namespaces are declared as attributes of
-    almost any node in an XML document. The declaration looks like this:</p>
-
-<source>
-    &lt;element xmlns:prefix="http://some.site/spec"&gt;....&lt;/element&gt;
-</source>
-
-    <p>The <code>"xmlns"</code> tells that this is a namespace declaration. The
-    scope of the namespace declaration is the element in which it is defined
-    and all the children of that element.The prefix is the local alias we use
-    for referencing the namespace, and the URL (it can be anything, really) is
-    the name/definition of the namespace. Note that even though the namespace
-    definition is normally an URL, it does not have to point to anything. It
-    is recommended that it points to a page that describes the elements in the
-    namespace, but it does not have to. The prefix can be just about anything
-    - or nothing (in which case it is the default namespace). Any prefix,
-    including the empty prefix for the default namespace, can be redefined to
-    refer to a different namespace at any time in an XML document. This is
-    more likely to happen to the default namespace than any other prefix. Here
-    is an example of this:</p>
-
-    <anchor name="xml_sample_1"/>
-<source>
-    &lt;?xml version="1.0"?&gt;
-    
-    &lt;employees xmlns:postal="http://postal.ie/spec-1.0"
-               xmlns:email="http://www.w3c.org/some-spec-3.2"&gt;
-        &lt;employee&gt;
-            &lt;name&gt;Bob Worker&lt;/name&gt;
-            &lt;postal:address&gt;
-                &lt;postal:street&gt;Nassau Street&lt;/postal:street&gt;
-                &lt;postal:city&gt;Dublin 3&lt;/postal:city&gt;
-                &lt;postal:country&gt;Ireland&lt;/postal:country&gt;
-            &lt;/postal:address&gt;
-            &lt;email:address&gt;bob.worker@hisjob.ie&lt;/email:address&gt;
-        &lt;/employee&gt;
-    &lt;/employees&gt;
-</source>
-
-    <p>This short document has two namespace declarations, one with the prefix
-    <code>"postal"</code> and another with the prefix <code>"email"</code>. The
-    prefixes are used to distinguish between elements for e-mail addresses and
-    regular postal addresses. In addition to these two namespaces there is also
-    an initial (unnamed) default namespace being used for the
-    <code>&lt;name&gt;</code> and <code>&lt;employee&gt;</code> tags. The scope of the
-    default namespace is in this case the whole document, while the scope of
-    the other two declared namespaces is the <code>&lt;employees&gt;</code>
-    element and its children.</p>
-
-    <p>By changing the default namespace we could have made the document a
-    little bit simpler and more readable:</p>
-
-    <anchor name="xml_sample_2"/>
-<source>
-    &lt;?xml version="1.0"?&gt;
-    
-    &lt;employees xmlns:email="http://www.w3c.org/some-spec-3.2"&gt;
-        &lt;employee&gt;
-            &lt;name&gt;Bob Worker&lt;/name&gt;
-            &lt;address xmlns="http://postal.ie/spec-1.0"&gt;
-                &lt;street&gt;Nassau Street&lt;/street&gt;
-                &lt;city&gt;Dublin 3&lt;/city&gt;
-                &lt;country&gt;Ireland&lt;/country&gt;
-            &lt;/address&gt;
-            &lt;email:address&gt;bob.worker@hisjob.ie&lt;/email:address&gt;
-        &lt;/employee&gt;
-    &lt;/employees&gt;
-</source>
-
-    <p>The default namespace is redefined for the <code>&lt;address&gt;</code> node
-    and its children, so there is no need to specify the street as
-    <code>&lt;postal:street&gt;</code> - just plain <code>&lt;street&gt;</code> is
-    sufficient. Note that this also applies to the <code>&lt;address&gt;</code>
-    where the namespace is first defined. This is in effect a redefinition of
-    the default namespace.</p>
-  </s2><anchor name="overview"/>
-  <s2 title="Namespace overview">
-
-    <p>Namespaces will have to be handled in three separate parts of the XSLT
-    compiler:</p>
-
-    <anchor name="all_namespaces"/>
-      <p><img src="all_namespaces.gif" alt="all_namespaces.gif"/></p>
-      <p><ref>Figure 1: Namespace handlers in the XSLTC</ref></p>
-
-    <p>The most obvious is the namespaces in the source XML document
-    (marked <link anchor="NSA">"NS A"</link> in figure 1). These namespaces will be
-    handled by our DOM implementation class. The source XSL stylesheet also
-    has its own set of namespaces (<link idref="NSB">"NS B"</link>) - one of which
-    is the XSL namespace. These namespaces will be handled at run-time and
-    whatever information that is needed to process there should be compiled
-    into the translet. There is also a set of namespaces that will be used in
-    the resulting document (<link idref="NSC">"NS C"</link>). This is an
-    intersection of the first two. The output document should not contain any
-    more namespace declarations than necessary.</p>
-
-    </s2><anchor name="NSA"/>
-    <s2 title="The DOM &amp; namespaces">
-    <ul>
-      <li><link anchor="dom-namespace">DOM node types and namespace types</link></li>
-      <li><link anchor="assign">Assigning namespace types to DOM nodes</link></li>                
-    </ul>
-    <anchor name="dom-namespace"/>
-    <s3 title="DOM node types and namespace types">
-
-    <p>Refer to the XSLTC <link idref="xsltc_runtime">runtime
-    environment design</link> document for a description of node types before
-    proceeding. In short, each node in the our DOM implementation is
-    represented by a simple integer. By using this integer as an index into an
-    array called <code>_type[]</code> we can find the type of the node.</p>
-
-    <p>The type of the node is an integer representing the type of element the
-    node is. All elements <code>&lt;bob&gt;</code> will be given the same type,
-    all text nodes will be given the same type, and so on. By using the node
-    type as an index an array called <code>_namesArray[]</code> we can find the
-    name of the element type - in this case "bob". This code fragment shows
-    how you can, with our current implementation, find the name of a node:</p>
-
-<source>
-    int    node = iterator.getNext();  // get next node
-    int    type = _type[node];         // get node type
-    String name = _namesArray[type];   // get node name
-</source>
-
-    <p>We want to keep the one-type-per-node arrangement, since that lets us
-    produce fairly efficient code. One type in the DOM maps to one type in
-    the compiled translet. What we could do to represent the namespace for
-    each node in the DOM is to add a <code>_namespaceType[]</code> array that holds
-    namespace types. Each node type maps to a namespace type, and each
-    namespace type maps to a namespace name (and a prefix with a limited
-    scope):</p>
-
-    <anchor name="type_mappings"/>
-    <p><img src="type_mappings.gif" alt="type_mappings.gif"/></p>
-      <p><ref>Figure 2: Mapping between node types/names, namespace types/names</ref></p>
-
-    <p>This code fragment shows how we could get the namespace name for a node:</p>
-
-<source>
-    int    node      = iterator.getNext();    // get next node
-    int    type      = _type[node];           // get node type
-    int    nstype    = _namespace[type];      // get namespace type
-    String name      = _namesArray[type];     // get node element name
-    String namespace = _nsNamesArray[nstype]; // get node namespace name
-</source>
-
-    <p>Note that namespace prefixes are not included here. Namespace prefixes
-    are local to the XML document and will be expanded to the full namespace
-    names when the nodes are put into the DOM. This, however, is not a trivial
-    matter.</p>
-    </s3><anchor name="assign"/>
-    <s3 title="Assigning namespace types to DOM nodes">
-
-    <p>We cannot simply have a single namespace prefix array similar to the
-    <code>_namespaceArray[]</code> array for mapping a namespace type to a single
-    prefix. This because prefixes can refer to different namespaces depending
-    on where in the document the prefixes are being used. In our last example's
-    <link idref="xml_sample_2">XML fragment</link> the empty prefix <code>""</code>
-    initially referred to the default namespace (the one with no name - just
-    like a Clint Eastwood character). Later on in the document the empty
-    prefix is changed to refer to a namespace called 
-    <code>"http://postal.ie/spec-1.0"</code>.</p>
-
-    <p>Namespace prefixes are only relevant at the time when the XML document
-    is parsed and the DOM is built. Once we have the DOM completed we only need
-    a table that maps each node type to a namespace type, and another array of
-    all the names of the different namespaces. So what we want to end up with
-    is something like this:</p>
-
-     <p><img src="dom_namespace1.gif" alt="dom_namespace1.gif"/></p>
-     <p><ref>Figure 3: Each namespace references in the DOM gets one entry</ref></p>
-
-    <p>The namespace table has one entry for each namespace, nomatter how many
-    prefixes were used ro reference this namespace in the DOM. To build this
-    array we need a temporary data structure used by the DOM builder. This
-    structure is a hashtable - where the various prefixes are used for the
-    hash values. The contents of each entry in the table will be a small stack
-    where previous meanings of each prefix will be stored:</p>
-
-     <p><img src="dom_namespace2.gif" alt="dom_namespace2.gif"/></p>
-     <p><ref>Figure 4: Temporary data structure used by the DOM builder</ref></p>
-
-    <p>When the first node is encountered we define a new namespace
-    <code>"foo"</code> and assign this namespace type/index 1 (the default 
-    namespace <code>""</code> has index 0). At the same time we use the prefix
-    <code>"A"</code> for a lookup in the hashtable. This gives us
-    an integer stack used for the prefix <code>"A"</code>. We push the namespace
-    type 1 on this stack. From now on, until <code>"A"</code> is pop'ed off this
-    stack, the prefix <code>"A"</code> will map to namespace type 1, which
-    represents the namespace URI <code>"foo"</code>.</p>
-
-    <p>We then encounter the next node with a new namespace definition with
-    the same namespace prefix, we create a new namespace <code>"bar"</code> and
-    we put that in the namespace table under type 2. Again we use the prefix
-    <code>"A"</code> as an entry into the namespace prefix table and we get the
-    same integer stack. We now push namespace type 2 on the stack, so that
-    namespace prefix <code>"A"</code> maps to namespace URI <code>"bar"</code>. When
-    we have traversed this node's children we need to pop the integer off the
-    stack, so when we're back at the first node the prefix <code>"A"</code> again
-    will point to namespace type 0, which maps to <code>"foo"</code>. To keep
-    track of what nodes had what namespace declarations, we use a namespace
-    declaration stack:</p>
-
-    <p><img src="dom_namespace3.gif" alt="dom_namespace3.gif"/></p>
-     <p><ref>Figure 5: Namespace declaration stack</ref></p>
-     
-    <p>Every namespace declaration is pushed on the namespace declaration
-    stack. This stack holds the node index for where the namespace was
-    declared, and a reference to the prefix stack for this declaration.
-    The <code>endElement()</code> method of the DOMBuilder class will need to
-    remove namespace declaration for the node that is closed. This is done
-    by first checking the namespace declaration stack for any namespaces
-    declared by this node. If any declarations are found these are un-declared
-    by poping the namespace prefixes off the respective prefix stack(s), and
-    then poping the entry/entries for this node off the namespace declaration
-    stack.</p>
-
-    <p>The <code>endDocument()</code> method will build an array that contains
-    all namespaces used in the source XML document - <code>_nsNamesArray[]</code>
-    - which holds the URIs of all refered namespaces. This method also builds
-    an array that maps all DOM node types to namespace types. This two arrays
-    are accessed through two new methods in the DOM interface:</p>
-
-<source>
-    public String getNamespaceName(int node);
-    public int    getNamespaceType(int node);
-</source>
-
-  </s3></s2><anchor name="NSB"/>
-  <s2 title="Namespaces in the XSL stylesheet">
-  <ul>
-    <li><link anchor="store-access">Storing and accessing namespace information</link></li>
-    <li><link anchor="mapdom-stylesheet">Mapping DOM namespaces to stylesheet namespaces</link></li>
-    <li><link anchor="wildcards">Wildcards and namespaces</link></li>
-  </ul>
-    <anchor name="store-access"/>
-    <s3 title="Storing and accessing namespace information">
-    <p>The SymbolTable class has three datastructures that are used to hold
-    namespace information:</p>
-
-    <ul>
-      <li>
-        First there is the <code>_namespaces[]</code> Hashtable that maps the names
-        of in-scope namespace to their respective prefixes. Each key in the
-        Hashtable object has a stack. A new prefix is pushed on the stack for
-        each new declaration of a namespace.
-      </li>
-      <li>
-        Then there is the <code>_prefixes[]</code> Hashtable. This has the reverse
-        function of the <code>_namespaces[]</code> Hashtable - it maps from
-        prefixes to namespaces.
-      </li>
-      <li>
-        There is also a hashtable that is used for implementing the
-        <code>&lt;xsl:namespace-alias&gt;</code> element. The keys in this
-        hashtable is taken from the <code>stylesheet-prefix</code> attribute of
-        this element, and the resulting prefix (from the <code>result-prefix</code>
-        attribute) is used as the value for each key.
-      </li>
-    </ul>
-
-    <p>The SymbolTable class offers 4 methods for accessing these data
-    structures:</p>
-
-<source>
-    public void   pushNamespace(String prefix, String uri);
-    public void   popNamespace(String prefix);
-    public String lookupPrefix(String uri);
-    public String lookupNamespace(String prefix);
-</source>
-
-    <p>These methods are wrapped by two methods in the Parser class (a Parser
-    object alwas has a SymbolTable object):</p>
-<source>
-    // This method pushes all namespaces declared within a single element
-    public void pushNamespaces(ElementEx element);
-    // This method pops all namespaces declared within a single element
-    public void popNamespaces(ElementEx element);
-</source>
-
-    <p>The translet class has, just like the DOM, a <code>namesArray[]</code>
-    structure for holding the expanded QNames of all accessed elements. The
-    compiled translet fills this array in its constructor. When the translet
-    has built the DOM (a DOMImpl object), it passes the DOM to the a DOM
-    adapter (a DOMAdapter object) together with the names array. The DOM
-    adapter then maps the translet's types to the DOM's types.</p>
-   </s3><anchor name="mapdom-stylesheet"/>
-  <s3 title="Mapping DOM namespaces and stylesheet namespaces">
-
-    <p>Each entry in the DOM's <code>_namesArray[]</code> is expanded to contain
-    the full QName, so that instead of containing <code>prefix:localname</code> it
-    will now contain <code>namespace-uri:localname</code>. In this way the expanded
-    QName in the translet will match the exanded QName in the DOM. This assures
-    matches on full QNames, but does not do much for <code>match="A:*"</code> type
-    XPath patterns. This is where our main challenge lies.</p>
-    </s3><anchor name="wildcards"/>
-    <s3 title="Wildcards and namespaces">
-
-    <p>The original implementation of the XSLTC runtime environment would
-    only allow matches on "<code>*</code>" and "<code>@*</code>" patterns. This was
-    achieved by mapping all elements that could not be mapped to a translet
-    type to 3 (DOM.ELEMENT type), and similarly all unknown attributes to
-    type 4 (DOM.ATTRIBUTE type). The main <code>switch()</code> statement in
-    <code>applyTemplates()</code> would then have a separate "<code>case()</code>"
-    for each of these. (Under each <code>case()</code> you might have to check
-    for the node's parents in case you were matching on "<code>path/*</code>"-type
-    patterns.) This figure shows how that was done:</p>
-
-    <anchor name="match_namespace1"/>
-    <p><img src="match_namespace1.gif" alt="match_namespace1.gif"/></p>
-    <p><ref>Figure 6: Previous pattern matching</ref></p>
-
-    <p>The "Node test" box here represents the "<code>switch()</code>" statement.
-    The "Node parent test" box represent each "<code>case:</code>" for that 
-    <code>switch()</code> statement. There is one <code>case:</code> for each know
-    translet node type. For each node type we have to check for any parent
-    patterns - for instance, for the pattern "<code>/foo/bar/baz</code>", we will
-    get a match with <code>case "baz"</code>, and we have to check that the parent
-    node is "<code>bar</code>" and that the grandparent is "<code>foo</code>" before
-    we can say that we have a hit. The "Element parent test" is the test that
-    is done all DOM nodes that do not directly match any translet types. This
-    is the test for "<code>*</code>" or "<code>foo/*</code>". Similarly we have a
-    "<code>case:</code>" for match on attributes ("<code>@*</code>").</p>
-
-    <p>What we now want to achieve is to insert a check for patterns on the
-    format "<code>ns:*</code>", "<code>foo/ns:*</code>" or "<code>ns:@*</code>", which
-    this figure illustrates:</p>
-
-    <anchor name="match_namespace2"/>
-      <p><img src="match_namespace2.gif" alt="match_namespace2.gif"/></p>
-      <p><ref>Figure 7: Pattern matching with namespace tests</ref></p>
-
-
-    <p>Each node in the DOM needs a namespace type as well as the QName type.
-    With this type we can match wildcard rules to any specific namespace.
-    So after any checks have been done on the whole QName of a node (the type),
-    we can match on the namespace type of the node. The main dispatch
-    <code>switch()</code> in <code>applyTemplates()</code> must be changed from this:</p>
-
-    <source>
-        public void applyTemplates(DOM dom, NodeIterator iterator,
-                                   TransletOutputHandler handler) {
-
-            // Get next node from iterator
-            while ((node = iterator.next()) != END) {
-                // Get internal node type
-                final int type = DOM.getType(node);
-                switch(type) {
-                case DOM.ROOT:      // Match on "/" pattern
-                    handleRootNode();       
-                    break;
-                case DOM.TEXT:      // Handle text nodes
-                    handleText();
-                    break;
-                case DOM.ELEMENT:   // Match on "*" pattern
-                    handleWildcardElement();
-                    break;
-                case DOM.ATTRIBUTE: // Handle on "@*" pattern
-                    handleWildcardElement();
-                    break;
-                case nodeType1:     // Handle 1st known element type
-                    compiledCodeForType1();
-                    break;
-                    :
-                    :
-                    :
-                case nodeTypeN:   // Handle nth known element type
-                    compiledCodeForTypeN();
-                    break;
-                default:
-                   NodeIterator newIterator = DOM.getChildren(node);
-                   applyTemplates(DOM, newIterator, handler);
-                   break;
-                }
-            }
-            return;
-        }
-</source>
-
-    <p>To something like this:</p>
-
-    <source>
-        public void applyTemplates(DOM dom, NodeIterator iterator,
-                                   TransletOutputHandler handler) {
-
-            // Get next node from iterator
-            while ((node = iterator.next()) != END) {
-
-                // First run check on node type
-                final int type = DOM.getType(node);
-                switch(type) {
-                case DOM.ROOT:      // Match on "/" pattern
-                    handleRootNode();
-                    continue;
-                case DOM.TEXT:      // Handle text nodes
-                    handleText();
-                    continue;
-                case DOM.ELEMENT:   // Not handled here!!!
-                    break;
-                case DOM.ATTRIBUTE: // Not handled here!!!
-                    break;
-                case nodeType1:     // Handle 1st known element type
-                    if (compiledCodeForType1() == match) continue;
-                    break;
-                    :
-                    :
-                    :
-                case nodeTypeN:     // Handle nth known element type
-                    if (compiledCodeForTypeN() == match) continue;
-                    break;
-                default:
-                    break;
-                }
-
-                // Then run check on namespace type
-                final int namespace = DOM.getNamespace(type);
-                switch(namespace) {
-                case 0: // Handle nodes matching 1st known namespace
-                    if (handleThisNamespace() == match) continue;
-                    break;
-                case 1: // Handle nodes matching 2nd known namespace
-                    if (handleOtherNamespace() == match) continue;
-                    break;
-                }
-
-                // Finally check on element/attribute wildcard
-                if (type == DOM.ELEMENT) {
-                    if (handleWildcardElement() == match)
-                        continue;
-                    else {
-                       // The default action for elements
-                       NodeIterator newIterator = DOM.getChildren(node);
-                       applyTemplates(DOM, newIterator, handler);
-                    }
-                }
-                else if (type == DOM.ATTRIBUTE) {
-                    handleWildcardAttribute();
-                    continue; 
-                }
-            }
-        }
-</source>
-
-    <p>First note that the default action (iterate on children) does not hold for
-    attributes, since attribute nodes do not have children. Then note that the way
-    the three levels of tests are ordered is consistent with the way patterns
-    should be prioritised:</p>
-
-    <ul>
-
-      <li><em>Match on element/attribute types:</em></li>
-        <ul>
-          <li><code>match="/"</code> - match on the root node</li>
-          <li><code>match="B"</code> - match on any B element</li>
-          <li><code>match="A/B"</code> - match on B elements with A parent</li>
-          <li><code>match="A | B"</code> - match on B or A element</li>
-          <li><code>match="foo:B"</code> - match on B element within "foo" namespace</li>
-        </ul>
-        <li><em>Match on namespace:</em></li>
-        <ul>
-          <li><code>match="foo:*"</code> - match on any element within "foo" namespace</li>
-          <li><code>match="foo:@*"</code> - match on any attribute within "foo" namespace</li>
-          <li><code>match="A/foo:*"</code> - match on any element within "foo" namespace with A parent</li>
-          <li><code>match="A/foo:@*"</code> - match on any attribute within "foo" namespace with A parent</li>
-        </ul>      
-
-      <li><em>Match on wildcard:</em> </li>
-        <ul>
-          <li><code>match="*"</code> - match on any element</li>
-          <li><code>match="@*"</code> - match on any attribute</li>
-          <li><code>match="A/*"</code> - match on any element with A parent</li>
-          <li><code>match="A/@*"</code> - match on any attribute with A parent</li>
-        </ul>
-     
-    </ul>
-
-     </s3></s2><anchor name="NSC"/>
-     <s2 title="Namespaces in the output document">
-
-    <p>These are the categories of namespaces that end up in the output
-    document:</p>
-
-    <ul>
-      <li>
-        Namespaces used in literal elements/attributes in the stylesheet. These
-        namespaces should be declared <em>once</em> before use in the output
-        document. These elements are copied to the output document independent
-        of namespaces in the input XML document. However, the namespaces can
-        be declared using the same prefix, such that a namespace used by a
-        literal result element can overshadow a namespace from the DOM.
-      </li>
-      <li>
-        Namespaces from elements in the stylesheet that match elements in the
-        DOM. No namespaces from the DOM should be copied to the output document
-        unless they are actually referenced in the stylesheet. No namespaces
-        from the stylesheet should be copied to the output document unless the
-        elements in which they are references match elements in the DOM.
-      </li>
-    </ul>
-
-      <anchor name="output_namespaces1"/>
-      <p><img src="output_namespaces1.gif" alt="output_namespaces1.gif"/></p>
-      <p><ref>Figure 8: Namespace declaration in the output document</ref></p>    
-
-    <p>Any literal element that ends up in the output document must declare all
-    namespaces that were declared in the <code>&lt;xsl:stylesheet&lt;</code>
-    element. Exceptions are namespaces that are listed in this element's
-    <code>exclude-result-prefixes</code> or <code>extension-element-prefixes</code>
-    attributes. These namespaces should only be declared if they are referenced
-    in the output.</p>
-
-    <p>Literal elements should only declare namespaces when necessary. A
-    literal element should only declare a namespace in the case where it
-    references a namespace using prefix that is not in scope for this
-    namespace. The output handler will take care of this problem. All namespace
-    declarations are put in the output document using the output handler's
-    <code>declarenamespace()</code> method. This method will monitor all namespace
-    declarations and make sure that no unnecessary declarations are output.
-    The datastructures used for this are similar to those used to track
-    namespaces in the XSL stylesheet:</p>
-
-    <anchor name="output_namespaces2"/>
-    <p><img src="output_namespaces2.gif" alt="output_namespaces2.gif"/></p>
-      <p><ref>Figure 9: Handling Namespace declarations in the output document</ref></p>
-
- </s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsltc_runtime.xml b/xdocs/sources/xsltc/xsltc_runtime.xml
deleted file mode 100644
index dd0ba43..0000000
--- a/xdocs/sources/xsltc/xsltc_runtime.xml
+++ /dev/null
@@ -1,415 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-  <s1 title="XSLTC runtime environment">
-  <ul>
-    <li><link anchor="overview">Runtime overview</link></li>
-    <li><link anchor="translet">The compiled translet</link></li>
-    <li><link anchor="types">External/internal type mapping</link></li>    
-    <li><link anchor="mainloop">Main program loop</link></li>
-
-  </ul>
-  <anchor name="overview"/>
-  <s2 title="Runtime overview">
-    <p>The actual transformation of the input XML document is initiated by
-    one of these classes:</p>
-
-    <ul>
-      <li>
-        <code>com.sun.xslt.runtime.DefaultRun</code> (runs in a terminal)
-      </li>
-      <li>
-        <code>com.sun.xslt.demo.applet.TransformApplet</code> (runs in an applet)
-      </li>
-      <li>
-        <code>com.sun.xslt.demo.servlet.Translate</code> (runs in a servlet)
-      </li>
-    </ul>
-
-    <p>Any one of these classes will have to go through the folloing steps in
-    order to initiate a transformation:</p>
-
-    <ul>
-      <li>
-        Instanciate the translet object. The name of the translet (ie. class)
-        to use is passed to us as a string. We use this string as a parameter
-        to the static method <code>Class.forName(String name)</code> to get a
-        reference to a translet object.
-      </li>
-      <li>
-        Instanciate a <code>com.sun.xsl.parser.Parser</code> object to parse the
-        input XML file, and instanciate a DOM (we have our own DOM
-        implementation especially designed for XSLTC) where we store the
-        input document.
-      </li>
-      <li>
-        Pass any parameters to the translet (currently only possible when
-        running the transformation in a terminal using DefaultRun)
-      </li>
-      <li>
-        Instanciate a handler for the result document. This handler must be
-        extend the <code>TransletOutputHandler</code> class.
-      </li>
-      <li>
-        Invoke the <code>transform()</code> method on the translet, passing the
-        instanciated DOM and the output handler as parameters.
-      </li>
-    </ul>
-
-    </s2><anchor name="translet"/>
-    <s2 title="The compiled translet">
-
-    <p>A translet is always a subclass of <code>AbstractTranslet</code>. As well
-    as having access to the public/protected methods in this class, the
-    translet is compiled with these methods:</p>
-
-    <p><code>public void transform(DOM, NodeIterator, TransletOutputHandler);</code></p>
-
-    <p>This method is passed a <code>DOMImpl</code> object. Depending on whether
-    the stylesheet had any calls to the <code>document()</code> function this
-    method will either generate a <code>DOMAdapter</code> object (when only one
-    XML document is used as input) or a <code>MultiDOM</code> object (when there
-    are more than one XML input documents). This DOM object is passed on to
-    the <code>topLevel()</code> method.</p>
-
-    <p>When the <code>topLevel()</code> method returns we initiate the output
-    document by calling <code>startDocument()</code> on the supplied output
-    handler object. We then call <code>applyTemplates()</code> to get the actual
-    output contents, before we close the output document by calling
-    <code>endDocument()</code> on the output handler.</p>
-
-    <p><code>public void topLevel(DOM, NodeIterator, TransletOutputHandler);</code></p>
-
-    <p>This method handles all of these top-level elements:</p>
-    <ul>
-      <li><code>&lt;xsl:output&gt;</code></li>
-      <li><code>&lt;xsl:decimal-format&gt;</code></li>
-      <li><code>&lt;xsl:key&gt;</code></li>
-      <li><code>&lt;xsl:param&gt;</code> (for global parameters)</li>
-      <li><code>&lt;xsl:variable&gt;</code> (for global variables)</li>
-    </ul>
-
-    <p><code>public void applyTemplates(DOM, NodeIterator, TransletOutputHandler);</code></p>
-
-    <p>This is the method that produces the actual output. Its central element
-    is a big <code>switch()</code> statement that is used to choose the available
-    templates for the various node in the input document. See the chapter
-    <link anchor="mainloop">Main Program Loop</link> for details on this method.</p>
-
-    <p><code>public void &lt;init&gt; ();</code></p>
-    <anchor name="namesarray"/>
-    <p>The translet's constructor initializes a table
-    of all the elements we want to search for in the XML input document.
-    This table is called the <code>namesArray</code> and it is passed to the DOM
-    holding the input XML document.</p>
-
-    <p>The constructor also initializes any <code>DecimalFormatSymbol</code>
-    objects that are used to format numbers before passing them to the
-    output handler.</p>
-
-    <p><code>public boolean stripSpace(int nodeType);</code></p>
-
-    <p>This method is only present if any <code>&lt;xsl:strip-space&gt;</code> or
-    <code>&lt;xsl:preserve-space&gt;</code> elements are present in the stylesheet.
-    If that is the case, the translet implements the
-    <code>StripWhitespaceFilter</code> interface by containing this method.</p>
-
-    </s2><anchor name="types"/>
-    <s2 title="External/internal type mapping">
-
-    <anchor name="external-types"/>
-
-    <p>This is the very core of XSL transformations: <em>Read carefully!!!</em></p>
-
-    <p>Every node in the input XML document(s) is assigned a type by the
-    DOM builder class. This type is an integer value which represents the
-    element, so that for instance all <code>&lt;bob&gt;</code> elements in the
-    input document will be given type <ref>7</ref> and can be referred to by using
-    that integer. These types can be used for lookups in the
-    <link anchor="namesarray">namesArray</link> table to get the actual
-    element name (in this case "bob"). These types are referred to as
-    <em>external types</em> or <em>DOM types</em>, as they are types known only
-    to the DOM and the DOM builder.</p>
-
-    <anchor name="internal-types"/>
-
-    <p>Similarly the translet assignes types to all element and attribute names
-    that are referenced in the stylesheet. These types are referred to as
-    <em>internal types</em> or <em>translet types</em>.</p>
-
-    <p>It is not very probable that there will be a one-to-one mapping between
-    internal and external types. There will most often be elements in the DOM
-    (ie. the input document) that are not mentioned in the stylesheet, and
-    there could be elements in the stylesheet that do not match any elements
-    in the DOM. Here is an example:</p>
-
-<source>
-      &lt;?xml version="1.0"?&gt;
-      &lt;xsl:stylesheet version="1.0" xmlns:xsl="blahblahblah"&gt;
-
-      &lt;xsl:template match="/"&gt;
-        &lt;xsl:for-each select="//B"&gt;
-          &lt;xsl:apply-templates select="." /&gt;
-        &lt;/xsl:for-each&gt;
-        &lt;xsl:for-each select="C"&gt;
-          &lt;xsl:apply-templates select="." /&gt;
-        &lt;/xsl:for-each&gt;
-        &lt;xsl:for-each select="A/B"&gt;
-          &lt;xsl:apply-templates select="." /&gt;
-        &lt;/xsl:for-each&gt;
-      &lt;/xsl:template&gt;
-
-    &lt;/xsl:stylesheet&gt;
-</source>
-
-    <p>In this stylesheet we are looking for elements <code>&lt;B&gt;</code>,
-    <code>&lt;C&gt;</code> and <code>&lt;A&gt;</code>. For this example we can assume
-    that these element types will be assigned the values 0, 1 and 2. Now, lets
-    say we are transforming this XML document:</p>
-
-<source>
-      &lt;?xml version="1.0"?&gt;
-
-      &lt;A&gt;
-        The crocodile cried:
-        &lt;F&gt;foo&lt;/F&gt;
-        &lt;B&gt;bar&lt;/B&gt;
-        &lt;B&gt;baz&lt;/B&gt;
-      &lt;/A&gt;
-</source>
-
-    <p>This XML document has the elements <code>&lt;A&gt;</code>,
-    <code>&lt;B&gt;</code> and <code>&lt;F&gt;</code>, which we assume are assigned the
-    types 7, 8 and 9 respectively  (the numbers below that are assigned for
-    specific element types, such as the root node, text nodes, etc.). This
-    causes a mismatch between the type used for <code>&lt;B&gt;</code> in the
-    translet and the type used for <code>&lt;B&gt;</code> in the DOM. Th
-    DOMAdapter class (which mediates between the DOM and the translet) has been
-    given two tables for convertint between the two types; <code>mapping</code> for
-    mapping from internal to external types, and <code>reverseMapping</code> for
-    the other way around.</p>
-
-    <p>The translet contains a <code>String[]</code> array called
-    <code>namesArray</code>. This array will contain all the element and attribute
-    names that were referenced in the stylesheet. In our example, this array
-    would contain these string (in this specific order): &quot;B&quot;, 
-    &quot;C&quot; and &quot;A&quot;. This array is passed as one of the
-    parameters to the DOM adapter constructor (the other adapter is the DOM
-    itself). The DOM adapter passes this table on to the DOM. The DOM has
-    a hashtable that maps known element names to external types. The DOM goes
-    through the <code>namesArray</code> from the DOM sequentially, looks up each
-    name in the hashtable, and is then able to map the internal type to an
-    external type. The result is then passed back to the DOM adapter.</p>
-
-    <p>The reverse is done for external types. External types that are not
-    interesting for the translet (such as the type for <code>&lt;F&gt;</code>
-    elements in the example above) are mapped to a generic <code>"ELEMENT"</code>
-    type 3, and are more or less ignored by the translet.</p>
-
-    <p>It is important that we separate the DOM from the translet. In several
-    cases we want the DOM as a structure completely independent from the
-    translet - even though the DOM is a structure internal to XSLTC. One such
-    case is when transformations are offered by a servlet as a web service.
-    Any DOM that is built should potentially be stored in a cache and made
-    available for simultaneous access by several translet/servlet couples.</p>
-
-    <p><img src="runtime_type_mapping.gif" alt="runtime_type_mapping.gif"/></p>
-    <p><ref>Figure 1: Two translets accessing a single dom using different type mappings</ref></p>
-
-    </s2><anchor name="mainloop"/>
-    <s2 title="Main program loop">
-
-    <p>The main loop in the translet is found in the <code>applyTemplates()</code>
-    method. This method goes through these steps:</p>
-
-    <ul>
-      <li>
-        Get the next node from the node iterator
-      </li>
-      <li>
-        Get the internal type of this node. The DOMAdapter object holds the
-        internal/external type mapping table, and it will supply the translet
-        with the internal type of the current node.
-      </li>
-      <li>
-        Execute a switch statement on the internal node type. There will be
-        one "case" label for each recognised node type - this includes the
-        first 7 internal node types.
-      </li>
-    </ul>
-
-    <p>The root node will have internal type 0 and will cause any initial
-    literal elements to be output. Text nodes will have internal node type 1
-    and will simply be dumped to the output handler. Unrecognized elements
-    will have internal node type 3 and will be given the default treatment
-    (a new iterator is created for the node's children, and this iterator
-    is passed with a recursive call to <code>applyTemplates()</code>).
-    Unrecognised attribute nodes (type 4) will be handled like text nodes.
-    The <code>switch()</code> statement in <code>applyTemplates</code> will thereby
-    look something like this:</p>
-
-<source>
-        public void applyTemplates(DOM dom, NodeIterator,
-                                   TransletOutputHandler handler) {
-
-            // get nodes from iterator
-            while ((node = iterator.next()) != END) {
-                // get internal node type
-                switch(DOM.getType(node)) {
-
-                case 0: // root
-                    outputPreable(handler);
-                    break;
-                case 1: // text
-                    DOM.characters(node,handler);
-                    break;
-                case 3: // unrecognised element
-                    NodeIterator newIterator = DOM.getChildren(node);
-                    applyTemplates(DOM,newIterator,handler);
-                    break;
-                case 4: // unrecognised attribute
-                    DOM.characters(node,handler);
-                    break;
-                case 7: // elements of type &lt;B&gt;
-                    someCompiledCode();
-                    break;
-                case 8: // elements of type &lt;C&gt;
-                    otherCompiledCode();
-                    break;
-                default:
-                    break;
-                }
-            }
-        }
-</source>
-
-    <p>Each recognised element will have its own piece of compiled code.</p>
-
-    <p>Note that each "case" will not lead directly to a single template.
-    There may be several templates that match node type 7
-    (say <code>&lt;B&gt;</code>). In the sample stylesheet in the previous chapter
-    we have to templates that would match a node <code>&lt;B&gt;</code>. We have
-    one <code>match="//B"</code> (match just any <code>&lt;B&gt;</code> element) and
-    one <code>match="A/B"</code> (match a <code>&lt;B&gt;</code> element that is a
-    child of a <code>&lt;A&gt;</code> element). In this case we would have to
-    compile code that first gets the type of the current node's parent, and
-    then compared this type with the type for <code>&lt;A&gt;</code>. If there was
-    no match we will have executed the first <code>&lt;xsl:for-each&gt;</code>
-    element, but if there was a match we will have executed the last one.
-    Consequentally, the compiler will generate the following code:</p>
-
-<source>
-        switch(DOM.getType(node)) {
-          :
-          :
-        case 7: // elements of type &lt;B&gt;
-            int parent = DOM.getParent(node);
-            if (DOM.getType(parent) == 9) // type 9 = elements &lt;A&gt;
-                someCompiledCode();
-            else
-                evenOtherCompiledCode();
-            break;
-          :
-          :
-        }
-</source>
-
-    <p>We could do the same for namespaces, that is, assign a numeric value
-    to every namespace that is references in the stylesheet, and use an
-    <code>"if"</code> statement for each namespace that needs to be checked for
-    each type. Lets say we had a stylesheet like this:</p>
-
-<source>
-      &lt;?xml version="1.0"?&gt;
-      &lt;xsl:stylesheet version="1.0" xmlns:xsl="blahblahblah"&gt;
-
-      &lt;xsl:template match="/"
-          xmlns:foo="http://foo.com/spec"
-          xmlns:bar="http://bar.net/ref"&gt;
-        &lt;xsl:for-each select="foo:A"&gt;
-          &lt;xsl:apply-templates select="." /&gt;
-        &lt;/xsl:for-each&gt;
-        &lt;xsl:for-each select="bar:A"&gt;
-          &lt;xsl:apply-templates select="." /&gt;
-        &lt;/xsl:for-each&gt;
-      &lt;/xsl:template&gt;
-
-    &lt;/xsl:stylesheet&gt;
-</source>
-
-    <p>And a stylesheet like this:</p>
-
-<source>
-      &lt;?xml version="1.0"?&gt;
-
-      &lt;DOC
-          xmlns:foo="http://foo.com/spec"
-          xmlns:bar="http://bar.net/ref"&gt;
-        &lt;foo:A&gt;In foo namespace&lt;/foo:A&gt;
-        &lt;bar:A&gt;In bar namespace&lt;/bar:A&gt;
-      &lt;/DOC&gt;
-</source>
-
-    <p>We could still keep the same type for all <code>&lt;A&gt;</code> elements
-    regardless of what namespace they are in, and use the same <code>"if"</code>
-    structure within the <code>switch()</code> statement above. The other option
-    is to assign different types to <code>&lt;foo:A&gt;</code> and
-    <code>&lt;bar:A&gt;</code> elements.</p>
-
-  </s2>
-</s1>
\ No newline at end of file
diff --git a/xdocs/sources/xsltc/xsltc_trax.xml b/xdocs/sources/xsltc/xsltc_trax.xml
deleted file mode 100644
index 14eb801..0000000
--- a/xdocs/sources/xsltc/xsltc_trax.xml
+++ /dev/null
@@ -1,691 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-<!-- 
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, Sun
- * Microsystems., http://www.sun.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
-<s1 title="The Translet API &amp; TrAX">
-<p><ref>By</ref> <jump href="mailto:todd.miller@east.sun.com">G. Todd Miller</jump> -updated May 11, 2001</p>
-<ul>
-  <li><link anchor="abstract">Abstract</link></li>
-  <li><link anchor="trax">TrAX</link></li>
-  <li><link anchor="integrate">Translet Integration</link></li>
-  <li><link anchor="factory">SAXTransformerFactory for Translets</link></li>
-  <li><link anchor="transform">AbstractTranslet transform() method</link></li>
-  <li><link anchor="conclusion">Conclusion</link></li>
-  <li><link anchor="appendix">Appendix</link></li>      
-</ul>
-<p>See also: <jump href="../xsltc_usage.html#api">Calling XSLTC with the TrAX/JAXP API</jump></p>
-<anchor name="abstract"/>
-<s2 title="Abstract">
-<p>This document describes what I have so far as a prototype for integrating
-Translets with the JAXP TrAX. In a nutshell, a new Transformer factory
-class has be written that extends the JAXP SAXTransformerFactory class.
-The newfactory delivers Translets as Transformers, and creates Templates.
-Calling the Transformer transform() method will cause the given XML
-document to be transformed by a translet that has been compiled from the
-supplied stylesheet. The switch that determines what XSLT processor gets
-to transform the XML document is based on the value of a JAXP system
-property for the Transformers factory.</p>
-</s2><anchor name="trax"/>
-<s2 title="TrAX">
-<p>The Java API for XML Processing (JAXP) includes an XSLT framework based on the
-Transformation API for XML (TrAX). In a typical JAXP transformation application
-the steps involved in transforming an XML document with an XSLT stylesheet are: (1)
-create an instance of the TransformerFactory class, (2) from the factory instance and
-a given XSLT stylesheet, create a new Transformer object, (3) call the Transformer
-objects transform() method on a given XML document and a specified Result object.
-Alternatively, one could also ask the instance of the TransformerFactory for
-a Templates object given an XSLT stylesheet. From the Templates object, a new
-Transformer can be created, and again, its transform() method can be called with
-an XML document and specified Result object.</p>
-<p>The code below illustrates a simple JAXP transformation application (Proto.java)
-that creates the Transformer directly.</p>
-<source>import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-public class Proto {
-  public static void main(String[] args){
-    Proto app = new Proto();
-    app.run(args);
-  }
-
-  public void run(String[] args){
-    if (args.length != 2) {
-      usage();
-    }
-    String inputFilename = args[0];
-    String stylesheet = args[1];
-    Transformer transformer;
-    TransformerFactory factory = TransformerFactory.newInstance();
-    try {
-      transformer = factory.newTransformer(new StreamSource(stylesheet));
-      transformer.transform(new StreamSource(inputFilename),
-                            new StreamResult(System.out));
-    } catch (Exception e) {
-      // nothing...
-    }
-  }
-
-  public void usage() {
-    System.err.println(
-       "Usage: run &lt;xml_file&gt; &lt;xsl_file&gt;");
-    System.exit(1);
-  }
-}</source>
-<p>The use of Templates is useful when multiple instances of the same transformer
-are needed. For example transforming multiple documents by the same transformer,
-each working in a separate thread. In this case, the TransformerFactory is used to
-create a Templates object for a given stylesheet. Each Transformer instance is then
-created by the Templates object. In this way the Templates object can compile the
-stylesheet once, and each time a new instance of the transformer is asked for, a clone is
-provided rather than recompile the stylesheet again and again. The Proto class above
-would be modified as follows:</p>
-<source>try {
-  Templates templates = factory.newTemplates(new StreamSource(stylesheet));
-  transformer = templates.newTransformer();
-  transformer.transform(new StreamSource(inputFilename),
-                        new StreamResult(System.out));
-} catch (Exception e) {
-  // nothing...
-}</source>
-<p>The JAXP TransformerFactory is configurable. The API supports configuring the
-factory to: (1) use attributes which are passed down to the underlying XSL processor,
-these are vendor dependent, (2) register an ErrorListener that provides callbacks
-to handle error and warning message generated by the XSL processor, (3) register
-an URIResolver which can be used to resolve URIs encountered in xsl:include,
-xsl:import,anddocument() functions.</p>
-<p>The JAXP TransformerFactory can be queried at runtme to discover what features
-it supports. For example, an application might want to know if a particular factory
-implementation supports the use of SAX events as a source, or whether it can write
-out transformation results as a DOM. The factory API queries with the getFeature()
-method. In the Proto code above, I could add the following code before the try-catch
-block:</p>
-<source>if (!(factory.getFeature(StreamSource.FEATURE)) ||
-    !(factory.getFeature(StreamResult.FEATURE))) {
-       System.err.println(
-         "Stream Source/Result not supported by Transformer Factory\n" +
-         "exiting.");
-       System.exit(1);
-}</source>
-</s2><anchor name="integrate"/>
-<s2 title="Translet Integration">
-<p>The crux of the integration strategy is the pluggable TransformerFactory class. The
-JAXP specifies that the actual TransformerFactory implementation be controlled by the
-a Java system property (javax.xml.transformer.TransformerFactory) . This system property can be specified in the usual ways, for
-example in a properties file or on the command line as a -D optionpassed to thejava
-engine itself. The strategy involves writing a TransformerFactory for Translets.
-In the JAXP the TransformerFactory is an abstract class. In Xalan, the system
-property specifies the implementation class TransformerFactoryImpl (org.apache.xalan.processor.TransformerFactoryImpl).
- This implementation is an extension of the abstract SAXTransformerFactory class, which in
-turn is an extension of the abstract TransformerFactory class (javax.xml.transform.sax.SAXTransformerFactory).</p>
-<p>In this prototype integration I have constructed an XSLTC TransformerFactory as
-an extension of the abstract SAXTransformerFactory class.</p>
-
-</s2><anchor name="factory"/>
-<s2 title="SAXTransformerFactory for Translets">
-<p>The prototype XSLTC TransformerFactory needs to accomplish the following:</p>
- <ul>
-   <li><link anchor="saxtransformerfactory">Implement the abstract methods of the SAXTransformerFactory class</link></li>
-   <li><link anchor="transformerfactory">Implement the abstract methods of the TransformerFactory class</link></li></ul>
-<anchor name="saxtransformerfactory"/>
-<s3 title="SAXTransformerFactory Methods">
-
-<p>The methods of the abstract SAXTransformerFactory class have been stubbed out as
-follows.</p>
-<source>public TemplatesHandler newTemplatesHandler() { return null; }
-public TransformerHandler newTransformerHandler() { return null; }
-public TransformerHandler newTransformerHandler(Source src) {
-return null;
-}
-public TransformerHandler newTransformerHandler(Templates templates) {
-return null;
-}
-public XMLFilter newXMLFilter(Source src) { return null; }
-public XMLFilter newXMLFilter(Templates templates) { return null; }</source>
-<p>These stubbed out methods will need to be replaced with real implementations.</p>
-</s3><anchor name="transformerfactory"/>
-<s3 title="TransformerFactory Methods">
-<p>The methods of the abstract TransformerFactory class have been stubbed out as
-follows:</p>
-<source>public ErrorListener getErrorListener() { return null; }
-public void setErrorListener(ErrorListener listener) { }
-public Object getAttribute(String name) { return null; }
-public void setAttribute(String name, Object value) { }
-public boolean getFeature(String name) { return false; }
-public URIResolver getURIResolver() { return null; }
-public void setURIResolver(URIResolver resolver) { }
-public Source getAssociatedStylesheet(Source src, String media,
-String title, String charset) { return null; }
-public Templates newTemplates(Source xslSrc) throws
-TransformerConfigurationException { return null; }
-public Transformer newTransformer() throws
-TransformerConfigurationException { return null; }</source>
-<p>The methods listed above fall into 4 categories: (1) <link anchor="transformcreation">Transform creation</link>, 
-(2) <link anchor="templatescreation">Templates creation</link>, (3) <link anchor="featurediscovery">feature discovery</link>, 
-and (4) <link anchor="limitations">others that will remain unimplemented at this time</link>.</p>
-<anchor name="transformercreation"/>
-<s4 title="Transformer Creation">
-<p>The JAXP specifies a method that takes the stylesheet as a Source object and returns a
-Transformer.</p>
-<p><code>public Transformer newTransformer(Source xslSrc)</code></p>
-<p>This method needs to return a Transformer to comply with the JAXP API, but also
-needs to return a Translet. In the XSLTC/Xalan API, a Translet is an interface that is
-implemented by the runtime abstract class AbstractTranslet (org.apache.xalan.xsltc.Translet and org.apache.xalan.xsltc.runtime.AbstractTranslet, repectively). Therefore, I had to
-change the AbstractTranslet class so that it will extend the abstract Transformer
-class while still implementing the Translet interface. Once this is done, then the
-newTransformer() method of the new TransformerFactory can return a Translet that
-is a Transformer.</p>
-<p>In order to have AbstractTranslet extend Transformer, several abstract methods
-have to be implemented in AbstractTranslet class. These are:</p>
-<source>public void clearParameters() { }
-public ErrorListener getErrorListener() { return null; }
-public Properties getOutputProperties() throws IllegalArgumentException {
-  return null;
-}
-public String getOutputProperty(String name)
-  throws IllegalArgumentException{ return ""; }
-//public Object getParameter(String name) { return null; }
-public URIResolver getURIResolver() { return null; }
-public void setErrorListener(ErrorListener listener)
-  throws IllegalArgumentException { }
-public void setOutputProperties(Properties props)
-  throws IllegalArgumentException { }
-public void setOutputProperty(String name, String value)
-  throws IllegalArgumentException { }
-public void setParameter(String name, Object value) { }
-public void setURIResolver(URIResolver resolver) { }
-public void transform(Source xmlsrc, Result outputTarget)
-  throws TransformerException { ... }</source>
-<p>Mapping these methods to some existing ones in AbstractTranslet still has to be
-done. In particular the transform() method which is explained further in a following
-section.</p>
-<p>Now that XSLTCÂ’s AbstractTranslet is a Transformer, the new Transformer
-factory class can implement the newTransformer() method. This method needs to do
-two fundamental things: (1) create a translet from the given XSLT stylesheet and (2)
-instantiate the translet so it can be returned as a Transformer.</p>
-<p>The code belows hows my current implementation of the newTransformer() method
-in the new factory class:</p>
-<source>public class ToddsTransformerFactoryImpl extends SAXTransformerFactory {
-  ...
-  public Transformer newTransformer(Source stylesheet) throws
-    TransformerConfigurationException
-  {
-    XSLTC xsltc = new XSLTC();
-    xsltc.init();
-    String stylesheetName = stylesheet.getSystemId();
-    int index = stylesheetName.indexOf(Â’.Â’);
-    String transletName = stylesheetName.substring(0,index);
-    boolean isSuccessful = true;
-    try {
-      File file = new File(stylesheetName);
-      URL url = file.toURL();
-      isSuccessful = xsltc.compile(url);
-    } catch (MalformedURLException e) {
-        throw new TransformerConfigurationException(
-               "URL for stylesheet Â’" + stylesheetName +
-               "Â’ can not be formed.");
-    }
-
-    if (!isSuccessful) {
-      throw new TransformerConfigurationException(
-          "Compilation of stylesheet Â’" + stylesheetName + "Â’ failed.");
-    }
-    
-    Translet translet = null;
-    try {
-      Class clazz = Class.forName(transletName);
-      translet = (Translet)clazz.newInstance();
-      ((AbstractTranslet)translet).setTransletName(transletName);
-     } catch (ClassNotFoundException e) {
-         throw new TransformerConfigurationException(
-              "Translet class Â’" + transletName + "Â’ not found.");
-     } catch (InstantiationException e) {
-         throw new TransformerConfigurationException(
-              "Translet class Â’" + transletName +
-              "Â’ could not be instantiated");
-     } catch (IllegalAccessException e) {
-         throw new TransformerConfigurationException(
-             "Translet class Â’" + transletName + "Â’ could not be accessed.");
-     }
-     return (AbstractTranslet)translet;
-  }
-}</source>
-</s4><anchor name="templatescreation"/>
-<s4 title="Templates Creation">
-<p>The JAXP specifies a method that takes the stylesheet as a Source object and returns a
-Templates object.</p>
-<p><code>public Templates newTemplates(Source xslSrc)</code></p>
-<p>To implement this method I needed to create a new class that would be a Templates
-for Translets object. The new class TransletTemplates (org.apache.xalan.xsltc.trax.TransletTemplates) implements the Templates
-interface as is shown below:</p>
-<source>package org.apache.xalan.xsltc.trax;
-
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import java.util.Properties;
-
-public class TransletTemplates implements Templates {
-  public TransletTemplates(Transformer translet) {
-    _translet = (AbstractTranslet)translet;
-  }
-
-  public Properties getOutputProperties() { /*TBD*/ return null; }
-
-  public Transformer newTransformer() throws
-    TransformerConfigurationException
-  {
-    if (_translet == null) {
-      throw new TransformerConfigurationException(
-              "Error: Null Translet");
-    }
-    return _translet;
-  }
-  private AbstractTranslet _translet = null;
-}</source>
-<p>The factory method newTemplates() simply creates a Transformer for the stylesheet,
-and returns a newTransletTemplates object. The implementation of newTemplates()
-is shown below:</p>
-<source>public class TransformerFactoryImpl extends SAXTransformerFactory {
-...
-  public Templates newTemplates(Source stylesheet) throws
-    TransformerConfigurationException
-  {
-    Transformer translet = newTransformer(stylesheet);
-    return new TransletTemplates(translet);
-  }
-}</source>
-<p>This implementation only satisfies the JAXP, it does not address caching of previously
-created translets. This type of mechanism belongs in Templates,where a given
-stylesheet will be compiled one time only, but the generated translet can be cloned to
-create multiple instances upon demand.</p>
-</s4><anchor name="featurediscovery"/>
-<s4 title="Feature Discovery">
-<p>The JAXP specifies a method that allows programs to discover what features the factory
-is capable of supporting.</p>
-<p><code>public boolean getFeature(String featureName)</code></p>
-<p>At this time the new transformer factory supports Stream sources and results, and
-the SAX Transform factory feature. The getFeature() implementation is shown below:</p>
-<source>public class TransformerFactoryImpl extends SAXTransformerFactory {
-  ...
-  public boolean getFeature(String name) {
-    if ((StreamSource.FEATURE == name) ||
-        (StreamResult.FEATURE == name) ||
-        (SAXTransformerFactory.FEATURE == name)) {
-        return true;
-    } else if ((StreamSource.FEATURE.equals(name))
-            || (StreamResult.FEATURE.equals(name))
-            || (SAXTransformerFactory.FEATURE.equals(name))) {
-         return true;
-    } else {
-         return false;
-    }
-  }
-}</source>
-<p>As the other features are implemented, this methods will need to be updated.</p>
-
-</s4><anchor name="limitations"/>
-<s4 title="Limitations">
-<p>As you can see, the prototype will compile the stylesheet everytime. This obviously
-needs to be smarter. This is where the question ”do I already have this translet?” needs
-to be answered. Also for now the translet bytecodes are written out to a File in the current
-working directory, and then instantiated using a Class.forName, newInstance()
-pair. This also needs work. Note the return statement, the Translet is cast to an AbstractTranslet
-which now is a Transformer.</p>
-</s4>
-</s3>
-</s2><anchor name="transform"/>
-<s2 title="AbstractTransletÂ’s transform() Method">
-<p>Now the JAXP program (Proto) shown in the first section has a way to get a Transformer
-factory that can return Translets. The next step of the Proto.java program is
-calling the transform() method and having the Translet process the given XML
-document.</p>
-<p>This requires some surgery in the AbstractTranslet class again. The AbstractTranslet
-already has a transform() method, but its signature is not the same as the
-JAXP Transform signature. In the AbstractTranslet, transform methods expect a DOM
-argument, in some cases a NodeIterator, and a TransletOutputHandler argument. The
-JAXP TransformÂ’s transform() signature requires only the XML document as a Source
-object reference and an outputTarget as a Result object reference. My implementation
-of the JAXP transform() signature is as shown:</p>
-
-<source>public void transform(Source xmlsrc, Result outputTarget)
-  throws TransformerException
-{
-  doTransform( xmlsrc.getSystemId(),
-    ((StreamResult)outputTarget).getOutputStream() );
-}</source>
-<p>This implementation leverages code derived from XSLTCÂ’s DefaultRun class. In
-that class there is a doTransform() method that carries out the work of: (1) parsing the
-input XML document (using a JAXP SAXParserFactory and SAXParser), (2) creating
-a DOMImpl (org.apache.xalan.xsltc.dom.DOMImpl), (3) creating a SAXOutputHandler, and finally (4) calling the translet to
-transform the input XML document (from the DOMImpl).</p>
-<p>The code for doTransform is shown below:</p>
-<source>public abstract class AbstractTranslet extends Transformer implements Translet{
-  ...
-  private void doTransform(String xmlDocName, OutputStream ostream) {
-    try {
-      final Translet translet = (Translet)this; // GTM added
-
-      // Create a SAX parser and get the XMLReader object it uses
-      final SAXParserFactory factory = SAXParserFactory.newInstance();
-      final SAXParser parser = factory.newSAXParser();
-      final XMLReader reader = parser.getXMLReader();
-
-      // Set the DOMÂ’s DOM builder as the XMLReaderÂ’s SAX2 content handler
-      final DOMImpl dom = new DOMImpl();
-      reader.setContentHandler(dom.getBuilder());
-      // Create a DTD monitor and pass it to the XMLReader object
-      final DTDMonitor dtdMonitor = new DTDMonitor();
-      dtdMonitor.handleDTD(reader);
-      dom.setDocumentURI(xmlDocName);
-      /****************
-      if (_uri)
-        reader.parse(xmlDocName);
-      else
-      *******************/
-      reader.parse("file:"+(new File(xmlDocName).getAbsolutePath()));
-
-      // Set size of key/id indices
-      setIndexSize(dom.getSize());
-      // If there are any elements with ID attributes, build an index
-      dtdMonitor.buildIdIndex(dom, 0, this);
-
-      setUnparsedEntityURIs(dtdMonitor.getUnparsedEntityURIs());
-    
-      // Transform the document
-      String encoding = translet.getOutputEncoding();
-      if (encoding == null) encoding = "UTF-8";
-    
-      //TextOutput textOutput = new TextOutput(System.out, encoding);
-      DefaultSAXOutputHandler saxHandler = new
-         DefaultSAXOutputHandler(ostream, encoding);
-      TextOutput textOutput = new TextOutput(saxHandler, encoding);
-      translet.transform(dom, textOutput);
-      textOutput.flush();
-    }
-    catch (TransletException e) {
-      ...
-    }
-    catch (RuntimeException e) {
-      ...
-    }
-    catch (FileNotFoundException e) {
-      ...
-    }
-    catch (MalformedURLException e) {
-      ...
-    }
-    catch (UnknownHostException e) {
-      ...
-    }
-    catch (Exception e) {
-      ...
-    }
-  }
-}</source>
-</s2><anchor name="conclusion"/>
-<s2 title="Conclusion">
-<p>This is the current state of the integration of Translet and TrAX. The JAXP program
-illustrated in the first section (Proto.java) compiles and runs with the changes outlined
-above. The new transformer factory TransformerFactoryImpl supports transformer,
-templates creation, and the feature discovery mechanism. The transformers
-returned from the factory are in fact AbstractTranslet objects. The new class
-TransletTemplates implements the Templates interface for translets. This is the
-result of a first pass implementation, there are many stubbed out methods that need to
-be implemented, translet caching in Templates needs to be implemented and support
-for Source and Result types beyond simple stream types, such as DOM and SAX.</p>
-
-</s2><anchor name="appendix"/>
-<s2 title="Appendix">
-<ul>
-  <li><link anchor="runscript">The Run script</link></li>
-  <li><link anchor="transformerfactoryimpl">TransformerFactoryImpl.java</link></li>
-  <li><link anchor="TransletTemplates">TransletTemplates.java</link></li>
-  <li><link anchor="makefile">The Makefile</link></li>
-</ul>
-<anchor name="runscript"/>
-<s3 title="The Run script">
-<p>By changing the FAC variable I can switch between the two Transformer factory implementations
-for testing.</p>
-<source>#!/bin/ksh
-JAXP=/usr/local/jaxp-1.1/jaxp.jar
-CRIMSON=/usr/local/jaxp-1.1/crimson.jar
-XSLT=/net/bigblock/files18/tmiller/xml-xalan/java/build/classes
-XML=/net/bigblock/files18/tmiller/xml-xalan/java/bin/xml.jar
-BCEL=/net/bigblock/files18/tmiller/xml-xalan/java/bin/BCEL.jar
-JCUP=/net/bigblock/files18/tmiller/xml-xalan/java/bin/java_cup.jar
-JCUPRT=/net/bigblock/files18/tmiller/xml-xalan/java/bin/runtime.jar
-CLASSPATH=${JAXP}:${CRIMSON}:${XSLT}:${XML}:${BCEL}:${JCUP}:${JCUPRT}:.
-FAC=org.apache.xalan.xsltc.trax.TransformerFactoryImpl
-#FAC=org.apache.xalan.processor.TransformerFactoryImpl
-java -classpath ${CLASSPATH} \
-     -Djavax.xml.transform.TransformerFactory=${FAC} \
-     Proto $@</source>
-</s3><anchor name="transformerfactoryimpl"/>
-<s3 title="TransformerFactoryImpl.java">
-
-<source>package org.apache.xalan.xsltc.trax;
-
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.sax.TransformerHandler;
-
-import org.xml.sax.XMLFilter;
-
-import org.apache.xalan.xsltc.Translet;
-import org.apache.xalan.xsltc.compiler.XSLTC;
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-
-import java.io.File;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-/**
- * Implementation of a JAXP1.1 SAXTransformerFactory for Translets.
- */
-public class TransformerFactoryImpl extends SAXTransformerFactory {
-  public TransformerFactoryImpl() { /* nothing yet */ }
-
-  //////////////////////////////////////////////////////
-  // SAXTransformerFactory (subclass of TransformerFactory)
-  //
-  public TemplatesHandler newTemplatesHandler() { /*TBD*/ return null; }
-  public TransformerHandler newTransformerHandler() { /*TBD*/ return null; }
-  public TransformerHandler newTransformerHandler(Source src) {
-     /*TBD*/ return null;
-  }
-  public TransformerHandler newTransformerHandler(Templates templates) {
-     /*TBD*/ return null;
-  }
-  public XMLFilter newXMLFilter(Source src) { /*TBD*/ return null; }
-  public XMLFilter newXMLFilter(Templates templates) { /*TBD*/ return null; }
-
-  //
-  // End SAXTransformerFactory methods
-  //////////////////////////////////////////////////////
-  //////////////////////////////////////////////////////
-  // TransformerFactory
-  //
-  public ErrorListener getErrorListener() { /*TBD*/ return null; }
-  public void setErrorListener(ErrorListener listener) {/*TBD*/ }
-  public Object getAttribute(String name) { /*TBD*/ return null; }
-  public void setAttribute(String name, Object value) { /*TBD*/ }
-  public boolean getFeature(String name) {
-    if ((StreamSource.FEATURE == name) ||
-        (StreamResult.FEATURE == name) ||
-        (SAXTransformerFactory.FEATURE == name)) {
-        return true;
-     } else if ((StreamSource.FEATURE.equals(name))
-             || (StreamResult.FEATURE.equals(name))
-             || (SAXTransformerFactory.FEATURE.equals(name))) {
-        return true;
-     } else {
-        return false;
-    }
-  }
-  public URIResolver getURIResolver() { /*TBD*/ return null; }
-  public void setURIResolver(URIResolver resolver) {/*TBD*/ }
-  public Source getAssociatedStylesheet(Source src, String media,
-       String title, String charset) { /*TBD*/ return null; }
-  public Transformer newTransformer() throws
-    TransformerConfigurationException { /*TBD*/ return null; }
-  //
-  // End TransformerFactory methods
-  //////////////////////////////////////////////////////
-  public Transformer newTransformer(Source stylesheet) throws
-  TransformerConfigurationException
-  {
-    XSLTC xsltc = new XSLTC();
-    xsltc.init();
-    String stylesheetName = stylesheet.getSystemId();
-    int index = stylesheetName.indexOf(Â’.Â’);
-    String transletName = stylesheetName.substring(0,index);
-    boolean isSuccessful = true;
-    try {
-      File file = new File(stylesheetName);
-      URL url = file.toURL();
-      isSuccessful = xsltc.compile(url);
-    } catch (MalformedURLException e) {
-        throw new TransformerConfigurationException(
-            "URL for stylesheet Â’" + stylesheetName +
-            "Â’ can not be formed.");
-    }
-    if (!isSuccessful) {
-      throw new TransformerConfigurationException(
-           "Compilation of stylesheet Â’" + stylesheetName + "Â’ failed.");
-    }
-    
-    Translet translet = null;
-    try {
-      Class clazz = Class.forName(transletName);
-      translet = (Translet)clazz.newInstance();
-      ((AbstractTranslet)translet).setTransletName(transletName);
-    } catch (ClassNotFoundException e) {
-       throw new TransformerConfigurationException(
-            "Translet class Â’" + transletName + "Â’ not found.");
-    } catch (InstantiationException e) {
-        throw new TransformerConfigurationException(
-            "Translet class Â’" + transletName +
-            "Â’ could not be instantiated");
-    } catch (IllegalAccessException e) {
-        throw new TransformerConfigurationException(
-            "Translet class Â’" + transletName + "Â’ could not be accessed.");
-    }
-    return (AbstractTranslet)translet;
-  }
-  public Templates newTemplates(Source stylesheet) throws
-  TransformerConfigurationException
-  {
-  Transformer translet = newTransformer(stylesheet);
-  return new TransletTemplates(translet);
-  }
-}</source>
-</s3><anchor name="translettemplates"/>
-<s3 title="TransletTemplates.java">
-<source>package org.apache.xalan.xsltc.trax;
-
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.SAXTransformerFactory;
-
-import org.apache.xalan.xsltc.runtime.AbstractTranslet;
-import java.util.Properties;
-
-/**
- * Implementation of a JAXP1.1 Templates object for Translets.
- */
-public class TransletTemplates implements Templates {
-  public TransletTemplates(Transformer translet) {
-    _translet = (AbstractTranslet)translet;
-  }
-  public Properties getOutputProperties() { /*TBD*/ return null; }
-  public Transformer newTransformer() throws
-    TransformerConfigurationException
-  {
-    if (_translet == null) {
-      throw new TransformerConfigurationException(
-           "Error: Null Translet");
-    }
-    return _translet;
-  }
-  private AbstractTranslet _translet = null;
-}</source>
-</s3><anchor name="makefile"/> 
-<s3 title="The Makefile">
-<source>JAXP=/usr/local/jaxp-1.1/jaxp.jar
-CRIMSON=/usr/local/jaxp-1.1/crimson.jar
-XSLT=/net/bigblock/files18/tmiller/xml-xalan/java/build/classes
-CLASSPATH=${JAXP}:${CRIMSON}:${XSLT}
-SRCS=\
-Proto.java
-all:
-javac -classpath ${CLASSPATH} ${SRCS}</source>
-</s3>
-</s2>
-</s1>
diff --git a/xdocs/sources/xsltc/xsltover.xml b/xdocs/sources/xsltc/xsltover.xml
deleted file mode 100644
index 155782c..0000000
--- a/xdocs/sources/xsltc/xsltover.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
-
-<!--
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- -->
- 
-
-<s1 title="XSLT Compiler and Runtime">
-   
-   <s2 title="Using the Command-Line Utility">
-
-   </s2>
-</s1>
diff --git a/xdocs/style/dtd/spec.dtd b/xdocs/style/dtd/spec.dtd
deleted file mode 100644
index 8720289..0000000
--- a/xdocs/style/dtd/spec.dtd
+++ /dev/null
@@ -1,578 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ============================================================= -->
-<!--  MODULE:    spec DTD                                          -->
-<!--  VERSION:   1.0                                               -->
-<!--  DATE:      October 18, 2000                                  -->
-
-
-<!-- ============================================================= -->
-<!--                   ISO STANDARD SPECIAL CHARACTER SETS         -->
-<!-- ============================================================= -->
-<!--
-<!ENTITY % isolat1      PUBLIC
-"ISO 8879-1986//ENTITIES Added Latin 1//EN"
-"entities/ISOlat1.pen"
-                                                                    >
-
-<!ENTITY % isonum       PUBLIC
-"ISO 8879-1986//ENTITIES Numeric and Special Graphic//EN"
-"entities/ISOnum.pen"
-                                                                    >
-
-<!ENTITY % isopub       PUBLIC
-"ISO 8879-1986//ENTITIES Publishing//EN"
-"entities/ISOpub.pen"
-                                                                    >
-
-<!ENTITY % isotech      PUBLIC
-"ISO 8879-1986//ENTITIES General Technical//EN"
-"entities/ISOtech.pen"
-                                                                    >
-
-%isolat1; %isonum; %isopub; %isotech;
--->
-
-<!-- ============================================================= -->
-<!--                    parameter entities for content models      -->
-<!-- ============================================================= -->
-
-
-<!--                    list elements                              -->
-<!ENTITY % lists       "itemizedlist | orderedlist | variablelist"   >
-
-
-<!--                    linespecific elements                      -->
-<!--                    elements where line endings and whitespace
-                        are significant                            -->
-<!ENTITY % linespecific
-                       "literallayout | programlisting"              >
-
-
-<!--                    phrase-level elements                      -->
-<!--                    elements allowed at the same level as text -->
-<!ENTITY % phraselevel "citation | emphasis | inlinegraphic | link | plink |
-                        subscript | superscript | ulink | termref"   >
-
-
-<!--                    paragraph-level elements                   -->
-<!--                    elements (including paragraphs) allowed at
-                        the level of paragraphs                    -->
-<!ENTITY % paralevel   "%linespecific; | %lists; | note | para | issue |
-                        table | figure | graphic"                    >
-
-
-<!-- ============================================================= -->
-<!--                    parameter entities for attributes          -->
-<!-- ============================================================= -->
-
-
-<!--                    common attributes                          -->
-<!ENTITY % common.atts
-             "id         ID                                 #IMPLIED
-              link-url   CDATA                              #IMPLIED" >
-
-<!--                    graphic-related attributes                 -->
-<!ENTITY % graphic.atts
-            "fileref    CDATA                              #IMPLIED
-             alt        CDATA                              #IMPLIED
-             srccredit  CDATA                              #IMPLIED
-             width      NMTOKEN                            #IMPLIED
-             depth      NMTOKEN                            #IMPLIED
-             scale      NMTOKEN                            #IMPLIED
-             scalefit   NMTOKEN                            #IMPLIED" >
-
-<!-- ============================================================= -->
-<!--                    external modules                           -->
-<!-- ============================================================= -->
-
-<!--
-<!ENTITY % table.ent SYSTEM "table.ent"                              >
-%table.ent;
--->
-
-<!-- ============================================================= -->
-<!--                    element definitions                        -->
-<!-- ============================================================= -->
-
-
-<!--                    specification                              -->
-<!ELEMENT  spec         (title, frontmatter, introduction, requirements, model, sect1+,
-                         appendix*, bibliography?)                   >
-
-<!ATTLIST  spec
-            %common.atts;                                            >
-
-<!ELEMENT  frontmatter   (pubdate, copyright, author*, abstract?)    >
-
-<!--                    title                                      -->
-<!ELEMENT  title        (#PCDATA | %phraselevel;)*                   >
-<!ATTLIST  title
-            %common.atts;                                            >
-
-
-<!--                    issue                                      -->
-<!ELEMENT  issue        (#PCDATA | %phraselevel;)*                   >
-<!ATTLIST  issue
-            %common.atts;                                            >
-
-
-<!--                    publication date                           -->
-<!--                    publication date and, possibly, time       -->
-<!ELEMENT  pubdate      (#PCDATA)                                    >
-<!ATTLIST  pubdate
-            %common.atts;                                            >
-
-
-<!--                    copyright statement                        -->
-<!ELEMENT  copyright    (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  copyright
-            %common.atts;                                            >
-
-
-<!--                    author                                     -->
-<!ELEMENT  author       (firstname, surname, jobtitle?, orgname?,
-                         address?)                                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  author
-            %common.atts;                                            >
-
-
-<!--                    abstract                                   -->
-<!ELEMENT  abstract     (para+)                                      >
-<!--         id         unique identifier                          -->
-<!ATTLIST  abstract
-            %common.atts;                                            >
-
-<!ELEMENT  introduction        (title, (((%paralevel;)+, sect2*) | sect2+)) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  introduction
-            %common.atts;                                            >
-
-<!ELEMENT  requirements        (title, (((%paralevel;)+, sect2*) | sect2+)) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  requirements
-            %common.atts; >    
-
-<!ELEMENT  model        (title, (((%paralevel;)+, patterns) | sect2+)) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  model
-            %common.atts;                                            >
-
-<!ELEMENT  patterns        (pattern+) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  patterns
-            %common.atts; 
-			module  CDATA                              #IMPLIED
-            > 
-                        
-<!ELEMENT  pattern        (pattern-name, potential-alternate-name?, intent, responsibilities, thread-safety, notes?) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  pattern
-            %common.atts;  
-                                                      >
-<!ELEMENT  pattern-name        (#PCDATA | %phraselevel;)* >
-<!--         id         unique identifier                          -->
-<!ATTLIST  pattern-name
-            %common.atts; >
-            
-<!ELEMENT  potential-alternate-name        (#PCDATA | %phraselevel;)* >
-<!--         id         unique identifier                          -->
-<!ATTLIST  potential-alternate-name
-            %common.atts; >  
-
-<!ELEMENT  intent        (#PCDATA | %phraselevel;)* >
-<!--         id         unique identifier                          -->
-<!ATTLIST  intent
-            %common.atts; >  
-
-<!ELEMENT  responsibilities        (#PCDATA | %phraselevel;)* >
-<!--         id         unique identifier                          -->
-<!ATTLIST  responsibilities
-            %common.atts; >  
-
-<!ELEMENT  thread-safety        (#PCDATA | %phraselevel;)* >
-<!--         id         unique identifier                          -->
-<!ATTLIST  thread-safety
-            %common.atts; >
-
-<!ELEMENT  notes         (#PCDATA | %phraselevel;)*                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  notes
-            %common.atts;                                            >
-
-<!--         id         unique identifier                          -->
-<!ATTLIST  sect1
-            %common.atts;                                            >
-
-<!--                    section 1                                  -->
-<!ELEMENT  sect1        (title, (((%paralevel;)+, sect2*) | sect2+)) >						   
-<!--                    section 2                                  -->
-<!ELEMENT  sect2        (title, (((%paralevel;)+, sect3*) | sect3+)) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  sect2
-            %common.atts;                                            >
-
-
-<!--                    section 3                                  -->
-<!ELEMENT  sect3        (title, (((%paralevel;)+, sect4*) | sect4+)) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  sect3
-            %common.atts;                                            >
-
-
-<!--                    section 4                                  -->
-<!ELEMENT  sect4        (title, (%paralevel;)+)                      >
-<!--         id         unique identifier                          -->
-<!ATTLIST  sect4
-            %common.atts;                                            >
-
-
-<!--                    appendix                                   -->
-<!ELEMENT  appendix     (title, (((%paralevel;)+, sect1*) | sect1+)) >
-<!--         id         unique identifier                          -->
-<!ATTLIST  appendix
-            %common.atts;                                            >
-
-
-<!--                    bibliography                               -->
-<!ELEMENT  bibliography (title, biblioitem+)                         >
-<!--         id         unique identifier                          -->
-<!ATTLIST  bibliography
-            %common.atts;                                            >
-
-
-<!--                    bibliography item                          -->
-<!ELEMENT  biblioitem   (designator, biblioentry)                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  biblioitem
-            %common.atts;                                            >
-
-
-<!--                    bibliography item designator               -->
-<!--                    designator contains whatever designator the
-                        author uses to identify publications listed in
-                        the bibliography (e.g., [lab 87]).  the
-                        stylesheet generates the square "[]" brackets
-                        fore & aft.                                -->
-<!ELEMENT  designator   (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  designator
-            %common.atts;                                            >
-
-
-<!--                    bibliography entry                         -->
-<!ELEMENT  biblioentry  (#PCDATA | %phraselevel;)*                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  biblioentry
-            %common.atts;                                            >
-
-
-<!-- ============================================================= -->
-<!--                    author-related elements                    -->
-<!-- ============================================================= -->
-
-
-<!--                    first name                                 -->
-<!ELEMENT  firstname    (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  firstname
-            %common.atts;                                            >
-
-
-<!--                    surname                                    -->
-<!ELEMENT  surname      (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  surname
-            %common.atts;                                            >
-
-
-<!--                    job title                                  -->
-<!ELEMENT  jobtitle     (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  jobtitle
-            %common.atts;                                            >
-
-
-<!--                    organization name                          -->
-<!ELEMENT  orgname      (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  orgname
-            %common.atts;                                            >
-
-
-<!--                    address                                    -->
-<!ELEMENT  address      (street?, pob?, city?, state?, postcode?, 
-                         country?, phone?, fax?, email?)             >
-<!--         id         unique identifier                          -->
-<!ATTLIST  address
-            %common.atts;                                            >
-
-
-<!-- ============================================================= -->
-<!--                    address elements                           -->
-<!-- ============================================================= -->
-
-
-<!--                    street address                             -->
-<!ELEMENT  street       (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  street
-            %common.atts;                                            >
-
-
-<!--                    post office box                            -->
-<!ELEMENT  pob          (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  pob
-            %common.atts;                                            >
-
-
-<!--                    postcode                                   -->
-<!ELEMENT  postcode     (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  postcode
-            %common.atts;                                            >
-
-
-<!--                    city                                       -->
-<!ELEMENT  city         (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  city
-            %common.atts;                                            >
-
-
-<!--                    state                                      -->
-<!ELEMENT  state        (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  state
-            %common.atts;                                            >
-
-
-<!--                    country                                    -->
-<!ELEMENT  country      (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  country
-            %common.atts;                                            >
-
-
-<!--                    phone number                               -->
-<!ELEMENT  phone        (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  phone
-            %common.atts;                                            >
-
-
-<!--                    fax number                                 -->
-<!ELEMENT  fax          (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  fax
-            %common.atts;                                            >
-
-
-<!--                    email address                              -->
-<!ELEMENT  email        (#PCDATA)                                    >
-<!--         id         unique identifier                          -->
-<!ATTLIST  email
-            %common.atts;                                            >
-
-
-<!-- ============================================================= -->
-<!--                    paragraph-level elements                   -->
-<!-- ============================================================= -->
-
-
-<!--                    paragraph                                  -->
-<!ELEMENT  para         (#PCDATA | %phraselevel;)*                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  para
-            %common.atts;                                            >
-
-
-<!--                    note                                       -->
-<!ELEMENT  note         (%paralevel;)+                               >
-<!--         id         unique identifier                          -->
-<!ATTLIST  note
-            %common.atts;                                            >
-
-
-<!--                    itemized list                              -->
-<!ELEMENT  itemizedlist (listitem+)                                  >
-<!--         id         unique identifier                          -->
-<!ATTLIST  itemizedlist
-            %common.atts;                                            >
-
-
-<!--                    ordered list                               -->
-<!ELEMENT  orderedlist  (listitem+)                                  >
-<!--         id         unique identifier                          -->
-<!ATTLIST  orderedlist
-            %common.atts;                                            >
-
-
-<!--                    variable list                              -->
-<!ELEMENT  variablelist (varlistentry+)                              >
-<!--         id         unique identifier                          -->
-<!ATTLIST  variablelist
-            %common.atts;                                            >
-
-
-<!--                    list item                                  -->
-<!ELEMENT  listitem     (#PCDATA | %phraselevel; | %paralevel;)*     >
-<!--         id         unique identifier                          -->
-<!ATTLIST  listitem
-            %common.atts;                                            >
-
-
-<!--                    variable list entry                        -->
-<!ELEMENT  varlistentry (term+, listitem)                            >
-<!--         id         unique identifier                          -->
-<!ATTLIST  varlistentry
-            %common.atts;                                            >
-
-
-<!--                    term                                       -->
-<!ELEMENT  term         (#PCDATA | %phraselevel;)*                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  term
-            %common.atts;                                            >
-
-<!--                    termref                                       -->
-<!ELEMENT  termref         (#PCDATA | %phraselevel;)*                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  termref
-            %common.atts;	   >
-
-<!--                    literal layout                             -->
-<!ELEMENT  literallayout
-                        (#PCDATA | %phraselevel;)*                   >
-<!--         xml:space  whitespace handling
-             id         unique identifier                          -->
-<!ATTLIST  literallayout
-            %common.atts;                                            >
-
-
-<!--                    program listing                            -->
-<!ELEMENT  programlisting
-                        (#PCDATA | %phraselevel;)*                   >
-<!--         xml:space  whitespace handling
-             id         unique identifier                          -->
-<!ATTLIST  programlisting
-            %common.atts;                                            >
-
-
-<!--                    figure                                     -->
-<!ELEMENT  figure       (title, graphic)                             >
-<!--         id         unique identifier                          -->
-<!ATTLIST  figure
-            %common.atts;                                            >
-
-
-<!--                    graphic                                    -->
-<!ELEMENT  graphic      EMPTY                                        >
-<!--         align      alignment of graphic image.  values are:
-                          left          left aligned
-                          right         right aligned
-                          center        centered
-             fileref    path to external file
-             alt        alternate text
-             srccredit  source of graphic
-             width      width of area in which to fit graphic
-             depth      depth of area in which to fit graphic
-             scale      percentage scaling factor
-             scalefit   scale to fit width and/or depth
-             id         unique identifier                          -->
-<!ATTLIST  graphic
-             align      (left |right |center)              #IMPLIED
-            %graphic.atts;
-            %common.atts;                                            >
-
-<!--                    inline graphic                             -->
-<!ELEMENT  inlinegraphic
-                        EMPTY                                        >
-<!--         fileref    path to external file
-             alt        alternate text
-             srccredit  source of graphic
-             width      width of area in which to fit graphic
-             depth      depth of area in which to fit graphic
-             scale      percentage scaling factor
-             scalefit   scale to fit width and/or depth
-             id         unique identifier                          -->
-<!ATTLIST  inlinegraphic
-            %graphic.atts;
-            %common.atts;                                            >
-
-<!-- ============================================================= -->
-<!--                    text-level elements                        -->
-<!-- ============================================================= -->
-
-
-<!--                    bibliographic citation                     -->
-<!--                    a <citation> appears in the body of the
-                        article, and it refers through its
-                        "linkend" attribute to the id of the
-                        relevant bibliography item.
-                          the <citation> receives the same
-                        formatting as the <designator> element
-                        within the <biblioitem> being referenced.
-                        for example, when for the bibitem
-                        <biblioitem id="bib1"><designator>lab
-                        87</designator>...</biblioitem> is
-                        formatted as "[lab 87]", the bibliographic
-                        citation <citation linkend="bib1">lab
-                        87</citation> also formats as "[lab 87]".  -->
-<!ELEMENT  citation     (#PCDATA | emphasis | inlinegraphic |
-                         subscript | superscript)*                   >
-<!--         linkend    id of referenced bibliography entry
-             id         unique identifier                          -->
-<!ATTLIST  citation
-             linkend    IDREF                              #REQUIRED
-            %common.atts;                                            >
-
-
-<!--                    emphasis                                   -->
-<!ELEMENT  emphasis     (#PCDATA | %phraselevel;)*                   >
-<!--         id         unique identifier                          -->
-<!ATTLIST  emphasis
-            %common.atts;                                            >
-
-
-<!--                    subscript                                  -->
-<!ELEMENT  subscript    (#PCDATA | emphasis | subscript |
-                         superscript)*                               >
-<!--         id         unique identifier                          -->
-<!ATTLIST  subscript
-            %common.atts;                                            >
-
-
-<!--                    superscript                                -->
-<!ELEMENT  superscript  (#PCDATA | emphasis | subscript |
-                         superscript)*                               >
-<!--         id         unique identifier                          -->
-<!ATTLIST  superscript
-            %common.atts;                                            >
-
-
-<!--                    link                                       -->
-<!ELEMENT  link         (#PCDATA)                                    >
-<!--         linkend    id of referenced element
-             id         unique identifier                          -->
-<!ATTLIST  link
-             linkend    IDREF                              #REQUIRED
-            %common.atts;                                            >
-
-<!--  package link (for {@link org.xml.trax.Processor} type links, for javadocs.                              -->
-<!ELEMENT  plink         (#PCDATA)                                   >
-<!ATTLIST  plink
-            %common.atts;                                            >
-
-<!--                    ulink (external link)                      -->
-<!ELEMENT  ulink        (#PCDATA)                                    >
-<!--         url        uniform resource locator; the target of the
-                        ulink
-             id         unique identifier                          -->
-<!ATTLIST  ulink
-             url        CDATA                              #REQUIRED
-            %common.atts;                                            >
-
-
diff --git a/xdocs/style/dtd/xsl-html40s.dtd b/xdocs/style/dtd/xsl-html40s.dtd
deleted file mode 100644
index a8848bd..0000000
--- a/xdocs/style/dtd/xsl-html40s.dtd
+++ /dev/null
@@ -1,1505 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- 
-     XSLT (WD-19990813) DTD and HTML 4.0 Strict (REC-HTML40-19980424) DTD
-     This DTD defines a XSLT stylesheet with a result-ns of html
-
-     Credits:
-       Original XSLT DTD from W3C XSLT WD-19990813
-       Original XML  DTD for HTML 4.0 Strict by
-         TAMURA, Kent <kent@trl.ibm.co.jp>, for IBM's XML4J package
-       Minor fixes to XSLT & HTML DTDs by 
-         Scott Boag <scott_boag@lotus.com>
-         Henrique M. Holschuh <henriqmh@dca.fee.unicamp.br>
-       HTML/XSLT composite DTD by
-         Henrique M. Holschuh <henriqmh@dca.fee.unicamp.br>
-
-     Caveats: It is possible to generate invalid XSLT and HTML documents 
-       using this DTD, as the result-ns elements (HTML) must allow all 
-       possible xsl elements as content, and all result-ns elements had 
-       to be relaxed on their element content rules.
-
-     TODO:
-       - A XSLT/XHTML1.0 Strict DTD to use instead of this one. Lowercase
-         element names allow for better compression ratios, at least in
-         English documents.
-       - Update to HTML 4.01
-
-     $Id$
--->
-
-<!-- Predefined XML (REC-XML-19980210) entities -->
-<!ENTITY lt     "&#38;#60;">
-<!ENTITY gt     "&#62;">
-<!ENTITY amp    "&#38;#38;">
-<!ENTITY apos   "&#39;">
-<!ENTITY quot   "&#34;">
-
-<!-- 
-  Result elements allowed (inside xsl elements). These are actually
-  all of the HTML40 Strict elements. 
--->
-
-<!ENTITY % result-elements "
-  | TT
-  | I
-  | B
-  | BIG
-  | SMALL
-  | EM
-  | STRONG
-  | DFN
-  | CODE
-  | SAMP
-  | KBD
-  | VAR
-  | CITE
-  | ABBR
-  | ACRONYM
-  | SUP
-  | SUB
-  | SPAN
-  | BDO
-  | BR
-  | BODY
-  | ADDRESS
-  | DIV
-  | A
-  | MAP
-  | AREA
-  | LINK
-  | IMG
-  | OBJECT
-  | PARAM
-  | HR
-  | P
-  | H1
-  | H2
-  | H3
-  | H4
-  | H5
-  | H6
-  | PRE
-  | Q
-  | BLOCKQUOTE
-  | INS
-  | DEL
-  | DL
-  | DT
-  | DD
-  | OL
-  | UL
-  | LI
-  | FORM
-  | LABEL
-  | INPUT
-  | SELECT
-  | OPTGROUP
-  | OPTION
-  | TEXTAREA
-  | FIELDSET
-  | LEGEND
-  | BUTTON
-  | TABLE
-  | CAPTION
-  | THEAD
-  | TFOOT
-  | TBODY
-  | COLGROUP
-  | COL
-  | TR
-  | TH
-  | TD
-  | HEAD
-  | TITLE
-  | BASE
-  | META
-  | STYLE
-  | SCRIPT
-  | NOSCRIPT
-  | HTML
-">
-
-<!-- begin XSLT DTD, patched -->
-
-<!ENTITY % char-instructions "
- | xsl:apply-templates
- | xsl:call-template
- | xsl:apply-imports
- | xsl:for-each
- | xsl:value-of
- | xsl:copy-of
- | xsl:number
- | xsl:choose
- | xsl:if
- | xsl:text
- | xsl:copy
- | xsl:variable
- | xsl:message
-">
-
-<!ENTITY % instructions "
- %char-instructions;
- | xsl:processing-instruction
- | xsl:comment
- | xsl:element
- | xsl:attribute
-">
-
-<!ENTITY % char-template "
-(#PCDATA
- %char-instructions;)*
-">
-
-<!ENTITY % template "
-(#PCDATA
- %instructions;
- %result-elements;)*
-">
-
-<!-- Used for the type of an attribute value that is a URI reference.-->
-<!ENTITY % URI "CDATA">
-
-<!-- Used for the type of an attribute value that is a pattern.-->
-<!ENTITY % pattern "CDATA">
-
-<!-- Used for the type of an attribute value that is an
-    attribute value template.-->
-<!ENTITY % avt "CDATA">
-
-<!-- Used for the type of an attribute value that is a QName; the prefix
-    gets expanded by the XSLT processor. -->
-<!ENTITY % qname "NMTOKEN">
-
-<!-- Like qname but a whitespace-separated list of QNames. -->
-<!ENTITY % qnames "NMTOKENS">
-
-<!-- Used for the type of an attribute value that is an expression.-->
-<!ENTITY % expr "CDATA">
-
-<!-- Used for the type of an attribute value that consists
-    of a single character.-->
-<!ENTITY % char "CDATA">
-
-<!-- Used for the type of an attribute value that is a priority. -->
-<!ENTITY % priority "NMTOKEN">
-
-<!ENTITY % space-att "xml:space (default|preserve) #IMPLIED">
-
-<!-- This may be overridden to customize the set of elements allowed
-at the top-level. -->
-
-<!ENTITY % non-xsl-top-level "">
-
-<!ENTITY % top-level "
-(xsl:import*,
- (xsl:include
- | xsl:strip-space
- | xsl:preserve-space
- | xsl:output
- | xsl:key
- | xsl:locale
- | xsl:attribute-set
- | xsl:variable
- | xsl:param
- | xsl:template
- %non-xsl-top-level;)*)
-">
-
-<!-- added xmlns attribute suitable for this DTD -->
-<!ENTITY % top-level-atts '
- extension-element-prefixes CDATA #IMPLIED
- id ID #IMPLIED
- xmlns:xsl CDATA #FIXED "http://www.w3.org/XSL/1999/Transform"
- xmlns CDATA #FIXED "http://www.w3.org/TR/REC-html40"
- %space-att;
-'>
-
-<!-- This entity is defined for use in the ATTLIST declaration
-for result elements. -->
-
-<!ENTITY % result-element-atts '
- xsl:extension-element-prefixes CDATA #IMPLIED
- xsl:use-attribute-sets %qnames; #IMPLIED
-'>
-
-<!ELEMENT xsl:stylesheet %top-level;>
-<!ATTLIST xsl:stylesheet %top-level-atts;>
-
-<!ELEMENT xsl:transform %top-level;>
-<!ATTLIST xsl:transform %top-level-atts;>
-
-<!ELEMENT xsl:import EMPTY>
-<!ATTLIST xsl:import href %URI; #REQUIRED>
-
-<!ELEMENT xsl:include EMPTY>
-<!ATTLIST xsl:include href %URI; #REQUIRED>
-
-<!ELEMENT xsl:strip-space EMPTY>
-<!ATTLIST xsl:strip-space elements CDATA #REQUIRED>
-
-<!ELEMENT xsl:preserve-space EMPTY>
-<!ATTLIST xsl:preserve-space elements CDATA #REQUIRED>
-
-<!ELEMENT xsl:output EMPTY>
-<!ATTLIST xsl:output
- method %qname; #IMPLIED
- version NMTOKEN #IMPLIED
- encoding NMTOKEN #IMPLIED
- xml-declaration (yes|no) #IMPLIED
- standalone (yes|no) #IMPLIED
- doctype-public CDATA #IMPLIED
- doctype-system CDATA #IMPLIED
- cdata-section-elements %qnames; #IMPLIED
- indent (yes|no) #IMPLIED
- media-type CDATA #IMPLIED
->
-
-<!ELEMENT xsl:key EMPTY>
-<!ATTLIST xsl:key
- name %qname; #REQUIRED
- match %pattern; #REQUIRED
- use %expr; #REQUIRED
->
-
-<!ELEMENT xsl:locale EMPTY>
-<!ATTLIST xsl:locale
- name %qname; #IMPLIED
- decimal-separator %char; "."
- grouping-separator %char; ","
- infinity CDATA "&#x221E;"
- minus-sign %char; "-"
- NaN CDATA "&#xFFFD;"
- percent %char; "%"
- per-mille %char; "&#x2030;"
- zero-digit %char; "0"
- digit %char; "#"
- pattern-separator %char; ";"
->
-
-<!ELEMENT xsl:template
-(#PCDATA
- %instructions;
- %result-elements;
- | xsl:param)*
->
-
-<!ATTLIST xsl:template
- match %pattern; #IMPLIED
- name %qname; #IMPLIED
- priority %priority; #IMPLIED
- mode %qname; #IMPLIED
- %space-att;
->
-
-<!ELEMENT xsl:value-of EMPTY>
-<!ATTLIST xsl:value-of
- select %expr; #REQUIRED
- disable-output-escaping (yes|no) "no"
->
-
-<!ELEMENT xsl:copy-of EMPTY>
-<!ATTLIST xsl:copy-of select %expr; #REQUIRED>
-
-<!ELEMENT xsl:number EMPTY>
-<!ATTLIST xsl:number
-  level (single|multiple|any) "single"
-  count %pattern; #IMPLIED
-  from %pattern; #IMPLIED
-  value %expr; #IMPLIED
-  format %avt; '1'
-  lang %avt; #IMPLIED
-  letter-value %avt; #IMPLIED
-  grouping-separator%avt; #IMPLIED
-  grouping-size %avt; #IMPLIED
->
-
-<!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*>
-<!ATTLIST xsl:apply-templates
- select %expr; "node()"
- mode %qname; #IMPLIED
->
-
-<!ELEMENT xsl:apply-imports EMPTY>
-
-<!-- xsl:sort cannot occur after any other elements or
-any non-whitespace character -->
-
-<!ELEMENT xsl:for-each
-(#PCDATA
- %instructions;
- %result-elements;
- | xsl:sort)*
->
-
-<!ATTLIST xsl:for-each
- select %expr; #REQUIRED
- %space-att;
->
-
-<!ELEMENT xsl:sort EMPTY>
-<!ATTLIST xsl:sort
- select %expr; "."
- lang %avt; #IMPLIED
- data-type %avt; "text"
- order %avt; "ascending"
- case-order %avt; #IMPLIED
->
-
-<!ELEMENT xsl:if %template;>
-<!ATTLIST xsl:if
- test %expr; #REQUIRED
- %space-att;
->
-
-<!ELEMENT xsl:choose (xsl:when+, xsl:otherwise?)>
-<!ATTLIST xsl:choose %space-att;>
-
-<!ELEMENT xsl:when %template;>
-<!ATTLIST xsl:when
- test %expr; #REQUIRED
- %space-att;
->
-
-<!ELEMENT xsl:otherwise %template;>
-<!ATTLIST xsl:otherwise %space-att;>
-
-<!ELEMENT xsl:attribute-set (xsl:attribute)*>
-<!ATTLIST xsl:attribute-set
- name %qname; #REQUIRED
- use-attribute-sets %qnames; #IMPLIED
->
-
-<!ELEMENT xsl:call-template (xsl:with-param)*>
-<!ATTLIST xsl:call-template
- name %qname; #REQUIRED
->
-
-<!ELEMENT xsl:with-param %template;>
-<!ATTLIST xsl:with-param
- name %qname; #REQUIRED
- select %expr; #IMPLIED
->
-
-<!ELEMENT xsl:variable %template;>
-<!ATTLIST xsl:variable 
- name %qname; #REQUIRED
- select %expr; #IMPLIED
->
-
-<!ELEMENT xsl:param %template;>
-<!ATTLIST xsl:param 
- name %qname; #REQUIRED
- select %expr; #IMPLIED
->
-
-<!ELEMENT xsl:text (#PCDATA)>
-<!ATTLIST xsl:text
- disable-output-escaping (yes|no) "no"
->
-
-<!ELEMENT xsl:processing-instruction %char-template;>
-<!ATTLIST xsl:processing-instruction 
- name %avt; #REQUIRED
- %space-att;
->
-
-<!ELEMENT xsl:element %template;>
-<!ATTLIST xsl:element 
- name %avt; #REQUIRED
- namespace %avt; #IMPLIED
- use-attribute-sets %qnames; #IMPLIED
- %space-att;
->
-
-<!ELEMENT xsl:attribute %char-template;>
-<!ATTLIST xsl:attribute 
- name %avt; #REQUIRED
- namespace %avt; #IMPLIED
- %space-att;
->
-
-<!ELEMENT xsl:comment %char-template;>
-<!ATTLIST xsl:comment %space-att;>
-
-<!ELEMENT xsl:copy %template;>
-<!ATTLIST xsl:copy
- %space-att;
- use-attribute-sets %qnames; #IMPLIED
->
-
-<!ELEMENT xsl:message %template;>
-<!ATTLIST xsl:message %space-att;>
-
-<!ELEMENT xsl:fallback %template;>
-<!ATTLIST xsl:fallback %space-att;>
-
-
-
-<!-- ######################################################################## -->
-<!--   HTML 4.0 Strict DTD   (revised to allow for xsl content)               -->
-<!--   Original DTD from XML4J package                                        -->
-<!--   Original SGML to XML conversion by TAMURA, Kent for IBM's XML4J        -->
-
-<!-- 
-     Container for all xsl elements allowed inside result-elements elements,
-     i.e.: all xsl elements which are valid where a result-element is valid,
-     and therefore must be valid inside ALL non-empty HTML elements.
-
-     You'll notice this does allow the user to create invalid XSL documents.
-
-  xsl:sort, xsl:param, xsl:param-variable were not inluded because
-  IMHO it is bad practice (and an error?) not to include them before 
-  other siblings, especially result-ns ones.
--->
-
-<!-- While the content should be simply %instructions; we cannot do that
-     due to the first '|' in %instructions -->
-<!ENTITY % xsl-valid-in-resultns "
-  xsl:processing-instruction
-  | xsl:comment
-  | xsl:element
-  | xsl:attribute
-  %char-instructions;
-">
-
-<!-- Also, %result-element-atts; was added to the ATTLIST of all html
-     elments -->
-
-<!-- Revision: 23 1.3 docs/data/HTML40strict.xml.dtd, xml4jdocs, xml4j-jtcsv, xml4j_1_1_9  -->
-
-<!--
-    This is HTML 4.0 Strict DTD, which excludes the presentation 
-    attributes and elements that W3C expects to phase out as 
-    support for style sheets matures. Authors should use the Strict
-    DTD when possible, but may use the Transitional DTD when support
-    for presentation attribute and elements is required.
-    
-    HTML 4.0 includes mechanisms for style sheets, scripting,
-    embedding objects, improved support for right to left and mixed
-    direction text, and enhancements to forms for improved
-    accessibility for people with disabilities.
-
-          Draft: Date: 1998/07/06 17:50:32
-
-          Authors:
-              Dave Raggett <dsr@w3.org>
-              Arnaud Le Hors <lehors@w3.org>
-              Ian Jacobs <ij@w3.org>
-
-    Further information about HTML 4.0 is available at:
-
-        http://www.w3.org/TR/REC-html40
--->
-
-<!--
-    ================================================================
-    Modified for XML 1.0 by:
-	"TAMURA, Kent" <kent@trl.ibm.co.jp>
-
-    o HTMLspecial, HTMLsymbol, HTMLlat1 aren't included in this DTD.
-    o The `lang' attribute was renamed to `xml:lang'.
-
-
-    Typical usage:
-
-    <?xml version="1.0" encoding="..."?>
-    <!DOCTYPE HTML SYSTEM ".../HTML40strict.xml.dtd">
-    <HTML>
-      <HEAD>
-        ...
-        <TITLE>...</TITLE>
-        ...
-      </HEAD>
-      <BODY>
-        ...
-      </BODY>
-    </HTML>
-
-    Note: XML is case-sensitive.  So element names must be written
-    in uppercase and attribute names must be written in lowercase.
-    ================================================================
--->
-
-<!--
-    Typical usage:
-
-    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
-            "http://www.w3.org/TR/REC-html40/strict.dtd">
-    <html>
-    <head>
-    ...
-    </head>
-    <body>
-    ...
-    </body>
-    </html>
-
-    The URI used as a system identifier with the public identifier allows
-    the user agent to download the DTD and entity sets as needed.
-
-    The FPI for the Transitional HTML 4.0 DTD is:
-
-        "-//W3C//DTD HTML 4.0 Transitional//EN"
-
-    and its URI is:
-
-        http://www.w3.org/TR/REC-html40/loose.dtd
-
-    If you are writing a document that includes frames, use 
-    the following FPI:
-
-        "-//W3C//DTD HTML 4.0 Frameset//EN"
-
-    with the URI:
-
-        http://www.w3.org/TR/REC-html40/frameset.dtd
-
-    The following URIs are supported in relation to HTML 4.0
-
-    "http://www.w3.org/TR/REC-html40/strict.dtd" (Strict DTD)
-    "http://www.w3.org/TR/REC-html40/loose.dtd" (Loose DTD)
-    "http://www.w3.org/TR/REC-html40/frameset.dtd" (Frameset DTD)
-    "http://www.w3.org/TR/REC-html40/HTMLlat1.ent" (Latin-1 entities)
-    "http://www.w3.org/TR/REC-html40/HTMLsymbol.ent" (Symbol entities)
-    "http://www.w3.org/TR/REC-html40/HTMLspecial.ent" (Special entities)
-
-    These URIs point to the latest version of each file. To reference
-    this specific revision use the following URIs:
-
-    "http://www.w3.org/TR/REC-html40-971218/strict.dtd"
-    "http://www.w3.org/TR/REC-html40-971218/loose.dtd"
-    "http://www.w3.org/TR/REC-html40-971218/frameset.dtd"
-    "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent"
-    "http://www.w3.org/TR/REC-html40-971218/HTMLsymbol.ent"
-    "http://www.w3.org/TR/REC-html40-971218/HTMLspecial.ent"
-
--->
-
-<!--=== for XML ===-->
-<!ENTITY % Number "CDATA">
-<!ENTITY % Name "NMTOKEN">
-
-
-<!--================== Imported Names ====================================-->
-
-<!ENTITY % ContentType "CDATA"
-> <!-- media type, as per [RFC2045]
-    -->
-
-<!ENTITY % ContentTypes "CDATA"
-> <!-- comma-separated list of media types, as per [RFC2045]
-    -->
-
-<!ENTITY % Charset "CDATA"
-> <!-- a character encoding, as per [RFC2045]
-    -->
-
-<!ENTITY % Charsets "CDATA"
-> <!-- a space separated list of character encodings, as per [RFC2045]
-    -->
-
-<!ENTITY % LanguageCode "NMTOKEN"
-> <!-- a language code, as per [RFC1766]
-    -->
-
-<!ENTITY % Character "CDATA"
-> <!-- a single character from [ISO10646] 
-    -->
-
-<!ENTITY % LinkTypes "CDATA"
-> <!-- space-separated list of link types
-    -->
-
-<!ENTITY % MediaDesc "CDATA"
-> <!-- single or comma-separated list of media descriptors
-    -->
-
-<!-- Defined elsewhere in this DTD
-<!ENTITY % URI "CDATA"
-> <! a Uniform Resource Identifier,
-       see [URI]
-    -->
-
-<!ENTITY % Datetime "CDATA"><!-- date and time information. ISO date format -->
-
-
-<!ENTITY % Script "CDATA"><!-- script expression -->
-
-<!ENTITY % StyleSheet "CDATA"><!-- style sheet data -->
-
-
-
-<!ENTITY % Text "CDATA">
-
-
-<!-- Parameter Entities -->
-
-<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT"><!-- repeatable head elements -->
-<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
-<!ENTITY % list "UL | OL">
-<!ENTITY % preformatted "PRE">
-
-
-<!--================ Character mnemonic entities =========================-->
-
-<!--ENTITY % HTMLlat1 PUBLIC
-   "-//W3C//ENTITIES Latin1//EN//HTML"
-   "HTMLlat1.ent"-->
-<!--   "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent"-->
-<!--%HTMLlat1;-->
-
-<!--ENTITY % HTMLsymbol PUBLIC
-   "-//W3C//ENTITIES Symbols//EN//HTML"
-   "HTMLsymbol.ent"-->
-<!--   "http://www.w3.org/TR/REC-html40-971218/HTMLsymbol.ent"-->
-<!--%HTMLsymbol;-->
-
-<!--ENTITY % HTMLspecial PUBLIC
-   "-//W3C//ENTITIES Special//EN//HTML"
-   "HTMLspecial.ent"-->
-<!--   "http://www.w3.org/TR/REC-html40-971218/HTMLspecial.ent"-->
-<!--%HTMLspecial;-->
-
-<!-- We define these elsewhere in this mixed DTD
-<!ENTITY quot "&#34;">
-<!ENTITY amp  "&#38;">
-<!ENTITY lt   "&#60;">
-<!ENTITY gt   "&#62;">
--->
-
-<!--=================== Generic Attributes ===============================-->
-
-<!ENTITY % coreattrs
- "id          ID             #IMPLIED
-  class       CDATA          #IMPLIED
-  style       %StyleSheet;   #IMPLIED
-  title       %Text;         #IMPLIED
-  %result-element-atts;"
->
-
-<!ENTITY % i18n
- "xml:lang    %LanguageCode; #IMPLIED
-  dir         (ltr|rtl)      #IMPLIED"
-  >
-
-<!ENTITY % events
- "onclick     %Script;       #IMPLIED
-  ondblclick  %Script;       #IMPLIED
-  onmousedown %Script;       #IMPLIED
-  onmouseup   %Script;       #IMPLIED
-  onmouseover %Script;       #IMPLIED
-  onmousemove %Script;       #IMPLIED
-  onmouseout  %Script;       #IMPLIED
-  onkeypress  %Script;       #IMPLIED
-  onkeydown   %Script;       #IMPLIED
-  onkeyup     %Script;       #IMPLIED"
-  >
-
-<!-- Reserved Feature Switch -->
-<!ENTITY % HTML.Reserved "IGNORE">
-
-<!-- The following attributes are reserved for possible future use -->
-<![ %HTML.Reserved; [
-<!ENTITY % reserved
- "datasrc     %URI;          #IMPLIED
-  datafld     CDATA          #IMPLIED
-  dataformatas (plaintext|html) plaintext"
-  >
-]]>
-
-<!ENTITY % reserved "">
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-
-<!--=================== Text Markup ======================================-->
-
-<!ENTITY % fontstyle
- "TT | I | B | BIG | SMALL">
-
-<!ENTITY % phrase "EM | STRONG | DFN | CODE |
-                   SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
-
-<!ENTITY % special
-   "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
-<!ENTITY % special-A
-   "IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
-
-<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
-
-<!-- %inline; covers inline or "text-level" elements -->
-<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
-<!ENTITY % inline-A "#PCDATA | %fontstyle; | %phrase; | %special-A; | %formctrl;">
-<!ENTITY % inline-LABEL "#PCDATA | %fontstyle; | %phrase; | %special; | INPUT | SELECT | TEXTAREA | BUTTON">
-
-<!--
-<!ELEMENT (%fontstyle;|%phrase;)     (%inline;)*>
-<!ATTLIST (%fontstyle;|%phrase;)
-  %attrs;
-  >-->
-<!ELEMENT TT (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST TT %attrs;>
-<!ELEMENT I (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST I %attrs;>
-<!ELEMENT B (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST B %attrs;>
-<!ELEMENT BIG (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST BIG %attrs;>
-<!ELEMENT SMALL (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST SMALL %attrs;>
-<!ELEMENT EM (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST EM %attrs;>
-<!ELEMENT STRONG (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST STRONG %attrs;>
-<!ELEMENT DFN (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST DFN %attrs;>
-<!ELEMENT CODE (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST CODE %attrs;>
-<!ELEMENT SAMP (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST SAMP %attrs;>
-<!ELEMENT KBD (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST KBD %attrs;>
-<!ELEMENT VAR (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST VAR %attrs;>
-<!ELEMENT CITE (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST CITE %attrs;>
-<!ELEMENT ABBR (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST ABBR %attrs;>
-<!ELEMENT ACRONYM (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST ACRONYM %attrs;>
-
-
-<!ELEMENT SUP (%inline; | %xsl-valid-in-resultns;)*><!-- subscript, superscript -->
-<!ATTLIST SUP
-  %attrs;
-  >
-<!ELEMENT SUB (%inline; | %xsl-valid-in-resultns;)*><!-- subscript, superscript -->
-<!ATTLIST SUB
-  %attrs;
-  >
-
-<!ELEMENT SPAN (%inline; | %xsl-valid-in-resultns;)*><!-- generic language/style container -->
-<!ATTLIST SPAN
-  %attrs;
-  %reserved;			
-  >
-
-<!ELEMENT BDO (%inline; | %xsl-valid-in-resultns;)*><!-- I18N BiDi over-ride -->
-<!ATTLIST BDO
-  %coreattrs;
-  lang        %LanguageCode; #IMPLIED
-  dir         (ltr|rtl)      #REQUIRED
-  >
-
-
-<!ELEMENT BR     EMPTY><!-- forced line break -->
-<!ATTLIST BR
-  %coreattrs;
-  >
-
-<!--================== HTML content models ===============================-->
-
-<!--
-    HTML has two basic content models:
-
-        %inline;     character level elements and text strings
-        %block;      block-like elements e.g. paragraphs and lists
--->
-
-<!ENTITY % block
-     "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
-      BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
-<!ENTITY % block-FORM
-     "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
-      BLOCKQUOTE | HR | TABLE | FIELDSET | ADDRESS">
-<!ENTITY % block-FORM-FIELDSET
-     "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
-      BLOCKQUOTE | HR | TABLE | ADDRESS">
-
-<!--<!ENTITY % flow "%block; | %inline;">-->
-<!ENTITY % flow "%inline; | %block;">
-
-<!--=================== Document Body ====================================-->
-
-<!--ELEMENT BODY     (%block;|SCRIPT)+ +(INS|DEL)  document body -->
-<!ELEMENT BODY ((INS|DEL)*, (%xsl-valid-in-resultns;|%block;|SCRIPT), (INS|DEL)*)+ ><!-- document body -->
-<!ATTLIST BODY
-  %attrs;
-  onload          %Script;   #IMPLIED
-  onunload        %Script;   #IMPLIED
-  >
-
-<!ELEMENT ADDRESS (%inline; | %xsl-valid-in-resultns;)*><!-- information on author -->
-<!ATTLIST ADDRESS
-  %attrs;
-  >
-
-<!ELEMENT DIV (%flow; | %xsl-valid-in-resultns;)*><!-- generic language/style container -->
-<!ATTLIST DIV
-  %attrs;
-  %reserved;
-  >
-
-
-<!--================== The Anchor Element ================================-->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-<!ENTITY % Coords "CDATA"><!-- comma separated list of lengths -->
-
-<!ELEMENT A (%inline-A; | %xsl-valid-in-resultns;)*><!-- anchor -->
-<!ATTLIST A
-  %attrs;
-  charset     %Charset;      #IMPLIED
-  type        %ContentType;  #IMPLIED
-  name        CDATA          #IMPLIED
-  href        %URI;          #IMPLIED
-  hreflang    %LanguageCode; #IMPLIED
-  rel         %LinkTypes;    #IMPLIED
-  rev         %LinkTypes;    #IMPLIED
-  accesskey   %Character;    #IMPLIED
-  shape       %Shape;        "rect"
-  coords      %Coords;       #IMPLIED
-  tabindex    %Number;       #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  >
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
-     separate document although this isn't yet widely supported -->
-
-<!ELEMENT MAP  ((%xsl-valid-in-resultns;|%block;)+ | (%xsl-valid-in-resultns;|AREA+))><!-- client-side image map -->
-<!ATTLIST MAP
-  %attrs;
-  name        CDATA          #REQUIRED
-  >
-
-<!ELEMENT AREA     EMPTY><!-- client-side image map area -->
-<!ATTLIST AREA
-  %attrs;
-  shape       %Shape;        "rect"
-  coords      %Coords;       #IMPLIED
-  href        %URI;          #IMPLIED
-  nohref      (nohref)       #IMPLIED
-  alt         %Text;         #REQUIRED
-  tabindex    %Number;       #IMPLIED
-  accesskey   %Character;    #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  >
-
-<!--================== The LINK Element ==================================-->
-
-<!--
-  Relationship values can be used in principle:
-
-   a) for document specific toolbars/menus when used
-      with the LINK element in document head e.g.
-        start, contents, previous, next, index, end, help
-   b) to link to a separate style sheet (rel=stylesheet)
-   c) to make a link to a script (rel=script)
-   d) by stylesheets to control how collections of
-      html nodes are rendered into printed documents
-   e) to make a link to a printable version of this document
-      e.g. a postscript or pdf version (rel=alternate media=print)
--->
-
-<!ELEMENT LINK     EMPTY><!-- a media-independent link -->
-<!ATTLIST LINK
-  %attrs;
-  charset     %Charset;      #IMPLIED
-  href        %URI;          #IMPLIED
-  hreflang    %LanguageCode; #IMPLIED
-  type        %ContentType;  #IMPLIED
-  rel         %LinkTypes;    #IMPLIED
-  rev         %LinkTypes;    #IMPLIED
-  media       %MediaDesc;    #IMPLIED
-  >
-
-<!--=================== Images ===========================================-->
-
-<!-- Length defined in strict DTD for cellpadding/cellspacing -->
-<!ENTITY % Length "CDATA"><!-- nn for pixels or nn% for percentage length -->
-<!ENTITY % MultiLength "CDATA"><!-- pixel, percentage, or relative -->
-
-<!ENTITY % MultiLengths "CDATA"><!-- comma-separated list of MultiLength -->
-
-<!ENTITY % Pixels "CDATA"><!-- integer representing length in pixels -->
-
-
-<!-- To avoid problems with text-only UAs as well as 
-   to make image content understandable and navigable 
-   to users of non-visual UAs, you need to provide
-   a description with ALT, and avoid server-side image maps -->
-<!ELEMENT IMG     EMPTY><!-- Embedded image -->
-<!ATTLIST IMG
-  %attrs;
-  src         %URI;          #REQUIRED
-  alt         %Text;         #REQUIRED
-  longdesc    %URI;          #IMPLIED
-  height      %Length;       #IMPLIED
-  width       %Length;       #IMPLIED
-  usemap      %URI;          #IMPLIED
-  ismap       (ismap)        #IMPLIED
-  >
-
-<!-- USEMAP points to a MAP element which may be in this document
-  or an external document, although the latter is not widely supported -->
-
-<!--==================== OBJECT ======================================-->
-<!--
-  OBJECT is used to embed objects as part of HTML pages 
-  PARAM elements should precede other content. SGML mixed content
-  model technicality precludes specifying this formally ...
--->
-
-<!ELEMENT OBJECT (%flow; | %xsl-valid-in-resultns; | PARAM)*
-><!-- generic embedded object -->
-<!ATTLIST OBJECT
-  %attrs;
-  declare     (declare)      #IMPLIED
-  classid     %URI;          #IMPLIED
-  codebase    %URI;          #IMPLIED
-  data        %URI;          #IMPLIED
-  type        %ContentType;  #IMPLIED
-  codetype    %ContentType;  #IMPLIED
-  archive     %URI;          #IMPLIED
-  standby     %Text;         #IMPLIED
-  height      %Length;       #IMPLIED
-  width       %Length;       #IMPLIED
-  usemap      %URI;          #IMPLIED
-  name        CDATA          #IMPLIED
-  tabindex    %Number;       #IMPLIED
-  %reserved;
-  >
-
-<!ELEMENT PARAM     EMPTY><!-- named property value -->
-<!ATTLIST PARAM
-  id          ID             #IMPLIED
-  name        CDATA          #REQUIRED
-  value       CDATA          #IMPLIED
-  valuetype   (DATA|REF|OBJECT) "DATA"
-  type        %ContentType;  #IMPLIED
-  >
-
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT HR     EMPTY><!-- horizontal rule -->
-<!ATTLIST HR
-  %coreattrs;
-  %events;
-  >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT P (%inline; | %xsl-valid-in-resultns;)*><!-- paragraph -->
-<!ATTLIST P
-  %attrs;
-  >
-
-<!--=================== Headings =========================================-->
-
-<!--
-  There are six levels of headings from H1 (the most important)
-  to H6 (the least important).
--->
-
-<!--
-<!ELEMENT (%heading;)      (%inline;)*>
-<!ATTLIST (%heading;)
-  %attrs;
-  >-->
-<!ELEMENT H1 (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST H1 %attrs;>
-<!ELEMENT H2 (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST H2 %attrs;>
-<!ELEMENT H3 (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST H3 %attrs;>
-<!ELEMENT H4 (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST H4 %attrs;>
-<!ELEMENT H5 (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST H5 %attrs;>
-<!ELEMENT H6 (%inline; | %xsl-valid-in-resultns;)*>
-<!ATTLIST H6 %attrs;>
-
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- excludes markup for images and changes in font size -->
-<!--
-<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
-
-<!ELEMENT PRE  (%inline;)* -(%pre.exclusion;)><! preformatted text -->
-
-<!ELEMENT PRE (#PCDATA |%xsl-valid-in-resultns;| TT|I|B|%phrase;|A|BR|SCRIPT|MAP|Q|SPAN|BDO|%formctrl;)*>
-			<!-- preformatted text -->
-<!ATTLIST PRE
-  %attrs;>
-<!-- Should the attribute below be incuded in PRE?
-  xml:space (default|preserve) #FIXED "preserve"
--->
-
-<!--===================== Inline Quotes ==================================-->
-
-<!ELEMENT Q  (%inline; | %xsl-valid-in-resultns;)*><!-- short inline quotation -->
-<!ATTLIST Q
-  %attrs;
-  cite        %URI;          #IMPLIED
-  >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT BLOCKQUOTE  (%block;|%xsl-valid-in-resultns;|SCRIPT)+><!-- long quotation -->
-<!ATTLIST BLOCKQUOTE
-  %attrs;
-  cite        %URI;          #IMPLIED
-  >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-
-<!-- INS/DEL are handled by inclusion on BODY -->
-<!ELEMENT INS (%flow;|%xsl-valid-in-resultns;)*><!-- inserted text, deleted text -->
-<!ATTLIST INS
-  %attrs;
-  cite        %URI;          #IMPLIED
-  datetime    %Datetime;     #IMPLIED
-  >
-<!ELEMENT DEL (%flow;|%xsl-valid-in-resultns;)*><!-- inserted text, deleted text -->
-<!ATTLIST DEL
-  %attrs;
-  cite        %URI;          #IMPLIED
-  datetime    %Datetime;     #IMPLIED
-  >
-
-<!--=================== Lists ============================================-->
-
-<!-- definition lists - DT for term, DD for its definition -->
-
-<!ELEMENT DL  (%xsl-valid-in-resultns;| DT|DD)+><!-- definition list -->
-<!ATTLIST DL
-  %attrs;
-  >
-
-<!ELEMENT DT (%inline; | %xsl-valid-in-resultns;)*><!-- definition term -->
-<!ELEMENT DD (%flow; | %xsl-valid-in-resultns;)*><!-- definition description -->
-<!ATTLIST DT
-  %attrs;
-  >
-<!ATTLIST DD
-  %attrs;
-  >
-
-
-<!ELEMENT OL (%xsl-valid-in-resultns; | LI)+><!-- ordered list -->
-<!ATTLIST OL
-  %attrs;
-  >
-
-<!-- Unordered Lists (UL) bullet styles -->
-<!ELEMENT UL (%xsl-valid-in-resultns; | LI)+><!-- unordered list -->
-<!ATTLIST UL
-  %attrs;
-  >
-
-
-
-<!ELEMENT LI (%flow; | %xsl-valid-in-resultns;)*><!-- list item -->
-<!ATTLIST LI
-  %attrs;
-  >
-
-<!--================ Forms ===============================================-->
-<!ELEMENT FORM (%xsl-valid-in-resultns;|%block-FORM;|SCRIPT)+>
-
-<!-- interactive form -->
-<!ATTLIST FORM
-  %attrs;
-  action      %URI;          #REQUIRED
-  method      (GET|POST)     "GET"
-  enctype     %ContentType;  "application/x-www-form-urlencoded"
-  onsubmit    %Script;       #IMPLIED
-  onreset     %Script;       #IMPLIED
-  accept-charset %Charsets;  #IMPLIED
-  >
-
-<!-- Each label must not contain more than ONE field -->
-<!ELEMENT LABEL  (%inline-LABEL; | %xsl-valid-in-resultns;)*><!-- form field label text -->
-<!ATTLIST LABEL
-  %attrs;
-  for         IDREF          #IMPLIED
-  accesskey   %Character;    #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  >
-
-<!ENTITY % InputType
-  "(TEXT | PASSWORD | CHECKBOX |
-    RADIO | SUBMIT | RESET |
-    FILE | HIDDEN | IMAGE | BUTTON)"
-   >
-
-<!-- attribute name required for all but submit & reset -->
-<!ELEMENT INPUT     EMPTY><!-- form control -->
-<!ATTLIST INPUT
-  %attrs;
-  type        %InputType;    "TEXT"
-  name        CDATA          #IMPLIED
-  value       CDATA          #IMPLIED
-  checked     (checked)      #IMPLIED
-  disabled    (disabled)     #IMPLIED
-  readonly    (readonly)     #IMPLIED
-  size        CDATA          #IMPLIED
-  maxlength   %Number;       #IMPLIED
-  src         %URI;          #IMPLIED
-  alt         CDATA          #IMPLIED
-  usemap      %URI;          #IMPLIED
-  tabindex    %Number;       #IMPLIED
-  accesskey   %Character;    #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  onselect    %Script;       #IMPLIED
-  onchange    %Script;       #IMPLIED
-  accept      %ContentTypes; #IMPLIED
-  %reserved;
-  >
-
-<!ELEMENT SELECT ((%xsl-valid-in-resultns;|OPTGROUP)|(%xsl-valid-in-resultns;|OPTION))+ ><!-- option selector -->
-<!ATTLIST SELECT
-  %attrs;
-  name        CDATA          #IMPLIED
-  size        %Number;       #IMPLIED
-  multiple    (multiple)     #IMPLIED
-  disabled    (disabled)     #IMPLIED
-  tabindex    %Number;       #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  onchange    %Script;       #IMPLIED
-  %reserved;
-  >
-
-<!ELEMENT OPTGROUP (%xsl-valid-in-resultns;|OPTION)+>  <!-- option group -->
-<!ATTLIST OPTGROUP
-  %attrs;
-  disabled    (disabled)     #IMPLIED
-  label       %Text;         #REQUIRED
-  >
-
-<!ELEMENT OPTION  (#PCDATA | %xsl-valid-in-resultns;)*><!-- selectable choice -->
-<!ATTLIST OPTION
-  %attrs;
-  selected    (selected)     #IMPLIED
-  disabled    (disabled)     #IMPLIED
-  label       %Text;         #IMPLIED
-  value       CDATA          #IMPLIED
-  >
-
-<!ELEMENT TEXTAREA (#PCDATA | %xsl-valid-in-resultns;)*><!-- multi-line text field -->
-<!ATTLIST TEXTAREA
-  %attrs;
-  name        CDATA          #IMPLIED
-  rows        %Number;       #REQUIRED
-  cols        %Number;       #REQUIRED
-  disabled    (disabled)     #IMPLIED
-  readonly    (readonly)     #IMPLIED
-  tabindex    %Number;       #IMPLIED
-  accesskey   %Character;    #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  onselect    %Script;       #IMPLIED
-  onchange    %Script;       #IMPLIED
-  %reserved;
-  >
-
-<!--
-  #PCDATA is to solve the mixed content problem,
-  per specification only whitespace is allowed there!
-
-  We do allow XSL inside as well
- -->
-<!--ELEMENT FIELDSET     (#PCDATA,LEGEND,(%flow;)*)    form control group -->
-<!ELEMENT FIELDSET  (%flow;|%xsl-valid-in-resultns;|LEGEND)*><!-- form control group -->
-<!ATTLIST FIELDSET
-  %attrs;
-  >
-
-<!ELEMENT LEGEND (%inline;|%xsl-valid-in-resultns;)*><!-- fieldset legend -->
-<!ENTITY % LAlign "(top|bottom|left|right)">
-
-<!ATTLIST LEGEND
-  %attrs;
-  accesskey   %Character;    #IMPLIED
-  >
-
-<!ELEMENT BUTTON
-     (#PCDATA | %xsl-valid-in-resultns; | %fontstyle; | %phrase; | %special-A; | %block;)*
-><!-- push button -->
-<!ATTLIST BUTTON
-  %attrs;
-  name        CDATA          #IMPLIED
-  value       CDATA          #IMPLIED
-  type        (button|submit|reset) "submit"
-  disabled    (disabled)     #IMPLIED
-  tabindex    %Number;       #IMPLIED
-  accesskey   %Character;    #IMPLIED
-  onfocus     %Script;       #IMPLIED
-  onblur      %Script;       #IMPLIED
-  %reserved;
-  >
-
-<!--======================= Tables =======================================-->
-
-<!-- IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The BORDER attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The FRAME attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the VALIGN attribute.
-
- The value "border" is included for backwards compatibility with
- <TABLE BORDER> which yields frame=border and border=implied
- For <TABLE BORDER=1> you get border=1 and frame=implied. In this
- case, it is appropriate to treat this as frame=border for backwards
- compatibility with deployed browsers.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The RULES attribute defines which rules to draw between cells:
-
- If RULES is absent then assume:
-     "none" if BORDER is absent or BORDER=0 otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-  
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents -->
-<!ENTITY % cellhalign
-  "align      (left|center|right|justify|char) #IMPLIED
-   char       %Character;    #IMPLIED
-   charoff    %Length;       #IMPLIED"
-  >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
-  "valign     (top|middle|bottom|baseline) #IMPLIED"
-  >
-
-<!ELEMENT TABLE 
-  ((%xsl-valid-in-resultns;)*, CAPTION?, (%xsl-valid-in-resultns;)*,
-   ((COL | %xsl-valid-in-resultns;)*|(COLGROUP | %xsl-valid-in-resultns;)*),
-   ((THEAD?,(%xsl-valid-in-resultns;)*,TFOOT?,(%xsl-valid-in-resultns;|TBODY)+)
-    | (%xsl-valid-in-resultns;|TR)+) )>
-
-<!ELEMENT CAPTION   (%inline; | %xsl-valid-in-resultns;)*><!-- table caption -->
-<!ELEMENT THEAD     (TR|%xsl-valid-in-resultns;)+><!-- table header -->
-<!ELEMENT TFOOT     (TR|%xsl-valid-in-resultns;)+><!-- table footer -->
-<!ELEMENT TBODY     (TR|%xsl-valid-in-resultns;)+><!-- table body -->
-<!ELEMENT COLGROUP  (%xsl-valid-in-resultns; | COL)*><!-- table column group -->
-<!ELEMENT COL       EMPTY><!-- table column -->
-<!ELEMENT TR        (TH|TD| %xsl-valid-in-resultns;)+><!-- table row -->
-<!ELEMENT TH        (%flow; | %xsl-valid-in-resultns;)*><!-- table header cell, table data cell-->
-<!ELEMENT TD        (%flow; | %xsl-valid-in-resultns;)*><!-- table header cell, table data cell-->
-
-<!ATTLIST TABLE
-  %attrs;
-  summary     %Text;         #IMPLIED
-  width       %Length;       #IMPLIED
-  border      %Pixels;       #IMPLIED
-  frame       %TFrame;       #IMPLIED
-  rules       %TRules;       #IMPLIED
-  cellspacing %Length;       #IMPLIED
-  cellpadding %Length;       #IMPLIED
-  %reserved;
-  datapagesize CDATA         #IMPLIED
-  >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST CAPTION
-  %attrs;
-  >
-
-<!--
-COLGROUP groups a set of COL elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST COLGROUP
-  %attrs;
-  span        %Number;       "1"
-  width       %MultiLength;  #IMPLIED
-  %cellhalign;
-  %cellvalign;
-  >
-
-<!--
- COL elements define the alignment properties for cells in
- one or more columns.
-
- The WIDTH attribute specifies the width of the columns, e.g.
-
-     width=64        width in screen pixels
-     width=0.5*      relative width of 0.5
-
- The SPAN attribute causes the attributes of one
- COL element to apply to more than one column.
--->
-<!ATTLIST COL
-  %attrs;
-  span        %Number;       "1"
-  width       %MultiLength;  #IMPLIED
-  %cellhalign;
-  %cellvalign;
-  >
-
-<!--
-    Use THEAD to duplicate headers when breaking table
-    across page boundaries, or for static headers when
-    TBODY sections are rendered in scrolling panel.
-
-    Use TFOOT to duplicate footers when breaking table
-    across page boundaries, or for static footers when
-    TBODY sections are rendered in scrolling panel.
-
-    Use multiple TBODY sections when rules are needed
-    between groups of table rows.
--->
-<!ATTLIST THEAD
-  %attrs;
-  %cellhalign;
-  %cellvalign;
-  >
-<!ATTLIST TBODY
-  %attrs;
-  %cellhalign;
-  %cellvalign;
-  >
-<!ATTLIST TFOOT
-  %attrs;
-  %cellhalign;
-  %cellvalign;
-  >
-
-<!ATTLIST TR
-  %attrs;
-  %cellhalign;
-  %cellvalign;
-  >
-
-
-<!-- Scope is simpler than axes attribute for common tables -->
-<!ENTITY % Scope "(ROW|COL|ROWGROUP|COLGROUP)">
-
-<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
-<!ATTLIST TH
-  %attrs;
-  abbr        %Text;         #IMPLIED
-  axis        CDATA          #IMPLIED
-  headers     IDREFS         #IMPLIED
-  scope       %Scope;        #IMPLIED
-  rowspan     %Number;       "1"
-  colspan     %Number;       "1"
-  %cellhalign;
-  %cellvalign;
-  >
-<!ATTLIST TD
-  %attrs;
-  abbr        %Text;         #IMPLIED
-  axis        CDATA          #IMPLIED
-  headers     IDREFS         #IMPLIED
-  scope       %Scope;        #IMPLIED
-  rowspan     %Number;       "1"
-  colspan     %Number;       "1"
-  %cellhalign;
-  %cellvalign;
-  >
-
-
-<!--================ Document Head =======================================-->
-<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT",
-     extended now to allow xsl -->
-<!ENTITY % head.misc-HEAD "%head.misc;|%xsl-valid-in-resultns;">
-
-<!ENTITY % head.content "TITLE &amp; BASE?">
-
-<!--ELEMENT HEAD     (%head.content;) +(%head.misc;)   document head -->
-<!ELEMENT HEAD
-   ((%head.misc-HEAD;)*, ((BASE?,(%head.misc-HEAD;)*,TITLE?) | (TITLE?,(%head.misc-HEAD;)*,BASE?)|(%head.misc-HEAD;)*)+, (%head.misc-HEAD;)*)>
-<!ATTLIST HEAD
-  %i18n;
-  profile     %URI;          #IMPLIED
-  %result-element-atts;
-  >
-
-<!-- The TITLE element is not considered part of the flow of text.
-       It should be displayed, for example as the page header or
-       window title. Exactly one title is required per document.
-    -->
-<!--ELEMENT TITLE     (#PCDATA) -(%head.misc;)  document title -->
-<!ELEMENT TITLE  (#PCDATA |  %xsl-valid-in-resultns;)*><!-- document title -->
-<!ATTLIST TITLE %i18n; %result-element-atts;>
-
-
-<!ELEMENT BASE     EMPTY><!-- document base URI -->
-<!ATTLIST BASE
-  href        %URI;          #REQUIRED
-  >
-
-<!ELEMENT META     EMPTY><!-- generic metainformation -->
-<!ATTLIST META
-  %i18n;
-  http-equiv  %Name;         #IMPLIED
-  name        %Name;         #IMPLIED
-  content     CDATA          #REQUIRED
-  scheme      CDATA          #IMPLIED
-  %result-element-atts;
-  >
-
-<!--ELEMENT STYLE     %StyleSheet;  style info -->
-<!ELEMENT STYLE (#PCDATA | %xsl-valid-in-resultns;)*><!-- style info -->
-<!ATTLIST STYLE
-  %i18n;
-  type        %ContentType;  #REQUIRED
-  media       %MediaDesc;    #IMPLIED
-  title       %Text;         #IMPLIED
-  %result-element-atts;
-  >
-
-<!--ELEMENT SCRIPT     %Script; script statements -->
-<!ELEMENT SCRIPT (#PCDATA | %xsl-valid-in-resultns;)*><!-- script statements -->
-<!ATTLIST SCRIPT
-  charset     %Charset;      #IMPLIED
-  type        %ContentType;  #REQUIRED
-  language    CDATA          #IMPLIED
-  src         %URI;          #IMPLIED
-  defer       (defer)        #IMPLIED
-  event       CDATA          #IMPLIED
-  for         %URI;          #IMPLIED
-  %result-element-atts;
-  >
-
-<!ELEMENT NOSCRIPT (%xsl-valid-in-resultns;|%block;)+
-><!-- alternate content container for non script-based rendering -->
-<!ATTLIST NOSCRIPT
-  %attrs;
-  >
-
-<!--================ Document Structure ==================================-->
-<!ENTITY % html.content "HEAD, BODY">
-
-<!--<!ELEMENT HTML     (%html.content;)> --><!-- document root element -->
-<!ELEMENT HTML (((%xsl-valid-in-resultns;)*,HEAD?,(%xsl-valid-in-resultns;)*,BODY?,
-                (%xsl-valid-in-resultns;)*) | (%xsl-valid-in-resultns;)*)>
-<!-- document root element -->
-<!ATTLIST HTML
-  %i18n;
-  %result-element-atts;
-  >
diff --git a/xdocs/style/loaderdesign.xml b/xdocs/style/loaderdesign.xml
deleted file mode 100644
index 975055b..0000000
--- a/xdocs/style/loaderdesign.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-
-<loader>
-  <processor name="xslt">
-    <parameter name="stylesheet" value="sbk:/style/stylesheets/design2project.xsl"/>
-  </processor>
-</loader>
diff --git a/xdocs/style/stylesheets/design2project.xsl b/xdocs/style/stylesheets/design2project.xsl
deleted file mode 100644
index 8d23940..0000000
--- a/xdocs/style/stylesheets/design2project.xsl
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-  <xsl:template match="/">
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <!-- match the root book element -->
-  <xsl:template match="book">
-    <project>
-      <parameter name="copyright" value="{@copyright}"/>
-      <xsl:apply-templates/>
-    </project>
-  </xsl:template>
-
- <xsl:template match="document">
-
-    <process source="{@source}" producer="parser">
-      <processor name="xslt">
-        <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
-      </processor>
-    </process>
-
-    <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
-      <processor name="xslt">
-        <parameter name="id" value="{@id}"/>
-        <parameter name="stylesheet" value="sbk:/style/stylesheets/designdoc2html.xsl"/>
-      </processor>
-    </create>
-  </xsl:template>
-  
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/xdocs/style/stylesheets/designdoc2html.xsl b/xdocs/style/stylesheets/designdoc2html.xsl
deleted file mode 100644
index 4663e41..0000000
--- a/xdocs/style/stylesheets/designdoc2html.xsl
+++ /dev/null
@@ -1,217 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-  <xsl:param name="stylebook.project"/>
-  <xsl:param name="copyright"/>
-  <xsl:param name="id"/>
-
-  <xsl:template match="/">
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="s1">
-    <html>
-      <head>
-        <title><xsl:value-of select="@title"/></title>
-      </head>
-      <body text="#000000" link="#0000ff" vlink="#0000aa" alink="#ff0000"
-            topmargin="4" leftmargin="4" marginwidth="4" marginheight="4"
-            bgcolor="#ffffff">
-         <xsl:variable name="topimage" select="string(./p/img/@src)"/>
-         <h1><a href="http://xml.apache.org"><img src="images/{$topimage}"/></a>&#160;&#160;
-         <xsl:value-of select="@title"/></h1><hr/>
-             <xsl:apply-templates/>
-         <hr/>
-            <font size="-1" color="#0086b2"><i>
-              Copyright &#169; <xsl:value-of select="$copyright"/>
-            </i></font>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="s2">
-      
-      <h2><xsl:value-of select="@title"/></h2>
-      <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="s3">
-      <h3><xsl:value-of select="@title"/></h3>
-      <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="s4">
-      <h4><xsl:value-of select="@title"/></h4>
-      <xsl:apply-templates/>
-  </xsl:template>
-
-<!-- ###################################################################### -->
-<!-- blocks -->
-
-  <xsl:template match="p">
-    <p><xsl:apply-templates/></p>
-  </xsl:template>
-
-  <xsl:template match="note">
-    <table width="100%" cellspacing="3" cellpadding="0" border="0">
-      <tr>
-        <td width="20" valign="top">
-          <img src="resources/note.gif" width="20" height="24" vspace="0" hspace="0" border="0" alt="Note"/>
-        </td>
-        <td valign="top">
-          <font size="-1" face="arial,helvetica,sanserif" color="#000000">
-            <i>
-              <xsl:apply-templates/>
-            </i>
-          </font>
-        </td>
-      </tr>  
-    </table>
-  </xsl:template>
-
-  <xsl:template match="ul">
-    <ul><xsl:apply-templates/></ul>
-  </xsl:template>
-
-  <xsl:template match="ol">
-    <ol><xsl:apply-templates/></ol>
-  </xsl:template>
-
-  <xsl:template match="li">
-    <li><xsl:apply-templates/></li>
-  </xsl:template>
-  
-    <!--Definition lists: gloss, term, label, item -->
-  <xsl:template match="gloss">
-    <dl><xsl:apply-templates/></dl>
-  </xsl:template>
-   <!-- <term> contains a single-word, multi-word or symbolic 
-       designation which is regarded as a technical term. --> 
-  <xsl:template match="term">
-    <dfn><xsl:apply-templates/></dfn>
-  </xsl:template>
-  <xsl:template match="label" priority="1">
-    <dt><xsl:apply-templates/></dt>
-  </xsl:template>
-  <xsl:template match="item" priority="2">
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-
-  <xsl:template match="source">
-    <p><font size="-1"><pre><xsl:apply-templates/></pre></font></p>
-  </xsl:template>
-
-  <xsl:template match="table">
-    <table width="100%" border="0" cellspacing="2" cellpadding="2">
-      <xsl:apply-templates/>
-    </table>
-  </xsl:template>
-
-  <xsl:template match="tr">
-    <tr><xsl:apply-templates/></tr>
-  </xsl:template>
-
-  <xsl:template match="th">
-    <td bgcolor="#039acc" colspan="{@colspan}" rowspan="{@rowspan}" valign="center" align="center">
-      <font color="#ffffff" size="-1" face="arial,helvetica,sanserif">
-        <b><xsl:apply-templates/></b>&#160;
-      </font>
-    </td>
-  </xsl:template>
-
-  <xsl:template match="td">
-    <td bgcolor="#a0ddf0" colspan="{@colspan}" rowspan="{@rowspan}" valign="top" align="left">
-      <font color="#000000" size="-1" face="arial,helvetica,sanserif">
-        <xsl:apply-templates/>&#160;
-      </font>
-    </td>
-  </xsl:template>
-
-  <xsl:template match="tn">
-    <td bgcolor="#ffffff" colspan="{@colspan}" rowspan="{@rowspan}">
-      &#160;
-    </td>
-  </xsl:template>
-
-<!-- ###################################################################### -->
-<!-- markup -->
-
-  <xsl:template match="em">
-    <b><xsl:apply-templates/></b>
-  </xsl:template>
-
-  <xsl:template match="ref">
-    <i><xsl:apply-templates/></i>
-  </xsl:template>
-  
-  <xsl:template match="code">
-    <code><font face="courier, monospaced"><xsl:apply-templates/></font></code>
-  </xsl:template>
-  
-  <xsl:template match="br">
-    <br/>
-  </xsl:template>
-  
-<!-- ###################################################################### -->
-<!-- links -->
-
-  <xsl:template match="link">
-    <xsl:if test="string-length(@anchor)=0">
-      <xsl:if test="string-length(@idref)=0">
-        <!--xsl:apply-templates/-->
-      </xsl:if>
-      <xsl:if test="string-length(@idref)>0">
-        <a href="{@idref}.html"><xsl:apply-templates/></a>
-      </xsl:if>
-    </xsl:if>
-
-    <xsl:if test="string-length(@anchor)>0">
-      <xsl:if test="string-length(@idref)=0">
-        <a href="#{@anchor}"><xsl:apply-templates/></a>
-      </xsl:if>
-      <xsl:if test="string-length(@idref)>0">
-        <a href="{@idref}.html#{@anchor}"><xsl:apply-templates/></a>
-      </xsl:if>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="anchor">
-    <a name="{@name}"><xsl:comment>anchor</xsl:comment></a>
-  </xsl:template>
-
-  <xsl:template match="jump">
-    <a href="{@href}"><xsl:apply-templates/></a>
-  </xsl:template>
-
-  <xsl:template match="/s1/s2//img">
-    <img src="images/{@src}"/>
-  </xsl:template>
-
-  <xsl:template match="resource-ref">
-    <xsl:variable name="resourceFile" 
-          select="document($stylebook.project)/book/resources/@source"/>
-    <xsl:variable name="xref" select="@idref"/>
-    <xsl:variable name="href"
-          select="document($resourceFile)/resources/resource[@id=$xref]/@location"/>
-    <xsl:variable name="label"
-          select="document($resourceFile)/resources/resource[@id=$xref]/@title"/>
-    <A href="{$href}" target="_top"><xsl:value-of select="$label"/></A>
-  </xsl:template>
-
-  <xsl:template match="human-resource-ref">
-    <xsl:variable name="resourceFile" 
-          select="document($stylebook.project)/book/resources/@source"/>  
-    <xsl:variable name="ref"  select="@idref"/>
-    <xsl:variable name="mailto"
-          select="document($resourceFile)/resources/human-resource[@id=$ref]/@mailto"/>
-   <xsl:variable name="name"
-          select="document($resourceFile)/resources/human-resource[@id=$ref]/@name"/>                          
-    <A href="mailto:{$mailto}"><xsl:value-of select="$name"/></A>
-  </xsl:template>
-
-<!-- ###################################################################### -->
-
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/xdocs/style/stylesheets/done.xsl b/xdocs/style/stylesheets/done.xsl
deleted file mode 100644
index 8e547f0..0000000
--- a/xdocs/style/stylesheets/done.xsl
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<!DOCTYPE xsl:stylesheet>
-
-<!-- XSL Style sheet, DTD omitted -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <xsl:output method="xml"/>
-  
-  <xsl:template match="Commits">
-  <xsl:comment>This XML fragment contains a list of source code updates to place in an &lt;s3&gt; section of readme.xml</xsl:comment>
-    <xsl:if test="count(Commit[@category='core'])>0">
-      <p> Core (Non-XSLTC) source code updates:</p>
-      <ul>
-      <xsl:for-each select="Commit[@category='core']">
-        <li><xsl:apply-templates select="Who|DateCommitted|Modified|Added|Removed|Log"/></li>
-      </xsl:for-each>
-      </ul>
-    </xsl:if>
-    <xsl:if test="count(Commit[@category='core'])=0">
-      <note>This release includes no updates of the non-XSLTC core source code.</note>
-    </xsl:if>
-    <xsl:if test="count(Commit[@category='compat'])>0">
-      <p>Compatibility source code updates:</p>
-      <ul>
-      <xsl:for-each select="Commit[@category='compat']">
-        <li><xsl:apply-templates select="Who|DateCommitted|Modified|Added|Removed|Log"/></li>
-      </xsl:for-each>
-      </ul>
-    </xsl:if>
-    <xsl:if test="count(Commit[@category='compat'])=0">
-      <note>This release includes no updates of the compatibility source code (now deprecated).</note>
-    </xsl:if>
-    <!--xsl:if test="count(Commit[@category='xsltc'])>0">
-      <p>XSLTC source code updates:</p>
-      <ul>
-      <xsl:for-each select="Commit[@category='xsltc']">
-        <li><xsl:apply-templates select="Who|DateCommitted|Modified|Added|Removed|Log"/></li>
-      </xsl:for-each>
-      </ul>
-    </xsl:if>
-    <xsl:if test="count(Commit[@category='xsltc'])=0">
-      <note>This release includes no updates of the XSLTC source code.</note>
-    </xsl:if-->
-  </xsl:template>
-  
-  <xsl:template match="Who">
-    <ref>Committed by </ref><xsl:value-of select="."/>
-  </xsl:template>
-  <xsl:template match="DateCommitted">
-    <ref> on </ref><xsl:value-of select="."/><br/>
-  </xsl:template>    
-  <xsl:template match="Modified">    
-    <ref>Modified: </ref><xsl:value-of select="."/><br/>
-  </xsl:template>    
-  <xsl:template match="Added">    
-    <ref>Added: </ref><xsl:value-of select="."/><br/>
-  </xsl:template>    
-  <xsl:template match="Removed">    
-    <ref>Removed: </ref><xsl:value-of select="."/><br/>
-  </xsl:template>    
-    <xsl:template match="Log">    
-    <ref>Committer's log entry: </ref><xsl:value-of select="."/><br/><br/>
-  </xsl:template>
-  
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/xdocs/style/stylesheets/spec.xsl b/xdocs/style/stylesheets/spec.xsl
deleted file mode 100644
index 26d73bd..0000000
--- a/xdocs/style/stylesheets/spec.xsl
+++ /dev/null
@@ -1,220 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<!DOCTYPE xsl:stylesheet [
-<!ENTITY copy   "&#169;">
-<!ENTITY nbsp   "&#160;">
-]>
-
-<!-- XSL Style sheet, DTD omitted -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:redirect="org.apache.xalan.lib.Redirect"
-                extension-element-prefixes="redirect">
-  <xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>
-  
-  <xsl:param name="package-root" select="'../../../src/'"/>  <!-- root of destination for package.html files -->
-
-  <xsl:template match="spec">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="header/title"/>
-        </title>
-      </head>
-      <body>
-        <xsl:apply-templates/>
-      </body>
-    </html>
-  </xsl:template>
-  
-  <xsl:template match="spec/title[1]">
-    <h1><xsl:apply-templates/></h1>
-  </xsl:template>
-
-  <xsl:template match="frontmatter/pubdate">
-    <p><b>Edit Date: </b><xsl:apply-templates/></p>
-  </xsl:template>
-
-  <xsl:template match="frontmatter/copyright">
-    <!-- p>&copy;<xsl:apply-templates/></p -->
-  </xsl:template>
-
-  <xsl:template match="frontmatter/author">
-  </xsl:template>
-  
-  <xsl:template match="spec/title">
-    <h2>
-      <xsl:choose>
-        <xsl:when test="@id">
-          <a name="@id">
-            <xsl:apply-templates/>
-          </a>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </h2>
-  </xsl:template>
-  
-  <xsl:template name="apply-id-templates">
-    <xsl:choose>
-      <xsl:when test="@id">
-        <a name="{@id}">
-          <xsl:apply-templates/>
-        </a>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="sect2/title | spec/*/title">
-    <h3>
-      <xsl:call-template name="apply-id-templates"/>
-    </h3>
-  </xsl:template>
-  
-  <xsl:template match="sect3/title">
-    <h4>
-      <xsl:call-template name="apply-id-templates"/>
-    </h4>
-  </xsl:template>
-
-  <xsl:template match="sect4/title">
-    <h5>
-      <xsl:call-template name="apply-id-templates"/>
-    </h5>
-  </xsl:template>
-  
-  <xsl:template match="para">
-    <p><xsl:apply-templates/></p>
-  </xsl:template>
-
-  <xsl:template match="variablelist">
-    <ul>
-    <xsl:for-each select="varlistentry">
-      <li>
-        <p><b><xsl:apply-templates select="term"/></b><br/>
-        <xsl:apply-templates select="listitem"/></p>
-      </li>
-    </xsl:for-each>
-    </ul>
-  </xsl:template>
-
-  <xsl:template match="orderedlist">
-    <ol>
-    <xsl:for-each select="listitem">
-      <li><xsl:apply-templates/></li>
-    </xsl:for-each>
-    </ol>
-  </xsl:template>
-
-  <xsl:template match="patterns">
-    <H3><xsl:value-of select="@module"/><xsl:text> </xsl:text>Patterns</H3>
-    <ul>
-      <xsl:for-each select="pattern">
-        <p>
-          <b>
-            <xsl:for-each select="pattern-name">
-              <xsl:call-template name="apply-id-templates"/>
-            </xsl:for-each>
-          </b>
-          <br/>
-        <xsl:apply-templates select="*[name() != 'pattern-name']"/></p>
-      </xsl:for-each>
-    </ul>
-  </xsl:template>
-  
-  <xsl:template match="pattern/intent">
-    <br/><i>Intent: </i><xsl:apply-templates/>
-  </xsl:template>
-  
-  <xsl:template match="pattern/responsibilities">
-    <br/><i>Responsibilities: </i><xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="pattern/potential-alternate-name">
-    <br/><i>Potential alternate name: </i><xsl:apply-templates/>
-  </xsl:template>
-  
-  <xsl:template match="pattern/thread-safety">
-    <br/><i>Thread safety: </i><xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="pattern/notes">
-    <br/><i>Notes: </i><xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="programlisting">
-    <code>
-    <pre>
-      <xsl:apply-templates/>
-    </pre>
-    </code>
-  </xsl:template>
-  
-  <xsl:template match="link">
-    <A href="#{@linkend}">
-      <xsl:apply-templates/>
-    </A>
-  </xsl:template>
-  <xsl:template match="ulink">
-    <A href="{@url}">
-      <xsl:apply-templates/>
-    </A>
-  </xsl:template>
-
-  <xsl:template match="termref">
-    <xsl:choose>
-      <xsl:when test="@link-url">
-        <A href="#{@link-url}">
-          <xsl:value-of select="."/>
-        </A>
-      </xsl:when>
-      <xsl:otherwise>
-        <U><xsl:value-of select="."/></U>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="plink">
-    <xsl:text>{@link </xsl:text>
-      <xsl:value-of select="."/>
-    <xsl:text>}</xsl:text>
-  </xsl:template>
-  
-  <xsl:template match="sect1[@id='package']">
-    <xsl:variable name="filename" select="concat($package-root,translate(title,'.', '/'),'/package.html')"/>
-    <redirect:write file="{$filename}">
-      <xsl:call-template name="sub-package"/>
-    </redirect:write>
-  </xsl:template>
-  
-  <xsl:template match="sect2[@id='specialized-packages']">
-    <xsl:message>Found specialized-packages</xsl:message>
-    <xsl:for-each select="sect3">
-	  <xsl:variable name="filename" select="concat($package-root,translate(title,'.', '/'),'/package.html')"/>
-      <redirect:write file="{$filename}">
-        <xsl:call-template name="sub-package"/>
-      </redirect:write>
-    </xsl:for-each>
-  </xsl:template>
-  
-  <xsl:template name="sub-package">
-    <html>
-       <head>
-         <title>
-           <xsl:value-of select="title"/>
-         </title>
-       </head>
-       <body>
-         <xsl:apply-templates select="*[not (name()='title')]"/>
-       </body>
-     </html>
-  </xsl:template>
-
-
-</xsl:stylesheet>
-
diff --git a/xdocs/style/stylesheets/xml2fo.xsl b/xdocs/style/stylesheets/xml2fo.xsl
deleted file mode 100644
index c05930d..0000000
--- a/xdocs/style/stylesheets/xml2fo.xsl
+++ /dev/null
@@ -1,489 +0,0 @@
-<?xml version="1.0"?>
-
-<!--    XSLT stylesheet to convert the Xalan documentation collected in one xml file into a fo file
-        for use in FOP 
-
-TBD: - The faq doesn't show in the content
-     - check why margin-bottom on the page with properties is too large
-     - check why keep-next not only doesn't work, but leads to repeating already printed lines
-     - make lines containing only code look nicer (smaller line height)
-     - replace bullets in ordered lists with numbers
-     - correct the hack replacing nbsp with '-'
-     - handle the links correctly which have been external in the html doc and are now internal
-
--->
-
-<xsl:stylesheet
-     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
-     xmlns:fo="http://www.w3.org/1999/XSL/Format">
-     
-     <!-- to use with document() to get resources.xml -->
-    <xsl:param name="resourceFile" select="'../../sources/xalan/resources.xml'"/>
-    <xsl:param name="project" select="Xalan"/>
-              
-<xsl:template match ="/">
-	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
-
-	  <!-- defines page layout -->
-	  <fo:layout-master-set>
-		<fo:simple-page-master master-name="simple"
-							   page-height="29.7cm" 
-							   page-width="21cm"
-							   margin-top="1.5cm" 
-							   margin-bottom="2cm" 
-							   margin-left="2.5cm" 
-							   margin-right="2.5cm">
-		  <fo:region-body margin-top="3cm"/>
-		  <fo:region-before extent="1.5cm"/>
-		  <fo:region-after extent="1.5cm"/>
-		</fo:simple-page-master>
-	  </fo:layout-master-set>
-
-	  <fo:page-sequence master-name="simple">
-		<fo:static-content flow-name="xsl-region-before">
-			<fo:block text-align="end" 
-			    	  font-size="10pt" 
-					  font-family="serif" 
-					  line-height="14pt" >
-				<xsl:value-of select="$project"/> documentation - p. <fo:page-number/>
-			</fo:block>
-		</fo:static-content> 
-
-		<fo:flow flow-name="xsl-region-body">
-
-          <fo:block font-size="18pt" 
-                    font-family="sans-serif" 
-                    line-height="24pt"
-                    space-after.optimum="15pt"
-                    background-color="blue"
-                    color="white"
-                    text-align="center">
-            <xsl:value-of select="$project"/> - an XSL Transformer
-          </fo:block>
-
-
-        <!-- generates table of contents and puts it into a table -->
-
-         <fo:block font-size="14pt" 
-                  font-family="sans-serif" 
-                  line-height="18pt"
-                  space-after.optimum="10pt"
-                  font-weight="bold"
-                  start-indent="15pt">
-            Content
-         </fo:block>
-
-         <fo:table>
-            <fo:table-column column-width="1cm"/>
-            <fo:table-column column-width="10cm"/>
-            <fo:table-column column-width="5cm"/>
-            <fo:table-body font-size="12pt" 
-                           line-height="16pt"
-                           font-family="sans-serif">
-              <fo:table-row>
-                  <fo:table-cell>
-                     <fo:block text-align="end" >
-                     </fo:block>
-                  </fo:table-cell>
-                  <fo:table-cell>
-                     <fo:block text-align="end" >
-                     </fo:block>
-                  </fo:table-cell>
-                  <fo:table-cell>
-                     <fo:block text-align="end" >
-                     page
-                     </fo:block>
-                  </fo:table-cell>
-              </fo:table-row>                                 
-              <xsl:for-each select="documentation/chapter"> 
-                <fo:table-row>
-                  <fo:table-cell>
-                     <fo:block text-align="end" >
-                        <xsl:number value="position()" format="I"/>.  
-                     </fo:block>
-                  </fo:table-cell>
-                  <fo:table-cell>
-                     <fo:block  text-align="start" >
-                        <fo:basic-link color="blue">
-                           <xsl:attribute name="internal-destination">
-                           <xsl:value-of select="@id"/>
-                           </xsl:attribute>
-                          <xsl:value-of select="s1/@title|faqs/@title"/>
-                        </fo:basic-link>
-                     </fo:block>
-                  </fo:table-cell>
-                  <fo:table-cell>
-                     <fo:block text-align="end">                                
-                       <fo:page-number-citation ref-id="{@id}"/>
-                     </fo:block>
-                  </fo:table-cell>
-               </fo:table-row>
-            </xsl:for-each>
-            </fo:table-body>
-         </fo:table>
-		 <xsl:apply-templates/> 
-	   </fo:flow>
-	   </fo:page-sequence>
-	</fo:root>
-</xsl:template>
-
-<!--chapter-->
-<xsl:template match="chapter">
-  <fo:block id="{@id}" break-before="page"/>
-	<xsl:apply-templates/>   
-</xsl:template>  
-
-<!-- s1 -->
-<xsl:template match ="s1">
-   <fo:block font-size="18pt" 
-            font-family="sans-serif" 
-            line-height="24pt"
-            space-before.optimum="15pt"
-            space-after.optimum="15pt"
-            background-color="blue"
-            color="white"
-            keep-with-next.within-page="always"
-            text-align="center">
-     <xsl:attribute name="id">
-     <xsl:value-of select="translate(@title,' ),-.(','____')"/>
-     </xsl:attribute>
-     <xsl:value-of select="@title"/>
-   </fo:block>
-    <xsl:apply-templates/> 
-</xsl:template>
-
-<!-- s2 -->
-<xsl:template match ="s2">
-   <fo:block font-size="16pt" 
-            font-family="sans-serif" 
-            line-height="20pt"
-            keep-with-next.within-page="always"            
-            space-before.optimum="15pt"
-            space-after.optimum="12pt"
-            text-align="start"
-            padding-top="3pt"
-            >
-     <xsl:value-of select="@title"/>
-   </fo:block>
-    <xsl:apply-templates/> 
-</xsl:template>
-
-<!-- s3 -->
-<xsl:template match ="s3">
-   <fo:block font-size="14pt" 
-            font-family="sans-serif" 
-            line-height="18pt"
-            keep-with-next.within-page="always"
-            space-before.optimum="10pt"
-            space-after.optimum="9pt"
-            text-align="start"
-            padding-top="3pt">
-     <xsl:value-of select="@title"/>
-   </fo:block>
-    <xsl:apply-templates/> 
-</xsl:template>
-
-<!-- p  [not(code)] -->
-<xsl:template match ="p"> 
-   <fo:block font-size="11pt" 
-            font-family="sans-serif" 
-            line-height="13pt"
-            space-after.optimum="3pt"
-            space-before.optimum="3pt"
-            text-align="start">
-     <xsl:apply-templates/> 
-   </fo:block>
-</xsl:template>
-
-<xsl:template match ="note"> 
-   <fo:block font-size="11pt" 
-            font-family="sans-serif" 
-            font-weight="italic"
-            line-height="13pt"
-            space-after.optimum="3pt"
-            space-before.optimum="3pt"
-            text-align="start">
-        Note:     
-     <xsl:apply-templates/> 
-   </fo:block>
-</xsl:template>
-
-<xsl:template match="anchor">
-  <fo:block> <!--id="concat(local-name(ancestor::node()="chapter"/@id.,'_',{./@name}"/-->
-    <xsl:attribute name="id">
-      <xsl:value-of select="concat(ancestor::chapter/@id,'_',./@name)"/>
-    </xsl:attribute>
-  </fo:block>    
-</xsl:template>
-
-<xsl:template match="table">
-  <xsl:variable name="colwidth" select="14.5 div count(tr[1]/td)"/>
-  <fo:table>
-  <xsl:for-each select="tr[1]/td">
-    <fo:table-column column-width="{$colwidth}cm"/>
-  </xsl:for-each>
-  <fo:table-body font-size="10pt" font-family="sans-serif">
-  <xsl:apply-templates/>
-  </fo:table-body>
-  </fo:table>  
-</xsl:template>  
-<xsl:template match="tr">
-  <fo:table-row>
-    <xsl:apply-templates/>
-  </fo:table-row>
-</xsl:template>
-<xsl:template match="td">
-  <fo:table-cell>
-    <fo:block>
-      <xsl:apply-templates/>
-    </fo:block>
-   </fo:table-cell>
-</xsl:template>
-
-<!-- p + code 
-<xsl:template match ="p[code]">
-   <fo:block font-size="11pt" 
-            font-family="sans-serif" 
-            line-height="11pt"
-            space-after.optimum="0pt"
-            space-before.optimum="0pt"
-            text-align="start">
-     <xsl:apply-templates/> 
-   </fo:block>
-</xsl:template>
--->
-
-<xsl:template match="img">
-  <fo:block>
-    <fo:external-graphic src="file:build/docs/images/{@src}"/>
-  </fo:block>
-</xsl:template>
-
-<!-- faqs -->
-<xsl:template match ="faqs">
-   <fo:block font-size="18pt" 
-            font-family="sans-serif" 
-            line-height="24pt"
-            space-before.optimum="15pt"
-            space-after.optimum="15pt"
-            background-color="blue"
-            color="white"
-            text-align="center"
-            >
-     <xsl:attribute name="id">
-     <xsl:value-of select="translate(.,' ),-.(','____')"/>
-     </xsl:attribute>
-     <xsl:value-of select="@title"/>
-   </fo:block>
-    <xsl:apply-templates/> 
-</xsl:template>
-
-<!-- faq -->
-<xsl:template match ="faq">
-    <xsl:apply-templates/> 
-</xsl:template>
-
-<!-- q in faq -->
-<xsl:template match="q">
-   <fo:block font-size="14pt" 
-            font-family="sans-serif" 
-            line-height="18pt"
-            keep-with-next.within-page="always"
-            space-before.optimum="10pt"
-            space-after.optimum="9pt"
-            text-align="start"
-            padding-top="3pt">     
-      <xsl:apply-templates/> 
-    </fo:block>
-</xsl:template>
-
-<!-- a in faq -->
-<xsl:template match ="a">
-      <xsl:apply-templates/> 
-</xsl:template>
-
-
-<!-- jump (links) -->
-<xsl:template match ="jump">
-  <fo:basic-link color="blue">
-     <xsl:attribute name="external-destination">
-       <xsl:if test="starts-with(@href,'apidocs')">
-         <xsl:value-of select="concat('http://xml.apache.org/xalan-j/',@href)"/>
-       </xsl:if>
-       <xsl:if test="not(starts-with(@href,'apidocs'))">
-         <xsl:value-of select="@href"/>
-       </xsl:if>    
-     </xsl:attribute>  
-   <xsl:value-of select="./text()"/>
-     <!--xsl:apply-templates/--> 
-   </fo:basic-link>
-</xsl:template>
-
-  <xsl:template match="link">
-    <xsl:if test="string-length(@anchor)=0">
-      <xsl:if test="string-length(@idref)=0">
-        <xsl:apply-templates/>
-      </xsl:if>
-      <xsl:if test="string-length(@idref)>0">
-        <fo:basic-link color="blue" internal-destination="{@idref}">
-        <xsl:value-of select="./text()"/></fo:basic-link>
-      </xsl:if>
-    </xsl:if>
-
-    <xsl:if test="string-length(@anchor)>0">
-      <xsl:if test="string-length(@idref)=0">
-        <fo:basic-link color="blue"
-                      internal-destination="{concat(ancestor::chapter/@id,'_',@anchor)}">
-        <xsl:value-of select="./text()"/></fo:basic-link>
-      </xsl:if>
-      <xsl:if test="string-length(@idref)>0">
-        <fo:basic-link color="blue" internal-destination="{@idref}_{@anchor}">
-        <xsl:value-of select="./text()"/></fo:basic-link>
-      </xsl:if>
-    </xsl:if>
-  </xsl:template>
-
-
-<xsl:template match="resource-ref">
-  <xsl:variable name="xref" select="@idref"/>
-  <xsl:variable name="href"
-          select="document($resourceFile)/resources/resource[@id=$xref]/@location"/>
-  <xsl:variable name="label"
-          select="document($resourceFile)/resources/resource[@id=$xref]/@title"/>
-  <fo:basic-link color="blue">
-     <xsl:attribute name="external-destination">
-       <xsl:if test="starts-with($href,'apidocs')">
-         <xsl:value-of select="concat('http://xml.apache.org/xalan-j/',$href)"/>
-       </xsl:if>
-       <xsl:if test="not(starts-with($href,'apidocs'))">
-         <xsl:value-of select="$href"/>
-       </xsl:if>    
-     </xsl:attribute>  
-     <xsl:value-of select="$label"/>
-     <!--xsl:apply-templates/--> 
-   </fo:basic-link>        
-  </xsl:template>
-
-  <xsl:template match="human-resource-ref">
-    <xsl:variable name="resourceFile" 
-          select="./xalan/resources.xml"/>  
-    <xsl:variable name="ref"  select="@idref"/>
-    <xsl:variable name="mailto"
-          select="document($resourceFile)/resources/human-resource[@id=$ref]/@mailto"/>
-    <xsl:variable name="name"
-          select="document($resourceFile)/resources/human-resource[@id=$ref]/@name"/>
-  <fo:basic-link color="blue" external-destination="mailto:{$mailto}">
-     <xsl:value-of select="$name"/>
-     <!--xsl:apply-templates/--> 
-   </fo:basic-link>          
-  </xsl:template>
-
-<xsl:template match ="source"> 
-   <fo:block font-size="10pt" 
-            font-family="Courier" 
-            text-align="start"
-            white-space-collapse="false">
-     <xsl:apply-templates/> 
-   </fo:block>
-
-</xsl:template>
-  <xsl:template match ="br">
-  <fo:block></fo:block>
-</xsl:template>
-
-<!-- code -->
-<xsl:template match ="*/code">
-   <fo:inline font-size="10pt" 
-            font-family="Courier">
-     <xsl:apply-templates/> 
-   </fo:inline>
-</xsl:template>
-
-<!-- ul (unordered list) -->
-<xsl:template match ="ul">
-  <fo:list-block start-indent="1cm" 
-                 provisional-distance-between-starts="12pt" 
-                 font-family="sans-serif" 
-                 font-size="11pt" 
-                 line-height="11pt">
-     <xsl:apply-templates/> 
-   </fo:list-block>
-</xsl:template>         
-          
-<!-- ol (ordered list) -->
-<xsl:template match ="ol">
-  <fo:list-block start-indent="1cm" 
-                 provisional-distance-between-starts="12pt" 
-                 font-family="sans-serif" 
-                 font-size="11pt" 
-                 line-height="11pt">
-     <xsl:apply-templates/> 
-   </fo:list-block>
-</xsl:template>
-
-
-<!-- li (list item) in unordered list -->
-<xsl:template match ="ul/li">
-    <fo:list-item>
-      <fo:list-item-label>
-        <fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
-      </fo:list-item-label>
-      <fo:list-item-body>
-        <fo:block space-after.optimum="4pt"
-              text-align="start"
-              padding-top="3pt">
-          <xsl:apply-templates/> 
-       </fo:block>
-      </fo:list-item-body>
-    </fo:list-item>
-</xsl:template>
-
-<!-- li (list item) in ordered list -->
-<xsl:template match ="ol/li">
-    <fo:list-item>
-      <fo:list-item-label>
-        <fo:block>
-          <xsl:number level="multiple" count="li" format="1"/>)
-        </fo:block>
-      </fo:list-item-label>
-      <fo:list-item-body>
-        <fo:block space-after.optimum="4pt"
-              text-align="start"
-              padding-top="3pt">
-          <xsl:apply-templates/> 
-       </fo:block>
-      </fo:list-item-body>
-    </fo:list-item>
-</xsl:template>
-
-<!-- temporary kludge for definition list gloss with label-item pairs ) -->
-
-<xsl:template match="gloss">
-  <xsl:apply-templates/>
-</xsl:template>
-<xsl:template match="label">
-   <fo:block font-size="11pt" 
-            font-family="sans-serif" 
-            line-height="13pt"
-            space-after.optimum="3pt"
-            space-before.optimum="6pt"
-            text-align="start">
-     <xsl:apply-templates/> 
-   </fo:block>
-</xsl:template> 
-<xsl:template match="item">
-   <fo:block font-size="11pt" 
-            font-family="sans-serif" 
-            line-height="13pt"
-            space-after.optimum="6pt"
-            space-before.optimum="0pt"
-            margin-left="24pt"
-            text-align="start">
-     <xsl:apply-templates/>
-     <fo:block></fo:block> 
-   </fo:block>
-</xsl:template> 
-
-<!-- end body -->
-
-</xsl:stylesheet>
diff --git a/xdocs/xml-site-style.tar.gz b/xdocs/xml-site-style.tar.gz
deleted file mode 100644
index f477a84..0000000
--- a/xdocs/xml-site-style.tar.gz
+++ /dev/null
Binary files differ
diff --git a/xsltc_todo.xml b/xsltc_todo.xml
deleted file mode 100644
index 7448f93..0000000
--- a/xsltc_todo.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0"?>
-
-<todo title="Things To Do" project="XSLTC" major-version="1">
-
-  <devs>
-   <person name="Jacek Ambroziak" email="jacek_ambroziak@yahoo.com" id="JA" expertise="code">
-     Inventor, architect, former lead developer and evangelist.
-   </person>  
-   <person name="Tom Amiro" email="Tom.Amiro@Sun.COM" id="TA" expertise="testing">
-     Testing.
-   </person>  
-   <person name="Morten J&#216;rgensen" email="morten@xml.apache.org" id="MJ" expertise="code, doc">
-     Lead developer - key contributor on design documentation, ID/Keys, performance, JAXP, and continuing development in general.
-   </person>
-   <person name="G. Todd Miller" email="Glenn.Miller@Sun.COM" id="TM" expertise="code">
-     Developer - key contributor on TrAX.
-   </person>
-   <person name="Santiago Pericas-Geertsen" email="santiago@cs.bu.edu" id="SP" expertise="code">
-     Developer - key contributor on compilation strategy.
-   </person>
-  </devs>
- 
-  <actions>
-
-   <target-release-description>
-    <date>09/??/01</date>
-    <level>????</level>
-    <goal type="conformance">XSLT 1.0 compliant 100%.</goal>
-    <goal type="performance">Maintain current level.</goal>
-    <goal type="stability"> Stable, reasonable.</goal>
-    <goal type="api">API Complete.</goal>
-    <goal type="documentation">Documentation functionally complete.</goal>
-   </target-release-description>
-   
-  <action context="test, packages:org.apache.xalan.xsltc"
-          category="tests"
-          who="TA, Shane"
-          priority="high">
-     Modify Xalan test enviroment to test XSLTC as a component of XalanJ2.
-   </action>       
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="feature"
-          who="MJ"
-          priority="high">
-       Finish the implementation of id() and key() in patterns.   
-   </action>       
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bug"
-          who="??"
-          priority="high">
-      Continue to improve the handling of name spaces. There are a number of
-      bugs that are independent of the lack of namespace nodes.  
-     (bugzilla 1411, 1506, 1518, 2582, 2801, 2857, 2859, 2863, 2535, 2954, 2840)    
-   </action>       
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bug"
-          who="??"
-          priority="high">
-    Fix bugs that impact the XSLTMark performance benchmark.
-    (bugzilla 1376, 1498, 1512, 1532, 2351, 2517, 2553, 3065, 3066).          
-   </action>
-        
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bugs"
-          who="TM"
-          priority="high">
-       Fix bugs reflecting positional problems (1410, 1532, 2939).          
-   </action>
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bug"
-          who="TM"
-          priority="high">
-      Fix bugs on dealing with XPATH/Axes expressions (1498, 2551, 2553, 2572, 2932).          
-   </action>       
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bug"
-          who="??"
-          priority="medium">
-      Fix bugs involving template selection (1397, 2749, 2582, 2585, 2695, 2749, 2754, 2886, 2937).
-   </action>
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bug"
-          who="??"
-          priority="medium">
-      Fix bugs affecting numbering (2901, 2931).
-   </action>
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="bug"
-          who="??"
-          priority="medium">
-      Fix bugs affecting comment and processing-intruction nodes (2599, 2834, 2858).
-   </action>
-
-  <action context="code, packages:org.apache.xalan.xsltc"
-          category="feature"
-          who="MJ"
-          priority="low">
-     Implement name space nodes (bugzilla 1379).
-   </action>       
-
-  <action context="code, packages:????"
-          category="feature, integration with Xalan"
-          who="??"
-          priority="medium">
-      Implement an extension to support the redirection of output to multiple
-      output files from within a stylesheet (equivalent to xalan:redirect or
-      saxon:output).  Note: Task may be implemented as a result of integrating Xsltc and Xalan 
-     and using shared code.
-   </action>       
-
-
-  <action context="code, packages:????"
-          category="feature, integration with Xalan"
-          who="??"
-          priority="medium">
-     Implement a node-set extension to convert result tree fragments to
-     node-sets. This enables sorting and grouping of nodes assigned to a tree 
-     variable. Note: Task may be implemented as a result of integrating Xsltc and Xalan 
-     and using shared code.
-   </action>       
-
-
-  <action context="code, packages:????"
-          category="feature, integration with Xalan"
-          who="??"
-          priority="medium">
-      Add support for nonstatic external Java functions.  
-      Note: Task may be implemented as a result of integrating Xsltc and Xalan 
-      and using shared code.
-   </action>       
-
-
-  <action context="code, packages:????"
-          category="feature, integration with Xalan"
-          who="??"
-          priority="medium">
-    Fix bugs affecting the correctness of ouput 
-    (1439, 1504, 1512, 1516, 1520, 1525, 2517, 2520, 2578, 2948, 2951, 2952, 2954, 3005, 3065).
-     Note: Task may be implemented as a result of integrating Xsltc and Xalan 
-     and using shared code.
-   </action>       
-
-  <action context="code, AST"
-          category="architecture"
-          who="??"
-          priority="medium">
-    Use SAX to build the AST. The DOM builder
-   (the real DOM builder, not our quasi-DOM builder) receives SAX
-   events when it builds the DOM. The compiler.Parser class could
-   possible receive these SAX events directly, and thereby eliminating
-   the need for a DOM (saves loads of time and memory).
-   </action>
-   
-   <action context="code, DOM"
-           category="architecture"
-           who="??"
-           priority="medium">
-      Consider building a DOM-2-'DOM' converter, perhaps by adding 
-      a second DOM builder inner class to our DOM. Then we would have 
-      one SAX DOM builder and one DOM DOM builder. I don't know if
-      JAXP lets you supply the stylesheet as a DOM. If it doesn't, 
-      we should assign this task a very low priority. There is no
-      point in spending a lot of time on this if JAXP users will 
-      never be able to use this functionality.
-    </action>       
-
-  </actions>
-</todo>